handset

package module
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 11 Imported by: 0

README

handset-go

The official Go client for the Handset API — the business phone API for SMS, MMS, voice, and phone numbers.

Generated from api/openapi.yaml with oapi-codegen. Regenerate with make sdk-go from the repo root.

Install

go get github.com/handset-hq/handset-go

Requires Go 1.24+.

Quickstart

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	handset "github.com/handset-hq/handset-go"
)

func main() {
	client, err := handset.New(os.Getenv("HANDSET_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	resp, err := client.SendMessageWithResponse(context.Background(), nil,
		handset.SendMessageJSONRequestBody{
			From: "num_01H8X…",
			To:   "+14155550123",
			Body: handset.Ptr("On my way!"),
		})
	if err != nil {
		log.Fatal(err)
	}
	if resp.JSON202 == nil {
		log.Fatalf("send failed (%d): %s", resp.StatusCode(), resp.JSONDefault.Error.Message)
	}
	fmt.Println("queued", resp.JSON202.Id)
}

Run the bundled example against your account:

export HANDSET_API_KEY=hs_test_…
go run ./examples/send -from num_01H8X… -to +14155550123 -body "On my way!"

Authentication

handset.New sends your key as a bearer token on every request. Use a live key (hs_live_…) to move real traffic and draw down prepaid credits, or a test key (hs_test_…) to exercise the API for free. The key prefix selects the mode — the base URL is the same for both.

Responses

Every operation has a …WithResponse method. It returns a typed struct holding the decoded body for each documented status code, plus StatusCode() and the raw *http.Response:

resp, err := client.GetMessageWithResponse(ctx, "msg_01j8x3a")
// err        → transport failure (DNS, connection, timeout)
// resp.JSON200   → *Message on success
// resp.JSONDefault → *Error on a 4xx/5xx
// resp.StatusCode() / resp.HTTPResponse → raw HTTP

There's no thrown error for a non-2xx: check the typed field for the status you expect (JSON200, JSON202, …); when it's nil, read JSONDefault.Error.

Optional fields, headers, and idempotency

Optional request fields are pointers — handset.Ptr(v) wraps a value inline. Header and query parameters ride in a per-operation *…Params struct; pass nil when you need none. To make a send safe to retry:

key := handset.IdempotencyKey("order-4417-confirm")
client.SendMessageWithResponse(ctx,
	&handset.SendMessageParams{IdempotencyKey: &key},
	body,
)

A retry with the same key within 24h returns the original response instead of sending twice.

Configuration

New accepts the generated client options to override transport:

client, _ := handset.New(key,
	handset.WithBaseURL("http://localhost:8080/v1"),
	handset.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
	handset.WithRequestEditorFn(func(_ context.Context, r *http.Request) error {
		r.Header.Set("X-Trace-Id", traceID)
		return nil
	}),
)

Versioning

handset.Version is the SDK release, shared across the Handset SDKs (TypeScript, Python, Go) so one number describes the same API surface in every language. The client sends it as User-Agent: handset-go/<version> on every request — pass your own WithRequestEditorFn setting User-Agent to override.

Webhooks

Inbound event deliveries are the EventEnvelope type. Each event name also has a named alias (MessageReceivedJSONRequestBody, CallCompletedJSONRequestBody, …) so you can unmarshal a verified payload into a typed value. Verify the Handset-Signature header (t=<unix>,v1=<hmac_sha256> over <t>.<raw_body>) before trusting a delivery.

Documentation

Overview

Package handset is the official Go client for the Handset API — the business phone API for SMS, MMS, voice, and phone numbers.

Getting started

import "github.com/handset-hq/handset-go"

client, err := handset.New(os.Getenv("HANDSET_API_KEY"))
if err != nil {
        log.Fatal(err)
}

Authenticate with a key from the Handset console. A live key (hs_live_…) moves real traffic and draws down prepaid credits; a test key (hs_test_…) exercises the API for free. The key prefix selects the mode — the base URL is the same for both.

Making calls

Every operation has a ...WithResponse method. It returns a typed struct whose fields hold the decoded body for each documented status code (JSON202, JSONDefault, …), plus StatusCode() and the raw *http.Response:

resp, err := client.SendMessageWithResponse(ctx, nil, handset.SendMessageJSONRequestBody{
        From: "num_01H…",
        To:   "+14155550123",
        Body: handset.Ptr("On my way!"),
})
if err != nil {
        return err // transport error
}
if resp.JSON202 == nil {
        return fmt.Errorf("send failed (%d): %s", resp.StatusCode(), resp.JSONDefault.Error.Message)
}
fmt.Println("queued", resp.JSON202.Id)

Optional fields and headers

Optional request fields are pointers; handset.Ptr wraps a value in one line. Header and query parameters ride in a per-operation *…Params struct — pass nil when you need none. To make a send idempotent:

key := handset.IdempotencyKey("order-4417-confirm")
client.SendMessageWithResponse(ctx, &handset.SendMessageParams{IdempotencyKey: &key}, body)

Configuration

New accepts the generated ClientOption values to override transport:

client, _ := handset.New(key,
        handset.WithBaseURL("http://localhost:8080/v1"),
        handset.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
)

The type definitions in this package are generated from the Handset OpenAPI spec; the hand-written surface is just New and Ptr.

Package handset provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Examples

Constants

View Source
const DefaultBaseURL = "https://api.handset.dev/v1"

DefaultBaseURL is the Handset API base, including the version prefix. Both live (hs_live_…) and test (hs_test_…) keys use the same host; the key's prefix selects the mode.

View Source
const Version = "0.12.0"

Version is the SDK release, shared across the Handset SDKs (TypeScript, Python, Go) so one number describes the same API surface in every language. It ships as the User-Agent on every request and surfaces in your API logs.

Variables

This section is empty.

Functions

func NewBrandStatusChangedWebhookRequest

func NewBrandStatusChangedWebhookRequest(targetURL string, body BrandStatusChangedJSONRequestBody) (*http.Request, error)

NewBrandStatusChangedWebhookRequest builds a application/json POST request for the brand.status_changed webhook

func NewBrandStatusChangedWebhookRequestWithBody

func NewBrandStatusChangedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewBrandStatusChangedWebhookRequestWithBody builds a POST request for the brand.status_changed webhook with any body

func NewCallCompletedWebhookRequest

func NewCallCompletedWebhookRequest(targetURL string, body CallCompletedJSONRequestBody) (*http.Request, error)

NewCallCompletedWebhookRequest builds a application/json POST request for the call.completed webhook

func NewCallCompletedWebhookRequestWithBody

func NewCallCompletedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallCompletedWebhookRequestWithBody builds a POST request for the call.completed webhook with any body

func NewCallDtmfWebhookRequest

func NewCallDtmfWebhookRequest(targetURL string, body CallDtmfJSONRequestBody) (*http.Request, error)

NewCallDtmfWebhookRequest builds a application/json POST request for the call.dtmf webhook

func NewCallDtmfWebhookRequestWithBody

func NewCallDtmfWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallDtmfWebhookRequestWithBody builds a POST request for the call.dtmf webhook with any body

func NewCallGatherWebhookRequest

func NewCallGatherWebhookRequest(targetURL string, body CallGatherJSONRequestBody) (*http.Request, error)

NewCallGatherWebhookRequest builds a application/json POST request for the call.gather webhook

func NewCallGatherWebhookRequestWithBody

func NewCallGatherWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallGatherWebhookRequestWithBody builds a POST request for the call.gather webhook with any body

func NewCallStartedWebhookRequest

func NewCallStartedWebhookRequest(targetURL string, body CallStartedJSONRequestBody) (*http.Request, error)

NewCallStartedWebhookRequest builds a application/json POST request for the call.started webhook

func NewCallStartedWebhookRequestWithBody

func NewCallStartedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallStartedWebhookRequestWithBody builds a POST request for the call.started webhook with any body

func NewCallStreamFailedWebhookRequest

func NewCallStreamFailedWebhookRequest(targetURL string, body CallStreamFailedJSONRequestBody) (*http.Request, error)

NewCallStreamFailedWebhookRequest builds a application/json POST request for the call.stream.failed webhook

func NewCallStreamFailedWebhookRequestWithBody

func NewCallStreamFailedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallStreamFailedWebhookRequestWithBody builds a POST request for the call.stream.failed webhook with any body

func NewCallStreamStartedWebhookRequest

func NewCallStreamStartedWebhookRequest(targetURL string, body CallStreamStartedJSONRequestBody) (*http.Request, error)

NewCallStreamStartedWebhookRequest builds a application/json POST request for the call.stream.started webhook

func NewCallStreamStartedWebhookRequestWithBody

func NewCallStreamStartedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallStreamStartedWebhookRequestWithBody builds a POST request for the call.stream.started webhook with any body

func NewCallStreamStoppedWebhookRequest

func NewCallStreamStoppedWebhookRequest(targetURL string, body CallStreamStoppedJSONRequestBody) (*http.Request, error)

NewCallStreamStoppedWebhookRequest builds a application/json POST request for the call.stream.stopped webhook

func NewCallStreamStoppedWebhookRequestWithBody

func NewCallStreamStoppedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallStreamStoppedWebhookRequestWithBody builds a POST request for the call.stream.stopped webhook with any body

func NewCallSummaryWebhookRequest

func NewCallSummaryWebhookRequest(targetURL string, body CallSummaryJSONRequestBody) (*http.Request, error)

NewCallSummaryWebhookRequest builds a application/json POST request for the call.summary webhook

func NewCallSummaryWebhookRequestWithBody

func NewCallSummaryWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCallSummaryWebhookRequestWithBody builds a POST request for the call.summary webhook with any body

func NewCampaignStatusChangedWebhookRequest

func NewCampaignStatusChangedWebhookRequest(targetURL string, body CampaignStatusChangedJSONRequestBody) (*http.Request, error)

NewCampaignStatusChangedWebhookRequest builds a application/json POST request for the campaign.status_changed webhook

func NewCampaignStatusChangedWebhookRequestWithBody

func NewCampaignStatusChangedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewCampaignStatusChangedWebhookRequestWithBody builds a POST request for the campaign.status_changed webhook with any body

func NewCancelPortInRequest

func NewCancelPortInRequest(server string, portInId string) (*http.Request, error)

NewCancelPortInRequest constructs an http.Request for the CancelPortIn method

func NewCheckPortabilityRequest

func NewCheckPortabilityRequest(server string, body CheckPortabilityJSONRequestBody) (*http.Request, error)

NewCheckPortabilityRequest calls the generic CheckPortability builder with application/json body

func NewCheckPortabilityRequestWithBody

func NewCheckPortabilityRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCheckPortabilityRequestWithBody constructs an http.Request for the CheckPortability method, with any body, and a specified content type

func NewCreateBrandRequest

func NewCreateBrandRequest(server string, params *CreateBrandParams, body CreateBrandJSONRequestBody) (*http.Request, error)

NewCreateBrandRequest calls the generic CreateBrand builder with application/json body

func NewCreateBrandRequestWithBody

func NewCreateBrandRequestWithBody(server string, params *CreateBrandParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateBrandRequestWithBody constructs an http.Request for the CreateBrand method, with any body, and a specified content type

func NewCreateCallRequest

func NewCreateCallRequest(server string, body CreateCallJSONRequestBody) (*http.Request, error)

NewCreateCallRequest calls the generic CreateCall builder with application/json body

func NewCreateCallRequestWithBody

func NewCreateCallRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateCallRequestWithBody constructs an http.Request for the CreateCall method, with any body, and a specified content type

func NewCreateCallStreamRequest

func NewCreateCallStreamRequest(server string, callId string, body CreateCallStreamJSONRequestBody) (*http.Request, error)

NewCreateCallStreamRequest calls the generic CreateCallStream builder with application/json body

func NewCreateCallStreamRequestWithBody

func NewCreateCallStreamRequestWithBody(server string, callId string, contentType string, body io.Reader) (*http.Request, error)

NewCreateCallStreamRequestWithBody constructs an http.Request for the CreateCallStream method, with any body, and a specified content type

func NewCreateCampaignRequest

func NewCreateCampaignRequest(server string, params *CreateCampaignParams, body CreateCampaignJSONRequestBody) (*http.Request, error)

NewCreateCampaignRequest calls the generic CreateCampaign builder with application/json body

func NewCreateCampaignRequestWithBody

func NewCreateCampaignRequestWithBody(server string, params *CreateCampaignParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateCampaignRequestWithBody constructs an http.Request for the CreateCampaign method, with any body, and a specified content type

func NewCreateE911AddressRequest

func NewCreateE911AddressRequest(server string, params *CreateE911AddressParams, body CreateE911AddressJSONRequestBody) (*http.Request, error)

NewCreateE911AddressRequest calls the generic CreateE911Address builder with application/json body

func NewCreateE911AddressRequestWithBody

func NewCreateE911AddressRequestWithBody(server string, params *CreateE911AddressParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateE911AddressRequestWithBody constructs an http.Request for the CreateE911Address method, with any body, and a specified content type

func NewCreatePortInRequest

func NewCreatePortInRequest(server string, body CreatePortInJSONRequestBody) (*http.Request, error)

NewCreatePortInRequest calls the generic CreatePortIn builder with application/json body

func NewCreatePortInRequestWithBody

func NewCreatePortInRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreatePortInRequestWithBody constructs an http.Request for the CreatePortIn method, with any body, and a specified content type

func NewCreateRoutingConfigRequest

func NewCreateRoutingConfigRequest(server string, params *CreateRoutingConfigParams, body CreateRoutingConfigJSONRequestBody) (*http.Request, error)

NewCreateRoutingConfigRequest calls the generic CreateRoutingConfig builder with application/json body

func NewCreateRoutingConfigRequestWithBody

func NewCreateRoutingConfigRequestWithBody(server string, params *CreateRoutingConfigParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateRoutingConfigRequestWithBody constructs an http.Request for the CreateRoutingConfig method, with any body, and a specified content type

func NewCreateTenantRequest

func NewCreateTenantRequest(server string, params *CreateTenantParams, body CreateTenantJSONRequestBody) (*http.Request, error)

NewCreateTenantRequest calls the generic CreateTenant builder with application/json body

func NewCreateTenantRequestWithBody

func NewCreateTenantRequestWithBody(server string, params *CreateTenantParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateTenantRequestWithBody constructs an http.Request for the CreateTenant method, with any body, and a specified content type

func NewCreateWebClientRequest

func NewCreateWebClientRequest(server string, body CreateWebClientJSONRequestBody) (*http.Request, error)

NewCreateWebClientRequest calls the generic CreateWebClient builder with application/json body

func NewCreateWebClientRequestWithBody

func NewCreateWebClientRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateWebClientRequestWithBody constructs an http.Request for the CreateWebClient method, with any body, and a specified content type

func NewCreateWebClientTokenRequest

func NewCreateWebClientTokenRequest(server string, webClientId string) (*http.Request, error)

NewCreateWebClientTokenRequest constructs an http.Request for the CreateWebClientToken method

func NewCreateWebhookEndpointRequest

func NewCreateWebhookEndpointRequest(server string, params *CreateWebhookEndpointParams, body CreateWebhookEndpointJSONRequestBody) (*http.Request, error)

NewCreateWebhookEndpointRequest calls the generic CreateWebhookEndpoint builder with application/json body

func NewCreateWebhookEndpointRequestWithBody

func NewCreateWebhookEndpointRequestWithBody(server string, params *CreateWebhookEndpointParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateWebhookEndpointRequestWithBody constructs an http.Request for the CreateWebhookEndpoint method, with any body, and a specified content type

func NewDeleteRoutingConfigRequest

func NewDeleteRoutingConfigRequest(server string, routingConfigId string) (*http.Request, error)

NewDeleteRoutingConfigRequest constructs an http.Request for the DeleteRoutingConfig method

func NewDeleteTenantRequest

func NewDeleteTenantRequest(server string, tenantId TenantId) (*http.Request, error)

NewDeleteTenantRequest constructs an http.Request for the DeleteTenant method

func NewDeleteWebhookEndpointRequest

func NewDeleteWebhookEndpointRequest(server string, endpointId string) (*http.Request, error)

NewDeleteWebhookEndpointRequest constructs an http.Request for the DeleteWebhookEndpoint method

func NewGatherCallDigitsRequest

func NewGatherCallDigitsRequest(server string, callId string, body GatherCallDigitsJSONRequestBody) (*http.Request, error)

NewGatherCallDigitsRequest calls the generic GatherCallDigits builder with application/json body

func NewGatherCallDigitsRequestWithBody

func NewGatherCallDigitsRequestWithBody(server string, callId string, contentType string, body io.Reader) (*http.Request, error)

NewGatherCallDigitsRequestWithBody constructs an http.Request for the GatherCallDigits method, with any body, and a specified content type

func NewGetBrandRequest

func NewGetBrandRequest(server string, brandId string) (*http.Request, error)

NewGetBrandRequest constructs an http.Request for the GetBrand method

func NewGetCallRequest

func NewGetCallRequest(server string, callId string) (*http.Request, error)

NewGetCallRequest constructs an http.Request for the GetCall method

func NewGetCallTranscriptRequest

func NewGetCallTranscriptRequest(server string, callId string) (*http.Request, error)

NewGetCallTranscriptRequest constructs an http.Request for the GetCallTranscript method

func NewGetCampaignRequest

func NewGetCampaignRequest(server string, campaignId string) (*http.Request, error)

NewGetCampaignRequest constructs an http.Request for the GetCampaign method

func NewGetConversationRequest

func NewGetConversationRequest(server string, conversationId string) (*http.Request, error)

NewGetConversationRequest constructs an http.Request for the GetConversation method

func NewGetMessageRequest

func NewGetMessageRequest(server string, messageId string) (*http.Request, error)

NewGetMessageRequest constructs an http.Request for the GetMessage method

func NewGetMessageStatsRequest added in v0.12.0

func NewGetMessageStatsRequest(server string, params *GetMessageStatsParams) (*http.Request, error)

NewGetMessageStatsRequest constructs an http.Request for the GetMessageStats method

func NewGetNumberRequest

func NewGetNumberRequest(server string, numberId string) (*http.Request, error)

NewGetNumberRequest constructs an http.Request for the GetNumber method

func NewGetPortInRequest

func NewGetPortInRequest(server string, portInId string) (*http.Request, error)

NewGetPortInRequest constructs an http.Request for the GetPortIn method

func NewGetRecordingRequest

func NewGetRecordingRequest(server string, recordingId string) (*http.Request, error)

NewGetRecordingRequest constructs an http.Request for the GetRecording method

func NewGetRoutingConfigRequest

func NewGetRoutingConfigRequest(server string, routingConfigId string) (*http.Request, error)

NewGetRoutingConfigRequest constructs an http.Request for the GetRoutingConfig method

func NewGetTenantRequest

func NewGetTenantRequest(server string, tenantId TenantId) (*http.Request, error)

NewGetTenantRequest constructs an http.Request for the GetTenant method

func NewGetUsageRequest

func NewGetUsageRequest(server string, params *GetUsageParams) (*http.Request, error)

NewGetUsageRequest constructs an http.Request for the GetUsage method

func NewGetVoicemailRequest

func NewGetVoicemailRequest(server string, voicemailId string) (*http.Request, error)

NewGetVoicemailRequest constructs an http.Request for the GetVoicemail method

func NewGetWebClientRequest

func NewGetWebClientRequest(server string, webClientId string) (*http.Request, error)

NewGetWebClientRequest constructs an http.Request for the GetWebClient method

func NewListBrandsRequest

func NewListBrandsRequest(server string, params *ListBrandsParams) (*http.Request, error)

NewListBrandsRequest constructs an http.Request for the ListBrands method

func NewListCallStreamsRequest

func NewListCallStreamsRequest(server string, callId string) (*http.Request, error)

NewListCallStreamsRequest constructs an http.Request for the ListCallStreams method

func NewListCallsRequest

func NewListCallsRequest(server string, params *ListCallsParams) (*http.Request, error)

NewListCallsRequest constructs an http.Request for the ListCalls method

func NewListCampaignsRequest

func NewListCampaignsRequest(server string, params *ListCampaignsParams) (*http.Request, error)

NewListCampaignsRequest constructs an http.Request for the ListCampaigns method

func NewListConversationsRequest

func NewListConversationsRequest(server string, params *ListConversationsParams) (*http.Request, error)

NewListConversationsRequest constructs an http.Request for the ListConversations method

func NewListE911AddressesRequest

func NewListE911AddressesRequest(server string, params *ListE911AddressesParams) (*http.Request, error)

NewListE911AddressesRequest constructs an http.Request for the ListE911Addresses method

func NewListMessagesRequest

func NewListMessagesRequest(server string, params *ListMessagesParams) (*http.Request, error)

NewListMessagesRequest constructs an http.Request for the ListMessages method

func NewListNumbersRequest

func NewListNumbersRequest(server string, params *ListNumbersParams) (*http.Request, error)

NewListNumbersRequest constructs an http.Request for the ListNumbers method

func NewListOptOutsRequest

func NewListOptOutsRequest(server string, params *ListOptOutsParams) (*http.Request, error)

NewListOptOutsRequest constructs an http.Request for the ListOptOuts method

func NewListPortInsRequest

func NewListPortInsRequest(server string, params *ListPortInsParams) (*http.Request, error)

NewListPortInsRequest constructs an http.Request for the ListPortIns method

func NewListRoutingConfigsRequest

func NewListRoutingConfigsRequest(server string, params *ListRoutingConfigsParams) (*http.Request, error)

NewListRoutingConfigsRequest constructs an http.Request for the ListRoutingConfigs method

func NewListTenantsRequest

func NewListTenantsRequest(server string, params *ListTenantsParams) (*http.Request, error)

NewListTenantsRequest constructs an http.Request for the ListTenants method

func NewListVoicemailsRequest

func NewListVoicemailsRequest(server string, params *ListVoicemailsParams) (*http.Request, error)

NewListVoicemailsRequest constructs an http.Request for the ListVoicemails method

func NewListWebClientsRequest

func NewListWebClientsRequest(server string, params *ListWebClientsParams) (*http.Request, error)

NewListWebClientsRequest constructs an http.Request for the ListWebClients method

func NewListWebhookEndpointsRequest

func NewListWebhookEndpointsRequest(server string, params *ListWebhookEndpointsParams) (*http.Request, error)

NewListWebhookEndpointsRequest constructs an http.Request for the ListWebhookEndpoints method

func NewMessageDeliveredWebhookRequest

func NewMessageDeliveredWebhookRequest(targetURL string, body MessageDeliveredJSONRequestBody) (*http.Request, error)

NewMessageDeliveredWebhookRequest builds a application/json POST request for the message.delivered webhook

func NewMessageDeliveredWebhookRequestWithBody

func NewMessageDeliveredWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewMessageDeliveredWebhookRequestWithBody builds a POST request for the message.delivered webhook with any body

func NewMessageFailedWebhookRequest

func NewMessageFailedWebhookRequest(targetURL string, body MessageFailedJSONRequestBody) (*http.Request, error)

NewMessageFailedWebhookRequest builds a application/json POST request for the message.failed webhook

func NewMessageFailedWebhookRequestWithBody

func NewMessageFailedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewMessageFailedWebhookRequestWithBody builds a POST request for the message.failed webhook with any body

func NewMessageReceivedWebhookRequest

func NewMessageReceivedWebhookRequest(targetURL string, body MessageReceivedJSONRequestBody) (*http.Request, error)

NewMessageReceivedWebhookRequest builds a application/json POST request for the message.received webhook

func NewMessageReceivedWebhookRequestWithBody

func NewMessageReceivedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewMessageReceivedWebhookRequestWithBody builds a POST request for the message.received webhook with any body

func NewMintRealtimeTokenRequest

func NewMintRealtimeTokenRequest(server string) (*http.Request, error)

NewMintRealtimeTokenRequest constructs an http.Request for the MintRealtimeToken method

func NewPurchaseNumberRequest

func NewPurchaseNumberRequest(server string, params *PurchaseNumberParams, body PurchaseNumberJSONRequestBody) (*http.Request, error)

NewPurchaseNumberRequest calls the generic PurchaseNumber builder with application/json body

func NewPurchaseNumberRequestWithBody

func NewPurchaseNumberRequestWithBody(server string, params *PurchaseNumberParams, contentType string, body io.Reader) (*http.Request, error)

NewPurchaseNumberRequestWithBody constructs an http.Request for the PurchaseNumber method, with any body, and a specified content type

func NewRecordingCompletedWebhookRequest

func NewRecordingCompletedWebhookRequest(targetURL string, body RecordingCompletedJSONRequestBody) (*http.Request, error)

NewRecordingCompletedWebhookRequest builds a application/json POST request for the recording.completed webhook

func NewRecordingCompletedWebhookRequestWithBody

func NewRecordingCompletedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewRecordingCompletedWebhookRequestWithBody builds a POST request for the recording.completed webhook with any body

func NewReleaseNumberRequest

func NewReleaseNumberRequest(server string, numberId string) (*http.Request, error)

NewReleaseNumberRequest constructs an http.Request for the ReleaseNumber method

func NewRevokeWebClientRequest

func NewRevokeWebClientRequest(server string, webClientId string) (*http.Request, error)

NewRevokeWebClientRequest constructs an http.Request for the RevokeWebClient method

func NewSearchAvailableNumbersRequest

func NewSearchAvailableNumbersRequest(server string, params *SearchAvailableNumbersParams) (*http.Request, error)

NewSearchAvailableNumbersRequest constructs an http.Request for the SearchAvailableNumbers method

func NewSendCallDtmfRequest

func NewSendCallDtmfRequest(server string, callId string, body SendCallDtmfJSONRequestBody) (*http.Request, error)

NewSendCallDtmfRequest calls the generic SendCallDtmf builder with application/json body

func NewSendCallDtmfRequestWithBody

func NewSendCallDtmfRequestWithBody(server string, callId string, contentType string, body io.Reader) (*http.Request, error)

NewSendCallDtmfRequestWithBody constructs an http.Request for the SendCallDtmf method, with any body, and a specified content type

func NewSendMessageRequest

func NewSendMessageRequest(server string, params *SendMessageParams, body SendMessageJSONRequestBody) (*http.Request, error)

NewSendMessageRequest calls the generic SendMessage builder with application/json body

func NewSendMessageRequestWithBody

func NewSendMessageRequestWithBody(server string, params *SendMessageParams, contentType string, body io.Reader) (*http.Request, error)

NewSendMessageRequestWithBody constructs an http.Request for the SendMessage method, with any body, and a specified content type

func NewStartCallTranscriptionRequest

func NewStartCallTranscriptionRequest(server string, callId string) (*http.Request, error)

NewStartCallTranscriptionRequest constructs an http.Request for the StartCallTranscription method

func NewStopCallStreamRequest

func NewStopCallStreamRequest(server string, callId string, streamId string) (*http.Request, error)

NewStopCallStreamRequest constructs an http.Request for the StopCallStream method

func NewSubmitPortInRequest

func NewSubmitPortInRequest(server string, portInId string) (*http.Request, error)

NewSubmitPortInRequest constructs an http.Request for the SubmitPortIn method

func NewTestWebhookEndpointRequest

func NewTestWebhookEndpointRequest(server string, endpointId string, body TestWebhookEndpointJSONRequestBody) (*http.Request, error)

NewTestWebhookEndpointRequest calls the generic TestWebhookEndpoint builder with application/json body

func NewTestWebhookEndpointRequestWithBody

func NewTestWebhookEndpointRequestWithBody(server string, endpointId string, contentType string, body io.Reader) (*http.Request, error)

NewTestWebhookEndpointRequestWithBody constructs an http.Request for the TestWebhookEndpoint method, with any body, and a specified content type

func NewUpdateNumberRequest

func NewUpdateNumberRequest(server string, numberId string, body UpdateNumberJSONRequestBody) (*http.Request, error)

NewUpdateNumberRequest calls the generic UpdateNumber builder with application/json body

func NewUpdateNumberRequestWithBody

func NewUpdateNumberRequestWithBody(server string, numberId string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateNumberRequestWithBody constructs an http.Request for the UpdateNumber method, with any body, and a specified content type

func NewUpdateRoutingConfigRequest

func NewUpdateRoutingConfigRequest(server string, routingConfigId string, body UpdateRoutingConfigJSONRequestBody) (*http.Request, error)

NewUpdateRoutingConfigRequest calls the generic UpdateRoutingConfig builder with application/json body

func NewUpdateRoutingConfigRequestWithBody

func NewUpdateRoutingConfigRequestWithBody(server string, routingConfigId string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateRoutingConfigRequestWithBody constructs an http.Request for the UpdateRoutingConfig method, with any body, and a specified content type

func NewUpdateTenantRequest

func NewUpdateTenantRequest(server string, tenantId TenantId, body UpdateTenantJSONRequestBody) (*http.Request, error)

NewUpdateTenantRequest calls the generic UpdateTenant builder with application/json body

func NewUpdateTenantRequestWithBody

func NewUpdateTenantRequestWithBody(server string, tenantId TenantId, contentType string, body io.Reader) (*http.Request, error)

NewUpdateTenantRequestWithBody constructs an http.Request for the UpdateTenant method, with any body, and a specified content type

func NewUpdateWebhookEndpointRequest

func NewUpdateWebhookEndpointRequest(server string, endpointId string, body UpdateWebhookEndpointJSONRequestBody) (*http.Request, error)

NewUpdateWebhookEndpointRequest calls the generic UpdateWebhookEndpoint builder with application/json body

func NewUpdateWebhookEndpointRequestWithBody

func NewUpdateWebhookEndpointRequestWithBody(server string, endpointId string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateWebhookEndpointRequestWithBody constructs an http.Request for the UpdateWebhookEndpoint method, with any body, and a specified content type

func NewVoicemailCreatedWebhookRequest

func NewVoicemailCreatedWebhookRequest(targetURL string, body VoicemailCreatedJSONRequestBody) (*http.Request, error)

NewVoicemailCreatedWebhookRequest builds a application/json POST request for the voicemail.created webhook

func NewVoicemailCreatedWebhookRequestWithBody

func NewVoicemailCreatedWebhookRequestWithBody(targetURL string, contentType string, body io.Reader) (*http.Request, error)

NewVoicemailCreatedWebhookRequestWithBody builds a POST request for the voicemail.created webhook with any body

func Ptr

func Ptr[T any](v T) *T

Ptr returns a pointer to v. Optional request fields are modeled as pointers, so Ptr keeps call sites to a single line: handset.Ptr("value").

Types

type After

type After = string

After defines model for After.

type AvailableNumber

type AvailableNumber struct {
	Capabilities *[]AvailableNumberCapabilities `json:"capabilities,omitempty"`
	Locality     *string                        `json:"locality,omitempty"`

	// MonthlyPriceUsd Examples: 1.50
	MonthlyPriceUsd *string `json:"monthly_price_usd,omitempty"`

	// PhoneNumber Examples: +16025550134
	PhoneNumber string  `json:"phone_number"`
	Region      *string `json:"region,omitempty"`
}

AvailableNumber defines model for AvailableNumber.

type AvailableNumberCapabilities

type AvailableNumberCapabilities string

AvailableNumberCapabilities defines model for AvailableNumber.Capabilities.

const (
	AvailableNumberCapabilitiesMms   AvailableNumberCapabilities = "mms"
	AvailableNumberCapabilitiesSms   AvailableNumberCapabilities = "sms"
	AvailableNumberCapabilitiesVoice AvailableNumberCapabilities = "voice"
)

Defines values for AvailableNumberCapabilities.

func (AvailableNumberCapabilities) Valid

Valid indicates whether the value is a known member of the AvailableNumberCapabilities enum.

type Brand

type Brand struct {
	City         string              `json:"city"`
	ContactEmail openapi_types.Email `json:"contact_email"`
	CreatedAt    time.Time           `json:"created_at"`
	Dba          *string             `json:"dba,omitempty"`

	// Ein US tax ID.
	Ein        string          `json:"ein"`
	EntityType BrandEntityType `json:"entity_type"`

	// Id Examples: brd_01j8x3k
	Id        string `json:"id"`
	LegalName string `json:"legal_name"`

	// Phone Business contact number, E.164 — carrier registration requires it.
	Phone string `json:"phone"`

	// PostalCode 5-digit ZIP (ZIP+4 allowed).
	PostalCode      string  `json:"postal_code"`
	RejectionReason *string `json:"rejection_reason,omitempty"`

	// State Two-letter US state code.
	State  string      `json:"state"`
	Status BrandStatus `json:"status"`
	Street string      `json:"street"`

	// TenantId Set when the brand belongs to a tenant with its own EIN; omit for your platform-level brand.
	TenantId *string `json:"tenant_id,omitempty"`
	Website  *string `json:"website,omitempty"`
}

Brand defines model for Brand.

type BrandCreate

type BrandCreate struct {
	City         string              `json:"city"`
	ContactEmail openapi_types.Email `json:"contact_email"`
	Dba          *string             `json:"dba,omitempty"`

	// Ein US tax ID.
	Ein        string                `json:"ein"`
	EntityType BrandCreateEntityType `json:"entity_type"`
	LegalName  string                `json:"legal_name"`

	// Phone Business contact number, E.164 — carrier registration requires it.
	Phone string `json:"phone"`

	// PostalCode 5-digit ZIP (ZIP+4 allowed).
	PostalCode string `json:"postal_code"`

	// State Two-letter US state code.
	State  string `json:"state"`
	Street string `json:"street"`

	// TenantId Set when the brand belongs to a tenant with its own EIN; omit for your platform-level brand.
	TenantId *string `json:"tenant_id,omitempty"`
	Website  *string `json:"website,omitempty"`
}

BrandCreate defines model for BrandCreate.

type BrandCreateEntityType

type BrandCreateEntityType string

BrandCreateEntityType defines model for BrandCreate.EntityType.

const (
	BrandCreateEntityTypeNonProfit      BrandCreateEntityType = "non_profit"
	BrandCreateEntityTypePrivateCompany BrandCreateEntityType = "private_company"
	BrandCreateEntityTypePublicCompany  BrandCreateEntityType = "public_company"
	BrandCreateEntityTypeSoleProprietor BrandCreateEntityType = "sole_proprietor"
)

Defines values for BrandCreateEntityType.

func (BrandCreateEntityType) Valid

func (e BrandCreateEntityType) Valid() bool

Valid indicates whether the value is a known member of the BrandCreateEntityType enum.

type BrandEntityType

type BrandEntityType string

BrandEntityType defines model for Brand.EntityType.

const (
	BrandEntityTypeNonProfit      BrandEntityType = "non_profit"
	BrandEntityTypePrivateCompany BrandEntityType = "private_company"
	BrandEntityTypePublicCompany  BrandEntityType = "public_company"
	BrandEntityTypeSoleProprietor BrandEntityType = "sole_proprietor"
)

Defines values for BrandEntityType.

func (BrandEntityType) Valid

func (e BrandEntityType) Valid() bool

Valid indicates whether the value is a known member of the BrandEntityType enum.

type BrandStatus

type BrandStatus string

BrandStatus defines model for BrandStatus.

const (
	BrandStatusPendingVetting BrandStatus = "pending_vetting"
	BrandStatusRejected       BrandStatus = "rejected"
	BrandStatusVetted         BrandStatus = "vetted"
)

Defines values for BrandStatus.

func (BrandStatus) Valid

func (e BrandStatus) Valid() bool

Valid indicates whether the value is a known member of the BrandStatus enum.

type BrandStatusChangedJSONRequestBody

type BrandStatusChangedJSONRequestBody = EventEnvelope

BrandStatusChangedJSONRequestBody defines body for BrandStatusChanged for application/json ContentType.

type Call

type Call struct {
	// AnsweredBy The ring target that answered, when applicable.
	AnsweredBy *string `json:"answered_by,omitempty"`

	// ConnectTo The agent's phone on click-to-call calls.
	ConnectTo       *string       `json:"connect_to,omitempty"`
	Direction       CallDirection `json:"direction"`
	DurationSeconds *int          `json:"duration_seconds,omitempty"`
	EndedAt         *time.Time    `json:"ended_at,omitempty"`

	// Events Append-only call timeline (returned on retrieve only).
	Events *[]struct {
		At     time.Time               `json:"at"`
		Detail *map[string]interface{} `json:"detail,omitempty"`

		// Type Examples: initiated, routing_evaluated, ringing, answered, bridged, recording_started, ended
		Type string `json:"type"`
	} `json:"events,omitempty"`
	From string `json:"from"`

	// Id Examples: call_01j8x42
	Id            string     `json:"id"`
	PhoneNumberId *string    `json:"phone_number_id,omitempty"`
	RecordingId   *string    `json:"recording_id,omitempty"`
	StartedAt     time.Time  `json:"started_at"`
	Status        CallStatus `json:"status"`

	// Summary AI-written recap of a transcribed call — why they called, what was discussed, follow-ups. Generated shortly after a call created with `transcribe: true` completes (`call.summary` fires when ready).
	Summary *string `json:"summary,omitempty"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId    TenantIdField `json:"tenant_id"`
	To          string        `json:"to"`
	VoicemailId *string       `json:"voicemail_id,omitempty"`
}

Call defines model for Call.

type CallCompletedJSONRequestBody

type CallCompletedJSONRequestBody = EventEnvelope

CallCompletedJSONRequestBody defines body for CallCompleted for application/json ContentType.

type CallDirection

type CallDirection string

CallDirection defines model for Call.Direction.

const (
	CallDirectionInbound  CallDirection = "inbound"
	CallDirectionOutbound CallDirection = "outbound"
)

Defines values for CallDirection.

func (CallDirection) Valid

func (e CallDirection) Valid() bool

Valid indicates whether the value is a known member of the CallDirection enum.

type CallDtmfJSONRequestBody

type CallDtmfJSONRequestBody = EventEnvelope

CallDtmfJSONRequestBody defines body for CallDtmf for application/json ContentType.

type CallGatherJSONRequestBody

type CallGatherJSONRequestBody = EventEnvelope

CallGatherJSONRequestBody defines body for CallGather for application/json ContentType.

type CallStartedJSONRequestBody

type CallStartedJSONRequestBody = EventEnvelope

CallStartedJSONRequestBody defines body for CallStarted for application/json ContentType.

type CallStatus

type CallStatus string

CallStatus defines model for CallStatus.

const (
	CallStatusCompleted  CallStatus = "completed"
	CallStatusDialing    CallStatus = "dialing"
	CallStatusFailed     CallStatus = "failed"
	CallStatusInProgress CallStatus = "in_progress"
	CallStatusMissed     CallStatus = "missed"
	CallStatusRinging    CallStatus = "ringing"
	CallStatusVoicemail  CallStatus = "voicemail"
)

Defines values for CallStatus.

func (CallStatus) Valid

func (e CallStatus) Valid() bool

Valid indicates whether the value is a known member of the CallStatus enum.

type CallStreamFailedJSONRequestBody

type CallStreamFailedJSONRequestBody = EventEnvelope

CallStreamFailedJSONRequestBody defines body for CallStreamFailed for application/json ContentType.

type CallStreamStartedJSONRequestBody

type CallStreamStartedJSONRequestBody = EventEnvelope

CallStreamStartedJSONRequestBody defines body for CallStreamStarted for application/json ContentType.

type CallStreamStoppedJSONRequestBody

type CallStreamStoppedJSONRequestBody = EventEnvelope

CallStreamStoppedJSONRequestBody defines body for CallStreamStopped for application/json ContentType.

type CallSummaryJSONRequestBody

type CallSummaryJSONRequestBody = EventEnvelope

CallSummaryJSONRequestBody defines body for CallSummary for application/json ContentType.

type Campaign

type Campaign struct {
	BrandId   string    `json:"brand_id"`
	CreatedAt time.Time `json:"created_at"`

	// Description What the tenant sends and why recipients expect it.
	Description string `json:"description"`

	// Id Examples: cmp_01j8x3p
	Id string `json:"id"`

	// OptInDescription How recipients consent to receive these messages. Carriers review this text; at least 40 characters describing the consent flow.
	OptInDescription string         `json:"opt_in_description"`
	RejectionReason  *string        `json:"rejection_reason,omitempty"`
	SampleMessages   []string       `json:"sample_messages"`
	Status           CampaignStatus `json:"status"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`

	// Throughput Carrier-granted send limits.
	Throughput *struct {
		DailyCap          *int `json:"daily_cap,omitempty"`
		MessagesPerMinute *int `json:"messages_per_minute,omitempty"`
	} `json:"throughput,omitempty"`
	UseCase CampaignUseCase `json:"use_case"`
}

Campaign defines model for Campaign.

type CampaignCreate

type CampaignCreate struct {
	BrandId string `json:"brand_id"`

	// Description What the tenant sends and why recipients expect it.
	Description string `json:"description"`

	// OptInDescription How recipients consent to receive these messages. Carriers review this text; at least 40 characters describing the consent flow.
	OptInDescription string   `json:"opt_in_description"`
	SampleMessages   []string `json:"sample_messages"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField         `json:"tenant_id"`
	UseCase  CampaignCreateUseCase `json:"use_case"`
}

CampaignCreate defines model for CampaignCreate.

type CampaignCreateUseCase

type CampaignCreateUseCase string

CampaignCreateUseCase defines model for CampaignCreate.UseCase.

const (
	CampaignCreateUseCaseAppointmentReminders CampaignCreateUseCase = "appointment_reminders"
	CampaignCreateUseCaseCustomerCare         CampaignCreateUseCase = "customer_care"
	CampaignCreateUseCaseMarketing            CampaignCreateUseCase = "marketing"
	CampaignCreateUseCaseMixed                CampaignCreateUseCase = "mixed"
	CampaignCreateUseCaseTwoFactor            CampaignCreateUseCase = "two_factor"
)

Defines values for CampaignCreateUseCase.

func (CampaignCreateUseCase) Valid

func (e CampaignCreateUseCase) Valid() bool

Valid indicates whether the value is a known member of the CampaignCreateUseCase enum.

type CampaignStatus

type CampaignStatus string

CampaignStatus defines model for CampaignStatus.

const (
	CampaignStatusApproved      CampaignStatus = "approved"
	CampaignStatusDraft         CampaignStatus = "draft"
	CampaignStatusPendingReview CampaignStatus = "pending_review"
	CampaignStatusRejected      CampaignStatus = "rejected"
	CampaignStatusSuspended     CampaignStatus = "suspended"
)

Defines values for CampaignStatus.

func (CampaignStatus) Valid

func (e CampaignStatus) Valid() bool

Valid indicates whether the value is a known member of the CampaignStatus enum.

type CampaignStatusChangedJSONRequestBody

type CampaignStatusChangedJSONRequestBody = EventEnvelope

CampaignStatusChangedJSONRequestBody defines body for CampaignStatusChanged for application/json ContentType.

type CampaignUseCase

type CampaignUseCase string

CampaignUseCase defines model for Campaign.UseCase.

const (
	CampaignUseCaseAppointmentReminders CampaignUseCase = "appointment_reminders"
	CampaignUseCaseCustomerCare         CampaignUseCase = "customer_care"
	CampaignUseCaseMarketing            CampaignUseCase = "marketing"
	CampaignUseCaseMixed                CampaignUseCase = "mixed"
	CampaignUseCaseTwoFactor            CampaignUseCase = "two_factor"
)

Defines values for CampaignUseCase.

func (CampaignUseCase) Valid

func (e CampaignUseCase) Valid() bool

Valid indicates whether the value is a known member of the CampaignUseCase enum.

type CancelPortInResponse

type CancelPortInResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *PortIn
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCancelPortInResponse

func ParseCancelPortInResponse(rsp *http.Response) (*CancelPortInResponse, error)

ParseCancelPortInResponse parses an HTTP response from a CancelPortInWithResponse call

func (CancelPortInResponse) ContentType

func (r CancelPortInResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CancelPortInResponse) GetBody

func (r CancelPortInResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CancelPortInResponse) GetJSON200

func (r CancelPortInResponse) GetJSON200() *PortIn

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CancelPortInResponse) GetJSONDefault

func (r CancelPortInResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CancelPortInResponse) Status

func (r CancelPortInResponse) Status() string

Status returns HTTPResponse.Status

func (CancelPortInResponse) StatusCode

func (r CancelPortInResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CheckPortabilityJSONBody

type CheckPortabilityJSONBody struct {
	// PhoneNumbers US numbers in E.164, up to 100.
	PhoneNumbers []string `json:"phone_numbers"`
}

CheckPortabilityJSONBody defines parameters for CheckPortability.

type CheckPortabilityJSONRequestBody

type CheckPortabilityJSONRequestBody CheckPortabilityJSONBody

CheckPortabilityJSONRequestBody defines body for CheckPortability for application/json ContentType.

type CheckPortabilityResponse

type CheckPortabilityResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data []PortabilityResult `json:"data"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCheckPortabilityResponse

func ParseCheckPortabilityResponse(rsp *http.Response) (*CheckPortabilityResponse, error)

ParseCheckPortabilityResponse parses an HTTP response from a CheckPortabilityWithResponse call

func (CheckPortabilityResponse) ContentType

func (r CheckPortabilityResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CheckPortabilityResponse) GetBody

func (r CheckPortabilityResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CheckPortabilityResponse) GetJSON200

func (r CheckPortabilityResponse) GetJSON200() *struct {
	Data []PortabilityResult `json:"data"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CheckPortabilityResponse) GetJSONDefault

func (r CheckPortabilityResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CheckPortabilityResponse) Status

func (r CheckPortabilityResponse) Status() string

Status returns HTTPResponse.Status

func (CheckPortabilityResponse) StatusCode

func (r CheckPortabilityResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CancelPortIn

func (c *Client) CancelPortIn(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*http.Response, error)

CancelPortIn Cancel a port-in

Corresponds with POST /port_ins/{port_in_id}/cancel (the `CancelPortIn` operationId).

func (*Client) CheckPortability

func (c *Client) CheckPortability(ctx context.Context, body CheckPortabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CheckPortability Check portability

Ask, per number, whether it can be ported in. Free and side-effect-free.

Takes a body of the `application/json` content type.

Corresponds with POST /port_ins/check (the `CheckPortability` operationId).

func (*Client) CheckPortabilityWithBody

func (c *Client) CheckPortabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CheckPortabilityWithBody Check portability

Ask, per number, whether it can be ported in. Free and side-effect-free.

Takes any type of body and a specified content type.

Corresponds with POST /port_ins/check (the `CheckPortability` operationId).

func (*Client) CreateBrand

func (c *Client) CreateBrand(ctx context.Context, params *CreateBrandParams, body CreateBrandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateBrand Register a 10DLC brand

Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.

Takes a body of the `application/json` content type.

Corresponds with POST /brands (the `CreateBrand` operationId).

func (*Client) CreateBrandWithBody

func (c *Client) CreateBrandWithBody(ctx context.Context, params *CreateBrandParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateBrandWithBody Register a 10DLC brand

Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.

Takes any type of body and a specified content type.

Corresponds with POST /brands (the `CreateBrand` operationId).

func (*Client) CreateCall

func (c *Client) CreateCall(ctx context.Context, body CreateCallJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCall Start a click-to-call

Dials `connect_to` (the agent) from the tenant's number; when they answer, dials `to` (the customer) showing the same tenant number, and bridges the two. Track progress via `call.completed` webhooks or by polling: `dialing` → `ringing` → `in_progress` → `completed` (`failed` if either side never answers). In test mode the simulated parties answer within seconds and the call auto-completes.

A small set of US rural exchanges known for access stimulation (traffic pumping) can't be dialed from any leg — such requests return `destination_not_supported`.

Takes a body of the `application/json` content type.

Corresponds with POST /calls (the `CreateCall` operationId).

func (*Client) CreateCallStream

func (c *Client) CreateCallStream(ctx context.Context, callId string, body CreateCallStreamJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCallStream Stream the call's audio in real time

Forks the call's audio to a WebSocket on the media gateway (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the returned `url` with the returned `token` (`?token=…` or an `Authorization: Bearer` header) — the token is shown exactly once. Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1, "timestamp_ms":840,"payload":"<base64 pcmu>"}`.

`direction: bidirectional` also plays audio you send on the same socket into the call (`{"event":"media","payload":…}`; send `{"event":"clear"}` to flush queued playback) — the substrate for AI voice agents. The call must be ringing or in progress; one active stream per call. Billed per connected minute (`stream_minute`). In test mode the simulated carrier streams a pulsing 440 Hz tone on the inbound track and echoes your playback on the outbound track; calls to +15005550008 fail to stream.

Takes a body of the `application/json` content type.

Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).

func (*Client) CreateCallStreamWithBody

func (c *Client) CreateCallStreamWithBody(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCallStreamWithBody Stream the call's audio in real time

Forks the call's audio to a WebSocket on the media gateway (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the returned `url` with the returned `token` (`?token=…` or an `Authorization: Bearer` header) — the token is shown exactly once. Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1, "timestamp_ms":840,"payload":"<base64 pcmu>"}`.

`direction: bidirectional` also plays audio you send on the same socket into the call (`{"event":"media","payload":…}`; send `{"event":"clear"}` to flush queued playback) — the substrate for AI voice agents. The call must be ringing or in progress; one active stream per call. Billed per connected minute (`stream_minute`). In test mode the simulated carrier streams a pulsing 440 Hz tone on the inbound track and echoes your playback on the outbound track; calls to +15005550008 fail to stream.

Takes any type of body and a specified content type.

Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).

func (*Client) CreateCallWithBody

func (c *Client) CreateCallWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCallWithBody Start a click-to-call

Dials `connect_to` (the agent) from the tenant's number; when they answer, dials `to` (the customer) showing the same tenant number, and bridges the two. Track progress via `call.completed` webhooks or by polling: `dialing` → `ringing` → `in_progress` → `completed` (`failed` if either side never answers). In test mode the simulated parties answer within seconds and the call auto-completes.

A small set of US rural exchanges known for access stimulation (traffic pumping) can't be dialed from any leg — such requests return `destination_not_supported`.

Takes any type of body and a specified content type.

Corresponds with POST /calls (the `CreateCall` operationId).

func (*Client) CreateCampaign

func (c *Client) CreateCampaign(ctx context.Context, params *CreateCampaignParams, body CreateCampaignJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCampaign Register a 10DLC campaign

Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.

Takes a body of the `application/json` content type.

Corresponds with POST /campaigns (the `CreateCampaign` operationId).

func (*Client) CreateCampaignWithBody

func (c *Client) CreateCampaignWithBody(ctx context.Context, params *CreateCampaignParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateCampaignWithBody Register a 10DLC campaign

Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.

Takes any type of body and a specified content type.

Corresponds with POST /campaigns (the `CreateCampaign` operationId).

func (*Client) CreateE911Address

func (c *Client) CreateE911Address(ctx context.Context, params *CreateE911AddressParams, body CreateE911AddressJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateE911Address Validate and register an E911 address

Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.

Takes a body of the `application/json` content type.

Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).

func (*Client) CreateE911AddressWithBody

func (c *Client) CreateE911AddressWithBody(ctx context.Context, params *CreateE911AddressParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateE911AddressWithBody Validate and register an E911 address

Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.

Takes any type of body and a specified content type.

Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).

func (*Client) CreatePortIn

func (c *Client) CreatePortIn(ctx context.Context, body CreatePortInJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreatePortIn Create a port-in

Opens a draft port-in carrying the numbers and the account details as they appear at the losing carrier. Fails with `numbers_not_portable` if any number can't be ported. Call `submit` to start carrier review.

Takes a body of the `application/json` content type.

Corresponds with POST /port_ins (the `CreatePortIn` operationId).

func (*Client) CreatePortInWithBody

func (c *Client) CreatePortInWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreatePortInWithBody Create a port-in

Opens a draft port-in carrying the numbers and the account details as they appear at the losing carrier. Fails with `numbers_not_portable` if any number can't be ported. Call `submit` to start carrier review.

Takes any type of body and a specified content type.

Corresponds with POST /port_ins (the `CreatePortIn` operationId).

func (*Client) CreateRoutingConfig

func (c *Client) CreateRoutingConfig(ctx context.Context, params *CreateRoutingConfigParams, body CreateRoutingConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateRoutingConfig Create a routing config

Takes a body of the `application/json` content type.

Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).

func (*Client) CreateRoutingConfigWithBody

func (c *Client) CreateRoutingConfigWithBody(ctx context.Context, params *CreateRoutingConfigParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateRoutingConfigWithBody Create a routing config

Takes any type of body and a specified content type.

Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).

func (*Client) CreateTenant

func (c *Client) CreateTenant(ctx context.Context, params *CreateTenantParams, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateTenant Create a tenant

Takes a body of the `application/json` content type.

Corresponds with POST /tenants (the `CreateTenant` operationId).

func (*Client) CreateTenantWithBody

func (c *Client) CreateTenantWithBody(ctx context.Context, params *CreateTenantParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateTenantWithBody Create a tenant

Takes any type of body and a specified content type.

Corresponds with POST /tenants (the `CreateTenant` operationId).

func (*Client) CreateWebClient

func (c *Client) CreateWebClient(ctx context.Context, body CreateWebClientJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateWebClient Create a web client

Provisions a browser softphone endpoint (one SIP credential). Create one per agent seat — credentials must not be shared across concurrent devices. The browser never sees the credential: mint short-lived login tokens server-side via `POST /web_clients/{id}/tokens` and hand only the token to the page. Freshly created clients can take a few seconds to accept their first login.

Takes a body of the `application/json` content type.

Corresponds with POST /web_clients (the `CreateWebClient` operationId).

func (*Client) CreateWebClientToken

func (c *Client) CreateWebClientToken(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateWebClientToken Mint a login token

Returns a short-lived browser login token. Call this from your backend when a signed-in agent opens the softphone, and pass the token to the browser SDK. Mint a fresh token per session; tokens expire on their own and die early if the client is revoked.

Corresponds with POST /web_clients/{web_client_id}/tokens (the `CreateWebClientToken` operationId).

func (*Client) CreateWebClientWithBody

func (c *Client) CreateWebClientWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateWebClientWithBody Create a web client

Provisions a browser softphone endpoint (one SIP credential). Create one per agent seat — credentials must not be shared across concurrent devices. The browser never sees the credential: mint short-lived login tokens server-side via `POST /web_clients/{id}/tokens` and hand only the token to the page. Freshly created clients can take a few seconds to accept their first login.

Takes any type of body and a specified content type.

Corresponds with POST /web_clients (the `CreateWebClient` operationId).

func (*Client) CreateWebhookEndpoint

func (c *Client) CreateWebhookEndpoint(ctx context.Context, params *CreateWebhookEndpointParams, body CreateWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateWebhookEndpoint Create a webhook endpoint

Takes a body of the `application/json` content type.

Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).

func (*Client) CreateWebhookEndpointWithBody

func (c *Client) CreateWebhookEndpointWithBody(ctx context.Context, params *CreateWebhookEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateWebhookEndpointWithBody Create a webhook endpoint

Takes any type of body and a specified content type.

Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).

func (*Client) DeleteRoutingConfig

func (c *Client) DeleteRoutingConfig(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteRoutingConfig Delete a routing config

Fails with `routing_config_in_use` if any number references it.

Corresponds with DELETE /routing_configs/{routing_config_id} (the `DeleteRoutingConfig` operationId).

func (*Client) DeleteTenant

func (c *Client) DeleteTenant(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteTenant Delete a tenant

Releases the tenant's phone numbers and deactivates its campaigns. Message and call history is retained per your data-retention settings.

Corresponds with DELETE /tenants/{tenant_id} (the `DeleteTenant` operationId).

func (*Client) DeleteWebhookEndpoint

func (c *Client) DeleteWebhookEndpoint(ctx context.Context, endpointId string, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteWebhookEndpoint Delete a webhook endpoint

Corresponds with DELETE /webhook_endpoints/{endpoint_id} (the `DeleteWebhookEndpoint` operationId).

func (*Client) GatherCallDigits

func (c *Client) GatherCallDigits(ctx context.Context, callId string, body GatherCallDigitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

GatherCallDigits Ask the remote party a keypad question

Speaks `prompt` as text-to-speech and collects keypresses from the call's remote party. Each keypress fires a `call.dtmf` webhook; the collected result arrives as a `call.gather` webhook with `digits` and a `reason` of `completed`, `timeout`, or `hangup`. The call must be in progress. In test mode the simulated party presses `1` about 1.5 s after the prompt (calls to +15005550007 never press anything and time out).

Takes a body of the `application/json` content type.

Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).

func (*Client) GatherCallDigitsWithBody

func (c *Client) GatherCallDigitsWithBody(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

GatherCallDigitsWithBody Ask the remote party a keypad question

Speaks `prompt` as text-to-speech and collects keypresses from the call's remote party. Each keypress fires a `call.dtmf` webhook; the collected result arrives as a `call.gather` webhook with `digits` and a `reason` of `completed`, `timeout`, or `hangup`. The call must be in progress. In test mode the simulated party presses `1` about 1.5 s after the prompt (calls to +15005550007 never press anything and time out).

Takes any type of body and a specified content type.

Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).

func (*Client) GetBrand

func (c *Client) GetBrand(ctx context.Context, brandId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetBrand Retrieve a brand

Corresponds with GET /brands/{brand_id} (the `GetBrand` operationId).

func (*Client) GetCall

func (c *Client) GetCall(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCall Retrieve a call

Corresponds with GET /calls/{call_id} (the `GetCall` operationId).

func (*Client) GetCallTranscript

func (c *Client) GetCallTranscript(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCallTranscript Retrieve a call's live transcript

The transcript so far — callable mid-call. Segments are final utterances in order; `text` is the full conversation joined.

Corresponds with GET /calls/{call_id}/transcript (the `GetCallTranscript` operationId).

func (*Client) GetCampaign

func (c *Client) GetCampaign(ctx context.Context, campaignId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCampaign Retrieve a campaign

Corresponds with GET /campaigns/{campaign_id} (the `GetCampaign` operationId).

func (*Client) GetConversation

func (c *Client) GetConversation(ctx context.Context, conversationId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetConversation Retrieve a conversation

Corresponds with GET /conversations/{conversation_id} (the `GetConversation` operationId).

func (*Client) GetMessage

func (c *Client) GetMessage(ctx context.Context, messageId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetMessage Retrieve a message

Corresponds with GET /messages/{message_id} (the `GetMessage` operationId).

func (*Client) GetMessageStats added in v0.12.0

func (c *Client) GetMessageStats(ctx context.Context, params *GetMessageStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetMessageStats Outbound deliverability stats

Delivery rate and failure-reason breakdown for outbound messages over a window, aggregated from the messages table. Defaults to the last 30 days. `delivery_rate` is delivered / (delivered + failed); in-flight messages (`sent`, `pending`) are excluded from that ratio.

Corresponds with GET /messages/stats (the `GetMessageStats` operationId).

func (*Client) GetNumber

func (c *Client) GetNumber(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetNumber Retrieve a phone number

Corresponds with GET /phone_numbers/{number_id} (the `GetNumber` operationId).

func (*Client) GetPortIn

func (c *Client) GetPortIn(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetPortIn Get a port-in

Corresponds with GET /port_ins/{port_in_id} (the `GetPortIn` operationId).

func (*Client) GetRecording

func (c *Client) GetRecording(ctx context.Context, recordingId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetRecording Retrieve a call recording

Corresponds with GET /recordings/{recording_id} (the `GetRecording` operationId).

func (*Client) GetRoutingConfig

func (c *Client) GetRoutingConfig(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetRoutingConfig Retrieve a routing config

Corresponds with GET /routing_configs/{routing_config_id} (the `GetRoutingConfig` operationId).

func (*Client) GetTenant

func (c *Client) GetTenant(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetTenant Retrieve a tenant

Corresponds with GET /tenants/{tenant_id} (the `GetTenant` operationId).

func (*Client) GetUsage

func (c *Client) GetUsage(ctx context.Context, params *GetUsageParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetUsage Usage summary

Totals the account's billable usage by kind over `[start, end)` for the key's mode. Live and test ledgers are separate; only live usage is invoiced.

Corresponds with GET /usage (the `GetUsage` operationId).

func (*Client) GetVoicemail

func (c *Client) GetVoicemail(ctx context.Context, voicemailId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetVoicemail Retrieve a voicemail

Corresponds with GET /voicemails/{voicemail_id} (the `GetVoicemail` operationId).

func (*Client) GetWebClient

func (c *Client) GetWebClient(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetWebClient Retrieve a web client

Corresponds with GET /web_clients/{web_client_id} (the `GetWebClient` operationId).

func (*Client) ListBrands

func (c *Client) ListBrands(ctx context.Context, params *ListBrandsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListBrands List brands

Corresponds with GET /brands (the `ListBrands` operationId).

func (*Client) ListCallStreams

func (c *Client) ListCallStreams(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCallStreams List a call's streams

Corresponds with GET /calls/{call_id}/streams (the `ListCallStreams` operationId).

func (*Client) ListCalls

func (c *Client) ListCalls(ctx context.Context, params *ListCallsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCalls List calls

Corresponds with GET /calls (the `ListCalls` operationId).

func (*Client) ListCampaigns

func (c *Client) ListCampaigns(ctx context.Context, params *ListCampaignsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListCampaigns List campaigns

Corresponds with GET /campaigns (the `ListCampaigns` operationId).

func (*Client) ListConversations

func (c *Client) ListConversations(ctx context.Context, params *ListConversationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListConversations List conversations

A conversation is the thread between one tenant number and one external number, ordered by most recent activity.

Corresponds with GET /conversations (the `ListConversations` operationId).

func (*Client) ListE911Addresses

func (c *Client) ListE911Addresses(ctx context.Context, params *ListE911AddressesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListE911Addresses List E911 addresses

Corresponds with GET /e911_addresses (the `ListE911Addresses` operationId).

func (*Client) ListMessages

func (c *Client) ListMessages(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListMessages List messages

Corresponds with GET /messages (the `ListMessages` operationId).

func (*Client) ListNumbers

func (c *Client) ListNumbers(ctx context.Context, params *ListNumbersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListNumbers List phone numbers

Corresponds with GET /phone_numbers (the `ListNumbers` operationId).

func (*Client) ListOptOuts

func (c *Client) ListOptOuts(ctx context.Context, params *ListOptOutsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListOptOuts List opted-out recipients

Recipients who sent STOP to a tenant's numbers. Handset blocks sends to them automatically; this endpoint exists so your UI can show why.

Corresponds with GET /opt_outs (the `ListOptOuts` operationId).

func (*Client) ListPortIns

func (c *Client) ListPortIns(ctx context.Context, params *ListPortInsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListPortIns List port-ins

Corresponds with GET /port_ins (the `ListPortIns` operationId).

func (*Client) ListRoutingConfigs

func (c *Client) ListRoutingConfigs(ctx context.Context, params *ListRoutingConfigsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListRoutingConfigs List routing configs

Corresponds with GET /routing_configs (the `ListRoutingConfigs` operationId).

func (*Client) ListTenants

func (c *Client) ListTenants(ctx context.Context, params *ListTenantsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListTenants List tenants

Corresponds with GET /tenants (the `ListTenants` operationId).

func (*Client) ListVoicemails

func (c *Client) ListVoicemails(ctx context.Context, params *ListVoicemailsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListVoicemails List voicemails

Corresponds with GET /voicemails (the `ListVoicemails` operationId).

func (*Client) ListWebClients

func (c *Client) ListWebClients(ctx context.Context, params *ListWebClientsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListWebClients List web clients

Corresponds with GET /web_clients (the `ListWebClients` operationId).

func (*Client) ListWebhookEndpoints

func (c *Client) ListWebhookEndpoints(ctx context.Context, params *ListWebhookEndpointsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListWebhookEndpoints List webhook endpoints

Corresponds with GET /webhook_endpoints (the `ListWebhookEndpoints` operationId).

func (*Client) MintRealtimeToken

func (c *Client) MintRealtimeToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

MintRealtimeToken Mint a realtime event-stream token

Returns a short-lived browser-safe token and the WebSocket `url` to connect it to (`wss://media.handset.dev/v1/events?token=…`). The socket pushes your account's events — the same envelopes your webhook endpoints receive — the moment they happen; tenant-scoped keys get only their tenant's events. Mint from your backend (your API key never reaches the browser) and re-mint on expiry; treat the stream as a low-latency refresh signal, with webhooks as the durable channel.

Corresponds with POST /realtime/tokens (the `MintRealtimeToken` operationId).

func (*Client) PurchaseNumber

func (c *Client) PurchaseNumber(ctx context.Context, params *PurchaseNumberParams, body PurchaseNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

PurchaseNumber Purchase a number for a tenant

Takes a body of the `application/json` content type.

Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).

func (*Client) PurchaseNumberWithBody

func (c *Client) PurchaseNumberWithBody(ctx context.Context, params *PurchaseNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

PurchaseNumberWithBody Purchase a number for a tenant

Takes any type of body and a specified content type.

Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).

func (*Client) ReleaseNumber

func (c *Client) ReleaseNumber(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*http.Response, error)

ReleaseNumber Release a phone number

Releases the number back to inventory. Irreversible.

Corresponds with DELETE /phone_numbers/{number_id} (the `ReleaseNumber` operationId).

func (*Client) RevokeWebClient

func (c *Client) RevokeWebClient(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

RevokeWebClient Revoke a web client

Deletes the underlying credential — outstanding login tokens die with it and any registered browser session disconnects. Idempotent.

Corresponds with DELETE /web_clients/{web_client_id} (the `RevokeWebClient` operationId).

func (*Client) SearchAvailableNumbers

func (c *Client) SearchAvailableNumbers(ctx context.Context, params *SearchAvailableNumbersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

SearchAvailableNumbers Search purchasable numbers

Corresponds with GET /phone_numbers/available (the `SearchAvailableNumbers` operationId).

func (*Client) SendCallDtmf

func (c *Client) SendCallDtmf(ctx context.Context, callId string, body SendCallDtmfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

SendCallDtmf Send DTMF digits on a call

Plays digits to the call's remote party — dial an extension, enter a conference PIN, navigate a phone tree. The call must be in progress. On outbound calls tones reach the `to` party; on inbound calls the original caller.

Takes a body of the `application/json` content type.

Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).

func (*Client) SendCallDtmfWithBody

func (c *Client) SendCallDtmfWithBody(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

SendCallDtmfWithBody Send DTMF digits on a call

Plays digits to the call's remote party — dial an extension, enter a conference PIN, navigate a phone tree. The call must be in progress. On outbound calls tones reach the `to` party; on inbound calls the original caller.

Takes any type of body and a specified content type.

Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, params *SendMessageParams, body SendMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

SendMessage Send an SMS/MMS

Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.

Takes a body of the `application/json` content type.

Corresponds with POST /messages (the `SendMessage` operationId).

func (*Client) SendMessageWithBody

func (c *Client) SendMessageWithBody(ctx context.Context, params *SendMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

SendMessageWithBody Send an SMS/MMS

Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.

Takes any type of body and a specified content type.

Corresponds with POST /messages (the `SendMessage` operationId).

func (*Client) StartCallTranscription

func (c *Client) StartCallTranscription(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

StartCallTranscription Start live transcription mid-call

Turns on live speech-to-text for an in-progress call, either direction — each final utterance arrives as a `call.transcript` webhook and accumulates on `GET /calls/{call_id}/transcript`, and an AI summary generates after hangup (`call.summary`). This is the agent-assist switch for inbound calls; `transcribe: true` at creation remains the click-to-call shortcut. Idempotent — starting an already-transcribing call is a no-op. Runs until hangup; billed per transcribed minute on the call's connected time.

Corresponds with POST /calls/{call_id}/transcription (the `StartCallTranscription` operationId).

func (*Client) StopCallStream

func (c *Client) StopCallStream(ctx context.Context, callId string, streamId string, reqEditors ...RequestEditorFn) (*http.Response, error)

StopCallStream Stop a stream

Stops forking audio and settles billing. Idempotent — deleting an already-stopped stream returns its final state. Streams also end on their own when the call ends.

Corresponds with DELETE /calls/{call_id}/streams/{stream_id} (the `StopCallStream` operationId).

func (*Client) SubmitPortIn

func (c *Client) SubmitPortIn(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*http.Response, error)

SubmitPortIn Submit a port-in for carrier review

Moves a `draft` (or corrected `action_needed`) port-in into `in_review`. Status changes arrive as `port_in.status_changed` webhooks. In test mode the simulated carrier completes the whole lifecycle in under a minute.

Corresponds with POST /port_ins/{port_in_id}/submit (the `SubmitPortIn` operationId).

func (*Client) TestWebhookEndpoint

func (c *Client) TestWebhookEndpoint(ctx context.Context, endpointId string, body TestWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

TestWebhookEndpoint Send a test event

Takes a body of the `application/json` content type.

Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).

func (*Client) TestWebhookEndpointWithBody

func (c *Client) TestWebhookEndpointWithBody(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

TestWebhookEndpointWithBody Send a test event

Takes any type of body and a specified content type.

Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).

func (*Client) UpdateNumber

func (c *Client) UpdateNumber(ctx context.Context, numberId string, body UpdateNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateNumber Update routing, campaign, or E911 for a number

Takes a body of the `application/json` content type.

Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).

func (*Client) UpdateNumberWithBody

func (c *Client) UpdateNumberWithBody(ctx context.Context, numberId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateNumberWithBody Update routing, campaign, or E911 for a number

Takes any type of body and a specified content type.

Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).

func (*Client) UpdateRoutingConfig

func (c *Client) UpdateRoutingConfig(ctx context.Context, routingConfigId string, body UpdateRoutingConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateRoutingConfig Update a routing config

Changes apply to new calls immediately.

Takes a body of the `application/json` content type.

Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).

func (*Client) UpdateRoutingConfigWithBody

func (c *Client) UpdateRoutingConfigWithBody(ctx context.Context, routingConfigId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateRoutingConfigWithBody Update a routing config

Changes apply to new calls immediately.

Takes any type of body and a specified content type.

Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).

func (*Client) UpdateTenant

func (c *Client) UpdateTenant(ctx context.Context, tenantId TenantId, body UpdateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateTenant Update a tenant

Takes a body of the `application/json` content type.

Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).

func (*Client) UpdateTenantWithBody

func (c *Client) UpdateTenantWithBody(ctx context.Context, tenantId TenantId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateTenantWithBody Update a tenant

Takes any type of body and a specified content type.

Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).

func (*Client) UpdateWebhookEndpoint

func (c *Client) UpdateWebhookEndpoint(ctx context.Context, endpointId string, body UpdateWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateWebhookEndpoint Update a webhook endpoint

Takes a body of the `application/json` content type.

Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).

func (*Client) UpdateWebhookEndpointWithBody

func (c *Client) UpdateWebhookEndpointWithBody(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateWebhookEndpointWithBody Update a webhook endpoint

Takes any type of body and a specified content type.

Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).

type ClientInterface

type ClientInterface interface {

	// ListBrands List brands
	//
	// Corresponds with GET /brands (the `ListBrands` operationId).
	ListBrands(ctx context.Context, params *ListBrandsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateBrandWithBody Register a 10DLC brand
	//
	// Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /brands (the `CreateBrand` operationId).
	CreateBrandWithBody(ctx context.Context, params *CreateBrandParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateBrand Register a 10DLC brand
	//
	// Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /brands (the `CreateBrand` operationId).
	CreateBrand(ctx context.Context, params *CreateBrandParams, body CreateBrandJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetBrand Retrieve a brand
	//
	// Corresponds with GET /brands/{brand_id} (the `GetBrand` operationId).
	GetBrand(ctx context.Context, brandId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCalls List calls
	//
	// Corresponds with GET /calls (the `ListCalls` operationId).
	ListCalls(ctx context.Context, params *ListCallsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCallWithBody Start a click-to-call
	//
	// Dials `connect_to` (the agent) from the tenant's number; when they
	// answer, dials `to` (the customer) showing the same tenant number,
	// and bridges the two. Track progress via `call.completed` webhooks or
	// by polling: `dialing` → `ringing` → `in_progress` → `completed`
	// (`failed` if either side never answers). In test mode the simulated
	// parties answer within seconds and the call auto-completes.
	//
	// A small set of US rural exchanges known for access stimulation
	// (traffic pumping) can't be dialed from any leg — such requests
	// return `destination_not_supported`.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /calls (the `CreateCall` operationId).
	CreateCallWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCall Start a click-to-call
	//
	// Dials `connect_to` (the agent) from the tenant's number; when they
	// answer, dials `to` (the customer) showing the same tenant number,
	// and bridges the two. Track progress via `call.completed` webhooks or
	// by polling: `dialing` → `ringing` → `in_progress` → `completed`
	// (`failed` if either side never answers). In test mode the simulated
	// parties answer within seconds and the call auto-completes.
	//
	// A small set of US rural exchanges known for access stimulation
	// (traffic pumping) can't be dialed from any leg — such requests
	// return `destination_not_supported`.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /calls (the `CreateCall` operationId).
	CreateCall(ctx context.Context, body CreateCallJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCall Retrieve a call
	//
	// Corresponds with GET /calls/{call_id} (the `GetCall` operationId).
	GetCall(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SendCallDtmfWithBody Send DTMF digits on a call
	//
	// Plays digits to the call's remote party — dial an extension, enter a
	// conference PIN, navigate a phone tree. The call must be in progress.
	// On outbound calls tones reach the `to` party; on inbound calls the
	// original caller.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).
	SendCallDtmfWithBody(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SendCallDtmf Send DTMF digits on a call
	//
	// Plays digits to the call's remote party — dial an extension, enter a
	// conference PIN, navigate a phone tree. The call must be in progress.
	// On outbound calls tones reach the `to` party; on inbound calls the
	// original caller.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).
	SendCallDtmf(ctx context.Context, callId string, body SendCallDtmfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GatherCallDigitsWithBody Ask the remote party a keypad question
	//
	// Speaks `prompt` as text-to-speech and collects keypresses from the
	// call's remote party. Each keypress fires a `call.dtmf` webhook; the
	// collected result arrives as a `call.gather` webhook with `digits`
	// and a `reason` of `completed`, `timeout`, or `hangup`. The call must
	// be in progress. In test mode the simulated party presses `1` about
	// 1.5 s after the prompt (calls to +15005550007 never press anything
	// and time out).
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).
	GatherCallDigitsWithBody(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GatherCallDigits Ask the remote party a keypad question
	//
	// Speaks `prompt` as text-to-speech and collects keypresses from the
	// call's remote party. Each keypress fires a `call.dtmf` webhook; the
	// collected result arrives as a `call.gather` webhook with `digits`
	// and a `reason` of `completed`, `timeout`, or `hangup`. The call must
	// be in progress. In test mode the simulated party presses `1` about
	// 1.5 s after the prompt (calls to +15005550007 never press anything
	// and time out).
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).
	GatherCallDigits(ctx context.Context, callId string, body GatherCallDigitsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCallStreams List a call's streams
	//
	// Corresponds with GET /calls/{call_id}/streams (the `ListCallStreams` operationId).
	ListCallStreams(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCallStreamWithBody Stream the call's audio in real time
	//
	// Forks the call's audio to a WebSocket on the media gateway
	// (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the
	// returned `url` with the returned `token` (`?token=…` or an
	// `Authorization: Bearer` header) — the token is shown exactly once.
	// Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1,
	// "timestamp_ms":840,"payload":"<base64 pcmu>"}`.
	//
	// `direction: bidirectional` also plays audio you send on the same
	// socket into the call (`{"event":"media","payload":…}`; send
	// `{"event":"clear"}` to flush queued playback) — the substrate for
	// AI voice agents. The call must be ringing or in progress; one
	// active stream per call. Billed per connected minute
	// (`stream_minute`). In test mode the simulated carrier streams a
	// pulsing 440 Hz tone on the inbound track and echoes your playback
	// on the outbound track; calls to +15005550008 fail to stream.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).
	CreateCallStreamWithBody(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCallStream Stream the call's audio in real time
	//
	// Forks the call's audio to a WebSocket on the media gateway
	// (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the
	// returned `url` with the returned `token` (`?token=…` or an
	// `Authorization: Bearer` header) — the token is shown exactly once.
	// Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1,
	// "timestamp_ms":840,"payload":"<base64 pcmu>"}`.
	//
	// `direction: bidirectional` also plays audio you send on the same
	// socket into the call (`{"event":"media","payload":…}`; send
	// `{"event":"clear"}` to flush queued playback) — the substrate for
	// AI voice agents. The call must be ringing or in progress; one
	// active stream per call. Billed per connected minute
	// (`stream_minute`). In test mode the simulated carrier streams a
	// pulsing 440 Hz tone on the inbound track and echoes your playback
	// on the outbound track; calls to +15005550008 fail to stream.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).
	CreateCallStream(ctx context.Context, callId string, body CreateCallStreamJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// StopCallStream Stop a stream
	//
	// Stops forking audio and settles billing. Idempotent — deleting an already-stopped stream returns its final state. Streams also end on their own when the call ends.
	//
	// Corresponds with DELETE /calls/{call_id}/streams/{stream_id} (the `StopCallStream` operationId).
	StopCallStream(ctx context.Context, callId string, streamId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCallTranscript Retrieve a call's live transcript
	//
	// The transcript so far — callable mid-call. Segments are final
	// utterances in order; `text` is the full conversation joined.
	//
	// Corresponds with GET /calls/{call_id}/transcript (the `GetCallTranscript` operationId).
	GetCallTranscript(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// StartCallTranscription Start live transcription mid-call
	//
	// Turns on live speech-to-text for an in-progress call, either
	// direction — each final utterance arrives as a `call.transcript`
	// webhook and accumulates on `GET /calls/{call_id}/transcript`, and
	// an AI summary generates after hangup (`call.summary`). This is the
	// agent-assist switch for inbound calls; `transcribe: true` at
	// creation remains the click-to-call shortcut. Idempotent — starting
	// an already-transcribing call is a no-op. Runs until hangup; billed
	// per transcribed minute on the call's connected time.
	//
	// Corresponds with POST /calls/{call_id}/transcription (the `StartCallTranscription` operationId).
	StartCallTranscription(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListCampaigns List campaigns
	//
	// Corresponds with GET /campaigns (the `ListCampaigns` operationId).
	ListCampaigns(ctx context.Context, params *ListCampaignsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCampaignWithBody Register a 10DLC campaign
	//
	// Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /campaigns (the `CreateCampaign` operationId).
	CreateCampaignWithBody(ctx context.Context, params *CreateCampaignParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateCampaign Register a 10DLC campaign
	//
	// Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /campaigns (the `CreateCampaign` operationId).
	CreateCampaign(ctx context.Context, params *CreateCampaignParams, body CreateCampaignJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCampaign Retrieve a campaign
	//
	// Corresponds with GET /campaigns/{campaign_id} (the `GetCampaign` operationId).
	GetCampaign(ctx context.Context, campaignId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListConversations List conversations
	//
	// A conversation is the thread between one tenant number and one external number, ordered by most recent activity.
	//
	// Corresponds with GET /conversations (the `ListConversations` operationId).
	ListConversations(ctx context.Context, params *ListConversationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetConversation Retrieve a conversation
	//
	// Corresponds with GET /conversations/{conversation_id} (the `GetConversation` operationId).
	GetConversation(ctx context.Context, conversationId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListE911Addresses List E911 addresses
	//
	// Corresponds with GET /e911_addresses (the `ListE911Addresses` operationId).
	ListE911Addresses(ctx context.Context, params *ListE911AddressesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateE911AddressWithBody Validate and register an E911 address
	//
	// Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).
	CreateE911AddressWithBody(ctx context.Context, params *CreateE911AddressParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateE911Address Validate and register an E911 address
	//
	// Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).
	CreateE911Address(ctx context.Context, params *CreateE911AddressParams, body CreateE911AddressJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListMessages List messages
	//
	// Corresponds with GET /messages (the `ListMessages` operationId).
	ListMessages(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SendMessageWithBody Send an SMS/MMS
	//
	// Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /messages (the `SendMessage` operationId).
	SendMessageWithBody(ctx context.Context, params *SendMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SendMessage Send an SMS/MMS
	//
	// Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /messages (the `SendMessage` operationId).
	SendMessage(ctx context.Context, params *SendMessageParams, body SendMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMessageStats Outbound deliverability stats
	//
	// Delivery rate and failure-reason breakdown for outbound messages over a window, aggregated from the messages table. Defaults to the last 30 days. `delivery_rate` is delivered / (delivered + failed); in-flight messages (`sent`, `pending`) are excluded from that ratio.
	//
	// Corresponds with GET /messages/stats (the `GetMessageStats` operationId).
	GetMessageStats(ctx context.Context, params *GetMessageStatsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMessage Retrieve a message
	//
	// Corresponds with GET /messages/{message_id} (the `GetMessage` operationId).
	GetMessage(ctx context.Context, messageId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListOptOuts List opted-out recipients
	//
	// Recipients who sent STOP to a tenant's numbers. Handset blocks sends to them automatically; this endpoint exists so your UI can show why.
	//
	// Corresponds with GET /opt_outs (the `ListOptOuts` operationId).
	ListOptOuts(ctx context.Context, params *ListOptOutsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListNumbers List phone numbers
	//
	// Corresponds with GET /phone_numbers (the `ListNumbers` operationId).
	ListNumbers(ctx context.Context, params *ListNumbersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PurchaseNumberWithBody Purchase a number for a tenant
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).
	PurchaseNumberWithBody(ctx context.Context, params *PurchaseNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PurchaseNumber Purchase a number for a tenant
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).
	PurchaseNumber(ctx context.Context, params *PurchaseNumberParams, body PurchaseNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchAvailableNumbers Search purchasable numbers
	//
	// Corresponds with GET /phone_numbers/available (the `SearchAvailableNumbers` operationId).
	SearchAvailableNumbers(ctx context.Context, params *SearchAvailableNumbersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ReleaseNumber Release a phone number
	//
	// Releases the number back to inventory. Irreversible.
	//
	// Corresponds with DELETE /phone_numbers/{number_id} (the `ReleaseNumber` operationId).
	ReleaseNumber(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetNumber Retrieve a phone number
	//
	// Corresponds with GET /phone_numbers/{number_id} (the `GetNumber` operationId).
	GetNumber(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateNumberWithBody Update routing, campaign, or E911 for a number
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).
	UpdateNumberWithBody(ctx context.Context, numberId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateNumber Update routing, campaign, or E911 for a number
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).
	UpdateNumber(ctx context.Context, numberId string, body UpdateNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListPortIns List port-ins
	//
	// Corresponds with GET /port_ins (the `ListPortIns` operationId).
	ListPortIns(ctx context.Context, params *ListPortInsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreatePortInWithBody Create a port-in
	//
	// Opens a draft port-in carrying the numbers and the account details as
	// they appear at the losing carrier. Fails with `numbers_not_portable`
	// if any number can't be ported. Call `submit` to start carrier review.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /port_ins (the `CreatePortIn` operationId).
	CreatePortInWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreatePortIn Create a port-in
	//
	// Opens a draft port-in carrying the numbers and the account details as
	// they appear at the losing carrier. Fails with `numbers_not_portable`
	// if any number can't be ported. Call `submit` to start carrier review.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /port_ins (the `CreatePortIn` operationId).
	CreatePortIn(ctx context.Context, body CreatePortInJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CheckPortabilityWithBody Check portability
	//
	// Ask, per number, whether it can be ported in. Free and side-effect-free.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /port_ins/check (the `CheckPortability` operationId).
	CheckPortabilityWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CheckPortability Check portability
	//
	// Ask, per number, whether it can be ported in. Free and side-effect-free.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /port_ins/check (the `CheckPortability` operationId).
	CheckPortability(ctx context.Context, body CheckPortabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPortIn Get a port-in
	//
	// Corresponds with GET /port_ins/{port_in_id} (the `GetPortIn` operationId).
	GetPortIn(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelPortIn Cancel a port-in
	//
	// Corresponds with POST /port_ins/{port_in_id}/cancel (the `CancelPortIn` operationId).
	CancelPortIn(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SubmitPortIn Submit a port-in for carrier review
	//
	// Moves a `draft` (or corrected `action_needed`) port-in into
	// `in_review`. Status changes arrive as `port_in.status_changed`
	// webhooks. In test mode the simulated carrier completes the whole
	// lifecycle in under a minute.
	//
	// Corresponds with POST /port_ins/{port_in_id}/submit (the `SubmitPortIn` operationId).
	SubmitPortIn(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MintRealtimeToken Mint a realtime event-stream token
	//
	// Returns a short-lived browser-safe token and the WebSocket `url` to
	// connect it to (`wss://media.handset.dev/v1/events?token=…`). The
	// socket pushes your account's events — the same envelopes your
	// webhook endpoints receive — the moment they happen; tenant-scoped
	// keys get only their tenant's events. Mint from your backend (your
	// API key never reaches the browser) and re-mint on expiry; treat the
	// stream as a low-latency refresh signal, with webhooks as the
	// durable channel.
	//
	// Corresponds with POST /realtime/tokens (the `MintRealtimeToken` operationId).
	MintRealtimeToken(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetRecording Retrieve a call recording
	//
	// Corresponds with GET /recordings/{recording_id} (the `GetRecording` operationId).
	GetRecording(ctx context.Context, recordingId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListRoutingConfigs List routing configs
	//
	// Corresponds with GET /routing_configs (the `ListRoutingConfigs` operationId).
	ListRoutingConfigs(ctx context.Context, params *ListRoutingConfigsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateRoutingConfigWithBody Create a routing config
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).
	CreateRoutingConfigWithBody(ctx context.Context, params *CreateRoutingConfigParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateRoutingConfig Create a routing config
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).
	CreateRoutingConfig(ctx context.Context, params *CreateRoutingConfigParams, body CreateRoutingConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteRoutingConfig Delete a routing config
	//
	// Fails with `routing_config_in_use` if any number references it.
	//
	// Corresponds with DELETE /routing_configs/{routing_config_id} (the `DeleteRoutingConfig` operationId).
	DeleteRoutingConfig(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetRoutingConfig Retrieve a routing config
	//
	// Corresponds with GET /routing_configs/{routing_config_id} (the `GetRoutingConfig` operationId).
	GetRoutingConfig(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateRoutingConfigWithBody Update a routing config
	//
	// Changes apply to new calls immediately.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).
	UpdateRoutingConfigWithBody(ctx context.Context, routingConfigId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateRoutingConfig Update a routing config
	//
	// Changes apply to new calls immediately.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).
	UpdateRoutingConfig(ctx context.Context, routingConfigId string, body UpdateRoutingConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListTenants List tenants
	//
	// Corresponds with GET /tenants (the `ListTenants` operationId).
	ListTenants(ctx context.Context, params *ListTenantsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateTenantWithBody Create a tenant
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /tenants (the `CreateTenant` operationId).
	CreateTenantWithBody(ctx context.Context, params *CreateTenantParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateTenant Create a tenant
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /tenants (the `CreateTenant` operationId).
	CreateTenant(ctx context.Context, params *CreateTenantParams, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteTenant Delete a tenant
	//
	// Releases the tenant's phone numbers and deactivates its campaigns. Message and call history is retained per your data-retention settings.
	//
	// Corresponds with DELETE /tenants/{tenant_id} (the `DeleteTenant` operationId).
	DeleteTenant(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTenant Retrieve a tenant
	//
	// Corresponds with GET /tenants/{tenant_id} (the `GetTenant` operationId).
	GetTenant(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateTenantWithBody Update a tenant
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).
	UpdateTenantWithBody(ctx context.Context, tenantId TenantId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateTenant Update a tenant
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).
	UpdateTenant(ctx context.Context, tenantId TenantId, body UpdateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetUsage Usage summary
	//
	// Totals the account's billable usage by kind over `[start, end)` for the key's mode. Live and test ledgers are separate; only live usage is invoiced.
	//
	// Corresponds with GET /usage (the `GetUsage` operationId).
	GetUsage(ctx context.Context, params *GetUsageParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListVoicemails List voicemails
	//
	// Corresponds with GET /voicemails (the `ListVoicemails` operationId).
	ListVoicemails(ctx context.Context, params *ListVoicemailsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetVoicemail Retrieve a voicemail
	//
	// Corresponds with GET /voicemails/{voicemail_id} (the `GetVoicemail` operationId).
	GetVoicemail(ctx context.Context, voicemailId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListWebClients List web clients
	//
	// Corresponds with GET /web_clients (the `ListWebClients` operationId).
	ListWebClients(ctx context.Context, params *ListWebClientsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateWebClientWithBody Create a web client
	//
	// Provisions a browser softphone endpoint (one SIP credential). Create
	// one per agent seat — credentials must not be shared across concurrent
	// devices. The browser never sees the credential: mint short-lived
	// login tokens server-side via `POST /web_clients/{id}/tokens` and hand
	// only the token to the page. Freshly created clients can take a few
	// seconds to accept their first login.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /web_clients (the `CreateWebClient` operationId).
	CreateWebClientWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateWebClient Create a web client
	//
	// Provisions a browser softphone endpoint (one SIP credential). Create
	// one per agent seat — credentials must not be shared across concurrent
	// devices. The browser never sees the credential: mint short-lived
	// login tokens server-side via `POST /web_clients/{id}/tokens` and hand
	// only the token to the page. Freshly created clients can take a few
	// seconds to accept their first login.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /web_clients (the `CreateWebClient` operationId).
	CreateWebClient(ctx context.Context, body CreateWebClientJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RevokeWebClient Revoke a web client
	//
	// Deletes the underlying credential — outstanding login tokens die with
	// it and any registered browser session disconnects. Idempotent.
	//
	// Corresponds with DELETE /web_clients/{web_client_id} (the `RevokeWebClient` operationId).
	RevokeWebClient(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetWebClient Retrieve a web client
	//
	// Corresponds with GET /web_clients/{web_client_id} (the `GetWebClient` operationId).
	GetWebClient(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateWebClientToken Mint a login token
	//
	// Returns a short-lived browser login token. Call this from your
	// backend when a signed-in agent opens the softphone, and pass the
	// token to the browser SDK. Mint a fresh token per session; tokens
	// expire on their own and die early if the client is revoked.
	//
	// Corresponds with POST /web_clients/{web_client_id}/tokens (the `CreateWebClientToken` operationId).
	CreateWebClientToken(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListWebhookEndpoints List webhook endpoints
	//
	// Corresponds with GET /webhook_endpoints (the `ListWebhookEndpoints` operationId).
	ListWebhookEndpoints(ctx context.Context, params *ListWebhookEndpointsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateWebhookEndpointWithBody Create a webhook endpoint
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).
	CreateWebhookEndpointWithBody(ctx context.Context, params *CreateWebhookEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateWebhookEndpoint Create a webhook endpoint
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).
	CreateWebhookEndpoint(ctx context.Context, params *CreateWebhookEndpointParams, body CreateWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteWebhookEndpoint Delete a webhook endpoint
	//
	// Corresponds with DELETE /webhook_endpoints/{endpoint_id} (the `DeleteWebhookEndpoint` operationId).
	DeleteWebhookEndpoint(ctx context.Context, endpointId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateWebhookEndpointWithBody Update a webhook endpoint
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).
	UpdateWebhookEndpointWithBody(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateWebhookEndpoint Update a webhook endpoint
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).
	UpdateWebhookEndpoint(ctx context.Context, endpointId string, body UpdateWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TestWebhookEndpointWithBody Send a test event
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).
	TestWebhookEndpointWithBody(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TestWebhookEndpoint Send a test event
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).
	TestWebhookEndpoint(ctx context.Context, endpointId string, body TestWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func New

func New(apiKey string, opts ...ClientOption) (*ClientWithResponses, error)

New returns a Handset API client authenticated with the given API key.

The key is sent as a bearer token on every request. Use a live key (hs_live_…) to move real traffic and spend prepaid credits, or a test key (hs_test_…) to exercise the API for free — the key prefix selects the mode, not the base URL.

client, err := handset.New(os.Getenv("HANDSET_API_KEY"))
if err != nil {
        log.Fatal(err)
}
resp, err := client.SendMessageWithResponse(ctx, handset.SendMessageJSONRequestBody{
        From: "num_01H…",
        To:   "+14155550123",
        Body: handset.Ptr("On my way!"),
})

Every operation has a ...WithResponse method that returns a typed struct with the decoded body for each documented status code, alongside the raw *http.Response.

Point the client elsewhere (a local gateway, a staging host) or customize transport with the generated options — handset.WithBaseURL, WithHTTPClient, and WithRequestEditorFn:

client, err := handset.New(key,
        handset.WithBaseURL("http://localhost:8080/v1"),
        handset.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
)
Example (IdempotentSend)

Make a send idempotent by attaching an Idempotency-Key: a retry with the same key within 24h returns the original result instead of sending twice.

package main

import (
	"context"
	"os"

	handset "github.com/handset-hq/handset-go"
)

func main() {
	client, _ := handset.New(os.Getenv("HANDSET_API_KEY"))

	key := handset.IdempotencyKey("order-4417-confirm")
	_, _ = client.SendMessageWithResponse(context.Background(),
		&handset.SendMessageParams{IdempotencyKey: &key},
		handset.SendMessageJSONRequestBody{
			From: "num_01H8XABCDE",
			To:   "+14155550123",
			Body: handset.Ptr("Your order is confirmed."),
		})
}
Example (SendMessage)

Send an SMS and read back the queued message.

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	handset "github.com/handset-hq/handset-go"
)

func main() {
	client, err := handset.New(os.Getenv("HANDSET_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	resp, err := client.SendMessageWithResponse(context.Background(), nil,
		handset.SendMessageJSONRequestBody{
			From: "num_01H8XABCDE",
			To:   "+14155550123",
			Body: handset.Ptr("On my way!"),
		})
	if err != nil {
		log.Fatal(err) // transport-level failure
	}

	// A 202 carries the created Message; anything else carries an Error.
	if resp.JSON202 == nil {
		log.Fatalf("send failed (%d): %s", resp.StatusCode(), resp.JSONDefault.Error.Message)
	}
	fmt.Printf("queued %s -> %s\n", resp.JSON202.Id, resp.JSON202.Status)
}

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CancelPortInWithResponse

func (c *ClientWithResponses) CancelPortInWithResponse(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*CancelPortInResponse, error)

CancelPortInWithResponse Cancel a port-in

Returns a wrapper object for the known response body format(s).

Corresponds with POST /port_ins/{port_in_id}/cancel (the `CancelPortIn` operationId).

func (*ClientWithResponses) CheckPortabilityWithBodyWithResponse

func (c *ClientWithResponses) CheckPortabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CheckPortabilityResponse, error)

CheckPortabilityWithBodyWithResponse Check portability

Ask, per number, whether it can be ported in. Free and side-effect-free.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /port_ins/check (the `CheckPortability` operationId).

func (*ClientWithResponses) CheckPortabilityWithResponse

func (c *ClientWithResponses) CheckPortabilityWithResponse(ctx context.Context, body CheckPortabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*CheckPortabilityResponse, error)

CheckPortabilityWithResponse Check portability

Ask, per number, whether it can be ported in. Free and side-effect-free.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /port_ins/check (the `CheckPortability` operationId).

func (*ClientWithResponses) CreateBrandWithBodyWithResponse

func (c *ClientWithResponses) CreateBrandWithBodyWithResponse(ctx context.Context, params *CreateBrandParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBrandResponse, error)

CreateBrandWithBodyWithResponse Register a 10DLC brand

Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /brands (the `CreateBrand` operationId).

func (*ClientWithResponses) CreateBrandWithResponse

func (c *ClientWithResponses) CreateBrandWithResponse(ctx context.Context, params *CreateBrandParams, body CreateBrandJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBrandResponse, error)

CreateBrandWithResponse Register a 10DLC brand

Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /brands (the `CreateBrand` operationId).

func (*ClientWithResponses) CreateCallStreamWithBodyWithResponse

func (c *ClientWithResponses) CreateCallStreamWithBodyWithResponse(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCallStreamResponse, error)

CreateCallStreamWithBodyWithResponse Stream the call's audio in real time

Forks the call's audio to a WebSocket on the media gateway (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the returned `url` with the returned `token` (`?token=…` or an `Authorization: Bearer` header) — the token is shown exactly once. Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1, "timestamp_ms":840,"payload":"<base64 pcmu>"}`.

`direction: bidirectional` also plays audio you send on the same socket into the call (`{"event":"media","payload":…}`; send `{"event":"clear"}` to flush queued playback) — the substrate for AI voice agents. The call must be ringing or in progress; one active stream per call. Billed per connected minute (`stream_minute`). In test mode the simulated carrier streams a pulsing 440 Hz tone on the inbound track and echoes your playback on the outbound track; calls to +15005550008 fail to stream.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).

func (*ClientWithResponses) CreateCallStreamWithResponse

func (c *ClientWithResponses) CreateCallStreamWithResponse(ctx context.Context, callId string, body CreateCallStreamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCallStreamResponse, error)

CreateCallStreamWithResponse Stream the call's audio in real time

Forks the call's audio to a WebSocket on the media gateway (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the returned `url` with the returned `token` (`?token=…` or an `Authorization: Bearer` header) — the token is shown exactly once. Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1, "timestamp_ms":840,"payload":"<base64 pcmu>"}`.

`direction: bidirectional` also plays audio you send on the same socket into the call (`{"event":"media","payload":…}`; send `{"event":"clear"}` to flush queued playback) — the substrate for AI voice agents. The call must be ringing or in progress; one active stream per call. Billed per connected minute (`stream_minute`). In test mode the simulated carrier streams a pulsing 440 Hz tone on the inbound track and echoes your playback on the outbound track; calls to +15005550008 fail to stream.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).

func (*ClientWithResponses) CreateCallWithBodyWithResponse

func (c *ClientWithResponses) CreateCallWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCallResponse, error)

CreateCallWithBodyWithResponse Start a click-to-call

Dials `connect_to` (the agent) from the tenant's number; when they answer, dials `to` (the customer) showing the same tenant number, and bridges the two. Track progress via `call.completed` webhooks or by polling: `dialing` → `ringing` → `in_progress` → `completed` (`failed` if either side never answers). In test mode the simulated parties answer within seconds and the call auto-completes.

A small set of US rural exchanges known for access stimulation (traffic pumping) can't be dialed from any leg — such requests return `destination_not_supported`.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls (the `CreateCall` operationId).

func (*ClientWithResponses) CreateCallWithResponse

func (c *ClientWithResponses) CreateCallWithResponse(ctx context.Context, body CreateCallJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCallResponse, error)

CreateCallWithResponse Start a click-to-call

Dials `connect_to` (the agent) from the tenant's number; when they answer, dials `to` (the customer) showing the same tenant number, and bridges the two. Track progress via `call.completed` webhooks or by polling: `dialing` → `ringing` → `in_progress` → `completed` (`failed` if either side never answers). In test mode the simulated parties answer within seconds and the call auto-completes.

A small set of US rural exchanges known for access stimulation (traffic pumping) can't be dialed from any leg — such requests return `destination_not_supported`.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls (the `CreateCall` operationId).

func (*ClientWithResponses) CreateCampaignWithBodyWithResponse

func (c *ClientWithResponses) CreateCampaignWithBodyWithResponse(ctx context.Context, params *CreateCampaignParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCampaignResponse, error)

CreateCampaignWithBodyWithResponse Register a 10DLC campaign

Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /campaigns (the `CreateCampaign` operationId).

func (*ClientWithResponses) CreateCampaignWithResponse

func (c *ClientWithResponses) CreateCampaignWithResponse(ctx context.Context, params *CreateCampaignParams, body CreateCampaignJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCampaignResponse, error)

CreateCampaignWithResponse Register a 10DLC campaign

Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /campaigns (the `CreateCampaign` operationId).

func (*ClientWithResponses) CreateE911AddressWithBodyWithResponse

func (c *ClientWithResponses) CreateE911AddressWithBodyWithResponse(ctx context.Context, params *CreateE911AddressParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateE911AddressResponse, error)

CreateE911AddressWithBodyWithResponse Validate and register an E911 address

Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).

func (*ClientWithResponses) CreateE911AddressWithResponse

CreateE911AddressWithResponse Validate and register an E911 address

Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).

func (*ClientWithResponses) CreatePortInWithBodyWithResponse

func (c *ClientWithResponses) CreatePortInWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePortInResponse, error)

CreatePortInWithBodyWithResponse Create a port-in

Opens a draft port-in carrying the numbers and the account details as they appear at the losing carrier. Fails with `numbers_not_portable` if any number can't be ported. Call `submit` to start carrier review.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /port_ins (the `CreatePortIn` operationId).

func (*ClientWithResponses) CreatePortInWithResponse

func (c *ClientWithResponses) CreatePortInWithResponse(ctx context.Context, body CreatePortInJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePortInResponse, error)

CreatePortInWithResponse Create a port-in

Opens a draft port-in carrying the numbers and the account details as they appear at the losing carrier. Fails with `numbers_not_portable` if any number can't be ported. Call `submit` to start carrier review.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /port_ins (the `CreatePortIn` operationId).

func (*ClientWithResponses) CreateRoutingConfigWithBodyWithResponse

func (c *ClientWithResponses) CreateRoutingConfigWithBodyWithResponse(ctx context.Context, params *CreateRoutingConfigParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRoutingConfigResponse, error)

CreateRoutingConfigWithBodyWithResponse Create a routing config

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).

func (*ClientWithResponses) CreateRoutingConfigWithResponse

CreateRoutingConfigWithResponse Create a routing config

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).

func (*ClientWithResponses) CreateTenantWithBodyWithResponse

func (c *ClientWithResponses) CreateTenantWithBodyWithResponse(ctx context.Context, params *CreateTenantParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error)

CreateTenantWithBodyWithResponse Create a tenant

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /tenants (the `CreateTenant` operationId).

func (*ClientWithResponses) CreateTenantWithResponse

func (c *ClientWithResponses) CreateTenantWithResponse(ctx context.Context, params *CreateTenantParams, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error)

CreateTenantWithResponse Create a tenant

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /tenants (the `CreateTenant` operationId).

func (*ClientWithResponses) CreateWebClientTokenWithResponse

func (c *ClientWithResponses) CreateWebClientTokenWithResponse(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*CreateWebClientTokenResponse, error)

CreateWebClientTokenWithResponse Mint a login token

Returns a short-lived browser login token. Call this from your backend when a signed-in agent opens the softphone, and pass the token to the browser SDK. Mint a fresh token per session; tokens expire on their own and die early if the client is revoked.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /web_clients/{web_client_id}/tokens (the `CreateWebClientToken` operationId).

func (*ClientWithResponses) CreateWebClientWithBodyWithResponse

func (c *ClientWithResponses) CreateWebClientWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebClientResponse, error)

CreateWebClientWithBodyWithResponse Create a web client

Provisions a browser softphone endpoint (one SIP credential). Create one per agent seat — credentials must not be shared across concurrent devices. The browser never sees the credential: mint short-lived login tokens server-side via `POST /web_clients/{id}/tokens` and hand only the token to the page. Freshly created clients can take a few seconds to accept their first login.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /web_clients (the `CreateWebClient` operationId).

func (*ClientWithResponses) CreateWebClientWithResponse

func (c *ClientWithResponses) CreateWebClientWithResponse(ctx context.Context, body CreateWebClientJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebClientResponse, error)

CreateWebClientWithResponse Create a web client

Provisions a browser softphone endpoint (one SIP credential). Create one per agent seat — credentials must not be shared across concurrent devices. The browser never sees the credential: mint short-lived login tokens server-side via `POST /web_clients/{id}/tokens` and hand only the token to the page. Freshly created clients can take a few seconds to accept their first login.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /web_clients (the `CreateWebClient` operationId).

func (*ClientWithResponses) CreateWebhookEndpointWithBodyWithResponse

func (c *ClientWithResponses) CreateWebhookEndpointWithBodyWithResponse(ctx context.Context, params *CreateWebhookEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookEndpointResponse, error)

CreateWebhookEndpointWithBodyWithResponse Create a webhook endpoint

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).

func (*ClientWithResponses) CreateWebhookEndpointWithResponse

CreateWebhookEndpointWithResponse Create a webhook endpoint

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).

func (*ClientWithResponses) DeleteRoutingConfigWithResponse

func (c *ClientWithResponses) DeleteRoutingConfigWithResponse(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*DeleteRoutingConfigResponse, error)

DeleteRoutingConfigWithResponse Delete a routing config

Fails with `routing_config_in_use` if any number references it.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /routing_configs/{routing_config_id} (the `DeleteRoutingConfig` operationId).

func (*ClientWithResponses) DeleteTenantWithResponse

func (c *ClientWithResponses) DeleteTenantWithResponse(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*DeleteTenantResponse, error)

DeleteTenantWithResponse Delete a tenant

Releases the tenant's phone numbers and deactivates its campaigns. Message and call history is retained per your data-retention settings.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /tenants/{tenant_id} (the `DeleteTenant` operationId).

func (*ClientWithResponses) DeleteWebhookEndpointWithResponse

func (c *ClientWithResponses) DeleteWebhookEndpointWithResponse(ctx context.Context, endpointId string, reqEditors ...RequestEditorFn) (*DeleteWebhookEndpointResponse, error)

DeleteWebhookEndpointWithResponse Delete a webhook endpoint

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /webhook_endpoints/{endpoint_id} (the `DeleteWebhookEndpoint` operationId).

func (*ClientWithResponses) GatherCallDigitsWithBodyWithResponse

func (c *ClientWithResponses) GatherCallDigitsWithBodyWithResponse(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GatherCallDigitsResponse, error)

GatherCallDigitsWithBodyWithResponse Ask the remote party a keypad question

Speaks `prompt` as text-to-speech and collects keypresses from the call's remote party. Each keypress fires a `call.dtmf` webhook; the collected result arrives as a `call.gather` webhook with `digits` and a `reason` of `completed`, `timeout`, or `hangup`. The call must be in progress. In test mode the simulated party presses `1` about 1.5 s after the prompt (calls to +15005550007 never press anything and time out).

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).

func (*ClientWithResponses) GatherCallDigitsWithResponse

func (c *ClientWithResponses) GatherCallDigitsWithResponse(ctx context.Context, callId string, body GatherCallDigitsJSONRequestBody, reqEditors ...RequestEditorFn) (*GatherCallDigitsResponse, error)

GatherCallDigitsWithResponse Ask the remote party a keypad question

Speaks `prompt` as text-to-speech and collects keypresses from the call's remote party. Each keypress fires a `call.dtmf` webhook; the collected result arrives as a `call.gather` webhook with `digits` and a `reason` of `completed`, `timeout`, or `hangup`. The call must be in progress. In test mode the simulated party presses `1` about 1.5 s after the prompt (calls to +15005550007 never press anything and time out).

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).

func (*ClientWithResponses) GetBrandWithResponse

func (c *ClientWithResponses) GetBrandWithResponse(ctx context.Context, brandId string, reqEditors ...RequestEditorFn) (*GetBrandResponse, error)

GetBrandWithResponse Retrieve a brand

Returns a wrapper object for the known response body format(s).

Corresponds with GET /brands/{brand_id} (the `GetBrand` operationId).

func (*ClientWithResponses) GetCallTranscriptWithResponse

func (c *ClientWithResponses) GetCallTranscriptWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*GetCallTranscriptResponse, error)

GetCallTranscriptWithResponse Retrieve a call's live transcript

The transcript so far — callable mid-call. Segments are final utterances in order; `text` is the full conversation joined.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /calls/{call_id}/transcript (the `GetCallTranscript` operationId).

func (*ClientWithResponses) GetCallWithResponse

func (c *ClientWithResponses) GetCallWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*GetCallResponse, error)

GetCallWithResponse Retrieve a call

Returns a wrapper object for the known response body format(s).

Corresponds with GET /calls/{call_id} (the `GetCall` operationId).

func (*ClientWithResponses) GetCampaignWithResponse

func (c *ClientWithResponses) GetCampaignWithResponse(ctx context.Context, campaignId string, reqEditors ...RequestEditorFn) (*GetCampaignResponse, error)

GetCampaignWithResponse Retrieve a campaign

Returns a wrapper object for the known response body format(s).

Corresponds with GET /campaigns/{campaign_id} (the `GetCampaign` operationId).

func (*ClientWithResponses) GetConversationWithResponse

func (c *ClientWithResponses) GetConversationWithResponse(ctx context.Context, conversationId string, reqEditors ...RequestEditorFn) (*GetConversationResponse, error)

GetConversationWithResponse Retrieve a conversation

Returns a wrapper object for the known response body format(s).

Corresponds with GET /conversations/{conversation_id} (the `GetConversation` operationId).

func (*ClientWithResponses) GetMessageStatsWithResponse added in v0.12.0

func (c *ClientWithResponses) GetMessageStatsWithResponse(ctx context.Context, params *GetMessageStatsParams, reqEditors ...RequestEditorFn) (*GetMessageStatsResponse, error)

GetMessageStatsWithResponse Outbound deliverability stats

Delivery rate and failure-reason breakdown for outbound messages over a window, aggregated from the messages table. Defaults to the last 30 days. `delivery_rate` is delivered / (delivered + failed); in-flight messages (`sent`, `pending`) are excluded from that ratio.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /messages/stats (the `GetMessageStats` operationId).

func (*ClientWithResponses) GetMessageWithResponse

func (c *ClientWithResponses) GetMessageWithResponse(ctx context.Context, messageId string, reqEditors ...RequestEditorFn) (*GetMessageResponse, error)

GetMessageWithResponse Retrieve a message

Returns a wrapper object for the known response body format(s).

Corresponds with GET /messages/{message_id} (the `GetMessage` operationId).

func (*ClientWithResponses) GetNumberWithResponse

func (c *ClientWithResponses) GetNumberWithResponse(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*GetNumberResponse, error)

GetNumberWithResponse Retrieve a phone number

Returns a wrapper object for the known response body format(s).

Corresponds with GET /phone_numbers/{number_id} (the `GetNumber` operationId).

func (*ClientWithResponses) GetPortInWithResponse

func (c *ClientWithResponses) GetPortInWithResponse(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*GetPortInResponse, error)

GetPortInWithResponse Get a port-in

Returns a wrapper object for the known response body format(s).

Corresponds with GET /port_ins/{port_in_id} (the `GetPortIn` operationId).

func (*ClientWithResponses) GetRecordingWithResponse

func (c *ClientWithResponses) GetRecordingWithResponse(ctx context.Context, recordingId string, reqEditors ...RequestEditorFn) (*GetRecordingResponse, error)

GetRecordingWithResponse Retrieve a call recording

Returns a wrapper object for the known response body format(s).

Corresponds with GET /recordings/{recording_id} (the `GetRecording` operationId).

func (*ClientWithResponses) GetRoutingConfigWithResponse

func (c *ClientWithResponses) GetRoutingConfigWithResponse(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*GetRoutingConfigResponse, error)

GetRoutingConfigWithResponse Retrieve a routing config

Returns a wrapper object for the known response body format(s).

Corresponds with GET /routing_configs/{routing_config_id} (the `GetRoutingConfig` operationId).

func (*ClientWithResponses) GetTenantWithResponse

func (c *ClientWithResponses) GetTenantWithResponse(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*GetTenantResponse, error)

GetTenantWithResponse Retrieve a tenant

Returns a wrapper object for the known response body format(s).

Corresponds with GET /tenants/{tenant_id} (the `GetTenant` operationId).

func (*ClientWithResponses) GetUsageWithResponse

func (c *ClientWithResponses) GetUsageWithResponse(ctx context.Context, params *GetUsageParams, reqEditors ...RequestEditorFn) (*GetUsageResponse, error)

GetUsageWithResponse Usage summary

Totals the account's billable usage by kind over `[start, end)` for the key's mode. Live and test ledgers are separate; only live usage is invoiced.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /usage (the `GetUsage` operationId).

func (*ClientWithResponses) GetVoicemailWithResponse

func (c *ClientWithResponses) GetVoicemailWithResponse(ctx context.Context, voicemailId string, reqEditors ...RequestEditorFn) (*GetVoicemailResponse, error)

GetVoicemailWithResponse Retrieve a voicemail

Returns a wrapper object for the known response body format(s).

Corresponds with GET /voicemails/{voicemail_id} (the `GetVoicemail` operationId).

func (*ClientWithResponses) GetWebClientWithResponse

func (c *ClientWithResponses) GetWebClientWithResponse(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*GetWebClientResponse, error)

GetWebClientWithResponse Retrieve a web client

Returns a wrapper object for the known response body format(s).

Corresponds with GET /web_clients/{web_client_id} (the `GetWebClient` operationId).

func (*ClientWithResponses) ListBrandsWithResponse

func (c *ClientWithResponses) ListBrandsWithResponse(ctx context.Context, params *ListBrandsParams, reqEditors ...RequestEditorFn) (*ListBrandsResponse, error)

ListBrandsWithResponse List brands

Returns a wrapper object for the known response body format(s).

Corresponds with GET /brands (the `ListBrands` operationId).

func (*ClientWithResponses) ListCallStreamsWithResponse

func (c *ClientWithResponses) ListCallStreamsWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*ListCallStreamsResponse, error)

ListCallStreamsWithResponse List a call's streams

Returns a wrapper object for the known response body format(s).

Corresponds with GET /calls/{call_id}/streams (the `ListCallStreams` operationId).

func (*ClientWithResponses) ListCallsWithResponse

func (c *ClientWithResponses) ListCallsWithResponse(ctx context.Context, params *ListCallsParams, reqEditors ...RequestEditorFn) (*ListCallsResponse, error)

ListCallsWithResponse List calls

Returns a wrapper object for the known response body format(s).

Corresponds with GET /calls (the `ListCalls` operationId).

func (*ClientWithResponses) ListCampaignsWithResponse

func (c *ClientWithResponses) ListCampaignsWithResponse(ctx context.Context, params *ListCampaignsParams, reqEditors ...RequestEditorFn) (*ListCampaignsResponse, error)

ListCampaignsWithResponse List campaigns

Returns a wrapper object for the known response body format(s).

Corresponds with GET /campaigns (the `ListCampaigns` operationId).

func (*ClientWithResponses) ListConversationsWithResponse

func (c *ClientWithResponses) ListConversationsWithResponse(ctx context.Context, params *ListConversationsParams, reqEditors ...RequestEditorFn) (*ListConversationsResponse, error)

ListConversationsWithResponse List conversations

A conversation is the thread between one tenant number and one external number, ordered by most recent activity.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /conversations (the `ListConversations` operationId).

func (*ClientWithResponses) ListE911AddressesWithResponse

func (c *ClientWithResponses) ListE911AddressesWithResponse(ctx context.Context, params *ListE911AddressesParams, reqEditors ...RequestEditorFn) (*ListE911AddressesResponse, error)

ListE911AddressesWithResponse List E911 addresses

Returns a wrapper object for the known response body format(s).

Corresponds with GET /e911_addresses (the `ListE911Addresses` operationId).

func (*ClientWithResponses) ListMessagesWithResponse

func (c *ClientWithResponses) ListMessagesWithResponse(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*ListMessagesResponse, error)

ListMessagesWithResponse List messages

Returns a wrapper object for the known response body format(s).

Corresponds with GET /messages (the `ListMessages` operationId).

func (*ClientWithResponses) ListNumbersWithResponse

func (c *ClientWithResponses) ListNumbersWithResponse(ctx context.Context, params *ListNumbersParams, reqEditors ...RequestEditorFn) (*ListNumbersResponse, error)

ListNumbersWithResponse List phone numbers

Returns a wrapper object for the known response body format(s).

Corresponds with GET /phone_numbers (the `ListNumbers` operationId).

func (*ClientWithResponses) ListOptOutsWithResponse

func (c *ClientWithResponses) ListOptOutsWithResponse(ctx context.Context, params *ListOptOutsParams, reqEditors ...RequestEditorFn) (*ListOptOutsResponse, error)

ListOptOutsWithResponse List opted-out recipients

Recipients who sent STOP to a tenant's numbers. Handset blocks sends to them automatically; this endpoint exists so your UI can show why.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /opt_outs (the `ListOptOuts` operationId).

func (*ClientWithResponses) ListPortInsWithResponse

func (c *ClientWithResponses) ListPortInsWithResponse(ctx context.Context, params *ListPortInsParams, reqEditors ...RequestEditorFn) (*ListPortInsResponse, error)

ListPortInsWithResponse List port-ins

Returns a wrapper object for the known response body format(s).

Corresponds with GET /port_ins (the `ListPortIns` operationId).

func (*ClientWithResponses) ListRoutingConfigsWithResponse

func (c *ClientWithResponses) ListRoutingConfigsWithResponse(ctx context.Context, params *ListRoutingConfigsParams, reqEditors ...RequestEditorFn) (*ListRoutingConfigsResponse, error)

ListRoutingConfigsWithResponse List routing configs

Returns a wrapper object for the known response body format(s).

Corresponds with GET /routing_configs (the `ListRoutingConfigs` operationId).

func (*ClientWithResponses) ListTenantsWithResponse

func (c *ClientWithResponses) ListTenantsWithResponse(ctx context.Context, params *ListTenantsParams, reqEditors ...RequestEditorFn) (*ListTenantsResponse, error)

ListTenantsWithResponse List tenants

Returns a wrapper object for the known response body format(s).

Corresponds with GET /tenants (the `ListTenants` operationId).

func (*ClientWithResponses) ListVoicemailsWithResponse

func (c *ClientWithResponses) ListVoicemailsWithResponse(ctx context.Context, params *ListVoicemailsParams, reqEditors ...RequestEditorFn) (*ListVoicemailsResponse, error)

ListVoicemailsWithResponse List voicemails

Returns a wrapper object for the known response body format(s).

Corresponds with GET /voicemails (the `ListVoicemails` operationId).

func (*ClientWithResponses) ListWebClientsWithResponse

func (c *ClientWithResponses) ListWebClientsWithResponse(ctx context.Context, params *ListWebClientsParams, reqEditors ...RequestEditorFn) (*ListWebClientsResponse, error)

ListWebClientsWithResponse List web clients

Returns a wrapper object for the known response body format(s).

Corresponds with GET /web_clients (the `ListWebClients` operationId).

func (*ClientWithResponses) ListWebhookEndpointsWithResponse

func (c *ClientWithResponses) ListWebhookEndpointsWithResponse(ctx context.Context, params *ListWebhookEndpointsParams, reqEditors ...RequestEditorFn) (*ListWebhookEndpointsResponse, error)

ListWebhookEndpointsWithResponse List webhook endpoints

Returns a wrapper object for the known response body format(s).

Corresponds with GET /webhook_endpoints (the `ListWebhookEndpoints` operationId).

func (*ClientWithResponses) MintRealtimeTokenWithResponse

func (c *ClientWithResponses) MintRealtimeTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*MintRealtimeTokenResponse, error)

MintRealtimeTokenWithResponse Mint a realtime event-stream token

Returns a short-lived browser-safe token and the WebSocket `url` to connect it to (`wss://media.handset.dev/v1/events?token=…`). The socket pushes your account's events — the same envelopes your webhook endpoints receive — the moment they happen; tenant-scoped keys get only their tenant's events. Mint from your backend (your API key never reaches the browser) and re-mint on expiry; treat the stream as a low-latency refresh signal, with webhooks as the durable channel.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /realtime/tokens (the `MintRealtimeToken` operationId).

func (*ClientWithResponses) PurchaseNumberWithBodyWithResponse

func (c *ClientWithResponses) PurchaseNumberWithBodyWithResponse(ctx context.Context, params *PurchaseNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PurchaseNumberResponse, error)

PurchaseNumberWithBodyWithResponse Purchase a number for a tenant

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).

func (*ClientWithResponses) PurchaseNumberWithResponse

func (c *ClientWithResponses) PurchaseNumberWithResponse(ctx context.Context, params *PurchaseNumberParams, body PurchaseNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*PurchaseNumberResponse, error)

PurchaseNumberWithResponse Purchase a number for a tenant

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).

func (*ClientWithResponses) ReleaseNumberWithResponse

func (c *ClientWithResponses) ReleaseNumberWithResponse(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*ReleaseNumberResponse, error)

ReleaseNumberWithResponse Release a phone number

Releases the number back to inventory. Irreversible.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /phone_numbers/{number_id} (the `ReleaseNumber` operationId).

func (*ClientWithResponses) RevokeWebClientWithResponse

func (c *ClientWithResponses) RevokeWebClientWithResponse(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*RevokeWebClientResponse, error)

RevokeWebClientWithResponse Revoke a web client

Deletes the underlying credential — outstanding login tokens die with it and any registered browser session disconnects. Idempotent.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /web_clients/{web_client_id} (the `RevokeWebClient` operationId).

func (*ClientWithResponses) SearchAvailableNumbersWithResponse

func (c *ClientWithResponses) SearchAvailableNumbersWithResponse(ctx context.Context, params *SearchAvailableNumbersParams, reqEditors ...RequestEditorFn) (*SearchAvailableNumbersResponse, error)

SearchAvailableNumbersWithResponse Search purchasable numbers

Returns a wrapper object for the known response body format(s).

Corresponds with GET /phone_numbers/available (the `SearchAvailableNumbers` operationId).

func (*ClientWithResponses) SendCallDtmfWithBodyWithResponse

func (c *ClientWithResponses) SendCallDtmfWithBodyWithResponse(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendCallDtmfResponse, error)

SendCallDtmfWithBodyWithResponse Send DTMF digits on a call

Plays digits to the call's remote party — dial an extension, enter a conference PIN, navigate a phone tree. The call must be in progress. On outbound calls tones reach the `to` party; on inbound calls the original caller.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).

func (*ClientWithResponses) SendCallDtmfWithResponse

func (c *ClientWithResponses) SendCallDtmfWithResponse(ctx context.Context, callId string, body SendCallDtmfJSONRequestBody, reqEditors ...RequestEditorFn) (*SendCallDtmfResponse, error)

SendCallDtmfWithResponse Send DTMF digits on a call

Plays digits to the call's remote party — dial an extension, enter a conference PIN, navigate a phone tree. The call must be in progress. On outbound calls tones reach the `to` party; on inbound calls the original caller.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).

func (*ClientWithResponses) SendMessageWithBodyWithResponse

func (c *ClientWithResponses) SendMessageWithBodyWithResponse(ctx context.Context, params *SendMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendMessageResponse, error)

SendMessageWithBodyWithResponse Send an SMS/MMS

Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /messages (the `SendMessage` operationId).

func (*ClientWithResponses) SendMessageWithResponse

func (c *ClientWithResponses) SendMessageWithResponse(ctx context.Context, params *SendMessageParams, body SendMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SendMessageResponse, error)

SendMessageWithResponse Send an SMS/MMS

Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /messages (the `SendMessage` operationId).

func (*ClientWithResponses) StartCallTranscriptionWithResponse

func (c *ClientWithResponses) StartCallTranscriptionWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*StartCallTranscriptionResponse, error)

StartCallTranscriptionWithResponse Start live transcription mid-call

Turns on live speech-to-text for an in-progress call, either direction — each final utterance arrives as a `call.transcript` webhook and accumulates on `GET /calls/{call_id}/transcript`, and an AI summary generates after hangup (`call.summary`). This is the agent-assist switch for inbound calls; `transcribe: true` at creation remains the click-to-call shortcut. Idempotent — starting an already-transcribing call is a no-op. Runs until hangup; billed per transcribed minute on the call's connected time.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /calls/{call_id}/transcription (the `StartCallTranscription` operationId).

func (*ClientWithResponses) StopCallStreamWithResponse

func (c *ClientWithResponses) StopCallStreamWithResponse(ctx context.Context, callId string, streamId string, reqEditors ...RequestEditorFn) (*StopCallStreamResponse, error)

StopCallStreamWithResponse Stop a stream

Stops forking audio and settles billing. Idempotent — deleting an already-stopped stream returns its final state. Streams also end on their own when the call ends.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /calls/{call_id}/streams/{stream_id} (the `StopCallStream` operationId).

func (*ClientWithResponses) SubmitPortInWithResponse

func (c *ClientWithResponses) SubmitPortInWithResponse(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*SubmitPortInResponse, error)

SubmitPortInWithResponse Submit a port-in for carrier review

Moves a `draft` (or corrected `action_needed`) port-in into `in_review`. Status changes arrive as `port_in.status_changed` webhooks. In test mode the simulated carrier completes the whole lifecycle in under a minute.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /port_ins/{port_in_id}/submit (the `SubmitPortIn` operationId).

func (*ClientWithResponses) TestWebhookEndpointWithBodyWithResponse

func (c *ClientWithResponses) TestWebhookEndpointWithBodyWithResponse(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestWebhookEndpointResponse, error)

TestWebhookEndpointWithBodyWithResponse Send a test event

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).

func (*ClientWithResponses) TestWebhookEndpointWithResponse

func (c *ClientWithResponses) TestWebhookEndpointWithResponse(ctx context.Context, endpointId string, body TestWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*TestWebhookEndpointResponse, error)

TestWebhookEndpointWithResponse Send a test event

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).

func (*ClientWithResponses) UpdateNumberWithBodyWithResponse

func (c *ClientWithResponses) UpdateNumberWithBodyWithResponse(ctx context.Context, numberId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateNumberResponse, error)

UpdateNumberWithBodyWithResponse Update routing, campaign, or E911 for a number

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).

func (*ClientWithResponses) UpdateNumberWithResponse

func (c *ClientWithResponses) UpdateNumberWithResponse(ctx context.Context, numberId string, body UpdateNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateNumberResponse, error)

UpdateNumberWithResponse Update routing, campaign, or E911 for a number

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).

func (*ClientWithResponses) UpdateRoutingConfigWithBodyWithResponse

func (c *ClientWithResponses) UpdateRoutingConfigWithBodyWithResponse(ctx context.Context, routingConfigId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateRoutingConfigResponse, error)

UpdateRoutingConfigWithBodyWithResponse Update a routing config

Changes apply to new calls immediately.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).

func (*ClientWithResponses) UpdateRoutingConfigWithResponse

func (c *ClientWithResponses) UpdateRoutingConfigWithResponse(ctx context.Context, routingConfigId string, body UpdateRoutingConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateRoutingConfigResponse, error)

UpdateRoutingConfigWithResponse Update a routing config

Changes apply to new calls immediately.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).

func (*ClientWithResponses) UpdateTenantWithBodyWithResponse

func (c *ClientWithResponses) UpdateTenantWithBodyWithResponse(ctx context.Context, tenantId TenantId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error)

UpdateTenantWithBodyWithResponse Update a tenant

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).

func (*ClientWithResponses) UpdateTenantWithResponse

func (c *ClientWithResponses) UpdateTenantWithResponse(ctx context.Context, tenantId TenantId, body UpdateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error)

UpdateTenantWithResponse Update a tenant

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).

func (*ClientWithResponses) UpdateWebhookEndpointWithBodyWithResponse

func (c *ClientWithResponses) UpdateWebhookEndpointWithBodyWithResponse(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookEndpointResponse, error)

UpdateWebhookEndpointWithBodyWithResponse Update a webhook endpoint

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).

func (*ClientWithResponses) UpdateWebhookEndpointWithResponse

func (c *ClientWithResponses) UpdateWebhookEndpointWithResponse(ctx context.Context, endpointId string, body UpdateWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookEndpointResponse, error)

UpdateWebhookEndpointWithResponse Update a webhook endpoint

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// ListBrandsWithResponse List brands
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /brands (the `ListBrands` operationId).
	ListBrandsWithResponse(ctx context.Context, params *ListBrandsParams, reqEditors ...RequestEditorFn) (*ListBrandsResponse, error)

	// CreateBrandWithBodyWithResponse Register a 10DLC brand
	//
	// Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /brands (the `CreateBrand` operationId).
	CreateBrandWithBodyWithResponse(ctx context.Context, params *CreateBrandParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBrandResponse, error)

	// CreateBrandWithResponse Register a 10DLC brand
	//
	// Registers your platform (or a tenant, for tenants with their own EIN) with The Campaign Registry. Vetting typically takes minutes to days; track via `brand.status_changed`.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /brands (the `CreateBrand` operationId).
	CreateBrandWithResponse(ctx context.Context, params *CreateBrandParams, body CreateBrandJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBrandResponse, error)

	// GetBrandWithResponse Retrieve a brand
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /brands/{brand_id} (the `GetBrand` operationId).
	GetBrandWithResponse(ctx context.Context, brandId string, reqEditors ...RequestEditorFn) (*GetBrandResponse, error)

	// ListCallsWithResponse List calls
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /calls (the `ListCalls` operationId).
	ListCallsWithResponse(ctx context.Context, params *ListCallsParams, reqEditors ...RequestEditorFn) (*ListCallsResponse, error)

	// CreateCallWithBodyWithResponse Start a click-to-call
	//
	// Dials `connect_to` (the agent) from the tenant's number; when they
	// answer, dials `to` (the customer) showing the same tenant number,
	// and bridges the two. Track progress via `call.completed` webhooks or
	// by polling: `dialing` → `ringing` → `in_progress` → `completed`
	// (`failed` if either side never answers). In test mode the simulated
	// parties answer within seconds and the call auto-completes.
	//
	// A small set of US rural exchanges known for access stimulation
	// (traffic pumping) can't be dialed from any leg — such requests
	// return `destination_not_supported`.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls (the `CreateCall` operationId).
	CreateCallWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCallResponse, error)

	// CreateCallWithResponse Start a click-to-call
	//
	// Dials `connect_to` (the agent) from the tenant's number; when they
	// answer, dials `to` (the customer) showing the same tenant number,
	// and bridges the two. Track progress via `call.completed` webhooks or
	// by polling: `dialing` → `ringing` → `in_progress` → `completed`
	// (`failed` if either side never answers). In test mode the simulated
	// parties answer within seconds and the call auto-completes.
	//
	// A small set of US rural exchanges known for access stimulation
	// (traffic pumping) can't be dialed from any leg — such requests
	// return `destination_not_supported`.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls (the `CreateCall` operationId).
	CreateCallWithResponse(ctx context.Context, body CreateCallJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCallResponse, error)

	// GetCallWithResponse Retrieve a call
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /calls/{call_id} (the `GetCall` operationId).
	GetCallWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*GetCallResponse, error)

	// SendCallDtmfWithBodyWithResponse Send DTMF digits on a call
	//
	// Plays digits to the call's remote party — dial an extension, enter a
	// conference PIN, navigate a phone tree. The call must be in progress.
	// On outbound calls tones reach the `to` party; on inbound calls the
	// original caller.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).
	SendCallDtmfWithBodyWithResponse(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendCallDtmfResponse, error)

	// SendCallDtmfWithResponse Send DTMF digits on a call
	//
	// Plays digits to the call's remote party — dial an extension, enter a
	// conference PIN, navigate a phone tree. The call must be in progress.
	// On outbound calls tones reach the `to` party; on inbound calls the
	// original caller.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls/{call_id}/dtmf (the `SendCallDtmf` operationId).
	SendCallDtmfWithResponse(ctx context.Context, callId string, body SendCallDtmfJSONRequestBody, reqEditors ...RequestEditorFn) (*SendCallDtmfResponse, error)

	// GatherCallDigitsWithBodyWithResponse Ask the remote party a keypad question
	//
	// Speaks `prompt` as text-to-speech and collects keypresses from the
	// call's remote party. Each keypress fires a `call.dtmf` webhook; the
	// collected result arrives as a `call.gather` webhook with `digits`
	// and a `reason` of `completed`, `timeout`, or `hangup`. The call must
	// be in progress. In test mode the simulated party presses `1` about
	// 1.5 s after the prompt (calls to +15005550007 never press anything
	// and time out).
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).
	GatherCallDigitsWithBodyWithResponse(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GatherCallDigitsResponse, error)

	// GatherCallDigitsWithResponse Ask the remote party a keypad question
	//
	// Speaks `prompt` as text-to-speech and collects keypresses from the
	// call's remote party. Each keypress fires a `call.dtmf` webhook; the
	// collected result arrives as a `call.gather` webhook with `digits`
	// and a `reason` of `completed`, `timeout`, or `hangup`. The call must
	// be in progress. In test mode the simulated party presses `1` about
	// 1.5 s after the prompt (calls to +15005550007 never press anything
	// and time out).
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls/{call_id}/gather (the `GatherCallDigits` operationId).
	GatherCallDigitsWithResponse(ctx context.Context, callId string, body GatherCallDigitsJSONRequestBody, reqEditors ...RequestEditorFn) (*GatherCallDigitsResponse, error)

	// ListCallStreamsWithResponse List a call's streams
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /calls/{call_id}/streams (the `ListCallStreams` operationId).
	ListCallStreamsWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*ListCallStreamsResponse, error)

	// CreateCallStreamWithBodyWithResponse Stream the call's audio in real time
	//
	// Forks the call's audio to a WebSocket on the media gateway
	// (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the
	// returned `url` with the returned `token` (`?token=…` or an
	// `Authorization: Bearer` header) — the token is shown exactly once.
	// Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1,
	// "timestamp_ms":840,"payload":"<base64 pcmu>"}`.
	//
	// `direction: bidirectional` also plays audio you send on the same
	// socket into the call (`{"event":"media","payload":…}`; send
	// `{"event":"clear"}` to flush queued playback) — the substrate for
	// AI voice agents. The call must be ringing or in progress; one
	// active stream per call. Billed per connected minute
	// (`stream_minute`). In test mode the simulated carrier streams a
	// pulsing 440 Hz tone on the inbound track and echoes your playback
	// on the outbound track; calls to +15005550008 fail to stream.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).
	CreateCallStreamWithBodyWithResponse(ctx context.Context, callId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCallStreamResponse, error)

	// CreateCallStreamWithResponse Stream the call's audio in real time
	//
	// Forks the call's audio to a WebSocket on the media gateway
	// (`media.handset.dev`) as ~20 ms G.711 μ-law frames. Connect to the
	// returned `url` with the returned `token` (`?token=…` or an
	// `Authorization: Bearer` header) — the token is shown exactly once.
	// Frames arrive as JSON: `{"event":"media","track":"inbound","seq":1,
	// "timestamp_ms":840,"payload":"<base64 pcmu>"}`.
	//
	// `direction: bidirectional` also plays audio you send on the same
	// socket into the call (`{"event":"media","payload":…}`; send
	// `{"event":"clear"}` to flush queued playback) — the substrate for
	// AI voice agents. The call must be ringing or in progress; one
	// active stream per call. Billed per connected minute
	// (`stream_minute`). In test mode the simulated carrier streams a
	// pulsing 440 Hz tone on the inbound track and echoes your playback
	// on the outbound track; calls to +15005550008 fail to stream.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls/{call_id}/streams (the `CreateCallStream` operationId).
	CreateCallStreamWithResponse(ctx context.Context, callId string, body CreateCallStreamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCallStreamResponse, error)

	// StopCallStreamWithResponse Stop a stream
	//
	// Stops forking audio and settles billing. Idempotent — deleting an already-stopped stream returns its final state. Streams also end on their own when the call ends.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /calls/{call_id}/streams/{stream_id} (the `StopCallStream` operationId).
	StopCallStreamWithResponse(ctx context.Context, callId string, streamId string, reqEditors ...RequestEditorFn) (*StopCallStreamResponse, error)

	// GetCallTranscriptWithResponse Retrieve a call's live transcript
	//
	// The transcript so far — callable mid-call. Segments are final
	// utterances in order; `text` is the full conversation joined.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /calls/{call_id}/transcript (the `GetCallTranscript` operationId).
	GetCallTranscriptWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*GetCallTranscriptResponse, error)

	// StartCallTranscriptionWithResponse Start live transcription mid-call
	//
	// Turns on live speech-to-text for an in-progress call, either
	// direction — each final utterance arrives as a `call.transcript`
	// webhook and accumulates on `GET /calls/{call_id}/transcript`, and
	// an AI summary generates after hangup (`call.summary`). This is the
	// agent-assist switch for inbound calls; `transcribe: true` at
	// creation remains the click-to-call shortcut. Idempotent — starting
	// an already-transcribing call is a no-op. Runs until hangup; billed
	// per transcribed minute on the call's connected time.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /calls/{call_id}/transcription (the `StartCallTranscription` operationId).
	StartCallTranscriptionWithResponse(ctx context.Context, callId string, reqEditors ...RequestEditorFn) (*StartCallTranscriptionResponse, error)

	// ListCampaignsWithResponse List campaigns
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /campaigns (the `ListCampaigns` operationId).
	ListCampaignsWithResponse(ctx context.Context, params *ListCampaignsParams, reqEditors ...RequestEditorFn) (*ListCampaignsResponse, error)

	// CreateCampaignWithBodyWithResponse Register a 10DLC campaign
	//
	// Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /campaigns (the `CreateCampaign` operationId).
	CreateCampaignWithBodyWithResponse(ctx context.Context, params *CreateCampaignParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateCampaignResponse, error)

	// CreateCampaignWithResponse Register a 10DLC campaign
	//
	// Registers a messaging use case under an approved brand for a tenant. Carrier review typically takes 1–3 business days; sending is blocked until status is `approved`. Track via `campaign.status_changed`.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /campaigns (the `CreateCampaign` operationId).
	CreateCampaignWithResponse(ctx context.Context, params *CreateCampaignParams, body CreateCampaignJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateCampaignResponse, error)

	// GetCampaignWithResponse Retrieve a campaign
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /campaigns/{campaign_id} (the `GetCampaign` operationId).
	GetCampaignWithResponse(ctx context.Context, campaignId string, reqEditors ...RequestEditorFn) (*GetCampaignResponse, error)

	// ListConversationsWithResponse List conversations
	//
	// A conversation is the thread between one tenant number and one external number, ordered by most recent activity.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /conversations (the `ListConversations` operationId).
	ListConversationsWithResponse(ctx context.Context, params *ListConversationsParams, reqEditors ...RequestEditorFn) (*ListConversationsResponse, error)

	// GetConversationWithResponse Retrieve a conversation
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /conversations/{conversation_id} (the `GetConversation` operationId).
	GetConversationWithResponse(ctx context.Context, conversationId string, reqEditors ...RequestEditorFn) (*GetConversationResponse, error)

	// ListE911AddressesWithResponse List E911 addresses
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /e911_addresses (the `ListE911Addresses` operationId).
	ListE911AddressesWithResponse(ctx context.Context, params *ListE911AddressesParams, reqEditors ...RequestEditorFn) (*ListE911AddressesResponse, error)

	// CreateE911AddressWithBodyWithResponse Validate and register an E911 address
	//
	// Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).
	CreateE911AddressWithBodyWithResponse(ctx context.Context, params *CreateE911AddressParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateE911AddressResponse, error)

	// CreateE911AddressWithResponse Validate and register an E911 address
	//
	// Validates a dispatchable location and registers it for use with a tenant's numbers. Returns `e911_address_invalid` with correction suggestions when validation fails.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /e911_addresses (the `CreateE911Address` operationId).
	CreateE911AddressWithResponse(ctx context.Context, params *CreateE911AddressParams, body CreateE911AddressJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateE911AddressResponse, error)

	// ListMessagesWithResponse List messages
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /messages (the `ListMessages` operationId).
	ListMessagesWithResponse(ctx context.Context, params *ListMessagesParams, reqEditors ...RequestEditorFn) (*ListMessagesResponse, error)

	// SendMessageWithBodyWithResponse Send an SMS/MMS
	//
	// Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /messages (the `SendMessage` operationId).
	SendMessageWithBodyWithResponse(ctx context.Context, params *SendMessageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendMessageResponse, error)

	// SendMessageWithResponse Send an SMS/MMS
	//
	// Sends from a tenant-owned number. Fails with `campaign_not_approved` if the number lacks an approved 10DLC campaign, and with `recipient_opted_out` if the recipient previously sent STOP.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /messages (the `SendMessage` operationId).
	SendMessageWithResponse(ctx context.Context, params *SendMessageParams, body SendMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SendMessageResponse, error)

	// GetMessageStatsWithResponse Outbound deliverability stats
	//
	// Delivery rate and failure-reason breakdown for outbound messages over a window, aggregated from the messages table. Defaults to the last 30 days. `delivery_rate` is delivered / (delivered + failed); in-flight messages (`sent`, `pending`) are excluded from that ratio.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /messages/stats (the `GetMessageStats` operationId).
	GetMessageStatsWithResponse(ctx context.Context, params *GetMessageStatsParams, reqEditors ...RequestEditorFn) (*GetMessageStatsResponse, error)

	// GetMessageWithResponse Retrieve a message
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /messages/{message_id} (the `GetMessage` operationId).
	GetMessageWithResponse(ctx context.Context, messageId string, reqEditors ...RequestEditorFn) (*GetMessageResponse, error)

	// ListOptOutsWithResponse List opted-out recipients
	//
	// Recipients who sent STOP to a tenant's numbers. Handset blocks sends to them automatically; this endpoint exists so your UI can show why.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /opt_outs (the `ListOptOuts` operationId).
	ListOptOutsWithResponse(ctx context.Context, params *ListOptOutsParams, reqEditors ...RequestEditorFn) (*ListOptOutsResponse, error)

	// ListNumbersWithResponse List phone numbers
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /phone_numbers (the `ListNumbers` operationId).
	ListNumbersWithResponse(ctx context.Context, params *ListNumbersParams, reqEditors ...RequestEditorFn) (*ListNumbersResponse, error)

	// PurchaseNumberWithBodyWithResponse Purchase a number for a tenant
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).
	PurchaseNumberWithBodyWithResponse(ctx context.Context, params *PurchaseNumberParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PurchaseNumberResponse, error)

	// PurchaseNumberWithResponse Purchase a number for a tenant
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /phone_numbers (the `PurchaseNumber` operationId).
	PurchaseNumberWithResponse(ctx context.Context, params *PurchaseNumberParams, body PurchaseNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*PurchaseNumberResponse, error)

	// SearchAvailableNumbersWithResponse Search purchasable numbers
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /phone_numbers/available (the `SearchAvailableNumbers` operationId).
	SearchAvailableNumbersWithResponse(ctx context.Context, params *SearchAvailableNumbersParams, reqEditors ...RequestEditorFn) (*SearchAvailableNumbersResponse, error)

	// ReleaseNumberWithResponse Release a phone number
	//
	// Releases the number back to inventory. Irreversible.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /phone_numbers/{number_id} (the `ReleaseNumber` operationId).
	ReleaseNumberWithResponse(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*ReleaseNumberResponse, error)

	// GetNumberWithResponse Retrieve a phone number
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /phone_numbers/{number_id} (the `GetNumber` operationId).
	GetNumberWithResponse(ctx context.Context, numberId string, reqEditors ...RequestEditorFn) (*GetNumberResponse, error)

	// UpdateNumberWithBodyWithResponse Update routing, campaign, or E911 for a number
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).
	UpdateNumberWithBodyWithResponse(ctx context.Context, numberId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateNumberResponse, error)

	// UpdateNumberWithResponse Update routing, campaign, or E911 for a number
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /phone_numbers/{number_id} (the `UpdateNumber` operationId).
	UpdateNumberWithResponse(ctx context.Context, numberId string, body UpdateNumberJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateNumberResponse, error)

	// ListPortInsWithResponse List port-ins
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /port_ins (the `ListPortIns` operationId).
	ListPortInsWithResponse(ctx context.Context, params *ListPortInsParams, reqEditors ...RequestEditorFn) (*ListPortInsResponse, error)

	// CreatePortInWithBodyWithResponse Create a port-in
	//
	// Opens a draft port-in carrying the numbers and the account details as
	// they appear at the losing carrier. Fails with `numbers_not_portable`
	// if any number can't be ported. Call `submit` to start carrier review.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /port_ins (the `CreatePortIn` operationId).
	CreatePortInWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePortInResponse, error)

	// CreatePortInWithResponse Create a port-in
	//
	// Opens a draft port-in carrying the numbers and the account details as
	// they appear at the losing carrier. Fails with `numbers_not_portable`
	// if any number can't be ported. Call `submit` to start carrier review.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /port_ins (the `CreatePortIn` operationId).
	CreatePortInWithResponse(ctx context.Context, body CreatePortInJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePortInResponse, error)

	// CheckPortabilityWithBodyWithResponse Check portability
	//
	// Ask, per number, whether it can be ported in. Free and side-effect-free.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /port_ins/check (the `CheckPortability` operationId).
	CheckPortabilityWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CheckPortabilityResponse, error)

	// CheckPortabilityWithResponse Check portability
	//
	// Ask, per number, whether it can be ported in. Free and side-effect-free.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /port_ins/check (the `CheckPortability` operationId).
	CheckPortabilityWithResponse(ctx context.Context, body CheckPortabilityJSONRequestBody, reqEditors ...RequestEditorFn) (*CheckPortabilityResponse, error)

	// GetPortInWithResponse Get a port-in
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /port_ins/{port_in_id} (the `GetPortIn` operationId).
	GetPortInWithResponse(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*GetPortInResponse, error)

	// CancelPortInWithResponse Cancel a port-in
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /port_ins/{port_in_id}/cancel (the `CancelPortIn` operationId).
	CancelPortInWithResponse(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*CancelPortInResponse, error)

	// SubmitPortInWithResponse Submit a port-in for carrier review
	//
	// Moves a `draft` (or corrected `action_needed`) port-in into
	// `in_review`. Status changes arrive as `port_in.status_changed`
	// webhooks. In test mode the simulated carrier completes the whole
	// lifecycle in under a minute.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /port_ins/{port_in_id}/submit (the `SubmitPortIn` operationId).
	SubmitPortInWithResponse(ctx context.Context, portInId string, reqEditors ...RequestEditorFn) (*SubmitPortInResponse, error)

	// MintRealtimeTokenWithResponse Mint a realtime event-stream token
	//
	// Returns a short-lived browser-safe token and the WebSocket `url` to
	// connect it to (`wss://media.handset.dev/v1/events?token=…`). The
	// socket pushes your account's events — the same envelopes your
	// webhook endpoints receive — the moment they happen; tenant-scoped
	// keys get only their tenant's events. Mint from your backend (your
	// API key never reaches the browser) and re-mint on expiry; treat the
	// stream as a low-latency refresh signal, with webhooks as the
	// durable channel.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /realtime/tokens (the `MintRealtimeToken` operationId).
	MintRealtimeTokenWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*MintRealtimeTokenResponse, error)

	// GetRecordingWithResponse Retrieve a call recording
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /recordings/{recording_id} (the `GetRecording` operationId).
	GetRecordingWithResponse(ctx context.Context, recordingId string, reqEditors ...RequestEditorFn) (*GetRecordingResponse, error)

	// ListRoutingConfigsWithResponse List routing configs
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /routing_configs (the `ListRoutingConfigs` operationId).
	ListRoutingConfigsWithResponse(ctx context.Context, params *ListRoutingConfigsParams, reqEditors ...RequestEditorFn) (*ListRoutingConfigsResponse, error)

	// CreateRoutingConfigWithBodyWithResponse Create a routing config
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).
	CreateRoutingConfigWithBodyWithResponse(ctx context.Context, params *CreateRoutingConfigParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateRoutingConfigResponse, error)

	// CreateRoutingConfigWithResponse Create a routing config
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /routing_configs (the `CreateRoutingConfig` operationId).
	CreateRoutingConfigWithResponse(ctx context.Context, params *CreateRoutingConfigParams, body CreateRoutingConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateRoutingConfigResponse, error)

	// DeleteRoutingConfigWithResponse Delete a routing config
	//
	// Fails with `routing_config_in_use` if any number references it.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /routing_configs/{routing_config_id} (the `DeleteRoutingConfig` operationId).
	DeleteRoutingConfigWithResponse(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*DeleteRoutingConfigResponse, error)

	// GetRoutingConfigWithResponse Retrieve a routing config
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /routing_configs/{routing_config_id} (the `GetRoutingConfig` operationId).
	GetRoutingConfigWithResponse(ctx context.Context, routingConfigId string, reqEditors ...RequestEditorFn) (*GetRoutingConfigResponse, error)

	// UpdateRoutingConfigWithBodyWithResponse Update a routing config
	//
	// Changes apply to new calls immediately.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).
	UpdateRoutingConfigWithBodyWithResponse(ctx context.Context, routingConfigId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateRoutingConfigResponse, error)

	// UpdateRoutingConfigWithResponse Update a routing config
	//
	// Changes apply to new calls immediately.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /routing_configs/{routing_config_id} (the `UpdateRoutingConfig` operationId).
	UpdateRoutingConfigWithResponse(ctx context.Context, routingConfigId string, body UpdateRoutingConfigJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateRoutingConfigResponse, error)

	// ListTenantsWithResponse List tenants
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /tenants (the `ListTenants` operationId).
	ListTenantsWithResponse(ctx context.Context, params *ListTenantsParams, reqEditors ...RequestEditorFn) (*ListTenantsResponse, error)

	// CreateTenantWithBodyWithResponse Create a tenant
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /tenants (the `CreateTenant` operationId).
	CreateTenantWithBodyWithResponse(ctx context.Context, params *CreateTenantParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error)

	// CreateTenantWithResponse Create a tenant
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /tenants (the `CreateTenant` operationId).
	CreateTenantWithResponse(ctx context.Context, params *CreateTenantParams, body CreateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTenantResponse, error)

	// DeleteTenantWithResponse Delete a tenant
	//
	// Releases the tenant's phone numbers and deactivates its campaigns. Message and call history is retained per your data-retention settings.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /tenants/{tenant_id} (the `DeleteTenant` operationId).
	DeleteTenantWithResponse(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*DeleteTenantResponse, error)

	// GetTenantWithResponse Retrieve a tenant
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /tenants/{tenant_id} (the `GetTenant` operationId).
	GetTenantWithResponse(ctx context.Context, tenantId TenantId, reqEditors ...RequestEditorFn) (*GetTenantResponse, error)

	// UpdateTenantWithBodyWithResponse Update a tenant
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).
	UpdateTenantWithBodyWithResponse(ctx context.Context, tenantId TenantId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error)

	// UpdateTenantWithResponse Update a tenant
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /tenants/{tenant_id} (the `UpdateTenant` operationId).
	UpdateTenantWithResponse(ctx context.Context, tenantId TenantId, body UpdateTenantJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTenantResponse, error)

	// GetUsageWithResponse Usage summary
	//
	// Totals the account's billable usage by kind over `[start, end)` for the key's mode. Live and test ledgers are separate; only live usage is invoiced.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /usage (the `GetUsage` operationId).
	GetUsageWithResponse(ctx context.Context, params *GetUsageParams, reqEditors ...RequestEditorFn) (*GetUsageResponse, error)

	// ListVoicemailsWithResponse List voicemails
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /voicemails (the `ListVoicemails` operationId).
	ListVoicemailsWithResponse(ctx context.Context, params *ListVoicemailsParams, reqEditors ...RequestEditorFn) (*ListVoicemailsResponse, error)

	// GetVoicemailWithResponse Retrieve a voicemail
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /voicemails/{voicemail_id} (the `GetVoicemail` operationId).
	GetVoicemailWithResponse(ctx context.Context, voicemailId string, reqEditors ...RequestEditorFn) (*GetVoicemailResponse, error)

	// ListWebClientsWithResponse List web clients
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /web_clients (the `ListWebClients` operationId).
	ListWebClientsWithResponse(ctx context.Context, params *ListWebClientsParams, reqEditors ...RequestEditorFn) (*ListWebClientsResponse, error)

	// CreateWebClientWithBodyWithResponse Create a web client
	//
	// Provisions a browser softphone endpoint (one SIP credential). Create
	// one per agent seat — credentials must not be shared across concurrent
	// devices. The browser never sees the credential: mint short-lived
	// login tokens server-side via `POST /web_clients/{id}/tokens` and hand
	// only the token to the page. Freshly created clients can take a few
	// seconds to accept their first login.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /web_clients (the `CreateWebClient` operationId).
	CreateWebClientWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebClientResponse, error)

	// CreateWebClientWithResponse Create a web client
	//
	// Provisions a browser softphone endpoint (one SIP credential). Create
	// one per agent seat — credentials must not be shared across concurrent
	// devices. The browser never sees the credential: mint short-lived
	// login tokens server-side via `POST /web_clients/{id}/tokens` and hand
	// only the token to the page. Freshly created clients can take a few
	// seconds to accept their first login.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /web_clients (the `CreateWebClient` operationId).
	CreateWebClientWithResponse(ctx context.Context, body CreateWebClientJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebClientResponse, error)

	// RevokeWebClientWithResponse Revoke a web client
	//
	// Deletes the underlying credential — outstanding login tokens die with
	// it and any registered browser session disconnects. Idempotent.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /web_clients/{web_client_id} (the `RevokeWebClient` operationId).
	RevokeWebClientWithResponse(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*RevokeWebClientResponse, error)

	// GetWebClientWithResponse Retrieve a web client
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /web_clients/{web_client_id} (the `GetWebClient` operationId).
	GetWebClientWithResponse(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*GetWebClientResponse, error)

	// CreateWebClientTokenWithResponse Mint a login token
	//
	// Returns a short-lived browser login token. Call this from your
	// backend when a signed-in agent opens the softphone, and pass the
	// token to the browser SDK. Mint a fresh token per session; tokens
	// expire on their own and die early if the client is revoked.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /web_clients/{web_client_id}/tokens (the `CreateWebClientToken` operationId).
	CreateWebClientTokenWithResponse(ctx context.Context, webClientId string, reqEditors ...RequestEditorFn) (*CreateWebClientTokenResponse, error)

	// ListWebhookEndpointsWithResponse List webhook endpoints
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /webhook_endpoints (the `ListWebhookEndpoints` operationId).
	ListWebhookEndpointsWithResponse(ctx context.Context, params *ListWebhookEndpointsParams, reqEditors ...RequestEditorFn) (*ListWebhookEndpointsResponse, error)

	// CreateWebhookEndpointWithBodyWithResponse Create a webhook endpoint
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).
	CreateWebhookEndpointWithBodyWithResponse(ctx context.Context, params *CreateWebhookEndpointParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWebhookEndpointResponse, error)

	// CreateWebhookEndpointWithResponse Create a webhook endpoint
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /webhook_endpoints (the `CreateWebhookEndpoint` operationId).
	CreateWebhookEndpointWithResponse(ctx context.Context, params *CreateWebhookEndpointParams, body CreateWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWebhookEndpointResponse, error)

	// DeleteWebhookEndpointWithResponse Delete a webhook endpoint
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /webhook_endpoints/{endpoint_id} (the `DeleteWebhookEndpoint` operationId).
	DeleteWebhookEndpointWithResponse(ctx context.Context, endpointId string, reqEditors ...RequestEditorFn) (*DeleteWebhookEndpointResponse, error)

	// UpdateWebhookEndpointWithBodyWithResponse Update a webhook endpoint
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).
	UpdateWebhookEndpointWithBodyWithResponse(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWebhookEndpointResponse, error)

	// UpdateWebhookEndpointWithResponse Update a webhook endpoint
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PATCH /webhook_endpoints/{endpoint_id} (the `UpdateWebhookEndpoint` operationId).
	UpdateWebhookEndpointWithResponse(ctx context.Context, endpointId string, body UpdateWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWebhookEndpointResponse, error)

	// TestWebhookEndpointWithBodyWithResponse Send a test event
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).
	TestWebhookEndpointWithBodyWithResponse(ctx context.Context, endpointId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestWebhookEndpointResponse, error)

	// TestWebhookEndpointWithResponse Send a test event
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /webhook_endpoints/{endpoint_id}/test (the `TestWebhookEndpoint` operationId).
	TestWebhookEndpointWithResponse(ctx context.Context, endpointId string, body TestWebhookEndpointJSONRequestBody, reqEditors ...RequestEditorFn) (*TestWebhookEndpointResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Conversation

type Conversation struct {
	ExternalNumber string `json:"external_number"`

	// Id Examples: cnv_01j8x3f
	Id                 string    `json:"id"`
	LastActivityAt     time.Time `json:"last_activity_at"`
	LastMessagePreview *string   `json:"last_message_preview,omitempty"`

	// OptedOut True if the external party sent STOP.
	OptedOut      *bool  `json:"opted_out,omitempty"`
	PhoneNumberId string `json:"phone_number_id"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
}

Conversation defines model for Conversation.

type CreateBrandJSONRequestBody

type CreateBrandJSONRequestBody = BrandCreate

CreateBrandJSONRequestBody defines body for CreateBrand for application/json ContentType.

type CreateBrandParams

type CreateBrandParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

CreateBrandParams defines parameters for CreateBrand.

type CreateBrandResponse

type CreateBrandResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *Brand
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateBrandResponse

func ParseCreateBrandResponse(rsp *http.Response) (*CreateBrandResponse, error)

ParseCreateBrandResponse parses an HTTP response from a CreateBrandWithResponse call

func (CreateBrandResponse) ContentType

func (r CreateBrandResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateBrandResponse) GetBody

func (r CreateBrandResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateBrandResponse) GetJSON201

func (r CreateBrandResponse) GetJSON201() *Brand

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateBrandResponse) GetJSONDefault

func (r CreateBrandResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateBrandResponse) Status

func (r CreateBrandResponse) Status() string

Status returns HTTPResponse.Status

func (CreateBrandResponse) StatusCode

func (r CreateBrandResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateCallJSONBody

type CreateCallJSONBody struct {
	// ConnectTo The agent's number, E.164 — rings first.
	ConnectTo string `json:"connect_to"`

	// From A tenant number id (`num_…`) or its E.164 — the caller ID both parties see.
	From string `json:"from"`

	// To The customer's number, E.164.
	To string `json:"to"`

	// Transcribe Stream live speech-to-text: each final utterance arrives
	// as a `call.transcript` webhook and accumulates on
	// `GET /calls/{id}/transcript`. Billed per transcribed minute.
	// After the call completes, an AI summary lands on the call's
	// `summary` field (a `call.summary` webhook fires when ready).
	Transcribe *bool `json:"transcribe,omitempty"`
}

CreateCallJSONBody defines parameters for CreateCall.

type CreateCallJSONRequestBody

type CreateCallJSONRequestBody CreateCallJSONBody

CreateCallJSONRequestBody defines body for CreateCall for application/json ContentType.

type CreateCallResponse

type CreateCallResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *Call
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateCallResponse

func ParseCreateCallResponse(rsp *http.Response) (*CreateCallResponse, error)

ParseCreateCallResponse parses an HTTP response from a CreateCallWithResponse call

func (CreateCallResponse) ContentType

func (r CreateCallResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateCallResponse) GetBody

func (r CreateCallResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateCallResponse) GetJSON201

func (r CreateCallResponse) GetJSON201() *Call

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateCallResponse) GetJSONDefault

func (r CreateCallResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateCallResponse) Status

func (r CreateCallResponse) Status() string

Status returns HTTPResponse.Status

func (CreateCallResponse) StatusCode

func (r CreateCallResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateCallStreamJSONBody

type CreateCallStreamJSONBody struct {
	// Direction fork receives audio; bidirectional also plays your audio into the call.
	Direction *CreateCallStreamJSONBodyDirection `json:"direction,omitempty"`

	// Track Which side(s) of the conversation to receive.
	Track *CreateCallStreamJSONBodyTrack `json:"track,omitempty"`
}

CreateCallStreamJSONBody defines parameters for CreateCallStream.

type CreateCallStreamJSONBodyDirection

type CreateCallStreamJSONBodyDirection string

CreateCallStreamJSONBodyDirection defines parameters for CreateCallStream.

const (
	CreateCallStreamJSONBodyDirectionBidirectional CreateCallStreamJSONBodyDirection = "bidirectional"
	CreateCallStreamJSONBodyDirectionFork          CreateCallStreamJSONBodyDirection = "fork"
)

Defines values for CreateCallStreamJSONBodyDirection.

func (CreateCallStreamJSONBodyDirection) Valid

Valid indicates whether the value is a known member of the CreateCallStreamJSONBodyDirection enum.

type CreateCallStreamJSONBodyTrack

type CreateCallStreamJSONBodyTrack string

CreateCallStreamJSONBodyTrack defines parameters for CreateCallStream.

const (
	CreateCallStreamJSONBodyTrackBoth     CreateCallStreamJSONBodyTrack = "both"
	CreateCallStreamJSONBodyTrackInbound  CreateCallStreamJSONBodyTrack = "inbound"
	CreateCallStreamJSONBodyTrackOutbound CreateCallStreamJSONBodyTrack = "outbound"
)

Defines values for CreateCallStreamJSONBodyTrack.

func (CreateCallStreamJSONBodyTrack) Valid

Valid indicates whether the value is a known member of the CreateCallStreamJSONBodyTrack enum.

type CreateCallStreamJSONRequestBody

type CreateCallStreamJSONRequestBody CreateCallStreamJSONBody

CreateCallStreamJSONRequestBody defines body for CreateCallStream for application/json ContentType.

type CreateCallStreamResponse

type CreateCallStreamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *Stream
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateCallStreamResponse

func ParseCreateCallStreamResponse(rsp *http.Response) (*CreateCallStreamResponse, error)

ParseCreateCallStreamResponse parses an HTTP response from a CreateCallStreamWithResponse call

func (CreateCallStreamResponse) ContentType

func (r CreateCallStreamResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateCallStreamResponse) GetBody

func (r CreateCallStreamResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateCallStreamResponse) GetJSON201

func (r CreateCallStreamResponse) GetJSON201() *Stream

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateCallStreamResponse) GetJSONDefault

func (r CreateCallStreamResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateCallStreamResponse) Status

func (r CreateCallStreamResponse) Status() string

Status returns HTTPResponse.Status

func (CreateCallStreamResponse) StatusCode

func (r CreateCallStreamResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateCampaignJSONRequestBody

type CreateCampaignJSONRequestBody = CampaignCreate

CreateCampaignJSONRequestBody defines body for CreateCampaign for application/json ContentType.

type CreateCampaignParams

type CreateCampaignParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

CreateCampaignParams defines parameters for CreateCampaign.

type CreateCampaignResponse

type CreateCampaignResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *Campaign
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateCampaignResponse

func ParseCreateCampaignResponse(rsp *http.Response) (*CreateCampaignResponse, error)

ParseCreateCampaignResponse parses an HTTP response from a CreateCampaignWithResponse call

func (CreateCampaignResponse) ContentType

func (r CreateCampaignResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateCampaignResponse) GetBody

func (r CreateCampaignResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateCampaignResponse) GetJSON201

func (r CreateCampaignResponse) GetJSON201() *Campaign

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateCampaignResponse) GetJSONDefault

func (r CreateCampaignResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateCampaignResponse) Status

func (r CreateCampaignResponse) Status() string

Status returns HTTPResponse.Status

func (CreateCampaignResponse) StatusCode

func (r CreateCampaignResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateE911AddressJSONRequestBody

type CreateE911AddressJSONRequestBody = E911AddressCreate

CreateE911AddressJSONRequestBody defines body for CreateE911Address for application/json ContentType.

type CreateE911AddressParams

type CreateE911AddressParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

CreateE911AddressParams defines parameters for CreateE911Address.

type CreateE911AddressResponse

type CreateE911AddressResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *E911Address
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateE911AddressResponse

func ParseCreateE911AddressResponse(rsp *http.Response) (*CreateE911AddressResponse, error)

ParseCreateE911AddressResponse parses an HTTP response from a CreateE911AddressWithResponse call

func (CreateE911AddressResponse) ContentType

func (r CreateE911AddressResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateE911AddressResponse) GetBody

func (r CreateE911AddressResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateE911AddressResponse) GetJSON201

func (r CreateE911AddressResponse) GetJSON201() *E911Address

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateE911AddressResponse) GetJSONDefault

func (r CreateE911AddressResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateE911AddressResponse) Status

func (r CreateE911AddressResponse) Status() string

Status returns HTTPResponse.Status

func (CreateE911AddressResponse) StatusCode

func (r CreateE911AddressResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreatePortInJSONRequestBody

type CreatePortInJSONRequestBody = PortInCreate

CreatePortInJSONRequestBody defines body for CreatePortIn for application/json ContentType.

type CreatePortInResponse

type CreatePortInResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *PortIn
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreatePortInResponse

func ParseCreatePortInResponse(rsp *http.Response) (*CreatePortInResponse, error)

ParseCreatePortInResponse parses an HTTP response from a CreatePortInWithResponse call

func (CreatePortInResponse) ContentType

func (r CreatePortInResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreatePortInResponse) GetBody

func (r CreatePortInResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreatePortInResponse) GetJSON201

func (r CreatePortInResponse) GetJSON201() *PortIn

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreatePortInResponse) GetJSONDefault

func (r CreatePortInResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreatePortInResponse) Status

func (r CreatePortInResponse) Status() string

Status returns HTTPResponse.Status

func (CreatePortInResponse) StatusCode

func (r CreatePortInResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateRoutingConfigJSONRequestBody

type CreateRoutingConfigJSONRequestBody = RoutingConfigCreate

CreateRoutingConfigJSONRequestBody defines body for CreateRoutingConfig for application/json ContentType.

type CreateRoutingConfigParams

type CreateRoutingConfigParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

CreateRoutingConfigParams defines parameters for CreateRoutingConfig.

type CreateRoutingConfigResponse

type CreateRoutingConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *RoutingConfig
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateRoutingConfigResponse

func ParseCreateRoutingConfigResponse(rsp *http.Response) (*CreateRoutingConfigResponse, error)

ParseCreateRoutingConfigResponse parses an HTTP response from a CreateRoutingConfigWithResponse call

func (CreateRoutingConfigResponse) ContentType

func (r CreateRoutingConfigResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateRoutingConfigResponse) GetBody

func (r CreateRoutingConfigResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateRoutingConfigResponse) GetJSON201

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateRoutingConfigResponse) GetJSONDefault

func (r CreateRoutingConfigResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateRoutingConfigResponse) Status

Status returns HTTPResponse.Status

func (CreateRoutingConfigResponse) StatusCode

func (r CreateRoutingConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateTenantJSONRequestBody

type CreateTenantJSONRequestBody = TenantCreate

CreateTenantJSONRequestBody defines body for CreateTenant for application/json ContentType.

type CreateTenantParams

type CreateTenantParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

CreateTenantParams defines parameters for CreateTenant.

type CreateTenantResponse

type CreateTenantResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *Tenant
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateTenantResponse

func ParseCreateTenantResponse(rsp *http.Response) (*CreateTenantResponse, error)

ParseCreateTenantResponse parses an HTTP response from a CreateTenantWithResponse call

func (CreateTenantResponse) ContentType

func (r CreateTenantResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateTenantResponse) GetBody

func (r CreateTenantResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateTenantResponse) GetJSON201

func (r CreateTenantResponse) GetJSON201() *Tenant

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateTenantResponse) GetJSONDefault

func (r CreateTenantResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateTenantResponse) Status

func (r CreateTenantResponse) Status() string

Status returns HTTPResponse.Status

func (CreateTenantResponse) StatusCode

func (r CreateTenantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateWebClientJSONRequestBody

type CreateWebClientJSONRequestBody = WebClientCreate

CreateWebClientJSONRequestBody defines body for CreateWebClient for application/json ContentType.

type CreateWebClientResponse

type CreateWebClientResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *WebClient
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateWebClientResponse

func ParseCreateWebClientResponse(rsp *http.Response) (*CreateWebClientResponse, error)

ParseCreateWebClientResponse parses an HTTP response from a CreateWebClientWithResponse call

func (CreateWebClientResponse) ContentType

func (r CreateWebClientResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateWebClientResponse) GetBody

func (r CreateWebClientResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateWebClientResponse) GetJSON201

func (r CreateWebClientResponse) GetJSON201() *WebClient

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateWebClientResponse) GetJSONDefault

func (r CreateWebClientResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateWebClientResponse) Status

func (r CreateWebClientResponse) Status() string

Status returns HTTPResponse.Status

func (CreateWebClientResponse) StatusCode

func (r CreateWebClientResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateWebClientTokenResponse

type CreateWebClientTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *WebClientToken
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateWebClientTokenResponse

func ParseCreateWebClientTokenResponse(rsp *http.Response) (*CreateWebClientTokenResponse, error)

ParseCreateWebClientTokenResponse parses an HTTP response from a CreateWebClientTokenWithResponse call

func (CreateWebClientTokenResponse) ContentType

func (r CreateWebClientTokenResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateWebClientTokenResponse) GetBody

func (r CreateWebClientTokenResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateWebClientTokenResponse) GetJSON201

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateWebClientTokenResponse) GetJSONDefault

func (r CreateWebClientTokenResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateWebClientTokenResponse) Status

Status returns HTTPResponse.Status

func (CreateWebClientTokenResponse) StatusCode

func (r CreateWebClientTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateWebhookEndpointJSONRequestBody

type CreateWebhookEndpointJSONRequestBody = WebhookEndpointCreate

CreateWebhookEndpointJSONRequestBody defines body for CreateWebhookEndpoint for application/json ContentType.

type CreateWebhookEndpointParams

type CreateWebhookEndpointParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

CreateWebhookEndpointParams defines parameters for CreateWebhookEndpoint.

type CreateWebhookEndpointResponse

type CreateWebhookEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *WebhookEndpointWithSecret
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseCreateWebhookEndpointResponse

func ParseCreateWebhookEndpointResponse(rsp *http.Response) (*CreateWebhookEndpointResponse, error)

ParseCreateWebhookEndpointResponse parses an HTTP response from a CreateWebhookEndpointWithResponse call

func (CreateWebhookEndpointResponse) ContentType

func (r CreateWebhookEndpointResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateWebhookEndpointResponse) GetBody

func (r CreateWebhookEndpointResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateWebhookEndpointResponse) GetJSON201

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateWebhookEndpointResponse) GetJSONDefault

func (r CreateWebhookEndpointResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (CreateWebhookEndpointResponse) Status

Status returns HTTPResponse.Status

func (CreateWebhookEndpointResponse) StatusCode

func (r CreateWebhookEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteRoutingConfigResponse

type DeleteRoutingConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseDeleteRoutingConfigResponse

func ParseDeleteRoutingConfigResponse(rsp *http.Response) (*DeleteRoutingConfigResponse, error)

ParseDeleteRoutingConfigResponse parses an HTTP response from a DeleteRoutingConfigWithResponse call

func (DeleteRoutingConfigResponse) ContentType

func (r DeleteRoutingConfigResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteRoutingConfigResponse) GetBody

func (r DeleteRoutingConfigResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteRoutingConfigResponse) GetJSONDefault

func (r DeleteRoutingConfigResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DeleteRoutingConfigResponse) Status

Status returns HTTPResponse.Status

func (DeleteRoutingConfigResponse) StatusCode

func (r DeleteRoutingConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteTenantResponse

type DeleteTenantResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseDeleteTenantResponse

func ParseDeleteTenantResponse(rsp *http.Response) (*DeleteTenantResponse, error)

ParseDeleteTenantResponse parses an HTTP response from a DeleteTenantWithResponse call

func (DeleteTenantResponse) ContentType

func (r DeleteTenantResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteTenantResponse) GetBody

func (r DeleteTenantResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteTenantResponse) GetJSONDefault

func (r DeleteTenantResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DeleteTenantResponse) Status

func (r DeleteTenantResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteTenantResponse) StatusCode

func (r DeleteTenantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteWebhookEndpointResponse

type DeleteWebhookEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseDeleteWebhookEndpointResponse

func ParseDeleteWebhookEndpointResponse(rsp *http.Response) (*DeleteWebhookEndpointResponse, error)

ParseDeleteWebhookEndpointResponse parses an HTTP response from a DeleteWebhookEndpointWithResponse call

func (DeleteWebhookEndpointResponse) ContentType

func (r DeleteWebhookEndpointResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteWebhookEndpointResponse) GetBody

func (r DeleteWebhookEndpointResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteWebhookEndpointResponse) GetJSONDefault

func (r DeleteWebhookEndpointResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (DeleteWebhookEndpointResponse) Status

Status returns HTTPResponse.Status

func (DeleteWebhookEndpointResponse) StatusCode

func (r DeleteWebhookEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type E911Address

type E911Address struct {
	City      string    `json:"city"`
	CreatedAt time.Time `json:"created_at"`

	// Id Examples: e911_01j8x3t
	Id         string            `json:"id"`
	PostalCode string            `json:"postal_code"`
	State      string            `json:"state"`
	Status     E911AddressStatus `json:"status"`

	// Street Examples: 123 N Central Ave
	Street string `json:"street"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`

	// Unit Examples: Suite 400
	Unit *string `json:"unit,omitempty"`
}

E911Address defines model for E911Address.

type E911AddressCreate

type E911AddressCreate struct {
	City       string `json:"city"`
	PostalCode string `json:"postal_code"`
	State      string `json:"state"`

	// Street Examples: 123 N Central Ave
	Street string `json:"street"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`

	// Unit Examples: Suite 400
	Unit *string `json:"unit,omitempty"`
}

E911AddressCreate defines model for E911AddressCreate.

type E911AddressStatus

type E911AddressStatus string

E911AddressStatus defines model for E911Address.Status.

const (
	E911AddressStatusFailed    E911AddressStatus = "failed"
	E911AddressStatusValidated E911AddressStatus = "validated"
)

Defines values for E911AddressStatus.

func (E911AddressStatus) Valid

func (e E911AddressStatus) Valid() bool

Valid indicates whether the value is a known member of the E911AddressStatus enum.

type Error

type Error = ErrorBody

Error defines model for Error.

type ErrorBody

type ErrorBody struct {
	Error struct {
		// Code Stable machine-readable code.
		//
		// Examples: campaign_not_approved, recipient_opted_out, e911_address_invalid
		Code    string  `json:"code"`
		DocsUrl *string `json:"docs_url,omitempty"`

		// Message Human explanation of what went wrong and what to do.
		Message string `json:"message"`

		// Param The request field at fault, when applicable.
		Param *string `json:"param,omitempty"`
	} `json:"error"`
}

ErrorBody defines model for ErrorBody.

type EventEnvelope

type EventEnvelope struct {
	CreatedAt time.Time `json:"created_at"`

	// Data The full affected resource (Message, Call, Voicemail, …).
	Data map[string]interface{} `json:"data"`

	// EventVersion Examples: 2026-08-11
	EventVersion string `json:"event_version"`

	// Id Examples: evt_01j8x4e
	Id string `json:"id"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId *TenantIdField `json:"tenant_id,omitempty"`

	// Type Examples: message.received
	Type string `json:"type"`
}

EventEnvelope Every delivery is signed: `Handset-Signature: t=<unix_ts>,v1=<hmac_sha256>` over `<t>.<raw_body>` with your endpoint secret. Reject deliveries older than 5 minutes to prevent replay.

type GatherCallDigits202JSONResponseBodyStatus

type GatherCallDigits202JSONResponseBodyStatus string

GatherCallDigits202JSONResponseBodyStatus defines parameters for GatherCallDigits.

const (
	Listening GatherCallDigits202JSONResponseBodyStatus = "listening"
)

Defines values for GatherCallDigits202JSONResponseBodyStatus.

func (GatherCallDigits202JSONResponseBodyStatus) Valid

Valid indicates whether the value is a known member of the GatherCallDigits202JSONResponseBodyStatus enum.

type GatherCallDigitsJSONBody

type GatherCallDigitsJSONBody struct {
	// MaxDigits Collection ends once this many digits arrive.
	MaxDigits *int `json:"max_digits,omitempty"`

	// Prompt Spoken to the remote party as TTS.
	Prompt string `json:"prompt"`

	// Terminator A digit (0-9, *,
	Terminator *string `json:"terminator,omitempty"`

	// TimeoutMs How long to wait for input.
	TimeoutMs *int `json:"timeout_ms,omitempty"`
}

GatherCallDigitsJSONBody defines parameters for GatherCallDigits.

type GatherCallDigitsJSONRequestBody

type GatherCallDigitsJSONRequestBody GatherCallDigitsJSONBody

GatherCallDigitsJSONRequestBody defines body for GatherCallDigits for application/json ContentType.

type GatherCallDigitsResponse

type GatherCallDigitsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *struct {
		CallId string                                    `json:"call_id"`
		Status GatherCallDigits202JSONResponseBodyStatus `json:"status"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGatherCallDigitsResponse

func ParseGatherCallDigitsResponse(rsp *http.Response) (*GatherCallDigitsResponse, error)

ParseGatherCallDigitsResponse parses an HTTP response from a GatherCallDigitsWithResponse call

func (GatherCallDigitsResponse) ContentType

func (r GatherCallDigitsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GatherCallDigitsResponse) GetBody

func (r GatherCallDigitsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GatherCallDigitsResponse) GetJSON202

func (r GatherCallDigitsResponse) GetJSON202() *struct {
	CallId string                                    `json:"call_id"`
	Status GatherCallDigits202JSONResponseBodyStatus `json:"status"`
}

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (GatherCallDigitsResponse) GetJSONDefault

func (r GatherCallDigitsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GatherCallDigitsResponse) Status

func (r GatherCallDigitsResponse) Status() string

Status returns HTTPResponse.Status

func (GatherCallDigitsResponse) StatusCode

func (r GatherCallDigitsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetBrandResponse

type GetBrandResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Brand
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetBrandResponse

func ParseGetBrandResponse(rsp *http.Response) (*GetBrandResponse, error)

ParseGetBrandResponse parses an HTTP response from a GetBrandWithResponse call

func (GetBrandResponse) ContentType

func (r GetBrandResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetBrandResponse) GetBody

func (r GetBrandResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetBrandResponse) GetJSON200

func (r GetBrandResponse) GetJSON200() *Brand

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetBrandResponse) GetJSONDefault

func (r GetBrandResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetBrandResponse) Status

func (r GetBrandResponse) Status() string

Status returns HTTPResponse.Status

func (GetBrandResponse) StatusCode

func (r GetBrandResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCallResponse

type GetCallResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Call
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetCallResponse

func ParseGetCallResponse(rsp *http.Response) (*GetCallResponse, error)

ParseGetCallResponse parses an HTTP response from a GetCallWithResponse call

func (GetCallResponse) ContentType

func (r GetCallResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetCallResponse) GetBody

func (r GetCallResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetCallResponse) GetJSON200

func (r GetCallResponse) GetJSON200() *Call

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetCallResponse) GetJSONDefault

func (r GetCallResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetCallResponse) Status

func (r GetCallResponse) Status() string

Status returns HTTPResponse.Status

func (GetCallResponse) StatusCode

func (r GetCallResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCallTranscriptResponse

type GetCallTranscriptResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		CallId   string `json:"call_id"`
		Segments []struct {
			OccurredAt time.Time `json:"occurred_at"`

			// Speaker agent | customer, when known.
			Speaker *string `json:"speaker,omitempty"`
			Text    string  `json:"text"`
		} `json:"segments"`
		Text string `json:"text"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetCallTranscriptResponse

func ParseGetCallTranscriptResponse(rsp *http.Response) (*GetCallTranscriptResponse, error)

ParseGetCallTranscriptResponse parses an HTTP response from a GetCallTranscriptWithResponse call

func (GetCallTranscriptResponse) ContentType

func (r GetCallTranscriptResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetCallTranscriptResponse) GetBody

func (r GetCallTranscriptResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetCallTranscriptResponse) GetJSON200

func (r GetCallTranscriptResponse) GetJSON200() *struct {
	CallId   string `json:"call_id"`
	Segments []struct {
		OccurredAt time.Time `json:"occurred_at"`

		// Speaker agent | customer, when known.
		Speaker *string `json:"speaker,omitempty"`
		Text    string  `json:"text"`
	} `json:"segments"`
	Text string `json:"text"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetCallTranscriptResponse) GetJSONDefault

func (r GetCallTranscriptResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetCallTranscriptResponse) Status

func (r GetCallTranscriptResponse) Status() string

Status returns HTTPResponse.Status

func (GetCallTranscriptResponse) StatusCode

func (r GetCallTranscriptResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetCampaignResponse

type GetCampaignResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Campaign
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetCampaignResponse

func ParseGetCampaignResponse(rsp *http.Response) (*GetCampaignResponse, error)

ParseGetCampaignResponse parses an HTTP response from a GetCampaignWithResponse call

func (GetCampaignResponse) ContentType

func (r GetCampaignResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetCampaignResponse) GetBody

func (r GetCampaignResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetCampaignResponse) GetJSON200

func (r GetCampaignResponse) GetJSON200() *Campaign

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetCampaignResponse) GetJSONDefault

func (r GetCampaignResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetCampaignResponse) Status

func (r GetCampaignResponse) Status() string

Status returns HTTPResponse.Status

func (GetCampaignResponse) StatusCode

func (r GetCampaignResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetConversationResponse

type GetConversationResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Conversation
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetConversationResponse

func ParseGetConversationResponse(rsp *http.Response) (*GetConversationResponse, error)

ParseGetConversationResponse parses an HTTP response from a GetConversationWithResponse call

func (GetConversationResponse) ContentType

func (r GetConversationResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetConversationResponse) GetBody

func (r GetConversationResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetConversationResponse) GetJSON200

func (r GetConversationResponse) GetJSON200() *Conversation

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetConversationResponse) GetJSONDefault

func (r GetConversationResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetConversationResponse) Status

func (r GetConversationResponse) Status() string

Status returns HTTPResponse.Status

func (GetConversationResponse) StatusCode

func (r GetConversationResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetMessageResponse

type GetMessageResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Message
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetMessageResponse

func ParseGetMessageResponse(rsp *http.Response) (*GetMessageResponse, error)

ParseGetMessageResponse parses an HTTP response from a GetMessageWithResponse call

func (GetMessageResponse) ContentType

func (r GetMessageResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetMessageResponse) GetBody

func (r GetMessageResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetMessageResponse) GetJSON200

func (r GetMessageResponse) GetJSON200() *Message

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetMessageResponse) GetJSONDefault

func (r GetMessageResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetMessageResponse) Status

func (r GetMessageResponse) Status() string

Status returns HTTPResponse.Status

func (GetMessageResponse) StatusCode

func (r GetMessageResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetMessageStatsParams added in v0.12.0

type GetMessageStatsParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`

	// Start RFC 3339 or YYYY-MM-DD. Defaults to 30 days ago.
	Start *time.Time `form:"start,omitempty" json:"start,omitempty"`

	// End RFC 3339 or YYYY-MM-DD. Defaults to now.
	End *time.Time `form:"end,omitempty" json:"end,omitempty"`
}

GetMessageStatsParams defines parameters for GetMessageStats.

type GetMessageStatsResponse added in v0.12.0

type GetMessageStatsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *MessageStats
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetMessageStatsResponse added in v0.12.0

func ParseGetMessageStatsResponse(rsp *http.Response) (*GetMessageStatsResponse, error)

ParseGetMessageStatsResponse parses an HTTP response from a GetMessageStatsWithResponse call

func (GetMessageStatsResponse) ContentType added in v0.12.0

func (r GetMessageStatsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetMessageStatsResponse) GetBody added in v0.12.0

func (r GetMessageStatsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetMessageStatsResponse) GetJSON200 added in v0.12.0

func (r GetMessageStatsResponse) GetJSON200() *MessageStats

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetMessageStatsResponse) GetJSONDefault added in v0.12.0

func (r GetMessageStatsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetMessageStatsResponse) Status added in v0.12.0

func (r GetMessageStatsResponse) Status() string

Status returns HTTPResponse.Status

func (GetMessageStatsResponse) StatusCode added in v0.12.0

func (r GetMessageStatsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetNumberResponse

type GetNumberResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *PhoneNumber
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetNumberResponse

func ParseGetNumberResponse(rsp *http.Response) (*GetNumberResponse, error)

ParseGetNumberResponse parses an HTTP response from a GetNumberWithResponse call

func (GetNumberResponse) ContentType

func (r GetNumberResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetNumberResponse) GetBody

func (r GetNumberResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetNumberResponse) GetJSON200

func (r GetNumberResponse) GetJSON200() *PhoneNumber

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetNumberResponse) GetJSONDefault

func (r GetNumberResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetNumberResponse) Status

func (r GetNumberResponse) Status() string

Status returns HTTPResponse.Status

func (GetNumberResponse) StatusCode

func (r GetNumberResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPortInResponse

type GetPortInResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *PortIn
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetPortInResponse

func ParseGetPortInResponse(rsp *http.Response) (*GetPortInResponse, error)

ParseGetPortInResponse parses an HTTP response from a GetPortInWithResponse call

func (GetPortInResponse) ContentType

func (r GetPortInResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetPortInResponse) GetBody

func (r GetPortInResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetPortInResponse) GetJSON200

func (r GetPortInResponse) GetJSON200() *PortIn

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetPortInResponse) GetJSONDefault

func (r GetPortInResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetPortInResponse) Status

func (r GetPortInResponse) Status() string

Status returns HTTPResponse.Status

func (GetPortInResponse) StatusCode

func (r GetPortInResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRecordingResponse

type GetRecordingResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Recording
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetRecordingResponse

func ParseGetRecordingResponse(rsp *http.Response) (*GetRecordingResponse, error)

ParseGetRecordingResponse parses an HTTP response from a GetRecordingWithResponse call

func (GetRecordingResponse) ContentType

func (r GetRecordingResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetRecordingResponse) GetBody

func (r GetRecordingResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetRecordingResponse) GetJSON200

func (r GetRecordingResponse) GetJSON200() *Recording

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetRecordingResponse) GetJSONDefault

func (r GetRecordingResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetRecordingResponse) Status

func (r GetRecordingResponse) Status() string

Status returns HTTPResponse.Status

func (GetRecordingResponse) StatusCode

func (r GetRecordingResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetRoutingConfigResponse

type GetRoutingConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *RoutingConfig
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetRoutingConfigResponse

func ParseGetRoutingConfigResponse(rsp *http.Response) (*GetRoutingConfigResponse, error)

ParseGetRoutingConfigResponse parses an HTTP response from a GetRoutingConfigWithResponse call

func (GetRoutingConfigResponse) ContentType

func (r GetRoutingConfigResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetRoutingConfigResponse) GetBody

func (r GetRoutingConfigResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetRoutingConfigResponse) GetJSON200

func (r GetRoutingConfigResponse) GetJSON200() *RoutingConfig

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetRoutingConfigResponse) GetJSONDefault

func (r GetRoutingConfigResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetRoutingConfigResponse) Status

func (r GetRoutingConfigResponse) Status() string

Status returns HTTPResponse.Status

func (GetRoutingConfigResponse) StatusCode

func (r GetRoutingConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTenantResponse

type GetTenantResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Tenant
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetTenantResponse

func ParseGetTenantResponse(rsp *http.Response) (*GetTenantResponse, error)

ParseGetTenantResponse parses an HTTP response from a GetTenantWithResponse call

func (GetTenantResponse) ContentType

func (r GetTenantResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetTenantResponse) GetBody

func (r GetTenantResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetTenantResponse) GetJSON200

func (r GetTenantResponse) GetJSON200() *Tenant

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetTenantResponse) GetJSONDefault

func (r GetTenantResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetTenantResponse) Status

func (r GetTenantResponse) Status() string

Status returns HTTPResponse.Status

func (GetTenantResponse) StatusCode

func (r GetTenantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetUsage200JSONResponseBodyDataKind

type GetUsage200JSONResponseBodyDataKind string

GetUsage200JSONResponseBodyDataKind defines parameters for GetUsage.

const (
	NumberMonth         GetUsage200JSONResponseBodyDataKind = "number_month"
	SmsSegmentInbound   GetUsage200JSONResponseBodyDataKind = "sms_segment_inbound"
	SmsSegmentOutbound  GetUsage200JSONResponseBodyDataKind = "sms_segment_outbound"
	TranscriptionMinute GetUsage200JSONResponseBodyDataKind = "transcription_minute"
	VoiceMinuteInbound  GetUsage200JSONResponseBodyDataKind = "voice_minute_inbound"
)

Defines values for GetUsage200JSONResponseBodyDataKind.

func (GetUsage200JSONResponseBodyDataKind) Valid

Valid indicates whether the value is a known member of the GetUsage200JSONResponseBodyDataKind enum.

type GetUsage200JSONResponseBodyMode

type GetUsage200JSONResponseBodyMode string

GetUsage200JSONResponseBodyMode defines parameters for GetUsage.

Defines values for GetUsage200JSONResponseBodyMode.

func (GetUsage200JSONResponseBodyMode) Valid

Valid indicates whether the value is a known member of the GetUsage200JSONResponseBodyMode enum.

type GetUsage200JSONResponseBodyObject

type GetUsage200JSONResponseBodyObject string

GetUsage200JSONResponseBodyObject defines parameters for GetUsage.

const (
	UsageSummary GetUsage200JSONResponseBodyObject = "usage_summary"
)

Defines values for GetUsage200JSONResponseBodyObject.

func (GetUsage200JSONResponseBodyObject) Valid

Valid indicates whether the value is a known member of the GetUsage200JSONResponseBodyObject enum.

type GetUsageParams

type GetUsageParams struct {
	// Start RFC 3339 timestamp or `YYYY-MM-DD`. Defaults to the first instant of the current month.
	Start *string `form:"start,omitempty" json:"start,omitempty"`

	// End RFC 3339 timestamp or `YYYY-MM-DD`. Defaults to now.
	End *string `form:"end,omitempty" json:"end,omitempty"`

	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
}

GetUsageParams defines parameters for GetUsage.

type GetUsageResponse

type GetUsageResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data []struct {
			Kind     GetUsage200JSONResponseBodyDataKind `json:"kind"`
			Quantity float32                             `json:"quantity"`
		} `json:"data"`
		End    time.Time                         `json:"end"`
		Mode   GetUsage200JSONResponseBodyMode   `json:"mode"`
		Object GetUsage200JSONResponseBodyObject `json:"object"`
		Start  time.Time                         `json:"start"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetUsageResponse

func ParseGetUsageResponse(rsp *http.Response) (*GetUsageResponse, error)

ParseGetUsageResponse parses an HTTP response from a GetUsageWithResponse call

func (GetUsageResponse) ContentType

func (r GetUsageResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetUsageResponse) GetBody

func (r GetUsageResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetUsageResponse) GetJSON200

func (r GetUsageResponse) GetJSON200() *struct {
	Data []struct {
		Kind     GetUsage200JSONResponseBodyDataKind `json:"kind"`
		Quantity float32                             `json:"quantity"`
	} `json:"data"`
	End    time.Time                         `json:"end"`
	Mode   GetUsage200JSONResponseBodyMode   `json:"mode"`
	Object GetUsage200JSONResponseBodyObject `json:"object"`
	Start  time.Time                         `json:"start"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetUsageResponse) GetJSONDefault

func (r GetUsageResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetUsageResponse) Status

func (r GetUsageResponse) Status() string

Status returns HTTPResponse.Status

func (GetUsageResponse) StatusCode

func (r GetUsageResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetVoicemailResponse

type GetVoicemailResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Voicemail
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetVoicemailResponse

func ParseGetVoicemailResponse(rsp *http.Response) (*GetVoicemailResponse, error)

ParseGetVoicemailResponse parses an HTTP response from a GetVoicemailWithResponse call

func (GetVoicemailResponse) ContentType

func (r GetVoicemailResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetVoicemailResponse) GetBody

func (r GetVoicemailResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetVoicemailResponse) GetJSON200

func (r GetVoicemailResponse) GetJSON200() *Voicemail

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetVoicemailResponse) GetJSONDefault

func (r GetVoicemailResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetVoicemailResponse) Status

func (r GetVoicemailResponse) Status() string

Status returns HTTPResponse.Status

func (GetVoicemailResponse) StatusCode

func (r GetVoicemailResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetWebClientResponse

type GetWebClientResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WebClient
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseGetWebClientResponse

func ParseGetWebClientResponse(rsp *http.Response) (*GetWebClientResponse, error)

ParseGetWebClientResponse parses an HTTP response from a GetWebClientWithResponse call

func (GetWebClientResponse) ContentType

func (r GetWebClientResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetWebClientResponse) GetBody

func (r GetWebClientResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetWebClientResponse) GetJSON200

func (r GetWebClientResponse) GetJSON200() *WebClient

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetWebClientResponse) GetJSONDefault

func (r GetWebClientResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetWebClientResponse) Status

func (r GetWebClientResponse) Status() string

Status returns HTTPResponse.Status

func (GetWebClientResponse) StatusCode

func (r GetWebClientResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type IdempotencyKey

type IdempotencyKey = string

IdempotencyKey defines model for IdempotencyKey.

type Limit

type Limit = int

Limit defines model for Limit.

type ListBrandsParams

type ListBrandsParams struct {
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListBrandsParams defines parameters for ListBrands.

type ListBrandsResponse

type ListBrandsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []Brand `json:"data"`
		HasMore bool    `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListBrandsResponse

func ParseListBrandsResponse(rsp *http.Response) (*ListBrandsResponse, error)

ParseListBrandsResponse parses an HTTP response from a ListBrandsWithResponse call

func (ListBrandsResponse) ContentType

func (r ListBrandsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListBrandsResponse) GetBody

func (r ListBrandsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListBrandsResponse) GetJSON200

func (r ListBrandsResponse) GetJSON200() *struct {
	Data    []Brand `json:"data"`
	HasMore bool    `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListBrandsResponse) GetJSONDefault

func (r ListBrandsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListBrandsResponse) Status

func (r ListBrandsResponse) Status() string

Status returns HTTPResponse.Status

func (ListBrandsResponse) StatusCode

func (r ListBrandsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCallStreamsResponse

type ListCallStreamsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data []Stream `json:"data"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListCallStreamsResponse

func ParseListCallStreamsResponse(rsp *http.Response) (*ListCallStreamsResponse, error)

ParseListCallStreamsResponse parses an HTTP response from a ListCallStreamsWithResponse call

func (ListCallStreamsResponse) ContentType

func (r ListCallStreamsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCallStreamsResponse) GetBody

func (r ListCallStreamsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCallStreamsResponse) GetJSON200

func (r ListCallStreamsResponse) GetJSON200() *struct {
	Data []Stream `json:"data"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCallStreamsResponse) GetJSONDefault

func (r ListCallStreamsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListCallStreamsResponse) Status

func (r ListCallStreamsResponse) Status() string

Status returns HTTPResponse.Status

func (ListCallStreamsResponse) StatusCode

func (r ListCallStreamsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCallsParams

type ListCallsParams struct {
	// TenantId Scope results to one tenant.
	TenantId      *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	PhoneNumberId *string       `form:"phone_number_id,omitempty" json:"phone_number_id,omitempty"`
	Limit         *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListCallsParams defines parameters for ListCalls.

type ListCallsResponse

type ListCallsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []Call `json:"data"`
		HasMore bool   `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListCallsResponse

func ParseListCallsResponse(rsp *http.Response) (*ListCallsResponse, error)

ParseListCallsResponse parses an HTTP response from a ListCallsWithResponse call

func (ListCallsResponse) ContentType

func (r ListCallsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCallsResponse) GetBody

func (r ListCallsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCallsResponse) GetJSON200

func (r ListCallsResponse) GetJSON200() *struct {
	Data    []Call `json:"data"`
	HasMore bool   `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCallsResponse) GetJSONDefault

func (r ListCallsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListCallsResponse) Status

func (r ListCallsResponse) Status() string

Status returns HTTPResponse.Status

func (ListCallsResponse) StatusCode

func (r ListCallsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListCampaignsParams

type ListCampaignsParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter   `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Status   *CampaignStatus `form:"status,omitempty" json:"status,omitempty"`
	Limit    *Limit          `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListCampaignsParams defines parameters for ListCampaigns.

type ListCampaignsResponse

type ListCampaignsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []Campaign `json:"data"`
		HasMore bool       `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListCampaignsResponse

func ParseListCampaignsResponse(rsp *http.Response) (*ListCampaignsResponse, error)

ParseListCampaignsResponse parses an HTTP response from a ListCampaignsWithResponse call

func (ListCampaignsResponse) ContentType

func (r ListCampaignsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListCampaignsResponse) GetBody

func (r ListCampaignsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListCampaignsResponse) GetJSON200

func (r ListCampaignsResponse) GetJSON200() *struct {
	Data    []Campaign `json:"data"`
	HasMore bool       `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListCampaignsResponse) GetJSONDefault

func (r ListCampaignsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListCampaignsResponse) Status

func (r ListCampaignsResponse) Status() string

Status returns HTTPResponse.Status

func (ListCampaignsResponse) StatusCode

func (r ListCampaignsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListConversationsParams

type ListConversationsParams struct {
	// TenantId Scope results to one tenant.
	TenantId      *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	PhoneNumberId *string       `form:"phone_number_id,omitempty" json:"phone_number_id,omitempty"`
	Limit         *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListConversationsParams defines parameters for ListConversations.

type ListConversationsResponse

type ListConversationsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []Conversation `json:"data"`
		HasMore bool           `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListConversationsResponse

func ParseListConversationsResponse(rsp *http.Response) (*ListConversationsResponse, error)

ParseListConversationsResponse parses an HTTP response from a ListConversationsWithResponse call

func (ListConversationsResponse) ContentType

func (r ListConversationsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListConversationsResponse) GetBody

func (r ListConversationsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListConversationsResponse) GetJSON200

func (r ListConversationsResponse) GetJSON200() *struct {
	Data    []Conversation `json:"data"`
	HasMore bool           `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListConversationsResponse) GetJSONDefault

func (r ListConversationsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListConversationsResponse) Status

func (r ListConversationsResponse) Status() string

Status returns HTTPResponse.Status

func (ListConversationsResponse) StatusCode

func (r ListConversationsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListE911AddressesParams

type ListE911AddressesParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Limit    *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListE911AddressesParams defines parameters for ListE911Addresses.

type ListE911AddressesResponse

type ListE911AddressesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []E911Address `json:"data"`
		HasMore bool          `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListE911AddressesResponse

func ParseListE911AddressesResponse(rsp *http.Response) (*ListE911AddressesResponse, error)

ParseListE911AddressesResponse parses an HTTP response from a ListE911AddressesWithResponse call

func (ListE911AddressesResponse) ContentType

func (r ListE911AddressesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListE911AddressesResponse) GetBody

func (r ListE911AddressesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListE911AddressesResponse) GetJSON200

func (r ListE911AddressesResponse) GetJSON200() *struct {
	Data    []E911Address `json:"data"`
	HasMore bool          `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListE911AddressesResponse) GetJSONDefault

func (r ListE911AddressesResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListE911AddressesResponse) Status

func (r ListE911AddressesResponse) Status() string

Status returns HTTPResponse.Status

func (ListE911AddressesResponse) StatusCode

func (r ListE911AddressesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListMessagesParams

type ListMessagesParams struct {
	// TenantId Scope results to one tenant.
	TenantId       *TenantFilter                `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	ConversationId *string                      `form:"conversation_id,omitempty" json:"conversation_id,omitempty"`
	Direction      *ListMessagesParamsDirection `form:"direction,omitempty" json:"direction,omitempty"`
	Limit          *Limit                       `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListMessagesParams defines parameters for ListMessages.

type ListMessagesParamsDirection

type ListMessagesParamsDirection string

ListMessagesParamsDirection defines parameters for ListMessages.

const (
	ListMessagesParamsDirectionInbound  ListMessagesParamsDirection = "inbound"
	ListMessagesParamsDirectionOutbound ListMessagesParamsDirection = "outbound"
)

Defines values for ListMessagesParamsDirection.

func (ListMessagesParamsDirection) Valid

Valid indicates whether the value is a known member of the ListMessagesParamsDirection enum.

type ListMessagesResponse

type ListMessagesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []Message `json:"data"`
		HasMore bool      `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListMessagesResponse

func ParseListMessagesResponse(rsp *http.Response) (*ListMessagesResponse, error)

ParseListMessagesResponse parses an HTTP response from a ListMessagesWithResponse call

func (ListMessagesResponse) ContentType

func (r ListMessagesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListMessagesResponse) GetBody

func (r ListMessagesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListMessagesResponse) GetJSON200

func (r ListMessagesResponse) GetJSON200() *struct {
	Data    []Message `json:"data"`
	HasMore bool      `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListMessagesResponse) GetJSONDefault

func (r ListMessagesResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListMessagesResponse) Status

func (r ListMessagesResponse) Status() string

Status returns HTTPResponse.Status

func (ListMessagesResponse) StatusCode

func (r ListMessagesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListNumbersParams

type ListNumbersParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Limit    *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListNumbersParams defines parameters for ListNumbers.

type ListNumbersResponse

type ListNumbersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []PhoneNumber `json:"data"`
		HasMore bool          `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListNumbersResponse

func ParseListNumbersResponse(rsp *http.Response) (*ListNumbersResponse, error)

ParseListNumbersResponse parses an HTTP response from a ListNumbersWithResponse call

func (ListNumbersResponse) ContentType

func (r ListNumbersResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListNumbersResponse) GetBody

func (r ListNumbersResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListNumbersResponse) GetJSON200

func (r ListNumbersResponse) GetJSON200() *struct {
	Data    []PhoneNumber `json:"data"`
	HasMore bool          `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListNumbersResponse) GetJSONDefault

func (r ListNumbersResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListNumbersResponse) Status

func (r ListNumbersResponse) Status() string

Status returns HTTPResponse.Status

func (ListNumbersResponse) StatusCode

func (r ListNumbersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListOptOutsParams

type ListOptOutsParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Limit    *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListOptOutsParams defines parameters for ListOptOuts.

type ListOptOutsResponse

type ListOptOutsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []OptOut `json:"data"`
		HasMore bool     `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListOptOutsResponse

func ParseListOptOutsResponse(rsp *http.Response) (*ListOptOutsResponse, error)

ParseListOptOutsResponse parses an HTTP response from a ListOptOutsWithResponse call

func (ListOptOutsResponse) ContentType

func (r ListOptOutsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListOptOutsResponse) GetBody

func (r ListOptOutsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListOptOutsResponse) GetJSON200

func (r ListOptOutsResponse) GetJSON200() *struct {
	Data    []OptOut `json:"data"`
	HasMore bool     `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListOptOutsResponse) GetJSONDefault

func (r ListOptOutsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListOptOutsResponse) Status

func (r ListOptOutsResponse) Status() string

Status returns HTTPResponse.Status

func (ListOptOutsResponse) StatusCode

func (r ListOptOutsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListPortInsParams

type ListPortInsParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter            `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Status   *ListPortInsParamsStatus `form:"status,omitempty" json:"status,omitempty"`
	Limit    *Limit                   `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListPortInsParams defines parameters for ListPortIns.

type ListPortInsParamsStatus

type ListPortInsParamsStatus string

ListPortInsParamsStatus defines parameters for ListPortIns.

const (
	ListPortInsParamsStatusActionNeeded ListPortInsParamsStatus = "action_needed"
	ListPortInsParamsStatusCancelled    ListPortInsParamsStatus = "cancelled"
	ListPortInsParamsStatusCompleted    ListPortInsParamsStatus = "completed"
	ListPortInsParamsStatusDraft        ListPortInsParamsStatus = "draft"
	ListPortInsParamsStatusFocConfirmed ListPortInsParamsStatus = "foc_confirmed"
	ListPortInsParamsStatusInReview     ListPortInsParamsStatus = "in_review"
)

Defines values for ListPortInsParamsStatus.

func (ListPortInsParamsStatus) Valid

func (e ListPortInsParamsStatus) Valid() bool

Valid indicates whether the value is a known member of the ListPortInsParamsStatus enum.

type ListPortInsResponse

type ListPortInsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []PortIn `json:"data"`
		HasMore bool     `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListPortInsResponse

func ParseListPortInsResponse(rsp *http.Response) (*ListPortInsResponse, error)

ParseListPortInsResponse parses an HTTP response from a ListPortInsWithResponse call

func (ListPortInsResponse) ContentType

func (r ListPortInsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListPortInsResponse) GetBody

func (r ListPortInsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListPortInsResponse) GetJSON200

func (r ListPortInsResponse) GetJSON200() *struct {
	Data    []PortIn `json:"data"`
	HasMore bool     `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListPortInsResponse) GetJSONDefault

func (r ListPortInsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListPortInsResponse) Status

func (r ListPortInsResponse) Status() string

Status returns HTTPResponse.Status

func (ListPortInsResponse) StatusCode

func (r ListPortInsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListRoutingConfigsParams

type ListRoutingConfigsParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Limit    *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListRoutingConfigsParams defines parameters for ListRoutingConfigs.

type ListRoutingConfigsResponse

type ListRoutingConfigsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []RoutingConfig `json:"data"`
		HasMore bool            `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListRoutingConfigsResponse

func ParseListRoutingConfigsResponse(rsp *http.Response) (*ListRoutingConfigsResponse, error)

ParseListRoutingConfigsResponse parses an HTTP response from a ListRoutingConfigsWithResponse call

func (ListRoutingConfigsResponse) ContentType

func (r ListRoutingConfigsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListRoutingConfigsResponse) GetBody

func (r ListRoutingConfigsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListRoutingConfigsResponse) GetJSON200

func (r ListRoutingConfigsResponse) GetJSON200() *struct {
	Data    []RoutingConfig `json:"data"`
	HasMore bool            `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListRoutingConfigsResponse) GetJSONDefault

func (r ListRoutingConfigsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListRoutingConfigsResponse) Status

Status returns HTTPResponse.Status

func (ListRoutingConfigsResponse) StatusCode

func (r ListRoutingConfigsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListTenantsParams

type ListTenantsParams struct {
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`

	// ExternalRef Filter by your own identifier for the tenant.
	ExternalRef *string `form:"external_ref,omitempty" json:"external_ref,omitempty"`
}

ListTenantsParams defines parameters for ListTenants.

type ListTenantsResponse

type ListTenantsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []Tenant `json:"data"`
		HasMore bool     `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListTenantsResponse

func ParseListTenantsResponse(rsp *http.Response) (*ListTenantsResponse, error)

ParseListTenantsResponse parses an HTTP response from a ListTenantsWithResponse call

func (ListTenantsResponse) ContentType

func (r ListTenantsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListTenantsResponse) GetBody

func (r ListTenantsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListTenantsResponse) GetJSON200

func (r ListTenantsResponse) GetJSON200() *struct {
	Data    []Tenant `json:"data"`
	HasMore bool     `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListTenantsResponse) GetJSONDefault

func (r ListTenantsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListTenantsResponse) Status

func (r ListTenantsResponse) Status() string

Status returns HTTPResponse.Status

func (ListTenantsResponse) StatusCode

func (r ListTenantsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListVoicemailsParams

type ListVoicemailsParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Limit    *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListVoicemailsParams defines parameters for ListVoicemails.

type ListVoicemailsResponse

type ListVoicemailsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []Voicemail `json:"data"`
		HasMore bool        `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListVoicemailsResponse

func ParseListVoicemailsResponse(rsp *http.Response) (*ListVoicemailsResponse, error)

ParseListVoicemailsResponse parses an HTTP response from a ListVoicemailsWithResponse call

func (ListVoicemailsResponse) ContentType

func (r ListVoicemailsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListVoicemailsResponse) GetBody

func (r ListVoicemailsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListVoicemailsResponse) GetJSON200

func (r ListVoicemailsResponse) GetJSON200() *struct {
	Data    []Voicemail `json:"data"`
	HasMore bool        `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListVoicemailsResponse) GetJSONDefault

func (r ListVoicemailsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListVoicemailsResponse) Status

func (r ListVoicemailsResponse) Status() string

Status returns HTTPResponse.Status

func (ListVoicemailsResponse) StatusCode

func (r ListVoicemailsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListWebClientsParams

type ListWebClientsParams struct {
	// TenantId Scope results to one tenant.
	TenantId *TenantFilter `form:"tenant_id,omitempty" json:"tenant_id,omitempty"`
	Limit    *Limit        `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListWebClientsParams defines parameters for ListWebClients.

type ListWebClientsResponse

type ListWebClientsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []WebClient `json:"data"`
		HasMore bool        `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListWebClientsResponse

func ParseListWebClientsResponse(rsp *http.Response) (*ListWebClientsResponse, error)

ParseListWebClientsResponse parses an HTTP response from a ListWebClientsWithResponse call

func (ListWebClientsResponse) ContentType

func (r ListWebClientsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListWebClientsResponse) GetBody

func (r ListWebClientsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListWebClientsResponse) GetJSON200

func (r ListWebClientsResponse) GetJSON200() *struct {
	Data    []WebClient `json:"data"`
	HasMore bool        `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListWebClientsResponse) GetJSONDefault

func (r ListWebClientsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListWebClientsResponse) Status

func (r ListWebClientsResponse) Status() string

Status returns HTTPResponse.Status

func (ListWebClientsResponse) StatusCode

func (r ListWebClientsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListWebhookEndpointsParams

type ListWebhookEndpointsParams struct {
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// After Cursor from a previous page's `next_cursor`.
	After *After `form:"after,omitempty" json:"after,omitempty"`
}

ListWebhookEndpointsParams defines parameters for ListWebhookEndpoints.

type ListWebhookEndpointsResponse

type ListWebhookEndpointsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data    []WebhookEndpoint `json:"data"`
		HasMore bool              `json:"has_more"`

		// NextCursor Pass as `after` to fetch the next page.
		NextCursor *string `json:"next_cursor,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseListWebhookEndpointsResponse

func ParseListWebhookEndpointsResponse(rsp *http.Response) (*ListWebhookEndpointsResponse, error)

ParseListWebhookEndpointsResponse parses an HTTP response from a ListWebhookEndpointsWithResponse call

func (ListWebhookEndpointsResponse) ContentType

func (r ListWebhookEndpointsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListWebhookEndpointsResponse) GetBody

func (r ListWebhookEndpointsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListWebhookEndpointsResponse) GetJSON200

func (r ListWebhookEndpointsResponse) GetJSON200() *struct {
	Data    []WebhookEndpoint `json:"data"`
	HasMore bool              `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListWebhookEndpointsResponse) GetJSONDefault

func (r ListWebhookEndpointsResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListWebhookEndpointsResponse) Status

Status returns HTTPResponse.Status

func (ListWebhookEndpointsResponse) StatusCode

func (r ListWebhookEndpointsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Message

type Message struct {
	Body           *string          `json:"body,omitempty"`
	ConversationId string           `json:"conversation_id"`
	CreatedAt      time.Time        `json:"created_at"`
	Direction      MessageDirection `json:"direction"`

	// ErrorCode Set when status is `failed`.
	ErrorCode *string `json:"error_code,omitempty"`
	From      string  `json:"from"`

	// Id Examples: msg_01j8x3a
	Id        string    `json:"id"`
	MediaUrls *[]string `json:"media_urls,omitempty"`

	// Metadata Your own key–value data, returned unchanged on the object and its events.
	Metadata *Metadata `json:"metadata,omitempty"`

	// ScheduledAt When a scheduled message is due; null for immediate sends.
	ScheduledAt *time.Time `json:"scheduled_at,omitempty"`

	// Segments Billable SMS segments.
	Segments *int          `json:"segments,omitempty"`
	Status   MessageStatus `json:"status"`

	// StatusHistory Append-only status timeline.
	StatusHistory *[]struct {
		At     time.Time     `json:"at"`
		Status MessageStatus `json:"status"`
	} `json:"status_history,omitempty"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
	To       string        `json:"to"`
}

Message defines model for Message.

type MessageDeliveredJSONRequestBody

type MessageDeliveredJSONRequestBody = EventEnvelope

MessageDeliveredJSONRequestBody defines body for MessageDelivered for application/json ContentType.

type MessageDirection

type MessageDirection string

MessageDirection defines model for Message.Direction.

const (
	MessageDirectionInbound  MessageDirection = "inbound"
	MessageDirectionOutbound MessageDirection = "outbound"
)

Defines values for MessageDirection.

func (MessageDirection) Valid

func (e MessageDirection) Valid() bool

Valid indicates whether the value is a known member of the MessageDirection enum.

type MessageFailedJSONRequestBody

type MessageFailedJSONRequestBody = EventEnvelope

MessageFailedJSONRequestBody defines body for MessageFailed for application/json ContentType.

type MessageReceivedJSONRequestBody

type MessageReceivedJSONRequestBody = EventEnvelope

MessageReceivedJSONRequestBody defines body for MessageReceived for application/json ContentType.

type MessageStats added in v0.12.0

type MessageStats struct {
	End      time.Time `json:"end"`
	Outbound struct {
		Delivered int `json:"delivered"`

		// DeliveryRate delivered / (delivered + failed); 0 when none have settled.
		DeliveryRate   float32 `json:"delivery_rate"`
		Failed         int     `json:"failed"`
		FailureReasons []struct {
			// Code The `error_code`
			Code  string `json:"code"`
			Count int    `json:"count"`
		} `json:"failure_reasons"`

		// Pending Queued
		Pending int `json:"pending"`

		// Sent Accepted by the carrier
		Sent  int `json:"sent"`
		Total int `json:"total"`
	} `json:"outbound"`
	Start time.Time `json:"start"`
}

MessageStats defines model for MessageStats.

type MessageStatus

type MessageStatus string

MessageStatus defines model for MessageStatus.

const (
	MessageStatusDelivered MessageStatus = "delivered"
	MessageStatusFailed    MessageStatus = "failed"
	MessageStatusQueued    MessageStatus = "queued"
	MessageStatusReceived  MessageStatus = "received"
	MessageStatusScheduled MessageStatus = "scheduled"
	MessageStatusSending   MessageStatus = "sending"
	MessageStatusSent      MessageStatus = "sent"
)

Defines values for MessageStatus.

func (MessageStatus) Valid

func (e MessageStatus) Valid() bool

Valid indicates whether the value is a known member of the MessageStatus enum.

type Metadata

type Metadata map[string]string

Metadata Your own key–value data, returned unchanged on the object and its events.

type MintRealtimeTokenResponse

type MintRealtimeTokenResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *struct {
		ExpiresAt time.Time `json:"expires_at"`

		// Token Examples: hsrt_eyJhIjo…
		Token string `json:"token"`
		Url   string `json:"url"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseMintRealtimeTokenResponse

func ParseMintRealtimeTokenResponse(rsp *http.Response) (*MintRealtimeTokenResponse, error)

ParseMintRealtimeTokenResponse parses an HTTP response from a MintRealtimeTokenWithResponse call

func (MintRealtimeTokenResponse) ContentType

func (r MintRealtimeTokenResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (MintRealtimeTokenResponse) GetBody

func (r MintRealtimeTokenResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (MintRealtimeTokenResponse) GetJSON201

func (r MintRealtimeTokenResponse) GetJSON201() *struct {
	ExpiresAt time.Time `json:"expires_at"`

	// Token Examples: hsrt_eyJhIjo…
	Token string `json:"token"`
	Url   string `json:"url"`
}

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (MintRealtimeTokenResponse) GetJSONDefault

func (r MintRealtimeTokenResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (MintRealtimeTokenResponse) Status

func (r MintRealtimeTokenResponse) Status() string

Status returns HTTPResponse.Status

func (MintRealtimeTokenResponse) StatusCode

func (r MintRealtimeTokenResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type OptOut

type OptOut struct {
	ExternalNumber string        `json:"external_number"`
	OptedOutAt     time.Time     `json:"opted_out_at"`
	Source         *OptOutSource `json:"source,omitempty"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
}

OptOut defines model for OptOut.

type OptOutSource

type OptOutSource string

OptOutSource defines model for OptOut.Source.

const (
	Api         OptOutSource = "api"
	Carrier     OptOutSource = "carrier"
	StopKeyword OptOutSource = "stop_keyword"
)

Defines values for OptOutSource.

func (OptOutSource) Valid

func (e OptOutSource) Valid() bool

Valid indicates whether the value is a known member of the OptOutSource enum.

type Page

type Page struct {
	Data    []interface{} `json:"data"`
	HasMore bool          `json:"has_more"`

	// NextCursor Pass as `after` to fetch the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
}

Page defines model for Page.

type PhoneNumber

type PhoneNumber struct {
	CampaignId    *string                    `json:"campaign_id,omitempty"`
	Capabilities  *[]PhoneNumberCapabilities `json:"capabilities,omitempty"`
	CreatedAt     time.Time                  `json:"created_at"`
	E911AddressId *string                    `json:"e911_address_id,omitempty"`

	// Id Examples: num_01j8x31
	Id string `json:"id"`

	// MessagingReady True when attached to an approved campaign — outbound SMS allowed.
	MessagingReady  *bool             `json:"messaging_ready,omitempty"`
	PhoneNumber     string            `json:"phone_number"`
	RoutingConfigId *string           `json:"routing_config_id,omitempty"`
	Status          PhoneNumberStatus `json:"status"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
}

PhoneNumber defines model for PhoneNumber.

type PhoneNumberCapabilities

type PhoneNumberCapabilities string

PhoneNumberCapabilities defines model for PhoneNumber.Capabilities.

const (
	PhoneNumberCapabilitiesMms   PhoneNumberCapabilities = "mms"
	PhoneNumberCapabilitiesSms   PhoneNumberCapabilities = "sms"
	PhoneNumberCapabilitiesVoice PhoneNumberCapabilities = "voice"
)

Defines values for PhoneNumberCapabilities.

func (PhoneNumberCapabilities) Valid

func (e PhoneNumberCapabilities) Valid() bool

Valid indicates whether the value is a known member of the PhoneNumberCapabilities enum.

type PhoneNumberStatus

type PhoneNumberStatus string

PhoneNumberStatus defines model for PhoneNumber.Status.

const (
	PhoneNumberStatusActive    PhoneNumberStatus = "active"
	PhoneNumberStatusPending   PhoneNumberStatus = "pending"
	PhoneNumberStatusPortingIn PhoneNumberStatus = "porting_in"
	PhoneNumberStatusReleased  PhoneNumberStatus = "released"
)

Defines values for PhoneNumberStatus.

func (PhoneNumberStatus) Valid

func (e PhoneNumberStatus) Valid() bool

Valid indicates whether the value is a known member of the PhoneNumberStatus enum.

type PortIn

type PortIn struct {
	// AccountNumber Masked (••••1234).
	AccountNumber      string    `json:"account_number"`
	AuthorizedPerson   string    `json:"authorized_person"`
	BillingPhoneNumber string    `json:"billing_phone_number"`
	CreatedAt          time.Time `json:"created_at"`
	EntityName         string    `json:"entity_name"`

	// FocDate Firm order commitment — when the numbers switch over.
	FocDate *time.Time `json:"foc_date,omitempty"`

	// Id port_…
	Id             string        `json:"id"`
	PhoneNumbers   []string      `json:"phone_numbers"`
	ServiceAddress PortInAddress `json:"service_address"`

	// Status `draft` → `in_review` → `foc_confirmed` → `completed`.
	// `action_needed` means the losing carrier rejected something —
	// see `status_detail`, fix, and submit again. On `completed` the
	// numbers appear as active phone_numbers on the tenant.
	Status PortInStatus `json:"status"`

	// StatusDetail Carrier explanation when status is action_needed.
	StatusDetail *string `json:"status_detail,omitempty"`
	TenantId     string  `json:"tenant_id"`
}

PortIn defines model for PortIn.

type PortInAddress

type PortInAddress struct {
	City       string `json:"city"`
	PostalCode string `json:"postal_code"`

	// State 2-letter state code.
	State  string `json:"state"`
	Street string `json:"street"`
}

PortInAddress defines model for PortInAddress.

type PortInCreate

type PortInCreate struct {
	// AccountNumber Account number at the losing carrier. Encrypted at rest.
	AccountNumber string `json:"account_number"`

	// AuthorizedPerson Person authorized to move the numbers.
	AuthorizedPerson string `json:"authorized_person"`

	// BillingPhoneNumber The losing account's main billing number, E.164.
	BillingPhoneNumber string `json:"billing_phone_number"`

	// EntityName Account holder name exactly as the losing carrier has it.
	EntityName string `json:"entity_name"`

	// PhoneNumbers US numbers in E.164, up to 100, all from one losing carrier.
	PhoneNumbers []string `json:"phone_numbers"`

	// Pin Port-out PIN, when the losing carrier uses one. Encrypted at rest.
	Pin            *string       `json:"pin,omitempty"`
	ServiceAddress PortInAddress `json:"service_address"`

	// TenantId The tenant the ported numbers will belong to.
	TenantId string `json:"tenant_id"`
}

PortInCreate defines model for PortInCreate.

type PortInStatus

type PortInStatus string

PortInStatus `draft` → `in_review` → `foc_confirmed` → `completed`. `action_needed` means the losing carrier rejected something — see `status_detail`, fix, and submit again. On `completed` the numbers appear as active phone_numbers on the tenant.

const (
	PortInStatusActionNeeded PortInStatus = "action_needed"
	PortInStatusCancelled    PortInStatus = "cancelled"
	PortInStatusCompleted    PortInStatus = "completed"
	PortInStatusDraft        PortInStatus = "draft"
	PortInStatusFocConfirmed PortInStatus = "foc_confirmed"
	PortInStatusInReview     PortInStatus = "in_review"
)

Defines values for PortInStatus.

func (PortInStatus) Valid

func (e PortInStatus) Valid() bool

Valid indicates whether the value is a known member of the PortInStatus enum.

type PortabilityResult

type PortabilityResult struct {
	PhoneNumber string `json:"phone_number"`
	Portable    bool   `json:"portable"`

	// Reason Why the number can't be ported, when it can't.
	Reason *string `json:"reason,omitempty"`
}

PortabilityResult defines model for PortabilityResult.

type PurchaseNumberJSONBody

type PurchaseNumberJSONBody struct {
	// CampaignId 10DLC campaign to attach. Outbound SMS is blocked until the number is attached to an approved campaign.
	CampaignId *string `json:"campaign_id,omitempty"`

	// PhoneNumber E.164 number from a search result.
	//
	// Examples: +16025550134
	PhoneNumber string `json:"phone_number"`

	// RoutingConfigId Routing to apply to inbound calls on this number.
	RoutingConfigId *string `json:"routing_config_id,omitempty"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
}

PurchaseNumberJSONBody defines parameters for PurchaseNumber.

type PurchaseNumberJSONRequestBody

type PurchaseNumberJSONRequestBody PurchaseNumberJSONBody

PurchaseNumberJSONRequestBody defines body for PurchaseNumber for application/json ContentType.

type PurchaseNumberParams

type PurchaseNumberParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

PurchaseNumberParams defines parameters for PurchaseNumber.

type PurchaseNumberResponse

type PurchaseNumberResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *PhoneNumber
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParsePurchaseNumberResponse

func ParsePurchaseNumberResponse(rsp *http.Response) (*PurchaseNumberResponse, error)

ParsePurchaseNumberResponse parses an HTTP response from a PurchaseNumberWithResponse call

func (PurchaseNumberResponse) ContentType

func (r PurchaseNumberResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PurchaseNumberResponse) GetBody

func (r PurchaseNumberResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PurchaseNumberResponse) GetJSON201

func (r PurchaseNumberResponse) GetJSON201() *PhoneNumber

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (PurchaseNumberResponse) GetJSONDefault

func (r PurchaseNumberResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (PurchaseNumberResponse) Status

func (r PurchaseNumberResponse) Status() string

Status returns HTTPResponse.Status

func (PurchaseNumberResponse) StatusCode

func (r PurchaseNumberResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Recording

type Recording struct {
	// AudioUrl Time-limited download URL (valid 1 h).
	AudioUrl         *string   `json:"audio_url,omitempty"`
	CallId           string    `json:"call_id"`
	ConsentAnnounced *bool     `json:"consent_announced,omitempty"`
	CreatedAt        time.Time `json:"created_at"`
	DurationSeconds  int       `json:"duration_seconds"`

	// Id Examples: rec_01j8x48
	Id string `json:"id"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
}

Recording defines model for Recording.

type RecordingCompletedJSONRequestBody

type RecordingCompletedJSONRequestBody = EventEnvelope

RecordingCompletedJSONRequestBody defines body for RecordingCompleted for application/json ContentType.

type ReleaseNumberResponse

type ReleaseNumberResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseReleaseNumberResponse

func ParseReleaseNumberResponse(rsp *http.Response) (*ReleaseNumberResponse, error)

ParseReleaseNumberResponse parses an HTTP response from a ReleaseNumberWithResponse call

func (ReleaseNumberResponse) ContentType

func (r ReleaseNumberResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ReleaseNumberResponse) GetBody

func (r ReleaseNumberResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ReleaseNumberResponse) GetJSONDefault

func (r ReleaseNumberResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ReleaseNumberResponse) Status

func (r ReleaseNumberResponse) Status() string

Status returns HTTPResponse.Status

func (ReleaseNumberResponse) StatusCode

func (r ReleaseNumberResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RevokeWebClientResponse

type RevokeWebClientResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WebClient
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseRevokeWebClientResponse

func ParseRevokeWebClientResponse(rsp *http.Response) (*RevokeWebClientResponse, error)

ParseRevokeWebClientResponse parses an HTTP response from a RevokeWebClientWithResponse call

func (RevokeWebClientResponse) ContentType

func (r RevokeWebClientResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (RevokeWebClientResponse) GetBody

func (r RevokeWebClientResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (RevokeWebClientResponse) GetJSON200

func (r RevokeWebClientResponse) GetJSON200() *WebClient

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (RevokeWebClientResponse) GetJSONDefault

func (r RevokeWebClientResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (RevokeWebClientResponse) Status

func (r RevokeWebClientResponse) Status() string

Status returns HTTPResponse.Status

func (RevokeWebClientResponse) StatusCode

func (r RevokeWebClientResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RingBehavior

type RingBehavior struct {
	NoAnswer *VoicemailBehavior `json:"no_answer,omitempty"`

	// Strategy simultaneous rings every target at once; sequential rings them one at a time in order, each for `timeout_seconds`, falling to `no_answer` only after the last target's turn.
	Strategy *RingBehaviorStrategy `json:"strategy,omitempty"`

	// Targets Ring targets: E.164 numbers (cell phones, desk lines) and/or web clients as `client:<web_client_id>` — the browser softphone rings like any other phone. Multiple targets ring simultaneously; the first to answer takes the call and sees the caller's number. Revoked web clients are skipped at ring time. Numbers in high-cost access-stimulation exchanges are rejected with `destination_not_supported`.
	Targets []string `json:"targets"`

	// TimeoutSeconds How long each ring attempt waits — the whole group for simultaneous, per target for sequential.
	TimeoutSeconds *int        `json:"timeout_seconds,omitempty"`
	Type           interface{} `json:"type"`
}

RingBehavior defines model for RingBehavior.

type RingBehaviorStrategy

type RingBehaviorStrategy string

RingBehaviorStrategy simultaneous rings every target at once; sequential rings them one at a time in order, each for `timeout_seconds`, falling to `no_answer` only after the last target's turn.

const (
	Sequential   RingBehaviorStrategy = "sequential"
	Simultaneous RingBehaviorStrategy = "simultaneous"
)

Defines values for RingBehaviorStrategy.

func (RingBehaviorStrategy) Valid

func (e RingBehaviorStrategy) Valid() bool

Valid indicates whether the value is a known member of the RingBehaviorStrategy enum.

type RoutingConfig

type RoutingConfig struct {
	// BusinessHours Weekly schedule in the tenant's timezone. Omit for 24/7 `open_behavior`.
	BusinessHours *struct {
		Schedule *[]struct {
			// Close Examples: 17:30
			Close string                                   `json:"close"`
			Days  []RoutingConfigBusinessHoursScheduleDays `json:"days"`

			// Open Examples: 08:00
			Open string `json:"open"`
		} `json:"schedule,omitempty"`
	} `json:"business_hours,omitempty"`

	// ClosedBehavior Applied outside business hours. Defaults to voicemail.
	ClosedBehavior *RoutingConfig_ClosedBehavior `json:"closed_behavior,omitempty"`
	CreatedAt      time.Time                     `json:"created_at"`

	// Id Examples: rtc_01j8x3w
	Id string `json:"id"`

	// Name Examples: Main line
	Name         string       `json:"name"`
	OpenBehavior RingBehavior `json:"open_behavior"`
	Recording    *struct {
		// ConsentAnnouncement Play "this call may be recorded" before connecting. Handset forces this on when any party is in an all-party-consent state.
		ConsentAnnouncement *bool `json:"consent_announcement,omitempty"`
		Enabled             *bool `json:"enabled,omitempty"`
	} `json:"recording,omitempty"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
}

RoutingConfig defines model for RoutingConfig.

type RoutingConfigBusinessHoursScheduleDays

type RoutingConfigBusinessHoursScheduleDays string

RoutingConfigBusinessHoursScheduleDays defines model for RoutingConfig.BusinessHours.Schedule.Days.

const (
	RoutingConfigBusinessHoursScheduleDaysFri RoutingConfigBusinessHoursScheduleDays = "fri"
	RoutingConfigBusinessHoursScheduleDaysMon RoutingConfigBusinessHoursScheduleDays = "mon"
	RoutingConfigBusinessHoursScheduleDaysSat RoutingConfigBusinessHoursScheduleDays = "sat"
	RoutingConfigBusinessHoursScheduleDaysSun RoutingConfigBusinessHoursScheduleDays = "sun"
	RoutingConfigBusinessHoursScheduleDaysThu RoutingConfigBusinessHoursScheduleDays = "thu"
	RoutingConfigBusinessHoursScheduleDaysTue RoutingConfigBusinessHoursScheduleDays = "tue"
	RoutingConfigBusinessHoursScheduleDaysWed RoutingConfigBusinessHoursScheduleDays = "wed"
)

Defines values for RoutingConfigBusinessHoursScheduleDays.

func (RoutingConfigBusinessHoursScheduleDays) Valid

Valid indicates whether the value is a known member of the RoutingConfigBusinessHoursScheduleDays enum.

type RoutingConfigCreate

type RoutingConfigCreate struct {
	// BusinessHours Weekly schedule in the tenant's timezone. Omit for 24/7 `open_behavior`.
	BusinessHours *struct {
		Schedule *[]struct {
			// Close Examples: 17:30
			Close string                                         `json:"close"`
			Days  []RoutingConfigCreateBusinessHoursScheduleDays `json:"days"`

			// Open Examples: 08:00
			Open string `json:"open"`
		} `json:"schedule,omitempty"`
	} `json:"business_hours,omitempty"`

	// ClosedBehavior Applied outside business hours. Defaults to voicemail.
	ClosedBehavior *RoutingConfigCreate_ClosedBehavior `json:"closed_behavior,omitempty"`

	// Name Examples: Main line
	Name         string       `json:"name"`
	OpenBehavior RingBehavior `json:"open_behavior"`
	Recording    *struct {
		// ConsentAnnouncement Play "this call may be recorded" before connecting. Handset forces this on when any party is in an all-party-consent state.
		ConsentAnnouncement *bool `json:"consent_announcement,omitempty"`
		Enabled             *bool `json:"enabled,omitempty"`
	} `json:"recording,omitempty"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`
}

RoutingConfigCreate defines model for RoutingConfigCreate.

type RoutingConfigCreateBusinessHoursScheduleDays

type RoutingConfigCreateBusinessHoursScheduleDays string

RoutingConfigCreateBusinessHoursScheduleDays defines model for RoutingConfigCreate.BusinessHours.Schedule.Days.

const (
	RoutingConfigCreateBusinessHoursScheduleDaysFri RoutingConfigCreateBusinessHoursScheduleDays = "fri"
	RoutingConfigCreateBusinessHoursScheduleDaysMon RoutingConfigCreateBusinessHoursScheduleDays = "mon"
	RoutingConfigCreateBusinessHoursScheduleDaysSat RoutingConfigCreateBusinessHoursScheduleDays = "sat"
	RoutingConfigCreateBusinessHoursScheduleDaysSun RoutingConfigCreateBusinessHoursScheduleDays = "sun"
	RoutingConfigCreateBusinessHoursScheduleDaysThu RoutingConfigCreateBusinessHoursScheduleDays = "thu"
	RoutingConfigCreateBusinessHoursScheduleDaysTue RoutingConfigCreateBusinessHoursScheduleDays = "tue"
	RoutingConfigCreateBusinessHoursScheduleDaysWed RoutingConfigCreateBusinessHoursScheduleDays = "wed"
)

Defines values for RoutingConfigCreateBusinessHoursScheduleDays.

func (RoutingConfigCreateBusinessHoursScheduleDays) Valid

Valid indicates whether the value is a known member of the RoutingConfigCreateBusinessHoursScheduleDays enum.

type RoutingConfigCreate_ClosedBehavior

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

RoutingConfigCreate_ClosedBehavior Applied outside business hours. Defaults to voicemail.

func (RoutingConfigCreate_ClosedBehavior) AsRingBehavior

AsRingBehavior returns the union data inside the RoutingConfigCreate_ClosedBehavior as a RingBehavior

func (RoutingConfigCreate_ClosedBehavior) AsVoicemailBehavior

func (t RoutingConfigCreate_ClosedBehavior) AsVoicemailBehavior() (VoicemailBehavior, error)

AsVoicemailBehavior returns the union data inside the RoutingConfigCreate_ClosedBehavior as a VoicemailBehavior

func (*RoutingConfigCreate_ClosedBehavior) FromRingBehavior

func (t *RoutingConfigCreate_ClosedBehavior) FromRingBehavior(v RingBehavior) error

FromRingBehavior overwrites any union data inside the RoutingConfigCreate_ClosedBehavior as the provided RingBehavior

func (*RoutingConfigCreate_ClosedBehavior) FromVoicemailBehavior

func (t *RoutingConfigCreate_ClosedBehavior) FromVoicemailBehavior(v VoicemailBehavior) error

FromVoicemailBehavior overwrites any union data inside the RoutingConfigCreate_ClosedBehavior as the provided VoicemailBehavior

func (RoutingConfigCreate_ClosedBehavior) MarshalJSON

func (t RoutingConfigCreate_ClosedBehavior) MarshalJSON() ([]byte, error)

func (*RoutingConfigCreate_ClosedBehavior) MergeRingBehavior

func (t *RoutingConfigCreate_ClosedBehavior) MergeRingBehavior(v RingBehavior) error

MergeRingBehavior performs a merge with any union data inside the RoutingConfigCreate_ClosedBehavior, using the provided RingBehavior

func (*RoutingConfigCreate_ClosedBehavior) MergeVoicemailBehavior

func (t *RoutingConfigCreate_ClosedBehavior) MergeVoicemailBehavior(v VoicemailBehavior) error

MergeVoicemailBehavior performs a merge with any union data inside the RoutingConfigCreate_ClosedBehavior, using the provided VoicemailBehavior

func (*RoutingConfigCreate_ClosedBehavior) UnmarshalJSON

func (t *RoutingConfigCreate_ClosedBehavior) UnmarshalJSON(b []byte) error

type RoutingConfig_ClosedBehavior

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

RoutingConfig_ClosedBehavior Applied outside business hours. Defaults to voicemail.

func (RoutingConfig_ClosedBehavior) AsRingBehavior

func (t RoutingConfig_ClosedBehavior) AsRingBehavior() (RingBehavior, error)

AsRingBehavior returns the union data inside the RoutingConfig_ClosedBehavior as a RingBehavior

func (RoutingConfig_ClosedBehavior) AsVoicemailBehavior

func (t RoutingConfig_ClosedBehavior) AsVoicemailBehavior() (VoicemailBehavior, error)

AsVoicemailBehavior returns the union data inside the RoutingConfig_ClosedBehavior as a VoicemailBehavior

func (*RoutingConfig_ClosedBehavior) FromRingBehavior

func (t *RoutingConfig_ClosedBehavior) FromRingBehavior(v RingBehavior) error

FromRingBehavior overwrites any union data inside the RoutingConfig_ClosedBehavior as the provided RingBehavior

func (*RoutingConfig_ClosedBehavior) FromVoicemailBehavior

func (t *RoutingConfig_ClosedBehavior) FromVoicemailBehavior(v VoicemailBehavior) error

FromVoicemailBehavior overwrites any union data inside the RoutingConfig_ClosedBehavior as the provided VoicemailBehavior

func (RoutingConfig_ClosedBehavior) MarshalJSON

func (t RoutingConfig_ClosedBehavior) MarshalJSON() ([]byte, error)

func (*RoutingConfig_ClosedBehavior) MergeRingBehavior

func (t *RoutingConfig_ClosedBehavior) MergeRingBehavior(v RingBehavior) error

MergeRingBehavior performs a merge with any union data inside the RoutingConfig_ClosedBehavior, using the provided RingBehavior

func (*RoutingConfig_ClosedBehavior) MergeVoicemailBehavior

func (t *RoutingConfig_ClosedBehavior) MergeVoicemailBehavior(v VoicemailBehavior) error

MergeVoicemailBehavior performs a merge with any union data inside the RoutingConfig_ClosedBehavior, using the provided VoicemailBehavior

func (*RoutingConfig_ClosedBehavior) UnmarshalJSON

func (t *RoutingConfig_ClosedBehavior) UnmarshalJSON(b []byte) error

type SearchAvailableNumbersParams

type SearchAvailableNumbersParams struct {
	AreaCode *string `form:"area_code,omitempty" json:"area_code,omitempty"`

	// Locality City name, e.g. `Phoenix`.
	Locality *string `form:"locality,omitempty" json:"locality,omitempty"`

	// Contains Digit pattern the number should contain.
	Contains *string `form:"contains,omitempty" json:"contains,omitempty"`
	Limit    *Limit  `form:"limit,omitempty" json:"limit,omitempty"`
}

SearchAvailableNumbersParams defines parameters for SearchAvailableNumbers.

type SearchAvailableNumbersResponse

type SearchAvailableNumbersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Data []AvailableNumber `json:"data"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseSearchAvailableNumbersResponse

func ParseSearchAvailableNumbersResponse(rsp *http.Response) (*SearchAvailableNumbersResponse, error)

ParseSearchAvailableNumbersResponse parses an HTTP response from a SearchAvailableNumbersWithResponse call

func (SearchAvailableNumbersResponse) ContentType

func (r SearchAvailableNumbersResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (SearchAvailableNumbersResponse) GetBody

func (r SearchAvailableNumbersResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (SearchAvailableNumbersResponse) GetJSON200

func (r SearchAvailableNumbersResponse) GetJSON200() *struct {
	Data []AvailableNumber `json:"data"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (SearchAvailableNumbersResponse) GetJSONDefault

func (r SearchAvailableNumbersResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (SearchAvailableNumbersResponse) Status

Status returns HTTPResponse.Status

func (SearchAvailableNumbersResponse) StatusCode

func (r SearchAvailableNumbersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SendCallDtmf202JSONResponseBodyStatus

type SendCallDtmf202JSONResponseBodyStatus string

SendCallDtmf202JSONResponseBodyStatus defines parameters for SendCallDtmf.

const (
	SendCallDtmf202JSONResponseBodyStatusSent SendCallDtmf202JSONResponseBodyStatus = "sent"
)

Defines values for SendCallDtmf202JSONResponseBodyStatus.

func (SendCallDtmf202JSONResponseBodyStatus) Valid

Valid indicates whether the value is a known member of the SendCallDtmf202JSONResponseBodyStatus enum.

type SendCallDtmfJSONBody

type SendCallDtmfJSONBody struct {
	// Digits 0-9, A-D, *, #, plus pause characters w (0.5 s) and W (1 s). Example: "wwww4512#".
	Digits string `json:"digits"`
}

SendCallDtmfJSONBody defines parameters for SendCallDtmf.

type SendCallDtmfJSONRequestBody

type SendCallDtmfJSONRequestBody SendCallDtmfJSONBody

SendCallDtmfJSONRequestBody defines body for SendCallDtmf for application/json ContentType.

type SendCallDtmfResponse

type SendCallDtmfResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *struct {
		CallId string                                `json:"call_id"`
		Digits string                                `json:"digits"`
		Status SendCallDtmf202JSONResponseBodyStatus `json:"status"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseSendCallDtmfResponse

func ParseSendCallDtmfResponse(rsp *http.Response) (*SendCallDtmfResponse, error)

ParseSendCallDtmfResponse parses an HTTP response from a SendCallDtmfWithResponse call

func (SendCallDtmfResponse) ContentType

func (r SendCallDtmfResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (SendCallDtmfResponse) GetBody

func (r SendCallDtmfResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (SendCallDtmfResponse) GetJSON202

func (r SendCallDtmfResponse) GetJSON202() *struct {
	CallId string                                `json:"call_id"`
	Digits string                                `json:"digits"`
	Status SendCallDtmf202JSONResponseBodyStatus `json:"status"`
}

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (SendCallDtmfResponse) GetJSONDefault

func (r SendCallDtmfResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (SendCallDtmfResponse) Status

func (r SendCallDtmfResponse) Status() string

Status returns HTTPResponse.Status

func (SendCallDtmfResponse) StatusCode

func (r SendCallDtmfResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SendMessageJSONBody

type SendMessageJSONBody struct {
	Body *string `json:"body,omitempty"`

	// From A tenant number ID (`num_…`) or its E.164.
	From string `json:"from"`

	// MediaUrls Attach up to 10 publicly reachable `https://` URLs (images, PDFs, vCards — carrier limits apply, ~1 MB total is safe). Any media makes the message an MMS: billed per message instead of per segment, and the sending number must be MMS-capable. The carrier fetches each URL once at send time.
	MediaUrls *[]string `json:"media_urls,omitempty"`

	// Metadata Your own key–value data, returned unchanged on the object and its events.
	Metadata *Metadata `json:"metadata,omitempty"`

	// SendAt Schedule the message for later delivery (RFC 3339, at most 90 days out). Omit to send immediately. A scheduled message is created in `scheduled` status and dispatched at this time; until then it appears in listings with `scheduled_at` set.
	//
	//
	// Examples: 2026-09-01T15:00:00Z
	SendAt *time.Time `json:"send_at,omitempty"`

	// To Destination in E.164.
	//
	// Examples: +14805550199
	To string `json:"to"`
}

SendMessageJSONBody defines parameters for SendMessage.

type SendMessageJSONRequestBody

type SendMessageJSONRequestBody SendMessageJSONBody

SendMessageJSONRequestBody defines body for SendMessage for application/json ContentType.

type SendMessageParams

type SendMessageParams struct {
	// IdempotencyKey Retries with the same key within 24 h return the original response instead of repeating the action.
	IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}

SendMessageParams defines parameters for SendMessage.

type SendMessageResponse

type SendMessageResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *Message
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseSendMessageResponse

func ParseSendMessageResponse(rsp *http.Response) (*SendMessageResponse, error)

ParseSendMessageResponse parses an HTTP response from a SendMessageWithResponse call

func (SendMessageResponse) ContentType

func (r SendMessageResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (SendMessageResponse) GetBody

func (r SendMessageResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (SendMessageResponse) GetJSON202

func (r SendMessageResponse) GetJSON202() *Message

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (SendMessageResponse) GetJSONDefault

func (r SendMessageResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (SendMessageResponse) Status

func (r SendMessageResponse) Status() string

Status returns HTTPResponse.Status

func (SendMessageResponse) StatusCode

func (r SendMessageResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type StartCallTranscription202JSONResponseBodyStatus

type StartCallTranscription202JSONResponseBodyStatus string

StartCallTranscription202JSONResponseBodyStatus defines parameters for StartCallTranscription.

const (
	Transcribing StartCallTranscription202JSONResponseBodyStatus = "transcribing"
)

Defines values for StartCallTranscription202JSONResponseBodyStatus.

func (StartCallTranscription202JSONResponseBodyStatus) Valid

Valid indicates whether the value is a known member of the StartCallTranscription202JSONResponseBodyStatus enum.

type StartCallTranscriptionResponse

type StartCallTranscriptionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON202 the response for an HTTP 202 `application/json` response
	JSON202 *struct {
		CallId string                                          `json:"call_id"`
		Status StartCallTranscription202JSONResponseBodyStatus `json:"status"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseStartCallTranscriptionResponse

func ParseStartCallTranscriptionResponse(rsp *http.Response) (*StartCallTranscriptionResponse, error)

ParseStartCallTranscriptionResponse parses an HTTP response from a StartCallTranscriptionWithResponse call

func (StartCallTranscriptionResponse) ContentType

func (r StartCallTranscriptionResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (StartCallTranscriptionResponse) GetBody

func (r StartCallTranscriptionResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (StartCallTranscriptionResponse) GetJSON202

func (r StartCallTranscriptionResponse) GetJSON202() *struct {
	CallId string                                          `json:"call_id"`
	Status StartCallTranscription202JSONResponseBodyStatus `json:"status"`
}

GetJSON202 returns the response for an HTTP 202 `application/json` response

func (StartCallTranscriptionResponse) GetJSONDefault

func (r StartCallTranscriptionResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (StartCallTranscriptionResponse) Status

Status returns HTTPResponse.Status

func (StartCallTranscriptionResponse) StatusCode

func (r StartCallTranscriptionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type StopCallStreamResponse

type StopCallStreamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Stream
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseStopCallStreamResponse

func ParseStopCallStreamResponse(rsp *http.Response) (*StopCallStreamResponse, error)

ParseStopCallStreamResponse parses an HTTP response from a StopCallStreamWithResponse call

func (StopCallStreamResponse) ContentType

func (r StopCallStreamResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (StopCallStreamResponse) GetBody

func (r StopCallStreamResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (StopCallStreamResponse) GetJSON200

func (r StopCallStreamResponse) GetJSON200() *Stream

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (StopCallStreamResponse) GetJSONDefault

func (r StopCallStreamResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (StopCallStreamResponse) Status

func (r StopCallStreamResponse) Status() string

Status returns HTTPResponse.Status

func (StopCallStreamResponse) StatusCode

func (r StopCallStreamResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Stream

type Stream struct {
	CallId    string          `json:"call_id"`
	CreatedAt time.Time       `json:"created_at"`
	Direction StreamDirection `json:"direction"`

	// Id Examples: stm_01j8x4b
	Id        string       `json:"id"`
	StartedAt *time.Time   `json:"started_at,omitempty"`
	Status    StreamStatus `json:"status"`

	// StopReason Why the stream ended: call_ended | api_request | carrier_error | carrier_timeout | gateway_restart.
	StopReason *string    `json:"stop_reason,omitempty"`
	StoppedAt  *time.Time `json:"stopped_at,omitempty"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`

	// Token Connect token — returned once, at creation, and never readable again.
	Token *string     `json:"token,omitempty"`
	Track StreamTrack `json:"track"`

	// Url WebSocket endpoint to connect to (active streams only).
	Url *string `json:"url,omitempty"`
}

Stream defines model for Stream.

type StreamDirection

type StreamDirection string

StreamDirection defines model for Stream.Direction.

const (
	StreamDirectionBidirectional StreamDirection = "bidirectional"
	StreamDirectionFork          StreamDirection = "fork"
)

Defines values for StreamDirection.

func (StreamDirection) Valid

func (e StreamDirection) Valid() bool

Valid indicates whether the value is a known member of the StreamDirection enum.

type StreamStatus

type StreamStatus string

StreamStatus defines model for Stream.Status.

const (
	StreamStatusActive   StreamStatus = "active"
	StreamStatusFailed   StreamStatus = "failed"
	StreamStatusStarting StreamStatus = "starting"
	StreamStatusStopped  StreamStatus = "stopped"
)

Defines values for StreamStatus.

func (StreamStatus) Valid

func (e StreamStatus) Valid() bool

Valid indicates whether the value is a known member of the StreamStatus enum.

type StreamTrack

type StreamTrack string

StreamTrack defines model for Stream.Track.

const (
	StreamTrackBoth     StreamTrack = "both"
	StreamTrackInbound  StreamTrack = "inbound"
	StreamTrackOutbound StreamTrack = "outbound"
)

Defines values for StreamTrack.

func (StreamTrack) Valid

func (e StreamTrack) Valid() bool

Valid indicates whether the value is a known member of the StreamTrack enum.

type SubmitPortInResponse

type SubmitPortInResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *PortIn
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseSubmitPortInResponse

func ParseSubmitPortInResponse(rsp *http.Response) (*SubmitPortInResponse, error)

ParseSubmitPortInResponse parses an HTTP response from a SubmitPortInWithResponse call

func (SubmitPortInResponse) ContentType

func (r SubmitPortInResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (SubmitPortInResponse) GetBody

func (r SubmitPortInResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (SubmitPortInResponse) GetJSON200

func (r SubmitPortInResponse) GetJSON200() *PortIn

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (SubmitPortInResponse) GetJSONDefault

func (r SubmitPortInResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (SubmitPortInResponse) Status

func (r SubmitPortInResponse) Status() string

Status returns HTTPResponse.Status

func (SubmitPortInResponse) StatusCode

func (r SubmitPortInResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Tenant

type Tenant struct {
	CreatedAt time.Time `json:"created_at"`

	// ExternalRef Your own identifier for this customer.
	ExternalRef *string `json:"external_ref,omitempty"`

	// Id Examples: tnt_01j8x2z
	Id string `json:"id"`

	// Metadata Your own key–value data, returned unchanged on the object and its events.
	Metadata *Metadata `json:"metadata,omitempty"`

	// Name Display name, e.g. the business name.
	Name string `json:"name"`

	// Timezone IANA timezone; used for business-hours routing.
	Timezone *string `json:"timezone,omitempty"`
}

Tenant defines model for Tenant.

type TenantCreate

type TenantCreate struct {
	// ExternalRef Your own identifier for this customer.
	ExternalRef *string `json:"external_ref,omitempty"`

	// Metadata Your own key–value data, returned unchanged on the object and its events.
	Metadata *Metadata `json:"metadata,omitempty"`

	// Name Display name, e.g. the business name.
	Name string `json:"name"`

	// Timezone IANA timezone; used for business-hours routing.
	Timezone *string `json:"timezone,omitempty"`
}

TenantCreate defines model for TenantCreate.

type TenantFilter

type TenantFilter = string

TenantFilter defines model for TenantFilter.

type TenantId

type TenantId = string

TenantId defines model for TenantId.

type TenantIdField

type TenantIdField = string

TenantIdField The tenant this resource belongs to.

Examples: tnt_01j8x2z

type TenantUpdate

type TenantUpdate struct {
	ExternalRef *string `json:"external_ref,omitempty"`

	// Metadata Your own key–value data, returned unchanged on the object and its events.
	Metadata *Metadata `json:"metadata,omitempty"`
	Name     *string   `json:"name,omitempty"`
	Timezone *string   `json:"timezone,omitempty"`
}

TenantUpdate defines model for TenantUpdate.

type TestWebhookEndpointJSONBody

type TestWebhookEndpointJSONBody struct {
	EventType *string `json:"event_type,omitempty"`
}

TestWebhookEndpointJSONBody defines parameters for TestWebhookEndpoint.

type TestWebhookEndpointJSONRequestBody

type TestWebhookEndpointJSONRequestBody TestWebhookEndpointJSONBody

TestWebhookEndpointJSONRequestBody defines body for TestWebhookEndpoint for application/json ContentType.

type TestWebhookEndpointResponse

type TestWebhookEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		Delivered      *bool   `json:"delivered,omitempty"`
		Error          *string `json:"error,omitempty"`
		ResponseStatus *int    `json:"response_status,omitempty"`
	}
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseTestWebhookEndpointResponse

func ParseTestWebhookEndpointResponse(rsp *http.Response) (*TestWebhookEndpointResponse, error)

ParseTestWebhookEndpointResponse parses an HTTP response from a TestWebhookEndpointWithResponse call

func (TestWebhookEndpointResponse) ContentType

func (r TestWebhookEndpointResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (TestWebhookEndpointResponse) GetBody

func (r TestWebhookEndpointResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (TestWebhookEndpointResponse) GetJSON200

func (r TestWebhookEndpointResponse) GetJSON200() *struct {
	Delivered      *bool   `json:"delivered,omitempty"`
	Error          *string `json:"error,omitempty"`
	ResponseStatus *int    `json:"response_status,omitempty"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (TestWebhookEndpointResponse) GetJSONDefault

func (r TestWebhookEndpointResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (TestWebhookEndpointResponse) Status

Status returns HTTPResponse.Status

func (TestWebhookEndpointResponse) StatusCode

func (r TestWebhookEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UpdateNumberJSONBody

type UpdateNumberJSONBody struct {
	CampaignId      *string `json:"campaign_id,omitempty"`
	E911AddressId   *string `json:"e911_address_id,omitempty"`
	RoutingConfigId *string `json:"routing_config_id,omitempty"`
}

UpdateNumberJSONBody defines parameters for UpdateNumber.

type UpdateNumberJSONRequestBody

type UpdateNumberJSONRequestBody UpdateNumberJSONBody

UpdateNumberJSONRequestBody defines body for UpdateNumber for application/json ContentType.

type UpdateNumberResponse

type UpdateNumberResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *PhoneNumber
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseUpdateNumberResponse

func ParseUpdateNumberResponse(rsp *http.Response) (*UpdateNumberResponse, error)

ParseUpdateNumberResponse parses an HTTP response from a UpdateNumberWithResponse call

func (UpdateNumberResponse) ContentType

func (r UpdateNumberResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (UpdateNumberResponse) GetBody

func (r UpdateNumberResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (UpdateNumberResponse) GetJSON200

func (r UpdateNumberResponse) GetJSON200() *PhoneNumber

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (UpdateNumberResponse) GetJSONDefault

func (r UpdateNumberResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (UpdateNumberResponse) Status

func (r UpdateNumberResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateNumberResponse) StatusCode

func (r UpdateNumberResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UpdateRoutingConfigJSONRequestBody

type UpdateRoutingConfigJSONRequestBody = RoutingConfigCreate

UpdateRoutingConfigJSONRequestBody defines body for UpdateRoutingConfig for application/json ContentType.

type UpdateRoutingConfigResponse

type UpdateRoutingConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *RoutingConfig
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseUpdateRoutingConfigResponse

func ParseUpdateRoutingConfigResponse(rsp *http.Response) (*UpdateRoutingConfigResponse, error)

ParseUpdateRoutingConfigResponse parses an HTTP response from a UpdateRoutingConfigWithResponse call

func (UpdateRoutingConfigResponse) ContentType

func (r UpdateRoutingConfigResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (UpdateRoutingConfigResponse) GetBody

func (r UpdateRoutingConfigResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (UpdateRoutingConfigResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (UpdateRoutingConfigResponse) GetJSONDefault

func (r UpdateRoutingConfigResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (UpdateRoutingConfigResponse) Status

Status returns HTTPResponse.Status

func (UpdateRoutingConfigResponse) StatusCode

func (r UpdateRoutingConfigResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UpdateTenantJSONRequestBody

type UpdateTenantJSONRequestBody = TenantUpdate

UpdateTenantJSONRequestBody defines body for UpdateTenant for application/json ContentType.

type UpdateTenantResponse

type UpdateTenantResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Tenant
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseUpdateTenantResponse

func ParseUpdateTenantResponse(rsp *http.Response) (*UpdateTenantResponse, error)

ParseUpdateTenantResponse parses an HTTP response from a UpdateTenantWithResponse call

func (UpdateTenantResponse) ContentType

func (r UpdateTenantResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (UpdateTenantResponse) GetBody

func (r UpdateTenantResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (UpdateTenantResponse) GetJSON200

func (r UpdateTenantResponse) GetJSON200() *Tenant

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (UpdateTenantResponse) GetJSONDefault

func (r UpdateTenantResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (UpdateTenantResponse) Status

func (r UpdateTenantResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateTenantResponse) StatusCode

func (r UpdateTenantResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UpdateWebhookEndpointJSONRequestBody

type UpdateWebhookEndpointJSONRequestBody = WebhookEndpointCreate

UpdateWebhookEndpointJSONRequestBody defines body for UpdateWebhookEndpoint for application/json ContentType.

type UpdateWebhookEndpointResponse

type UpdateWebhookEndpointResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *WebhookEndpoint
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *Error
}

func ParseUpdateWebhookEndpointResponse

func ParseUpdateWebhookEndpointResponse(rsp *http.Response) (*UpdateWebhookEndpointResponse, error)

ParseUpdateWebhookEndpointResponse parses an HTTP response from a UpdateWebhookEndpointWithResponse call

func (UpdateWebhookEndpointResponse) ContentType

func (r UpdateWebhookEndpointResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (UpdateWebhookEndpointResponse) GetBody

func (r UpdateWebhookEndpointResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (UpdateWebhookEndpointResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (UpdateWebhookEndpointResponse) GetJSONDefault

func (r UpdateWebhookEndpointResponse) GetJSONDefault() *Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (UpdateWebhookEndpointResponse) Status

Status returns HTTPResponse.Status

func (UpdateWebhookEndpointResponse) StatusCode

func (r UpdateWebhookEndpointResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Voicemail

type Voicemail struct {
	// AudioUrl Time-limited download URL (valid 1 h; re-fetch for a fresh one).
	AudioUrl        *string   `json:"audio_url,omitempty"`
	CallId          string    `json:"call_id"`
	CreatedAt       time.Time `json:"created_at"`
	DurationSeconds int       `json:"duration_seconds"`
	From            *string   `json:"from,omitempty"`

	// Id Examples: vm_01j8x45
	Id string `json:"id"`

	// TenantId The tenant this resource belongs to.
	//
	// Examples: tnt_01j8x2z
	TenantId TenantIdField `json:"tenant_id"`

	// Transcript Null until transcription completes (`voicemail.created` fires again with it).
	Transcript *string `json:"transcript,omitempty"`
}

Voicemail defines model for Voicemail.

type VoicemailBehavior

type VoicemailBehavior struct {
	GreetingAudioUrl *string `json:"greeting_audio_url,omitempty"`

	// GreetingText Spoken via TTS when no custom greeting audio is set.
	GreetingText *string     `json:"greeting_text,omitempty"`
	Transcribe   *bool       `json:"transcribe,omitempty"`
	Type         interface{} `json:"type"`
}

VoicemailBehavior defines model for VoicemailBehavior.

type VoicemailCreatedJSONRequestBody

type VoicemailCreatedJSONRequestBody = EventEnvelope

VoicemailCreatedJSONRequestBody defines body for VoicemailCreated for application/json ContentType.

type WebClient

type WebClient struct {
	CreatedAt time.Time `json:"created_at"`

	// Id wc_…
	Id   string  `json:"id"`
	Name *string `json:"name,omitempty"`

	// SipUsername The client's dialable identity. Ring targets reference the web client as `client:<id>`; you never dial the SIP username directly.
	SipUsername string          `json:"sip_username"`
	Status      WebClientStatus `json:"status"`
	TenantId    *string         `json:"tenant_id"`
}

WebClient defines model for WebClient.

type WebClientCreate

type WebClientCreate struct {
	// Name Label for your own bookkeeping, e.g. an agent seat.
	Name     *string `json:"name,omitempty"`
	TenantId string  `json:"tenant_id"`
}

WebClientCreate defines model for WebClientCreate.

type WebClientStatus

type WebClientStatus string

WebClientStatus defines model for WebClient.Status.

const (
	WebClientStatusActive  WebClientStatus = "active"
	WebClientStatusRevoked WebClientStatus = "revoked"
)

Defines values for WebClientStatus.

func (WebClientStatus) Valid

func (e WebClientStatus) Valid() bool

Valid indicates whether the value is a known member of the WebClientStatus enum.

type WebClientToken

type WebClientToken struct {
	ExpiresAt time.Time `json:"expires_at"`

	// Token Browser login token. Treat as a secret with a short life — mint one per session, never store it.
	Token string `json:"token"`
}

WebClientToken defines model for WebClientToken.

type WebhookEndpoint

type WebhookEndpoint struct {
	CreatedAt   time.Time `json:"created_at"`
	Description *string   `json:"description,omitempty"`

	// EnabledEvents Event types to deliver; omit for all.
	EnabledEvents *[]string `json:"enabled_events,omitempty"`

	// Id Examples: whe_01j8x4b
	Id string `json:"id"`

	// Status Auto-disabled after sustained delivery failure.
	Status WebhookEndpointStatus `json:"status"`
	Url    string                `json:"url"`
}

WebhookEndpoint defines model for WebhookEndpoint.

type WebhookEndpointCreate

type WebhookEndpointCreate struct {
	Description *string `json:"description,omitempty"`

	// EnabledEvents Event types to deliver; omit for all.
	EnabledEvents *[]string `json:"enabled_events,omitempty"`
	Url           string    `json:"url"`
}

WebhookEndpointCreate defines model for WebhookEndpointCreate.

type WebhookEndpointStatus

type WebhookEndpointStatus string

WebhookEndpointStatus Auto-disabled after sustained delivery failure.

const (
	WebhookEndpointStatusActive   WebhookEndpointStatus = "active"
	WebhookEndpointStatusDisabled WebhookEndpointStatus = "disabled"
)

Defines values for WebhookEndpointStatus.

func (WebhookEndpointStatus) Valid

func (e WebhookEndpointStatus) Valid() bool

Valid indicates whether the value is a known member of the WebhookEndpointStatus enum.

type WebhookEndpointWithSecret

type WebhookEndpointWithSecret struct {
	CreatedAt   time.Time `json:"created_at"`
	Description *string   `json:"description,omitempty"`

	// EnabledEvents Event types to deliver; omit for all.
	EnabledEvents *[]string `json:"enabled_events,omitempty"`

	// Id Examples: whe_01j8x4b
	Id string `json:"id"`

	// Secret HMAC signing secret (`whsec_…`). Shown only on creation. Verify the `Handset-Signature` header on every delivery.
	Secret string `json:"secret"`

	// Status Auto-disabled after sustained delivery failure.
	Status WebhookEndpointWithSecretStatus `json:"status"`
	Url    string                          `json:"url"`
}

WebhookEndpointWithSecret defines model for WebhookEndpointWithSecret.

type WebhookEndpointWithSecretStatus

type WebhookEndpointWithSecretStatus string

WebhookEndpointWithSecretStatus Auto-disabled after sustained delivery failure.

const (
	WebhookEndpointWithSecretStatusActive   WebhookEndpointWithSecretStatus = "active"
	WebhookEndpointWithSecretStatusDisabled WebhookEndpointWithSecretStatus = "disabled"
)

Defines values for WebhookEndpointWithSecretStatus.

func (WebhookEndpointWithSecretStatus) Valid

Valid indicates whether the value is a known member of the WebhookEndpointWithSecretStatus enum.

type WebhookInitiator

type WebhookInitiator struct {
	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

WebhookInitiator sends OpenAPI 3.1 webhook requests to target URLs. Modeled on the generated Client, but with no stored Server -- the full target URL is provided per-call by the caller (typically discovered from a subscription registration).

func NewWebhookInitiator

func NewWebhookInitiator(opts ...WebhookInitiatorOption) (*WebhookInitiator, error)

NewWebhookInitiator creates a new WebhookInitiator with reasonable defaults.

func (*WebhookInitiator) BrandStatusChanged

func (p *WebhookInitiator) BrandStatusChanged(ctx context.Context, targetURL string, body BrandStatusChangedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) BrandStatusChangedWithBody

func (p *WebhookInitiator) BrandStatusChangedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallCompleted

func (p *WebhookInitiator) CallCompleted(ctx context.Context, targetURL string, body CallCompletedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallCompletedWithBody

func (p *WebhookInitiator) CallCompletedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallDtmf

func (p *WebhookInitiator) CallDtmf(ctx context.Context, targetURL string, body CallDtmfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallDtmfWithBody

func (p *WebhookInitiator) CallDtmfWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallGather

func (p *WebhookInitiator) CallGather(ctx context.Context, targetURL string, body CallGatherJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallGatherWithBody

func (p *WebhookInitiator) CallGatherWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStarted

func (p *WebhookInitiator) CallStarted(ctx context.Context, targetURL string, body CallStartedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStartedWithBody

func (p *WebhookInitiator) CallStartedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStreamFailed

func (p *WebhookInitiator) CallStreamFailed(ctx context.Context, targetURL string, body CallStreamFailedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStreamFailedWithBody

func (p *WebhookInitiator) CallStreamFailedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStreamStarted

func (p *WebhookInitiator) CallStreamStarted(ctx context.Context, targetURL string, body CallStreamStartedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStreamStartedWithBody

func (p *WebhookInitiator) CallStreamStartedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStreamStopped

func (p *WebhookInitiator) CallStreamStopped(ctx context.Context, targetURL string, body CallStreamStoppedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallStreamStoppedWithBody

func (p *WebhookInitiator) CallStreamStoppedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallSummary

func (p *WebhookInitiator) CallSummary(ctx context.Context, targetURL string, body CallSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CallSummaryWithBody

func (p *WebhookInitiator) CallSummaryWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CampaignStatusChanged

func (p *WebhookInitiator) CampaignStatusChanged(ctx context.Context, targetURL string, body CampaignStatusChangedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) CampaignStatusChangedWithBody

func (p *WebhookInitiator) CampaignStatusChangedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) MessageDelivered

func (p *WebhookInitiator) MessageDelivered(ctx context.Context, targetURL string, body MessageDeliveredJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) MessageDeliveredWithBody

func (p *WebhookInitiator) MessageDeliveredWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) MessageFailed

func (p *WebhookInitiator) MessageFailed(ctx context.Context, targetURL string, body MessageFailedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) MessageFailedWithBody

func (p *WebhookInitiator) MessageFailedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) MessageReceived

func (p *WebhookInitiator) MessageReceived(ctx context.Context, targetURL string, body MessageReceivedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) MessageReceivedWithBody

func (p *WebhookInitiator) MessageReceivedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) RecordingCompleted

func (p *WebhookInitiator) RecordingCompleted(ctx context.Context, targetURL string, body RecordingCompletedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) RecordingCompletedWithBody

func (p *WebhookInitiator) RecordingCompletedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) VoicemailCreated

func (p *WebhookInitiator) VoicemailCreated(ctx context.Context, targetURL string, body VoicemailCreatedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*WebhookInitiator) VoicemailCreatedWithBody

func (p *WebhookInitiator) VoicemailCreatedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type WebhookInitiatorInterface

type WebhookInitiatorInterface interface {
	// BrandStatusChangedWithBody fires the brand.status_changed webhook with any body
	BrandStatusChangedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	BrandStatusChanged(ctx context.Context, targetURL string, body BrandStatusChangedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallCompletedWithBody fires the call.completed webhook with any body
	CallCompletedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallCompleted(ctx context.Context, targetURL string, body CallCompletedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallDtmfWithBody fires the call.dtmf webhook with any body
	CallDtmfWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallDtmf(ctx context.Context, targetURL string, body CallDtmfJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallGatherWithBody fires the call.gather webhook with any body
	CallGatherWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallGather(ctx context.Context, targetURL string, body CallGatherJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallStartedWithBody fires the call.started webhook with any body
	CallStartedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallStarted(ctx context.Context, targetURL string, body CallStartedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallStreamFailedWithBody fires the call.stream.failed webhook with any body
	CallStreamFailedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallStreamFailed(ctx context.Context, targetURL string, body CallStreamFailedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallStreamStartedWithBody fires the call.stream.started webhook with any body
	CallStreamStartedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallStreamStarted(ctx context.Context, targetURL string, body CallStreamStartedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallStreamStoppedWithBody fires the call.stream.stopped webhook with any body
	CallStreamStoppedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallStreamStopped(ctx context.Context, targetURL string, body CallStreamStoppedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CallSummaryWithBody fires the call.summary webhook with any body
	CallSummaryWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CallSummary(ctx context.Context, targetURL string, body CallSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CampaignStatusChangedWithBody fires the campaign.status_changed webhook with any body
	CampaignStatusChangedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CampaignStatusChanged(ctx context.Context, targetURL string, body CampaignStatusChangedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MessageDeliveredWithBody fires the message.delivered webhook with any body
	MessageDeliveredWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	MessageDelivered(ctx context.Context, targetURL string, body MessageDeliveredJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MessageFailedWithBody fires the message.failed webhook with any body
	MessageFailedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	MessageFailed(ctx context.Context, targetURL string, body MessageFailedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MessageReceivedWithBody fires the message.received webhook with any body
	MessageReceivedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	MessageReceived(ctx context.Context, targetURL string, body MessageReceivedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RecordingCompletedWithBody fires the recording.completed webhook with any body
	RecordingCompletedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	RecordingCompleted(ctx context.Context, targetURL string, body RecordingCompletedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// VoicemailCreatedWithBody fires the voicemail.created webhook with any body
	VoicemailCreatedWithBody(ctx context.Context, targetURL string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	VoicemailCreated(ctx context.Context, targetURL string, body VoicemailCreatedJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

WebhookInitiatorInterface is the interface specification for the webhook initiator.

type WebhookInitiatorOption

type WebhookInitiatorOption func(*WebhookInitiator) error

WebhookInitiatorOption allows setting custom parameters during construction.

func WithWebhookHTTPClient

func WithWebhookHTTPClient(doer HttpRequestDoer) WebhookInitiatorOption

WithWebhookHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithWebhookRequestEditorFn

func WithWebhookRequestEditorFn(fn RequestEditorFn) WebhookInitiatorOption

WithWebhookRequestEditorFn allows setting up a callback function, which will be called right before sending the webhook request. This can be used to mutate the request, e.g. to add signature headers.

Directories

Path Synopsis
examples
send command
Command send fires a single SMS through the Handset API and prints the result.
Command send fires a single SMS through the Handset API and prints the result.

Jump to

Keyboard shortcuts

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