openapi

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 4 Imported by: 2

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

Class Method HTTP request Description
PhoneNumbersApi FetchPhoneNumber Get /v1/PhoneNumbers/{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 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) FetchPhoneNumber added in v0.11.0

func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumberParams) (*LookupsV1PhoneNumber, error)

type FetchPhoneNumberParams

type FetchPhoneNumberParams struct {
	// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format.
	CountryCode *string `json:"CountryCode,omitempty"`
	// The type of information to return. Can be: `carrier` or `caller-name`. The default is null.  Carrier information costs $0.005 per phone number looked up.  Caller Name information is currently available only in the US and costs $0.01 per phone number looked up.  To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value.
	Type *[]string `json:"Type,omitempty"`
	// The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about  Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons).
	AddOns *[]string `json:"AddOns,omitempty"`
	// Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on.
	AddOnsData *map[string]interface{} `json:"AddOnsData,omitempty"`
}

Optional parameters for the method 'FetchPhoneNumber'

func (*FetchPhoneNumberParams) SetAddOns

func (params *FetchPhoneNumberParams) SetAddOns(AddOns []string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetAddOnsData

func (params *FetchPhoneNumberParams) SetAddOnsData(AddOnsData map[string]interface{}) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetCountryCode

func (params *FetchPhoneNumberParams) SetCountryCode(CountryCode string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetType

func (params *FetchPhoneNumberParams) SetType(Type []string) *FetchPhoneNumberParams

type LookupsV1PhoneNumber

type LookupsV1PhoneNumber struct {
	// The name of the phone number's owner. If `null`, that information was not available.
	CallerName *interface{} `json:"caller_name,omitempty"`
	// The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) for the phone number.
	CountryCode *string `json:"country_code,omitempty"`
	// The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number.
	PhoneNumber *string `json:"phone_number,omitempty"`
	// The phone number, in national format.
	NationalFormat *string `json:"national_format,omitempty"`
	// The telecom company that provides the phone number.
	Carrier *interface{} `json:"carrier,omitempty"`
	// A JSON string with the results of the Add-ons you specified in the `add_ons` parameters. For the format of the object, see [Using Add-ons](https://www.twilio.com/docs/add-ons).
	AddOns *interface{} `json:"add_ons,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

LookupsV1PhoneNumber struct for LookupsV1PhoneNumber

Jump to

Keyboard shortcuts

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