openapi

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 7 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.1.0
  • 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 CreateContent Post /v1/Content Create Content
ContentApi DeleteContent Delete /v1/Content/{Sid} Delete Content
ContentApi FetchContent Get /v1/Content/{Sid} Fetch Content
ContentApi ListContent Get /v1/Content List Contents
ContentApi UpdateContent Put /v1/Content/{Sid} Update Content
ContentAndApprovalsApi ListContentAndApprovals Get /v1/ContentAndApprovals List Content Approvals
ContentApprovalRequestsApi FetchApprovalFetch Get /v1/Content/{Sid}/ApprovalRequests Fetch Approval Status
ContentApprovalRequestsWhatsappApi CreateApprovalCreate Post /v1/Content/{ContentSid}/ApprovalRequests/whatsapp Create Content Approval Request
LegacyContentApi ListLegacyContent Get /v1/LegacyContent List Legacy Contents

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) CreateApprovalCreate

func (c *ApiService) CreateApprovalCreate(ContentSid string, params *CreateApprovalCreateParams) (*ContentV1ApprovalCreate, error)

Create a ContentApprovalRequest for a content item

func (*ApiService) CreateApprovalCreateWithMetadata

func (c *ApiService) CreateApprovalCreateWithMetadata(ContentSid string, params *CreateApprovalCreateParams) (*metadata.ResourceMetadata[ContentV1ApprovalCreate], error)

CreateApprovalCreateWithMetadata returns response with metadata like status code and response headers

func (*ApiService) CreateContent

func (c *ApiService) CreateContent(params *CreateContentParams) (*ContentV1Content, error)

Create a Content resource

func (*ApiService) CreateContentWithMetadata

func (c *ApiService) CreateContentWithMetadata(params *CreateContentParams) (*metadata.ResourceMetadata[ContentV1Content], error)

CreateContentWithMetadata returns response with metadata like status code and response headers

func (*ApiService) DeleteContent

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

Deletes a Content resource

func (*ApiService) DeleteContentWithMetadata

func (c *ApiService) DeleteContentWithMetadata(Sid string) (*metadata.ResourceMetadata[bool], error)

DeleteContentWithMetadata returns response with metadata like status code and response headers

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) FetchApprovalFetchWithMetadata

func (c *ApiService) FetchApprovalFetchWithMetadata(Sid string) (*metadata.ResourceMetadata[ContentV1ApprovalFetch], error)

FetchApprovalFetchWithMetadata returns response with metadata like status code and response headers

func (*ApiService) FetchContent

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

Fetch a Content resource by its unique Content Sid

func (*ApiService) FetchContentWithMetadata

func (c *ApiService) FetchContentWithMetadata(Sid string) (*metadata.ResourceMetadata[ContentV1Content], error)

FetchContentWithMetadata returns response with metadata like status code and response headers

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) ListContentAndApprovalsWithMetadata

func (c *ApiService) ListContentAndApprovalsWithMetadata(params *ListContentAndApprovalsParams) (*metadata.ResourceMetadata[[]ContentV1ContentAndApprovals], error)

ListContentAndApprovalsWithMetadata returns response with metadata like status code and response headers

func (*ApiService) ListContentWithMetadata

func (c *ApiService) ListContentWithMetadata(params *ListContentParams) (*metadata.ResourceMetadata[[]ContentV1Content], error)

ListContentWithMetadata returns response with metadata like status code and response headers

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) ListLegacyContentWithMetadata

func (c *ApiService) ListLegacyContentWithMetadata(params *ListLegacyContentParams) (*metadata.ResourceMetadata[[]ContentV1LegacyContent], error)

ListLegacyContentWithMetadata returns response with metadata like status code and response headers

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) PageContentAndApprovalsWithMetadata

func (c *ApiService) PageContentAndApprovalsWithMetadata(params *ListContentAndApprovalsParams, pageToken, pageNumber string) (*metadata.ResourceMetadata[ListContentAndApprovalsResponse], error)

PageContentAndApprovalsWithMetadata returns response with metadata like status code and response headers

func (*ApiService) PageContentWithMetadata

func (c *ApiService) PageContentWithMetadata(params *ListContentParams, pageToken, pageNumber string) (*metadata.ResourceMetadata[ListContentResponse], error)

PageContentWithMetadata returns response with metadata like status code and response headers

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) PageLegacyContentWithMetadata

func (c *ApiService) PageLegacyContentWithMetadata(params *ListLegacyContentParams, pageToken, pageNumber string) (*metadata.ResourceMetadata[ListLegacyContentResponse], error)

PageLegacyContentWithMetadata returns response with metadata like status code and response headers

func (*ApiService) RequestHandler

func (c *ApiService) RequestHandler() *twilio.RequestHandler

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) StreamContentAndApprovalsWithMetadata

func (c *ApiService) StreamContentAndApprovalsWithMetadata(params *ListContentAndApprovalsParams) (*metadata.ResourceMetadata[chan ContentV1ContentAndApprovals], chan error)

StreamContentAndApprovalsWithMetadata returns response with metadata like status code and response headers

func (*ApiService) StreamContentWithMetadata

func (c *ApiService) StreamContentWithMetadata(params *ListContentParams) (*metadata.ResourceMetadata[chan ContentV1Content], chan error)

StreamContentWithMetadata returns response with metadata like status code and response headers

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.

func (*ApiService) StreamLegacyContentWithMetadata

func (c *ApiService) StreamLegacyContentWithMetadata(params *ListLegacyContentParams) (*metadata.ResourceMetadata[chan ContentV1LegacyContent], chan error)

StreamLegacyContentWithMetadata returns response with metadata like status code and response headers

func (*ApiService) UpdateContent

func (c *ApiService) UpdateContent(Sid string, params *UpdateContentParams) (*ContentV1Content, error)

Update a Content resource

func (*ApiService) UpdateContentWithMetadata

func (c *ApiService) UpdateContentWithMetadata(Sid string, params *UpdateContentParams) (*metadata.ResourceMetadata[ContentV1Content], error)

UpdateContentWithMetadata returns response with metadata like status code and response headers

type AuthenticationAction

type AuthenticationAction struct {
	Type         AuthenticationActionType `json:"type"`
	CopyCodeText string                   `json:"copy_code_text"`
}

AuthenticationAction struct for AuthenticationAction

type AuthenticationActionType

type AuthenticationActionType string

AuthenticationActionType the model 'AuthenticationActionType'

const (
	AUTHENTICATIONACTIONTYPE_COPY_CODE AuthenticationActionType = "COPY_CODE"
)

List of authenticationActionType

type CallToActionAction

type CallToActionAction struct {
	Type  CallToActionActionType `json:"type"`
	Title string                 `json:"title"`
	Url   string                 `json:"url,omitempty"`
	Phone string                 `json:"phone,omitempty"`
	Code  string                 `json:"code,omitempty"`
	Id    string                 `json:"id,omitempty"`
}

CallToActionAction struct for CallToActionAction

type CallToActionActionType

type CallToActionActionType string

CallToActionActionType the model 'CallToActionActionType'

const (
	CALLTOACTIONACTIONTYPE_URL                CallToActionActionType = "URL"
	CALLTOACTIONACTIONTYPE_PHONE_NUMBER       CallToActionActionType = "PHONE_NUMBER"
	CALLTOACTIONACTIONTYPE_COPY_CODE          CallToActionActionType = "COPY_CODE"
	CALLTOACTIONACTIONTYPE_VOICE_CALL         CallToActionActionType = "VOICE_CALL"
	CALLTOACTIONACTIONTYPE_VOICE_CALL_REQUEST CallToActionActionType = "VOICE_CALL_REQUEST"
)

List of callToActionActionType

type CardAction

type CardAction struct {
	Type        CardActionType  `json:"type"`
	Title       string          `json:"title"`
	Url         string          `json:"url,omitempty"`
	Phone       string          `json:"phone,omitempty"`
	Id          string          `json:"id,omitempty"`
	Code        string          `json:"code,omitempty"`
	WebviewSize WebviewSizeType `json:"webview_size,omitempty"`
}

CardAction struct for CardAction

type CardActionType

type CardActionType string

CardActionType the model 'CardActionType'

const (
	CARDACTIONTYPE_URL          CardActionType = "URL"
	CARDACTIONTYPE_PHONE_NUMBER CardActionType = "PHONE_NUMBER"
	CARDACTIONTYPE_QUICK_REPLY  CardActionType = "QUICK_REPLY"
	CARDACTIONTYPE_COPY_CODE    CardActionType = "COPY_CODE"
	CARDACTIONTYPE_VOICE_CALL   CardActionType = "VOICE_CALL"
)

List of cardActionType

type CarouselAction

type CarouselAction struct {
	Type  CarouselActionType `json:"type"`
	Title string             `json:"title"`
	Url   string             `json:"url,omitempty"`
	Phone string             `json:"phone,omitempty"`
	Id    string             `json:"id,omitempty"`
}

CarouselAction struct for CarouselAction

type CarouselActionType

type CarouselActionType string

CarouselActionType the model 'CarouselActionType'

const (
	CAROUSELACTIONTYPE_URL          CarouselActionType = "URL"
	CAROUSELACTIONTYPE_PHONE_NUMBER CarouselActionType = "PHONE_NUMBER"
	CAROUSELACTIONTYPE_QUICK_REPLY  CarouselActionType = "QUICK_REPLY"
)

List of carouselActionType

type CarouselCard

type CarouselCard struct {
	Title   string           `json:"title,omitempty"`
	Body    string           `json:"body"`
	Media   string           `json:"media"`
	Actions []CarouselAction `json:"actions"`
}

CarouselCard struct for CarouselCard

type CatalogItem

type CatalogItem struct {
	Id           string  `json:"id,omitempty"`
	SectionTitle string  `json:"section_title,omitempty"`
	Name         string  `json:"name,omitempty"`
	MediaUrl     string  `json:"media_url,omitempty"`
	Price        float32 `json:"price,omitempty"`
	Description  string  `json:"description,omitempty"`
}

CatalogItem struct for CatalogItem

func (*CatalogItem) UnmarshalJSON

func (response *CatalogItem) UnmarshalJSON(bytes []byte) (err error)

type ContentApprovalRequest

type ContentApprovalRequest struct {
	// Name of the template.
	Name string `json:"name"`
	// A WhatsApp recognized template category.
	Category string `json:"category"`
}

ContentApprovalRequest Content approval request body

type ContentCreateRequest

type ContentCreateRequest struct {
	// User defined name of the content
	FriendlyName string `json:"friendly_name,omitempty"`
	// Key value pairs of variable name to value
	Variables map[string]string `json:"variables,omitempty"`
	// Language code for the content
	Language string `json:"language"`
	Types    Types  `json:"types"`
}

ContentCreateRequest Content creation request body

type ContentUpdateRequest

type ContentUpdateRequest struct {
	// User defined name of the content
	FriendlyName string `json:"friendly_name,omitempty"`
	// Key value pairs of variable name to value
	Variables map[string]string `json:"variables,omitempty"`
	// Language code for the content
	Language string `json:"language,omitempty"`
	Types    Types  `json:"types"`
}

ContentUpdateRequest Content update request body

type ContentV1ApprovalCreate

type ContentV1ApprovalCreate struct {
	Name                *string `json:"name,omitempty"`
	Category            *string `json:"category,omitempty"`
	ContentType         *string `json:"content_type,omitempty"`
	Status              *string `json:"status,omitempty"`
	RejectionReason     *string `json:"rejection_reason,omitempty"`
	AllowCategoryChange *bool   `json:"allow_category_change,omitempty"`
}

ContentV1ApprovalCreate struct for ContentV1ApprovalCreate

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 *map[string]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 *map[string]interface{} `json:"variables,omitempty"`
	// The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
	Types *map[string]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 *map[string]interface{} `json:"variables,omitempty"`
	// The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
	Types *map[string]interface{} `json:"types,omitempty"`
	// The submitted information and approval request status of the Content resource.
	ApprovalRequests *map[string]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 *map[string]interface{} `json:"variables,omitempty"`
	// The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
	Types *map[string]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 CreateApprovalCreateParams

type CreateApprovalCreateParams struct {
	//
	ContentApprovalRequest *ContentApprovalRequest `json:"ContentApprovalRequest,omitempty"`
}

Optional parameters for the method 'CreateApprovalCreate'

func (*CreateApprovalCreateParams) SetContentApprovalRequest

func (params *CreateApprovalCreateParams) SetContentApprovalRequest(ContentApprovalRequest ContentApprovalRequest) *CreateApprovalCreateParams

type CreateContentParams

type CreateContentParams struct {
	//
	ContentCreateRequest *ContentCreateRequest `json:"ContentCreateRequest,omitempty"`
}

Optional parameters for the method 'CreateContent'

func (*CreateContentParams) SetContentCreateRequest

func (params *CreateContentParams) SetContentCreateRequest(ContentCreateRequest ContentCreateRequest) *CreateContentParams

type FlowsPage

type FlowsPage struct {
	Id         string               `json:"id"`
	NextPageId string               `json:"next_page_id,omitempty"`
	Title      string               `json:"title"`
	Subtitle   string               `json:"subtitle,omitempty"`
	Layout     []FlowsPageComponent `json:"layout"`
}

FlowsPage struct for FlowsPage

type FlowsPageComponent

type FlowsPageComponent struct {
	Label string `json:"label,omitempty"`
	Type  string `json:"type"`
}

FlowsPageComponent struct for FlowsPageComponent

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"`
	Key             string  `json:"key,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"`
}

ListContentResponseMeta struct for ListContentResponseMeta

type ListItem

type ListItem struct {
	Id          string `json:"id"`
	Item        string `json:"item"`
	Description string `json:"description,omitempty"`
}

ListItem struct for ListItem

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

type QuickReplyAction

type QuickReplyAction struct {
	Type  QuickReplyActionType `json:"type,omitempty"`
	Title string               `json:"title"`
	Id    string               `json:"id,omitempty"`
}

QuickReplyAction struct for QuickReplyAction

type QuickReplyActionType

type QuickReplyActionType string

QuickReplyActionType the model 'QuickReplyActionType'

const (
	QUICKREPLYACTIONTYPE_QUICK_REPLY QuickReplyActionType = "QUICK_REPLY"
)

List of quickReplyActionType

type TwilioCallToAction

type TwilioCallToAction struct {
	Body    string               `json:"body"`
	Actions []CallToActionAction `json:"actions"`
}

TwilioCallToAction twilio/call-to-action buttons let recipients tap to trigger actions such as launching a website or making a phone call.

type TwilioCard

type TwilioCard struct {
	Title    string       `json:"title,omitempty"`
	Subtitle string       `json:"subtitle,omitempty"`
	Media    []string     `json:"media,omitempty"`
	Actions  []CardAction `json:"actions,omitempty"`
}

TwilioCard twilio/card is a structured template which can be used to send a series of related information. It must include a title and at least one additional field.

type TwilioCarousel

type TwilioCarousel struct {
	Body  string         `json:"body"`
	Cards []CarouselCard `json:"cards"`
}

TwilioCarousel twilio/carousel templates allow you to send a single text message accompanied by a set of up to 10 carousel cards in a horizontally scrollable view

type TwilioCatalog

type TwilioCatalog struct {
	Title        string        `json:"title,omitempty"`
	Body         string        `json:"body"`
	Subtitle     string        `json:"subtitle,omitempty"`
	Id           string        `json:"id,omitempty"`
	Items        []CatalogItem `json:"items,omitempty"`
	DynamicItems string        `json:"dynamic_items,omitempty"`
}

TwilioCatalog twilio/catalog type lets recipients view list of catalog products, ask questions about products, order products.

type TwilioFlows

type TwilioFlows struct {
	Body       string      `json:"body"`
	ButtonText string      `json:"button_text"`
	Subtitle   string      `json:"subtitle,omitempty"`
	MediaUrl   string      `json:"media_url,omitempty"`
	Pages      []FlowsPage `json:"pages"`
	Type       string      `json:"type"`
}

TwilioFlows twilio/flows templates allow you to send multiple messages in a set order with text or select options

type TwilioListPicker

type TwilioListPicker struct {
	Body   string     `json:"body"`
	Button string     `json:"button"`
	Items  []ListItem `json:"items"`
}

TwilioListPicker twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.

type TwilioLocation

type TwilioLocation struct {
	Latitude  float32 `json:"latitude"`
	Longitude float32 `json:"longitude"`
	Label     string  `json:"label,omitempty"`
	Id        string  `json:"id,omitempty"`
	Address   string  `json:"address,omitempty"`
}

TwilioLocation twilio/location type contains a location pin and an optional label, which can be used to enhance delivery notifications or connect recipients to physical experiences you offer.

func (*TwilioLocation) UnmarshalJSON

func (response *TwilioLocation) UnmarshalJSON(bytes []byte) (err error)

type TwilioMedia

type TwilioMedia struct {
	Body  string   `json:"body,omitempty"`
	Media []string `json:"media"`
}

TwilioMedia twilio/media is used to send file attachments, or to send long text via MMS in the US and Canada. As such, the twilio/media type must contain at least ONE of text or media content.

type TwilioQuickReply

type TwilioQuickReply struct {
	Body    string             `json:"body"`
	Actions []QuickReplyAction `json:"actions"`
}

TwilioQuickReply twilio/quick-reply templates let recipients tap, rather than type, to respond to the message.

type TwilioSchedule

type TwilioSchedule struct {
	Id        string `json:"id"`
	Title     string `json:"title"`
	TimeSlots string `json:"timeSlots"`
}

TwilioSchedule twilio/schedule templates allow us to send a message with a schedule with different time slots

type TwilioText

type TwilioText struct {
	Body string `json:"body"`
}

TwilioText Type containing only plain text-based content

type Types

type Types struct {
	TwilioText             *TwilioText             `json:"twilio/text,omitempty"`
	TwilioMedia            *TwilioMedia            `json:"twilio/media,omitempty"`
	TwilioLocation         *TwilioLocation         `json:"twilio/location,omitempty"`
	TwilioListPicker       *TwilioListPicker       `json:"twilio/list-picker,omitempty"`
	TwilioCallToAction     *TwilioCallToAction     `json:"twilio/call-to-action,omitempty"`
	TwilioQuickReply       *TwilioQuickReply       `json:"twilio/quick-reply,omitempty"`
	TwilioCard             *TwilioCard             `json:"twilio/card,omitempty"`
	TwilioCatalog          *TwilioCatalog          `json:"twilio/catalog,omitempty"`
	TwilioCarousel         *TwilioCarousel         `json:"twilio/carousel,omitempty"`
	TwilioFlows            *TwilioFlows            `json:"twilio/flows,omitempty"`
	TwilioSchedule         *TwilioSchedule         `json:"twilio/schedule,omitempty"`
	WhatsappCard           *WhatsappCard           `json:"whatsapp/card,omitempty"`
	WhatsappAuthentication *WhatsappAuthentication `json:"whatsapp/authentication,omitempty"`
	WhatsappFlows          *WhatsappFlows          `json:"whatsapp/flows,omitempty"`
}

Types Content types

type UpdateContentParams

type UpdateContentParams struct {
	//
	ContentUpdateRequest *ContentUpdateRequest `json:"ContentUpdateRequest,omitempty"`
}

Optional parameters for the method 'UpdateContent'

func (*UpdateContentParams) SetContentUpdateRequest

func (params *UpdateContentParams) SetContentUpdateRequest(ContentUpdateRequest ContentUpdateRequest) *UpdateContentParams

type WebviewSizeType

type WebviewSizeType string

WebviewSizeType the model 'WebviewSizeType'

const (
	WEBVIEWSIZETYPE_TALL WebviewSizeType = "TALL"
	WEBVIEWSIZETYPE_FULL WebviewSizeType = "FULL"
	WEBVIEWSIZETYPE_HALF WebviewSizeType = "HALF"
	WEBVIEWSIZETYPE_NONE WebviewSizeType = "NONE"
)

List of webviewSizeType

type WhatsappAuthentication

type WhatsappAuthentication struct {
	AddSecurityRecommendation bool                   `json:"add_security_recommendation,omitempty"`
	CodeExpirationMinutes     float32                `json:"code_expiration_minutes,omitempty"`
	Actions                   []AuthenticationAction `json:"actions"`
}

WhatsappAuthentication whatsApp/authentication templates let companies deliver WA approved one-time-password button.

func (*WhatsappAuthentication) UnmarshalJSON

func (response *WhatsappAuthentication) UnmarshalJSON(bytes []byte) (err error)

type WhatsappCard

type WhatsappCard struct {
	Body       string       `json:"body"`
	Footer     string       `json:"footer,omitempty"`
	Media      []string     `json:"media,omitempty"`
	HeaderText string       `json:"header_text,omitempty"`
	Actions    []CardAction `json:"actions,omitempty"`
}

WhatsappCard whatsapp/card is a structured template which can be used to send a series of related information. It must include a body and at least one additional field.

type WhatsappFlows

type WhatsappFlows struct {
	Body                    string `json:"body"`
	ButtonText              string `json:"button_text"`
	Subtitle                string `json:"subtitle,omitempty"`
	MediaUrl                string `json:"media_url,omitempty"`
	FlowId                  string `json:"flow_id"`
	FlowToken               string `json:"flow_token,omitempty"`
	FlowFirstPageId         string `json:"flow_first_page_id,omitempty"`
	IsFlowFirstPageEndpoint bool   `json:"is_flow_first_page_endpoint,omitempty"`
}

WhatsappFlows whatsapp/flows templates allow you to send multiple messages in a set order with text or select options

Source Files

  • api_service.go
  • content.go
  • content_and_approvals.go
  • content_approval_requests.go
  • content_approval_requests_whatsapp.go
  • legacy_content.go
  • model_authentication_action.go
  • model_authentication_action_type.go
  • model_call_to_action_action.go
  • model_call_to_action_action_type.go
  • model_card_action.go
  • model_card_action_type.go
  • model_carousel_action.go
  • model_carousel_action_type.go
  • model_carousel_card.go
  • model_catalog_item.go
  • model_content_approval_request.go
  • model_content_create_request.go
  • model_content_update_request.go
  • model_content_v1_approval_create.go
  • model_content_v1_approval_fetch.go
  • model_content_v1_content.go
  • model_content_v1_content_and_approvals.go
  • model_content_v1_legacy_content.go
  • model_flows_page.go
  • model_flows_page_component.go
  • model_list_content_and_approvals_response.go
  • model_list_content_response.go
  • model_list_content_response_meta.go
  • model_list_item.go
  • model_list_legacy_content_response.go
  • model_quick_reply_action.go
  • model_quick_reply_action_type.go
  • model_twilio_call_to_action.go
  • model_twilio_card.go
  • model_twilio_carousel.go
  • model_twilio_catalog.go
  • model_twilio_flows.go
  • model_twilio_list_picker.go
  • model_twilio_location.go
  • model_twilio_media.go
  • model_twilio_quick_reply.go
  • model_twilio_schedule.go
  • model_twilio_text.go
  • model_types.go
  • model_webview_size_type.go
  • model_whatsapp_authentication.go
  • model_whatsapp_card.go
  • model_whatsapp_flows.go

Jump to

Keyboard shortcuts

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