openapi

package
v0.0.0-...-e041b52 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 6 Imported by: 0

README

Go API client for openapi

This is the public Twilio REST API.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/twilio-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.52.1
  • Package version: 1.0.0
  • Build package: com.twilio.oai.TwilioGoGenerator For more information, please visit https://support.twilio.com

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./openapi"

Documentation for API Endpoints

All URIs are relative to https://content.twilio.com

Class Method HTTP request Description
ContentApi DeleteContent Delete /v1/Content/{Sid}
ContentApi FetchContent Get /v1/Content/{Sid}
ContentApi ListContent Get /v1/Content
ContentAndApprovalsApi ListContentAndApprovals Get /v1/ContentAndApprovals
ContentApprovalRequestsApi FetchApprovalFetch Get /v1/Content/{Sid}/ApprovalRequests
LegacyContentApi ListLegacyContent Get /v1/LegacyContent

Documentation For Models

Documentation For Authorization

accountSid_authToken

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService

func (*ApiService) DeleteContent

func (c *ApiService) DeleteContent(Sid string) error

Deletes a Content resource

func (*ApiService) FetchApprovalFetch

func (c *ApiService) FetchApprovalFetch(Sid string) (*ContentV1ApprovalFetch, error)

Fetch a Content resource's approval status by its unique Content Sid

func (*ApiService) FetchContent

func (c *ApiService) FetchContent(Sid string) (*ContentV1Content, error)

Fetch a Content resource by its unique Content Sid

func (*ApiService) ListContent

func (c *ApiService) ListContent(params *ListContentParams) ([]ContentV1Content, error)

Lists Content records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) ListContentAndApprovals

func (c *ApiService) ListContentAndApprovals(params *ListContentAndApprovalsParams) ([]ContentV1ContentAndApprovals, error)

Lists ContentAndApprovals records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) ListLegacyContent

func (c *ApiService) ListLegacyContent(params *ListLegacyContentParams) ([]ContentV1LegacyContent, error)

Lists LegacyContent records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.

func (*ApiService) PageContent

func (c *ApiService) PageContent(params *ListContentParams, pageToken, pageNumber string) (*ListContentResponse, error)

Retrieve a single page of Content records from the API. Request is executed immediately.

func (*ApiService) PageContentAndApprovals

func (c *ApiService) PageContentAndApprovals(params *ListContentAndApprovalsParams, pageToken, pageNumber string) (*ListContentAndApprovalsResponse, error)

Retrieve a single page of ContentAndApprovals records from the API. Request is executed immediately.

func (*ApiService) PageLegacyContent

func (c *ApiService) PageLegacyContent(params *ListLegacyContentParams, pageToken, pageNumber string) (*ListLegacyContentResponse, error)

Retrieve a single page of LegacyContent records from the API. Request is executed immediately.

func (*ApiService) StreamContent

func (c *ApiService) StreamContent(params *ListContentParams) (chan ContentV1Content, chan error)

Streams Content records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

func (*ApiService) StreamContentAndApprovals

func (c *ApiService) StreamContentAndApprovals(params *ListContentAndApprovalsParams) (chan ContentV1ContentAndApprovals, chan error)

Streams ContentAndApprovals records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

func (*ApiService) StreamLegacyContent

func (c *ApiService) StreamLegacyContent(params *ListLegacyContentParams) (chan ContentV1LegacyContent, chan error)

Streams LegacyContent records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.

type ContentV1ApprovalFetch

type ContentV1ApprovalFetch struct {
	// The unique string that that we created to identify the Content resource.
	Sid *string `json:"sid,omitempty"`
	// The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource.
	AccountSid *string `json:"account_sid,omitempty"`
	// Contains the whatsapp approval information for the Content resource, with fields such as approval status, rejection reason, and category, amongst others.
	Whatsapp *interface{} `json:"whatsapp,omitempty"`
	// The URL of the resource, relative to `https://content.twilio.com`.
	Url *string `json:"url,omitempty"`
}

ContentV1ApprovalFetch struct for ContentV1ApprovalFetch

type ContentV1Content

type ContentV1Content struct {
	// The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The unique string that that we created to identify the Content resource.
	Sid *string `json:"sid,omitempty"`
	// The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource.
	AccountSid *string `json:"account_sid,omitempty"`
	// A string name used to describe the Content resource. Not visible to the end recipient.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.
	Language *string `json:"language,omitempty"`
	// Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}.
	Variables *interface{} `json:"variables,omitempty"`
	// The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
	Types *interface{} `json:"types,omitempty"`
	// The URL of the resource, relative to `https://content.twilio.com`.
	Url *string `json:"url,omitempty"`
	// A list of links related to the Content resource, such as approval_fetch and approval_create
	Links *map[string]interface{} `json:"links,omitempty"`
}

ContentV1Content struct for ContentV1Content

type ContentV1ContentAndApprovals

type ContentV1ContentAndApprovals struct {
	// The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The unique string that that we created to identify the Content resource.
	Sid *string `json:"sid,omitempty"`
	// The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource.
	AccountSid *string `json:"account_sid,omitempty"`
	// A string name used to describe the Content resource. Not visible to the end recipient.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.
	Language *string `json:"language,omitempty"`
	// Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}.
	Variables *interface{} `json:"variables,omitempty"`
	// The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
	Types *interface{} `json:"types,omitempty"`
	// The submitted information and approval request status of the Content resource.
	ApprovalRequests *interface{} `json:"approval_requests,omitempty"`
}

ContentV1ContentAndApprovals struct for ContentV1ContentAndApprovals

type ContentV1LegacyContent

type ContentV1LegacyContent struct {
	// The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The unique string that that we created to identify the Content resource.
	Sid *string `json:"sid,omitempty"`
	// The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource.
	AccountSid *string `json:"account_sid,omitempty"`
	// A string name used to describe the Content resource. Not visible to the end recipient.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.
	Language *string `json:"language,omitempty"`
	// Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}.
	Variables *interface{} `json:"variables,omitempty"`
	// The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
	Types *interface{} `json:"types,omitempty"`
	// The string name of the legacy content template associated with this Content resource, unique across all template names for its account.  Only lowercase letters, numbers and underscores are allowed
	LegacyTemplateName *string `json:"legacy_template_name,omitempty"`
	// The string body field of the legacy content template associated with this Content resource
	LegacyBody *string `json:"legacy_body,omitempty"`
	// The URL of the resource, relative to `https://content.twilio.com`.
	Url *string `json:"url,omitempty"`
}

ContentV1LegacyContent struct for ContentV1LegacyContent

type ListContentAndApprovalsParams

type ListContentAndApprovalsParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListContentAndApprovals'

func (*ListContentAndApprovalsParams) SetLimit

func (*ListContentAndApprovalsParams) SetPageSize

func (params *ListContentAndApprovalsParams) SetPageSize(PageSize int) *ListContentAndApprovalsParams

type ListContentAndApprovalsResponse

type ListContentAndApprovalsResponse struct {
	Contents []ContentV1ContentAndApprovals `json:"contents,omitempty"`
	Meta     ListContentResponseMeta        `json:"meta,omitempty"`
}

ListContentAndApprovalsResponse struct for ListContentAndApprovalsResponse

type ListContentParams

type ListContentParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListContent'

func (*ListContentParams) SetLimit

func (params *ListContentParams) SetLimit(Limit int) *ListContentParams

func (*ListContentParams) SetPageSize

func (params *ListContentParams) SetPageSize(PageSize int) *ListContentParams

type ListContentResponse

type ListContentResponse struct {
	Contents []ContentV1Content      `json:"contents,omitempty"`
	Meta     ListContentResponseMeta `json:"meta,omitempty"`
}

ListContentResponse struct for ListContentResponse

type ListContentResponseMeta

type ListContentResponseMeta struct {
	FirstPageUrl    string  `json:"first_page_url,omitempty"`
	NextPageUrl     *string `json:"next_page_url,omitempty"`
	Page            int     `json:"page,omitempty"`
	PageSize        int     `json:"page_size,omitempty"`
	PreviousPageUrl *string `json:"previous_page_url,omitempty"`
	Url             string  `json:"url,omitempty"`
	Key             string  `json:"key,omitempty"`
}

ListContentResponseMeta struct for ListContentResponseMeta

type ListLegacyContentParams

type ListLegacyContentParams struct {
	// How many resources to return in each list page. The default is 50, and the maximum is 1000.
	PageSize *int `json:"PageSize,omitempty"`
	// Max number of records to return.
	Limit *int `json:"limit,omitempty"`
}

Optional parameters for the method 'ListLegacyContent'

func (*ListLegacyContentParams) SetLimit

func (params *ListLegacyContentParams) SetLimit(Limit int) *ListLegacyContentParams

func (*ListLegacyContentParams) SetPageSize

func (params *ListLegacyContentParams) SetPageSize(PageSize int) *ListLegacyContentParams

type ListLegacyContentResponse

type ListLegacyContentResponse struct {
	Contents []ContentV1LegacyContent `json:"contents,omitempty"`
	Meta     ListContentResponseMeta  `json:"meta,omitempty"`
}

ListLegacyContentResponse struct for ListLegacyContentResponse

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL