openapi

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

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

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

README

Go API client for openapi

This is the public Twilio REST API.

Overview

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

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

Installation

Install the following dependencies:

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

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

import "./openapi"

Documentation for API Endpoints

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

Class Method HTTP request Description
HostedNumberEligibilityBulkApi FetchBulkEligibility Get /v1/HostedNumber/Eligibility/Bulk/{RequestId}
PortingPortInApi FetchPortingPortInFetch Get /v1/Porting/PortIn/{PortInRequestSid}
PortingPortabilityApi CreatePortingBulkPortability Post /v1/Porting/Portability
PortingPortabilityApi FetchPortingBulkPortability Get /v1/Porting/Portability/{Sid}
PortingPortabilityPhoneNumberApi FetchPortingPortability Get /v1/Porting/Portability/PhoneNumber/{PhoneNumber}

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

func (c *ApiService) CreatePortingBulkPortability(params *CreatePortingBulkPortabilityParams) (*NumbersV1PortingBulkPortability, error)

Allows to check if a list of phone numbers can be ported to Twilio or not. This is done asynchronous for each phone number.

func (*ApiService) FetchBulkEligibility

func (c *ApiService) FetchBulkEligibility(RequestId string) (*NumbersV1BulkEligibility, error)

Fetch an eligibility bulk check that you requested to host in Twilio.

func (*ApiService) FetchPortingBulkPortability

func (c *ApiService) FetchPortingBulkPortability(Sid string) (*NumbersV1PortingBulkPortability, error)

Fetch a previous portability check. This should return the current status of the validation and the result for all the numbers provided, given that they have been validated (as this process is performed asynchronously).

func (*ApiService) FetchPortingPortInFetch

func (c *ApiService) FetchPortingPortInFetch(PortInRequestSid string) (*NumbersV1PortingPortInFetch, error)

Fetch a port in request by SID

func (*ApiService) FetchPortingPortability

func (c *ApiService) FetchPortingPortability(PhoneNumber string, params *FetchPortingPortabilityParams) (*NumbersV1PortingPortability, error)

Allows to check if a single phone number can be ported to Twilio or not.

type CreatePortingBulkPortabilityParams

type CreatePortingBulkPortabilityParams struct {
	// The phone numbers which portability is to be checked. This should be a list of strings. Phone numbers are in E.164 format (e.g. +16175551212). .
	PhoneNumbers *[]string `json:"PhoneNumbers,omitempty"`
}

Optional parameters for the method 'CreatePortingBulkPortability'

func (*CreatePortingBulkPortabilityParams) SetPhoneNumbers

func (params *CreatePortingBulkPortabilityParams) SetPhoneNumbers(PhoneNumbers []string) *CreatePortingBulkPortabilityParams

type FetchPortingPortabilityParams

type FetchPortingPortabilityParams struct {
	// The SID of the account where the phone number(s) will be ported.
	TargetAccountSid *string `json:"TargetAccountSid,omitempty"`
}

Optional parameters for the method 'FetchPortingPortability'

func (*FetchPortingPortabilityParams) SetTargetAccountSid

func (params *FetchPortingPortabilityParams) SetTargetAccountSid(TargetAccountSid string) *FetchPortingPortabilityParams

type NumbersV1BulkEligibility

type NumbersV1BulkEligibility struct {
	// The SID of the bulk eligibility check that you want to know about.
	RequestId *string `json:"request_id,omitempty"`
	// This is the url of the request that you're trying to reach out to locate the resource.
	Url *string `json:"url,omitempty"`
	// The result set that contains the eligibility check response for each requested number, each result has at least the following attributes:  phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number's ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status.
	Results *[]interface{} `json:"results,omitempty"`
	// This is the string that you assigned as a friendly name for describing the eligibility check request.
	FriendlyName *string `json:"friendly_name,omitempty"`
	// This is the status of the bulk eligibility check request. (Example: COMPLETE, IN_PROGRESS)
	Status        *string    `json:"status,omitempty"`
	DateCreated   *time.Time `json:"date_created,omitempty"`
	DateCompleted *time.Time `json:"date_completed,omitempty"`
}

NumbersV1BulkEligibility struct for NumbersV1BulkEligibility

type NumbersV1Eligibility

type NumbersV1Eligibility struct {
	// The result set that contains the eligibility check response for the requested number, each result has at least the following attributes:  phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, date_last_checked: Datetime (ISO 8601) when the PN was last checked for eligibility, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number's ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status.
	Results *[]interface{} `json:"results,omitempty"`
}

NumbersV1Eligibility struct for NumbersV1Eligibility

type NumbersV1PortingBulkPortability

type NumbersV1PortingBulkPortability struct {
	// A 34 character string that uniquely identifies this Portability check.
	Sid    *string `json:"sid,omitempty"`
	Status *string `json:"status,omitempty"`
	// The date that the Portability check was created, given in ISO 8601 format.
	DatetimeCreated *time.Time `json:"datetime_created,omitempty"`
	// Contains a list with all the information of the requested phone numbers. Each phone number contains the following properties: `phone_number`: The phone number which portability is to be checked. `portable`: Boolean flag specifying if phone number is portable or not. `not_portable_reason`: Reason why the phone number cannot be ported into Twilio, `null` otherwise. `not_portable_reason_code`: The Portability Reason Code for the phone number if it cannot be ported in Twilio, `null` otherwise. `pin_and_account_number_required`: Boolean flag specifying if PIN and account number is required for the phone number. `number_type`: The type of the requested phone number. `country` Country the phone number belongs to. `messaging_carrier` Current messaging carrier of the phone number. `voice_carrier` Current voice carrier of the phone number.
	PhoneNumbers *[]interface{} `json:"phone_numbers,omitempty"`
	// This is the url of the request that you're trying to reach out to locate the resource.
	Url *string `json:"url,omitempty"`
}

NumbersV1PortingBulkPortability struct for NumbersV1PortingBulkPortability

type NumbersV1PortingPortIn

type NumbersV1PortingPortIn struct {
	// The SID of the Port In request. This is a unique identifier of the port in request.
	PortInRequestSid *string `json:"port_in_request_sid,omitempty"`
	Url              *string `json:"url,omitempty"`
}

NumbersV1PortingPortIn struct for NumbersV1PortingPortIn

type NumbersV1PortingPortInFetch

type NumbersV1PortingPortInFetch struct {
	// The SID of the Port In request. This is a unique identifier of the port in request.
	PortInRequestSid *string `json:"port_in_request_sid,omitempty"`
	// The URL of this Port In request
	Url *string `json:"url,omitempty"`
	// The Account SID that the numbers will be added to after they are ported into Twilio.
	AccountSid *string `json:"account_sid,omitempty"`
	// List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails.
	NotificationEmails *[]string `json:"notification_emails,omitempty"`
	// Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation.
	TargetPortInDate *string `json:"target_port_in_date,omitempty"`
	// Minimum hour in the future needs to be established with the Ops team for validation.
	TargetPortInTimeRangeStart *string `json:"target_port_in_time_range_start,omitempty"`
	// Maximum hour in the future needs to be established with the Ops team for validation.
	TargetPortInTimeRangeEnd *string `json:"target_port_in_time_range_end,omitempty"`
	// The information for the losing carrier.
	LosingCarrierInformation *interface{} `json:"losing_carrier_information,omitempty"`
	// The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212).
	PhoneNumbers *[]interface{} `json:"phone_numbers,omitempty"`
	// The list of documents SID referencing a utility bills
	Documents *[]string `json:"documents,omitempty"`
}

NumbersV1PortingPortInFetch struct for NumbersV1PortingPortInFetch

type NumbersV1PortingPortability

type NumbersV1PortingPortability struct {
	// The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212).
	PhoneNumber *string `json:"phone_number,omitempty"`
	// The target account sid to which the number will be ported
	AccountSid *string `json:"account_sid,omitempty"`
	// Boolean flag specifying if phone number is portable or not.
	Portable *bool `json:"portable,omitempty"`
	// Boolean flag specifying if PIN and account number is required for the phone number.
	PinAndAccountNumberRequired *bool `json:"pin_and_account_number_required,omitempty"`
	// Reason why the phone number cannot be ported into Twilio, `null` otherwise.
	NotPortableReason *string `json:"not_portable_reason,omitempty"`
	// The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`.
	NotPortableReasonCode *int    `json:"not_portable_reason_code,omitempty"`
	NumberType            *string `json:"number_type,omitempty"`
	// Country the phone number belongs to.
	Country *string `json:"country,omitempty"`
	// Current messaging carrier of the phone number
	MessagingCarrier *string `json:"messaging_carrier,omitempty"`
	// Current voice carrier of the phone number
	VoiceCarrier *string `json:"voice_carrier,omitempty"`
	// This is the url of the request that you're trying to reach out to locate the resource.
	Url *string `json:"url,omitempty"`
}

NumbersV1PortingPortability struct for NumbersV1PortingPortability

Jump to

Keyboard shortcuts

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