openapi

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 6 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.37.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://wireless.twilio.com

Class Method HTTP request Description
CommandsApi CreateCommand Post /v1/Commands
CommandsApi DeleteCommand Delete /v1/Commands/{Sid}
CommandsApi FetchCommand Get /v1/Commands/{Sid}
CommandsApi ListCommand Get /v1/Commands
RatePlansApi CreateRatePlan Post /v1/RatePlans
RatePlansApi DeleteRatePlan Delete /v1/RatePlans/{Sid}
RatePlansApi FetchRatePlan Get /v1/RatePlans/{Sid}
RatePlansApi ListRatePlan Get /v1/RatePlans
RatePlansApi UpdateRatePlan Post /v1/RatePlans/{Sid}
SimsApi DeleteSim Delete /v1/Sims/{Sid}
SimsApi FetchSim Get /v1/Sims/{Sid}
SimsApi ListSim Get /v1/Sims
SimsApi UpdateSim Post /v1/Sims/{Sid}
SimsDataSessionsApi ListDataSession Get /v1/Sims/{SimSid}/DataSessions
SimsUsageRecordsApi ListUsageRecord Get /v1/Sims/{SimSid}/UsageRecords
UsageRecordsApi ListAccountUsageRecord Get /v1/UsageRecords

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

func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Command, error)

Send a Command to a Sim.

func (*ApiService) CreateRatePlan added in v0.11.0

func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1RatePlan, error)

func (*ApiService) DeleteCommand added in v0.11.0

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

Delete a Command instance from your account.

func (*ApiService) DeleteRatePlan added in v0.11.0

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

func (*ApiService) DeleteSim added in v0.11.0

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

Delete a Sim resource on your Account.

func (*ApiService) FetchCommand added in v0.11.0

func (c *ApiService) FetchCommand(Sid string) (*WirelessV1Command, error)

Fetch a Command instance from your account.

func (*ApiService) FetchRatePlan added in v0.11.0

func (c *ApiService) FetchRatePlan(Sid string) (*WirelessV1RatePlan, error)

func (*ApiService) FetchSim added in v0.11.0

func (c *ApiService) FetchSim(Sid string) (*WirelessV1Sim, error)

Fetch a Sim resource on your Account.

func (*ApiService) ListAccountUsageRecord added in v0.11.0

func (c *ApiService) ListAccountUsageRecord(params *ListAccountUsageRecordParams) ([]WirelessV1AccountUsageRecord, error)

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

func (*ApiService) ListCommand added in v0.11.0

func (c *ApiService) ListCommand(params *ListCommandParams) ([]WirelessV1Command, error)

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

func (*ApiService) ListDataSession added in v0.11.0

func (c *ApiService) ListDataSession(SimSid string, params *ListDataSessionParams) ([]WirelessV1DataSession, error)

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

func (*ApiService) ListRatePlan added in v0.11.0

func (c *ApiService) ListRatePlan(params *ListRatePlanParams) ([]WirelessV1RatePlan, error)

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

func (*ApiService) ListSim added in v0.11.0

func (c *ApiService) ListSim(params *ListSimParams) ([]WirelessV1Sim, error)

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

func (*ApiService) ListUsageRecord added in v0.11.0

func (c *ApiService) ListUsageRecord(SimSid string, params *ListUsageRecordParams) ([]WirelessV1UsageRecord, error)

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

func (*ApiService) PageAccountUsageRecord added in v0.13.0

func (c *ApiService) PageAccountUsageRecord(params *ListAccountUsageRecordParams, pageToken, pageNumber string) (*ListAccountUsageRecordResponse, error)

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

func (*ApiService) PageCommand added in v0.13.0

func (c *ApiService) PageCommand(params *ListCommandParams, pageToken, pageNumber string) (*ListCommandResponse, error)

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

func (*ApiService) PageDataSession added in v0.13.0

func (c *ApiService) PageDataSession(SimSid string, params *ListDataSessionParams, pageToken, pageNumber string) (*ListDataSessionResponse, error)

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

func (*ApiService) PageRatePlan added in v0.13.0

func (c *ApiService) PageRatePlan(params *ListRatePlanParams, pageToken, pageNumber string) (*ListRatePlanResponse, error)

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

func (*ApiService) PageSim added in v0.13.0

func (c *ApiService) PageSim(params *ListSimParams, pageToken, pageNumber string) (*ListSimResponse, error)

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

func (*ApiService) PageUsageRecord added in v0.13.0

func (c *ApiService) PageUsageRecord(SimSid string, params *ListUsageRecordParams, pageToken, pageNumber string) (*ListUsageRecordResponse, error)

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

func (*ApiService) StreamAccountUsageRecord added in v0.13.0

func (c *ApiService) StreamAccountUsageRecord(params *ListAccountUsageRecordParams) (chan WirelessV1AccountUsageRecord, chan error)

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

func (*ApiService) StreamCommand added in v0.13.0

func (c *ApiService) StreamCommand(params *ListCommandParams) (chan WirelessV1Command, chan error)

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

func (*ApiService) StreamDataSession added in v0.13.0

func (c *ApiService) StreamDataSession(SimSid string, params *ListDataSessionParams) (chan WirelessV1DataSession, chan error)

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

func (*ApiService) StreamRatePlan added in v0.13.0

func (c *ApiService) StreamRatePlan(params *ListRatePlanParams) (chan WirelessV1RatePlan, chan error)

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

func (*ApiService) StreamSim added in v0.13.0

func (c *ApiService) StreamSim(params *ListSimParams) (chan WirelessV1Sim, chan error)

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

func (*ApiService) StreamUsageRecord added in v0.13.0

func (c *ApiService) StreamUsageRecord(SimSid string, params *ListUsageRecordParams) (chan WirelessV1UsageRecord, chan error)

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

func (*ApiService) UpdateRatePlan added in v0.11.0

func (c *ApiService) UpdateRatePlan(Sid string, params *UpdateRatePlanParams) (*WirelessV1RatePlan, error)

func (*ApiService) UpdateSim added in v0.11.0

func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1Sim, error)

Updates the given properties of a Sim resource on your Account.

type CreateCommandParams

type CreateCommandParams struct {
	// The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode.
	Command *string `json:"Command,omitempty"`
	// The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/wireless/api/sim-resource) to send the Command to.
	Sim *string `json:"Sim,omitempty"`
	// The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`.
	CallbackMethod *string `json:"CallbackMethod,omitempty"`
	// The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed.
	CallbackUrl *string `json:"CallbackUrl,omitempty"`
	//
	CommandMode *string `json:"CommandMode,omitempty"`
	// Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once.  A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included.
	IncludeSid *string `json:"IncludeSid,omitempty"`
	// Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`.
	DeliveryReceiptRequested *bool `json:"DeliveryReceiptRequested,omitempty"`
}

Optional parameters for the method 'CreateCommand'

func (*CreateCommandParams) SetCallbackMethod

func (params *CreateCommandParams) SetCallbackMethod(CallbackMethod string) *CreateCommandParams

func (*CreateCommandParams) SetCallbackUrl

func (params *CreateCommandParams) SetCallbackUrl(CallbackUrl string) *CreateCommandParams

func (*CreateCommandParams) SetCommand

func (params *CreateCommandParams) SetCommand(Command string) *CreateCommandParams

func (*CreateCommandParams) SetCommandMode

func (params *CreateCommandParams) SetCommandMode(CommandMode string) *CreateCommandParams

func (*CreateCommandParams) SetDeliveryReceiptRequested

func (params *CreateCommandParams) SetDeliveryReceiptRequested(DeliveryReceiptRequested bool) *CreateCommandParams

func (*CreateCommandParams) SetIncludeSid

func (params *CreateCommandParams) SetIncludeSid(IncludeSid string) *CreateCommandParams

func (*CreateCommandParams) SetSim

func (params *CreateCommandParams) SetSim(Sim string) *CreateCommandParams

type CreateRatePlanParams

type CreateRatePlanParams struct {
	// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
	UniqueName *string `json:"UniqueName,omitempty"`
	// A descriptive string that you create to describe the resource. It does not have to be unique.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// Whether SIMs can use GPRS/3G/4G/LTE data connectivity.
	DataEnabled *bool `json:"DataEnabled,omitempty"`
	// The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`.
	DataLimit *int `json:"DataLimit,omitempty"`
	// The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/wireless/api/rateplan-resource#payg-vs-quota-data-plans).
	DataMetering *string `json:"DataMetering,omitempty"`
	// Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/wireless/api/command-resource).
	MessagingEnabled *bool `json:"MessagingEnabled,omitempty"`
	// Deprecated.
	VoiceEnabled *bool `json:"VoiceEnabled,omitempty"`
	// Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming).
	NationalRoamingEnabled *bool `json:"NationalRoamingEnabled,omitempty"`
	// The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`.
	InternationalRoaming *[]string `json:"InternationalRoaming,omitempty"`
	// The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming) for more info.
	NationalRoamingDataLimit *int `json:"NationalRoamingDataLimit,omitempty"`
	// The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB.
	InternationalRoamingDataLimit *int `json:"InternationalRoamingDataLimit,omitempty"`
}

Optional parameters for the method 'CreateRatePlan'

func (*CreateRatePlanParams) SetDataEnabled

func (params *CreateRatePlanParams) SetDataEnabled(DataEnabled bool) *CreateRatePlanParams

func (*CreateRatePlanParams) SetDataLimit

func (params *CreateRatePlanParams) SetDataLimit(DataLimit int) *CreateRatePlanParams

func (*CreateRatePlanParams) SetDataMetering

func (params *CreateRatePlanParams) SetDataMetering(DataMetering string) *CreateRatePlanParams

func (*CreateRatePlanParams) SetFriendlyName

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

func (*CreateRatePlanParams) SetInternationalRoaming

func (params *CreateRatePlanParams) SetInternationalRoaming(InternationalRoaming []string) *CreateRatePlanParams

func (*CreateRatePlanParams) SetInternationalRoamingDataLimit

func (params *CreateRatePlanParams) SetInternationalRoamingDataLimit(InternationalRoamingDataLimit int) *CreateRatePlanParams

func (*CreateRatePlanParams) SetMessagingEnabled

func (params *CreateRatePlanParams) SetMessagingEnabled(MessagingEnabled bool) *CreateRatePlanParams

func (*CreateRatePlanParams) SetNationalRoamingDataLimit

func (params *CreateRatePlanParams) SetNationalRoamingDataLimit(NationalRoamingDataLimit int) *CreateRatePlanParams

func (*CreateRatePlanParams) SetNationalRoamingEnabled

func (params *CreateRatePlanParams) SetNationalRoamingEnabled(NationalRoamingEnabled bool) *CreateRatePlanParams

func (*CreateRatePlanParams) SetUniqueName

func (params *CreateRatePlanParams) SetUniqueName(UniqueName string) *CreateRatePlanParams

func (*CreateRatePlanParams) SetVoiceEnabled

func (params *CreateRatePlanParams) SetVoiceEnabled(VoiceEnabled bool) *CreateRatePlanParams

type ListAccountUsageRecordParams

type ListAccountUsageRecordParams struct {
	// Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).
	End *time.Time `json:"End,omitempty"`
	// Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).
	Start *time.Time `json:"Start,omitempty"`
	// How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period.
	Granularity *string `json:"Granularity,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 'ListAccountUsageRecord'

func (*ListAccountUsageRecordParams) SetEnd

func (*ListAccountUsageRecordParams) SetGranularity

func (params *ListAccountUsageRecordParams) SetGranularity(Granularity string) *ListAccountUsageRecordParams

func (*ListAccountUsageRecordParams) SetLimit added in v0.13.0

func (*ListAccountUsageRecordParams) SetPageSize

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

func (*ListAccountUsageRecordParams) SetStart

type ListAccountUsageRecordResponse

type ListAccountUsageRecordResponse struct {
	UsageRecords []WirelessV1AccountUsageRecord     `json:"usage_records,omitempty"`
	Meta         ListAccountUsageRecordResponseMeta `json:"meta,omitempty"`
}

ListAccountUsageRecordResponse struct for ListAccountUsageRecordResponse

type ListAccountUsageRecordResponseMeta added in v1.0.0

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

ListAccountUsageRecordResponseMeta struct for ListAccountUsageRecordResponseMeta

type ListCommandParams

type ListCommandParams struct {
	// The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read.
	Sim *string `json:"Sim,omitempty"`
	// The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`.
	Status *string `json:"Status,omitempty"`
	// Only return Commands with this direction value.
	Direction *string `json:"Direction,omitempty"`
	// Only return Commands with this transport value. Can be: `sms` or `ip`.
	Transport *string `json:"Transport,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 'ListCommand'

func (*ListCommandParams) SetDirection

func (params *ListCommandParams) SetDirection(Direction string) *ListCommandParams

func (*ListCommandParams) SetLimit added in v0.13.0

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

func (*ListCommandParams) SetPageSize

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

func (*ListCommandParams) SetSim

func (params *ListCommandParams) SetSim(Sim string) *ListCommandParams

func (*ListCommandParams) SetStatus

func (params *ListCommandParams) SetStatus(Status string) *ListCommandParams

func (*ListCommandParams) SetTransport

func (params *ListCommandParams) SetTransport(Transport string) *ListCommandParams

type ListCommandResponse

type ListCommandResponse struct {
	Commands []WirelessV1Command                `json:"commands,omitempty"`
	Meta     ListAccountUsageRecordResponseMeta `json:"meta,omitempty"`
}

ListCommandResponse struct for ListCommandResponse

type ListDataSessionParams

type ListDataSessionParams 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 'ListDataSession'

func (*ListDataSessionParams) SetLimit added in v0.13.0

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

func (*ListDataSessionParams) SetPageSize

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

type ListDataSessionResponse

type ListDataSessionResponse struct {
	DataSessions []WirelessV1DataSession            `json:"data_sessions,omitempty"`
	Meta         ListAccountUsageRecordResponseMeta `json:"meta,omitempty"`
}

ListDataSessionResponse struct for ListDataSessionResponse

type ListRatePlanParams

type ListRatePlanParams 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 'ListRatePlan'

func (*ListRatePlanParams) SetLimit added in v0.13.0

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

func (*ListRatePlanParams) SetPageSize

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

type ListRatePlanResponse

type ListRatePlanResponse struct {
	RatePlans []WirelessV1RatePlan               `json:"rate_plans,omitempty"`
	Meta      ListAccountUsageRecordResponseMeta `json:"meta,omitempty"`
}

ListRatePlanResponse struct for ListRatePlanResponse

type ListSimParams

type ListSimParams struct {
	// Only return Sim resources with this status.
	Status *string `json:"Status,omitempty"`
	// Only return Sim resources with this ICCID. This will return a list with a maximum size of 1.
	Iccid *string `json:"Iccid,omitempty"`
	// The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource.
	RatePlan *string `json:"RatePlan,omitempty"`
	// Deprecated.
	EId *string `json:"EId,omitempty"`
	// Only return Sim resources with this registration code. This will return a list with a maximum size of 1.
	SimRegistrationCode *string `json:"SimRegistrationCode,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 'ListSim'

func (*ListSimParams) SetEId

func (params *ListSimParams) SetEId(EId string) *ListSimParams

func (*ListSimParams) SetIccid

func (params *ListSimParams) SetIccid(Iccid string) *ListSimParams

func (*ListSimParams) SetLimit added in v0.13.0

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

func (*ListSimParams) SetPageSize

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

func (*ListSimParams) SetRatePlan

func (params *ListSimParams) SetRatePlan(RatePlan string) *ListSimParams

func (*ListSimParams) SetSimRegistrationCode

func (params *ListSimParams) SetSimRegistrationCode(SimRegistrationCode string) *ListSimParams

func (*ListSimParams) SetStatus

func (params *ListSimParams) SetStatus(Status string) *ListSimParams

type ListSimResponse

type ListSimResponse struct {
	Sims []WirelessV1Sim                    `json:"sims,omitempty"`
	Meta ListAccountUsageRecordResponseMeta `json:"meta,omitempty"`
}

ListSimResponse struct for ListSimResponse

type ListUsageRecordParams

type ListUsageRecordParams struct {
	// Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time.
	End *time.Time `json:"End,omitempty"`
	// Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value.
	Start *time.Time `json:"Start,omitempty"`
	// How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period.
	Granularity *string `json:"Granularity,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 'ListUsageRecord'

func (*ListUsageRecordParams) SetEnd

func (*ListUsageRecordParams) SetGranularity

func (params *ListUsageRecordParams) SetGranularity(Granularity string) *ListUsageRecordParams

func (*ListUsageRecordParams) SetLimit added in v0.13.0

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

func (*ListUsageRecordParams) SetPageSize

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

func (*ListUsageRecordParams) SetStart

func (params *ListUsageRecordParams) SetStart(Start time.Time) *ListUsageRecordParams

type ListUsageRecordResponse

type ListUsageRecordResponse struct {
	UsageRecords []WirelessV1UsageRecord            `json:"usage_records,omitempty"`
	Meta         ListAccountUsageRecordResponseMeta `json:"meta,omitempty"`
}

ListUsageRecordResponse struct for ListUsageRecordResponse

type UpdateRatePlanParams

type UpdateRatePlanParams struct {
	// An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
	UniqueName *string `json:"UniqueName,omitempty"`
	// A descriptive string that you create to describe the resource. It does not have to be unique.
	FriendlyName *string `json:"FriendlyName,omitempty"`
}

Optional parameters for the method 'UpdateRatePlan'

func (*UpdateRatePlanParams) SetFriendlyName

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

func (*UpdateRatePlanParams) SetUniqueName

func (params *UpdateRatePlanParams) SetUniqueName(UniqueName string) *UpdateRatePlanParams

type UpdateSimParams

type UpdateSimParams struct {
	// An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource.
	UniqueName *string `json:"UniqueName,omitempty"`
	// The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`.
	CallbackMethod *string `json:"CallbackMethod,omitempty"`
	// The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`).
	CallbackUrl *string `json:"CallbackUrl,omitempty"`
	// A descriptive string that you create to describe the Sim resource. It does not need to be unique.
	FriendlyName *string `json:"FriendlyName,omitempty"`
	// The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource) to which the Sim resource should be assigned.
	RatePlan *string `json:"RatePlan,omitempty"`
	//
	Status *string `json:"Status,omitempty"`
	// The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`.
	CommandsCallbackMethod *string `json:"CommandsCallbackMethod,omitempty"`
	// The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored.
	CommandsCallbackUrl *string `json:"CommandsCallbackUrl,omitempty"`
	// The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`.
	SmsFallbackMethod *string `json:"SmsFallbackMethod,omitempty"`
	// The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`.
	SmsFallbackUrl *string `json:"SmsFallbackUrl,omitempty"`
	// The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`.
	SmsMethod *string `json:"SmsMethod,omitempty"`
	// The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/wireless/api/command-resource).
	SmsUrl *string `json:"SmsUrl,omitempty"`
	// Deprecated.
	VoiceFallbackMethod *string `json:"VoiceFallbackMethod,omitempty"`
	// Deprecated.
	VoiceFallbackUrl *string `json:"VoiceFallbackUrl,omitempty"`
	// Deprecated.
	VoiceMethod *string `json:"VoiceMethod,omitempty"`
	// Deprecated.
	VoiceUrl *string `json:"VoiceUrl,omitempty"`
	//
	ResetStatus *string `json:"ResetStatus,omitempty"`
	// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts).
	AccountSid *string `json:"AccountSid,omitempty"`
}

Optional parameters for the method 'UpdateSim'

func (*UpdateSimParams) SetAccountSid

func (params *UpdateSimParams) SetAccountSid(AccountSid string) *UpdateSimParams

func (*UpdateSimParams) SetCallbackMethod

func (params *UpdateSimParams) SetCallbackMethod(CallbackMethod string) *UpdateSimParams

func (*UpdateSimParams) SetCallbackUrl

func (params *UpdateSimParams) SetCallbackUrl(CallbackUrl string) *UpdateSimParams

func (*UpdateSimParams) SetCommandsCallbackMethod

func (params *UpdateSimParams) SetCommandsCallbackMethod(CommandsCallbackMethod string) *UpdateSimParams

func (*UpdateSimParams) SetCommandsCallbackUrl

func (params *UpdateSimParams) SetCommandsCallbackUrl(CommandsCallbackUrl string) *UpdateSimParams

func (*UpdateSimParams) SetFriendlyName

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

func (*UpdateSimParams) SetRatePlan

func (params *UpdateSimParams) SetRatePlan(RatePlan string) *UpdateSimParams

func (*UpdateSimParams) SetResetStatus

func (params *UpdateSimParams) SetResetStatus(ResetStatus string) *UpdateSimParams

func (*UpdateSimParams) SetSmsFallbackMethod

func (params *UpdateSimParams) SetSmsFallbackMethod(SmsFallbackMethod string) *UpdateSimParams

func (*UpdateSimParams) SetSmsFallbackUrl

func (params *UpdateSimParams) SetSmsFallbackUrl(SmsFallbackUrl string) *UpdateSimParams

func (*UpdateSimParams) SetSmsMethod

func (params *UpdateSimParams) SetSmsMethod(SmsMethod string) *UpdateSimParams

func (*UpdateSimParams) SetSmsUrl

func (params *UpdateSimParams) SetSmsUrl(SmsUrl string) *UpdateSimParams

func (*UpdateSimParams) SetStatus

func (params *UpdateSimParams) SetStatus(Status string) *UpdateSimParams

func (*UpdateSimParams) SetUniqueName

func (params *UpdateSimParams) SetUniqueName(UniqueName string) *UpdateSimParams

func (*UpdateSimParams) SetVoiceFallbackMethod

func (params *UpdateSimParams) SetVoiceFallbackMethod(VoiceFallbackMethod string) *UpdateSimParams

func (*UpdateSimParams) SetVoiceFallbackUrl

func (params *UpdateSimParams) SetVoiceFallbackUrl(VoiceFallbackUrl string) *UpdateSimParams

func (*UpdateSimParams) SetVoiceMethod

func (params *UpdateSimParams) SetVoiceMethod(VoiceMethod string) *UpdateSimParams

func (*UpdateSimParams) SetVoiceUrl

func (params *UpdateSimParams) SetVoiceUrl(VoiceUrl string) *UpdateSimParams

type WirelessV1AccountUsageRecord

type WirelessV1AccountUsageRecord struct {
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The time period for which usage is reported
	Period *interface{} `json:"period,omitempty"`
	// An object that describes the aggregated Commands usage for all SIMs during the specified period
	Commands *interface{} `json:"commands,omitempty"`
	// An object that describes the aggregated Data usage for all SIMs over the period
	Data *interface{} `json:"data,omitempty"`
}

WirelessV1AccountUsageRecord struct for WirelessV1AccountUsageRecord

type WirelessV1Command

type WirelessV1Command struct {
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The SID of the Sim resource that the Command was sent to or from
	SimSid *string `json:"sim_sid,omitempty"`
	// The message being sent to or from the SIM
	Command     *string `json:"command,omitempty"`
	CommandMode *string `json:"command_mode,omitempty"`
	Transport   *string `json:"transport,omitempty"`
	// Whether to request a delivery receipt
	DeliveryReceiptRequested *bool   `json:"delivery_receipt_requested,omitempty"`
	Status                   *string `json:"status,omitempty"`
	Direction                *string `json:"direction,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 format
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

WirelessV1Command struct for WirelessV1Command

type WirelessV1DataSession added in v0.14.0

type WirelessV1DataSession struct {
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// The SID of the Sim resource that the Data Session is for
	SimSid *string `json:"sim_sid,omitempty"`
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The generation of wireless technology that the device was using
	RadioLink *string `json:"radio_link,omitempty"`
	// The 'mobile country code' is the unique ID of the home country where the Data Session took place
	OperatorMcc *string `json:"operator_mcc,omitempty"`
	// The 'mobile network code' is the unique ID specific to the mobile operator network where the Data Session took place
	OperatorMnc *string `json:"operator_mnc,omitempty"`
	// The three letter country code representing where the device's Data Session took place
	OperatorCountry *string `json:"operator_country,omitempty"`
	// The friendly name of the mobile operator network that the SIM-connected device is attached to
	OperatorName *string `json:"operator_name,omitempty"`
	// The unique ID of the cellular tower that the device was attached to at the moment when the Data Session was last updated
	CellId *string `json:"cell_id,omitempty"`
	// An object with the estimated location where the device's Data Session took place
	CellLocationEstimate *interface{} `json:"cell_location_estimate,omitempty"`
	// The number of packets uploaded by the device between the start time and when the Data Session was last updated
	PacketsUploaded *int `json:"packets_uploaded,omitempty"`
	// The number of packets downloaded by the device between the start time and when the Data Session was last updated
	PacketsDownloaded *int `json:"packets_downloaded,omitempty"`
	// The date that the resource was last updated, given as GMT in ISO 8601 format
	LastUpdated *time.Time `json:"last_updated,omitempty"`
	// The date that the Data Session started, given as GMT in ISO 8601 format
	Start *time.Time `json:"start,omitempty"`
	// The date that the record ended, given as GMT in ISO 8601 format
	End *time.Time `json:"end,omitempty"`
	// The unique ID of the device using the SIM to connect
	Imei *string `json:"imei,omitempty"`
}

WirelessV1DataSession struct for WirelessV1DataSession

type WirelessV1RatePlan

type WirelessV1RatePlan struct {
	// The unique string that identifies the resource
	Sid *string `json:"sid,omitempty"`
	// An application-defined string that uniquely identifies the resource
	UniqueName *string `json:"unique_name,omitempty"`
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The string that you assigned to describe the resource
	FriendlyName *string `json:"friendly_name,omitempty"`
	// Whether SIMs can use GPRS/3G/4G/LTE data connectivity
	DataEnabled *bool `json:"data_enabled,omitempty"`
	// The model used to meter data usage
	DataMetering *string `json:"data_metering,omitempty"`
	// The total data usage in Megabytes that the Network allows during one month on the home network
	DataLimit *int `json:"data_limit,omitempty"`
	// Whether SIMs can make, send, and receive SMS using Commands
	MessagingEnabled *bool `json:"messaging_enabled,omitempty"`
	// Deprecated. Whether SIMs can make and receive voice calls
	VoiceEnabled *bool `json:"voice_enabled,omitempty"`
	// Whether SIMs can roam on networks other than the home network in the United States
	NationalRoamingEnabled *bool `json:"national_roaming_enabled,omitempty"`
	// The total data usage in Megabytes that the Network allows during one month on non-home networks in the United States
	NationalRoamingDataLimit *int `json:"national_roaming_data_limit,omitempty"`
	// The services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States
	InternationalRoaming *[]string `json:"international_roaming,omitempty"`
	// The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States
	InternationalRoamingDataLimit *int `json:"international_roaming_data_limit,omitempty"`
	// The date when the resource was created, given as GMT in ISO 8601 format
	DateCreated *time.Time `json:"date_created,omitempty"`
	// The date when the resource was last updated, given as GMT in ISO 8601 format
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
}

WirelessV1RatePlan struct for WirelessV1RatePlan

type WirelessV1Sim

type WirelessV1Sim struct {
	// The unique string that identifies the Sim resource
	Sid *string `json:"sid,omitempty"`
	// An application-defined string that uniquely identifies the resource
	UniqueName *string `json:"unique_name,omitempty"`
	// The SID of the Account to which the Sim resource belongs
	AccountSid *string `json:"account_sid,omitempty"`
	// The SID of the RatePlan resource to which the Sim resource is assigned.
	RatePlanSid *string `json:"rate_plan_sid,omitempty"`
	// The string that you assigned to describe the Sim resource
	FriendlyName *string `json:"friendly_name,omitempty"`
	// The ICCID associated with the SIM
	Iccid *string `json:"iccid,omitempty"`
	// Deprecated
	EId         *string `json:"e_id,omitempty"`
	Status      *string `json:"status,omitempty"`
	ResetStatus *string `json:"reset_status,omitempty"`
	// The URL we call when the SIM originates a machine-to-machine Command
	CommandsCallbackUrl *string `json:"commands_callback_url,omitempty"`
	// The HTTP method we use to call commands_callback_url
	CommandsCallbackMethod *string `json:"commands_callback_method,omitempty"`
	// Deprecated
	SmsFallbackMethod *string `json:"sms_fallback_method,omitempty"`
	// Deprecated
	SmsFallbackUrl *string `json:"sms_fallback_url,omitempty"`
	// Deprecated
	SmsMethod *string `json:"sms_method,omitempty"`
	// Deprecated
	SmsUrl *string `json:"sms_url,omitempty"`
	// Deprecated. The HTTP method we use to call voice_fallback_url
	VoiceFallbackMethod *string `json:"voice_fallback_method,omitempty"`
	// Deprecated. The URL we call when an error occurs while retrieving or executing the TwiML requested from voice_url
	VoiceFallbackUrl *string `json:"voice_fallback_url,omitempty"`
	// Deprecated. The HTTP method we use to call voice_url
	VoiceMethod *string `json:"voice_method,omitempty"`
	// Deprecated. The URL we call when the SIM-connected device makes a voice call
	VoiceUrl *string `json:"voice_url,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 Sim resource was last updated
	DateUpdated *time.Time `json:"date_updated,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
	// The URLs of related subresources
	Links *map[string]interface{} `json:"links,omitempty"`
	// Deprecated
	IpAddress *string `json:"ip_address,omitempty"`
}

WirelessV1Sim struct for WirelessV1Sim

type WirelessV1UsageRecord added in v0.14.0

type WirelessV1UsageRecord struct {
	// The SID of the Sim resource that this Usage Record is for
	SimSid *string `json:"sim_sid,omitempty"`
	// The SID of the Account that created the resource
	AccountSid *string `json:"account_sid,omitempty"`
	// The time period for which the usage is reported
	Period *interface{} `json:"period,omitempty"`
	// An object that describes the SIM's usage of Commands during the specified period
	Commands *interface{} `json:"commands,omitempty"`
	// An object that describes the SIM's data usage during the specified period
	Data *interface{} `json:"data,omitempty"`
}

WirelessV1UsageRecord struct for WirelessV1UsageRecord

Jump to

Keyboard shortcuts

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