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: 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.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 /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, identity_match.
	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"`
	// User’s first name. This query parameter is only used (optionally) for identity_match package requests.
	FirstName *string `json:"FirstName,omitempty"`
	// User’s last name. This query parameter is only used (optionally) for identity_match package requests.
	LastName *string `json:"LastName,omitempty"`
	// User’s first address line. This query parameter is only used (optionally) for identity_match package requests.
	AddressLine1 *string `json:"AddressLine1,omitempty"`
	// User’s second address line. This query parameter is only used (optionally) for identity_match package requests.
	AddressLine2 *string `json:"AddressLine2,omitempty"`
	// User’s city. This query parameter is only used (optionally) for identity_match package requests.
	City *string `json:"City,omitempty"`
	// User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests.
	State *string `json:"State,omitempty"`
	// User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests.
	PostalCode *string `json:"PostalCode,omitempty"`
	// User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests.
	AddressCountryCode *string `json:"AddressCountryCode,omitempty"`
	// User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests.
	NationalId *string `json:"NationalId,omitempty"`
	// User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests.
	DateOfBirth *string `json:"DateOfBirth,omitempty"`
}

Optional parameters for the method 'FetchPhoneNumber'

func (*FetchPhoneNumberParams) SetAddressCountryCode added in v1.2.2

func (params *FetchPhoneNumberParams) SetAddressCountryCode(AddressCountryCode string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetAddressLine1 added in v1.2.2

func (params *FetchPhoneNumberParams) SetAddressLine1(AddressLine1 string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetAddressLine2 added in v1.2.2

func (params *FetchPhoneNumberParams) SetAddressLine2(AddressLine2 string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetCity added in v1.2.2

func (params *FetchPhoneNumberParams) SetCity(City string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetCountryCode

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

func (*FetchPhoneNumberParams) SetDateOfBirth added in v1.2.2

func (params *FetchPhoneNumberParams) SetDateOfBirth(DateOfBirth string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetFields

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

func (*FetchPhoneNumberParams) SetFirstName added in v1.2.2

func (params *FetchPhoneNumberParams) SetFirstName(FirstName string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetLastName added in v1.2.2

func (params *FetchPhoneNumberParams) SetLastName(LastName string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetNationalId added in v1.2.2

func (params *FetchPhoneNumberParams) SetNationalId(NationalId string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetPostalCode added in v1.2.2

func (params *FetchPhoneNumberParams) SetPostalCode(PostalCode string) *FetchPhoneNumberParams

func (*FetchPhoneNumberParams) SetState added in v1.2.2

func (params *FetchPhoneNumberParams) SetState(State string) *FetchPhoneNumberParams

type LookupsV2PhoneNumber

type LookupsV2PhoneNumber struct {
	// International dialing prefix of the phone number defined in the E.164 standard.
	CallingCountryCode *string `json:"calling_country_code,omitempty"`
	// The phone number's [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
	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](https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers).
	NationalFormat *string `json:"national_format,omitempty"`
	// Boolean which indicates if the phone number is in a valid range that can be freely assigned by a carrier to a user.
	Valid *bool `json:"valid,omitempty"`
	// Contains reasons why a phone number is invalid. Possible values: TOO_SHORT, TOO_LONG, INVALID_BUT_POSSIBLE, INVALID_COUNTRY_CODE, INVALID_LENGTH, NOT_A_NUMBER.
	ValidationErrors *[]string `json:"validation_errors,omitempty"`
	// An object that contains caller name information based on [CNAM](https://support.twilio.com/hc/en-us/articles/360051670533-Getting-Started-with-CNAM-Caller-ID).
	CallerName *interface{} `json:"caller_name,omitempty"`
	// An object that contains information on the last date the subscriber identity module (SIM) was changed for a mobile phone number.
	SimSwap *interface{} `json:"sim_swap,omitempty"`
	// An object that contains information on the unconditional call forwarding status of mobile phone number.
	CallForwarding *interface{} `json:"call_forwarding,omitempty"`
	// An object that contains live activity information for a mobile phone number.
	LiveActivity *interface{} `json:"live_activity,omitempty"`
	// An object that contains line type information including the carrier name, mobile country code, and mobile network code.
	LineTypeIntelligence *interface{} `json:"line_type_intelligence,omitempty"`
	// An object that contains identity match information. The result of comparing user-provided information including name, address, date of birth, national ID, against authoritative phone-based data sources
	IdentityMatch *interface{} `json:"identity_match,omitempty"`
	// An object that contains information on if a phone number has been currently or previously blocked by Verify Fraud Guard for receiving malicious SMS pumping traffic as well as other signals associated with risky carriers and low conversion rates.
	SmsPumpingRisk *interface{} `json:"sms_pumping_risk,omitempty"`
	// The absolute URL of the resource.
	Url *string `json:"url,omitempty"`
}

LookupsV2PhoneNumber struct for LookupsV2PhoneNumber

Jump to

Keyboard shortcuts

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