openapi

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 5 Imported by: 1

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.43.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://bulkexports.twilio.com

Class Method HTTP request Description
ExportsApi FetchExport Get /v1/Exports/{ResourceType}
ExportsConfigurationApi FetchExportConfiguration Get /v1/Exports/{ResourceType}/Configuration
ExportsConfigurationApi UpdateExportConfiguration Post /v1/Exports/{ResourceType}/Configuration
ExportsDaysApi FetchDay Get /v1/Exports/{ResourceType}/Days/{Day}
ExportsDaysApi ListDay Get /v1/Exports/{ResourceType}/Days
ExportsJobsApi CreateExportCustomJob Post /v1/Exports/{ResourceType}/Jobs
ExportsJobsApi DeleteJob Delete /v1/Exports/Jobs/{JobSid}
ExportsJobsApi FetchJob Get /v1/Exports/Jobs/{JobSid}
ExportsJobsApi ListExportCustomJob Get /v1/Exports/{ResourceType}/Jobs

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

func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateExportCustomJobParams) (*BulkexportsV1ExportCustomJob, error)

func (*ApiService) DeleteJob added in v0.11.0

func (c *ApiService) DeleteJob(JobSid string) error

func (*ApiService) FetchDay added in v0.11.0

func (c *ApiService) FetchDay(ResourceType string, Day string) (*BulkexportsV1DayInstance, error)

Fetch a specific Day.

func (*ApiService) FetchExport added in v0.11.0

func (c *ApiService) FetchExport(ResourceType string) (*BulkexportsV1Export, error)

Fetch a specific Export.

func (*ApiService) FetchExportConfiguration added in v0.11.0

func (c *ApiService) FetchExportConfiguration(ResourceType string) (*BulkexportsV1ExportConfiguration, error)

Fetch a specific Export Configuration.

func (*ApiService) FetchJob added in v0.11.0

func (c *ApiService) FetchJob(JobSid string) (*BulkexportsV1Job, error)

func (*ApiService) ListDay added in v0.11.0

func (c *ApiService) ListDay(ResourceType string, params *ListDayParams) ([]BulkexportsV1Day, error)

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

func (*ApiService) ListExportCustomJob added in v0.11.0

func (c *ApiService) ListExportCustomJob(ResourceType string, params *ListExportCustomJobParams) ([]BulkexportsV1ExportCustomJob, error)

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

func (*ApiService) PageDay added in v0.13.0

func (c *ApiService) PageDay(ResourceType string, params *ListDayParams, pageToken, pageNumber string) (*ListDayResponse, error)

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

func (*ApiService) PageExportCustomJob added in v0.13.0

func (c *ApiService) PageExportCustomJob(ResourceType string, params *ListExportCustomJobParams, pageToken, pageNumber string) (*ListExportCustomJobResponse, error)

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

func (*ApiService) StreamDay added in v0.13.0

func (c *ApiService) StreamDay(ResourceType string, params *ListDayParams) (chan BulkexportsV1Day, chan error)

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

func (*ApiService) StreamExportCustomJob added in v0.13.0

func (c *ApiService) StreamExportCustomJob(ResourceType string, params *ListExportCustomJobParams) (chan BulkexportsV1ExportCustomJob, chan error)

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

func (*ApiService) UpdateExportConfiguration added in v0.11.0

func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *UpdateExportConfigurationParams) (*BulkexportsV1ExportConfiguration, error)

Update a specific Export Configuration.

type BulkexportsV1Day added in v0.14.0

type BulkexportsV1Day struct {
	// The ISO 8601 format date of the resources in the file, for a UTC day
	Day *string `json:"day,omitempty"`
	// The size of the day's data file in bytes
	Size *int `json:"size,omitempty"`
	// The ISO 8601 format date when resources is created
	CreateDate *string `json:"create_date,omitempty"`
	// The friendly name specified when creating the job
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The type of communication – Messages, Calls, Conferences, and Participants
	ResourceType *string `json:"resource_type,omitempty"`
}

BulkexportsV1Day struct for BulkexportsV1Day

type BulkexportsV1DayInstance added in v0.14.0

type BulkexportsV1DayInstance struct {
	RedirectTo *string `json:"redirect_to,omitempty"`
}

BulkexportsV1DayInstance struct for BulkexportsV1DayInstance

type BulkexportsV1Export

type BulkexportsV1Export struct {
	// The type of communication – Messages, Calls, Conferences, and Participants
	ResourceType *string `json:"resource_type,omitempty"`
	// The URL of this resource.
	Url *string `json:"url,omitempty"`
	// Contains a dictionary of URL links to nested resources of this Export.
	Links *map[string]interface{} `json:"links,omitempty"`
}

BulkexportsV1Export struct for BulkexportsV1Export

type BulkexportsV1ExportConfiguration

type BulkexportsV1ExportConfiguration struct {
	// If true, Twilio will automatically generate every day's file when the day is over.
	Enabled *bool `json:"enabled,omitempty"`
	// Stores the URL destination for the method specified in webhook_method.
	WebhookUrl *string `json:"webhook_url,omitempty"`
	// Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url
	WebhookMethod *string `json:"webhook_method,omitempty"`
	// The type of communication – Messages, Calls, Conferences, and Participants
	ResourceType *string `json:"resource_type,omitempty"`
	// The URL of this resource.
	Url *string `json:"url,omitempty"`
}

BulkexportsV1ExportConfiguration struct for BulkexportsV1ExportConfiguration

type BulkexportsV1ExportCustomJob added in v0.14.0

type BulkexportsV1ExportCustomJob struct {
	// The friendly name specified when creating the job
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The type of communication – Messages, Calls, Conferences, and Participants
	ResourceType *string `json:"resource_type,omitempty"`
	// The start day for the custom export specified when creating the job
	StartDay *string `json:"start_day,omitempty"`
	// The end day for the export specified when creating the job
	EndDay *string `json:"end_day,omitempty"`
	// The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied.
	WebhookUrl *string `json:"webhook_url,omitempty"`
	// This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied.
	WebhookMethod *string `json:"webhook_method,omitempty"`
	// The optional email to send the completion notification to
	Email *string `json:"email,omitempty"`
	// The unique job_sid returned when the custom export was created
	JobSid *string `json:"job_sid,omitempty"`
	// The details of a job which is an object that contains an array of status grouped by `status` state.  Each `status` object has a `status` string, a count which is the number of days in that `status`, and list of days in that `status`. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a `status` object for SUBMITTED each with its own count and list of days.
	Details *interface{} `json:"details,omitempty"`
	// This is the job position from the 1st in line. Your queue position will never increase. As jobs ahead of yours in the queue are processed, the queue position number will decrease
	JobQueuePosition *string `json:"job_queue_position,omitempty"`
	// this is the time estimated until your job is complete. This is calculated each time you request the job list. The time is calculated based on the current rate of job completion (which may vary) and your job queue position
	EstimatedCompletionTime *string `json:"estimated_completion_time,omitempty"`
}

BulkexportsV1ExportCustomJob struct for BulkexportsV1ExportCustomJob

type BulkexportsV1Job added in v0.14.0

type BulkexportsV1Job struct {
	// The type of communication – Messages, Calls, Conferences, and Participants
	ResourceType *string `json:"resource_type,omitempty"`
	// The friendly name specified when creating the job
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The details of a job which is an object that contains an array of status grouped by `status` state.  Each `status` object has a `status` string, a count which is the number of days in that `status`, and list of days in that `status`. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a `status` object for SUBMITTED each with its own count and list of days.
	Details *interface{} `json:"details,omitempty"`
	// The start time for the export specified when creating the job
	StartDay *string `json:"start_day,omitempty"`
	// The end time for the export specified when creating the job
	EndDay *string `json:"end_day,omitempty"`
	// The job_sid returned when the export was created
	JobSid *string `json:"job_sid,omitempty"`
	// The optional webhook url called on completion
	WebhookUrl *string `json:"webhook_url,omitempty"`
	// This is the method used to call the webhook
	WebhookMethod *string `json:"webhook_method,omitempty"`
	// The optional email to send the completion notification to
	Email *string `json:"email,omitempty"`
	Url   *string `json:"url,omitempty"`
	// This is the job position from the 1st in line. Your queue position will never increase. As jobs ahead of yours in the queue are processed, the queue position number will decrease
	JobQueuePosition *string `json:"job_queue_position,omitempty"`
	// this is the time estimated until your job is complete. This is calculated each time you request the job list. The time is calculated based on the current rate of job completion (which may vary) and your job queue position
	EstimatedCompletionTime *string `json:"estimated_completion_time,omitempty"`
}

BulkexportsV1Job struct for BulkexportsV1Job

type CreateExportCustomJobParams

type CreateExportCustomJobParams struct {
	// The start day for the custom export specified as a string in the format of yyyy-mm-dd
	StartDay *string `json:"StartDay,omitempty"`
	// The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier than the current UTC day.
	EndDay *string `json:"EndDay,omitempty"`
	// The friendly name specified when creating the job
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually.
	WebhookUrl *string `json:"WebhookUrl,omitempty"`
	// This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied.
	WebhookMethod *string `json:"WebhookMethod,omitempty"`
	// The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status.
	Email *string `json:"Email,omitempty"`
}

Optional parameters for the method 'CreateExportCustomJob'

func (*CreateExportCustomJobParams) SetEmail

func (*CreateExportCustomJobParams) SetEndDay

func (*CreateExportCustomJobParams) SetFriendlyName

func (params *CreateExportCustomJobParams) SetFriendlyName(FriendlyName string) *CreateExportCustomJobParams

func (*CreateExportCustomJobParams) SetStartDay

func (params *CreateExportCustomJobParams) SetStartDay(StartDay string) *CreateExportCustomJobParams

func (*CreateExportCustomJobParams) SetWebhookMethod

func (params *CreateExportCustomJobParams) SetWebhookMethod(WebhookMethod string) *CreateExportCustomJobParams

func (*CreateExportCustomJobParams) SetWebhookUrl

func (params *CreateExportCustomJobParams) SetWebhookUrl(WebhookUrl string) *CreateExportCustomJobParams

type ListDayParams

type ListDayParams 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 'ListDay'

func (*ListDayParams) SetLimit added in v0.13.0

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

func (*ListDayParams) SetPageSize

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

type ListDayResponse

type ListDayResponse struct {
	Days []BulkexportsV1Day  `json:"days,omitempty"`
	Meta ListDayResponseMeta `json:"meta,omitempty"`
}

ListDayResponse struct for ListDayResponse

type ListDayResponseMeta

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

ListDayResponseMeta struct for ListDayResponseMeta

type ListExportCustomJobParams

type ListExportCustomJobParams 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 'ListExportCustomJob'

func (*ListExportCustomJobParams) SetLimit added in v0.13.0

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

func (*ListExportCustomJobParams) SetPageSize

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

type ListExportCustomJobResponse

type ListExportCustomJobResponse struct {
	Jobs []BulkexportsV1ExportCustomJob `json:"jobs,omitempty"`
	Meta ListDayResponseMeta            `json:"meta,omitempty"`
}

ListExportCustomJobResponse struct for ListExportCustomJobResponse

type UpdateExportConfigurationParams

type UpdateExportConfigurationParams struct {
	// If true, Twilio will automatically generate every day's file when the day is over.
	Enabled *bool `json:"Enabled,omitempty"`
	// Stores the URL destination for the method specified in webhook_method.
	WebhookUrl *string `json:"WebhookUrl,omitempty"`
	// Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url
	WebhookMethod *string `json:"WebhookMethod,omitempty"`
}

Optional parameters for the method 'UpdateExportConfiguration'

func (*UpdateExportConfigurationParams) SetEnabled

func (*UpdateExportConfigurationParams) SetWebhookMethod

func (params *UpdateExportConfigurationParams) SetWebhookMethod(WebhookMethod string) *UpdateExportConfigurationParams

func (*UpdateExportConfigurationParams) SetWebhookUrl

func (params *UpdateExportConfigurationParams) SetWebhookUrl(WebhookUrl string) *UpdateExportConfigurationParams

Jump to

Keyboard shortcuts

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