resources

package
v0.0.0-...-c26fdb2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2018 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccountURLS = map[types.Action]string{
	types.CREATE:   "/v1/Accounts",
	types.READ:     "/v1/Accounts/{{.ResourceID}}",
	types.BULKREAD: "/v1/Accounts",
	types.UPDATE:   "/v1/Accounts/{{.ResourceID}}",
	types.DELETE:   "/v1/Accounts/{{.ResourceID}}",
}

AccountURLS saves the routes its in the format that the text/template library of go can accept

View Source
var AvailablePhoneNumberURLS = map[types.Action]string{
	types.READ:     "/v1/Accounts/{{.AccountSid}}/AvailablePhoneNumbers/{{.IsoCountry}}/Local",
	types.BULKREAD: "/v1/Accounts/{{.AccountSid}}/AvailablePhoneNumbers/{{.IsoCountry}}/Local",
}

AvailablePhoneNumberURLS method => urls maping

View Source
var CallURLS = map[types.Action]string{
	types.CREATE:   "/v1/Accounts/{{.AccountSid}}/Calls",
	types.READ:     "/v1/Accounts/{{.AccountSid}}/Calls/{{.ResourceID}}",
	types.BULKREAD: "/v1/Accounts/{{.AccountSid}}/Calls/{{.CallSid}}",
}

AvailablePhoneNumberURLS method => urls maping

View Source
var IncomingPhoneNumberURLS = map[types.Action]string{
	types.CREATE:   "/v1/Accounts/{{.AccountSid}}/IncomingPhoneNumbers",
	types.READ:     "/v1/Accounts/{{.AccountSid}}/IncomingPhoneNumbers/{{.ResourceID}}",
	types.BULKREAD: "/v1/Accounts/{{.AccountSid}}/IncomingPhoneNumbers",
	types.UPDATE:   "/v1/Accounts/{{.AccountSid}}/IncomingPhoneNumbers/{{.ResourceID}}",
	types.DELETE:   "/v1/Accounts/{{.AccountSid}}/IncomingPhoneNumbers/{{.ResourceID}}",
}

IncomingPhoneNumberURLS saves the routes its in the format that the text/template library of go can accept

View Source
var OutgoingCallerIDURLS = map[types.Action]string{
	types.CREATE:   "/v1/Accounts/{{.AccountSid}}}/OutgoingCallerIDs",
	types.READ:     "/v1/Accounts/{{.AccountSid}}}/OutgoingCallerIDs/{{.ResourceID}}",
	types.BULKREAD: "/v1/Accounts/{{.AccountSid}}}/OutgoingCallerIDs",
	types.DELETE:   "/v1/Accounts/{{.AccountSid}}}/OutgoingCallerIDs/{{.ResourceID}}",
}

OutgoingCallerIDURLS saves the routes its in the format that the text/template library of go can accept

View Source
var RecordingURLS = map[types.Action]string{
	types.READ:     "/v1/Accounts/{{.AccountSid}}/Recordings/{{.ResourceID}}",
	types.BULKREAD: "/v1/Accounts/{{.AccountSid}}/Recordings",
}

RecordingURLS saves the routes its in the format that the text/template library of go can accept

Functions

This section is empty.

Types

type Account

type Account struct {
	XMLName         xml.Name  `json:"-"`
	Sid             string    `json:"sid"`
	DateCreated     time.Time `json:"date_created"`
	DateUpdated     time.Time `json:"date_updated"`
	FriendlyName    string    `json:"friendly_name"`
	Type            string    `json:"type"`
	Status          string    `json:"status"`
	AuthToken       string    `json:"auth_token"`
	URI             string    `json:"uri"`
	OwnerAccountSid string    `json:"owner_account_sid,omitempty"`
}

Account is a struct for Account details in the account response

type AccountDetails

type AccountDetails struct {
	FriendlyName string `mandatory:"true" url:"FriendlyName"`
	CountryCode  string `mandatory:"true" queryparam:"CountryCode"`
}

AccountDetails struct for AccountDetails request data

type AccountFilter

type AccountFilter struct {
	FriendlyName string `queryparam:"FriendlyName"`
	Status       string `queryparam:"Status"`
}

AccountFilter struct for AccountFilter request data

type AccountUpdatableDetails

type AccountUpdatableDetails struct {
	FriendlyName string `queryparam:"FriendlyName"`
	Status       string `queryparam:"Status"`
}

AccountUpdatableDetails struct for Update request data

type AvailablePhoneNumber

type AvailablePhoneNumber struct {
	FriendlyName string       `json:"friendly_name"`
	PhoneNumber  string       `json:"phone_number"`
	Lata         *int         `json:"lata"`
	RateCenter   *string      `json:"rate_center"`
	Latitude     *float32     `json:"latitude"`
	Longitude    *float32     `json:"longitude"`
	Region       string       `json:"region"`
	PostalCode   *string      `json:"postal_code"`
	IsoCountry   string       `json:"iso_country"`
	Capabilities Capabilities `json:"capabilities"`
}

AvailablePhoneNumber is a struct for APN

type AvailablePhoneNumberFilter

type AvailablePhoneNumberFilter struct {
	ParentAccountSid string  `queryparam:"ParentAccountSid"`
	IsoCountry       string  `mandatory:"true" url:"IsoCountry"`
	Contains         *string `queryparam:"Contains"`
	SmsEnabled       bool    `queryparam:"SmsEnabled"`
	MmsEnabled       bool    `queryparam:"MmsEnabled"`
	VoiceEnabled     bool    `queryparam:"VoiceEnabled"`
	Region           string  `queryparam:"Region"`
}

AvailablePhoneNumberFilter struct for AvailablePhoneNumberFilter request data

type BulkGetAccountResponse

type BulkGetAccountResponse []GetAccountResponse

BulkGetAccountResponse has the response structure for bulk Get requests

type BulkGetAvailablePhoneNumberResponse

type BulkGetAvailablePhoneNumberResponse []GetAvailablePhoneNumberResponse

BulkGetAvailablePhoneNumberResponse is the response structure of available phone numbers bulk get request

type BulkGetCallResponse

type BulkGetCallResponse []GetAccountResponse

BulkGetCallResponse defines structure of bulk get call details request response

type BulkGetIncomingPhoneNumberResponse

type BulkGetIncomingPhoneNumberResponse []GetAccountResponse

BulkGetIncomingPhoneNumberResponse defines structure of bulk get call details request response

type BulkGetOutgoingCallerIDResponse

type BulkGetOutgoingCallerIDResponse []OutgoingCallerID

BulkGetOutgoingCallerIDResponse has the response structure for bulk Get requests

type BulkGetRecordingResponse

type BulkGetRecordingResponse []GetRecordingResponse

BulkGetRecordingResponse has the response structure for bulk Get requests

type Call

type Call struct {
	Sid             string      `json:"sid"`
	DateCreated     time.Time   `json:"date_created"`
	DateUpdated     time.Time   `json:"date_updated"`
	ParentCallSid   *string     `json:"parent_call_sid"`
	VirtualCallSid  string      `json:"virtual_call_sid"`
	AccountSid      string      `json:"account_sid"`
	To              string      `json:"to"`
	From            string      `json:"from"`
	PhoneNumberSid  *string     `json:"phone_number_sid"`
	Status          string      `json:"status"`
	StartTime       time.Time   `json:"start_time"`
	EndTime         time.Time   `json:"end_time"`
	Duration        *int64      `json:"duration"`
	Price           *float64    `json:"price"`
	PriceUnit       *string     `json:"price_unit"`
	Direction       string      `json:"direction"`
	AnsweredBy      *string     `json:"answered_by"`
	APIVersion      string      `json:"api_version"`
	ForwardedFrom   *string     `json:"forwarded_from"`
	CallerName      *string     `json:"caller_name"`
	URI             string      `json:"uri" xml:"Uri"`
	SubResourceURIs SubResource `json:"sub_resource_uris"`
}

Call is a struct for call

type CallDetails

type CallDetails struct {
	AccountSid           string   `queryparam:"AccountSid"`
	Userid               string   `queryparam:"Userid"`
	From                 string   `mandatory:"true" queryparam:"From"`
	To                   string   `mandatory:"true" queryparam:"To"`
	URL                  string   `mandatory:"true" queryparam:"Url"`
	Method               string   `queryparam:"Method"`
	FallbackURL          string   `queryparam:"FallbackURL"`
	FallbackMethod       string   `queryparam:"FallbackMethod"`
	StatusCallback       string   `queryparam:"StatusCallback"`
	StatusCallbackMethod string   `queryparam:"StatusCallbackMethod"`
	StatusCallbackEvents []string `queryparam:"StatusCallbackEvents"`
	SendDigits           string   `queryparam:"SendDigits"`
	Timeout              int      `queryparam:"Timeout"`
	Record               *bool    `queryparam:"Record"`
	IfMachine            string   `queryparam:"IfMachine"`
	RequestID            string   `queryparam:"RequestID"`
}

CallDetails struct for CallDetails request data

type CallFilter

type CallFilter struct {
	CallSid string `mandatory:"true" url:"CallSid"`
}

CallFilter the filter struct for call search

type Capabilities

type Capabilities struct {
	SMS   bool
	Voice bool
	MMS   bool
}

Capabilities have the phone capabilities

type CreateAccountResponse

type CreateAccountResponse struct {
	Account
}

CreateAccountResponse has the struct definition for account creation rsponse

type CreateCallResponse

type CreateCallResponse struct {
	Call
}

CreateCallResponse defines structure of create call response

type CreateIncomingPhoneNumberResponse

type CreateIncomingPhoneNumberResponse struct {
	IncomingPhoneNumber
}

CreateIncomingPhoneNumberResponse has the struct definition for account creation rsponse

type CreateOutgoingCallerIDResponse

type CreateOutgoingCallerIDResponse struct {
	XMLName        xml.Name `json:"-"`
	AccountSid     string
	PhoneNumber    string
	FriendlyName   *string
	ValidationCode int
	CallSid        string
}

CreateOutgoingCallerIDResponse defines the structure ofresponse on ccreate CreateOutgoingCallerIDResponse request

type GetAccountResponse

type GetAccountResponse struct {
	Account
}

GetAccountResponse has the response structure for Get requests

type GetAvailablePhoneNumberResponse

type GetAvailablePhoneNumberResponse struct {
	AvailablePhoneNumber
}

GetAvailablePhoneNumberResponse is the response structure of available phone numbers single get request

type GetCallResponse

type GetCallResponse struct {
	Call
}

GetCallResponse defines structure of get call details request response

type GetIncomingPhoneNumberResponse

type GetIncomingPhoneNumberResponse struct {
	IncomingPhoneNumber
}

GetIncomingPhoneNumberResponse has the response structure for Get requests

type GetOutgoingCallerIDResponse

type GetOutgoingCallerIDResponse struct {
	OutgoingCallerID
}

GetOutgoingCallerIDResponse has the response structure for Get requests

type GetRecordingResponse

type GetRecordingResponse struct {
	Recording
}

GetRecordingResponse has the response structure for Get requests

type IResource

type IResource interface {
}

IResource interface declares the functions that a valid resource should implement

type IValidator

type IValidator interface {
	Valid() bool
}

IValidator interface declares the functions that evry self validating entities should define

type IncomingPhoneNumber

type IncomingPhoneNumber struct {
	Sid                  string       `json:"sid"`
	AccountSid           string       `json:"account_sid"`
	FriendlyName         string       `json:"friendly_name"`
	PhoneNumber          string       `json:"phone_number"`
	VoiceURL             *string      `json:"voice_url"`
	VoiceMethod          string       `json:"voice_method"`
	VoiceFallbackURL     *string      `json:"voice_fallback_url"`
	VoiceFallbackMethod  string       `json:"voice_fallback_method"`
	VoiceCallerIDLookup  *string      `json:"voice_called_id_lookup"`
	DateCreated          time.Time    `json:"date_created"`
	DateUpdated          time.Time    `json:"date_updated"`
	SmsURL               *string      `json:"sms_url"`
	SmsMethod            string       `json:"sms_method"`
	SmsFallbackURL       *string      `json:"sms_fallback_url"`
	SmsFallbackMethod    string       `json:"sms_fallback_method"`
	Capabilities         Capabilities `json:"capabilities"`
	StatusCallback       *string      `json:"status_callback"`
	StatusCallbackMethod string       `json:"status_callback_method"`
	APIVersion           string       `json:"api_version"`
	URI                  string       `json:"uri"`
}

IncomingPhoneNumber is a struct for IPN Details in response

type IncomingPhoneNumberDetails

type IncomingPhoneNumberDetails struct {
	PhoneNumber          string `mandatory:"true" queryparam:"PhoneNumber"`
	FriendlyName         string `queryparam:"FriendlyName"`
	APIVersion           string `queryparam:"APIVersion"`
	VoiceURL             string `queryparam:"VoiceURL"`
	VoiceMethod          string `queryparam:"VoiceMethod"`
	VoiceFallbackURL     string `queryparam:"VoiceFallbackURL"`
	VoiceFallbackMethod  string `queryparam:"VoiceFallbackMethod"`
	StatusCallback       string `queryparam:"StatusCallback"`
	StatusCallbackMethod string `queryparam:"StatusCallbackMethod"`
	VoiceCallerIDLookup  string `queryparam:"VoiceCallerIDLookup"`
	VoiceApplicationSid  string `queryparam:"VoiceApplicationSid"`
	TrunkSid             string `queryparam:"TrunkSid"`
	SmsURL               string `queryparam:"SmsURL"`
	SmsMethod            string `queryparam:"SmsMethod"`
	SmsFallbackURL       string `queryparam:"SmsFallbackURL"`
	SmsFallbackMethod    string `queryparam:"SmsFallbackMethod"`
	SmsApplicationSid    string `queryparam:"SmsApplicationSid"`
}

IncomingPhoneNumberDetails struct for IncomingPhoneNumberDetails request data

type IncomingPhoneNumberFilter

type IncomingPhoneNumberFilter struct {
	PhoneNumber  string
	FriendlyName string
}

IncomingPhoneNumberFilter struct for IncomingPhoneNumberFilter request data

type IncomingPhoneNumberUpdatableDetails

type IncomingPhoneNumberUpdatableDetails struct {
	Sid                  string `queryparam:"Sid"`
	FriendlyName         string `queryparam:"FriendlyName"`
	APIVersion           string `queryparam:"APIVersion"`
	VoiceURL             string `queryparam:"VoiceURL"`
	VoiceMethod          string `queryparam:"VoiceMethod"`
	VoiceFallbackURL     string `queryparam:"VoiceFallbackURL"`
	VoiceFallbackMethod  string `queryparam:"VoiceFallbackMethod"`
	StatusCallback       string `queryparam:"StatusCallback"`
	StatusCallbackMethod string `queryparam:"StatusCallbackMethod"`
	VoiceCallerIDLookup  string `queryparam:"VoiceCallerIDLookup"`
	VoiceApplicationSid  string `queryparam:"VoiceApplicationSid"`
	TrunkSid             string `queryparam:"TrunkSid"`
	SmsURL               string `queryparam:"SmsURL"`
	SmsMethod            string `queryparam:"SmsMethod"`
	SmsFallbackURL       string `queryparam:"SmsFallbackURL"`
	SmsFallbackMethod    string `queryparam:"SmsFallbackMethod"`
	SmsApplicationSid    string `queryparam:"SmsApplicationSid"`
}

IncomingPhoneNumberUpdatableDetails struct for IncomingPhoneNumberUpdatableDetails request data

type OutgoingCallerID

type OutgoingCallerID struct {
	XMLName      xml.Name  `json:"-"`
	Sid          string    `json:"sid"`
	AccountSid   string    `json:"account_sid"`
	FriendlyName string    `json:"friendly_name"`
	PhoneNumber  string    `json:"phone_number"`
	DateCreated  time.Time `json:"date_created"`
	DateUpdated  time.Time `json:"date_updated"`
	URI          string    `json:"uri"`
}

OutgoingCallerID is a struct

type OutgoingCallerIDDetails

type OutgoingCallerIDDetails struct {
	PhoneNumber          string `mandatory:"true" queryparam:"PhoneNumber"`
	FriendlyName         string `queryparam:"FriendlyName"`
	StatusCallback       string `queryparam:"StatusCallback"`
	StatusCallbackMethod string `queryparam:"StatusCallbackMethod"`
}

OutgoingCallerIDDetails struct for OutgoingCallerIDDetails request data

type OutgoingCallerIDFilter

type OutgoingCallerIDFilter struct {
	PhoneNumber  string `queryparam:"PhoneNumber"`
	FriendlyName string `queryparam:"FriendlyName"`
}

OutgoingCallerIDFilter struct for OutgoingCallerIDFilter request data

type OutgoingCallerIDUpdateableDetails

type OutgoingCallerIDUpdateableDetails struct {
	FriendlyName string `queryparam:"FriendlyName"`
}

OutgoingCallerIDUpdateableDetails struct for OutgoingCallerIDUpdateableDetails request data

type Recording

type Recording struct {
	Sid         string    `json:"sid"`
	AccountSid  string    `json:"account_sid"`
	CallSid     string    `json:"call_sid"`
	Duration    int64     `json:"duration"`
	DateCreated time.Time `json:"date_created"`
	DateUpdated time.Time `json:"date_updated"`
	APIVersion  string    `json:"api_version"`
	URI         string    `json:"uri" xml:"Uri"`
}

Recording is a response for get recording resource.

type RecordingFilter

type RecordingFilter struct {
	CallSid string `queryparam:"CallSid"`
}

RecordingFilter struct for Get request data

type SubResource

type SubResource struct {
	Recordings string `json:"recordings"`
}

SubResource defines the fields that are linked to the call but need to be invoked separately

type UpdateAccountResponse

type UpdateAccountResponse struct {
	Account
}

UpdateAccountResponse has the struct definition for Account update request

type UpdateIncomingPhoneNumberResponse

type UpdateIncomingPhoneNumberResponse struct {
	IncomingPhoneNumber
}

UpdateIncomingPhoneNumberResponse has the struct definition for IncomingPhoneNumber update request

type UpdateOutgoingCallerIDResponse

type UpdateOutgoingCallerIDResponse struct {
	OutgoingCallerID
}

UpdateOutgoingCallerIDResponse has the struct definition for OutgoingCallerID update request

Jump to

Keyboard shortcuts

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