openapi

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 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.28.2
  • 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://fax.twilio.com

Class Method HTTP request Description
FaxesApi DeleteFax Delete /v1/Faxes/{Sid}
FaxesApi FetchFax Get /v1/Faxes/{Sid}
FaxesApi ListFax Get /v1/Faxes
FaxesMediaApi DeleteFaxMedia Delete /v1/Faxes/{FaxSid}/Media/{Sid}
FaxesMediaApi FetchFaxMedia Get /v1/Faxes/{FaxSid}/Media/{Sid}
FaxesMediaApi ListFaxMedia Get /v1/Faxes/{FaxSid}/Media

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 added in v0.11.0

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

func NewApiService added in v0.11.0

func NewApiService(requestHandler *twilio.RequestHandler) *ApiService

func NewApiServiceWithClient added in v0.11.0

func NewApiServiceWithClient(client twilio.BaseClient) *ApiService

func (*ApiService) DeleteFax added in v0.11.0

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

Delete a specific fax and its associated media.

func (*ApiService) DeleteFaxMedia added in v0.11.0

func (c *ApiService) DeleteFaxMedia(FaxSid string, Sid string) error

Delete a specific fax media instance.

func (*ApiService) FetchFax added in v0.11.0

func (c *ApiService) FetchFax(Sid string) (*FaxV1Fax, error)

Fetch a specific fax.

func (*ApiService) FetchFaxMedia added in v0.11.0

func (c *ApiService) FetchFaxMedia(FaxSid string, Sid string) (*FaxV1FaxMedia, error)

Fetch a specific fax media instance.

func (*ApiService) ListFax added in v0.11.0

func (c *ApiService) ListFax(params *ListFaxParams) ([]FaxV1Fax, error)

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

func (*ApiService) ListFaxMedia added in v0.11.0

func (c *ApiService) ListFaxMedia(FaxSid string, params *ListFaxMediaParams) ([]FaxV1FaxMedia, error)

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

func (*ApiService) PageFax added in v0.13.0

func (c *ApiService) PageFax(params *ListFaxParams, pageToken, pageNumber string) (*ListFaxResponse, error)

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

func (*ApiService) PageFaxMedia added in v0.13.0

func (c *ApiService) PageFaxMedia(FaxSid string, params *ListFaxMediaParams, pageToken, pageNumber string) (*ListFaxMediaResponse, error)

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

func (*ApiService) StreamFax added in v0.13.0

func (c *ApiService) StreamFax(params *ListFaxParams) (chan FaxV1Fax, error)

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

func (*ApiService) StreamFaxMedia added in v0.13.0

func (c *ApiService) StreamFaxMedia(FaxSid string, params *ListFaxMediaParams) (chan FaxV1FaxMedia, error)

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

type FaxV1Fax

type FaxV1Fax struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The API version used to transmit the fax
	ApiVersion *string `json:"api_version,omitempty"`
	// The ISO 8601 formatted date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 formatted date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The direction of the fax
	Direction *string `json:"direction,omitempty"`
	// The time it took to transmit the fax
	Duration *int `json:"duration,omitempty"`
	// The number the fax was sent from
	From *string `json:"from,omitempty"`
	// The URLs of the fax's related resources
	Links *map[string]interface{} `json:"links,omitempty"`
	// The SID of the FaxMedia resource that is associated with the Fax
	MediaSid *string `json:"media_sid,omitempty"`
	// The Twilio-hosted URL that can be used to download fax media
	MediaUrl *string `json:"media_url,omitempty"`
	// The number of pages contained in the fax document
	NumPages *int `json:"num_pages,omitempty"`
	// The fax transmission price
	Price *float32 `json:"price,omitempty"`
	// The ISO 4217 currency used for billing
	PriceUnit *string `json:"price_unit,omitempty"`
	// The quality of the fax
	Quality *string `json:"quality,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The status of the fax
	Status *string `json:"status,omitempty"`
	// The phone number that received the fax
	To *string `json:"to,omitempty"`
	// The absolute URL of the fax resource
	Url *string `json:"url,omitempty"`
}

FaxV1Fax struct for FaxV1Fax

type FaxV1FaxMedia added in v0.14.0

type FaxV1FaxMedia struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The content type of the stored fax media
	ContentType *string `json:"content_type,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was created
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The ISO 8601 date and time in GMT when the resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The SID of the fax the FaxMedia resource is associated with
	FaxSid *string `json:"fax_sid,omitempty"`
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The absolute URL of the FaxMedia resource
	Url *string `json:"url,omitempty"`
}

FaxV1FaxMedia struct for FaxV1FaxMedia

type ListFaxMediaParams

type ListFaxMediaParams 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 'ListFaxMedia'

func (*ListFaxMediaParams) SetLimit added in v0.13.0

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

func (*ListFaxMediaParams) SetPageSize

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

type ListFaxMediaResponse

type ListFaxMediaResponse struct {
	Media []FaxV1FaxMedia     `json:"media,omitempty"`
	Meta  ListFaxResponseMeta `json:"meta,omitempty"`
}

ListFaxMediaResponse struct for ListFaxMediaResponse

type ListFaxParams

type ListFaxParams struct {
	// Retrieve only those faxes sent from this phone number, specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.
	From *string `json:"From,omitempty"`
	// Retrieve only those faxes sent to this phone number, specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format.
	To *string `json:"To,omitempty"`
	// Retrieve only those faxes with a `date_created` that is before or equal to this value, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
	DateCreatedOnOrBefore *time.Time `json:"DateCreatedOnOrBefore,omitempty"`
	// Retrieve only those faxes with a `date_created` that is later than this value, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
	DateCreatedAfter *time.Time `json:"DateCreatedAfter,omitempty"`
	// 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 'ListFax'

func (*ListFaxParams) SetDateCreatedAfter

func (params *ListFaxParams) SetDateCreatedAfter(DateCreatedAfter time.Time) *ListFaxParams

func (*ListFaxParams) SetDateCreatedOnOrBefore

func (params *ListFaxParams) SetDateCreatedOnOrBefore(DateCreatedOnOrBefore time.Time) *ListFaxParams

func (*ListFaxParams) SetFrom

func (params *ListFaxParams) SetFrom(From string) *ListFaxParams

func (*ListFaxParams) SetLimit added in v0.13.0

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

func (*ListFaxParams) SetPageSize

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

func (*ListFaxParams) SetTo

func (params *ListFaxParams) SetTo(To string) *ListFaxParams

type ListFaxResponse

type ListFaxResponse struct {
	Faxes []FaxV1Fax          `json:"faxes,omitempty"`
	Meta  ListFaxResponseMeta `json:"meta,omitempty"`
}

ListFaxResponse struct for ListFaxResponse

type ListFaxResponseMeta

type ListFaxResponseMeta 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"`
}

ListFaxResponseMeta struct for ListFaxResponseMeta

Jump to

Keyboard shortcuts

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