vapi

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	BaseURL    string
	Token      string
	HTTPClient *http.Client
}

APIClient handles communication with the remote provider.

func (*APIClient) DeleteFile added in v0.3.0

func (c *APIClient) DeleteFile(id string) ([]byte, error)

DeleteFile deletes a specific phone number by ID.

func (*APIClient) DeletePhoneNumber added in v0.3.0

func (c *APIClient) DeletePhoneNumber(id string) ([]byte, error)

DeletePhoneNumber deletes a specific phone number by ID.

func (*APIClient) GetFile added in v0.3.0

func (c *APIClient) GetFile(id string) ([]byte, error)

GetFile retrieves the details of a specific phone number by ID.

func (*APIClient) GetPhoneNumber added in v0.3.0

func (c *APIClient) GetPhoneNumber(id string) ([]byte, error)

GetPhoneNumber retrieves the details of a specific phone number by ID.

func (*APIClient) ImportTwilioPhoneNumber added in v0.3.0

func (c *APIClient) ImportTwilioPhoneNumber(requestData ImportTwilioRequest) ([]byte, error)

ImportTwilioPhoneNumber requests the creation of a new phone number.

func (*APIClient) SendRequest

func (c *APIClient) SendRequest(method, endpoint string, body interface{}) ([]byte, error)

Sends a request to the API.

func (*APIClient) UploadFile

func (c *APIClient) UploadFile(fieldName, filePath string) ([]byte, error)

Uploads a file using multipart/form-data.

type FallbackDestination added in v0.3.0

type FallbackDestination struct {
	Type                   string `json:"type"`
	NumberE164CheckEnabled bool   `json:"numberE164CheckEnabled"`
	Number                 string `json:"number"`
	Extension              string `json:"extension"`
	Message                string `json:"message"`
	Description            string `json:"description"`
}

FallbackDestination struct.

type FileResponse

type FileResponse struct {
	ID           string                 `json:"id"`
	Name         string                 `json:"name"`
	OriginalName string                 `json:"originalName"`
	Bytes        int64                  `json:"bytes"`
	Mimetype     string                 `json:"mimetype"`
	Path         string                 `json:"path"`
	URL          string                 `json:"url"`
	Metadata     map[string]interface{} `json:"metadata"`
	OrgID        string                 `json:"orgId"`
	CreatedAt    string                 `json:"createdAt"`
	UpdatedAt    string                 `json:"updatedAt"`
}

FileResponse represents the structure of the API response.

func (*FileResponse) UnmarshalJSON

func (fr *FileResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom unmarshaling for FileResponse.

type ImportTwilioRequest added in v0.3.0

type ImportTwilioRequest struct {
	Provider         string               `json:"provider"`
	Name             string               `json:"name"`
	Number           string               `json:"number"`
	TwilioAccountSID string               `json:"twilioAccountSid"`
	TwilioAuthToken  string               `json:"twilioAuthToken"`
	Fallback         *FallbackDestination `json:"fallbackDestination,omitempty"`
}

ImportTwilioRequest struct.

type TwilioPhoneNumber added in v0.3.0

type TwilioPhoneNumber struct {
	ID               string `json:"id"`
	OrgID            string `json:"orgId"`
	Number           string `json:"number"`
	CreatedAt        string `json:"createdAt"`
	UpdatedAt        string `json:"updatedAt"`
	TwilioAccountSid string `json:"twilioAccountSid"`
	TwilioAuthToken  string `json:"twilioAuthToken"`
	Name             string `json:"name"`
	Provider         string `json:"provider"`
}

TwilioPhoneNumber represents the structure of a Twilio phone number API response.

Jump to

Keyboard shortcuts

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