openapi

package
v1.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 4 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.31.0
  • 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 /v2/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

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

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

type FetchPhoneNumberParams

type FetchPhoneNumberParams struct {
	// A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence.
	Fields *string `json:"Fields,omitempty"`
	// The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format.
	CountryCode *string `json:"CountryCode,omitempty"`
}

Optional parameters for the method 'FetchPhoneNumber'

func (*FetchPhoneNumberParams) SetCountryCode

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

func (*FetchPhoneNumberParams) SetFields

func (params *FetchPhoneNumberParams) SetFields(Fields string) *FetchPhoneNumberParams

type LookupsV2PhoneNumber

type LookupsV2PhoneNumber struct {
	// An object that contains call forwarding status information
	CallForwarding *interface{} `json:"call_forwarding,omitempty"`
	// An object that contains caller name information
	CallerName *interface{} `json:"caller_name,omitempty"`
	// International dialing prefix
	CallingCountryCode *string `json:"calling_country_code,omitempty"`
	// Phone number's ISO country code
	CountryCode *string `json:"country_code,omitempty"`
	// An object that contains line type information
	LineTypeIntelligence *interface{} `json:"line_type_intelligence,omitempty"`
	// An object that contains live activity information
	LiveActivity *interface{} `json:"live_activity,omitempty"`
	// Phone number in national format
	NationalFormat *string `json:"national_format,omitempty"`
	// Phone number in E.164 format
	PhoneNumber *string `json:"phone_number,omitempty"`
	// An object that contains SIM swap information
	SimSwap *interface{} `json:"sim_swap,omitempty"`
	// The absolute URL of the resource
	Url *string `json:"url,omitempty"`
	// Boolean which indicates if the phone number is valid
	Valid *bool `json:"valid,omitempty"`
	// Contains reasons why a phone number is invalid
	ValidationErrors *[]string `json:"validation_errors,omitempty"`
}

LookupsV2PhoneNumber struct for LookupsV2PhoneNumber

Jump to

Keyboard shortcuts

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