plivo

package module
v7.45.5 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 25 Imported by: 6

README

plivo-go

Build, Unit Tests, Linters Status codecov Go Report Card GoDoc

The Plivo Go SDK makes it simpler to integrate communications into your Go applications using the Plivo REST API. Using the SDK, you will be able to make voice calls, send messages and generate Plivo XML to control your call flows.

Prerequisites

  • Go >= 1.13.x

Getting started

The steps described below uses go modules.

Create a new project (optional)
$ mkdir ~/helloplivo
$ cd ~/helloplivo
$ go mod init helloplivo

This will generate a go.mod and go.sum file.

Add plivo-go as a dependency to your project
$ go get github.com/plivo/plivo-go/v7
Authentication

To make the API requests, you need to create a Client and provide it with authentication credentials (which can be found at https://manage.plivo.com/dashboard/).

We recommend that you store your credentials in the PLIVO_AUTH_ID and the PLIVO_AUTH_TOKEN environment variables, so as to avoid the possibility of accidentally committing them to source control. If you do this, you can initialise the client with no arguments and it will automatically fetch them from the environment variables:

package main

import "github.com/plivo/plivo-go/v7"

func main()  {
	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
}

Alternatively, you can specifiy the authentication credentials while initializing the Client.

package main

import "github.com/plivo/plivo-go/v7"

func main()  {
	client, err := plivo.NewClient("<auth-id>", "<auth-token>", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
}

The Basics

The SDK uses consistent interfaces to create, retrieve, update, delete and list resources. The pattern followed is as follows:

client.Resources.Create(Params{}) // Create
client.Resources.Get(Id) // Get
client.Resources.Update(Id, Params{}) // Update
client.Resources.Delete(Id) // Delete
client.Resources.List() // List all resources, max 20 at a time

Using client.Resources.List() would list the first 20 resources by default (which is the first page, with limit as 20, and offset as 0). To get more, you will have to use limit and offset to get the second page of resources.

Examples

Send a message
package main

import "github.com/plivo/plivo-go/v7"

func main() {
	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	client.Messages.Create(plivo.MessageCreateParams{
		Src:  "the_source_number",
		Dst:  "the_destination_number",
		Text: "Hello, world!",
	})
}
Make a call
package main

import "github.com/plivo/plivo-go/v7"

func main() {
	client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	client.Calls.Create(plivo.CallCreateParams{
		From:      "the_source_number",
		To:        "the_destination_number",
		AnswerURL: "http://answer.url",
	})
}

Lookup a number
package main

import (
	"fmt"
	"log"

	"github.com/plivo/plivo-go/v7"
)

func main() {
	client, err := plivo.NewClient("<auth-id>", "<auth-token>", &plivo.ClientOptions{})
	if err != nil {
		log.Fatalf("plivo.NewClient() failed: %s", err.Error())
	}

	resp, err := client.Lookup.Get("<insert-number-here>", plivo.LookupParams{})
	if err != nil {
		if respErr, ok := err.(*plivo.LookupError); ok {
			fmt.Printf("API ID: %s\nError Code: %d\nMessage: %s\n",
				respErr.ApiID, respErr.ErrorCode, respErr.Message)
			return
		}
		log.Fatalf("client.Lookup.Get() failed: %s", err.Error())
	}

	fmt.Printf("%+v\n", resp)
}
Generate Plivo XML
package main

import "github.com/plivo/plivo-go/v7/xml"

func main() {
	println(xml.ResponseElement{
		Contents: []interface{}{
			new(xml.SpeakElement).SetContents("Hello, world!"),
		},
	}.String())
}

This generates the following XML:

<Response>
  <Speak>Hello, world!</Speak>
</Response>
Run a PHLO
package main

import (
	"fmt"
	"github.com/plivo/plivo-go/v7"
)

// Initialize the following params with corresponding values to trigger resources

const authId = "auth_id"
const authToken = "auth_token"
const phloId = "phlo_id"

// with payload in request

func main() {
	testPhloRunWithParams()
}

func testPhloRunWithParams() {
	phloClient, err := plivo.NewPhloClient(authId, authToken, &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	phloGet, err := phloClient.Phlos.Get(phloId)
	if err != nil {
		panic(err)
	}
	//pass corresponding from and to values
	type params map[string]interface{}
	response, err := phloGet.Run(params{
		"from": "111111111",
		"to":   "2222222222",
	})

	if err != nil {
		println(err)
	}
	fmt.Printf("Response: %#v\n", response)
}
More examples

Refer to the Plivo API Reference for more examples.

Local Development

Note: Requires latest versions of Docker & Docker-Compose. If you're on MacOS, ensure Docker Desktop is running.

  1. Export the following environment variables in your host machine:
export PLIVO_AUTH_ID=<your_auth_id>
export PLIVO_AUTH_TOKEN=<your_auth_token>
export PLIVO_API_DEV_HOST=<plivoapi_dev_endpoint>
export PLIVO_API_PROD_HOST=<plivoapi_public_endpoint>
  1. Run make build. This will create a docker container in which the sdk will be setup and dependencies will be installed.

The entrypoint of the docker container will be the setup_sdk.sh script. The script will handle all the necessary changes required for local development. 3. The above command will print the docker container id (and instructions to connect to it) to stdout. 4. The testing code can be added to <sdk_dir_path>/go-sdk-test/test.go in host
(or /usr/src/app/go-sdk-test/test.go in container) 5. The sdk directory will be mounted as a volume in the container. So any changes in the sdk code will also be reflected inside the container. 6. To run test code, run make run CONTAINER=<cont_id> in host. 7. To run unit tests, run make test CONTAINER=<cont_id> in host. <cont_id> is the docker container id created in 2.
(The docker container should be running)

Test code and unit tests can also be run within the container using make run and make test respectively. (CONTAINER argument should be omitted when running from the container)

Documentation

Index

Constants

View Source
const (
	SMS = "sms"
	MMS = "mms"
)
View Source
const ABORT_TRANSFER = "abort_transfer"
View Source
const CallInsightsBaseURL = "stats.plivo.com"
View Source
const CallInsightsFeedbackPath = "v1/Call/%s/Feedback/"
View Source
const CallInsightsParams = "call_insights_params"
View Source
const CallInsightsRequestPath = "call_insights_feedback_path"
View Source
const HANGUP = "hangup"
View Source
const HOLD = "hold"
View Source
const RESUME_CALL = "resume_call"
View Source
const UNHOLD = "unhold"
View Source
const VOICEMAIL_DROP = "voicemail_drop"

Variables

View Source
var HttpsScheme = "https"

Functions

func ComputeSignature

func ComputeSignature(authToken, uri string, params map[string]string) string

func ComputeSignatureV2

func ComputeSignatureV2(authToken, uri string, nonce string) string

func ComputeSignatureV3

func ComputeSignatureV3(authToken, uri, method string, nonce string, params map[string]string) string

func Find

func Find(val string, slice []string) bool

func GenerateUrl

func GenerateUrl(uri string, params map[string]string, method string) string

func GetSortedQueryParamString

func GetSortedQueryParamString(params map[string]string, queryParams bool) string

func Headers

func Headers(headers map[string]string) string

Some code from encode.go from the Go Standard Library

func MakeMPCId

func MakeMPCId(MpcUuid string, FriendlyName string) string

func MultipleValidIntegers

func MultipleValidIntegers(paramname string, paramvalue interface{})

func Numbers

func Numbers(numbers ...string) string

func ValidateSignature

func ValidateSignature(authToken, uri string, params map[string]string, signature string) bool

func ValidateSignatureV2

func ValidateSignatureV2(uri string, nonce string, signature string, authToken string) bool

func ValidateSignatureV3

func ValidateSignatureV3(uri, nonce, method, signature, authToken string, params ...map[string]string) bool

Types

type Account

type Account struct {
	AccountType  string `json:"account_type,omitempty" url:"account_type,omitempty"` // The type of your Plivo account. All accounts with funds are standard accounts. If your account is on free trial, this attribute will return developer.
	Address      string `json:"address,omitempty" url:"address,omitempty"`           // The postal address of the account which will be reflected in the invoices.
	ApiID        string `json:"api_id,omitempty" url:"api_id,omitempty"`
	AuthID       string `json:"auth_id,omitempty" url:"auth_id,omitempty"`             // The auth id of the account.
	AutoRecharge bool   `json:"auto_recharge,omitempty" url:"auto_recharge,omitempty"` // Auto recharge settings associated with the account. If this value is true, we will recharge your account if the credits fall below a certain threshold.
	BillingMode  string `json:"billing_mode,omitempty" url:"billing_mode,omitempty"`   // The billing mode of the account. Can be prepaid or postpaid.
	CashCredits  string `json:"cash_credits,omitempty" url:"cash_credits,omitempty"`   // Credits of the account.
	City         string `json:"city,omitempty" url:"city,omitempty"`                   // The city of the account.
	Name         string `json:"name,omitempty" url:"name,omitempty"`                   // The name of the account holder.
	ResourceURI  string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	State        string `json:"state,omitempty" url:"state,omitempty"`       // The state of the account holder.
	Timezone     string `json:"timezone,omitempty" url:"timezone,omitempty"` // The timezone of the account.
}

func (Account) ID

func (self Account) ID() string

type AccountService

type AccountService struct {
	// contains filtered or unexported fields
}

func (*AccountService) Get

func (service *AccountService) Get() (response *Account, err error)

func (*AccountService) Update

func (service *AccountService) Update(params AccountUpdateParams) (response *SubaccountUpdateResponse, err error)

type AccountUpdateParams

type AccountUpdateParams struct {
	Name    string `json:"name,omitempty" url:"name,omitempty"`       // Name of the account holder or business.
	Address string `json:"address,omitempty" url:"address,omitempty"` // City of the account holder.
	City    string `json:"city,omitempty" url:"city,omitempty"`       // Address of the account holder.
}

type Address added in v7.12.1

type Address struct {
	Street     string `json:"street" validate:"max=100"`
	City       string `json:"city" validate:"max=100"`
	State      string `json:"state" validate:"max=20"`
	PostalCode string `json:"postal_code" validate:"max=10"`
	Country    string `json:"country" validate:"max=2"`
}

type Application

type Application struct {
	FallbackMethod      string `json:"fallback_method,omitempty" url:"fallback_method,omitempty"`
	DefaultApp          bool   `json:"default_app,omitempty" url:"default_app,omitempty"`
	AppName             string `json:"app_name,omitempty" url:"app_name,omitempty"`
	ProductionApp       bool   `json:"production_app,omitempty" url:"production_app,omitempty"`
	AppID               string `json:"app_id,omitempty" url:"app_id,omitempty"`
	HangupURL           string `json:"hangup_url,omitempty" url:"hangup_url,omitempty"`
	AnswerURL           string `json:"answer_url,omitempty" url:"answer_url,omitempty"`
	MessageURL          string `json:"message_url,omitempty" url:"message_url,omitempty"`
	ResourceURI         string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	HangupMethod        string `json:"hangup_method,omitempty" url:"hangup_method,omitempty"`
	MessageMethod       string `json:"message_method,omitempty" url:"message_method,omitempty"`
	FallbackAnswerURL   string `json:"fallback_answer_url,omitempty" url:"fallback_answer_url,omitempty"`
	AnswerMethod        string `json:"answer_method,omitempty" url:"answer_method,omitempty"`
	ApiID               string `json:"api_id,omitempty" url:"api_id,omitempty"`
	LogIncomingMessages bool   `json:"log_incoming_messages,omitempty" url:"log_incoming_messages,omitempty"`
	PublicURI           bool   `json:"public_uri,omitempty" url:"public_uri,omitempty"`

	// Additional fields for Modify calls
	DefaultNumberApp   bool `json:"default_number_app,omitempty" url:"default_number_app,omitempty"`
	DefaultEndpointApp bool `json:"default_endpoint_app,omitempty" url:"default_endpoint_app,omitempty"`
}

func (Application) ID

func (self Application) ID() string

type ApplicationCreateParams

type ApplicationCreateParams struct {
	FallbackMethod      string `json:"fallback_method,omitempty" url:"fallback_method,omitempty"`
	DefaultApp          bool   `json:"default_app,omitempty" url:"default_app,omitempty"`
	AppName             string `json:"app_name,omitempty" url:"app_name,omitempty"`
	ProductionApp       bool   `json:"production_app,omitempty" url:"production_app,omitempty"`
	AppID               string `json:"app_id,omitempty" url:"app_id,omitempty"`
	HangupURL           string `json:"hangup_url,omitempty" url:"hangup_url,omitempty"`
	AnswerURL           string `json:"answer_url,omitempty" url:"answer_url,omitempty"`
	MessageURL          string `json:"message_url,omitempty" url:"message_url,omitempty"`
	ResourceURI         string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	HangupMethod        string `json:"hangup_method,omitempty" url:"hangup_method,omitempty"`
	MessageMethod       string `json:"message_method,omitempty" url:"message_method,omitempty"`
	FallbackAnswerURL   string `json:"fallback_answer_url,omitempty" url:"fallback_answer_url,omitempty"`
	AnswerMethod        string `json:"answer_method,omitempty" url:"answer_method,omitempty"`
	ApiID               string `json:"api_id,omitempty" url:"api_id,omitempty"`
	LogIncomingMessages bool   `json:"log_incoming_messages,omitempty" url:"log_incoming_messages,omitempty"`
	PublicURI           bool   `json:"public_uri,omitempty" url:"public_uri,omitempty"`

	// Additional fields for Modify calls
	DefaultNumberApp   bool `json:"default_number_app,omitempty" url:"default_number_app,omitempty"`
	DefaultEndpointApp bool `json:"default_endpoint_app,omitempty" url:"default_endpoint_app,omitempty"`
}

TODO Verify against docs

type ApplicationCreateResponseBody

type ApplicationCreateResponseBody struct {
	Message string `json:"message" url:"message"`
	ApiID   string `json:"api_id" url:"api_id"`
	AppID   string `json:"app_id" url:"app_id"`
}

Stores response for Create call

type ApplicationDeleteParams

type ApplicationDeleteParams struct {
	Cascade                bool   `json:"cascade" url:"cascade"` // Specify if the Application should be cascade deleted or not. Takes a value of True or False
	NewEndpointApplication string `json:"new_endpoint_application,omitempty" url:"new_endpoint_application,omitempty"`
}

type ApplicationList

type ApplicationList struct {
	BaseListResponse
	Objects []Application `json:"objects" url:"objects"`
}

type ApplicationListParams

type ApplicationListParams struct {
	Subaccount string `url:"subaccount,omitempty"`

	Limit  int `url:"limit,omitempty"`
	Offset int `url:"offset,omitempty"`
}

type ApplicationService

type ApplicationService struct {
	// contains filtered or unexported fields
}

func (*ApplicationService) Create

func (service *ApplicationService) Create(params ApplicationCreateParams) (response *ApplicationCreateResponseBody, err error)

func (*ApplicationService) Delete

func (service *ApplicationService) Delete(appId string, data ...ApplicationDeleteParams) (err error)

func (*ApplicationService) Get

func (service *ApplicationService) Get(appId string) (response *Application, err error)

func (*ApplicationService) List

func (service *ApplicationService) List(params ApplicationListParams) (response *ApplicationList, err error)

func (*ApplicationService) Update

func (service *ApplicationService) Update(appId string, params ApplicationUpdateParams) (response *ApplicationUpdateResponse, err error)

type ApplicationUpdateParams

type ApplicationUpdateParams ApplicationCreateParams

TODO Check against docs

type ApplicationUpdateResponse

type ApplicationUpdateResponse BaseResponse

type AttemptCharges added in v7.33.0

type AttemptCharges struct {
	AttemptUUID string `json:"attempt_uuid,omitempty"`
	Channel     string `json:"channel,omitempty"`
	Charge      string `json:"charge,omitempty"`
}

type AttemptDetails added in v7.33.0

type AttemptDetails struct {
	Channel     string    `json:"channel,omitempty"`
	AttemptUUID string    `json:"attempt_uuid,omitempty"`
	Status      string    `json:"status,omitempty"`
	Time        time.Time `json:"time,omitempty"`
}

type AuthorizedContact added in v7.12.1

type AuthorizedContact struct {
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
	Phone     string `json:"phone,omitempty" validate:"max=16"`
	Email     string `json:"email,omitempty" validate:"max=100"`
	Title     string `json:"title,omitempty"`
	Seniority string `json:"seniority,omitempty"`
}

type BaseClient

type BaseClient struct {
	AuthId    string
	AuthToken string

	BaseUrl *url.URL

	RequestInterceptor  func(request *http.Request)
	ResponseInterceptor func(response *http.Response)
	// contains filtered or unexported fields
}

func (*BaseClient) ExecuteRequest

func (client *BaseClient) ExecuteRequest(request *http.Request, body interface{}, extra ...map[string]interface{}) (err error)

func (*BaseClient) NewRequest

func (client *BaseClient) NewRequest(method string, params interface{}, baseRequestString string, formatString string,
	formatParams ...interface{}) (request *http.Request, err error)

type BaseListMediaResponse

type BaseListMediaResponse struct {
	ApiID string    `json:"api_id" url:"api_id"`
	Meta  MediaMeta `json:"meta" url:"meta"`
	Media []Media   `json:"objects" url:"objects"`
}

List of media information

type BaseListPPKResponse

type BaseListPPKResponse struct {
	ApiID string  `json:"api_id" url:"api_id"`
	Meta  PPKMeta `json:"meta" url:"meta"`
}

type BaseListParams

type BaseListParams struct {
	Limit  int `json:"limit,omitempty" url:"limit,omitempty"`
	Offset int `json:"offset,omitempty" url:"offset,omitempty"`
}

type BaseListResponse

type BaseListResponse struct {
	ApiID string `json:"api_id" url:"api_id"`
	Meta  Meta   `json:"meta" url:"meta"`
}

type BaseResource

type BaseResource struct {
	// contains filtered or unexported fields
}

type BaseResourceInterface

type BaseResourceInterface struct {
	// contains filtered or unexported fields
}

type BaseResponse

type BaseResponse struct {
	ApiId   string `json:"api_id" url:"api_id"`
	Message string `json:"message" url:"message"`
}

type Brand

type Brand struct {
	BrandAlias         string            `json:"brand_alias,omitempty"`
	EntityType         string            `json:"entity_type,omitempty"`
	BrandID            string            `json:"brand_id,omitempty"`
	ProfileUUID        string            `json:"profile_uuid,omitempty"`
	FirstName          string            `json:"first_name,omitempty"`
	LastName           string            `json:"last_name,omitempty"`
	Name               string            `json:"name,omitempty"`
	CompanyName        string            `json:"company_name,omitempty"`
	BrandType          string            `json:"brand_type,omitempty"`
	Ein                string            `json:"ein,omitempty"`
	EinIssuingCountry  string            `json:"ein_issuing_country,omitempty"`
	StockSymbol        string            `json:"stock_symbol,omitempty"`
	StockExchange      string            `json:"stock_exchange,omitempty"`
	Website            string            `json:"website,omitempty"`
	Vertical           string            `json:"vertical,omitempty"`
	AltBusinessID      string            `json:"alt_business_id,omitempty"`
	AltBusinessidType  string            `json:"alt_business_id_type,omitempty"`
	RegistrationStatus string            `json:"registration_status,omitempty"`
	VettingStatus      string            `json:"vetting_status,omitempty"`
	VettingScore       int64             `json:"vetting_score,omitempty"`
	Address            Address           `json:"address,omitempty"`
	AuthorizedContact  AuthorizedContact `json:"authorized_contact,omitempty"`
	CreatedAt          string            `json:"created_at,omitempty"`
}

type BrandCreationParams

type BrandCreationParams struct {
	BrandAlias       string  `json:"brand_alias" url:"brand_alias" validate:"required"`
	Type             string  `json:"brand_type" url:"brand_type" validate:"oneof= STARTER STANDARD ''"`
	ProfileUUID      string  `json:"profile_uuid" url:"profile_uuid" validate:"required,max=36"`
	SecondaryVetting *string `json:"secondary_vetting,omitempty" url:"secondary_vetting,omitempty"`
	URL              string  `json:"url,omitempty" url:"url,omitempty"`
	Method           string  `json:"method,omitempty" url:"method,omitempty"`
}

type BrandCreationResponse

type BrandCreationResponse struct {
	ApiID   string `json:"api_id,omitempty"`
	BrandID string `json:"brand_id,omitempty"`
	Message string `json:"message,omitempty"`
}

type BrandDeleteResponse added in v7.15.0

type BrandDeleteResponse struct {
	ApiID   string `json:"api_id,omitempty"`
	BrandID string `json:"brand_id,omitempty"`
	Message string `json:"message,omitempty"`
}

type BrandGetResponse

type BrandGetResponse struct {
	ApiID string `json:"api_id,omitempty"`
	Brand Brand  `json:"brand,omitempty"`
}

type BrandListParams

type BrandListParams struct {
	Type   *string `json:"type,omitempty"`
	Status *string `json:"status,omitempty"`
	Limit  int     `url:"limit,omitempty"`
	Offset int     `url:"offset,omitempty"`
}

type BrandListResponse

type BrandListResponse struct {
	ApiID string `json:"api_id,omitempty"`
	Meta  struct {
		Previous   *string
		Next       *string
		Offset     int64
		Limit      int64
		TotalCount int64 `json:"total_count"`
	} `json:"meta"`
	BrandResponse []Brand `json:"brands,omitempty"`
}

type BrandService

type BrandService struct {
	// contains filtered or unexported fields
}

func (*BrandService) Create

func (service *BrandService) Create(params BrandCreationParams) (response *BrandCreationResponse, err error)

func (*BrandService) Delete added in v7.15.0

func (service *BrandService) Delete(brandID string) (response *BrandDeleteResponse, err error)

func (*BrandService) Get

func (service *BrandService) Get(brandID string) (response *BrandGetResponse, err error)

func (*BrandService) List

func (service *BrandService) List(params BrandListParams) (response *BrandListResponse, err error)

func (*BrandService) Usecases added in v7.14.0

func (service *BrandService) Usecases(brandID string) (response *BrandUsecaseResponse, err error)

type BrandUsecaseResponse added in v7.14.0

type BrandUsecaseResponse struct {
	ApiID    string    `json:"api_id,omitempty"`
	Usecases []Usecase `json:"use_cases"`
	BrandID  string    `json:"brand_id"`
}

type BuyPhoneNumberParam

type BuyPhoneNumberParam struct {
	Number       string `json:"number,omitempty"`
	Country_iso2 string `json:"country_iso,omitempty"`
	Type         string `json:"type,omitempty"`
	Region       string `json:"region,omitempty"`
	Pattern      string `json:"pattern,omitempty"`
	Service      string `json:"service,omitempty"`
}

type Call

type Call struct {
	AnswerTime        string `json:"answer_time,omitempty" url:"answer_time,omitempty"`
	BillDuration      int64  `json:"bill_duration,omitempty" url:"bill_duration,omitempty"`
	BilledDuration    int64  `json:"billed_duration,omitempty" url:"billed_duration,omitempty"`
	CallDirection     string `json:"call_direction,omitempty" url:"call_direction,omitempty"`
	CallDuration      int64  `json:"call_duration,omitempty" url:"call_duration,omitempty"`
	CallState         string `json:"call_state,omitempty" url:"call_state,omitempty"`
	CallUUID          string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	ConferenceUUID    string `json:"conference_uuid,omitempty"`
	EndTime           string `json:"end_time,omitempty" url:"end_time,omitempty"`
	FromNumber        string `json:"from_number,omitempty" url:"from_number,omitempty"`
	HangupCauseCode   int64  `json:"hangup_cause_code,omitempty" url:"hangup_cause_code,omitempty"`
	HangupCauseName   string `json:"hangup_cause_name,omitempty" url:"hangup_cause_name,omitempty"`
	HangupSource      string `json:"hangup_source,omitempty" url:"hangup_source,omitempty"`
	InitiationTime    string `json:"initiation_time,omitempty" url:"initiation_time,omitempty"`
	ParentCallUUID    string `json:"parent_call_uuid,omitempty" url:"parent_call_uuid,omitempty"`
	ResourceURI       string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	ToNumber          string `json:"to_number,omitempty" url:"to_number,omitempty"`
	TotalAmount       string `json:"total_amount,omitempty" url:"total_amount,omitempty"`
	TotalRate         string `json:"total_rate,omitempty" url:"total_rate,omitempty"`
	StirVerification  string `json:"stir_verification,omitempty" url:"stir_verification,omitempty"`
	VoiceNetworkGroup string `json:"voice_network_group,omitempty" url:"voice_network_group,omitempty"`
	StirAttestation   string `json:"stir_attestation,omitempty" url:"stir_attestation,omitempty"`
	SourceIp          string `json:"source_ip,omitempty" url:"source_ip,omitempty"`
	CnamLookup        string `json:"cnam_lookup,omitempty" url:"cnam_lookup,omitempty"`
}

func (Call) ID

func (self Call) ID() string

type CallAddParticipant

type CallAddParticipant struct {
	To       string `json:"to,omitempty" url:"to,omitempty"`
	From     string `json:"from,omitempty" url:"from,omitempty"`
	CallUuid string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
}

type CallCreateParams

type CallCreateParams struct {
	// Required parameters.
	From      string `json:"from,omitempty" url:"from,omitempty"`
	To        string `json:"to,omitempty" url:"to,omitempty"`
	AnswerURL string `json:"answer_url,omitempty" url:"answer_url,omitempty"`
	// Optional parameters.
	AnswerMethod           string `json:"answer_method,omitempty" url:"answer_method,omitempty"`
	RingURL                string `json:"ring_url,omitempty" url:"ring_url,omitempty"`
	RingMethod             string `json:"ring_method,omitempty" url:"ring_method,omitempty"`
	HangupURL              string `json:"hangup_url,omitempty" url:"hangup_url,omitempty"`
	HangupMethod           string `json:"hangup_method,omitempty" url:"hangup_method,omitempty"`
	FallbackURL            string `json:"fallback_url,omitempty" url:"fallback_url,omitempty"`
	FallbackMethod         string `json:"fallback_method,omitempty" url:"fallback_method,omitempty"`
	CallerName             string `json:"caller_name,omitempty" url:"caller_name,omitempty"`
	SendDigits             string `json:"send_digits,omitempty" url:"send_digits,omitempty"`
	SendOnPreanswer        bool   `json:"send_on_preanswer,omitempty" url:"send_on_preanswer,omitempty"`
	TimeLimit              int64  `json:"time_limit,omitempty" url:"time_limit,omitempty"`
	HangupOnRing           int64  `json:"hangup_on_ring,omitempty" url:"hangup_on_ring,omitempty"`
	MachineDetection       string `json:"machine_detection,omitempty" url:"machine_detection,omitempty"`
	MachineDetectionTime   int64  `json:"machine_detection_time,omitempty" url:"machine_detection_time,omitempty"`
	MachineDetectionUrl    string `json:"machine_detection_url,omitempty" url:"machine_detection_url,omitempty"`
	MachineDetectionMethod string `json:"machine_detection_method,omitempty" url:"machine_detection_method,omitempty"`
	SipHeaders             string `json:"sip_headers,omitempty" url:"sip_headers,omitempty"`
	RingTimeout            int64  `json:"ring_timeout,omitempty" url:"ring_timeout,omitempty"`
}

type CallCreateResponse

type CallCreateResponse struct {
	Message     string      `json:"message" url:"message"`
	ApiID       string      `json:"api_id" url:"api_id"`
	RequestUUID interface{} `json:"request_uuid" url:"request_uuid"`
}

Stores response for making a call.

type CallDTMFParams

type CallDTMFParams struct {
	Digits string `json:"digits" url:"digits"`
	Legs   string `json:"legs,omitempty" url:"legs,omitempty"`
}

type CallDTMFResponseBody

type CallDTMFResponseBody struct {
	Message string `json:"message,omitempty" url:"message,omitempty"`
	ApiID   string `json:"api_id,omitempty" url:"api_id,omitempty"`
}

type CallFeedbackCreateResponse

type CallFeedbackCreateResponse struct {
	ApiID   string `json:"api_id"`
	Message string `json:"message"`
	Status  string `json:"status"`
}

type CallFeedbackParams

type CallFeedbackParams struct {
	CallUUID string      `json:"call_uuid"`
	Notes    string      `json:"notes"`
	Rating   interface{} `json:"rating"`
	Issues   []string    `json:"issues"`
}

type CallFeedbackService

type CallFeedbackService struct {
	// contains filtered or unexported fields
}

func (*CallFeedbackService) Create

func (service *CallFeedbackService) Create(params CallFeedbackParams) (response *CallFeedbackCreateResponse, err error)

type CallListParams

type CallListParams struct {
	// Query parameters.
	Subaccount      string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
	CallDirection   string `json:"call_direction,omitempty" url:"call_direction,omitempty"`
	FromNumber      string `json:"from_number,omitempty" url:"from_number,omitempty"`
	ToNumber        string `json:"to_number,omitempty" url:"to_number,omitempty"`
	ParentCallUUID  string `json:"parent_call_uuid,omitempty" url:"parent_call_uuid,omitempty"`
	EndTimeEquals   string `json:"end_time,omitempty" url:"end_time,omitempty"`
	HangupCauseCode int64  `json:"hangup_cause_code,omitempty" url:"hangup_cause_code,omitempty"`
	HangupSource    string `json:"hangup_source,omitempty" url:"hangup_source,omitempty"`

	EndTimeLessThan string `json:"end_time__lt,omitempty" url:"end_time__lt,omitempty"`

	EndTimeGreaterThan string `json:"end_time__gt,omitempty" url:"end_time__gt,omitempty"`

	EndTimeLessOrEqual string `json:"end_time__lte,omitempty" url:"end_time__lte,omitempty"`

	EndTimeGreaterOrEqual string `json:"end_time__gte,omitempty" url:"end_time__gte,omitempty"`

	BillDurationEquals string `json:"bill_duration,omitempty" url:"bill_duration,omitempty"`

	BillDurationLessThan string `json:"bill_duration__lt,omitempty" url:"bill_duration__lt,omitempty"`

	BillDurationGreaterThan string `json:"bill_duration__gt,omitempty" url:"bill_duration__gt,omitempty"`

	BillDurationLessOrEqual string `json:"bill_duration__lte,omitempty" url:"bill_duration__lte,omitempty"`

	BillDurationGreaterOrEqual string `json:"bill_duration__gte,omitempty" url:"bill_duration__gte,omitempty"`
	Limit                      int64  `json:"limit,omitempty" url:"limit,omitempty"`
	Offset                     int64  `json:"offset,omitempty" url:"offset,omitempty"`
}

type CallListResponse

type CallListResponse struct {
	ApiID   string  `json:"api_id" url:"api_id"`
	Meta    *Meta   `json:"meta" url:"meta"`
	Objects []*Call `json:"objects" url:"objects"`
}

type CallPlayParams

type CallPlayParams struct {
	URLs   string `json:"urls" url:"urls"`
	Length string `json:"length,omitempty" url:"length,omitempty"`
	Legs   string `json:"legs,omitempty" url:"legs,omitempty"`
	Loop   bool   `json:"loop,omitempty" url:"loop,omitempty"`
	Mix    bool   `json:"mix,omitempty" url:"mix,omitempty"`
}

type CallPlayResponse

type CallPlayResponse struct {
	Message string `json:"message,omitempty" url:"message,omitempty"`
	ApiID   string `json:"api_id,omitempty" url:"api_id,omitempty"`
}

type CallRecordParams

type CallRecordParams struct {
	TimeLimit           int64  `json:"time_limit,omitempty" url:"time_limit,omitempty"`
	FileFormat          string `json:"file_format,omitempty" url:"file_format,omitempty"`
	TranscriptionType   string `json:"transcription_type,omitempty" url:"transcription_type,omitempty"`
	TranscriptionURL    string `json:"transcription_url,omitempty" url:"transcription_url,omitempty"`
	TranscriptionMethod string `json:"transcription_method,omitempty" url:"transcription_method,omitempty"`
	CallbackURL         string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod      string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
}

type CallRecordResponse

type CallRecordResponse struct {
	Message     string `json:"message,omitempty" url:"message,omitempty"`
	URL         string `json:"url,omitempty" url:"url,omitempty"`
	APIID       string `json:"api_id,omitempty" url:"api_id,omitempty"`
	RecordingID string `json:"recording_id,omitempty" url:"recording_id,omitempty"`
}

type CallService

type CallService struct {
	// contains filtered or unexported fields
}

func (*CallService) CancelRequest

func (service *CallService) CancelRequest(requestId string) (err error)

func (*CallService) Create

func (service *CallService) Create(params CallCreateParams) (response *CallCreateResponse, err error)

func (*CallService) Delete

func (service *CallService) Delete(CallId string) (err error)

func (*CallService) Get

func (service *CallService) Get(CallId string) (response *Call, err error)

func (*CallService) GetAllStreams added in v7.32.0

func (service *CallService) GetAllStreams(CallId string) (response *CallStreamGetAll, err error)

func (*CallService) GetSpecificStream added in v7.32.0

func (service *CallService) GetSpecificStream(CallId string, StreamId string) (response *CallStreamGetSpecific, err error)

func (*CallService) List

func (service *CallService) List(params CallListParams) (response *CallListResponse, err error)

func (*CallService) Play

func (service *CallService) Play(callId string, params CallPlayParams) (response *CallPlayResponse, err error)

func (*CallService) Record

func (service *CallService) Record(callId string, params CallRecordParams) (response *CallRecordResponse, err error)

func (*CallService) SendDigits

func (service *CallService) SendDigits(callId string, params CallDTMFParams) (response *CallDTMFResponseBody, err error)

func (*CallService) Speak

func (service *CallService) Speak(callId string, params CallSpeakParams) (response *CallSpeakResponse, err error)

func (*CallService) StopAllStreams added in v7.32.0

func (service *CallService) StopAllStreams(CallId string) (err error)

func (*CallService) StopPlaying

func (service *CallService) StopPlaying(callId string) (err error)

func (*CallService) StopRecording

func (service *CallService) StopRecording(callId string) (err error)

func (*CallService) StopSpeaking

func (service *CallService) StopSpeaking(callId string) (err error)

func (*CallService) StopSpecificStream added in v7.32.0

func (service *CallService) StopSpecificStream(CallId string, StreamId string) (err error)

func (*CallService) Stream added in v7.32.0

func (service *CallService) Stream(CallId string, params CallStreamParams) (response *CallStreamResponse, err error)

func (*CallService) Update

func (service *CallService) Update(CallId string, params CallUpdateParams) (response *CallUpdateResponse, err error)

type CallSpeakParams

type CallSpeakParams struct {
	Text           string `json:"text" url:"text"`
	Voice          string `json:"length,omitempty" url:"length,omitempty"`
	Language       string `json:"language,omitempty" url:"language,omitempty"`
	Legs           string `json:"legs,omitempty" url:"legs,omitempty"`
	Loop           bool   `json:"loop,omitempty" url:"loop,omitempty"`
	Mix            bool   `json:"mix,omitempty" url:"mix,omitempty"`
	Type           string `json:"type,omitempty" url:"type,omitempty"`
	CallbackURL    string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
}

type CallSpeakResponse

type CallSpeakResponse struct {
	Message string `json:"message,omitempty" url:"message,omitempty"`
	ApiID   string `json:"api_id,omitempty" url:"api_id,omitempty"`
}

type CallStreamGetAll added in v7.32.0

type CallStreamGetAll struct {
	ApiID   string                   `json:"api_id,omitempty" url:"api_id,omitempty"`
	Meta    Meta                     `json:"meta,omitempty" url:"meta,omitempty"`
	Objects []CallStreamGetAllObject `json:"objects" url:"objects"`
}

type CallStreamGetAllObject added in v7.32.0

type CallStreamGetAllObject struct {
	AudioTrack          string `json:"audio_track" url:"audio_track"`
	Bidirectional       bool   `json:"bidirectional" url:"bidirectional"`
	BilledAmount        string `json:"billed_amount" url:"billed_amount"`
	BillDuration        int64  `json:"bill_duration" url:"bill_duration"`
	CallUUID            string `json:"call_uuid" url:"call_uuid"`
	CreatedAt           string `json:"created_at" url:"created_at"`
	EndTime             string `json:"end_time" url:"end_time"`
	PlivoAuthId         string `json:"plivo_auth_id" url:"plivo_auth_id"`
	ResourceURI         string `json:"resource_uri" url:"resource_uri"`
	RoundedBillDuration string `json:"rounded_bill_duration" url:"rounded_bill_duration"`
	ServiceURL          string `json:"service_url" url:"service_url"`
	StartTime           string `json:"start_time" url:"start_time"`
	Status              string `json:"status" url:"status"`
	StatusCallbackURL   string `json:"status_callback_url" url:"status_callback_url"`
	StreamID            string `json:"stream_id" url:"stream_id"`
}

type CallStreamGetSpecific added in v7.32.0

type CallStreamGetSpecific struct {
	ApiID               string `json:"api_id,omitempty" url:"api_id,omitempty"`
	AudioTrack          string `json:"audio_track" url:"audio_track"`
	Bidirectional       bool   `json:"bidirectional" url:"bidirectional"`
	BilledAmount        string `json:"billed_amount" url:"billed_amount"`
	BillDuration        int64  `json:"bill_duration" url:"bill_duration"`
	CallUUID            string `json:"call_uuid" url:"call_uuid"`
	CreatedAt           string `json:"created_at" url:"created_at"`
	EndTime             string `json:"end_time" url:"end_time"`
	PlivoAuthId         string `json:"plivo_auth_id" url:"plivo_auth_id"`
	ResourceURI         string `json:"resource_uri" url:"resource_uri"`
	RoundedBillDuration string `json:"rounded_bill_duration" url:"rounded_bill_duration"`
	ServiceURL          string `json:"service_url" url:"service_url"`
	StartTime           string `json:"start_time" url:"start_time"`
	Status              string `json:"status" url:"status"`
	StatusCallbackURL   string `json:"status_callback_url" url:"status_callback_url"`
	StreamID            string `json:"stream_id" url:"stream_id"`
}

type CallStreamParams added in v7.32.0

type CallStreamParams struct {
	ServiceUrl           string `json:"service_url,omitempty" url:"service_url,omitempty"`
	Bidirectional        bool   `json:"bidirectional,omitempty" url:"bidirectional,omitempty"`
	AudioTrack           string `json:"audio_track,omitempty" url:"audio_track,omitempty"`
	StreamTimeout        int64  `json:"stream_timeout,omitempty" url:"stream_timeout,omitempty"`
	StatusCallbackUrl    string `json:"status_callback_url,omitempty" url:"status_callback_url,omitempty"`
	StatusCallbackMethod string `json:"status_callback_method,omitempty" url:"status_callback_method,omitempty"`
	ContentType          string `json:"content_type,omitempty" url:"content_type,omitempty"`
	ExtraHeaders         string `json:"extra_headers,omitempty" url:"extra_headers,omitempty"`
}

type CallStreamResponse added in v7.32.0

type CallStreamResponse struct {
	Message  string `json:"message,omitempty" url:"message,omitempty"`
	APIID    string `json:"api_id,omitempty" url:"api_id,omitempty"`
	StreamID string `json:"stream_id,omitempty" url:"stream_id,omitempty"`
}

type CallUpdateParams

type CallUpdateParams struct {
	Legs       string `json:"legs,omitempty" url:"legs,omitempty"`
	AlegURL    string `json:"aleg_url,omitempty" url:"aleg_url,omitempty"`
	AlegMethod string `json:"aleg_method,omitempty" url:"aleg_method,omitempty"`
	BlegURL    string `json:"bleg_url,omitempty" url:"bleg_url,omitempty"`
	BlegMethod string `json:"bleg_method,omitempty" url:"bleg_method,omitempty"`
}

type CallUpdateResponse

type CallUpdateResponse struct {
	ApiID   string `json:"api_id" url:"api_id"`
	Message string `json:"message" url:"message"`
}

type Campaign

type Campaign struct {
	BrandID             string             `json:"brand_id,omitempty"`
	CampaignID          string             `json:"campaign_id,omitempty"`
	MnoMetadata         MnoMetadata        `json:"mno_metadata,omitempty"`
	ResellerID          string             `json:"reseller_id,omitempty"`
	Usecase             string             `json:"usecase,omitempty"`
	SubUsecase          string             `json:"sub_usecase,omitempty"`
	RegistrationStatus  string             `json:"registration_status,omitempty"`
	MessageFlow         string             `json:"message_flow,omitempty"`
	HelpMessage         string             `json:"help_message,omitempty"`
	OptinKeywords       string             `json:"optin_keywords,omitempty"`
	OptinMessage        string             `json:"optin_message,omitempty"`
	OptoutKeywords      string             `json:"optout_keywords,omitempty"`
	OptoutMessage       string             `json:"optout_message,omitempty"`
	HelpKeywords        string             `json:"help_keywords,omitempty"`
	SampleMessage1      string             `json:"sample1,omitempty"`
	SampleMessage2      string             `json:"sample2,omitempty"`
	CampaignDescription string             `json:"description,omitempty"`
	CampaignAttributes  CampaignAttributes `json:"campaign_attributes,omitempty"`
	CreatedAt           string             `json:"created_at,omitempty"`
	CampaignSource      string             `json:"campaign_source,omitempty"`
	ErrorCode           string             `json:"error_code,omitempty"`
	ErrorReason         string             `json:"error_reason,omitempty"`
	Vertical            string             `json:"vertical,omitempty"`
	CampaignAlias       string             `json:"campaign_alias,omitempty"`
}

type CampaignAttributes added in v7.14.0

type CampaignAttributes struct {
	EmbeddedLink       bool `json:"embedded_link"`
	EmbeddedPhone      bool `json:"embedded_phone"`
	AgeGated           bool `json:"age_gated"`
	DirectLending      bool `json:"direct_lending"`
	SubscriberOptin    bool `json:"subscriber_optin"`
	SubscriberOptout   bool `json:"subscriber_optout"`
	SubscriberHelp     bool `json:"subscriber_help"`
	AffiliateMarketing bool `json:"affiliate_marketing"`
}

type CampaignCreateResponse added in v7.12.1

type CampaignCreateResponse struct {
	ApiID      string `json:"api_id,omitempty"`
	CampaignID string `json:"campaign_id"`
	Message    string `json:"message,omitempty"`
}

type CampaignCreationParams

type CampaignCreationParams struct {
	BrandID            string    `json:"brand_id" url:"brand_id" validate:"required"`
	CampaignAlias      *string   `json:"campaign_alias,omitempty" url:"campaign_alias,omitempty"`
	Vertical           string    `json:"vertical" url:"vertical"`
	Usecase            string    `json:"usecase" url:"usecase"`
	ResellerID         string    `json:" reseller_id,omitempty" url:" reseller_id,omitempty"`
	SubUsecases        *[]string `json:"sub_usecases" url:"sub_usecases"`
	Description        string    `json:"description,omitempty" url:"description,omitempty"`
	EmbeddedLink       *bool     `json:"embedded_link,omitempty" url:"embedded_link,omitempty"`
	EmbeddedPhone      *bool     `json:"embedded_phone,omitempty" url:"embedded_phone,omitempty"`
	AgeGated           *bool     `json:"age_gated,omitempty" url:"age_gated,omitempty"`
	DirectLending      *bool     `json:"direct_lending,omitempty" url:"direct_lending,omitempty"`
	SubscriberOptin    bool      `json:"subscriber_optin" url:"subscriber_optin"`
	SubscriberOptout   bool      `json:"subscriber_optout" url:"subscriber_optout"`
	SubscriberHelp     bool      `json:"subscriber_help" url:"subscriber_help"`
	AffiliateMarketing bool      `json:"affiliate_marketing" url:"subscriber_help"`
	Sample1            *string   `json:"sample1" url:"sample1"`
	Sample2            *string   `json:"sample2,omitempty" url:"sample2,omitempty"`
	URL                string    `json:"url,omitempty" url:"url,omitempty"`
	Method             string    `json:"method,omitempty" url:"method,omitempty"`
	MessageFlow        string    `json:"message_flow,omitempty" url:"message_flow"`
	HelpMessage        string    `json:"help_message,omitempty" url:"help_message"`
	OptinKeywords      string    `json:"optin_keywords,omitempty" url:"optin_keywords"`
	OptinMessage       string    `json:"optin_message,omitempty" url:"optin_message"`
	OptoutKeywords     string    `json:"optout_keywords,omitempty" url:"optout_keywords"`
	OptoutMessage      string    `json:"optout_message,omitempty" url:"optout_message"`
	HelpKeywords       string    `json:"help_keywords,omitempty" url:"help_keywords"`
}

type CampaignDeleteResponse added in v7.15.0

type CampaignDeleteResponse struct {
	ApiID      string `json:"api_id"`
	CampaignID string `json:"campaign_id,omitempty"`
	Message    string `json:"message,omitempty"`
}

type CampaignGetResponse added in v7.12.1

type CampaignGetResponse struct {
	ApiID    string   `json:"api_id"`
	Campaign Campaign `json:"campaign"`
}

type CampaignListParams

type CampaignListParams struct {
	BrandID            *string `url:"brand_id,omitempty"`
	Usecase            *string `url:"usecase,omitempty"`
	RegistrationStatus *string `url:"registration_status,omitempty"`
	CampaignSource     *string `url:"campaign_source,omitempty"`
	Limit              int     `url:"limit,omitempty"`
	Offset             int     `url:"offset,omitempty"`
}

type CampaignListResponse

type CampaignListResponse struct {
	ApiID string `json:"api_id,omitempty"`
	Meta  struct {
		Previous   *string
		Next       *string
		Offset     int64
		Limit      int64
		TotalCount int64 `json:"total_count"`
	} `json:"meta"`
	CampaignResponse []Campaign `json:"campaigns,omitempty"`
}

type CampaignNumber added in v7.12.1

type CampaignNumber struct {
	Number string `json:"number"`
	Status string `json:"status"`
}

type CampaignNumberGetResponse added in v7.12.1

type CampaignNumberGetResponse struct {
	ApiID                 string           `json:"api_id"`
	CampaignID            string           `json:"campaign_id"`
	CampaignAlias         string           `json:"campaign_alias"`
	CampaignUseCase       string           `json:"usecase"`
	CampaignNumbers       []CampaignNumber `json:"phone_numbers"`
	CampaignNumberSummary map[string]int   `json:"phone_numbers_summary,omitempty"`
	NumberPoolLimit       int              `json:"number_pool_limit,omitempty"`
}

type CampaignNumberLinkParams added in v7.12.1

type CampaignNumberLinkParams struct {
	Numbers []string `json:"numbers,omitempty"`
	URL     string   `json:"url,omitempty"`
	Method  string   `json:"method,omitempty"`
}

type CampaignNumberLinkUnlinkResponse added in v7.12.1

type CampaignNumberLinkUnlinkResponse struct {
	ApiID   string `json:"api_id"`
	Message string `json:"message,omitempty"`
}

type CampaignNumberUnlinkParams added in v7.12.1

type CampaignNumberUnlinkParams struct {
	URL    string `json:"url,omitempty"`
	Method string `json:"method,omitempty"`
}

type CampaignNumbersGetParams added in v7.12.1

type CampaignNumbersGetParams struct {
	Limit  int `url:"limit,omitempty"`
	Offset int `url:"offset,omitempty"`
}

type CampaignService

type CampaignService struct {
	// contains filtered or unexported fields
}

func (*CampaignService) Create

func (service *CampaignService) Create(params CampaignCreationParams) (response *CampaignCreateResponse, err error)

func (*CampaignService) Delete added in v7.15.0

func (service *CampaignService) Delete(campaignID string) (response *CampaignDeleteResponse, err error)

func (*CampaignService) Get

func (service *CampaignService) Get(campaignID string) (response *CampaignGetResponse, err error)

func (*CampaignService) Import added in v7.38.0

func (service *CampaignService) Import(params ImportCampaignParams) (response *CampaignCreateResponse, err error)

func (*CampaignService) List

func (service *CampaignService) List(params CampaignListParams) (response *CampaignListResponse, err error)

func (*CampaignService) NumberGet added in v7.12.1

func (service *CampaignService) NumberGet(campaignID, number string) (response *CampaignNumberGetResponse, err error)
func (service *CampaignService) NumberLink(campaignID string, params CampaignNumberLinkParams) (response *CampaignNumberLinkUnlinkResponse, err error)
func (service *CampaignService) NumberUnlink(campaignID, number string, params CampaignNumberUnlinkParams) (response *CampaignNumberLinkUnlinkResponse, err error)

func (*CampaignService) NumbersGet added in v7.12.1

func (service *CampaignService) NumbersGet(campaignID string, params CampaignNumbersGetParams) (response *CampaignNumberGetResponse, err error)

func (*CampaignService) Update added in v7.16.0

func (service *CampaignService) Update(campaignID string, params CampaignUpdateParams) (response *CampaignGetResponse, err error)

type CampaignUpdateParams added in v7.16.0

type CampaignUpdateParams struct {
	ResellerID     string `json:" reseller_id,omitempty" url:" reseller_id,omitempty"`
	Description    string `json:"description,omitempty" url:"description,omitempty"`
	Sample1        string `json:"sample1" url:"sample1"`
	Sample2        string `json:"sample2,omitempty" url:"sample2,omitempty"`
	MessageFlow    string `json:"message_flow,omitempty" url:"message_flow"`
	HelpMessage    string `json:"help_message,omitempty" url:"help_message"`
	OptinKeywords  string `json:"optin_keywords,omitempty" url:"optin_keywords"`
	OptinMessage   string `json:"optin_message,omitempty" url:"optin_message"`
	OptoutKeywords string `json:"optout_keywords,omitempty" url:"optout_keywords"`
	OptoutMessage  string `json:"optout_message,omitempty" url:"optout_message"`
	HelpKeywords   string `json:"help_keywords,omitempty" url:"help_keywords"`
}

type Carrier

type Carrier struct {
	MobileCountryCode string `json:"mobile_country_code"`
	MobileNetworkCode string `json:"mobile_network_code"`
	Name              string `json:"name"`
	Type              string `json:"type"`
	Ported            string `json:"ported"`
}

type Charges added in v7.33.0

type Charges struct {
	TotalCharge      string           `json:"total_charge,omitempty"`
	ValidationCharge string           `json:"validation_charge,omitempty"`
	AttemptCharges   []AttemptCharges `json:"attempt_charges,omitempty"`
}

type Client

type Client struct {
	BaseClient
	Messages                    *MessageService
	Accounts                    *AccountService
	Subaccounts                 *SubaccountService
	Applications                *ApplicationService
	Endpoints                   *EndpointService
	Numbers                     *NumberService
	PhoneNumbers                *PhoneNumberService
	Pricing                     *PricingService // TODO Rename?
	Recordings                  *RecordingService
	Calls                       *CallService
	Token                       *TokenService
	LiveCalls                   *LiveCallService
	QueuedCalls                 *QueuedCallService
	Conferences                 *ConferenceService
	CallFeedback                *CallFeedbackService
	Powerpack                   *PowerpackService
	Media                       *MediaService
	Lookup                      *LookupService
	EndUsers                    *EndUserService
	ComplianceDocuments         *ComplianceDocumentService
	ComplianceDocumentTypes     *ComplianceDocumentTypeService
	ComplianceRequirements      *ComplianceRequirementService
	ComplianceApplications      *ComplianceApplicationService
	MultiPartyCall              *MultiPartyCallService
	Brand                       *BrandService
	Profile                     *ProfileService
	Campaign                    *CampaignService
	MaskingSession              *MaskingSessionService
	VerifySession               *VerifyService
	VerifyCallerId              *VerifyCallerIdService
	TollFreeRequestVerification *TollfreeVerificationService
}

func NewClient

func NewClient(authId, authToken string, options *ClientOptions) (client *Client, err error)

To set a proxy for all requests, configure the Transport for the HttpClient passed in:

	&http.Client{
 		Transport: &http.Transport{
 			Proxy: http.ProxyURL("http//your.proxy.here"),
 		},
 	}

Similarly, to configure the timeout, set it on the HttpClient passed in:

	&http.Client{
 		Timeout: time.Minute,
 	}

func (*Client) NewRequest

func (client *Client) NewRequest(method string, params interface{}, formatString string,
	formatParams ...interface{}) (*http.Request, error)

type ClientOptions

type ClientOptions struct {
	HttpClient *http.Client
}

type ComplianceApplicationListParams

type ComplianceApplicationListParams struct {
	Limit       int    `json:"limit,omitempty" url:"limit,omitempty"`
	Offset      int    `json:"offset,omitempty" url:"offset,omitempty"`
	EndUserID   string `json:"end_user_id,omitempty" url:"end_user_id,omitempty"`
	Country     string `json:"country,omitempty" url:"country,omitempty"`
	NumberType  string `json:"number_type,omitempty" url:"number_type,omitempty"`
	EndUserType string `json:"end_user_type,omitempty" url:"end_user_type,omitempty"`
	Alias       string `json:"alias,omitempty" url:"alias,omitempty"`
	Status      string `json:"status,omitempty" url:"status,omitempty"`
}

type ComplianceApplicationResponse

type ComplianceApplicationResponse struct {
	APIID                   string    `json:"api_id"`
	CreatedAt               time.Time `json:"created_at"`
	ComplianceApplicationID string    `json:"compliance_application_id"`
	Alias                   string    `json:"alias"`
	Status                  string    `json:"status"`
	EndUserType             string    `json:"end_user_type"`
	CountryIso2             string    `json:"country_iso2"`
	NumberType              string    `json:"number_type"`
	EndUserID               string    `json:"end_user_id"`
	ComplianceRequirementID string    `json:"compliance_requirement_id"`
	Documents               []struct {
		DocumentID       string `json:"document_id"`
		Name             string `json:"name"`
		DocumentName     string `json:"document_name,omitempty"`
		DocumentTypeID   string `json:"document_type_id,omitempty"`
		DocumentTypeName string `json:"document_type_name,omitempty"`
		Scope            string `json:"scope,omitempty"`
	} `json:"documents"`
}

type ComplianceApplicationService

type ComplianceApplicationService struct {
	// contains filtered or unexported fields
}

func (*ComplianceApplicationService) Create

func (*ComplianceApplicationService) Delete

func (service *ComplianceApplicationService) Delete(complianceApplicationId string) (err error)

func (*ComplianceApplicationService) Get

func (service *ComplianceApplicationService) Get(complianceApplicationId string) (response *ComplianceApplicationResponse, err error)

func (*ComplianceApplicationService) List

func (*ComplianceApplicationService) Submit

func (service *ComplianceApplicationService) Submit(complianceApplicationId string) (response *SubmitComplianceApplicationResponse, err error)

func (*ComplianceApplicationService) Update

type ComplianceDocumentListParams

type ComplianceDocumentListParams struct {
	Limit          int    `json:"limit,omitempty" url:"limit,omitempty"`
	Offset         int    `json:"offset,omitempty" url:"offset,omitempty"`
	EndUserID      string `json:"end_user_id,omitempty" url:"end_user_id,omitempty"`
	DocumentTypeID string `json:"document_type_id,omitempty" url:"document_type_id,omitempty"`
	Alias          string `json:"alias,omitempty" url:"alias,omitempty"`
}

type ComplianceDocumentService

type ComplianceDocumentService struct {
	// contains filtered or unexported fields
}

func (*ComplianceDocumentService) Create

func (*ComplianceDocumentService) Delete

func (service *ComplianceDocumentService) Delete(complianceDocumentId string) (err error)

func (*ComplianceDocumentService) Get

func (service *ComplianceDocumentService) Get(complianceDocumentId string) (response *GetComplianceDocumentResponse, err error)

func (*ComplianceDocumentService) List

func (*ComplianceDocumentService) Update

type ComplianceDocumentTypeService

type ComplianceDocumentTypeService struct {
	// contains filtered or unexported fields
}

func (*ComplianceDocumentTypeService) Get

func (service *ComplianceDocumentTypeService) Get(docId string) (response *GetComplianceDocumentTypeResponse, err error)

func (*ComplianceDocumentTypeService) List

type ComplianceRequirementService

type ComplianceRequirementService struct {
	// contains filtered or unexported fields
}

func (*ComplianceRequirementService) Get

func (service *ComplianceRequirementService) Get(complianceRequirementId string) (response *GetComplianceRequirementResponse, err error)

func (*ComplianceRequirementService) List

type Component added in v7.35.0

type Component struct {
	Type       string      `mapstructure:"type" json:"type" validate:"required"`
	SubType    string      `mapstructure:"sub_type" json:"sub_type,omitempty"`
	Index      string      `mapstructure:"index" json:"index,omitempty"`
	Parameters []Parameter `mapstructure:"parameters" json:"parameters"`
}

type Conference

type Conference struct {
	ConferenceName        string   `json:"conference_name,omitempty" url:"conference_name,omitempty"`
	ConferenceRunTime     string   `json:"conference_run_time,omitempty" url:"conference_run_time,omitempty"`
	ConferenceMemberCount string   `json:"conference_member_count,omitempty" url:"conference_member_count,omitempty"`
	Members               []Member `json:"members,omitempty" url:"members,omitempty"`
}

func (Conference) ID

func (self Conference) ID() string

type ConferenceIDListResponseBody

type ConferenceIDListResponseBody struct {
	ApiID       string   `json:"api_id" url:"api_id"`
	Conferences []string `json:"conferences" url:"conferences"`
}

type ConferenceMemberActionResponse

type ConferenceMemberActionResponse struct {
	Message  string   `json:"message" url:"message"`
	APIID    string   `json:"api_id" url:"api_id"`
	MemberID []string `json:"member_id" url:"member_id"`
}

type ConferenceMemberSpeakParams

type ConferenceMemberSpeakParams struct {
	Text     string `json:"text" url:"text"`
	Voice    string `json:"voice,omitempty" url:"voice,omitempty"`
	Language string `json:"language,omitempty" url:"language,omitempty"`
}

type ConferenceRecordParams

type ConferenceRecordParams struct {
	TimeLimit           int64  `json:"time_limit,omitempty" url:"time_limit,omitempty"`
	FileFormat          string `json:"file_format,omitempty" url:"file_format,omitempty"`
	TranscriptionType   string `json:"transcription_type,omitempty" url:"transcription_type,omitempty"`
	TranscriptionUrl    string `json:"transcription_url,omitempty" url:"transcription_url,omitempty"`
	TranscriptionMethod string `json:"transcription_method,omitempty" url:"transcription_method,omitempty"`
	CallbackUrl         string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod      string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
}

type ConferenceRecordResponseBody

type ConferenceRecordResponseBody struct {
	Message string `json:"message,omitempty" url:"message,omitempty"`
	Url     string `json:"url,omitempty" url:"url,omitempty"`
}

type ConferenceService

type ConferenceService struct {
	// contains filtered or unexported fields
}

func (*ConferenceService) Delete

func (service *ConferenceService) Delete(ConferenceId string) (err error)

func (*ConferenceService) DeleteAll

func (service *ConferenceService) DeleteAll() (err error)

func (*ConferenceService) Get

func (service *ConferenceService) Get(ConferenceId string) (response *Conference, err error)

func (*ConferenceService) IDList

func (service *ConferenceService) IDList() (response *ConferenceIDListResponseBody, err error)

func (*ConferenceService) MemberDeaf

func (service *ConferenceService) MemberDeaf(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberHangup

func (service *ConferenceService) MemberHangup(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberKick

func (service *ConferenceService) MemberKick(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberMute

func (service *ConferenceService) MemberMute(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberPlay

func (service *ConferenceService) MemberPlay(conferenceId, memberId, url string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberPlayStop

func (service *ConferenceService) MemberPlayStop(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberSpeak

func (service *ConferenceService) MemberSpeak(conferenceId, memberId string, params ConferenceMemberSpeakParams) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberSpeakStop

func (service *ConferenceService) MemberSpeakStop(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberUndeaf

func (service *ConferenceService) MemberUndeaf(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) MemberUnmute

func (service *ConferenceService) MemberUnmute(conferenceId, memberId string) (response *ConferenceMemberActionResponse, err error)

func (*ConferenceService) Record

func (service *ConferenceService) Record(ConferenceId string, Params ConferenceRecordParams) (response *ConferenceRecordResponseBody, err error)

func (*ConferenceService) RecordStop

func (service *ConferenceService) RecordStop(ConferenceId string) (err error)

type ConferenceSpeakParams

type ConferenceSpeakParams struct {
	Text     string `json:"text" url:"text"`
	Voice    string `json:"length,omitempty" url:"length,omitempty"`
	Language string `json:"language,omitempty" url:"language,omitempty"`
}

type ConferenceSpeakResponseBody

type ConferenceSpeakResponseBody struct {
	Message string `json:"message,omitempty" url:"message,omitempty"`
	ApiID   string `json:"api_id,omitempty" url:"api_id,omitempty"`
}

type Country

type Country struct {
	Name string `json:"name"`
	ISO2 string `json:"iso2"`
	ISO3 string `json:"iso3"`
}

type CreateComplianceApplicationParams

type CreateComplianceApplicationParams struct {
	ComplianceRequirementId string   `json:"compliance_requirement_id,omitempty" url:"compliance_requirement_id,omitempty"`
	EndUserId               string   `json:"end_user_id,omitempty" url:"end_user_id,omitempty"`
	DocumentIds             []string `json:"document_ids,omitempty" url:"document_ids, omitempty"`
	Alias                   string   `json:"alias,omitempty" url:"alias, omitempty"`
	EndUserType             string   `json:"end_user_type,omitempty" url:"end_user_type, omitempty"`
	CountryIso2             string   `json:"country_iso2,omitempty" url:"country_iso2, omitempty"`
	NumberType              string   `json:"number_type,omitempty" url:"number_type, omitempty"`
}

type CreateComplianceDocumentParams

type CreateComplianceDocumentParams struct {
	File                         string `json:"file,omitempty"`
	EndUserID                    string `json:"end_user_id,omitempty"`
	DocumentTypeID               string `json:"document_type_id,omitempty"`
	Alias                        string `json:"alias,omitempty"`
	LastName                     string `json:"last_name,omitempty"`
	FirstName                    string `json:"first_name,omitempty"`
	DateOfBirth                  string `json:"date_of_birth,omitempty"`
	AddressLine1                 string `json:"address_line_1,omitempty"`
	AddressLine2                 string `json:"address_line_2,omitempty"`
	City                         string `json:"city,omitempty"`
	Country                      string `json:"country,omitempty"`
	PostalCode                   string `json:"postal_code,omitempty"`
	UniqueIdentificationNumber   string `json:"unique_identification_number,omitempty"`
	Nationality                  string `json:"nationality,omitempty"`
	PlaceOfBirth                 string `json:"place_of_birth,omitempty"`
	DateOfIssue                  string `json:"date_of_issue,omitempty"`
	DateOfExpiration             string `json:"date_of_expiration,omitempty"`
	TypeOfUtility                string `json:"type_of_utility,omitempty"`
	BillingId                    string `json:"billing_id,omitempty"`
	BillingDate                  string `json:"billing_date,omitempty"`
	BusinessName                 string `json:"business_name,omitempty"`
	TypeOfId                     string `json:"type_of_id,omitempty"`
	SupportPhoneNumber           string `json:"support_phone_number,omitempty"`
	SupportEmail                 string `json:"support_email,omitempty"`
	AuthorizedRepresentativeName string `json:"authorized_representative_name,omitempty"`
	BillDate                     string `json:"bill_date,omitempty"`
	BillId                       string `json:"bill_id,omitempty"`
	UseCaseDescription           string `json:"use_case_description,omitempty"`
}

type CreateEndUserResponse

type CreateEndUserResponse struct {
	CreatedAt   time.Time `json:"created_at"`
	EndUserID   string    `json:"end_user_id"`
	Name        string    `json:"name"`
	LastName    string    `json:"last_name"`
	EndUserType string    `json:"end_user_type"`
	APIID       string    `json:"api_id"`
	Message     string    `json:"message"`
}

type CreateMaskingSessionParams added in v7.34.0

type CreateMaskingSessionParams struct {
	FirstParty                  string `json:"first_party,omitempty" url:"first_party,omitempty"`
	SecondParty                 string `json:"second_party,omitempty" url:"second_party,omitempty"`
	SessionExpiry               int    `json:"session_expiry" url:"session_expiry,omitempty"`
	CallTimeLimit               int    `json:"call_time_limit,omitempty" url:"call_time_limit,omitempty"`
	Record                      bool   `json:"record,omitempty" url:"record,omitempty"`
	RecordFileFormat            string `json:"record_file_format,omitempty" url:"record_file_format,omitempty"`
	RecordingCallbackUrl        string `json:"recording_callback_url,omitempty" url:"recording_callback_url,omitempty"`
	InitiateCallToFirstParty    bool   `json:"initiate_call_to_first_party,omitempty" url:"initiate_call_to_first_party,omitempty"`
	CallbackUrl                 string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod              string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
	RingTimeout                 int64  `json:"ring_timeout,omitempty" url:"ring_timeout,omitempty"`
	FirstPartyPlayUrl           string `json:"first_party_play_url,omitempty" url:"first_party_play_url,omitempty"`
	SecondPartyPlayUrl          string `json:"second_party_play_url,omitempty" url:"second_party_play_url,omitempty"`
	RecordingCallbackMethod     string `json:"recording_callback_method,omitempty" url:"recording_callback_method,omitempty"`
	IsPinAuthenticationRequired bool   `json:"is_pin_authentication_required,omitempty" url:"is_pin_authentication_required,omitempty"`
	GeneratePin                 bool   `json:"generate_pin,omitempty" url:"generate_pin,omitempty"`
	GeneratePinLength           int64  `json:"generate_pin_length,omitempty" url:"generate_pin_length,omitempty"`
	FirstPartyPin               string `json:"first_party_pin,omitempty" url:"first_party_pin,omitempty"`
	SecondPartyPin              string `json:"second_party_pin,omitempty" url:"second_party_pin,omitempty"`
	PinPromptPlay               string `json:"pin_prompt_play,omitempty" url:"pin_prompt_play,omitempty"`
	PinRetry                    int64  `json:"pin_retry,omitempty" url:"pin_retry,omitempty"`
	PinRetryWait                int64  `json:"pin_retry_wait,omitempty" url:"pin_retry_wait,omitempty"`
	IncorrectPinPlay            string `json:"incorrect_pin_play,omitempty" url:"incorrect_pin_play,omitempty"`
	UnknownCallerPlay           string `json:"unknown_caller_play,omitempty" url:"unknown_caller_play,omitempty"`
}

type CreateMaskingSessionResponse added in v7.34.0

type CreateMaskingSessionResponse struct {
	ApiID         string         `json:"api_id,omitempty" url:"api_id,omitempty"`
	SessionUUID   string         `json:"session_uuid,omitempty" url:"session_uuid,omitempty"`
	VirtualNumber string         `json:"virtual_number,omitempty" url:"virtual_number,omitempty"`
	Message       string         `json:"message,omitempty" url:"message,omitempty"`
	Session       MaskingSession `json:"session,omitempty" url:"session,omitempty"`
}

type CreateProfileRequestParams added in v7.12.1

type CreateProfileRequestParams struct {
	ProfileAlias      string             `json:"profile_alias" validate:"required"`
	CustomerType      string             `json:"customer_type" validate:"oneof= DIRECT RESELLER"`
	EntityType        string             `json:"entity_type" validate:"oneof= PRIVATE PUBLIC NON_PROFIT GOVERNMENT INDIVIDUAL"`
	CompanyName       string             `json:"company_name" validate:"required,max=100"`
	Ein               string             `json:"ein" validate:"max=100"`
	EinIssuingCountry string             `json:"ein_issuing_country" validate:"max=2"`
	Address           *Address           `json:"address" validate:"required"`
	StockSymbol       string             `json:"stock_symbol" validate:"required_if=EntityType PUBLIC,max=10"`
	StockExchange     string             `` /* 186-byte string literal not displayed */
	Website           string             `json:"website" validate:"max=100"`
	Vertical          string             `` /* 281-byte string literal not displayed */
	AltBusinessID     string             `json:"alt_business_id" validate:"max=50"`
	AltBusinessidType string             `json:"alt_business_id_type" validate:"oneof= DUNS LEI GIIN NONE ''"`
	PlivoSubaccount   string             `json:"plivo_subaccount" validate:"max=20"`
	AuthorizedContact *AuthorizedContact `json:"authorized_contact"`
}

type CreateProfileResponse added in v7.12.1

type CreateProfileResponse struct {
	ApiID       string `json:"api_id"`
	ProfileUUID string `json:"profile_uuid,omitempty"`
	Message     string `json:"message,omitempty"`
}

type Currency added in v7.35.0

type Currency struct {
	FallbackValue string `mapstructure:"fallback_value" json:"fallback_value" validate:"required"`
	CurrencyCode  string `mapstructure:"currency_code" json:"currency_code" validate:"required"`
	Amount1000    int    `mapstructure:"amount_1000" json:"amount_1000" validate:"required"`
}

type DateTime added in v7.35.0

type DateTime struct {
	FallbackValue string `mapstructure:"fallback_value" json:"fallback_value" validate:"required"`
}

type DeleteMaskingSessionResponse added in v7.34.0

type DeleteMaskingSessionResponse struct {
	ApiID   string `json:"api_id,omitempty" url:"api_id,omitempty"`
	Message string `json:"message,omitempty" url:"message,omitempty"`
}

type DeleteProfileResponse added in v7.12.1

type DeleteProfileResponse struct {
	ApiID   string `json:"api_id"`
	Message string `json:"message,omitempty"`
}

type EndUserGetResponse

type EndUserGetResponse struct {
	CreatedAt   time.Time `json:"created_at"`
	EndUserID   string    `json:"end_user_id"`
	Name        string    `json:"name"`
	LastName    string    `json:"last_name"`
	EndUserType string    `json:"end_user_type"`
}

type EndUserListParams

type EndUserListParams struct {
	Limit       int    `json:"limit,omitempty" url:"limit,omitempty"`
	Offset      int    `json:"offset,omitempty" url:"offset,omitempty"`
	Name        string `json:"name,omitempty" url:"name,omitempty"`
	LastName    string `json:"last_name,omitempty" url:"last_name,omitempty"`
	EndUserType string `json:"end_user_type,omitempty" url:"end_user_type,omitempty"`
}

type EndUserListResponse

type EndUserListResponse struct {
	BaseListResponse
	Objects []EndUserGetResponse `json:"objects" url:"objects"`
}

type EndUserParams

type EndUserParams struct {
	Name        string `json:"name,omitempty" url:"name,omitempty"`
	LastName    string `json:"last_name,omitempty" url:"last_name,omitempty"`
	EndUserType string `json:"end_user_type,omitempty" url:"end_user_type,omitempty"`
}

type EndUserService

type EndUserService struct {
	// contains filtered or unexported fields
}

func (*EndUserService) Create

func (service *EndUserService) Create(params EndUserParams) (response *CreateEndUserResponse, err error)

func (*EndUserService) Delete

func (service *EndUserService) Delete(endUserId string) (err error)

func (*EndUserService) Get

func (service *EndUserService) Get(endUserId string) (response *EndUserGetResponse, err error)

func (*EndUserService) List

func (service *EndUserService) List(params EndUserListParams) (response *EndUserListResponse, err error)

func (*EndUserService) Update

func (service *EndUserService) Update(params UpdateEndUserParams) (response *UpdateEndUserResponse, err error)

type Endpoint

type Endpoint struct {
	Alias       string `json:"alias,omitempty" url:"alias,omitempty"`
	EndpointID  string `json:"endpoint_id,omitempty" url:"endpoint_id,omitempty"`
	Password    string `json:"password,omitempty" url:"password,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	SIPURI      string `json:"sip_uri,omitempty" url:"sip_uri,omitempty"`
	Username    string `json:"username,omitempty" url:"username,omitempty"`
	// Optional field for Create call.
	AppID string `json:"app_id,omitempty" url:"app_id,omitempty"`
}

func (Endpoint) ID

func (self Endpoint) ID() string

type EndpointCreateParams

type EndpointCreateParams struct {
	Alias    string `json:"alias,omitempty" url:"alias,omitempty"`
	Password string `json:"password,omitempty" url:"password,omitempty"`
	AppID    string `json:"app_id,omitempty" url:"app_id,omitempty"`
	Username string `json:"username,omitempty" url:"username,omitempty"`
}

type EndpointCreateResponse

type EndpointCreateResponse struct {
	BaseResponse
	Alias      string `json:"alias,omitempty" url:"alias,omitempty"`
	EndpointID string `json:"endpoint_id,omitempty" url:"endpoint_id,omitempty"`
	Username   string `json:"username,omitempty" url:"username,omitempty"`
}

type EndpointListParams

type EndpointListParams struct {
	Limit  int `url:"limit,omitempty"`
	Offset int `url:"offset,omitempty"`
}

type EndpointListResponse

type EndpointListResponse struct {
	BaseListResponse
	Objects []*Endpoint `json:"objects" url:"objects"`
}

type EndpointService

type EndpointService struct {
	// contains filtered or unexported fields
}

func (*EndpointService) Create

func (service *EndpointService) Create(params EndpointCreateParams) (response *EndpointCreateResponse, err error)

func (*EndpointService) Delete

func (service *EndpointService) Delete(endpointId string) (err error)

func (*EndpointService) Get

func (service *EndpointService) Get(endpointId string) (response *Endpoint, err error)

func (*EndpointService) List

func (service *EndpointService) List(params EndpointListParams) (response *EndpointListResponse, err error)

func (*EndpointService) Update

func (service *EndpointService) Update(endpointId string, params EndpointUpdateParams) (response *EndpointUpdateResponse, err error)

type EndpointUpdateParams

type EndpointUpdateParams struct {
	Alias    string `json:"alias,omitempty" url:"alias,omitempty"`
	Password string `json:"password,omitempty" url:"password,omitempty"`
	AppID    string `json:"app_id,omitempty" url:"app_id,omitempty"`
}

type EndpointUpdateResponse

type EndpointUpdateResponse BaseResponse

type Files

type Files struct {
	FilePath    string
	ContentType string
}

Information about files

type FindShortCodeResponse

type FindShortCodeResponse struct {
	ApiID string `json:"api_id,omitempty"`
	ShortCode
	Error string `json:"error,omitempty"`
}

type FindTollfreeResponse

type FindTollfreeResponse struct {
	ApiID string `json:"api_id,omitempty"`
	Tollfree
	Error string `json:"error,omitempty"`
}

type GetComplianceDocumentResponse

type GetComplianceDocumentResponse struct {
	APIID           string `json:"api_id"`
	DocumentID      string `json:"document_id"`
	EndUserID       string `json:"end_user_id"`
	DocumentTypeID  string `json:"document_type_id"`
	Alias           string `json:"alias"`
	FileName        string `json:"file_name,omitempty"`
	MetaInformation struct {
		LastName                     string `json:"last_name,omitempty"`
		FirstName                    string `json:"first_name,omitempty"`
		DateOfBirth                  string `json:"date_of_birth,omitempty"`
		AddressLine1                 string `json:"address_line_1,omitempty"`
		AddressLine2                 string `json:"address_line_2,omitempty"`
		City                         string `json:"city,omitempty"`
		Country                      string `json:"country,omitempty"`
		PostalCode                   string `json:"postal_code,omitempty"`
		UniqueIdentificationNumber   string `json:"unique_identification_number,omitempty"`
		Nationality                  string `json:"nationality,omitempty"`
		PlaceOfBirth                 string `json:"place_of_birth,omitempty"`
		DateOfIssue                  string `json:"date_of_issue,omitempty"`
		DateOfExpiration             string `json:"date_of_expiration,omitempty"`
		TypeOfUtility                string `json:"type_of_utility,omitempty"`
		BillingId                    string `json:"billing_id,omitempty"`
		BillingDate                  string `json:"billing_date,omitempty"`
		BusinessName                 string `json:"business_name,omitempty"`
		TypeOfId                     string `json:"type_of_id,omitempty"`
		SupportPhoneNumber           string `json:"support_phone_number,omitempty"`
		SupportEmail                 string `json:"support_email,omitempty"`
		AuthorizedRepresentativeName string `json:"authorized_representative_name,omitempty"`
		BillDate                     string `json:"bill_date,omitempty"`
		BillId                       string `json:"bill_id,omitempty"`
		UseCaseDescription           string `json:"use_case_description,omitempty"`
	} `json:"meta_information"`
	CreatedAt string `json:"created_at"`
}

type GetComplianceDocumentTypeResponse

type GetComplianceDocumentTypeResponse struct {
	APIID          string    `json:"api_id"`
	CreatedAt      time.Time `json:"created_at"`
	Description    string    `json:"description"`
	DocumentName   string    `json:"document_name"`
	DocumentTypeID string    `json:"document_type_id"`
	Information    []struct {
		FieldName    string   `json:"field_name"`
		FieldType    string   `json:"field_type"`
		FriendlyName string   `json:"friendly_name"`
		HelpText     string   `json:"help_text,omitempty"`
		MaxLength    int      `json:"max_length,omitempty"`
		MinLength    int      `json:"min_length,omitempty"`
		Format       string   `json:"format,omitempty"`
		Enums        []string `json:"enums,omitempty"`
	} `json:"information"`
	ProofRequired interface{} `json:"proof_required"`
}

type GetComplianceRequirementResponse

type GetComplianceRequirementResponse struct {
	APIID                   string `json:"api_id"`
	ComplianceRequirementID string `json:"compliance_requirement_id"`
	CountryIso2             string `json:"country_iso2"`
	NumberType              string `json:"number_type"`
	EndUserType             string `json:"end_user_type"`
	AcceptableDocumentTypes []struct {
		Name                string `json:"name"`
		Scope               string `json:"scope"`
		AcceptableDocuments []struct {
			DocumentTypeID   string `json:"document_type_id"`
			DocumentTypeName string `json:"document_type_name"`
		} `json:"acceptable_documents"`
	} `json:"acceptable_document_types"`
}

type GetMaskingSessionResponse added in v7.34.0

type GetMaskingSessionResponse struct {
	ApiID    string         `json:"api_id,omitempty" url:"api_id,omitempty"`
	Response MaskingSession `json:"response,omitempty" url:"response,omitempty"`
}

type GetVerifyResponse added in v7.40.0

type GetVerifyResponse struct {
	Alias            string    `json:"alias,omitempty"`
	ApiID            string    `json:"api_id,omitempty" url:"api_id,omitempty"`
	Country          string    `json:"country"`
	CreatedAt        time.Time `json:"created_at"`
	ModifiedAt       time.Time `json:"modified_at"`
	PhoneNumber      string    `json:"phone_number"`
	SubAccount       string    `json:"subaccount,omitempty" url:"subaccount,omitempty"`
	VerificationUUID string    `json:"verification_uuid"`
}

type ImportCampaignParams added in v7.38.0

type ImportCampaignParams struct {
	CampaignID    string `json:"campaign_id,omitempty" url:"campaign_id,omitempty"`
	CampaignAlias string `json:"campaign_alias,omitempty" url:"campaign_alias,omitempty"`
	URL           string `json:"url,omitempty" url:"url,omitempty"`
	Method        string `json:"method,omitempty" url:"method,omitempty"`
}

type InitiateVerify added in v7.40.0

type InitiateVerify struct {
	PhoneNumber string `json:"phone_number"`
	Alias       string `json:"alias"`
	Channel     string `json:"channel"`
	Country     string `json:"country"`
	SubAccount  string `json:"subaccount"`
	AccountID   int64  `json:"account_id"`
	AuthID      string `json:"auth_id"`
	AuthToken   string `json:"auth_token"`
}

type InitiateVerifyResponse added in v7.40.0

type InitiateVerifyResponse struct {
	ApiID            string `json:"api_id,omitempty" url:"api_id,omitempty"`
	Message          string `json:"message,omitempty" url:"message,omitempty"`
	VerificationUUID string `json:"verification_uuid,omitempty" url:"verification_uuid,omitempty"`
}

type ListComplianceApplicationResponse

type ListComplianceApplicationResponse struct {
	APIID string `json:"api_id"`
	Meta  struct {
		Limit      int         `json:"limit"`
		Next       string      `json:"next"`
		Offset     int         `json:"offset"`
		Previous   interface{} `json:"previous"`
		TotalCount int         `json:"total_count"`
	} `json:"meta"`
	Objects []struct {
		CreatedAt               time.Time `json:"created_at"`
		ComplianceApplicationID string    `json:"compliance_application_id"`
		Alias                   string    `json:"alias"`
		Status                  string    `json:"status"`
		EndUserType             string    `json:"end_user_type"`
		CountryIso2             string    `json:"country_iso2"`
		NumberType              string    `json:"number_type"`
		EndUserID               string    `json:"end_user_id"`
		ComplianceRequirementID string    `json:"compliance_requirement_id"`
		Documents               []struct {
			DocumentID       string `json:"document_id"`
			Name             string `json:"name"`
			DocumentName     string `json:"document_name"`
			DocumentTypeID   string `json:"document_type_id"`
			DocumentTypeName string `json:"document_type_name"`
			Scope            string `json:"scope"`
		} `json:"documents"`
	} `json:"objects"`
}

type ListComplianceDocumentResponse

type ListComplianceDocumentResponse struct {
	APIID string `json:"api_id"`
	Meta  struct {
		Limit      int         `json:"limit"`
		Next       string      `json:"next"`
		Offset     int         `json:"offset"`
		Previous   interface{} `json:"previous"`
		TotalCount int         `json:"total_count"`
	} `json:"meta"`
	Objects []struct {
		CreatedAt            time.Time `json:"created_at"`
		ComplianceDocumentID string    `json:"compliance_document_id"`
		Alias                string    `json:"alias"`
		MetaInformation      struct {
			LastName                     string `json:"last_name,omitempty"`
			FirstName                    string `json:"first_name,omitempty"`
			DateOfBirth                  string `json:"date_of_birth,omitempty"`
			AddressLine1                 string `json:"address_line_1,omitempty"`
			AddressLine2                 string `json:"address_line_2,omitempty"`
			City                         string `json:"city,omitempty"`
			Country                      string `json:"country,omitempty"`
			PostalCode                   string `json:"postal_code,omitempty"`
			UniqueIdentificationNumber   string `json:"unique_identification_number,omitempty"`
			Nationality                  string `json:"nationality,omitempty"`
			PlaceOfBirth                 string `json:"place_of_birth,omitempty"`
			DateOfIssue                  string `json:"date_of_issue,omitempty"`
			DateOfExpiration             string `json:"date_of_expiration,omitempty"`
			TypeOfUtility                string `json:"type_of_utility,omitempty"`
			BillingId                    string `json:"billing_id,omitempty"`
			BillingDate                  string `json:"billing_date,omitempty"`
			BusinessName                 string `json:"business_name,omitempty"`
			TypeOfId                     string `json:"type_of_id,omitempty"`
			SupportPhoneNumber           string `json:"support_phone_number,omitempty"`
			SupportEmail                 string `json:"support_email,omitempty"`
			AuthorizedRepresentativeName string `json:"authorized_representative_name,omitempty"`
			BillDate                     string `json:"bill_date,omitempty"`
			BillId                       string `json:"bill_id,omitempty"`
			UseCaseDescription           string `json:"use_case_description,omitempty"`
		} `json:"meta_information"`
		File           string `json:"file,omitempty"`
		EndUserID      string `json:"end_user_id"`
		DocumentTypeID string `json:"document_type_id"`
	} `json:"objects"`
}

type ListComplianceDocumentTypeResponse

type ListComplianceDocumentTypeResponse struct {
	APIID string `json:"api_id"`
	Meta  struct {
		Limit      int         `json:"limit"`
		Next       interface{} `json:"next"`
		Offset     int         `json:"offset"`
		Previous   interface{} `json:"previous"`
		TotalCount int         `json:"total_count"`
	} `json:"meta"`
	Objects []struct {
		CreatedAt      time.Time `json:"created_at"`
		Description    string    `json:"description"`
		DocumentName   string    `json:"document_name"`
		DocumentTypeID string    `json:"document_type_id"`
		Information    []struct {
			FieldName    string   `json:"field_name"`
			FieldType    string   `json:"field_type"`
			Format       string   `json:"format,omitempty"`
			FriendlyName string   `json:"friendly_name"`
			MaxLength    int      `json:"max_length,omitempty"`
			MinLength    int      `json:"min_length,omitempty"`
			HelpText     string   `json:"help_text,omitempty"`
			Enums        []string `json:"enums,omitempty"`
		} `json:"information"`
		ProofRequired interface{} `json:"proof_required"`
	} `json:"objects"`
}

type ListComplianceRequirementParams

type ListComplianceRequirementParams struct {
	CountryIso2 string `json:"country_iso2,omitempty" url:"country_iso2,omitempty"`
	NumberType  string `json:"number_type,omitempty" url:"number_type,omitempty"`
	EndUserType string `json:"end_user_type,omitempty" url:"end_user_type,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty" url:"phone_number,omitempty"`
}

type ListMPCMeta

type ListMPCMeta struct {
	Previous   *string
	Next       *string
	TotalCount int64 `json:"count"`
	Offset     int64
	Limit      int64
}

type ListMaskingSessionResponse added in v7.34.0

type ListMaskingSessionResponse struct {
	ApiID    string              `json:"api_id" url:"api_id"`
	Response ListSessionResponse `json:"response" url:"response"`
}

type ListSessionFilterParams added in v7.34.0

type ListSessionFilterParams struct {
	// Query parameters.
	FirstParty                string `json:"first_party,omitempty" url:"first_party,omitempty"`
	SecondParty               string `json:"second_party,omitempty" url:"second_party,omitempty"`
	VirtualNumber             string `json:"virtual_number,omitempty" url:"virtual_number,omitempty"`
	Status                    string `json:"status,omitempty" url:"status,omitempty"`
	CreatedTimeEquals         string `json:"created_time,omitempty" url:"created_time,omitempty"`
	CreatedTimeLessThan       string `json:"created_time__lt,omitempty" url:"created_time__lt,omitempty"`
	CreatedTimeGreaterThan    string `json:"created_time__gt,omitempty" url:"created_time__gt,omitempty"`
	CreatedTimeLessOrEqual    string `json:"created_time__lte,omitempty" url:"created_time__lte,omitempty"`
	CreatedTimeGreaterOrEqual string `json:"created_time__gte,omitempty" url:"created_time__gte,omitempty"`
	ExpiryTimeEquals          string `json:"expiry_time,omitempty" url:"expiry_time,omitempty"`
	ExpiryTimeLessThan        string `json:"expiry_time__lt,omitempty" url:"expiry_time__lt,omitempty"`
	ExpiryTimeGreaterThan     string `json:"expiry_time__gt,omitempty" url:"expiry_time__gt,omitempty"`
	ExpiryTimeLessOrEqual     string `json:"expiry_time__lte,omitempty" url:"expiry_time__lte,omitempty"`
	ExpiryTimeGreaterOrEqual  string `json:"expiry_time__gte,omitempty" url:"expiry_time__gte,omitempty"`
	DurationEquals            int64  `json:"duration,omitempty" url:"duration,omitempty"`
	DurationLessThan          int64  `json:"duration__lt,omitempty"  url:"duration__lt,omitempty"`
	DurationGreaterThan       int64  `json:"duration__gt,omitempty"  url:"duration__gt,omitempty"`
	DurationLessOrEqual       int64  `json:"duration__lte,omitempty" url:"duration__lte,omitempty"`
	DurationGreaterOrEqual    int64  `json:"duration__gte,omitempty" url:"duration__gte,omitempty"`
	Limit                     int64  `json:"limit,omitempty" url:"limit,omitempty"`
	Offset                    int64  `json:"offset,omitempty" url:"offset,omitempty"`
}

type ListSessionResponse added in v7.34.0

type ListSessionResponse struct {
	Meta    Meta             `json:"meta" url:"meta"`
	Objects []MaskingSession `json:"objects" url:"objects"`
}

type ListVerifiedCallerIDResponse added in v7.40.0

type ListVerifiedCallerIDResponse struct {
	ApiID   string               `json:"api_id,omitempty" url:"api_id,omitempty"`
	Meta    Meta                 `json:"meta" url:"meta"`
	Objects []ListVerifyResponse `json:"objects" url:"objects"`
}

type ListVerifiedCallerIdParams added in v7.40.0

type ListVerifiedCallerIdParams struct {
	Country    string `json:"country,omitempty" url:"country,omitempty"`
	SubAccount string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
	Alias      string `json:"alias,omitempty" url:"alias,omitempty"`
	Limit      int64  `json:"limit,omitempty" url:"limit,omitempty"`
	Offset     int64  `json:"offset,omitempty" url:"offset,omitempty"`
}

type ListVerifyResponse added in v7.40.0

type ListVerifyResponse struct {
	Alias            string    `json:"alias,omitempty"`
	Country          string    `json:"country"`
	CreatedAt        time.Time `json:"created_at"`
	ModifiedAt       time.Time `json:"modified_at"`
	PhoneNumber      string    `json:"phone_number"`
	ResourceUri      string    `json:"resource_uri,omitempty"`
	SubAccount       string    `json:"subaccount,omitempty"`
	VerificationUUID string    `json:"verification_uuid"`
}

type LiveCall

type LiveCall struct {
	From             string `json:"from,omitempty" url:"from,omitempty"`
	To               string `json:"to,omitempty" url:"to,omitempty"`
	AnswerURL        string `json:"answer_url,omitempty" url:"answer_url,omitempty"`
	CallUUID         string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	CallerName       string `json:"caller_name,omitempty" url:"caller_name,omitempty"`
	ParentCallUUID   string `json:"parent_call_uuid,omitempty" url:"parent_call_uuid,omitempty"`
	SessionStart     string `json:"session_start,omitempty" url:"session_start,omitempty"`
	CallStatus       string `json:"call_status,omitempty" url:"call_status,omitempty"`
	StirVerification string `json:"stir_verification,omitempty" url:"stir_verification,omitempty"`
	StirAttestation  string `json:"stir_attestation,omitempty" url:"stir_attestation,omitempty"`
}

func (LiveCall) ID

func (self LiveCall) ID() string

type LiveCallFilters

type LiveCallFilters struct {
	CallDirection string `json:"call_direction,omitempty" url:"call_direction,omitempty"`
	FromNumber    string `json:"from_number,omitempty" url:"from_number,omitempty"`
	ToNumber      string `json:"to_number,omitempty" url:"to_number,omitempty"`
	Status        string `json:"status,omitempty" url:"status,omitempty" default:"live"`
}

type LiveCallIDListResponse

type LiveCallIDListResponse struct {
	APIID string   `json:"api_id" url:"api_id"`
	Calls []string `json:"calls" url:"calls"`
}

type LiveCallService

type LiveCallService struct {
	// contains filtered or unexported fields
}

func (*LiveCallService) Get

func (service *LiveCallService) Get(LiveCallId string) (response *LiveCall, err error)

func (*LiveCallService) IDList

func (service *LiveCallService) IDList(data ...LiveCallFilters) (response *LiveCallIDListResponse, err error)

type LookupError

type LookupError struct {
	ApiID     string `json:"api_id"`
	ErrorCode int    `json:"error_code"`
	Message   string `json:"message"`
	// contains filtered or unexported fields
}

LookupError is the error response returned by Plivo Lookup API.

func (*LookupError) Error

func (e *LookupError) Error() string

Error returns the raw json/text response from Lookup API.

type LookupParams

type LookupParams struct {
	// If empty, Type defaults to "carrier".
	Type string `url:"type"`
}

LookupParams is the input parameters for Plivo Lookup API.

type LookupResponse

type LookupResponse struct {
	ApiID       string        `json:"api_id"`
	PhoneNumber string        `json:"phone_number"`
	Country     *Country      `json:"country"`
	Format      *NumberFormat `json:"format"`
	Carrier     *Carrier      `json:"carrier"`
	ResourceURI string        `json:"resource_uri"`
}

LookupResponse is the success response returned by Plivo Lookup API.

type LookupService

type LookupService struct {
	// contains filtered or unexported fields
}

func (*LookupService) Get

func (s *LookupService) Get(number string, params LookupParams) (*LookupResponse, error)

Get looks up a phone number using Plivo Lookup API.

type MMSMedia

type MMSMedia struct {
	ApiID       string `json:"api_id,omitempty"`
	ContentType string `json:"content_type,omitempty"`
	MediaID     string `json:"media_id,omitempty"`
	MediaURL    string `json:"media_url,omitempty"`
	MessageUUID string `json:"message_uuid,omitempty"`
	Size        int64  `json:"size,omitempty"`
}

type MPCUpdateResponse

type MPCUpdateResponse struct {
	CoachMode string `json:"coach_mode,omitempty" url:"coach_mode,omitempty"`
	Mute      string `json:"mute,omitempty" url:"mute,omitempty"`
	Hold      string `json:"hold,omitempty" url:"hold,omitempty"`
}

type MaskingSession added in v7.34.0

type MaskingSession struct {
	FirstParty                  string                     `json:"first_party,omitempty" url:"first_party,omitempty"`
	SecondParty                 string                     `json:"second_party,omitempty" url:"second_party,omitempty"`
	VirtualNumber               string                     `json:"virtual_number,omitempty" url:"virtual_number,omitempty"`
	Status                      string                     `json:"status,omitempty" url:"status,omitempty"`
	InitiateCallToFirstParty    bool                       `json:"initiate_call_to_first_party,omitempty" url:"initiate_call_to_first_party,omitempty"`
	SessionUUID                 string                     `json:"session_uuid,omitempty" url:"session_uuid,omitempty"`
	CallbackUrl                 string                     `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod              string                     `json:"callback_method,omitempty" url:"callback_method,omitempty"`
	CreatedAt                   string                     `json:"created_time,omitempty" url:"created_time,omitempty"`
	UpdatedAt                   string                     `json:"modified_time,omitempty" url:"updated_at,omitempty"`
	ExpiryAt                    string                     `json:"expiry_time,omitempty" url:"expiry_time,omitempty"`
	Duration                    int64                      `json:"duration,omitempty" url:"duration,omitempty"`
	SessionCreationAmount       int64                      `json:"amount" url:"amount"`
	CallTimeLimit               int64                      `json:"call_time_limit,omitempty" url:"call_time_limit,omitempty"`
	RingTimeout                 int64                      `json:"ring_timeout,omitempty" url:"ring_timeout,omitempty"`
	FirstPartyPlayUrl           string                     `json:"first_party_play_url,omitempty" url:"first_party_play_url,omitempty"`
	SecondPartyPlayUrl          string                     `json:"second_party_play_url,omitempty" url:"second_party_play_url,omitempty"`
	Record                      bool                       `json:"record,omitempty" url:"record,omitempty"`
	RecordFileFormat            string                     `json:"record_file_format,omitempty" url:"record_file_format,omitempty"`
	RecordingCallbackUrl        string                     `json:"recording_callback_url,omitempty" url:"recording_callback_url,omitempty"`
	RecordingCallbackMethod     string                     `json:"recording_callback_method,omitempty" url:"recording_callback_method,omitempty"`
	Interaction                 []VoiceInteractionResponse `json:"interaction" url:"interaction"`
	TotalCallAmount             float64                    `json:"total_call_amount" url:"total_call_amount"`
	TotalCallCount              int                        `json:"total_call_count" url:"total_call_count"`
	TotalCallBilledDuration     int                        `json:"total_call_billed_duration" url:"total_call_billed_duration"`
	TotalSessionAmount          float64                    `json:"total_session_amount" url:"total_session_amount"`
	LastInteractionTime         string                     `json:"last_interaction_time" url:"last_interaction_time"`
	IsPinAuthenticationRequired bool                       `json:"is_pin_authentication_required" url:"is_pin_authentication_required"`
	GeneratePin                 bool                       `json:"generate_pin" url:"generate_pin"`
	GeneratePinLength           int64                      `json:"generate_pin_length" url:"generate_pin_length"`
	FirstPartyPin               string                     `json:"first_party_pin" url:"first_party_pin"`
	SecondPartyPin              string                     `json:"second_party_pin" url:"second_party_pin"`
	PinPromptPlay               string                     `json:"pin_prompt_play" url:"pin_prompt_play"`
	PinRetry                    int64                      `json:"pin_retry" url:"pin_retry"`
	PinRetryWait                int64                      `json:"pin_retry_wait" url:"pin_retry_wait"`
	IncorrectPinPlay            string                     `json:"incorrect_pin_play" url:"incorrect_pin_play"`
	UnknownCallerPlay           string                     `json:"unknown_caller_play" url:"unknown_caller_play"`
}

type MaskingSessionService added in v7.34.0

type MaskingSessionService struct {
	// contains filtered or unexported fields
}

func (*MaskingSessionService) CreateMaskingSession added in v7.34.0

func (service *MaskingSessionService) CreateMaskingSession(params CreateMaskingSessionParams) (response *CreateMaskingSessionResponse, err error)

func (*MaskingSessionService) DeleteMaskingSession added in v7.34.0

func (service *MaskingSessionService) DeleteMaskingSession(sessionId string) (response *DeleteMaskingSessionResponse, err error)

func (*MaskingSessionService) GetMaskingSession added in v7.34.0

func (service *MaskingSessionService) GetMaskingSession(sessionId string) (response *GetMaskingSessionResponse, err error)

func (*MaskingSessionService) ListMaskingSession added in v7.34.0

func (service *MaskingSessionService) ListMaskingSession(params ListSessionFilterParams) (response *ListMaskingSessionResponse, err error)

func (*MaskingSessionService) UpdateMaskingSession added in v7.34.0

func (service *MaskingSessionService) UpdateMaskingSession(params UpdateMaskingSessionParams, sessionId string) (response *UpdateMaskingSessionResponse, err error)

type Media

type Media struct {
	ContentType string `json:"content_type,omitempty" url:"content_type,omitempty"`
	FileName    string `json:"file_name,omitempty" url:"file_name,omitempty"`
	MediaID     string `json:"media_id,omitempty" url:"media_id,omitempty"`
	Size        int    `json:"size,omitempty" url:"size,omitempty"`
	UploadTime  string `json:"upload_time,omitempty" url:"upload_time,omitempty"`
	URL         string `json:"url,omitempty" url:"url,omitempty"`
}

Contains the information about media

type MediaDeleteResponse

type MediaDeleteResponse struct {
	Error string `json:"error,omitempty"`
}

type MediaListParams

type MediaListParams struct {
	Limit  int `url:"limit,omitempty"`
	Offset int `url:"offset,omitempty"`
}

Media list metadata

type MediaListResponseBody

type MediaListResponseBody struct {
	Objects []MMSMedia `json:"objects" url:"objects"`
}

type MediaMeta

type MediaMeta struct {
	Previous   *string
	Next       *string
	TotalCount int `json:"total_count" url:"api_id"`
	Offset     int `json:"offset,omitempty" url:"offset,omitempty"`
	Limit      int `json:"limit,omitempty" url:"limit,omitempty"`
}

Meta data information

type MediaResponseBody

type MediaResponseBody struct {
	Media []MediaUploadResponse `json:"objects" url:"objects"`
	ApiID string                `json:"api_id" url:"api_id"`
}

Media upload response to client

type MediaService

type MediaService struct {
	Media
	// contains filtered or unexported fields
}

MediaService struct hold the client and Media detail

func (*MediaService) Get

func (service *MediaService) Get(media_id string) (response *Media, err error)

Get the single media information from media ID

func (*MediaService) List

func (service *MediaService) List(param MediaListParams) (response *BaseListMediaResponse, err error)

List all the media information

func (*MediaService) Upload

func (service *MediaService) Upload(params MediaUpload) (response *MediaResponseBody, err error)

Upload the media to plivo api, use media id for sending MMS

type MediaUpload

type MediaUpload struct {
	UploadFiles []Files
}

Input param to upload media

type MediaUploadResponse

type MediaUploadResponse struct {
	ContentType  string `json:"content_type,omitempty" url:"content_type,omitempty"`
	FileName     string `json:"file_name,omitempty" url:"file_name,omitempty"`
	MediaID      string `json:"media_id,omitempty" url:"media_id,omitempty"`
	Size         int    `json:"size,omitempty" url:"size,omitempty"`
	UploadTime   string `json:"upload_time,omitempty" url:"upload_time,omitempty"`
	URL          string `json:"url,omitempty" url:"url,omitempty"`
	Status       string `json:"status,omitempty" url:"status,omitempty"`
	StatusCode   int    `json:"status_code,omitempty" url:"status_code,omitempty"`
	ErrorMessage string `json:"error_message,omitempty" url:"error_message,omitempty"`
	ErrorCode    int    `json:"error_code,omitempty" url:"error_code,omitempty"`
}

Media related information

type Member

type Member struct {
	Muted      bool   `json:"muted,omitempty" url:"muted,omitempty"`
	MemberID   string `json:"member_id,omitempty" url:"member_id,omitempty"`
	Deaf       bool   `json:"deaf,omitempty" url:"deaf,omitempty"`
	From       string `json:"from,omitempty" url:"from,omitempty"`
	To         string `json:"to,omitempty" url:"to,omitempty"`
	CallerName string `json:"caller_name,omitempty" url:"caller_name,omitempty"`
	Direction  string `json:"direction,omitempty" url:"direction,omitempty"`
	CallUUID   string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	JoinTime   string `json:"join_time,omitempty" url:"join_time,omitempty"`
}

type Message

type Message struct {
	ApiID                           string `json:"api_id,omitempty" url:"api_id,omitempty"`
	ToNumber                        string `json:"to_number,omitempty" url:"to_number,omitempty"`
	FromNumber                      string `json:"from_number,omitempty" url:"from_number,omitempty"`
	CloudRate                       string `json:"cloud_rate,omitempty" url:"cloud_rate,omitempty"`
	MessageType                     string `json:"message_type,omitempty" url:"message_type,omitempty"`
	ResourceURI                     string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	CarrierRate                     string `json:"carrier_rate,omitempty" url:"carrier_rate,omitempty"`
	MessageDirection                string `json:"message_direction,omitempty" url:"message_direction,omitempty"`
	MessageState                    string `json:"message_state,omitempty" url:"message_state,omitempty"`
	TotalAmount                     string `json:"total_amount,omitempty" url:"total_amount,omitempty"`
	MessageUUID                     string `json:"message_uuid,omitempty" url:"message_uuid,omitempty"`
	MessageTime                     string `json:"message_time,omitempty" url:"message_time,omitempty"`
	ErrorCode                       string `json:"error_code,omitempty" url:"error_code,omitempty"`
	PowerpackID                     string `json:"powerpack_id,omitempty" url:"powerpack_id,omitempty"`
	RequesterIP                     string `json:"requester_ip,omitempty" url:"requester_ip,omitempty"`
	IsDomestic                      *bool  `json:"is_domestic,omitempty" url:"is_domestic,omitempty"`
	ReplacedSender                  string `json:"replaced_sender,omitempty" url:"replaced_sender,omitempty"`
	TendlcCampaignID                string `json:"tendlc_campaign_id" url:"tendlc_campaign_id,omitempty"`
	TendlcRegistrationStatus        string `json:"tendlc_registration_status" url:"tendlc_registration_status,omitempty"`
	DestinationCountryISO2          string `json:"destination_country_iso2" url:"destination_country_iso2,omitempty"`
	ConversationID                  string `json:"conversation_id" url:"conversation_id,omitempty"`
	ConversationOrigin              string `json:"conversation_origin" url:"conversation_origin,omitempty"`
	ConversationExpirationTimestamp string `json:"conversation_expiration_timestamp" url:"conversation_expiration_timestamp,omitempty"`
	DLTEntityID                     string `json:"dlt_entity_id" url:"dlt_entity_id,omitempty"`
	DLTTemplateID                   string `json:"dlt_template_id" url:"dlt_template_id,omitempty"`
	DLTTemplateCategory             string `json:"dlt_template_category" url:"dlt_template_category,omitempty"`
	DestinationNetwork              string `json:"destination_network" url:"destination_network,omitempty"`
	CarrierFeesRate                 string `json:"carrier_fees_rate" url:"carrier_fees_rate,omitempty"`
	CarrierFees                     string `json:"carrier_fees" url:"carrier_fees,omitempty"`
	Log                             string `json:"log" url:"log,omitempty"`
}

func (Message) ID

func (self Message) ID() string

type MessageCreateParams

type MessageCreateParams struct {
	Src  string `json:"src,omitempty" url:"src,omitempty"`
	Dst  string `json:"dst,omitempty" url:"dst,omitempty"`
	Text string `json:"text,omitempty" url:"text,omitempty"`
	// Optional parameters.
	Type      string      `json:"type,omitempty" url:"type,omitempty"`
	URL       string      `json:"url,omitempty" url:"url,omitempty"`
	Method    string      `json:"method,omitempty" url:"method,omitempty"`
	Trackable bool        `json:"trackable,omitempty" url:"trackable,omitempty"`
	Log       interface{} `json:"log,omitempty" url:"log,omitempty"`
	MediaUrls []string    `json:"media_urls,omitempty" url:"media_urls,omitempty"`
	MediaIds  []string    `json:"media_ids,omitempty" url:"media_ids,omitempty"`
	// Either one of src and powerpackuuid should be given
	PowerpackUUID       string    `json:"powerpack_uuid,omitempty" url:"powerpack_uuid,omitempty"`
	MessageExpiry       int       `json:"message_expiry,omitempty" url:"message_expiry,omitempty"`
	Template            *Template `json:"template,omitempty" url:"template,omitempty"`
	DLTEntityID         string    `json:"dlt_entity_id,omitempty" url:"dlt_entity_id,omitempty"`
	DLTTemplateID       string    `json:"dlt_template_id,omitempty" url:"dlt_template_id,omitempty"`
	DLTTemplateCategory string    `json:"dlt_template_category,omitempty" url:"dlt_template_category,omitempty"`
}

type MessageCreateResponseBody

type MessageCreateResponseBody struct {
	Message     string   `json:"message" url:"message"`
	ApiID       string   `json:"api_id" url:"api_id"`
	MessageUUID []string `json:"message_uuid" url:"message_uuid"`
	Error       string   `json:"error" url:"error"`
}

Stores response for ending a message.

type MessageList

type MessageList struct {
	ApiID string `json:"api_id" url:"api_id"`
	Meta  struct {
		Previous *string
		Next     *string
		Offset   int64
		Limit    int64
	} `json:"meta"`
	Objects []Message `json:"objects" url:"objects"`
}

type MessageListParams

type MessageListParams struct {
	Limit                     int    `url:"limit,omitempty"`
	Offset                    int    `url:"offset,omitempty"`
	PowerpackID               string `url:"powerpack_id,omitempty"`
	Subaccount                string `url:"subaccount,omitempty"`
	MessageDirection          string `url:"message_direction,omitempty"`
	MessageState              string `url:"message_state,omitempty"`
	ErrorCode                 int    `url:"error_code,omitempty"`
	MessageTime               string `url:"message_time,omitempty"`
	MessageTimeGreaterThan    string `url:"message_time__gt,omitempty"`
	MessageTimeGreaterOrEqual string `url:"message_time__gte,omitempty"`
	MessageTimeLessThan       string `url:"message_time__lt,omitempty"`
	MessageTimeLessOrEqual    string `url:"message_time__lte,omitempty"`
	TendlcCampaignID          string `url:"tendlc_campaign_id,omitempty"`
	TendlcRegistrationStatus  string `url:"tendlc_registration_status,omitempty"`
	DestinationCountryISO2    string `url:"destination_country_iso2,omitempty"`
	MessageType               string `url:"message_type,omitempty,enum:sms,mms,whatsapp"`
	ConversationID            string `url:"conversation_id,omitempty"`
	ConversationOrigin        string `url:"conversation_origin,omitempty,enum:service,utility,authentication,marketing"`
}

type MessageService

type MessageService struct {
	Message
	// contains filtered or unexported fields
}

func (*MessageService) Create

func (service *MessageService) Create(params MessageCreateParams) (response *MessageCreateResponseBody, err error)

func (*MessageService) Get

func (service *MessageService) Get(messageUuid string) (response *Message, err error)

func (*MessageService) List

func (service *MessageService) List(params MessageListParams) (response *MessageList, err error)

func (*MessageService) ListMedia

func (service *MessageService) ListMedia(messageUuid string) (response *MediaListResponseBody, err error)

type Meta

type Meta struct {
	Previous   *string
	Next       *string
	TotalCount int64 `json:"total_count"`
	Offset     int64
	Limit      int64
}

type MnoMetadata

type MnoMetadata struct {
	ATandT          OperatorDetail `json:"AT&T,omitempty"`
	TMobile         OperatorDetail `json:"T-Mobile,omitempty"`
	VerizonWireless OperatorDetail `json:"Verizon Wireless,omitempty"`
	USCellular      OperatorDetail `json:"US Cellular,omitempty"`
}

type MultiPartyCallAddParticipantParams

type MultiPartyCallAddParticipantParams struct {
	Role                           string      `json:"role,omitempty" url:"role,omitempty"`
	From                           string      `json:"from,omitempty" url:"from,omitempty"`
	To                             string      `json:"to,omitempty" url:"to,omitempty"`
	CallUuid                       string      `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	CallerName                     string      `json:"caller_name,omitempty" url:"caller_name,omitempty"`
	CallStatusCallbackUrl          string      `json:"call_status_callback_url,omitempty" url:"call_status_callback_url,omitempty"`
	CallStatusCallbackMethod       string      `json:"call_status_callback_method,omitempty" url:"call_status_callback_method,omitempty"`
	SipHeaders                     string      `json:"sip_headers,omitempty" url:"sip_headers,omitempty"`
	ConfirmKey                     string      `json:"confirm_key,omitempty" url:"confirm_key,omitempty"`
	ConfirmKeySoundUrl             string      `json:"confirm_key_sound_url,omitempty" url:"confirm_key_sound_url,omitempty"`
	ConfirmKeySoundMethod          string      `json:"confirm_key_sound_method,omitempty" url:"confirm_key_sound_method,omitempty"`
	DialMusic                      string      `json:"dial_music,omitempty" url:"dial_music,omitempty"`
	RingTimeout                    interface{} `json:"ring_timeout,omitempty" url:"ring_timeout,omitempty"`
	DelayDial                      interface{} `json:"delay_dial,omitempty" uril:"caller_name,omitempty"`
	MaxDuration                    int64       `json:"max_duration,omitempty" url:"max_duration,omitempty"`
	MaxParticipants                int64       `json:"max_participants,omitempty" url:"max_participants,omitempty"`
	WaitMusicUrl                   string      `json:"wait_music_url,omitempty" url:"wait_music_url,omitempty"`
	WaitMusicMethod                string      `json:"wait_music_method,omitempty" url:"wait_music_method,omitempty"`
	AgentHoldMusicUrl              string      `json:"agent_hold_music_url,omitempty" url:"agent_hold_music_url,omitempty"`
	AgentHoldMusicMethod           string      `json:"agent_hold_music_method,omitempty" url:"agent_hold_music_method,omitempty"`
	CustomerHoldMusicUrl           string      `json:"customer_hold_music_url,omitempty" url:"customer_hold_music_url,omitempty"`
	CustomerHoldMusicMethod        string      `json:"customer_hold_music_method,omitempty" url:"customer_hold_music_method,omitempty"`
	RecordingCallbackUrl           string      `json:"recording_callback_url,omitempty" url:"recording_callback_url,omitempty"`
	RecordingCallbackMethod        string      `json:"recording_callback_method,omitempty" url:"recording_callback_method,omitempty"`
	StatusCallbackUrl              string      `json:"status_callback_url,omitempty" url:"status_callback_url,omitempty"`
	StatusCallbackMethod           string      `json:"status_callback_method,omitempty" url:"status_callback_method,omitempty"`
	OnExitActionUrl                string      `json:"on_exit_action_url,omitempty" url:"on_exit_action_url,omitempty"`
	OnExitActionMethod             string      `json:"on_exit_action_method,omitempty" url:"on_exit_action_method,omitempty"`
	Record                         bool        `json:"record,omitempty" url:"record,omitempty"`
	RecordFileFormat               string      `json:"record_file_format,omitempty" url:"record_file_format,omitempty"`
	StatusCallbackEvents           string      `json:"status_callback_events,omitempty" url:"status_callback_events,omitempty"`
	StayAlone                      bool        `json:"stay_alone,omitempty" url:"stay_alone,omitempty"`
	CoachMode                      bool        `json:"coach_mode,omitempty" url:"coach_mode,omitempty"`
	Mute                           bool        `json:"mute,omitempty" url:"mute,omitempty"`
	Hold                           bool        `json:"hold,omitempty" url:"hold,omitempty"`
	StartMpcOnEnter                *bool       `json:"start_mpc_on_enter,omitempty" url:"start_mpc_on_enter,omitempty"`
	EndMpcOnExit                   bool        `json:"end_mpc_on_exit,omitempty" url:"end_mpc_on_exit,omitempty"`
	RelayDtmfInputs                bool        `json:"relay_dtmf_inputs,omitempty" url:"relay_dtmf_inputs,omitempty"`
	EnterSound                     string      `json:"enter_sound,omitempty" url:"enter_sound,omitempty"`
	EnterSoundMethod               string      `json:"enter_sound_method,omitempty" url:"enter_sound_method,omitempty"`
	ExitSound                      string      `json:"exit_sound,omitempty" url:"exit_sound,omitempty"`
	ExitSoundMethod                string      `json:"exit_sound_method,omitempty" url:"exit_sound_method,omitempty"`
	StartRecordingAudio            string      `json:"start_recording_audio,omitempty" url:"start_recording_audio,omitempty"`
	StartRecordingAudioMethod      string      `json:"start_recording_audio_method,omitempty" url:"start_recording_audio_method,omitempty"`
	StopRecordingAudio             string      `json:"stop_recording_audio,omitempty" url:"stop_recording_audio,omitempty"`
	StopRecordingAudioMethod       string      `json:"stop_recording_audio_method,omitempty" url:"stop_recording_audio_method,omitempty"`
	RecordMinMemberCount           int64       `json:"record_min_member_count,omitempty" url:"record_min_member_count,omitempty"`
	AgentHoldMusic                 string      `json:"agent_hold_music,omitempty" url:"agent_hold_music,omitempty"`
	CustomerHoldMusic              string      `json:"customer_hold_music,omitempty" url:"customer_hold_music,omitempty"`
	CreateMpcWithSingleParticipant *bool       `json:"create_mpc_with_single_participant,omitempty" url:"create_mpc_with_single_participant,omitempty"`
}

type MultiPartyCallAddParticipantResponse

type MultiPartyCallAddParticipantResponse struct {
	ApiID       string                `json:"api_id" url:"api_id"`
	Calls       []*CallAddParticipant `json:"calls" url:"calls"`
	Message     string                `json:"message,omitempty" url:"message,omitempty"`
	RequestUuid string                `json:"request_uuid,omitempty" url:"request_uuid,omitempty"`
}

type MultiPartyCallAudioParams

type MultiPartyCallAudioParams struct {
	Url string `json:"url" url:"url"`
}

type MultiPartyCallAudioResponse

type MultiPartyCallAudioResponse struct {
	APIID        string   `json:"api_id" url:"api_id"`
	Message      string   `json:"message" url:"message"`
	MemberId     []string `json:"mpcMemberId,omitempty" url:"mpcMemberId,omitempty"`
	FriendlyName string   `json:"mpcName,omitempty" url:"mpcName,omitempty"`
}

type MultiPartyCallBasicParams

type MultiPartyCallBasicParams struct {
	MpcUuid      string
	FriendlyName string
}

type MultiPartyCallGetResponse

type MultiPartyCallGetResponse struct {
	BilledAmount         string `json:"billed_amount,omitempty" url:"billed_amount,omitempty"`
	BilledDuration       int64  `json:"billed_duration,omitempty" url:"billed_duration,omitempty"`
	CreationTime         string `json:"creation_time,omitempty" url:"creation_time,omitempty"`
	Duration             int64  `json:"duration,omitempty" url:"duration,omitempty"`
	EndTime              string `json:"end_time,omitempty" url:"end_time,omitempty"`
	FriendlyName         string `json:"friendly_name,omitempty" url:"friendly_name,omitempty"`
	MpcUuid              string `json:"mpc_uuid,omitempty" url:"mpc_uuid,omitempty"`
	Participants         string `json:"participants,omitempty" url:"participants,omitempty"`
	Recording            string `json:"recording,omitempty" url:"recording,omitempty"`
	ResourceUri          string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	StartTime            string `json:"start_time,omitempty" url:"start_time,omitempty"`
	Status               string `json:"status,omitempty" url:"status,omitempty"`
	StayAlone            bool   `json:"stay_alone,omitempty" url:"stay_alone,omitempty"`
	SubAccount           string `json:"sub_account,omitempty" url:"sub_account,omitempty"`
	TerminationCause     string `json:"termination_cause,omitempty" url:"termination_cause,omitempty"`
	TerminationCauseCode int64  `json:"termination_cause_code,omitempty" url:"termination_cause_code,omitempty"`
}

type MultiPartyCallListParams

type MultiPartyCallListParams struct {
	SubAccount           string `json:"sub_account,omitempty" url:"sub_account,omitempty"`
	FriendlyName         string `json:"friendly_name,omitempty" url:"friendly_name,omitempty"`
	Status               string `json:"status,omitempty" url:"status,omitempty"`
	TerminationCauseCode int64  `json:"termination_cause_code,omitempty" url:"termination_cause_code,omitempty"`
	EndTimeGt            string `json:"end_time__gt,omitempty" url:"end_time__gt,omitempty"`
	EndTimeGte           string `json:"end_time__gte,omitempty" url:"end_time__gte,omitempty"`
	EndTimeLt            string `json:"end_time__lt,omitempty" url:"end_time__lt,omitempty"`
	EndTimeLte           string `json:"end_time__lte,omitempty" url:"end_time__lte,omitempty"`
	CreationTimeGt       string `json:"creation_time__gt,omitempty" url:"creation_time__gt,omitempty"`
	CreationTimeGte      string `json:"creation_time__gte,omitempty" url:"creation_time__gte,omitempty"`
	CreationTimeLt       string `json:"creation_time__lt,omitempty" url:"creation_time__lt,omitempty"`
	CreationTimeLte      string `json:"creation_time__lte,omitempty" url:"creation_time__lte,omitempty"`
	Limit                int64  `json:"limit,omitempty" url:"limit,omitempty"`
	Offset               int64  `json:"offset,omitempty" url:"offset,omitempty"`
}

type MultiPartyCallListParticipantParams

type MultiPartyCallListParticipantParams struct {
	CallUuid string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
}

type MultiPartyCallListParticipantsResponse

type MultiPartyCallListParticipantsResponse struct {
	ApiID   string                       `json:"api_id" url:"api_id"`
	Meta    *ListMPCMeta                 `json:"meta" url:"meta"`
	Objects []*MultiPartyCallParticipant `json:"objects" url:"objects"`
}

type MultiPartyCallListResponse

type MultiPartyCallListResponse struct {
	ApiID   string                       `json:"api_id" url:"api_id"`
	Meta    *ListMPCMeta                 `json:"meta" url:"meta"`
	Objects []*MultiPartyCallGetResponse `json:"objects" url:"objects"`
}

type MultiPartyCallParticipant

type MultiPartyCallParticipant struct {
	BilledAmount    string `json:"billed_amount,omitempty" url:"billed_amount,omitempty"`
	BilledDuration  int64  `json:"billed_duration,omitempty" url:"billed_duration,omitempty"`
	CallUuid        string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	CoachMode       bool   `json:"coach_mode,omitempty" url:"coach_mode,omitempty"`
	Duration        int64  `json:"duration,omitempty" url:"duration,omitempty"`
	EndMpcOnExit    bool   `json:"end_mpc_on_exit,omitempty" url:"end_mpc_on_exit,omitempty"`
	ExitCause       string `json:"exit_cause,omitempty" url:"exit_cause,omitempty"`
	ExitTime        string `json:"exit_time,omitempty" url:"exit_time,omitempty"`
	Hold            bool   `json:"hold,omitempty" url:"hold,omitempty"`
	JoinTime        string `json:"join_time,omitempty" url:"join_time,omitempty"`
	MemberAddress   string `json:"member_address,omitempty" url:"member_address,omitempty"`
	MemberId        string `json:"member_id,omitempty" url:"member_id,omitempty"`
	MpcUuid         string `json:"mpc_uuid,omitempty" url:"mpc_uuid,omitempty"`
	Mute            bool   `json:"mute,omitempty" url:"mute,omitempty"`
	ResourceUri     string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	Role            string `json:"role,omitempty" url:"role,omitempty"`
	StartMpcOnEnter bool   `json:"start_mpc_on_enter,omitempty" url:"start_mpc_on_enter,omitempty"`
}

type MultiPartyCallParticipantParams

type MultiPartyCallParticipantParams struct {
	MpcUuid       string
	FriendlyName  string
	ParticipantId string
}

type MultiPartyCallService

type MultiPartyCallService struct {
	// contains filtered or unexported fields
}

func (*MultiPartyCallService) AddParticipant

func (*MultiPartyCallService) Get

func (service *MultiPartyCallService) Get(basicParams MultiPartyCallBasicParams) (response *MultiPartyCallGetResponse, err error)

func (*MultiPartyCallService) GetParticipant

func (service *MultiPartyCallService) GetParticipant(basicParams MultiPartyCallParticipantParams) (response *MultiPartyCallParticipant, err error)

func (*MultiPartyCallService) KickParticipant

func (service *MultiPartyCallService) KickParticipant(basicParams MultiPartyCallParticipantParams) (err error)

func (*MultiPartyCallService) List

func (service *MultiPartyCallService) List(params MultiPartyCallListParams) (response *MultiPartyCallListResponse, err error)

func (*MultiPartyCallService) ListParticipants

func (*MultiPartyCallService) PauseParticipantRecording

func (service *MultiPartyCallService) PauseParticipantRecording(basicParams MultiPartyCallParticipantParams) (err error)

func (*MultiPartyCallService) PauseRecording

func (service *MultiPartyCallService) PauseRecording(basicParams MultiPartyCallBasicParams) (err error)

func (*MultiPartyCallService) ResumeParticipantRecording

func (service *MultiPartyCallService) ResumeParticipantRecording(basicParams MultiPartyCallParticipantParams) (err error)

func (*MultiPartyCallService) ResumeRecording

func (service *MultiPartyCallService) ResumeRecording(basicParams MultiPartyCallBasicParams) (err error)

func (*MultiPartyCallService) Start

func (service *MultiPartyCallService) Start(basicParams MultiPartyCallBasicParams) (err error)

func (*MultiPartyCallService) StartParticipantRecording

func (service *MultiPartyCallService) StartParticipantRecording(basicParams MultiPartyCallParticipantParams, params MultiPartyCallStartRecordingParams) (response *MultiPartyCallStartRecordingResponse, err error)

func (*MultiPartyCallService) StartPlayAudio

func (*MultiPartyCallService) StartRecording

func (*MultiPartyCallService) StartSpeak added in v7.21.0

func (*MultiPartyCallService) Stop

func (service *MultiPartyCallService) Stop(basicParams MultiPartyCallBasicParams) (err error)

func (*MultiPartyCallService) StopParticipantRecording

func (service *MultiPartyCallService) StopParticipantRecording(basicParams MultiPartyCallParticipantParams) (err error)

func (*MultiPartyCallService) StopPlayAudio

func (service *MultiPartyCallService) StopPlayAudio(basicParams MultiPartyCallParticipantParams) (err error)

func (*MultiPartyCallService) StopRecording

func (service *MultiPartyCallService) StopRecording(basicParams MultiPartyCallBasicParams) (err error)

func (*MultiPartyCallService) StopSpeak added in v7.21.0

func (service *MultiPartyCallService) StopSpeak(basicParams MultiPartyCallParticipantParams) (err error)

func (*MultiPartyCallService) UpdateParticipant

type MultiPartyCallSpeakParams added in v7.21.0

type MultiPartyCallSpeakParams struct {
	Text           string `json:"text" url:"text"`
	Voice          string `json:"voice" url:"voice,omitempty"`
	Language       string `json:"language" url:"language,omitempty"`
	Mix            bool   `json:"mix" url:"mix,omitempty"`
	Type           string `json:"type,omitempty" url:"type,omitempty"`
	CallbackURL    string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
}

type MultiPartyCallStartRecordingParams

type MultiPartyCallStartRecordingParams struct {
	FileFormat              string `json:"file_format,omitempty" url:"file_format,omitempty"`
	RecordingCallbackUrl    string `json:"recording_callback_url,omitempty" url:"recording_callback_url,omitempty"`
	RecordingCallbackMethod string `json:"recording_callback_method,omitempty" url:"recording_callback_method,omitempty"`
}

type MultiPartyCallStartRecordingResponse

type MultiPartyCallStartRecordingResponse struct {
	ApiID        string `json:"api_id" url:"api_id"`
	Message      string `json:"message,omitempty" url:"message,omitempty"`
	RecordingId  string `json:"recording_id,omitempty" url:"recording_id,omitempty"`
	RecordingUrl string `json:"recording_url,omitempty" url:"recording_url,omitempty"`
}

type MultiPartyCallUpdateParticipantParams

type MultiPartyCallUpdateParticipantParams struct {
	CoachMode *bool `json:"coach_mode,omitempty" url:"coach_mode,omitempty"`
	Mute      *bool `json:"mute,omitempty" url:"mute,omitempty"`
	Hold      *bool `json:"hold,omitempty" url:"hold,omitempty"`
}

type MultiPartyCallUpdateParticipantResponse

type MultiPartyCallUpdateParticipantResponse struct {
	ApiID string `json:"api_id" url:"api_id"`
	MPCUpdateResponse
}

type Node

type Node struct {
	ApiID     string `json:"api_id" url:"api_id"`
	NodeID    string `json:"node_id" url:"node_id"`
	PhloID    string `json:"phlo_id" url:"phlo_id"`
	Name      string `json:"name" url:"name"`
	NodeType  string `json:"node_type" url:"node_type"`
	CreatedOn string `json:"created_on" url:"created_on"`
}

type NodeActionResponse

type NodeActionResponse struct {
	ApiID string `json:"api_id" url:"api_id"`
	Error string `json:"error" url:"error"`
}

type Number

type Number struct {
	Alias                              string `json:"alias,omitempty" url:"alias,omitempty"`
	VoiceEnabled                       bool   `json:"voice_enabled,omitempty" url:"voice_enabled,omitempty"`
	SMSEnabled                         bool   `json:"sms_enabled,omitempty" url:"sms_enabled,omitempty"`
	MMSEnabled                         bool   `json:"mms_enabled,omitempty" url:"mms_enabled,omitempty"`
	Description                        string `json:"description,omitempty" url:"description,omitempty"`
	PlivoNumber                        bool   `json:"plivo_number,omitempty" url:"plivo_number,omitempty"`
	City                               string `json:"city,omitempty" url:"city,omitempty"`
	Country                            string `json:"country,omitempty" url:"country,omitempty"`
	Carrier                            string `json:"carrier,omitempty" url:"carrier,omitempty"`
	Number                             string `json:"number,omitempty" url:"number,omitempty"`
	NumberType                         string `json:"number_type,omitempty" url:"number_type,omitempty"`
	MonthlyRentalRate                  string `json:"monthly_rental_rate,omitempty" url:"monthly_rental_rate,omitempty"`
	Application                        string `json:"application,omitempty" url:"application,omitempty"`
	RenewalDate                        string `json:"renewal_date,omitempty" url:"renewal_date,omitempty"`
	CNAMLookup                         string `json:"cnam_lookup,omitempty" url:"cnam_lookup,omitempty"`
	AddedOn                            string `json:"added_on,omitempty" url:"added_on,omitempty"`
	ResourceURI                        string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	VoiceRate                          string `json:"voice_rate,omitempty" url:"voice_rate,omitempty"`
	SMSRate                            string `json:"sms_rate,omitempty" url:"sms_rate,omitempty"`
	MMSRate                            string `json:"mms_rate,omitempty" url:"mms_rate,omitempty"`
	TendlcCampaignID                   string `json:"tendlc_campaign_id,omitempty" url:"tendlc_campaign_id,omitempty"`
	TendlcRegistrationStatus           string `json:"tendlc_registration_status,omitempty" url:"tendlc_registration_status,omitempty"`
	TollFreeSMSVerification            string `json:"toll_free_sms_verification,omitempty" url:"toll_free_sms_verification,omitempty"`
	TollFreeSMSVerificationID          string `json:"toll_free_sms_verification_id,omitempty" url:"toll_free_sms_verification_id,omitempty"`
	TollFreeSMSVerificationOrderStatus string `json:"toll_free_sms_verification_order_status,omitempty" url:"toll_free_sms_verification_order_status,omitempty"`
}

func (Number) ID

func (self Number) ID() string

type NumberCreateParams

type NumberCreateParams struct {
	Numbers    string `json:"numbers,omitempty" url:"numbers,omitempty"`
	Carrier    string `json:"carrier,omitempty" url:"carrier,omitempty"`
	Region     string `json:"region,omitempty" url:"region,omitempty"`
	NumberType string `json:"number_type,omitempty" url:"number_type,omitempty"`
	AppID      string `json:"app_id,omitempty" url:"app_id,omitempty"`
	Subaccount string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
}

type NumberCreateResponse

type NumberCreateResponse BaseResponse

type NumberDeleteResponse

type NumberDeleteResponse struct {
	PowerpackDeleteResponse
}

type NumberFormat

type NumberFormat struct {
	E164          string `json:"e164"`
	National      string `json:"national"`
	International string `json:"international"`
	RFC3966       string `json:"rfc3966"`
}

type NumberListParams

type NumberListParams struct {
	NumberType                         string `json:"number_type,omitempty" url:"number_type,omitempty"`
	NumberStartsWith                   string `json:"number_startswith,omitempty" url:"number_startswith,omitempty"`
	Subaccount                         string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
	RenewalDate                        string `json:"renewal_date,omitempty" url:"renewal_date,omitempty"`
	RenewalDateLt                      string `json:"renewal_date__lt,omitempty" url:"renewal_date__lt,omitempty"`
	RenewalDateLte                     string `json:"renewal_date__lte,omitempty" url:"renewal_date__lte,omitempty"`
	RenewalDateGt                      string `json:"renewal_date__gt,omitempty" url:"renewal_date__gt,omitempty"`
	RenewalDateGte                     string `json:"renewal_date__gte,omitempty" url:"renewal_date__gte,omitempty"`
	Services                           string `json:"services,omitempty" url:"services,omitempty"`
	Alias                              string `json:"alias,omitempty" url:"alias,omitempty"`
	Limit                              int64  `json:"limit,omitempty" url:"limit,omitempty"`
	Offset                             int64  `json:"offset,omitempty" url:"offset,omitempty"`
	TendlcCampaignID                   string `json:"tendlc_campaign_id,omitempty" url:"tendlc_campaign_id,omitempty"`
	TendlcRegistrationStatus           string `json:"tendlc_registration_status,omitempty" url:"tendlc_registration_status,omitempty"`
	TollFreeSMSVerification            string `json:"toll_free_sms_verification,omitempty" url:"toll_free_sms_verification,omitempty"`
	CNAMLookup                         string `json:"cnam_lookup,omitempty" url:"cnam_lookup,omitempty"`
	TollFreeSMSVerificationOrderStatus string `json:"toll_free_sms_verification_order_status,omitempty" url:"toll_free_sms_verification_order_status,omitempty"`
}

type NumberListResponse

type NumberListResponse struct {
	ApiID   string    `json:"api_id" url:"api_id"`
	Meta    *Meta     `json:"meta" url:"meta"`
	Objects []*Number `json:"objects" url:"objects"`
}

type NumberPoolResponse

type NumberPoolResponse struct {
	Number_pool_uuid              string `json:"number_pool_uuid,omitempty"`
	Number                        string `json:"number,omitempty"`
	Type                          string `json:"Type,omitempty"`
	Country_iso2                  string `json:"country_iso2,omitempty"`
	Service                       string `json:"service,omitempty"`
	Added_on                      string `json:"added_on,omitempty"`
	Account_phone_number_resource string `json:"account_phone_number_resource,omitempty"`
}

type NumberPriority

type NumberPriority struct {
	ServiceType string   `json:"service_type"`
	CountryISO  string   `json:"country_iso"`
	Priority    Priority `json:"priority"`
}

type NumberRemoveParams

type NumberRemoveParams struct {
	Unrent bool `json:"unrent,omitempty"`
}

type NumberResponse

type NumberResponse struct {
	ApiID string `json:"api_id,omitempty"`
	NumberPoolResponse
	Error string `json:"error,omitempty"`
}

type NumberService

type NumberService struct {
	// contains filtered or unexported fields
}

func (*NumberService) Create

func (service *NumberService) Create(params NumberCreateParams) (response *NumberCreateResponse, err error)

func (*NumberService) Delete

func (service *NumberService) Delete(NumberId string) (err error)

func (*NumberService) Get

func (service *NumberService) Get(NumberId string) (response *Number, err error)

func (*NumberService) List

func (service *NumberService) List(params NumberListParams) (response *NumberListResponse, err error)

func (*NumberService) Update

func (service *NumberService) Update(NumberId string, params NumberUpdateParams) (response *NumberUpdateResponse, err error)

type NumberUpdateParams

type NumberUpdateParams struct {
	AppID      string `json:"app_id,omitempty" url:"app_id,omitempty"`
	Subaccount string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
	Alias      string `json:"alias,omitempty" url:"alias,omitempty"`
	CNAMLookup string `json:"cnam_lookup,omitempty" url:"cnam_lookup,omitempty"`
}

type NumberUpdateResponse

type NumberUpdateResponse BaseResponse

type OperatorDetail

type OperatorDetail struct {
	BrandTier string `json:"brand_tier,omitempty"`
	TPM       int    `json:"tpm,omitempty"`
}

type PPKMeta

type PPKMeta struct {
	Previous   *string
	Next       *string
	TotalCount int `json:"total_count" url:"api_id"`
	Offset     int
	Limit      int
}

type Parameter added in v7.35.0

type Parameter struct {
	Type     string    `mapstructure:"type" json:"type" validate:"required"`
	Text     string    `mapstructure:"text" json:"text,omitempty"`
	Media    string    `mapstructure:"media" json:"media,omitempty"`
	Currency *Currency `mapstructure:"currency" json:"currency,omitempty"`
	DateTime *DateTime `mapstructure:"date_time" json:"date_time,omitempty"`
}

type Phlo

type Phlo struct {
	BaseResource
	ApiId     string `json:"api_id" url:"api_id"`
	PhloId    string `json:"phlo_id" url:"phlo_id"`
	Name      string `json:"name" url:"name"`
	CreatedOn string `json:"created_on" url:"created_on"`
}

func (*Phlo) MultiPartyCall

func (self *Phlo) MultiPartyCall(nodeId string) (response *PhloMultiPartyCall, err error)

func (*Phlo) Node

func (self *Phlo) Node(nodeId string) (response *Node, err error)

func (*Phlo) Run

func (self *Phlo) Run(data map[string]interface{}) (response *PhloRun, err error)

type PhloClient

type PhloClient struct {
	BaseClient

	Phlos *Phlos
}

func NewPhloClient

func NewPhloClient(authId, authToken string, options *ClientOptions) (client *PhloClient, err error)

To set a proxy for all requests, configure the Transport for the HttpClient passed in:

	&http.Client{
 		Transport: &http.Transport{
 			Proxy: http.ProxyURL("http//your.proxy.here"),
 		},
 	}

Similarly, to configure the timeout, set it on the HttpClient passed in:

	&http.Client{
 		Timeout: time.Minute,
 	}

func (*PhloClient) NewRequest

func (client *PhloClient) NewRequest(method string, params interface{}, formatString string,
	formatParams ...interface{}) (*http.Request, error)

type PhloMultiPartyCall

type PhloMultiPartyCall struct {
	Node
	BaseResource
}

func (*PhloMultiPartyCall) Call

func (*PhloMultiPartyCall) ColdTransfer

func (self *PhloMultiPartyCall) ColdTransfer(params PhloMultiPartyCallActionPayload) (response *NodeActionResponse,
	err error)

func (*PhloMultiPartyCall) Member

func (self *PhloMultiPartyCall) Member(memberID string) (response *PhloMultiPartyCallMember)

func (*PhloMultiPartyCall) WarmTransfer

func (self *PhloMultiPartyCall) WarmTransfer(params PhloMultiPartyCallActionPayload) (response *NodeActionResponse,
	err error)

type PhloMultiPartyCallActionPayload

type PhloMultiPartyCallActionPayload struct {
	Action        string `json:"action" url:"action"`
	To            string `json:"to" url:"to"`
	Role          string `json:"role" url:"role"`
	TriggerSource string `json:"trigger_source" url:"trigger_source"`
}

type PhloMultiPartyCallMember

type PhloMultiPartyCallMember struct {
	NodeID        string `json:"node_id" url:"node_id"`
	PhloID        string `json:"phlo_id" url:"phlo_id"`
	NodeType      string `json:"node_type" url:"node_type"`
	MemberAddress string `json:"member_address" url:"member_address"`
	BaseResource
}

func (*PhloMultiPartyCallMember) AbortTransfer

func (self *PhloMultiPartyCallMember) AbortTransfer() (*NodeActionResponse, error)

func (*PhloMultiPartyCallMember) HangUp

func (service *PhloMultiPartyCallMember) HangUp() (*NodeActionResponse, error)

func (*PhloMultiPartyCallMember) Hold

func (*PhloMultiPartyCallMember) ResumeCall

func (service *PhloMultiPartyCallMember) ResumeCall() (*NodeActionResponse, error)

func (*PhloMultiPartyCallMember) UnHold

func (service *PhloMultiPartyCallMember) UnHold() (*NodeActionResponse, error)

func (*PhloMultiPartyCallMember) VoiceMailDrop

func (service *PhloMultiPartyCallMember) VoiceMailDrop() (*NodeActionResponse, error)

type PhloMultiPartyCallMemberActionPayload

type PhloMultiPartyCallMemberActionPayload struct {
	Action string `json:"action" url:"action"`
}

type PhloRun

type PhloRun struct {
	ApiID     string `json:"api_id" url:"api_id"`
	PhloRunID string `json:"phlo_run_id" url:"phlo_run_id"`
	PhloID    string `json:"phlo_id" url:"phlo_id"`
	Message   string `json:"message" url:"message"`
}

type Phlos

type Phlos struct {
	BaseResourceInterface
}

func NewPhlos

func NewPhlos(client *PhloClient) (phlos *Phlos)

func (*Phlos) Get

func (self *Phlos) Get(phloId string) (response *Phlo, err error)

type PhoneNumber

type PhoneNumber struct {
	Country           string `json:"country" url:"country"`
	City              string `json:"city" url:"city"`
	Lata              int    `json:"lata" url:"lata"`
	MonthlyRentalRate string `json:"monthly_rental_rate" url:"monthly_rental_rate"`
	Number            string `json:"number" url:"number"`
	Type              string `json:"type" url:"type"`
	Prefix            string `json:"prefix" url:"prefix"`
	RateCenter        string `json:"rate_center" url:"rate_center"`
	Region            string `json:"region" url:"region"`
	ResourceURI       string `json:"resource_uri" url:"resource_uri"`
	Restriction       string `json:"restriction" url:"restriction"`
	RestrictionText   string `json:"restriction_text" url:"restriction_text"`
	SetupRate         string `json:"setup_rate" url:"setup_rate"`
	SmsEnabled        bool   `json:"sms_enabled" url:"sms_enabled"`
	SmsRate           string `json:"sms_rate" url:"sms_rate"`
	MmsEnabled        bool   `json:"mms_enabled" url:"mms_enabled"`
	MmsRate           string `json:"mms_rate" url:"mms_rate"`
	VoiceEnabled      bool   `json:"voice_enabled" url:"voice_enabled"`
	VoiceRate         string `json:"voice_rate" url:"voice_rate"`
}

func (PhoneNumber) ID

func (self PhoneNumber) ID() string

type PhoneNumberCreateParams

type PhoneNumberCreateParams struct {
	AppID      string `json:"app_id,omitempty" url:"app_id,omitempty"`
	CNAMLookup string `json:"cnam_lookup,omitempty" url:"cnam_lookup,omitempty"`
}

type PhoneNumberCreateResponse

type PhoneNumberCreateResponse struct {
	APIID   string `json:"api_id" url:"api_id"`
	Message string `json:"message" url:"message"`
	Numbers []struct {
		Number string `json:"number" url:"number"`
		Status string `json:"status" url:"status"`
	} `json:"numbers" url:"numbers"`
	Status string `json:"status" url:"status"`
}

type PhoneNumberListParams

type PhoneNumberListParams struct {
	CountryISO string `json:"country_iso,omitempty" url:"country_iso,omitempty"`
	Type       string `json:"type,omitempty" url:"type,omitempty"`
	Pattern    string `json:"pattern,omitempty" url:"pattern,omitempty"`
	Region     string `json:"region,omitempty" url:"region,omitempty"`
	Services   string `json:"services,omitempty" url:"services,omitempty"`
	LATA       string `json:"lata,omitempty" url:"lata,omitempty"`
	RateCenter string `json:"rate_center,omitempty" url:"rate_center,omitempty"`
	City       string `json:"city,omitempty" url:"city,omitempty"`
	Limit      int    `json:"limit,omitempty" url:"limit,omitempty"`
	Offset     int    `json:"offset,omitempty" url:"offset,omitempty"`
}

type PhoneNumberListResponse

type PhoneNumberListResponse struct {
	ApiID   string         `json:"api_id" url:"api_id"`
	Meta    *Meta          `json:"meta" url:"meta"`
	Objects []*PhoneNumber `json:"objects" url:"objects"`
}

type PhoneNumberService

type PhoneNumberService struct {
	// contains filtered or unexported fields
}

func (*PhoneNumberService) Create

func (service *PhoneNumberService) Create(number string, params PhoneNumberCreateParams) (response *PhoneNumberCreateResponse, err error)

func (*PhoneNumberService) List

func (service *PhoneNumberService) List(params PhoneNumberListParams) (response *PhoneNumberListResponse, err error)

type Plan

type Plan struct {
	VoiceRate           string `json:"voice_rate,omitempty" url:"voice_rate,omitempty"`
	MessagingRate       string `json:"messaging_rate,omitempty" url:"messaging_rate,omitempty"`
	Name                string `json:"name_rate,omitempty" url:"name_rate,omitempty"`
	MonthlyCloudCredits string `json:"monthly_cloud_credits,omitempty" url:"monthly_cloud_credits,omitempty"`
}

type PowerackCreateParams

type PowerackCreateParams struct {
	Name string `json:"name,omitempty"`
	// Optional parameters.
	StickySender     bool             `json:"sticky_sender,omitempty"`
	LocalConnect     bool             `json:"local_connect,omitempty"`
	ApplicationType  string           `json:"application_type,omitempty"`
	ApplicationID    string           `json:"application_id,omitempty"`
	NumberPriorities []NumberPriority `json:"number_priority,omitempty"`
}

type PowerackUpdateParams

type PowerackUpdateParams struct {
	// Optional parameters.
	Name             string           `json:"name,omitempty"`
	StickySender     bool             `json:"sticky_sender,omitempty"`
	LocalConnect     bool             `json:"local_connect,omitempty"`
	ApplicationType  string           `json:"application_type,omitempty"`
	ApplicationID    string           `json:"application_id,omitempty"`
	NumberPriorities []NumberPriority `json:"number_priority,omitempty"`
}

type Powerpack

type Powerpack struct {
	UUID             string           `json:"uuid,omitempty"`
	Name             string           `json:"name,omitempty"`
	StickySender     bool             `json:"sticky_sender,omitempty"`
	LocalConnect     bool             `json:"local_connect,omitempty"`
	ApplicationType  string           `json:"application_type,omitempty"`
	ApplicationID    string           `json:"application_id,omitempty"`
	NumberPoolUUID   string           `json:"number_pool,omitempty"`
	CreatedOn        string           `json:"created_on,omitempty"`
	NumberPriorities []NumberPriority `json:"number_priority,omitempty"`
}

type PowerpackAddNumberOptions

type PowerpackAddNumberOptions struct {
	//Service can be 'sms' or 'mms'. Defaults to 'sms' when not set.
	Service string `json:"service,omitempty" url:"service,omitempty"`
}

type PowerpackCreateResponseBody

type PowerpackCreateResponseBody struct {
	ApiID string  `json:"api_id,omitempty"`
	Error *string `json:"error,omitempty" url:"error"`
	Powerpack
}

type PowerpackDeleteParams

type PowerpackDeleteParams struct {
	UnrentNumbers bool `json:"unrent_numbers,omitempty"`
}

type PowerpackDeleteResponse

type PowerpackDeleteResponse struct {
	ApiID    string `json:"api_id,omitempty"`
	Response string `json:"response,omitempty"`
	Error    string `json:"error,omitempty"`
}

type PowerpackFindNumberOptions

type PowerpackFindNumberOptions struct {
	//Service can be 'sms' or 'mms'. Defaults to 'sms' when not set.
	Service string `json:"service,omitempty" url:"service,omitempty"`
}

type PowerpackList

type PowerpackList struct {
	BaseListPPKResponse
	Objects []Powerpack `json:"objects" url:"objects"`
}

powerpack list

type PowerpackListParams

type PowerpackListParams struct {
	Limit   int    `url:"limit,omitempty"`
	Offset  int    `url:"offset,omitempty"`
	Service string `url:"service,omitempty"`
}

type PowerpackPhoneResponseBody

type PowerpackPhoneResponseBody struct {
	BaseListPPKResponse
	Objects []NumberPoolResponse `json:"objects" url:"objects"`
}

type PowerpackResponse

type PowerpackResponse struct {
	CreatedOn            string `json:"created_on,omitempty"`
	LocalConnect         bool   `json:"local_connect,omitempty"`
	Name                 string `json:"name,omitempty"`
	NumberPoolUUID       string `json:"number_pool,omitempty"`
	PowerpackResourceURI string `json:"powerpack_resource_uri,omitempty"`
	StickySender         bool   `json:"sticky_sender,omitempty"`
	UUID                 string `json:"uuid,omitempty"`
}

type PowerpackSearchParam

type PowerpackSearchParam struct {
	Starts_with  string `json:"starts_with,omitempty" url:"starts_with,omitempty"`
	Country_iso2 string `json:"country_iso2,omitempty" url:"country_iso2,omitempty"`
	Type         string `json:"type,omitempty" url:"type,omitempty"`
	Limit        string `json:"limit,omitempty" url:"limit,omitempty"`
	Offset       string `json:"offset,omitempty" url:"offset,omitempty"`
	Service      string `json:"service,omitempty" url:"service,omitempty"`
}

type PowerpackService

type PowerpackService struct {
	Powerpack
	// contains filtered or unexported fields
}

func (*PowerpackService) AddNumberWithOptions

func (service *PowerpackService) AddNumberWithOptions(number string, params PowerpackAddNumberOptions) (response *NumberResponse, err error)

func (*PowerpackService) Add_number

func (service *PowerpackService) Add_number(number string) (response *NumberResponse, err error)

func (*PowerpackService) Add_tollfree

func (service *PowerpackService) Add_tollfree(tollfree string) (response *NumberResponse, err error)

func (*PowerpackService) Buy_add_number

func (service *PowerpackService) Buy_add_number(phoneParam BuyPhoneNumberParam) (response *NumberResponse, err error)

func (*PowerpackService) Count_numbers

func (service *PowerpackService) Count_numbers(params PowerpackSearchParam) (count int, err error)

func (*PowerpackService) Create

func (service *PowerpackService) Create(params PowerackCreateParams) (response *PowerpackCreateResponseBody, err error)

func (*PowerpackService) Delete

func (service *PowerpackService) Delete(params PowerpackDeleteParams) (response *PowerpackDeleteResponse, err error)

func (*PowerpackService) FindNumbersWithOptions

func (service *PowerpackService) FindNumbersWithOptions(number string, params PowerpackFindNumberOptions) (response *NumberResponse, err error)

func (*PowerpackService) Find_numbers

func (service *PowerpackService) Find_numbers(number string) (response *NumberResponse, err error)

func (*PowerpackService) Find_shortcode

func (service *PowerpackService) Find_shortcode(shortcode string) (response *FindShortCodeResponse, err error)

func (*PowerpackService) Find_tollfree

func (service *PowerpackService) Find_tollfree(tollfree string) (response *FindTollfreeResponse, err error)

func (*PowerpackService) Get

func (service *PowerpackService) Get(powerpackUUID string) (response *PowerpackService, err error)

func (*PowerpackService) List

func (service *PowerpackService) List(params PowerpackListParams) (response *PowerpackList, err error)

returns the List.. of all powerpack

func (*PowerpackService) List_numbers

func (service *PowerpackService) List_numbers(params PowerpackSearchParam) (response *PowerpackPhoneResponseBody, err error)

func (*PowerpackService) List_shortcodes

func (service *PowerpackService) List_shortcodes() (response *ShortCodeResponse, err error)

func (*PowerpackService) List_tollfree

func (service *PowerpackService) List_tollfree() (response *TollfreeResponse, err error)

func (*PowerpackService) Remove_number

func (service *PowerpackService) Remove_number(number string, param NumberRemoveParams) (response *NumberDeleteResponse, err error)

func (*PowerpackService) Remove_shortcode

func (service *PowerpackService) Remove_shortcode(shortcode string) (response *ShortcodeDeleteResponse, err error)

func (*PowerpackService) Remove_tollfree

func (service *PowerpackService) Remove_tollfree(tollfree string, param NumberRemoveParams) (response *TollfreeDeleteResponse, err error)

func (*PowerpackService) Update

func (service *PowerpackService) Update(params PowerackUpdateParams) (response *PowerpackUpdateResponse, err error)

type PowerpackUpdateResponse

type PowerpackUpdateResponse struct {
	PowerpackCreateResponseBody
}

type Pricing

type Pricing struct {
	APIID       string `json:"api_id" url:"api_id"`
	Country     string `json:"country" url:"country"`
	CountryCode int    `json:"country_code" url:"country_code"`
	CountryISO  string `json:"country_iso" url:"country_iso"`
	Message     struct {
		Inbound struct {
			Rate string `json:"rate" url:"rate"`
		} `json:"inbound" url:"inbound"`
		Outbound struct {
			Rate string `json:"rate" url:"rate"`
		} `json:"outbound" url:"outbound"`
		OutboundNetworksList []struct {
			GroupName string `json:"group_name" url:"group_name"`
			Rate      string `json:"rate" url:"rate"`
		} `json:"outbound_networks_list" url:"outbound_networks_list"`
	} `json:"message" url:"message"`
	PhoneNumbers struct {
		Local struct {
			Rate string `json:"rate" url:"rate"`
		} `json:"local" url:"local"`
		Tollfree struct {
			Rate string `json:"rate" url:"rate"`
		} `json:"tollfree" url:"tollfree"`
	} `json:"phone_numbers" url:"phone_numbers"`
	Voice struct {
		Inbound struct {
			IP struct {
				Rate string `json:"rate" url:"rate"`
			} `json:"ip" url:"ip"`
			Local struct {
				Rate string `json:"rate" url:"rate"`
			} `json:"local" url:"local"`
			Tollfree struct {
				Rate string `json:"rate" url:"rate"`
			} `json:"tollfree" url:"tollfree"`
		} `json:"inbound" url:"inbound"`
		Outbound struct {
			IP struct {
				Rate string `json:"rate" url:"rate"`
			} `json:"ip" url:"ip"`
			Local struct {
				Rate string `json:"rate" url:"rate"`
			} `json:"local" url:"local"`
			Rates []struct {
				OriginationPrefix []string `json:"origination_prefix" url:"origination_prefix"`
				Prefix            []string `json:"prefix" url:"prefix"`
				Rate              string   `json:"rate" url:"rate"`
				VoiceNetworkGroup string   `json:"voice_network_group" url:"voice_network_group"`
			} `json:"rates" url:"rates"`
			Tollfree struct {
				Rate string `json:"rate" url:"rate"`
			} `json:"tollfree" url:"tollfree"`
		} `json:"outbound" url:"outbound"`
	} `json:"voice" url:"voice"`
}

func (Pricing) ID

func (self Pricing) ID() string

type PricingGetParams

type PricingGetParams struct {
	CountryISO string `json:"country_iso" url:"country_iso"`
}

type PricingService

type PricingService struct {
	// contains filtered or unexported fields
}

func (*PricingService) Get

func (service *PricingService) Get(countryISO string) (response *Pricing, err error)

type Priority

type Priority struct {
	Priority1 *string `json:"priority1"`
	Priority2 *string `json:"priority2"`
	Priority3 *string `json:"priority3"`
}

type Profile added in v7.12.1

type Profile struct {
	ProfileUUID       string            `json:"profile_uuid,omitempty"`
	ProfileAlias      string            `json:"profile_alias,omitempty"`
	ProfileType       string            `json:"profile_type,omitempty"`
	PrimaryProfile    string            `json:"primary_profile,omitempty"`
	CustomerType      string            `json:"customer_type,omitempty"`
	EntityType        string            `json:"entity_type,omitempty"`
	CompanyName       string            `json:"company_name,omitempty"`
	Ein               string            `json:"ein,omitempty"`
	EinIssuingCountry string            `json:"ein_issuing_country,omitempty"`
	Address           Address           `json:"address,omitempty"`
	StockSymbol       string            `json:"stock_symbol,omitempty"`
	StockExchange     string            `json:"stock_exchange,omitempty"`
	Website           string            `json:"website,omitempty"`
	Vertical          string            `json:"vertical,omitempty"`
	AltBusinessID     string            `json:"alt_business_id,omitempty"`
	AltBusinessidType string            `json:"alt_business_id_type,omitempty"`
	PlivoSubaccount   string            `json:"plivo_subaccount,omitempty"`
	AuthorizedContact AuthorizedContact `json:"authorized_contact,omitempty"`
	CreatedAt         string            `json:"created_at,omitempty"`
}

type ProfileGetResponse added in v7.12.1

type ProfileGetResponse struct {
	ApiID   string  `json:"api_id"`
	Profile Profile `json:"profile"`
}

type ProfileListParams added in v7.12.1

type ProfileListParams struct {
	Limit  int `url:"limit,omitempty"`
	Offset int `url:"offset,omitempty"`
}

type ProfileListResponse added in v7.12.1

type ProfileListResponse struct {
	ApiID string `json:"api_id"`
	Meta  struct {
		Previous *string
		Next     *string
		Offset   int64
		Limit    int64
	} `json:"meta"`
	ProfileResponse []Profile `json:"profiles"`
}

type ProfileService added in v7.12.1

type ProfileService struct {
	// contains filtered or unexported fields
}

func (*ProfileService) Create added in v7.12.1

func (service *ProfileService) Create(params CreateProfileRequestParams) (response *CreateProfileResponse, err error)

func (*ProfileService) Delete added in v7.12.1

func (service *ProfileService) Delete(profileUUID string) (response *DeleteProfileResponse, err error)

func (*ProfileService) Get added in v7.12.1

func (service *ProfileService) Get(ProfileUUID string) (response *ProfileGetResponse, err error)

func (*ProfileService) List added in v7.12.1

func (service *ProfileService) List(param ProfileListParams) (response *ProfileListResponse, err error)

func (*ProfileService) Update added in v7.12.1

func (service *ProfileService) Update(profileUUID string, params UpdateProfileRequestParams) (response *ProfileGetResponse, err error)

type QueuedCall

type QueuedCall struct {
	From        string `json:"from,omitempty" url:"from,omitempty"`
	To          string `json:"to,omitempty" url:"to,omitempty"`
	Status      string `json:"call_status,omitempty" url:"call_status,omitempty"`
	CallUUID    string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	CallerName  string `json:"caller_name,omitempty" url:"caller_name,omitempty"`
	APIID       string `json:"api_id,omitempty" url:"api_id,omitempty"`
	Direction   string `json:"direction,omitempty" url:"direction,omitempty"`
	RequestUUID string `json:"request_uuid,omitempty" url:"request_uuid,omitempty"`
}

type QueuedCallIDListResponse

type QueuedCallIDListResponse struct {
	APIID string   `json:"api_id" url:"api_id"`
	Calls []string `json:"calls" url:"calls"`
}

type QueuedCallService

type QueuedCallService struct {
	// contains filtered or unexported fields
}

func (*QueuedCallService) Get

func (service *QueuedCallService) Get(QueuedCallId string) (response *QueuedCall, err error)

func (*QueuedCallService) IDList

func (service *QueuedCallService) IDList() (response *QueuedCallIDListResponse, err error)

type Recording

type Recording struct {
	AddTime                       string  `json:"add_time,omitempty" url:"add_time,omitempty"`
	CallUUID                      string  `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	MonthlyRecordingStorageAmount float64 `json:"monthly_recording_storage_amount,omitempty" url:"monthly_recording_storage_amount,omitempty"`
	RecordingStorageDuration      int64   `json:"recording_storage_duration,omitempty" url:"recording_storage_duration,omitempty"`
	RecordingStorageRate          float64 `json:"recording_storage_rate,omitempty" url:"recording_storage_rate,omitempty"`
	RecordingID                   string  `json:"recording_id,omitempty" url:"recording_id,omitempty"`
	RecordingType                 string  `json:"recording_type,omitempty" url:"recording_type,omitempty"`
	RecordingFormat               string  `json:"recording_format,omitempty" url:"recording_format,omitempty"`
	ConferenceName                string  `json:"conference_name,omitempty" url:"conference_name,omitempty"`
	RecordingURL                  string  `json:"recording_url,omitempty" url:"recording_url,omitempty"`
	ResourceURI                   string  `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
	RecordingStartMS              string  `json:"recording_start_ms,omitempty" url:"recording_start_ms,omitempty"`
	RecordingEndMS                string  `json:"recording_end_ms,omitempty" url:"recording_end_ms,omitempty"`
	RecordingDurationMS           string  `json:"recording_duration_ms,omitempty" url:"recording_duration_ms,omitempty"`
	RoundedRecordingDuration      int64   `json:"rounded_recording_duration,omitempty" url:"rounded_recording_duration,omitempty"`
	FromNumber                    string  `json:"from_number,omitempty" url:"from_number,omitempty"`
	ToNumber                      string  `json:"to_number,omitempty" url:"to_number,omitempty"`
}

func (Recording) ID

func (self Recording) ID() string

type RecordingListParams

type RecordingListParams struct {
	// Query parameters.
	Subaccount                             string `json:"subaccount,omitempty" url:"subaccount,omitempty"`
	CallUUID                               string `json:"call_uuid,omitempty" url:"call_uuid,omitempty"`
	AddTimeLessThan                        string `json:"add_time__lt,omitempty" url:"add_time__lt,omitempty"`
	AddTimeGreaterThan                     string `json:"add_time__gt,omitempty" url:"add_time__gt,omitempty"`
	AddTimeLessOrEqual                     string `json:"add_time__lte,omitempty" url:"add_time__lte,omitempty"`
	AddTimeGreaterOrEqual                  string `json:"add_time__gte,omitempty" url:"add_time__gte,omitempty"`
	Limit                                  int64  `json:"limit,omitempty" url:"limit,omitempty"`
	Offset                                 int64  `json:"offset,omitempty" url:"offset,omitempty"`
	FromNumber                             string `json:"from_number,omitempty" url:"from_number,omitempty"`
	ToNumber                               string `json:"to_number,omitempty" url:"to_number,omitempty"`
	ConferenceName                         string `json:"conference_name,omitempty" url:"conference_name,omitempty"`
	MpcName                                string `json:"mpc_name,omitempty" url:"mpc_name,omitempty"`
	ConferenceUuid                         string `json:"conference_uuid,omitempty" url:"conference_uuid,omitempty"`
	MpcUuid                                string `json:"mpc_uuid,omitempty" url:"mpc_uuid,omitempty"`
	RecordingStorageDurationEquals         int64  `json:"recording_storage_duration,omitempty" url:"recording_storage_duration,omitempty"`
	RecordingStorageDurationLessThan       int64  `json:"recording_storage_duration__lt,omitempty" url:"recording_storage_duration__lt,omitempty"`
	RecordingStorageDurationGreaterThan    int64  `json:"recording_storage_duration__gt,omitempty" url:"recording_storage_duration__gt,omitempty"`
	RecordingStorageDurationLessOrEqual    int64  `json:"recording_storage_duration__lte,omitempty" url:"recording_storage_duration__lte,omitempty"`
	RecordingStorageDurationGreaterOrEqual int64  `json:"recording_storage_duration__gte,omitempty" url:"recording_storage_duration__gte,omitempty"`
}

type RecordingListResponse

type RecordingListResponse struct {
	ApiID   string       `json:"api_id" url:"api_id"`
	Meta    *Meta        `json:"meta" url:"meta"`
	Objects []*Recording `json:"objects" url:"objects"`
}

type RecordingService

type RecordingService struct {
	// contains filtered or unexported fields
}

func (*RecordingService) Delete

func (service *RecordingService) Delete(RecordingId string) (err error)

func (*RecordingService) Get

func (service *RecordingService) Get(RecordingId string) (response *Recording, err error)

func (*RecordingService) List

func (service *RecordingService) List(params RecordingListParams) (response *RecordingListResponse, err error)

type RentNumber

type RentNumber struct {
	Rent    string `json:"rent,omitempty"`
	Service string `json:"service,omitempty"`
}

type Session added in v7.33.0

type Session struct {
	APIID              string           `json:"api_id,omitempty"`
	SessionUUID        string           `json:"session_uuid,omitempty"`
	AppUUID            string           `json:"app_uuid,omitempty"`
	Alias              string           `json:"alias,omitempty"`
	Recipient          string           `json:"recipient,omitempty"`
	Channel            string           `json:"channel,omitempty"`
	Status             string           `json:"status,omitempty"`
	Count              int              `json:"count,omitempty"`
	RequesterIP        string           `json:"requestor_ip,omitempty"`
	CountryISO         string           `json:"destination_country_iso2,omitempty"`
	DestinationNetwork *string          `json:"destination_network,omitempty"`
	AttemptDetails     []AttemptDetails `json:"attempt_details,omitempty"`
	Charges            Charges          `json:"charges,omitempty"`
	CreatedAt          time.Time        `json:"created_at,omitempty"`
	UpdatedAt          time.Time        `json:"updated_at,omitempty"`
}

type SessionCreateParams added in v7.33.0

type SessionCreateParams struct {
	Recipient string `json:"recipient,omitempty"`
	// Optional parameters.
	AppUUID string `json:"app_uuid,omitempty"`
	Channel string `json:"channel,omitempty"`
	URL     string `json:"url,omitempty"`
	Method  string `json:"method,omitempty"`
	Src     string `json:"src,omitempty"`
}

type SessionCreateResponseBody added in v7.33.0

type SessionCreateResponseBody struct {
	APIID       string `json:"api_id,omitempty"`
	Error       string `json:"error,omitempty"`
	Message     string `json:"message,omitempty"`
	SessionUUID string `json:"session_uuid,omitempty"`
}

type SessionList added in v7.33.0

type SessionList struct {
	APIID string `json:"api_id"`
	Meta  struct {
		Limit    int     `json:"limit"`
		Offset   int     `json:"offset"`
		Next     *string `json:"next"`
		Previous *string `json:"previous"`
	} `json:"meta"`
	Sessions []Session `json:"sessions"`
}

type SessionListParams added in v7.33.0

type SessionListParams struct {
	Limit                     int    `url:"limit,omitempty"`
	Offset                    int    `url:"offset,omitempty"`
	Status                    string `url:"status,omitempty"`
	Recipient                 string `url:"recipient,omitempty"`
	AppUUID                   string `url:"app_uuid,omitempty"`
	Country                   string `url:"country,omitempty"`
	Alias                     string `url:"alias,omitempty"`
	SessionTime               string `url:"session_time,omitempty"`
	Subaccount                string `url:"subaccount,omitempty"`
	SessionTimeGreaterThan    string `url:"session_time__gt,omitempty"`
	SessionTimeGreaterOrEqual string `url:"session_time__gte,omitempty"`
	SessionTimeLessThan       string `url:"session_time__lt,omitempty"`
	SessionTimeLessOrEqual    string `url:"session_time__lte,omitempty"`
}

type SessionValidationParams added in v7.33.0

type SessionValidationParams struct {
	OTP string `json:"otp,omitempty"`
}

type ShortCode

type ShortCode struct {
	Number_pool_uuid string `json:"number_pool_uuid,omitempty"`
	Shortcode        string `json:"shortcode,omitempty"`
	Country_iso2     string `json:"country_iso2,omitempty"`
	Added_on         string `json:"added_on,omitempty"`
	Service          string `json:"service,omitempty"`
}

type ShortCodeResponse

type ShortCodeResponse struct {
	BaseListPPKResponse
	Objects []ShortCode `json:"objects" url:"objects"`
}

type ShortcodeDeleteResponse

type ShortcodeDeleteResponse struct {
	PowerpackDeleteResponse
}

type Subaccount

type Subaccount struct {
	Account     string `json:"account,omitempty" url:"account,omitempty"`
	ApiID       string `json:"api_id,omitempty" url:"api_id,omitempty"`
	AuthID      string `json:"auth_id,omitempty" url:"auth_id,omitempty"`
	AuthToken   string `json:"auth_token,omitempty" url:"auth_token,omitempty"`
	Created     string `json:"created,omitempty" url:"created,omitempty"`
	Modified    string `json:"modified,omitempty" url:"modified,omitempty"`
	Name        string `json:"name,omitempty" url:"name,omitempty"`
	Enabled     bool   `json:"enabled,omitempty" url:"enabled,omitempty"`
	ResourceURI string `json:"resource_uri,omitempty" url:"resource_uri,omitempty"`
}

func (Subaccount) ID

func (self Subaccount) ID() string

type SubaccountCreateParams

type SubaccountCreateParams struct {
	Name    string `json:"name,omitempty" url:"name,omitempty"`       // Name of the subaccount
	Enabled bool   `json:"enabled,omitempty" url:"enabled,omitempty"` // Specify if the subaccount should be enabled or not. Takes a value of True or False. Defaults to False
}

type SubaccountCreateResponse

type SubaccountCreateResponse struct {
	BaseResponse
	AuthId    string `json:"auth_id" url:"auth_id"`
	AuthToken string `json:"auth_token" url:"auth_token"`
}

type SubaccountDeleteParams

type SubaccountDeleteParams struct {
	Cascade bool `json:"cascade,omitempty" url:"cascade,omitempty"` // Specify if the sub account should be cascade deleted or not. Takes a value of True or False. Defaults to False
}

type SubaccountList

type SubaccountList struct {
	BaseListResponse
	Objects []Subaccount
}

type SubaccountListParams

type SubaccountListParams struct {
	Limit  int `json:"limit,omitempty" url:"limit,omitempty"`
	Offset int `json:"offset,omitempty" url:"offset,omitempty"`
}

type SubaccountService

type SubaccountService struct {
	// contains filtered or unexported fields
}

func (*SubaccountService) Create

func (service *SubaccountService) Create(params SubaccountCreateParams) (response *SubaccountCreateResponse, err error)

func (*SubaccountService) Delete

func (service *SubaccountService) Delete(subauthId string, data ...SubaccountDeleteParams) (err error)

func (*SubaccountService) Get

func (service *SubaccountService) Get(subauthId string) (response *Subaccount, err error)

func (*SubaccountService) List

func (service *SubaccountService) List(params SubaccountListParams) (response *SubaccountList, err error)

func (*SubaccountService) Update

func (service *SubaccountService) Update(subauthId string, params SubaccountUpdateParams) (response *SubaccountUpdateResponse, err error)

type SubaccountUpdateParams

type SubaccountUpdateParams SubaccountCreateParams

type SubaccountUpdateResponse

type SubaccountUpdateResponse BaseResponse

type SubmitComplianceApplicationResponse

type SubmitComplianceApplicationResponse struct {
	APIID                   string    `json:"api_id"`
	CreatedAt               time.Time `json:"created_at"`
	ComplianceApplicationID string    `json:"compliance_application_id"`
	Alias                   string    `json:"alias"`
	Status                  string    `json:"status"`
	EndUserType             string    `json:"end_user_type"`
	CountryIso2             string    `json:"country_iso2"`
	NumberType              string    `json:"number_type"`
	EndUserID               string    `json:"end_user_id"`
	ComplianceRequirementID string    `json:"compliance_requirement_id"`
	Documents               []struct {
		DocumentID       string `json:"document_id"`
		Name             string `json:"name"`
		DocumentName     string `json:"document_name,omitempty"`
		DocumentTypeID   string `json:"document_type_id,omitempty"`
		DocumentTypeName string `json:"document_type_name,omitempty"`
		Scope            string `json:"scope,omitempty"`
	} `json:"documents"`
}

type Template added in v7.35.0

type Template struct {
	Name       string      `mapstructure:"name" json:"name" validate:"required"`
	Language   string      `mapstructure:"language" json:"language" validate:"required"`
	Components []Component `mapstructure:"components" json:"components"`
}

func CreateWhatsappTemplate added in v7.35.0

func CreateWhatsappTemplate(templateData string) (template Template, err error)

type TokenCreateParams added in v7.11.0

type TokenCreateParams struct {
	// Required parameters.
	Iss string `json:"iss,omitempty" url:"iss,omitempty"`
	// Optional parameters.
	Exp           int64       `json:"exp,omitempty" url:"Exp,omitempty"`
	Nbf           int64       `json:"nbf,omitempty" url:"Nbf,omitempty"`
	IncomingAllow interface{} `json:"incoming_allow,omitempty" url:"incoming_allow,omitempty"`
	OutgoingAllow interface{} `json:"outgoing_allow,omitempty" url:"outgoing_allow,omitempty"`
	Per           interface{} `json:"per,omitempty" url:"per,omitempty"`
	App           string      `json:"app,omitempty" url:"App,omitempty"`
	Sub           string      `json:"sub,omitempty" url:"Sub,omitempty"`
}

type TokenCreateResponse added in v7.11.0

type TokenCreateResponse struct {
	Token string `json:"token" url:"token"`
	ApiID string `json:"api_id" url:"api_id"`
}

type TokenService added in v7.11.0

type TokenService struct {
	// contains filtered or unexported fields
}

func (*TokenService) Create added in v7.11.0

func (service *TokenService) Create(params TokenCreateParams) (response *TokenCreateResponse, err error)

type Tollfree

type Tollfree struct {
	NumberPoolUUID string `json:"number_pool_uuid,omitempty"`
	Tollfree       string `json:"number,omitempty"`
	Country_iso2   string `json:"country_iso2,omitempty"`
	Added_on       string `json:"added_on,omitempty"`
	Service        string `json:"service,omitempty"`
}

type TollfreeDeleteResponse

type TollfreeDeleteResponse struct {
	PowerpackDeleteResponse
}

type TollfreeResponse

type TollfreeResponse struct {
	BaseListPPKResponse
	Objects []Tollfree `json:"objects" url:"objects"`
}

type TollfreeVerification added in v7.41.0

type TollfreeVerification struct {
	UUID                  string    `json:"uuid"  url:"uuid"`
	ProfileUUID           string    `json:"profile_uuid" url:"profile_uuid"`
	Number                string    `json:"number" url:"number"`
	Usecase               string    `json:"usecase" url:"usecase"`
	UsecaseSummary        string    `json:"usecase_summary" url:"usecase_summary"`
	MessageSample         string    `json:"message_sample" url:"message_sample"`
	OptinImageURL         *string   `json:"optin_image_url" url:"optin_image_url"`
	OptinType             string    `json:"optin_type" url:"optin_type"`
	Volume                string    `json:"volume" url:"volume"`
	AdditionalInformation string    `json:"additional_information" url:"additional_information"`
	ExtraData             string    `json:"extra_data" url:"extra_data"`
	CallbackURL           string    `json:"callback_url" url:"callback_url"`
	CallbackMethod        string    `json:"callback_method" url:"callback_method"`
	Status                string    `json:"status" url:"status"`
	ErrorMessage          string    `json:"error_message" url:"error_message"`
	Created               time.Time `json:"created" url:"created"`
	LastModified          time.Time `json:"last_modified" url:"last_modified"`
}

TollfreeVerification struct

func (TollfreeVerification) ID added in v7.41.0

func (self TollfreeVerification) ID() string

type TollfreeVerificationCreateParams added in v7.41.0

type TollfreeVerificationCreateParams struct {
	ProfileUUID           string `json:"profile_uuid,omitempty" url:"profile_uuid,omitempty"`
	Usecase               string `json:"usecase,omitempty" url:"usecase,omitempty"`
	UsecaseSummary        string `json:"usecase_summary,omitempty" url:"usecase_summary,omitempty"`
	MessageSample         string `json:"message_sample,omitempty" url:"message_sample,omitempty"`
	OptInImageURL         string `json:"optin_image_url,omitempty" url:"optin_image_url,omitempty"`
	OptInType             string `json:"optin_type,omitempty" url:"optin_type,omitempty"`
	Volume                string `json:"volume,omitempty" url:"volume,omitempty"`
	AdditionalInformation string `json:"additional_information,omitempty" url:"additional_information,omitempty"`
	ExtraData             string `json:"extra_data,omitempty" url:"extra_data,omitempty"`
	Number                string `json:"number,omitempty" url:"number,omitempty"`
	CallbackURL           string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod        string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
}

TollfreeVerificationCreateParams - List of params to create a TF verification request

type TollfreeVerificationCreateResponse added in v7.41.0

type TollfreeVerificationCreateResponse struct {
	APIID   string `json:"api_id" url:"api_id"`
	Message string `json:"message,omitempty" url:"message,omitempty"`
	UUID    string `json:"uuid" url:"uuid"`
}

TollfreeVerificationCreateResponse - Default response

type TollfreeVerificationListParams added in v7.41.0

type TollfreeVerificationListParams struct {
	Number      string `json:"number,omitempty"  url:"number,omitempty"`
	Status      string `json:"status,omitempty"  url:"status,omitempty"`
	ProfileUUID string `json:"profile_uuid,omitempty" url:"profile_uuid,omitempty"`
	CreatedGT   string `json:"created__gt,omitempty" url:"created__gt,omitempty"`
	CreatedGTE  string `json:"created__gte,omitempty" url:"created__gte,omitempty"`
	CreatedLT   string `json:"created__lt,omitempty" url:"created__lt,omitempty"`
	CreatedLTE  string `json:"created__lte,omitempty" url:"created__lte,omitempty"`
	Usecase     string `json:"usecase,omitempty" url:"usecase,omitempty"`
	Limit       int64  `json:"limit,omitempty" url:"limit,omitempty"`
	Offset      int64  `json:"offset,omitempty" url:"offset,omitempty"`
}

TollfreeVerificationListParams - List of params to search in list API

type TollfreeVerificationListResponse added in v7.41.0

type TollfreeVerificationListResponse struct {
	APIID   string                 `json:"api_id" url:"api_id"`
	Meta    *Meta                  `json:"meta,omitempty" url:"meta,omitempty"`
	Objects []TollfreeVerification `json:"objects,omitempty" url:"objects,omitempty"`
}

TollfreeVerificationListResponse - list API response struct

type TollfreeVerificationResponse added in v7.41.0

type TollfreeVerificationResponse struct {
	APIID   string `json:"api_id" url:"api_id"`
	Message string `json:"message,omitempty" url:"message,omitempty"`
}

TollfreeVerificationResponse - Default response

type TollfreeVerificationService added in v7.41.0

type TollfreeVerificationService struct {
	// contains filtered or unexported fields
}

TollfreeVerificationService - TF verification service struct

func (*TollfreeVerificationService) Create added in v7.41.0

Create - create API for Tollfree Verification Request

func (*TollfreeVerificationService) Delete added in v7.41.0

func (service *TollfreeVerificationService) Delete(UUID string) (err error)

Delete - Delete API for Tollfree Verification Request

func (*TollfreeVerificationService) Get added in v7.41.0

func (service *TollfreeVerificationService) Get(UUID string) (response *TollfreeVerification, err error)

Get - Get API for Tollfree Verification Request

func (*TollfreeVerificationService) List added in v7.41.0

List - List API for Tollfree Verification Request

func (*TollfreeVerificationService) Update added in v7.41.0

Update - Update API for Tollfree Verification Request

type TollfreeVerificationUpdateParams added in v7.41.0

type TollfreeVerificationUpdateParams struct {
	ProfileUUID           string `json:"profile_uuid,omitempty" url:"profile_uuid,omitempty"`
	Usecase               string `json:"usecase,omitempty" url:"usecase,omitempty"`
	UsecaseSummary        string `json:"usecase_summary,omitempty" url:"usecase_summary,omitempty"`
	MessageSample         string `json:"message_sample,omitempty" url:"message_sample,omitempty"`
	OptInImageURL         string `json:"optin_image_url,omitempty" url:"optin_image_url,omitempty"`
	OptInType             string `json:"optin_type,omitempty" url:"optin_type,omitempty"`
	Volume                string `json:"volume,omitempty" url:"volume,omitempty"`
	AdditionalInformation string `json:"additional_information,omitempty" url:"additional_information,omitempty"`
	ExtraData             string `json:"extra_data,omitempty" url:"extra_data,omitempty"`
	CallbackURL           string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod        string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
}

TollfreeVerificationUpdateParams - List of update params to update in TF verification request

type UpdateComplianceApplicationParams

type UpdateComplianceApplicationParams struct {
	ComplianceApplicationId string   `json:"compliance_application_id"`
	DocumentIds             []string `json:"document_ids"`
}

type UpdateComplianceApplicationResponse

type UpdateComplianceApplicationResponse BaseResponse

type UpdateComplianceDocumentParams

type UpdateComplianceDocumentParams struct {
	ComplianceDocumentID string `json:"compliance_document_id"`
	CreateComplianceDocumentParams
}

type UpdateComplianceDocumentResponse

type UpdateComplianceDocumentResponse BaseResponse

type UpdateEndUserParams

type UpdateEndUserParams struct {
	EndUserParams
	EndUserID string `json:"end_user_id"`
}

type UpdateEndUserResponse

type UpdateEndUserResponse BaseResponse

type UpdateMaskingSessionParams added in v7.34.0

type UpdateMaskingSessionParams struct {
	SessionExpiry           int64  `json:"session_expiry,omitempty" url:"session_expiry,omitempty"`
	CallTimeLimit           int64  `json:"call_time_limit,omitempty" url:"call_time_limit,omitempty"`
	Record                  bool   `json:"record,omitempty" url:"record,omitempty"`
	RecordFileFormat        string `json:"record_file_format,omitempty" url:"record_file_format,omitempty"`
	RecordingCallbackUrl    string `json:"recording_callback_url,omitempty" url:"recording_callback_url,omitempty"`
	CallbackUrl             string `json:"callback_url,omitempty" url:"callback_url,omitempty"`
	CallbackMethod          string `json:"callback_method,omitempty" url:"callback_method,omitempty"`
	RingTimeout             int64  `json:"ring_timeout,omitempty" url:"ring_timeout,omitempty"`
	FirstPartyPlayUrl       string `json:"first_party_play_url,omitempty" url:"first_party_play_url,omitempty"`
	SecondPartyPlayUrl      string `json:"second_party_play_url,omitempty" url:"second_party_play_url,omitempty"`
	RecordingCallbackMethod string `json:"recording_callback_method,omitempty" url:"recording_callback_method,omitempty"`
}

type UpdateMaskingSessionResponse added in v7.34.0

type UpdateMaskingSessionResponse struct {
	ApiID   string         `json:"api_id,omitempty" url:"api_id,omitempty"`
	Message string         `json:"message,omitempty" url:"message,omitempty"`
	Session MaskingSession `json:"session,omitempty" url:"session,omitempty"`
}

type UpdateProfileRequestParams added in v7.12.1

type UpdateProfileRequestParams struct {
	EntityType        string             `json:"entity_type" validate:"oneof= PRIVATE PUBLIC NON_PROFIT GOVERNMENT INDIVIDUAL"`
	CompanyName       string             `json:"company_name" validate:"required,max=100"`
	Address           *Address           `json:"address" validate:"required"`
	Website           string             `json:"website" validate:"max=100"`
	Vertical          string             `` /* 281-byte string literal not displayed */
	AuthorizedContact *AuthorizedContact `json:"authorized_contact"`
}

type UpdateVerifiedCallerIDParams added in v7.40.0

type UpdateVerifiedCallerIDParams struct {
	Alias      string `json:"alias,omitempty"`
	SubAccount string `json:"subaccount,omitempty"`
}

type Usecase added in v7.14.0

type Usecase struct {
	Name    string `json:"name"`
	Code    string `json:"code"`
	Details string `json:"details"`
}

type VerifyCallerIdService added in v7.40.0

type VerifyCallerIdService struct {
	// contains filtered or unexported fields
}

func (*VerifyCallerIdService) DeleteVerifiedCallerID added in v7.40.0

func (service *VerifyCallerIdService) DeleteVerifiedCallerID(phoneNumber string) (err error)

func (*VerifyCallerIdService) GetVerifiedCallerID added in v7.40.0

func (service *VerifyCallerIdService) GetVerifiedCallerID(phoneNumber string) (response *GetVerifyResponse, err error)

func (*VerifyCallerIdService) InitiateVerify added in v7.40.0

func (service *VerifyCallerIdService) InitiateVerify(params InitiateVerify) (response *InitiateVerifyResponse, err error)

func (*VerifyCallerIdService) ListVerifiedCallerID added in v7.40.0

func (service *VerifyCallerIdService) ListVerifiedCallerID(params ListVerifiedCallerIdParams) (response *ListVerifiedCallerIDResponse, err error)

func (*VerifyCallerIdService) UpdateVerifiedCallerID added in v7.40.0

func (service *VerifyCallerIdService) UpdateVerifiedCallerID(phoneNumber string, params UpdateVerifiedCallerIDParams) (response *GetVerifyResponse, err error)

func (*VerifyCallerIdService) VerifyCallerID added in v7.40.0

func (service *VerifyCallerIdService) VerifyCallerID(verificationUuid string, otp string) (response *VerifyResponse, err error)

type VerifyResponse added in v7.40.0

type VerifyResponse struct {
	Alias            string    `json:"alias,omitempty"`
	ApiID            string    `json:"api_id,omitempty" url:"api_id,omitempty"`
	Channel          string    `json:"channel"`
	Country          string    `json:"country"`
	CreatedAt        time.Time `json:"created_at"`
	PhoneNumber      string    `json:"phone_number"`
	VerificationUUID string    `json:"verification_uuid"`
	SubAccount       string    `json:"subaccount,omitempty"`
}

type VerifyService added in v7.33.0

type VerifyService struct {
	Session
	// contains filtered or unexported fields
}

func (*VerifyService) Create added in v7.33.0

func (service *VerifyService) Create(params SessionCreateParams) (response *SessionCreateResponseBody, err error)

func (*VerifyService) Get added in v7.33.0

func (service *VerifyService) Get(sessionUUID string) (response *Session, err error)

func (*VerifyService) List added in v7.33.0

func (service *VerifyService) List(params SessionListParams) (response *SessionList, err error)

func (*VerifyService) Validate added in v7.33.0

func (service *VerifyService) Validate(params SessionValidationParams, sessionUUID string) (response *SessionCreateResponseBody, err error)

type VoiceInteractionResponse added in v7.34.0

type VoiceInteractionResponse struct {
	StartTime              string  `json:"start_time,omitempty" url:"start_time,omitempty"`
	EndTime                string  `json:"end_time,omitempty" url:"end_time,omitempty"`
	FirstPartyResourceUrl  string  `json:"first_party_resource_url,omitempty" url:"first_party_resource_url,omitempty"`
	SecondPartyResourceUrl string  `json:"second_party_resource_url,omitempty" url:"second_party_resource_url,omitempty"`
	FirstPartyStatus       string  `json:"first_party_status,omitempty" url:"first_party_status,omitempty"`
	SecondPartyStatus      string  `json:"second_party_status,omitempty" url:"second_party_status,omitempty"`
	Type                   string  `json:"type,omitempty" url:"type,omitempty"`
	TotalCallAmount        float64 `json:"total_call_amount,omitempty" url:"total_call_amount,omitempty"`
	CallBilledDuration     int     `json:"call_billed_duration,omitempty" url:"call_billed_duration,omitempty"`
	RecordingResourceUrl   string  `json:"recording_resource_url,omitempty" url:"recording_resource_url,omitempty"`
	AuthID                 string  `json:"auth_id,omitempty" url:"auth_id,omitempty"`
	TotalCallCount         int     `json:"total_call_count" url:"total_call_count"`
	Duration               float64 `json:"duration" url:"duration"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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