Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Address
- type AddressGetResponse
- type AddressListParams
- type AddressNewParams
- type AddressNewResponse
- type AddressService
- func (r *AddressService) Delete(ctx context.Context, addressID string, opts ...option.RequestOption) (err error)
- func (r *AddressService) Get(ctx context.Context, addressID string, opts ...option.RequestOption) (res *AddressGetResponse, err error)
- func (r *AddressService) List(ctx context.Context, query AddressListParams, opts ...option.RequestOption) (res *pagination.Cursor[Address], err error)
- func (r *AddressService) ListAutoPaging(ctx context.Context, query AddressListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Address]
- func (r *AddressService) New(ctx context.Context, body AddressNewParams, opts ...option.RequestOption) (res *AddressNewResponse, err error)
- type AddressStatus
- type Agent
- type AgentDocument
- type AgentExecution
- type AgentExecutionStatus
- type AgentFlow
- type AgentFlowStep
- type AgentFlowTrigger
- type AgentKnowledgeBase
- type AgentProvider
- type AgentResponse
- type AgentStats
- type AgentTool
- type AgentToolParameters
- type AgentToolParametersProperty
- type AvailablePhoneNumber
- type Broadcast
- type BroadcastCancelResponse
- type BroadcastChannel
- type BroadcastContact
- type BroadcastContactAddParams
- type BroadcastContactAddParamsContact
- type BroadcastContactAddResponse
- type BroadcastContactAddResponseError
- type BroadcastContactListParams
- type BroadcastContactRecipientType
- type BroadcastContactRemoveParams
- type BroadcastContactService
- func (r *BroadcastContactService) Add(ctx context.Context, broadcastID string, body BroadcastContactAddParams, ...) (res *BroadcastContactAddResponse, err error)
- func (r *BroadcastContactService) List(ctx context.Context, broadcastID string, query BroadcastContactListParams, ...) (res *pagination.Cursor[BroadcastContact], err error)
- func (r *BroadcastContactService) ListAutoPaging(ctx context.Context, broadcastID string, query BroadcastContactListParams, ...) *pagination.CursorAutoPager[BroadcastContact]
- func (r *BroadcastContactService) Remove(ctx context.Context, contactID string, body BroadcastContactRemoveParams, ...) (err error)
- type BroadcastContactStatus
- type BroadcastContent
- type BroadcastContentParam
- type BroadcastGetResponse
- type BroadcastListParams
- type BroadcastMessageType
- type BroadcastNewParams
- type BroadcastNewResponse
- type BroadcastProgress
- type BroadcastRescheduleParams
- type BroadcastRescheduleResponse
- type BroadcastReviewResult
- type BroadcastSendParams
- type BroadcastSendResponse
- type BroadcastService
- func (r *BroadcastService) Cancel(ctx context.Context, broadcastID string, opts ...option.RequestOption) (res *BroadcastCancelResponse, err error)
- func (r *BroadcastService) Delete(ctx context.Context, broadcastID string, opts ...option.RequestOption) (err error)
- func (r *BroadcastService) Get(ctx context.Context, broadcastID string, opts ...option.RequestOption) (res *BroadcastGetResponse, err error)
- func (r *BroadcastService) List(ctx context.Context, query BroadcastListParams, opts ...option.RequestOption) (res *pagination.Cursor[Broadcast], err error)
- func (r *BroadcastService) ListAutoPaging(ctx context.Context, query BroadcastListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Broadcast]
- func (r *BroadcastService) New(ctx context.Context, body BroadcastNewParams, opts ...option.RequestOption) (res *BroadcastNewResponse, err error)
- func (r *BroadcastService) Progress(ctx context.Context, broadcastID string, opts ...option.RequestOption) (res *BroadcastProgress, err error)
- func (r *BroadcastService) Reschedule(ctx context.Context, broadcastID string, body BroadcastRescheduleParams, ...) (res *BroadcastRescheduleResponse, err error)
- func (r *BroadcastService) Send(ctx context.Context, broadcastID string, body BroadcastSendParams, ...) (res *BroadcastSendResponse, err error)
- func (r *BroadcastService) Update(ctx context.Context, broadcastID string, body BroadcastUpdateParams, ...) (res *BroadcastUpdateResponse, err error)
- type BroadcastStatus
- type BroadcastUpdateParams
- type BroadcastUpdateResponse
- type Channel
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type Contact
- type ContactChannel
- type ContactChannelMetrics
- type ContactDefaultChannel
- type ContactListParams
- type ContactService
- func (r *ContactService) Get(ctx context.Context, contactID string, opts ...option.RequestOption) (res *Contact, err error)
- func (r *ContactService) GetByPhone(ctx context.Context, phoneNumber string, opts ...option.RequestOption) (res *Contact, err error)
- func (r *ContactService) List(ctx context.Context, query ContactListParams, opts ...option.RequestOption) (res *pagination.Cursor[Contact], err error)
- func (r *ContactService) ListAutoPaging(ctx context.Context, query ContactListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Contact]
- func (r *ContactService) Update(ctx context.Context, contactID string, body ContactUpdateParams, ...) (res *Contact, err error)
- type ContactUpdateParams
- type ContactUpdateParamsDefaultChannel
- type Error
- type IntrospectService
- type IntrospectValidatePhoneParams
- type IntrospectValidatePhoneResponse
- type IntrospectValidatePhoneResponseCarrier
- type LineType
- type Message
- type MessageContent
- type MessageContentButton
- type MessageContentButtonParam
- type MessageContentContact
- type MessageContentContactParam
- type MessageContentParam
- type MessageContentSection
- type MessageContentSectionParam
- type MessageContentSectionRow
- type MessageContentSectionRowParam
- type MessageListParams
- type MessageReactParams
- type MessageResponse
- type MessageSendParams
- type MessageService
- func (r *MessageService) Get(ctx context.Context, messageID string, opts ...option.RequestOption) (res *MessageResponse, err error)
- func (r *MessageService) List(ctx context.Context, query MessageListParams, opts ...option.RequestOption) (res *pagination.Cursor[Message], err error)
- func (r *MessageService) ListAutoPaging(ctx context.Context, query MessageListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Message]
- func (r *MessageService) React(ctx context.Context, messageID string, params MessageReactParams, ...) (res *MessageResponse, err error)
- func (r *MessageService) Send(ctx context.Context, params MessageSendParams, opts ...option.RequestOption) (res *MessageResponse, err error)
- type MessageStatus
- type MessageType
- type OwnedPhoneNumber
- type OwnedPhoneNumberPricing
- type PhoneNumberCapabilities
- type PhoneNumberGetResponse
- type PhoneNumberListParams
- type PhoneNumberPricing
- type PhoneNumberPurchaseParams
- type PhoneNumberPurchaseResponse
- type PhoneNumberRequirementsParams
- type PhoneNumberRequirementsResponse
- type PhoneNumberSearchAvailableParams
- type PhoneNumberSearchAvailableResponse
- type PhoneNumberService
- func (r *PhoneNumberService) Get(ctx context.Context, phoneNumberID string, opts ...option.RequestOption) (res *PhoneNumberGetResponse, err error)
- func (r *PhoneNumberService) List(ctx context.Context, query PhoneNumberListParams, opts ...option.RequestOption) (res *pagination.Cursor[OwnedPhoneNumber], err error)
- func (r *PhoneNumberService) ListAutoPaging(ctx context.Context, query PhoneNumberListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[OwnedPhoneNumber]
- func (r *PhoneNumberService) Purchase(ctx context.Context, body PhoneNumberPurchaseParams, ...) (res *PhoneNumberPurchaseResponse, err error)
- func (r *PhoneNumberService) Release(ctx context.Context, phoneNumberID string, opts ...option.RequestOption) (err error)
- func (r *PhoneNumberService) Requirements(ctx context.Context, query PhoneNumberRequirementsParams, ...) (res *PhoneNumberRequirementsResponse, err error)
- func (r *PhoneNumberService) SearchAvailable(ctx context.Context, query PhoneNumberSearchAvailableParams, ...) (res *PhoneNumberSearchAvailableResponse, err error)
- func (r *PhoneNumberService) Update(ctx context.Context, phoneNumberID string, body PhoneNumberUpdateParams, ...) (res *PhoneNumberUpdateResponse, err error)
- type PhoneNumberStatus
- type PhoneNumberType
- type PhoneNumberUpdateParams
- type PhoneNumberUpdateResponse
- type RegulatoryDocument
- type RegulatoryDocumentDocumentType
- type RegulatoryDocumentGetResponse
- type RegulatoryDocumentListParams
- type RegulatoryDocumentNewParams
- type RegulatoryDocumentNewParamsDocumentType
- type RegulatoryDocumentNewResponse
- type RegulatoryDocumentService
- func (r *RegulatoryDocumentService) Delete(ctx context.Context, documentID string, opts ...option.RequestOption) (err error)
- func (r *RegulatoryDocumentService) Get(ctx context.Context, documentID string, opts ...option.RequestOption) (res *RegulatoryDocumentGetResponse, err error)
- func (r *RegulatoryDocumentService) List(ctx context.Context, query RegulatoryDocumentListParams, ...) (res *pagination.Cursor[RegulatoryDocument], err error)
- func (r *RegulatoryDocumentService) ListAutoPaging(ctx context.Context, query RegulatoryDocumentListParams, ...) *pagination.CursorAutoPager[RegulatoryDocument]
- func (r *RegulatoryDocumentService) New(ctx context.Context, body RegulatoryDocumentNewParams, ...) (res *RegulatoryDocumentNewResponse, err error)
- func (r *RegulatoryDocumentService) UploadURL(ctx context.Context, opts ...option.RequestOption) (res *RegulatoryDocumentUploadURLResponse, err error)
- type RegulatoryDocumentStatus
- type RegulatoryDocumentUploadURLResponse
- type Requirement
- type RequirementAcceptanceCriteria
- type RequirementFieldType
- type RequirementType
- type Sender
- type SenderAgentExecutionListParams
- type SenderAgentExecutionService
- func (r *SenderAgentExecutionService) List(ctx context.Context, senderID string, query SenderAgentExecutionListParams, ...) (res *pagination.Cursor[AgentExecution], err error)
- func (r *SenderAgentExecutionService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentExecutionListParams, ...) *pagination.CursorAutoPager[AgentExecution]
- type SenderAgentFlowDeleteParams
- type SenderAgentFlowDuplicateParams
- type SenderAgentFlowDuplicateResponse
- type SenderAgentFlowGetParams
- type SenderAgentFlowGetResponse
- type SenderAgentFlowListParams
- type SenderAgentFlowNewParams
- type SenderAgentFlowNewParamsStep
- type SenderAgentFlowNewParamsTrigger
- type SenderAgentFlowNewResponse
- type SenderAgentFlowService
- func (r *SenderAgentFlowService) Delete(ctx context.Context, flowID string, body SenderAgentFlowDeleteParams, ...) (err error)
- func (r *SenderAgentFlowService) Duplicate(ctx context.Context, flowID string, params SenderAgentFlowDuplicateParams, ...) (res *SenderAgentFlowDuplicateResponse, err error)
- func (r *SenderAgentFlowService) Get(ctx context.Context, flowID string, query SenderAgentFlowGetParams, ...) (res *SenderAgentFlowGetResponse, err error)
- func (r *SenderAgentFlowService) List(ctx context.Context, senderID string, query SenderAgentFlowListParams, ...) (res *pagination.Cursor[AgentFlow], err error)
- func (r *SenderAgentFlowService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentFlowListParams, ...) *pagination.CursorAutoPager[AgentFlow]
- func (r *SenderAgentFlowService) New(ctx context.Context, senderID string, body SenderAgentFlowNewParams, ...) (res *SenderAgentFlowNewResponse, err error)
- func (r *SenderAgentFlowService) Update(ctx context.Context, flowID string, params SenderAgentFlowUpdateParams, ...) (res *SenderAgentFlowUpdateResponse, err error)
- type SenderAgentFlowUpdateParams
- type SenderAgentFlowUpdateParamsStep
- type SenderAgentFlowUpdateParamsTrigger
- type SenderAgentFlowUpdateResponse
- type SenderAgentKnowledgeBaseDeleteParams
- type SenderAgentKnowledgeBaseDocumentDeleteParams
- type SenderAgentKnowledgeBaseDocumentListParams
- type SenderAgentKnowledgeBaseDocumentNewParams
- type SenderAgentKnowledgeBaseDocumentNewResponse
- type SenderAgentKnowledgeBaseDocumentService
- func (r *SenderAgentKnowledgeBaseDocumentService) Delete(ctx context.Context, docID string, ...) (err error)
- func (r *SenderAgentKnowledgeBaseDocumentService) List(ctx context.Context, kbID string, ...) (res *pagination.Cursor[AgentDocument], err error)
- func (r *SenderAgentKnowledgeBaseDocumentService) ListAutoPaging(ctx context.Context, kbID string, ...) *pagination.CursorAutoPager[AgentDocument]
- func (r *SenderAgentKnowledgeBaseDocumentService) New(ctx context.Context, kbID string, ...) (res *SenderAgentKnowledgeBaseDocumentNewResponse, err error)
- type SenderAgentKnowledgeBaseGetParams
- type SenderAgentKnowledgeBaseGetResponse
- type SenderAgentKnowledgeBaseListParams
- type SenderAgentKnowledgeBaseNewParams
- type SenderAgentKnowledgeBaseNewResponse
- type SenderAgentKnowledgeBaseService
- func (r *SenderAgentKnowledgeBaseService) Delete(ctx context.Context, kbID string, body SenderAgentKnowledgeBaseDeleteParams, ...) (err error)
- func (r *SenderAgentKnowledgeBaseService) Get(ctx context.Context, kbID string, query SenderAgentKnowledgeBaseGetParams, ...) (res *SenderAgentKnowledgeBaseGetResponse, err error)
- func (r *SenderAgentKnowledgeBaseService) List(ctx context.Context, senderID string, query SenderAgentKnowledgeBaseListParams, ...) (res *pagination.Cursor[AgentKnowledgeBase], err error)
- func (r *SenderAgentKnowledgeBaseService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentKnowledgeBaseListParams, ...) *pagination.CursorAutoPager[AgentKnowledgeBase]
- func (r *SenderAgentKnowledgeBaseService) New(ctx context.Context, senderID string, body SenderAgentKnowledgeBaseNewParams, ...) (res *SenderAgentKnowledgeBaseNewResponse, err error)
- func (r *SenderAgentKnowledgeBaseService) Update(ctx context.Context, kbID string, params SenderAgentKnowledgeBaseUpdateParams, ...) (res *SenderAgentKnowledgeBaseUpdateResponse, err error)
- type SenderAgentKnowledgeBaseUpdateParams
- type SenderAgentKnowledgeBaseUpdateResponse
- type SenderAgentNewParams
- type SenderAgentService
- func (r *SenderAgentService) Delete(ctx context.Context, senderID string, opts ...option.RequestOption) (err error)
- func (r *SenderAgentService) Get(ctx context.Context, senderID string, opts ...option.RequestOption) (res *AgentResponse, err error)
- func (r *SenderAgentService) New(ctx context.Context, senderID string, body SenderAgentNewParams, ...) (res *AgentResponse, err error)
- func (r *SenderAgentService) Stats(ctx context.Context, senderID string, opts ...option.RequestOption) (res *AgentStats, err error)
- func (r *SenderAgentService) Update(ctx context.Context, senderID string, body SenderAgentUpdateParams, ...) (res *AgentResponse, err error)
- type SenderAgentToolDeleteParams
- type SenderAgentToolGetParams
- type SenderAgentToolGetResponse
- type SenderAgentToolListParams
- type SenderAgentToolNewParams
- type SenderAgentToolNewParamsParameters
- type SenderAgentToolNewParamsParametersProperty
- type SenderAgentToolNewResponse
- type SenderAgentToolService
- func (r *SenderAgentToolService) Delete(ctx context.Context, toolID string, body SenderAgentToolDeleteParams, ...) (err error)
- func (r *SenderAgentToolService) Get(ctx context.Context, toolID string, query SenderAgentToolGetParams, ...) (res *SenderAgentToolGetResponse, err error)
- func (r *SenderAgentToolService) List(ctx context.Context, senderID string, query SenderAgentToolListParams, ...) (res *pagination.Cursor[AgentTool], err error)
- func (r *SenderAgentToolService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentToolListParams, ...) *pagination.CursorAutoPager[AgentTool]
- func (r *SenderAgentToolService) New(ctx context.Context, senderID string, body SenderAgentToolNewParams, ...) (res *SenderAgentToolNewResponse, err error)
- func (r *SenderAgentToolService) Test(ctx context.Context, toolID string, params SenderAgentToolTestParams, ...) (res *SenderAgentToolTestResponse, err error)
- func (r *SenderAgentToolService) Update(ctx context.Context, toolID string, params SenderAgentToolUpdateParams, ...) (res *SenderAgentToolUpdateResponse, err error)
- type SenderAgentToolTestParams
- type SenderAgentToolTestResponse
- type SenderAgentToolUpdateParams
- type SenderAgentToolUpdateParamsParameters
- type SenderAgentToolUpdateParamsParametersProperty
- type SenderAgentToolUpdateResponse
- type SenderAgentUpdateParams
- type SenderListParams
- type SenderNewParams
- type SenderService
- func (r *SenderService) Delete(ctx context.Context, senderID string, opts ...option.RequestOption) (err error)
- func (r *SenderService) Get(ctx context.Context, senderID string, opts ...option.RequestOption) (res *Sender, err error)
- func (r *SenderService) GetProfile(ctx context.Context, senderID string, opts ...option.RequestOption) (res *WhatsappBusinessProfileResponse, err error)
- func (r *SenderService) List(ctx context.Context, query SenderListParams, opts ...option.RequestOption) (res *pagination.Cursor[Sender], err error)
- func (r *SenderService) ListAutoPaging(ctx context.Context, query SenderListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Sender]
- func (r *SenderService) New(ctx context.Context, body SenderNewParams, opts ...option.RequestOption) (res *Sender, err error)
- func (r *SenderService) RegenerateWebhookSecret(ctx context.Context, senderID string, opts ...option.RequestOption) (res *WebhookSecretResponse, err error)
- func (r *SenderService) Update(ctx context.Context, senderID string, body SenderUpdateParams, ...) (res *Sender, err error)
- func (r *SenderService) UpdateProfile(ctx context.Context, senderID string, body SenderUpdateProfileParams, ...) (res *SenderUpdateProfileResponse, err error)
- func (r *SenderService) UploadProfilePicture(ctx context.Context, senderID string, body SenderUploadProfilePictureParams, ...) (res *SenderUploadProfilePictureResponse, err error)
- type SenderUpdateParams
- type SenderUpdateProfileParams
- type SenderUpdateProfileResponse
- type SenderUploadProfilePictureParams
- type SenderUploadProfilePictureParamsMimeType
- type SenderUploadProfilePictureResponse
- type SenderWebhook
- type SenderWhatsapp
- type SenderWhatsappPaymentStatus
- type Template
- type TemplateButton
- type TemplateListParams
- type TemplateNewParams
- type TemplateNewParamsButton
- type TemplateService
- func (r *TemplateService) Delete(ctx context.Context, templateID string, opts ...option.RequestOption) (err error)
- func (r *TemplateService) Get(ctx context.Context, templateID string, opts ...option.RequestOption) (res *Template, err error)
- func (r *TemplateService) List(ctx context.Context, query TemplateListParams, opts ...option.RequestOption) (res *pagination.Cursor[Template], err error)
- func (r *TemplateService) ListAutoPaging(ctx context.Context, query TemplateListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Template]
- func (r *TemplateService) New(ctx context.Context, body TemplateNewParams, opts ...option.RequestOption) (res *Template, err error)
- func (r *TemplateService) Submit(ctx context.Context, templateID string, body TemplateSubmitParams, ...) (res *Template, err error)
- type TemplateStatus
- type TemplateSubmitParams
- type TemplateWhatsapp
- type WebhookEvent
- type WebhookSecretResponse
- type WhatsappBusinessProfile
- type WhatsappBusinessProfileResponse
- type WhatsappBusinessProfileVertical
- type WhatsappCategory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (ZAVUDEV_API_KEY, ZAVUDEV_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Address ¶
type Address struct {
ID string `json:"id" api:"required"`
CountryCode string `json:"countryCode" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Locality string `json:"locality" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
// Any of "pending", "verified", "rejected".
Status AddressStatus `json:"status" api:"required"`
StreetAddress string `json:"streetAddress" api:"required"`
AdministrativeArea string `json:"administrativeArea" api:"nullable"`
BusinessName string `json:"businessName" api:"nullable"`
ExtendedAddress string `json:"extendedAddress" api:"nullable"`
FirstName string `json:"firstName" api:"nullable"`
LastName string `json:"lastName" api:"nullable"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CountryCode respjson.Field
CreatedAt respjson.Field
Locality respjson.Field
PostalCode respjson.Field
Status respjson.Field
StreetAddress respjson.Field
AdministrativeArea respjson.Field
BusinessName respjson.Field
ExtendedAddress respjson.Field
FirstName respjson.Field
LastName respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A regulatory address for phone number requirements.
func (*Address) UnmarshalJSON ¶
type AddressGetResponse ¶
type AddressGetResponse struct {
// A regulatory address for phone number requirements.
Address Address `json:"address" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AddressGetResponse) RawJSON ¶
func (r AddressGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AddressGetResponse) UnmarshalJSON ¶
func (r *AddressGetResponse) UnmarshalJSON(data []byte) error
type AddressListParams ¶
type AddressListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AddressListParams) URLQuery ¶
func (r AddressListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AddressListParams's query parameters as `url.Values`.
type AddressNewParams ¶
type AddressNewParams struct {
CountryCode string `json:"countryCode" api:"required"`
Locality string `json:"locality" api:"required"`
PostalCode string `json:"postalCode" api:"required"`
StreetAddress string `json:"streetAddress" api:"required"`
AdministrativeArea param.Opt[string] `json:"administrativeArea,omitzero"`
BusinessName param.Opt[string] `json:"businessName,omitzero"`
ExtendedAddress param.Opt[string] `json:"extendedAddress,omitzero"`
FirstName param.Opt[string] `json:"firstName,omitzero"`
LastName param.Opt[string] `json:"lastName,omitzero"`
// contains filtered or unexported fields
}
func (AddressNewParams) MarshalJSON ¶
func (r AddressNewParams) MarshalJSON() (data []byte, err error)
func (*AddressNewParams) UnmarshalJSON ¶
func (r *AddressNewParams) UnmarshalJSON(data []byte) error
type AddressNewResponse ¶
type AddressNewResponse struct {
// A regulatory address for phone number requirements.
Address Address `json:"address" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Address respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AddressNewResponse) RawJSON ¶
func (r AddressNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AddressNewResponse) UnmarshalJSON ¶
func (r *AddressNewResponse) UnmarshalJSON(data []byte) error
type AddressService ¶
type AddressService struct {
Options []option.RequestOption
}
AddressService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAddressService method instead.
func NewAddressService ¶
func NewAddressService(opts ...option.RequestOption) (r AddressService)
NewAddressService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AddressService) Delete ¶
func (r *AddressService) Delete(ctx context.Context, addressID string, opts ...option.RequestOption) (err error)
Delete a regulatory address. Cannot delete addresses that are in use.
func (*AddressService) Get ¶
func (r *AddressService) Get(ctx context.Context, addressID string, opts ...option.RequestOption) (res *AddressGetResponse, err error)
Get a specific regulatory address.
func (*AddressService) List ¶
func (r *AddressService) List(ctx context.Context, query AddressListParams, opts ...option.RequestOption) (res *pagination.Cursor[Address], err error)
List regulatory addresses for this project.
func (*AddressService) ListAutoPaging ¶
func (r *AddressService) ListAutoPaging(ctx context.Context, query AddressListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Address]
List regulatory addresses for this project.
func (*AddressService) New ¶
func (r *AddressService) New(ctx context.Context, body AddressNewParams, opts ...option.RequestOption) (res *AddressNewResponse, err error)
Create a regulatory address for phone number purchases. Some countries require a verified address before phone numbers can be activated.
type AddressStatus ¶
type AddressStatus string
const ( AddressStatusPending AddressStatus = "pending" AddressStatusVerified AddressStatus = "verified" AddressStatusRejected AddressStatus = "rejected" )
type Agent ¶
type Agent struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Whether the agent is active.
Enabled bool `json:"enabled" api:"required"`
// Model ID (e.g., gpt-4o-mini, claude-3-5-sonnet).
Model string `json:"model" api:"required"`
Name string `json:"name" api:"required"`
// LLM provider for the AI agent.
//
// Any of "openai", "anthropic", "google", "mistral", "zavu".
Provider AgentProvider `json:"provider" api:"required"`
SenderID string `json:"senderId" api:"required"`
// System prompt for the agent.
SystemPrompt string `json:"systemPrompt" api:"required"`
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// Number of previous messages to include as context.
ContextWindowMessages int64 `json:"contextWindowMessages"`
// Whether to include contact metadata in context.
IncludeContactMetadata bool `json:"includeContactMetadata"`
// Maximum tokens for LLM response.
MaxTokens int64 `json:"maxTokens" api:"nullable"`
Stats AgentStats `json:"stats"`
// LLM temperature (0-2).
Temperature float64 `json:"temperature" api:"nullable"`
// Channels that trigger the agent.
TriggerOnChannels []string `json:"triggerOnChannels"`
// Message types that trigger the agent.
TriggerOnMessageTypes []string `json:"triggerOnMessageTypes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Enabled respjson.Field
Model respjson.Field
Name respjson.Field
Provider respjson.Field
SenderID respjson.Field
SystemPrompt respjson.Field
UpdatedAt respjson.Field
ContextWindowMessages respjson.Field
IncludeContactMetadata respjson.Field
MaxTokens respjson.Field
Stats respjson.Field
Temperature respjson.Field
TriggerOnChannels respjson.Field
TriggerOnMessageTypes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
AI Agent configuration for a sender.
func (*Agent) UnmarshalJSON ¶
type AgentDocument ¶
type AgentDocument struct {
ID string `json:"id" api:"required"`
// Number of chunks created from this document.
ChunkCount int64 `json:"chunkCount" api:"required"`
// Length of the document content in characters.
ContentLength int64 `json:"contentLength" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Whether the document has been processed for RAG.
IsProcessed bool `json:"isProcessed" api:"required"`
KnowledgeBaseID string `json:"knowledgeBaseId" api:"required"`
Title string `json:"title" api:"required"`
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ChunkCount respjson.Field
ContentLength respjson.Field
CreatedAt respjson.Field
IsProcessed respjson.Field
KnowledgeBaseID respjson.Field
Title respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentDocument) RawJSON ¶
func (r AgentDocument) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentDocument) UnmarshalJSON ¶
func (r *AgentDocument) UnmarshalJSON(data []byte) error
type AgentExecution ¶
type AgentExecution struct {
ID string `json:"id" api:"required"`
AgentID string `json:"agentId" api:"required"`
// Cost in USD.
Cost float64 `json:"cost" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
InputTokens int64 `json:"inputTokens" api:"required"`
LatencyMs int64 `json:"latencyMs" api:"required"`
OutputTokens int64 `json:"outputTokens" api:"required"`
// Status of an agent execution.
//
// Any of "success", "error", "filtered", "rate_limited", "balance_insufficient".
Status AgentExecutionStatus `json:"status" api:"required"`
ErrorMessage string `json:"errorMessage" api:"nullable"`
InboundMessageID string `json:"inboundMessageId"`
ResponseMessageID string `json:"responseMessageId" api:"nullable"`
ResponseText string `json:"responseText" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AgentID respjson.Field
Cost respjson.Field
CreatedAt respjson.Field
InputTokens respjson.Field
LatencyMs respjson.Field
OutputTokens respjson.Field
Status respjson.Field
ErrorMessage respjson.Field
InboundMessageID respjson.Field
ResponseMessageID respjson.Field
ResponseText respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentExecution) RawJSON ¶
func (r AgentExecution) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentExecution) UnmarshalJSON ¶
func (r *AgentExecution) UnmarshalJSON(data []byte) error
type AgentExecutionStatus ¶
type AgentExecutionStatus string
Status of an agent execution.
const ( AgentExecutionStatusSuccess AgentExecutionStatus = "success" AgentExecutionStatusError AgentExecutionStatus = "error" AgentExecutionStatusFiltered AgentExecutionStatus = "filtered" AgentExecutionStatusRateLimited AgentExecutionStatus = "rate_limited" AgentExecutionStatusBalanceInsufficient AgentExecutionStatus = "balance_insufficient" )
type AgentFlow ¶
type AgentFlow struct {
ID string `json:"id" api:"required"`
AgentID string `json:"agentId" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Enabled bool `json:"enabled" api:"required"`
Name string `json:"name" api:"required"`
// Priority when multiple flows match (higher = more priority).
Priority int64 `json:"priority" api:"required"`
Steps []AgentFlowStep `json:"steps" api:"required"`
Trigger AgentFlowTrigger `json:"trigger" api:"required"`
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
Description string `json:"description" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AgentID respjson.Field
CreatedAt respjson.Field
Enabled respjson.Field
Name respjson.Field
Priority respjson.Field
Steps respjson.Field
Trigger respjson.Field
UpdatedAt respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*AgentFlow) UnmarshalJSON ¶
type AgentFlowStep ¶
type AgentFlowStep struct {
// Unique step identifier.
ID string `json:"id" api:"required"`
// Step configuration (varies by type).
Config map[string]any `json:"config" api:"required"`
// Type of flow step.
//
// Any of "message", "collect", "condition", "tool", "llm", "transfer".
Type string `json:"type" api:"required"`
// ID of the next step to execute.
NextStepID string `json:"nextStepId" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Config respjson.Field
Type respjson.Field
NextStepID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentFlowStep) RawJSON ¶
func (r AgentFlowStep) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentFlowStep) UnmarshalJSON ¶
func (r *AgentFlowStep) UnmarshalJSON(data []byte) error
type AgentFlowTrigger ¶
type AgentFlowTrigger struct {
// Type of trigger for a flow.
//
// Any of "keyword", "intent", "always", "manual".
Type string `json:"type" api:"required"`
// Intent that triggers the flow (for intent type).
Intent string `json:"intent"`
// Keywords that trigger the flow (for keyword type).
Keywords []string `json:"keywords"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Intent respjson.Field
Keywords respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentFlowTrigger) RawJSON ¶
func (r AgentFlowTrigger) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentFlowTrigger) UnmarshalJSON ¶
func (r *AgentFlowTrigger) UnmarshalJSON(data []byte) error
type AgentKnowledgeBase ¶
type AgentKnowledgeBase struct {
ID string `json:"id" api:"required"`
AgentID string `json:"agentId" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
DocumentCount int64 `json:"documentCount" api:"required"`
Name string `json:"name" api:"required"`
TotalChunks int64 `json:"totalChunks" api:"required"`
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
Description string `json:"description" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AgentID respjson.Field
CreatedAt respjson.Field
DocumentCount respjson.Field
Name respjson.Field
TotalChunks respjson.Field
UpdatedAt respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentKnowledgeBase) RawJSON ¶
func (r AgentKnowledgeBase) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentKnowledgeBase) UnmarshalJSON ¶
func (r *AgentKnowledgeBase) UnmarshalJSON(data []byte) error
type AgentProvider ¶
type AgentProvider string
LLM provider for the AI agent.
const ( AgentProviderOpenAI AgentProvider = "openai" AgentProviderAnthropic AgentProvider = "anthropic" AgentProviderGoogle AgentProvider = "google" AgentProviderMistral AgentProvider = "mistral" AgentProviderZavu AgentProvider = "zavu" )
type AgentResponse ¶
type AgentResponse struct {
// AI Agent configuration for a sender.
Agent Agent `json:"agent" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Agent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentResponse) RawJSON ¶
func (r AgentResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentResponse) UnmarshalJSON ¶
func (r *AgentResponse) UnmarshalJSON(data []byte) error
type AgentStats ¶
type AgentStats struct {
// Total cost in USD.
TotalCost float64 `json:"totalCost"`
TotalInvocations int64 `json:"totalInvocations"`
TotalTokensUsed int64 `json:"totalTokensUsed"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
TotalCost respjson.Field
TotalInvocations respjson.Field
TotalTokensUsed respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentStats) RawJSON ¶
func (r AgentStats) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentStats) UnmarshalJSON ¶
func (r *AgentStats) UnmarshalJSON(data []byte) error
type AgentTool ¶
type AgentTool struct {
ID string `json:"id" api:"required"`
AgentID string `json:"agentId" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Description for the LLM to understand when to use this tool.
Description string `json:"description" api:"required"`
Enabled bool `json:"enabled" api:"required"`
Name string `json:"name" api:"required"`
Parameters AgentToolParameters `json:"parameters" api:"required"`
UpdatedAt time.Time `json:"updatedAt" api:"required" format:"date-time"`
// HTTPS URL to call when the tool is executed.
WebhookURL string `json:"webhookUrl" api:"required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AgentID respjson.Field
CreatedAt respjson.Field
Description respjson.Field
Enabled respjson.Field
Name respjson.Field
Parameters respjson.Field
UpdatedAt respjson.Field
WebhookURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*AgentTool) UnmarshalJSON ¶
type AgentToolParameters ¶
type AgentToolParameters struct {
Properties map[string]AgentToolParametersProperty `json:"properties" api:"required"`
Required []string `json:"required" api:"required"`
// Any of "object".
Type string `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Properties respjson.Field
Required respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentToolParameters) RawJSON ¶
func (r AgentToolParameters) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentToolParameters) UnmarshalJSON ¶
func (r *AgentToolParameters) UnmarshalJSON(data []byte) error
type AgentToolParametersProperty ¶
type AgentToolParametersProperty struct {
Description string `json:"description"`
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Description respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentToolParametersProperty) RawJSON ¶
func (r AgentToolParametersProperty) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentToolParametersProperty) UnmarshalJSON ¶
func (r *AgentToolParametersProperty) UnmarshalJSON(data []byte) error
type AvailablePhoneNumber ¶
type AvailablePhoneNumber struct {
Capabilities PhoneNumberCapabilities `json:"capabilities" api:"required"`
PhoneNumber string `json:"phoneNumber" api:"required"`
Pricing PhoneNumberPricing `json:"pricing" api:"required"`
FriendlyName string `json:"friendlyName"`
Locality string `json:"locality"`
Region string `json:"region"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Capabilities respjson.Field
PhoneNumber respjson.Field
Pricing respjson.Field
FriendlyName respjson.Field
Locality respjson.Field
Region respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AvailablePhoneNumber) RawJSON ¶
func (r AvailablePhoneNumber) RawJSON() string
Returns the unmodified JSON received from the API
func (*AvailablePhoneNumber) UnmarshalJSON ¶
func (r *AvailablePhoneNumber) UnmarshalJSON(data []byte) error
type Broadcast ¶
type Broadcast struct {
ID string `json:"id" api:"required"`
// Broadcast delivery channel. Use 'smart' for per-contact intelligent routing.
//
// Any of "smart", "sms", "sms_oneway", "whatsapp", "telegram", "email",
// "instagram", "voice".
Channel BroadcastChannel `json:"channel" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Type of message for broadcast.
//
// Any of "text", "image", "video", "audio", "document", "template".
MessageType BroadcastMessageType `json:"messageType" api:"required"`
Name string `json:"name" api:"required"`
// Current status of the broadcast.
//
// Any of "draft", "pending_review", "approved", "rejected", "escalated",
// "rejected_final", "scheduled", "sending", "paused", "completed", "cancelled",
// "failed".
Status BroadcastStatus `json:"status" api:"required"`
// Total number of contacts in the broadcast.
TotalContacts int64 `json:"totalContacts" api:"required"`
// Actual cost so far in USD.
ActualCost float64 `json:"actualCost" api:"nullable"`
CompletedAt time.Time `json:"completedAt" format:"date-time"`
// Content for non-text broadcast message types.
Content BroadcastContent `json:"content"`
DeliveredCount int64 `json:"deliveredCount"`
EmailSubject string `json:"emailSubject"`
// Estimated total cost in USD.
EstimatedCost float64 `json:"estimatedCost" api:"nullable"`
FailedCount int64 `json:"failedCount"`
Metadata map[string]string `json:"metadata"`
PendingCount int64 `json:"pendingCount"`
// Amount reserved from balance in USD.
ReservedAmount float64 `json:"reservedAmount" api:"nullable"`
// Number of review attempts (max 3).
ReviewAttempts int64 `json:"reviewAttempts" api:"nullable"`
// AI content review result.
ReviewResult BroadcastReviewResult `json:"reviewResult" api:"nullable"`
ScheduledAt time.Time `json:"scheduledAt" format:"date-time"`
SenderID string `json:"senderId"`
SendingCount int64 `json:"sendingCount"`
StartedAt time.Time `json:"startedAt" format:"date-time"`
Text string `json:"text"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Channel respjson.Field
CreatedAt respjson.Field
MessageType respjson.Field
Name respjson.Field
Status respjson.Field
TotalContacts respjson.Field
ActualCost respjson.Field
CompletedAt respjson.Field
Content respjson.Field
DeliveredCount respjson.Field
EmailSubject respjson.Field
EstimatedCost respjson.Field
FailedCount respjson.Field
Metadata respjson.Field
PendingCount respjson.Field
ReservedAmount respjson.Field
ReviewAttempts respjson.Field
ReviewResult respjson.Field
ScheduledAt respjson.Field
SenderID respjson.Field
SendingCount respjson.Field
StartedAt respjson.Field
Text respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Broadcast) UnmarshalJSON ¶
type BroadcastCancelResponse ¶
type BroadcastCancelResponse struct {
Broadcast Broadcast `json:"broadcast" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Broadcast respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastCancelResponse) RawJSON ¶
func (r BroadcastCancelResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastCancelResponse) UnmarshalJSON ¶
func (r *BroadcastCancelResponse) UnmarshalJSON(data []byte) error
type BroadcastChannel ¶
type BroadcastChannel string
Broadcast delivery channel. Use 'smart' for per-contact intelligent routing.
const ( BroadcastChannelSmart BroadcastChannel = "smart" BroadcastChannelSMS BroadcastChannel = "sms" BroadcastChannelSMSOneway BroadcastChannel = "sms_oneway" BroadcastChannelWhatsapp BroadcastChannel = "whatsapp" BroadcastChannelTelegram BroadcastChannel = "telegram" BroadcastChannelEmail BroadcastChannel = "email" BroadcastChannelInstagram BroadcastChannel = "instagram" BroadcastChannelVoice BroadcastChannel = "voice" )
type BroadcastContact ¶
type BroadcastContact struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Recipient string `json:"recipient" api:"required"`
// Any of "phone", "email".
RecipientType BroadcastContactRecipientType `json:"recipientType" api:"required"`
// Status of a contact within a broadcast.
//
// Any of "pending", "queued", "sending", "delivered", "failed", "skipped".
Status BroadcastContactStatus `json:"status" api:"required"`
Cost float64 `json:"cost" api:"nullable"`
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
// Associated message ID after processing.
MessageID string `json:"messageId"`
ProcessedAt time.Time `json:"processedAt" format:"date-time"`
TemplateVariables map[string]string `json:"templateVariables"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Recipient respjson.Field
RecipientType respjson.Field
Status respjson.Field
Cost respjson.Field
ErrorCode respjson.Field
ErrorMessage respjson.Field
MessageID respjson.Field
ProcessedAt respjson.Field
TemplateVariables respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastContact) RawJSON ¶
func (r BroadcastContact) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastContact) UnmarshalJSON ¶
func (r *BroadcastContact) UnmarshalJSON(data []byte) error
type BroadcastContactAddParams ¶
type BroadcastContactAddParams struct {
// List of contacts to add (max 1000 per request).
Contacts []BroadcastContactAddParamsContact `json:"contacts,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (BroadcastContactAddParams) MarshalJSON ¶
func (r BroadcastContactAddParams) MarshalJSON() (data []byte, err error)
func (*BroadcastContactAddParams) UnmarshalJSON ¶
func (r *BroadcastContactAddParams) UnmarshalJSON(data []byte) error
type BroadcastContactAddParamsContact ¶
type BroadcastContactAddParamsContact struct {
// Phone number (E.164) or email address.
Recipient string `json:"recipient" api:"required"`
// Per-contact template variables to personalize the message.
TemplateVariables map[string]string `json:"templateVariables,omitzero"`
// contains filtered or unexported fields
}
The property Recipient is required.
func (BroadcastContactAddParamsContact) MarshalJSON ¶
func (r BroadcastContactAddParamsContact) MarshalJSON() (data []byte, err error)
func (*BroadcastContactAddParamsContact) UnmarshalJSON ¶
func (r *BroadcastContactAddParamsContact) UnmarshalJSON(data []byte) error
type BroadcastContactAddResponse ¶
type BroadcastContactAddResponse struct {
// Number of contacts successfully added.
Added int64 `json:"added" api:"required"`
// Number of duplicate contacts skipped.
Duplicates int64 `json:"duplicates" api:"required"`
// Number of invalid contacts rejected.
Invalid int64 `json:"invalid" api:"required"`
// Details about invalid contacts.
Errors []BroadcastContactAddResponseError `json:"errors"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Added respjson.Field
Duplicates respjson.Field
Invalid respjson.Field
Errors respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastContactAddResponse) RawJSON ¶
func (r BroadcastContactAddResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastContactAddResponse) UnmarshalJSON ¶
func (r *BroadcastContactAddResponse) UnmarshalJSON(data []byte) error
type BroadcastContactAddResponseError ¶
type BroadcastContactAddResponseError struct {
Reason string `json:"reason"`
Recipient string `json:"recipient"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Reason respjson.Field
Recipient respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastContactAddResponseError) RawJSON ¶
func (r BroadcastContactAddResponseError) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastContactAddResponseError) UnmarshalJSON ¶
func (r *BroadcastContactAddResponseError) UnmarshalJSON(data []byte) error
type BroadcastContactListParams ¶
type BroadcastContactListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Status of a contact within a broadcast.
//
// Any of "pending", "queued", "sending", "delivered", "failed", "skipped".
Status BroadcastContactStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BroadcastContactListParams) URLQuery ¶
func (r BroadcastContactListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BroadcastContactListParams's query parameters as `url.Values`.
type BroadcastContactRecipientType ¶
type BroadcastContactRecipientType string
const ( BroadcastContactRecipientTypePhone BroadcastContactRecipientType = "phone" BroadcastContactRecipientTypeEmail BroadcastContactRecipientType = "email" )
type BroadcastContactRemoveParams ¶
type BroadcastContactRemoveParams struct {
BroadcastID string `path:"broadcastId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type BroadcastContactService ¶
type BroadcastContactService struct {
Options []option.RequestOption
}
BroadcastContactService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBroadcastContactService method instead.
func NewBroadcastContactService ¶
func NewBroadcastContactService(opts ...option.RequestOption) (r BroadcastContactService)
NewBroadcastContactService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BroadcastContactService) Add ¶
func (r *BroadcastContactService) Add(ctx context.Context, broadcastID string, body BroadcastContactAddParams, opts ...option.RequestOption) (res *BroadcastContactAddResponse, err error)
Add contacts to a broadcast in batch. Maximum 1000 contacts per request.
func (*BroadcastContactService) List ¶
func (r *BroadcastContactService) List(ctx context.Context, broadcastID string, query BroadcastContactListParams, opts ...option.RequestOption) (res *pagination.Cursor[BroadcastContact], err error)
List contacts in a broadcast with optional status filter.
func (*BroadcastContactService) ListAutoPaging ¶
func (r *BroadcastContactService) ListAutoPaging(ctx context.Context, broadcastID string, query BroadcastContactListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[BroadcastContact]
List contacts in a broadcast with optional status filter.
func (*BroadcastContactService) Remove ¶
func (r *BroadcastContactService) Remove(ctx context.Context, contactID string, body BroadcastContactRemoveParams, opts ...option.RequestOption) (err error)
Remove a contact from a broadcast in draft status.
type BroadcastContactStatus ¶
type BroadcastContactStatus string
Status of a contact within a broadcast.
const ( BroadcastContactStatusPending BroadcastContactStatus = "pending" BroadcastContactStatusQueued BroadcastContactStatus = "queued" BroadcastContactStatusSending BroadcastContactStatus = "sending" BroadcastContactStatusDelivered BroadcastContactStatus = "delivered" BroadcastContactStatusFailed BroadcastContactStatus = "failed" BroadcastContactStatusSkipped BroadcastContactStatus = "skipped" )
type BroadcastContent ¶
type BroadcastContent struct {
// Filename for documents.
Filename string `json:"filename"`
// Media ID if already uploaded.
MediaID string `json:"mediaId"`
// URL of the media file.
MediaURL string `json:"mediaUrl"`
// MIME type of the media.
MimeType string `json:"mimeType"`
// Template ID for template messages.
TemplateID string `json:"templateId"`
// Default template variables (can be overridden per contact).
TemplateVariables map[string]string `json:"templateVariables"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Filename respjson.Field
MediaID respjson.Field
MediaURL respjson.Field
MimeType respjson.Field
TemplateID respjson.Field
TemplateVariables respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Content for non-text broadcast message types.
func (BroadcastContent) RawJSON ¶
func (r BroadcastContent) RawJSON() string
Returns the unmodified JSON received from the API
func (BroadcastContent) ToParam ¶
func (r BroadcastContent) ToParam() BroadcastContentParam
ToParam converts this BroadcastContent to a BroadcastContentParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BroadcastContentParam.Overrides()
func (*BroadcastContent) UnmarshalJSON ¶
func (r *BroadcastContent) UnmarshalJSON(data []byte) error
type BroadcastContentParam ¶
type BroadcastContentParam struct {
// Filename for documents.
Filename param.Opt[string] `json:"filename,omitzero"`
// Media ID if already uploaded.
MediaID param.Opt[string] `json:"mediaId,omitzero"`
// URL of the media file.
MediaURL param.Opt[string] `json:"mediaUrl,omitzero"`
// MIME type of the media.
MimeType param.Opt[string] `json:"mimeType,omitzero"`
// Template ID for template messages.
TemplateID param.Opt[string] `json:"templateId,omitzero"`
// Default template variables (can be overridden per contact).
TemplateVariables map[string]string `json:"templateVariables,omitzero"`
// contains filtered or unexported fields
}
Content for non-text broadcast message types.
func (BroadcastContentParam) MarshalJSON ¶
func (r BroadcastContentParam) MarshalJSON() (data []byte, err error)
func (*BroadcastContentParam) UnmarshalJSON ¶
func (r *BroadcastContentParam) UnmarshalJSON(data []byte) error
type BroadcastGetResponse ¶
type BroadcastGetResponse struct {
Broadcast Broadcast `json:"broadcast" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Broadcast respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastGetResponse) RawJSON ¶
func (r BroadcastGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastGetResponse) UnmarshalJSON ¶
func (r *BroadcastGetResponse) UnmarshalJSON(data []byte) error
type BroadcastListParams ¶
type BroadcastListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Current status of the broadcast.
//
// Any of "draft", "pending_review", "approved", "rejected", "escalated",
// "rejected_final", "scheduled", "sending", "paused", "completed", "cancelled",
// "failed".
Status BroadcastStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (BroadcastListParams) URLQuery ¶
func (r BroadcastListParams) URLQuery() (v url.Values, err error)
URLQuery serializes BroadcastListParams's query parameters as `url.Values`.
type BroadcastMessageType ¶
type BroadcastMessageType string
Type of message for broadcast.
const ( BroadcastMessageTypeText BroadcastMessageType = "text" BroadcastMessageTypeImage BroadcastMessageType = "image" BroadcastMessageTypeVideo BroadcastMessageType = "video" BroadcastMessageTypeAudio BroadcastMessageType = "audio" BroadcastMessageTypeDocument BroadcastMessageType = "document" BroadcastMessageTypeTemplate BroadcastMessageType = "template" )
type BroadcastNewParams ¶
type BroadcastNewParams struct {
// Broadcast delivery channel. Use 'smart' for per-contact intelligent routing.
//
// Any of "smart", "sms", "sms_oneway", "whatsapp", "telegram", "email",
// "instagram", "voice".
Channel BroadcastChannel `json:"channel,omitzero" api:"required"`
// Name of the broadcast campaign.
Name string `json:"name" api:"required"`
// HTML body for email broadcasts.
EmailHTMLBody param.Opt[string] `json:"emailHtmlBody,omitzero"`
// Email subject line. Required for email broadcasts.
EmailSubject param.Opt[string] `json:"emailSubject,omitzero"`
// Idempotency key to prevent duplicate broadcasts.
IdempotencyKey param.Opt[string] `json:"idempotencyKey,omitzero"`
// Schedule the broadcast for future delivery.
ScheduledAt param.Opt[time.Time] `json:"scheduledAt,omitzero" format:"date-time"`
// Sender profile ID. Uses default sender if omitted.
SenderID param.Opt[string] `json:"senderId,omitzero"`
// Text content or caption. Supports template variables: {{name}}, {{1}}, etc.
Text param.Opt[string] `json:"text,omitzero"`
// Content for non-text broadcast message types.
Content BroadcastContentParam `json:"content,omitzero"`
// Type of message for broadcast.
//
// Any of "text", "image", "video", "audio", "document", "template".
MessageType BroadcastMessageType `json:"messageType,omitzero"`
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (BroadcastNewParams) MarshalJSON ¶
func (r BroadcastNewParams) MarshalJSON() (data []byte, err error)
func (*BroadcastNewParams) UnmarshalJSON ¶
func (r *BroadcastNewParams) UnmarshalJSON(data []byte) error
type BroadcastNewResponse ¶
type BroadcastNewResponse struct {
Broadcast Broadcast `json:"broadcast" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Broadcast respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastNewResponse) RawJSON ¶
func (r BroadcastNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastNewResponse) UnmarshalJSON ¶
func (r *BroadcastNewResponse) UnmarshalJSON(data []byte) error
type BroadcastProgress ¶
type BroadcastProgress struct {
BroadcastID string `json:"broadcastId" api:"required"`
// Successfully delivered.
Delivered int64 `json:"delivered" api:"required"`
// Failed to deliver.
Failed int64 `json:"failed" api:"required"`
// Not yet queued for sending.
Pending int64 `json:"pending" api:"required"`
// Percentage complete (0-100).
PercentComplete float64 `json:"percentComplete" api:"required"`
// Currently being sent.
Sending int64 `json:"sending" api:"required"`
// Skipped (broadcast cancelled).
Skipped int64 `json:"skipped" api:"required"`
// Current status of the broadcast.
//
// Any of "draft", "pending_review", "approved", "rejected", "escalated",
// "rejected_final", "scheduled", "sending", "paused", "completed", "cancelled",
// "failed".
Status BroadcastStatus `json:"status" api:"required"`
// Total contacts in broadcast.
Total int64 `json:"total" api:"required"`
// Actual cost so far in USD.
ActualCost float64 `json:"actualCost" api:"nullable"`
EstimatedCompletionAt time.Time `json:"estimatedCompletionAt" format:"date-time"`
// Estimated total cost in USD.
EstimatedCost float64 `json:"estimatedCost" api:"nullable"`
// Amount reserved from balance in USD.
ReservedAmount float64 `json:"reservedAmount" api:"nullable"`
StartedAt time.Time `json:"startedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BroadcastID respjson.Field
Delivered respjson.Field
Failed respjson.Field
Pending respjson.Field
PercentComplete respjson.Field
Sending respjson.Field
Skipped respjson.Field
Status respjson.Field
Total respjson.Field
ActualCost respjson.Field
EstimatedCompletionAt respjson.Field
EstimatedCost respjson.Field
ReservedAmount respjson.Field
StartedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastProgress) RawJSON ¶
func (r BroadcastProgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastProgress) UnmarshalJSON ¶
func (r *BroadcastProgress) UnmarshalJSON(data []byte) error
type BroadcastRescheduleParams ¶
type BroadcastRescheduleParams struct {
// New scheduled time for the broadcast.
ScheduledAt time.Time `json:"scheduledAt" api:"required" format:"date-time"`
// contains filtered or unexported fields
}
func (BroadcastRescheduleParams) MarshalJSON ¶
func (r BroadcastRescheduleParams) MarshalJSON() (data []byte, err error)
func (*BroadcastRescheduleParams) UnmarshalJSON ¶
func (r *BroadcastRescheduleParams) UnmarshalJSON(data []byte) error
type BroadcastRescheduleResponse ¶
type BroadcastRescheduleResponse struct {
Broadcast Broadcast `json:"broadcast" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Broadcast respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastRescheduleResponse) RawJSON ¶
func (r BroadcastRescheduleResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastRescheduleResponse) UnmarshalJSON ¶
func (r *BroadcastRescheduleResponse) UnmarshalJSON(data []byte) error
type BroadcastReviewResult ¶
type BroadcastReviewResult struct {
// Policy categories violated, if any.
Categories []string `json:"categories"`
// Problematic text fragments, if any.
FlaggedContent []string `json:"flaggedContent" api:"nullable"`
// Explanation of the review decision.
Reasoning string `json:"reasoning"`
ReviewedAt time.Time `json:"reviewedAt" format:"date-time"`
// Content safety score from 0.0 to 1.0, where 1.0 is completely safe.
Score float64 `json:"score"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Categories respjson.Field
FlaggedContent respjson.Field
Reasoning respjson.Field
ReviewedAt respjson.Field
Score respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
AI content review result.
func (BroadcastReviewResult) RawJSON ¶
func (r BroadcastReviewResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastReviewResult) UnmarshalJSON ¶
func (r *BroadcastReviewResult) UnmarshalJSON(data []byte) error
type BroadcastSendParams ¶
type BroadcastSendParams struct {
// Schedule for future delivery. Omit to send immediately.
ScheduledAt param.Opt[time.Time] `json:"scheduledAt,omitzero" format:"date-time"`
// contains filtered or unexported fields
}
func (BroadcastSendParams) MarshalJSON ¶
func (r BroadcastSendParams) MarshalJSON() (data []byte, err error)
func (*BroadcastSendParams) UnmarshalJSON ¶
func (r *BroadcastSendParams) UnmarshalJSON(data []byte) error
type BroadcastSendResponse ¶
type BroadcastSendResponse struct {
Broadcast Broadcast `json:"broadcast" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Broadcast respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastSendResponse) RawJSON ¶
func (r BroadcastSendResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastSendResponse) UnmarshalJSON ¶
func (r *BroadcastSendResponse) UnmarshalJSON(data []byte) error
type BroadcastService ¶
type BroadcastService struct {
Options []option.RequestOption
Contacts BroadcastContactService
}
BroadcastService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBroadcastService method instead.
func NewBroadcastService ¶
func NewBroadcastService(opts ...option.RequestOption) (r BroadcastService)
NewBroadcastService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BroadcastService) Cancel ¶
func (r *BroadcastService) Cancel(ctx context.Context, broadcastID string, opts ...option.RequestOption) (res *BroadcastCancelResponse, err error)
Cancel a broadcast. Pending contacts will be skipped, but already queued messages may still be delivered.
func (*BroadcastService) Delete ¶
func (r *BroadcastService) Delete(ctx context.Context, broadcastID string, opts ...option.RequestOption) (err error)
Delete a broadcast in draft status.
func (*BroadcastService) Get ¶
func (r *BroadcastService) Get(ctx context.Context, broadcastID string, opts ...option.RequestOption) (res *BroadcastGetResponse, err error)
Get broadcast
func (*BroadcastService) List ¶
func (r *BroadcastService) List(ctx context.Context, query BroadcastListParams, opts ...option.RequestOption) (res *pagination.Cursor[Broadcast], err error)
List broadcasts for this project.
func (*BroadcastService) ListAutoPaging ¶
func (r *BroadcastService) ListAutoPaging(ctx context.Context, query BroadcastListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Broadcast]
List broadcasts for this project.
func (*BroadcastService) New ¶
func (r *BroadcastService) New(ctx context.Context, body BroadcastNewParams, opts ...option.RequestOption) (res *BroadcastNewResponse, err error)
Create a new broadcast campaign. Add contacts after creation, then send.
func (*BroadcastService) Progress ¶
func (r *BroadcastService) Progress(ctx context.Context, broadcastID string, opts ...option.RequestOption) (res *BroadcastProgress, err error)
Get real-time progress of a broadcast including delivery counts and estimated completion time.
func (*BroadcastService) Reschedule ¶
func (r *BroadcastService) Reschedule(ctx context.Context, broadcastID string, body BroadcastRescheduleParams, opts ...option.RequestOption) (res *BroadcastRescheduleResponse, err error)
Update the scheduled time for a broadcast. The broadcast must be in scheduled status.
func (*BroadcastService) Send ¶
func (r *BroadcastService) Send(ctx context.Context, broadcastID string, body BroadcastSendParams, opts ...option.RequestOption) (res *BroadcastSendResponse, err error)
Start sending the broadcast immediately or schedule for later. Broadcasts go through automated AI content review before sending. If the review passes, the broadcast proceeds. If rejected, use PATCH to edit content, then call POST /retry-review. Reserves the estimated cost from your balance.
func (*BroadcastService) Update ¶
func (r *BroadcastService) Update(ctx context.Context, broadcastID string, body BroadcastUpdateParams, opts ...option.RequestOption) (res *BroadcastUpdateResponse, err error)
Update a broadcast in draft status.
type BroadcastStatus ¶
type BroadcastStatus string
Current status of the broadcast.
const ( BroadcastStatusDraft BroadcastStatus = "draft" BroadcastStatusPendingReview BroadcastStatus = "pending_review" BroadcastStatusApproved BroadcastStatus = "approved" BroadcastStatusRejected BroadcastStatus = "rejected" BroadcastStatusEscalated BroadcastStatus = "escalated" BroadcastStatusRejectedFinal BroadcastStatus = "rejected_final" BroadcastStatusScheduled BroadcastStatus = "scheduled" BroadcastStatusSending BroadcastStatus = "sending" BroadcastStatusPaused BroadcastStatus = "paused" BroadcastStatusCompleted BroadcastStatus = "completed" BroadcastStatusCancelled BroadcastStatus = "cancelled" BroadcastStatusFailed BroadcastStatus = "failed" )
type BroadcastUpdateParams ¶
type BroadcastUpdateParams struct {
EmailHTMLBody param.Opt[string] `json:"emailHtmlBody,omitzero"`
EmailSubject param.Opt[string] `json:"emailSubject,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
Text param.Opt[string] `json:"text,omitzero"`
// Content for non-text broadcast message types.
Content BroadcastContentParam `json:"content,omitzero"`
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (BroadcastUpdateParams) MarshalJSON ¶
func (r BroadcastUpdateParams) MarshalJSON() (data []byte, err error)
func (*BroadcastUpdateParams) UnmarshalJSON ¶
func (r *BroadcastUpdateParams) UnmarshalJSON(data []byte) error
type BroadcastUpdateResponse ¶
type BroadcastUpdateResponse struct {
Broadcast Broadcast `json:"broadcast" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Broadcast respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (BroadcastUpdateResponse) RawJSON ¶
func (r BroadcastUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BroadcastUpdateResponse) UnmarshalJSON ¶
func (r *BroadcastUpdateResponse) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
Messages MessageService
Templates TemplateService
Senders SenderService
Contacts ContactService
Broadcasts BroadcastService
Introspect IntrospectService
PhoneNumbers PhoneNumberService
Addresses AddressService
RegulatoryDocuments RegulatoryDocumentService
}
Client creates a struct with services and top level methods that help with interacting with the zavudev API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (ZAVUDEV_API_KEY, ZAVUDEV_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type Contact ¶
type Contact struct {
ID string `json:"id" api:"required"`
// List of available messaging channels for this contact.
AvailableChannels []string `json:"availableChannels" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
Metadata map[string]string `json:"metadata" api:"required"`
// Whether this contact has been verified.
Verified bool `json:"verified" api:"required"`
// All communication channels for this contact.
Channels []ContactChannel `json:"channels"`
CountryCode string `json:"countryCode"`
// Preferred channel for this contact.
//
// Any of "sms", "whatsapp", "telegram", "email", "instagram", "voice".
DefaultChannel ContactDefaultChannel `json:"defaultChannel"`
// Display name for the contact.
DisplayName string `json:"displayName"`
// DEPRECATED: Use primaryPhone instead. Primary phone number in E.164 format.
PhoneNumber string `json:"phoneNumber"`
// Primary email address.
PrimaryEmail string `json:"primaryEmail" format:"email"`
// Primary phone number in E.164 format.
PrimaryPhone string `json:"primaryPhone"`
// Contact's WhatsApp profile name. Only available for WhatsApp contacts.
ProfileName string `json:"profileName" api:"nullable"`
// ID of a contact suggested for merging.
SuggestedMergeWith string `json:"suggestedMergeWith"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AvailableChannels respjson.Field
CreatedAt respjson.Field
Metadata respjson.Field
Verified respjson.Field
Channels respjson.Field
CountryCode respjson.Field
DefaultChannel respjson.Field
DisplayName respjson.Field
PhoneNumber respjson.Field
PrimaryEmail respjson.Field
PrimaryPhone respjson.Field
ProfileName respjson.Field
SuggestedMergeWith respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Contact) UnmarshalJSON ¶
type ContactChannel ¶
type ContactChannel struct {
ID string `json:"id" api:"required"`
// Channel type.
//
// Any of "sms", "whatsapp", "email", "telegram", "voice".
Channel string `json:"channel" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Channel identifier (phone number or email address).
Identifier string `json:"identifier" api:"required"`
// Whether this is the primary channel for its type.
IsPrimary bool `json:"isPrimary" api:"required"`
// Whether this channel has been verified.
Verified bool `json:"verified" api:"required"`
// ISO country code for phone numbers.
CountryCode string `json:"countryCode"`
// Optional label for the channel.
Label string `json:"label"`
// Last time a message was received on this channel.
LastInboundAt time.Time `json:"lastInboundAt" format:"date-time"`
Metadata map[string]string `json:"metadata"`
// Delivery metrics for this channel.
Metrics ContactChannelMetrics `json:"metrics"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Channel respjson.Field
CreatedAt respjson.Field
Identifier respjson.Field
IsPrimary respjson.Field
Verified respjson.Field
CountryCode respjson.Field
Label respjson.Field
LastInboundAt respjson.Field
Metadata respjson.Field
Metrics respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A communication channel for a contact.
func (ContactChannel) RawJSON ¶
func (r ContactChannel) RawJSON() string
Returns the unmodified JSON received from the API
func (*ContactChannel) UnmarshalJSON ¶
func (r *ContactChannel) UnmarshalJSON(data []byte) error
type ContactChannelMetrics ¶
type ContactChannelMetrics struct {
AvgDeliveryTimeMs float64 `json:"avgDeliveryTimeMs"`
FailureCount int64 `json:"failureCount"`
LastSuccessAt time.Time `json:"lastSuccessAt" format:"date-time"`
SuccessCount int64 `json:"successCount"`
TotalAttempts int64 `json:"totalAttempts"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AvgDeliveryTimeMs respjson.Field
FailureCount respjson.Field
LastSuccessAt respjson.Field
SuccessCount respjson.Field
TotalAttempts respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Delivery metrics for this channel.
func (ContactChannelMetrics) RawJSON ¶
func (r ContactChannelMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*ContactChannelMetrics) UnmarshalJSON ¶
func (r *ContactChannelMetrics) UnmarshalJSON(data []byte) error
type ContactDefaultChannel ¶
type ContactDefaultChannel string
Preferred channel for this contact.
const ( ContactDefaultChannelSMS ContactDefaultChannel = "sms" ContactDefaultChannelWhatsapp ContactDefaultChannel = "whatsapp" ContactDefaultChannelTelegram ContactDefaultChannel = "telegram" ContactDefaultChannelEmail ContactDefaultChannel = "email" ContactDefaultChannelInstagram ContactDefaultChannel = "instagram" ContactDefaultChannelVoice ContactDefaultChannel = "voice" )
type ContactListParams ¶
type ContactListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
PhoneNumber param.Opt[string] `query:"phoneNumber,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ContactListParams) URLQuery ¶
func (r ContactListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ContactListParams's query parameters as `url.Values`.
type ContactService ¶
type ContactService struct {
Options []option.RequestOption
}
ContactService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewContactService method instead.
func NewContactService ¶
func NewContactService(opts ...option.RequestOption) (r ContactService)
NewContactService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ContactService) Get ¶
func (r *ContactService) Get(ctx context.Context, contactID string, opts ...option.RequestOption) (res *Contact, err error)
Get contact
func (*ContactService) GetByPhone ¶
func (r *ContactService) GetByPhone(ctx context.Context, phoneNumber string, opts ...option.RequestOption) (res *Contact, err error)
Get contact by phone number
func (*ContactService) List ¶
func (r *ContactService) List(ctx context.Context, query ContactListParams, opts ...option.RequestOption) (res *pagination.Cursor[Contact], err error)
List contacts with their communication channels.
func (*ContactService) ListAutoPaging ¶
func (r *ContactService) ListAutoPaging(ctx context.Context, query ContactListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Contact]
List contacts with their communication channels.
func (*ContactService) Update ¶
func (r *ContactService) Update(ctx context.Context, contactID string, body ContactUpdateParams, opts ...option.RequestOption) (res *Contact, err error)
Update contact
type ContactUpdateParams ¶
type ContactUpdateParams struct {
// Preferred channel for this contact. Set to null to clear.
//
// Any of "sms", "whatsapp", "telegram", "email", "instagram", "voice".
DefaultChannel ContactUpdateParamsDefaultChannel `json:"defaultChannel,omitzero"`
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (ContactUpdateParams) MarshalJSON ¶
func (r ContactUpdateParams) MarshalJSON() (data []byte, err error)
func (*ContactUpdateParams) UnmarshalJSON ¶
func (r *ContactUpdateParams) UnmarshalJSON(data []byte) error
type ContactUpdateParamsDefaultChannel ¶
type ContactUpdateParamsDefaultChannel string
Preferred channel for this contact. Set to null to clear.
const ( ContactUpdateParamsDefaultChannelSMS ContactUpdateParamsDefaultChannel = "sms" ContactUpdateParamsDefaultChannelWhatsapp ContactUpdateParamsDefaultChannel = "whatsapp" ContactUpdateParamsDefaultChannelTelegram ContactUpdateParamsDefaultChannel = "telegram" ContactUpdateParamsDefaultChannelEmail ContactUpdateParamsDefaultChannel = "email" ContactUpdateParamsDefaultChannelInstagram ContactUpdateParamsDefaultChannel = "instagram" ContactUpdateParamsDefaultChannelVoice ContactUpdateParamsDefaultChannel = "voice" )
type IntrospectService ¶
type IntrospectService struct {
Options []option.RequestOption
}
IntrospectService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIntrospectService method instead.
func NewIntrospectService ¶
func NewIntrospectService(opts ...option.RequestOption) (r IntrospectService)
NewIntrospectService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IntrospectService) ValidatePhone ¶
func (r *IntrospectService) ValidatePhone(ctx context.Context, body IntrospectValidatePhoneParams, opts ...option.RequestOption) (res *IntrospectValidatePhoneResponse, err error)
Validate a phone number and check if a WhatsApp conversation window is open.
type IntrospectValidatePhoneParams ¶
type IntrospectValidatePhoneParams struct {
PhoneNumber string `json:"phoneNumber" api:"required"`
// contains filtered or unexported fields
}
func (IntrospectValidatePhoneParams) MarshalJSON ¶
func (r IntrospectValidatePhoneParams) MarshalJSON() (data []byte, err error)
func (*IntrospectValidatePhoneParams) UnmarshalJSON ¶
func (r *IntrospectValidatePhoneParams) UnmarshalJSON(data []byte) error
type IntrospectValidatePhoneResponse ¶
type IntrospectValidatePhoneResponse struct {
CountryCode string `json:"countryCode" api:"required"`
PhoneNumber string `json:"phoneNumber" api:"required"`
ValidNumber bool `json:"validNumber" api:"required"`
// List of available messaging channels for this phone number.
AvailableChannels []string `json:"availableChannels"`
// Carrier information for the phone number.
Carrier IntrospectValidatePhoneResponseCarrier `json:"carrier"`
// Type of phone line.
//
// Any of "mobile", "landline", "voip", "toll_free", "unknown".
LineType LineType `json:"lineType"`
// Phone number in national format.
NationalFormat string `json:"nationalFormat"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CountryCode respjson.Field
PhoneNumber respjson.Field
ValidNumber respjson.Field
AvailableChannels respjson.Field
Carrier respjson.Field
LineType respjson.Field
NationalFormat respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (IntrospectValidatePhoneResponse) RawJSON ¶
func (r IntrospectValidatePhoneResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*IntrospectValidatePhoneResponse) UnmarshalJSON ¶
func (r *IntrospectValidatePhoneResponse) UnmarshalJSON(data []byte) error
type IntrospectValidatePhoneResponseCarrier ¶
type IntrospectValidatePhoneResponseCarrier struct {
// Carrier name.
Name string `json:"name" api:"nullable"`
// Type of phone line.
//
// Any of "mobile", "landline", "voip", "toll_free", "unknown".
Type LineType `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Carrier information for the phone number.
func (IntrospectValidatePhoneResponseCarrier) RawJSON ¶
func (r IntrospectValidatePhoneResponseCarrier) RawJSON() string
Returns the unmodified JSON received from the API
func (*IntrospectValidatePhoneResponseCarrier) UnmarshalJSON ¶
func (r *IntrospectValidatePhoneResponseCarrier) UnmarshalJSON(data []byte) error
type Message ¶
type Message struct {
ID string `json:"id" api:"required"`
// Delivery channel. Use 'auto' for intelligent routing.
//
// Any of "auto", "sms", "sms_oneway", "whatsapp", "telegram", "email",
// "instagram", "voice".
Channel Channel `json:"channel" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Type of message. Non-text types are supported by WhatsApp and Telegram (varies
// by type).
//
// Any of "text", "image", "video", "audio", "document", "sticker", "location",
// "contact", "buttons", "list", "reaction", "template".
MessageType MessageType `json:"messageType" api:"required"`
// Any of "queued", "sending", "sent", "delivered", "failed", "received",
// "pending_url_verification".
Status MessageStatus `json:"status" api:"required"`
To string `json:"to" api:"required"`
// Content for non-text message types (WhatsApp and Telegram).
Content MessageContent `json:"content"`
// MAU cost in USD (charged for first contact of the month).
Cost float64 `json:"cost" api:"nullable"`
// Provider cost in USD (Telnyx, SES, etc.).
CostProvider float64 `json:"costProvider" api:"nullable"`
// Total cost in USD (MAU + provider cost).
CostTotal float64 `json:"costTotal" api:"nullable"`
ErrorCode string `json:"errorCode" api:"nullable"`
ErrorMessage string `json:"errorMessage" api:"nullable"`
From string `json:"from"`
Metadata map[string]string `json:"metadata"`
// Message ID from the delivery provider.
ProviderMessageID string `json:"providerMessageId"`
SenderID string `json:"senderId"`
// Text content or caption.
Text string `json:"text"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Channel respjson.Field
CreatedAt respjson.Field
MessageType respjson.Field
Status respjson.Field
To respjson.Field
Content respjson.Field
Cost respjson.Field
CostProvider respjson.Field
CostTotal respjson.Field
ErrorCode respjson.Field
ErrorMessage respjson.Field
From respjson.Field
Metadata respjson.Field
ProviderMessageID respjson.Field
SenderID respjson.Field
Text respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Message) UnmarshalJSON ¶
type MessageContent ¶
type MessageContent struct {
// Interactive buttons (max 3).
Buttons []MessageContentButton `json:"buttons"`
// Contact cards for contact messages.
Contacts []MessageContentContact `json:"contacts"`
// Emoji for reaction messages.
Emoji string `json:"emoji"`
// Filename for documents.
Filename string `json:"filename"`
// Latitude for location messages.
Latitude float64 `json:"latitude"`
// Button text for list messages.
ListButton string `json:"listButton"`
// Address of the location.
LocationAddress string `json:"locationAddress"`
// Name of the location.
LocationName string `json:"locationName"`
// Longitude for location messages.
Longitude float64 `json:"longitude"`
// WhatsApp media ID if already uploaded.
MediaID string `json:"mediaId"`
// URL of the media file (for image, video, audio, document, sticker).
MediaURL string `json:"mediaUrl"`
// MIME type of the media.
MimeType string `json:"mimeType"`
// Message ID to react to.
ReactToMessageID string `json:"reactToMessageId"`
// Sections for list messages.
Sections []MessageContentSection `json:"sections"`
// Template ID for template messages.
TemplateID string `json:"templateId"`
// Variables for template rendering. Keys are variable positions (1, 2, 3...).
TemplateVariables map[string]string `json:"templateVariables"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Buttons respjson.Field
Contacts respjson.Field
Emoji respjson.Field
Filename respjson.Field
Latitude respjson.Field
ListButton respjson.Field
LocationAddress respjson.Field
LocationName respjson.Field
Longitude respjson.Field
MediaID respjson.Field
MediaURL respjson.Field
MimeType respjson.Field
ReactToMessageID respjson.Field
Sections respjson.Field
TemplateID respjson.Field
TemplateVariables respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Content for non-text message types (WhatsApp and Telegram).
func (MessageContent) RawJSON ¶
func (r MessageContent) RawJSON() string
Returns the unmodified JSON received from the API
func (MessageContent) ToParam ¶
func (r MessageContent) ToParam() MessageContentParam
ToParam converts this MessageContent to a MessageContentParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with MessageContentParam.Overrides()
func (*MessageContent) UnmarshalJSON ¶
func (r *MessageContent) UnmarshalJSON(data []byte) error
type MessageContentButton ¶
type MessageContentButton struct {
ID string `json:"id" api:"required"`
Title string `json:"title" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Title respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MessageContentButton) RawJSON ¶
func (r MessageContentButton) RawJSON() string
Returns the unmodified JSON received from the API
func (*MessageContentButton) UnmarshalJSON ¶
func (r *MessageContentButton) UnmarshalJSON(data []byte) error
type MessageContentButtonParam ¶
type MessageContentButtonParam struct {
ID string `json:"id" api:"required"`
Title string `json:"title" api:"required"`
// contains filtered or unexported fields
}
The properties ID, Title are required.
func (MessageContentButtonParam) MarshalJSON ¶
func (r MessageContentButtonParam) MarshalJSON() (data []byte, err error)
func (*MessageContentButtonParam) UnmarshalJSON ¶
func (r *MessageContentButtonParam) UnmarshalJSON(data []byte) error
type MessageContentContact ¶
type MessageContentContact struct {
Name string `json:"name"`
Phones []string `json:"phones"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Phones respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MessageContentContact) RawJSON ¶
func (r MessageContentContact) RawJSON() string
Returns the unmodified JSON received from the API
func (*MessageContentContact) UnmarshalJSON ¶
func (r *MessageContentContact) UnmarshalJSON(data []byte) error
type MessageContentContactParam ¶
type MessageContentContactParam struct {
Name param.Opt[string] `json:"name,omitzero"`
Phones []string `json:"phones,omitzero"`
// contains filtered or unexported fields
}
func (MessageContentContactParam) MarshalJSON ¶
func (r MessageContentContactParam) MarshalJSON() (data []byte, err error)
func (*MessageContentContactParam) UnmarshalJSON ¶
func (r *MessageContentContactParam) UnmarshalJSON(data []byte) error
type MessageContentParam ¶
type MessageContentParam struct {
// Emoji for reaction messages.
Emoji param.Opt[string] `json:"emoji,omitzero"`
// Filename for documents.
Filename param.Opt[string] `json:"filename,omitzero"`
// Latitude for location messages.
Latitude param.Opt[float64] `json:"latitude,omitzero"`
// Button text for list messages.
ListButton param.Opt[string] `json:"listButton,omitzero"`
// Address of the location.
LocationAddress param.Opt[string] `json:"locationAddress,omitzero"`
// Name of the location.
LocationName param.Opt[string] `json:"locationName,omitzero"`
// Longitude for location messages.
Longitude param.Opt[float64] `json:"longitude,omitzero"`
// WhatsApp media ID if already uploaded.
MediaID param.Opt[string] `json:"mediaId,omitzero"`
// URL of the media file (for image, video, audio, document, sticker).
MediaURL param.Opt[string] `json:"mediaUrl,omitzero"`
// MIME type of the media.
MimeType param.Opt[string] `json:"mimeType,omitzero"`
// Message ID to react to.
ReactToMessageID param.Opt[string] `json:"reactToMessageId,omitzero"`
// Template ID for template messages.
TemplateID param.Opt[string] `json:"templateId,omitzero"`
// Interactive buttons (max 3).
Buttons []MessageContentButtonParam `json:"buttons,omitzero"`
// Contact cards for contact messages.
Contacts []MessageContentContactParam `json:"contacts,omitzero"`
// Sections for list messages.
Sections []MessageContentSectionParam `json:"sections,omitzero"`
// Variables for template rendering. Keys are variable positions (1, 2, 3...).
TemplateVariables map[string]string `json:"templateVariables,omitzero"`
// contains filtered or unexported fields
}
Content for non-text message types (WhatsApp and Telegram).
func (MessageContentParam) MarshalJSON ¶
func (r MessageContentParam) MarshalJSON() (data []byte, err error)
func (*MessageContentParam) UnmarshalJSON ¶
func (r *MessageContentParam) UnmarshalJSON(data []byte) error
type MessageContentSection ¶
type MessageContentSection struct {
Rows []MessageContentSectionRow `json:"rows" api:"required"`
Title string `json:"title" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Rows respjson.Field
Title respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MessageContentSection) RawJSON ¶
func (r MessageContentSection) RawJSON() string
Returns the unmodified JSON received from the API
func (*MessageContentSection) UnmarshalJSON ¶
func (r *MessageContentSection) UnmarshalJSON(data []byte) error
type MessageContentSectionParam ¶
type MessageContentSectionParam struct {
Rows []MessageContentSectionRowParam `json:"rows,omitzero" api:"required"`
Title string `json:"title" api:"required"`
// contains filtered or unexported fields
}
The properties Rows, Title are required.
func (MessageContentSectionParam) MarshalJSON ¶
func (r MessageContentSectionParam) MarshalJSON() (data []byte, err error)
func (*MessageContentSectionParam) UnmarshalJSON ¶
func (r *MessageContentSectionParam) UnmarshalJSON(data []byte) error
type MessageContentSectionRow ¶
type MessageContentSectionRow struct {
ID string `json:"id" api:"required"`
Title string `json:"title" api:"required"`
Description string `json:"description"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Title respjson.Field
Description respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MessageContentSectionRow) RawJSON ¶
func (r MessageContentSectionRow) RawJSON() string
Returns the unmodified JSON received from the API
func (*MessageContentSectionRow) UnmarshalJSON ¶
func (r *MessageContentSectionRow) UnmarshalJSON(data []byte) error
type MessageContentSectionRowParam ¶
type MessageContentSectionRowParam struct {
ID string `json:"id" api:"required"`
Title string `json:"title" api:"required"`
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
The properties ID, Title are required.
func (MessageContentSectionRowParam) MarshalJSON ¶
func (r MessageContentSectionRowParam) MarshalJSON() (data []byte, err error)
func (*MessageContentSectionRowParam) UnmarshalJSON ¶
func (r *MessageContentSectionRowParam) UnmarshalJSON(data []byte) error
type MessageListParams ¶
type MessageListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
To param.Opt[string] `query:"to,omitzero" json:"-"`
// Delivery channel. Use 'auto' for intelligent routing.
//
// Any of "auto", "sms", "sms_oneway", "whatsapp", "telegram", "email",
// "instagram", "voice".
Channel Channel `query:"channel,omitzero" json:"-"`
// Any of "queued", "sending", "sent", "delivered", "failed", "received",
// "pending_url_verification".
Status MessageStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MessageListParams) URLQuery ¶
func (r MessageListParams) URLQuery() (v url.Values, err error)
URLQuery serializes MessageListParams's query parameters as `url.Values`.
type MessageReactParams ¶
type MessageReactParams struct {
// Single emoji character to react with.
Emoji string `json:"emoji" api:"required"`
ZavuSender param.Opt[string] `header:"Zavu-Sender,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MessageReactParams) MarshalJSON ¶
func (r MessageReactParams) MarshalJSON() (data []byte, err error)
func (*MessageReactParams) UnmarshalJSON ¶
func (r *MessageReactParams) UnmarshalJSON(data []byte) error
type MessageResponse ¶
type MessageResponse struct {
Message Message `json:"message" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MessageResponse) RawJSON ¶
func (r MessageResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MessageResponse) UnmarshalJSON ¶
func (r *MessageResponse) UnmarshalJSON(data []byte) error
type MessageSendParams ¶
type MessageSendParams struct {
// Recipient phone number in E.164 format, email address, or numeric chat ID (for
// Telegram/Instagram).
To string `json:"to" api:"required"`
// Whether to enable automatic fallback to SMS if WhatsApp fails. Defaults to true.
FallbackEnabled param.Opt[bool] `json:"fallbackEnabled,omitzero"`
// HTML body for email messages. If provided, email will be sent as multipart with
// both text and HTML.
HTMLBody param.Opt[string] `json:"htmlBody,omitzero"`
// Optional idempotency key to avoid duplicate sends.
IdempotencyKey param.Opt[string] `json:"idempotencyKey,omitzero"`
// Reply-To email address for email messages.
ReplyTo param.Opt[string] `json:"replyTo,omitzero" format:"email"`
// Email subject line. Required when channel is 'email' or recipient is an email
// address.
Subject param.Opt[string] `json:"subject,omitzero"`
// Text body for text messages or caption for media messages.
Text param.Opt[string] `json:"text,omitzero"`
// Language code for voice text-to-speech (e.g., 'en-US', 'es-ES', 'pt-BR'). If
// omitted, language is auto-detected from recipient's country code.
VoiceLanguage param.Opt[string] `json:"voiceLanguage,omitzero"`
ZavuSender param.Opt[string] `header:"Zavu-Sender,omitzero" json:"-"`
// Delivery channel. Use 'auto' for intelligent routing. If omitted with non-text
// messageType, WhatsApp is used. For email recipients, defaults to 'email'.
//
// Any of "auto", "sms", "sms_oneway", "whatsapp", "telegram", "email",
// "instagram", "voice".
Channel Channel `json:"channel,omitzero"`
// Additional content for non-text message types.
Content MessageContentParam `json:"content,omitzero"`
// Type of message. Defaults to 'text'.
//
// Any of "text", "image", "video", "audio", "document", "sticker", "location",
// "contact", "buttons", "list", "reaction", "template".
MessageType MessageType `json:"messageType,omitzero"`
// Arbitrary metadata to associate with the message.
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (MessageSendParams) MarshalJSON ¶
func (r MessageSendParams) MarshalJSON() (data []byte, err error)
func (*MessageSendParams) UnmarshalJSON ¶
func (r *MessageSendParams) UnmarshalJSON(data []byte) error
type MessageService ¶
type MessageService struct {
Options []option.RequestOption
}
MessageService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMessageService method instead.
func NewMessageService ¶
func NewMessageService(opts ...option.RequestOption) (r MessageService)
NewMessageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MessageService) Get ¶
func (r *MessageService) Get(ctx context.Context, messageID string, opts ...option.RequestOption) (res *MessageResponse, err error)
Get message by ID
func (*MessageService) List ¶
func (r *MessageService) List(ctx context.Context, query MessageListParams, opts ...option.RequestOption) (res *pagination.Cursor[Message], err error)
List messages previously sent by this project.
func (*MessageService) ListAutoPaging ¶
func (r *MessageService) ListAutoPaging(ctx context.Context, query MessageListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Message]
List messages previously sent by this project.
func (*MessageService) React ¶
func (r *MessageService) React(ctx context.Context, messageID string, params MessageReactParams, opts ...option.RequestOption) (res *MessageResponse, err error)
Send an emoji reaction to an existing WhatsApp message. Reactions are only supported for WhatsApp messages.
func (*MessageService) Send ¶
func (r *MessageService) Send(ctx context.Context, params MessageSendParams, opts ...option.RequestOption) (res *MessageResponse, err error)
Send a message to a recipient via SMS or WhatsApp.
**Channel selection:**
- If `channel` is omitted and `messageType` is `text`, defaults to SMS - If `messageType` is anything other than `text`, WhatsApp is used automatically
**WhatsApp 24-hour window:**
- Free-form messages (non-template) require an open 24h window - Window opens when the user messages you first - Use template messages to initiate conversations outside the window
**Daily limits:**
- Unverified accounts: 200 messages per channel per day - Complete KYC verification to increase limits to 10,000/day
type MessageStatus ¶
type MessageStatus string
const ( MessageStatusQueued MessageStatus = "queued" MessageStatusSending MessageStatus = "sending" MessageStatusSent MessageStatus = "sent" MessageStatusDelivered MessageStatus = "delivered" MessageStatusFailed MessageStatus = "failed" MessageStatusReceived MessageStatus = "received" MessageStatusPendingURLVerification MessageStatus = "pending_url_verification" )
type MessageType ¶
type MessageType string
Type of message. Non-text types are supported by WhatsApp and Telegram (varies by type).
const ( MessageTypeText MessageType = "text" MessageTypeImage MessageType = "image" MessageTypeVideo MessageType = "video" MessageTypeAudio MessageType = "audio" MessageTypeDocument MessageType = "document" MessageTypeSticker MessageType = "sticker" MessageTypeLocation MessageType = "location" MessageTypeContact MessageType = "contact" MessageTypeButtons MessageType = "buttons" MessageTypeList MessageType = "list" MessageTypeReaction MessageType = "reaction" MessageTypeTemplate MessageType = "template" )
type OwnedPhoneNumber ¶
type OwnedPhoneNumber struct {
ID string `json:"id" api:"required"`
Capabilities []string `json:"capabilities" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
PhoneNumber string `json:"phoneNumber" api:"required"`
Pricing OwnedPhoneNumberPricing `json:"pricing" api:"required"`
// Any of "active", "suspended", "pending".
Status PhoneNumberStatus `json:"status" api:"required"`
// Optional custom name for the phone number.
Name string `json:"name"`
NextRenewalDate time.Time `json:"nextRenewalDate" format:"date-time"`
// Sender ID if the phone number is assigned to a sender.
SenderID string `json:"senderId"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Capabilities respjson.Field
CreatedAt respjson.Field
PhoneNumber respjson.Field
Pricing respjson.Field
Status respjson.Field
Name respjson.Field
NextRenewalDate respjson.Field
SenderID respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OwnedPhoneNumber) RawJSON ¶
func (r OwnedPhoneNumber) RawJSON() string
Returns the unmodified JSON received from the API
func (*OwnedPhoneNumber) UnmarshalJSON ¶
func (r *OwnedPhoneNumber) UnmarshalJSON(data []byte) error
type OwnedPhoneNumberPricing ¶
type OwnedPhoneNumberPricing struct {
// Whether this is a free number.
IsFreeNumber bool `json:"isFreeNumber"`
// Monthly cost in cents.
MonthlyCost float64 `json:"monthlyCost"`
// Monthly price in USD.
MonthlyPrice float64 `json:"monthlyPrice"`
// One-time purchase cost in cents.
UpfrontCost float64 `json:"upfrontCost"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
IsFreeNumber respjson.Field
MonthlyCost respjson.Field
MonthlyPrice respjson.Field
UpfrontCost respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OwnedPhoneNumberPricing) RawJSON ¶
func (r OwnedPhoneNumberPricing) RawJSON() string
Returns the unmodified JSON received from the API
func (*OwnedPhoneNumberPricing) UnmarshalJSON ¶
func (r *OwnedPhoneNumberPricing) UnmarshalJSON(data []byte) error
type PhoneNumberCapabilities ¶
type PhoneNumberCapabilities struct {
Mms bool `json:"mms"`
SMS bool `json:"sms"`
Voice bool `json:"voice"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Mms respjson.Field
SMS respjson.Field
Voice respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PhoneNumberCapabilities) RawJSON ¶
func (r PhoneNumberCapabilities) RawJSON() string
Returns the unmodified JSON received from the API
func (*PhoneNumberCapabilities) UnmarshalJSON ¶
func (r *PhoneNumberCapabilities) UnmarshalJSON(data []byte) error
type PhoneNumberGetResponse ¶
type PhoneNumberGetResponse struct {
PhoneNumber OwnedPhoneNumber `json:"phoneNumber" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PhoneNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PhoneNumberGetResponse) RawJSON ¶
func (r PhoneNumberGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PhoneNumberGetResponse) UnmarshalJSON ¶
func (r *PhoneNumberGetResponse) UnmarshalJSON(data []byte) error
type PhoneNumberListParams ¶
type PhoneNumberListParams struct {
// Pagination cursor.
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter by phone number status.
//
// Any of "active", "suspended", "pending".
Status PhoneNumberStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PhoneNumberListParams) URLQuery ¶
func (r PhoneNumberListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PhoneNumberListParams's query parameters as `url.Values`.
type PhoneNumberPricing ¶
type PhoneNumberPricing struct {
// Whether this number qualifies for the free first US number offer.
IsFreeEligible bool `json:"isFreeEligible"`
// Monthly price in USD.
MonthlyPrice float64 `json:"monthlyPrice"`
// One-time purchase price in USD.
UpfrontPrice float64 `json:"upfrontPrice"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
IsFreeEligible respjson.Field
MonthlyPrice respjson.Field
UpfrontPrice respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PhoneNumberPricing) RawJSON ¶
func (r PhoneNumberPricing) RawJSON() string
Returns the unmodified JSON received from the API
func (*PhoneNumberPricing) UnmarshalJSON ¶
func (r *PhoneNumberPricing) UnmarshalJSON(data []byte) error
type PhoneNumberPurchaseParams ¶
type PhoneNumberPurchaseParams struct {
// Phone number in E.164 format.
PhoneNumber string `json:"phoneNumber" api:"required"`
// Optional custom name for the phone number.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (PhoneNumberPurchaseParams) MarshalJSON ¶
func (r PhoneNumberPurchaseParams) MarshalJSON() (data []byte, err error)
func (*PhoneNumberPurchaseParams) UnmarshalJSON ¶
func (r *PhoneNumberPurchaseParams) UnmarshalJSON(data []byte) error
type PhoneNumberPurchaseResponse ¶
type PhoneNumberPurchaseResponse struct {
PhoneNumber OwnedPhoneNumber `json:"phoneNumber" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PhoneNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PhoneNumberPurchaseResponse) RawJSON ¶
func (r PhoneNumberPurchaseResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PhoneNumberPurchaseResponse) UnmarshalJSON ¶
func (r *PhoneNumberPurchaseResponse) UnmarshalJSON(data []byte) error
type PhoneNumberRequirementsParams ¶
type PhoneNumberRequirementsParams struct {
// Two-letter ISO country code.
CountryCode string `query:"countryCode" api:"required" json:"-"`
// Type of phone number (local, mobile, tollFree).
//
// Any of "local", "mobile", "tollFree".
Type PhoneNumberType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PhoneNumberRequirementsParams) URLQuery ¶
func (r PhoneNumberRequirementsParams) URLQuery() (v url.Values, err error)
URLQuery serializes PhoneNumberRequirementsParams's query parameters as `url.Values`.
type PhoneNumberRequirementsResponse ¶
type PhoneNumberRequirementsResponse struct {
Items []Requirement `json:"items" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PhoneNumberRequirementsResponse) RawJSON ¶
func (r PhoneNumberRequirementsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PhoneNumberRequirementsResponse) UnmarshalJSON ¶
func (r *PhoneNumberRequirementsResponse) UnmarshalJSON(data []byte) error
type PhoneNumberSearchAvailableParams ¶
type PhoneNumberSearchAvailableParams struct {
// Two-letter ISO country code.
CountryCode string `query:"countryCode" api:"required" json:"-"`
// Search for numbers containing this string.
Contains param.Opt[string] `query:"contains,omitzero" json:"-"`
// Maximum number of results to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Type of phone number to search for.
//
// Any of "local", "mobile", "tollFree".
Type PhoneNumberType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PhoneNumberSearchAvailableParams) URLQuery ¶
func (r PhoneNumberSearchAvailableParams) URLQuery() (v url.Values, err error)
URLQuery serializes PhoneNumberSearchAvailableParams's query parameters as `url.Values`.
type PhoneNumberSearchAvailableResponse ¶
type PhoneNumberSearchAvailableResponse struct {
Items []AvailablePhoneNumber `json:"items" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PhoneNumberSearchAvailableResponse) RawJSON ¶
func (r PhoneNumberSearchAvailableResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PhoneNumberSearchAvailableResponse) UnmarshalJSON ¶
func (r *PhoneNumberSearchAvailableResponse) UnmarshalJSON(data []byte) error
type PhoneNumberService ¶
type PhoneNumberService struct {
Options []option.RequestOption
}
PhoneNumberService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPhoneNumberService method instead.
func NewPhoneNumberService ¶
func NewPhoneNumberService(opts ...option.RequestOption) (r PhoneNumberService)
NewPhoneNumberService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PhoneNumberService) Get ¶
func (r *PhoneNumberService) Get(ctx context.Context, phoneNumberID string, opts ...option.RequestOption) (res *PhoneNumberGetResponse, err error)
Get details of a specific phone number.
func (*PhoneNumberService) List ¶
func (r *PhoneNumberService) List(ctx context.Context, query PhoneNumberListParams, opts ...option.RequestOption) (res *pagination.Cursor[OwnedPhoneNumber], err error)
List all phone numbers owned by this project.
func (*PhoneNumberService) ListAutoPaging ¶
func (r *PhoneNumberService) ListAutoPaging(ctx context.Context, query PhoneNumberListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[OwnedPhoneNumber]
List all phone numbers owned by this project.
func (*PhoneNumberService) Purchase ¶
func (r *PhoneNumberService) Purchase(ctx context.Context, body PhoneNumberPurchaseParams, opts ...option.RequestOption) (res *PhoneNumberPurchaseResponse, err error)
Purchase an available phone number. The first US phone number is free for each team.
func (*PhoneNumberService) Release ¶
func (r *PhoneNumberService) Release(ctx context.Context, phoneNumberID string, opts ...option.RequestOption) (err error)
Release a phone number. The phone number must not be assigned to a sender.
func (*PhoneNumberService) Requirements ¶
func (r *PhoneNumberService) Requirements(ctx context.Context, query PhoneNumberRequirementsParams, opts ...option.RequestOption) (res *PhoneNumberRequirementsResponse, err error)
Get regulatory requirements for purchasing phone numbers in a specific country. Some countries require additional documentation (addresses, identity documents) before phone numbers can be activated.
func (*PhoneNumberService) SearchAvailable ¶
func (r *PhoneNumberService) SearchAvailable(ctx context.Context, query PhoneNumberSearchAvailableParams, opts ...option.RequestOption) (res *PhoneNumberSearchAvailableResponse, err error)
Search for available phone numbers to purchase by country and type.
func (*PhoneNumberService) Update ¶
func (r *PhoneNumberService) Update(ctx context.Context, phoneNumberID string, body PhoneNumberUpdateParams, opts ...option.RequestOption) (res *PhoneNumberUpdateResponse, err error)
Update a phone number's name or sender assignment.
type PhoneNumberStatus ¶
type PhoneNumberStatus string
const ( PhoneNumberStatusActive PhoneNumberStatus = "active" PhoneNumberStatusSuspended PhoneNumberStatus = "suspended" PhoneNumberStatusPending PhoneNumberStatus = "pending" )
type PhoneNumberType ¶
type PhoneNumberType string
const ( PhoneNumberTypeLocal PhoneNumberType = "local" PhoneNumberTypeMobile PhoneNumberType = "mobile" PhoneNumberTypeTollFree PhoneNumberType = "tollFree" )
type PhoneNumberUpdateParams ¶
type PhoneNumberUpdateParams struct {
// Custom name for the phone number. Set to null to clear.
Name param.Opt[string] `json:"name,omitzero"`
// Sender ID to assign the phone number to. Set to null to unassign.
SenderID param.Opt[string] `json:"senderId,omitzero"`
// contains filtered or unexported fields
}
func (PhoneNumberUpdateParams) MarshalJSON ¶
func (r PhoneNumberUpdateParams) MarshalJSON() (data []byte, err error)
func (*PhoneNumberUpdateParams) UnmarshalJSON ¶
func (r *PhoneNumberUpdateParams) UnmarshalJSON(data []byte) error
type PhoneNumberUpdateResponse ¶
type PhoneNumberUpdateResponse struct {
PhoneNumber OwnedPhoneNumber `json:"phoneNumber" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PhoneNumber respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PhoneNumberUpdateResponse) RawJSON ¶
func (r PhoneNumberUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PhoneNumberUpdateResponse) UnmarshalJSON ¶
func (r *PhoneNumberUpdateResponse) UnmarshalJSON(data []byte) error
type RegulatoryDocument ¶
type RegulatoryDocument struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"createdAt" api:"required" format:"date-time"`
// Any of "passport", "national_id", "drivers_license", "utility_bill", "tax_id",
// "business_registration", "proof_of_address", "other".
DocumentType RegulatoryDocumentDocumentType `json:"documentType" api:"required"`
Name string `json:"name" api:"required"`
// Any of "pending", "uploaded", "verified", "rejected".
Status RegulatoryDocumentStatus `json:"status" api:"required"`
FileSize int64 `json:"fileSize"`
MimeType string `json:"mimeType"`
RejectionReason string `json:"rejectionReason" api:"nullable"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DocumentType respjson.Field
Name respjson.Field
Status respjson.Field
FileSize respjson.Field
MimeType respjson.Field
RejectionReason respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A regulatory document for phone number requirements.
func (RegulatoryDocument) RawJSON ¶
func (r RegulatoryDocument) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegulatoryDocument) UnmarshalJSON ¶
func (r *RegulatoryDocument) UnmarshalJSON(data []byte) error
type RegulatoryDocumentDocumentType ¶
type RegulatoryDocumentDocumentType string
const ( RegulatoryDocumentDocumentTypePassport RegulatoryDocumentDocumentType = "passport" RegulatoryDocumentDocumentTypeNationalID RegulatoryDocumentDocumentType = "national_id" RegulatoryDocumentDocumentTypeDriversLicense RegulatoryDocumentDocumentType = "drivers_license" RegulatoryDocumentDocumentTypeUtilityBill RegulatoryDocumentDocumentType = "utility_bill" RegulatoryDocumentDocumentTypeTaxID RegulatoryDocumentDocumentType = "tax_id" RegulatoryDocumentDocumentTypeBusinessRegistration RegulatoryDocumentDocumentType = "business_registration" RegulatoryDocumentDocumentTypeProofOfAddress RegulatoryDocumentDocumentType = "proof_of_address" RegulatoryDocumentDocumentTypeOther RegulatoryDocumentDocumentType = "other" )
type RegulatoryDocumentGetResponse ¶
type RegulatoryDocumentGetResponse struct {
// A regulatory document for phone number requirements.
Document RegulatoryDocument `json:"document" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Document respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RegulatoryDocumentGetResponse) RawJSON ¶
func (r RegulatoryDocumentGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegulatoryDocumentGetResponse) UnmarshalJSON ¶
func (r *RegulatoryDocumentGetResponse) UnmarshalJSON(data []byte) error
type RegulatoryDocumentListParams ¶
type RegulatoryDocumentListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (RegulatoryDocumentListParams) URLQuery ¶
func (r RegulatoryDocumentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RegulatoryDocumentListParams's query parameters as `url.Values`.
type RegulatoryDocumentNewParams ¶
type RegulatoryDocumentNewParams struct {
// Any of "passport", "national_id", "drivers_license", "utility_bill", "tax_id",
// "business_registration", "proof_of_address", "other".
DocumentType RegulatoryDocumentNewParamsDocumentType `json:"documentType,omitzero" api:"required"`
FileSize int64 `json:"fileSize" api:"required"`
MimeType string `json:"mimeType" api:"required"`
Name string `json:"name" api:"required"`
// Storage ID from the upload-url endpoint.
StorageID string `json:"storageId" api:"required"`
// contains filtered or unexported fields
}
func (RegulatoryDocumentNewParams) MarshalJSON ¶
func (r RegulatoryDocumentNewParams) MarshalJSON() (data []byte, err error)
func (*RegulatoryDocumentNewParams) UnmarshalJSON ¶
func (r *RegulatoryDocumentNewParams) UnmarshalJSON(data []byte) error
type RegulatoryDocumentNewParamsDocumentType ¶
type RegulatoryDocumentNewParamsDocumentType string
const ( RegulatoryDocumentNewParamsDocumentTypePassport RegulatoryDocumentNewParamsDocumentType = "passport" RegulatoryDocumentNewParamsDocumentTypeNationalID RegulatoryDocumentNewParamsDocumentType = "national_id" RegulatoryDocumentNewParamsDocumentTypeDriversLicense RegulatoryDocumentNewParamsDocumentType = "drivers_license" RegulatoryDocumentNewParamsDocumentTypeUtilityBill RegulatoryDocumentNewParamsDocumentType = "utility_bill" RegulatoryDocumentNewParamsDocumentTypeTaxID RegulatoryDocumentNewParamsDocumentType = "tax_id" RegulatoryDocumentNewParamsDocumentTypeBusinessRegistration RegulatoryDocumentNewParamsDocumentType = "business_registration" RegulatoryDocumentNewParamsDocumentTypeProofOfAddress RegulatoryDocumentNewParamsDocumentType = "proof_of_address" RegulatoryDocumentNewParamsDocumentTypeOther RegulatoryDocumentNewParamsDocumentType = "other" )
type RegulatoryDocumentNewResponse ¶
type RegulatoryDocumentNewResponse struct {
// A regulatory document for phone number requirements.
Document RegulatoryDocument `json:"document" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Document respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RegulatoryDocumentNewResponse) RawJSON ¶
func (r RegulatoryDocumentNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegulatoryDocumentNewResponse) UnmarshalJSON ¶
func (r *RegulatoryDocumentNewResponse) UnmarshalJSON(data []byte) error
type RegulatoryDocumentService ¶
type RegulatoryDocumentService struct {
Options []option.RequestOption
}
RegulatoryDocumentService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRegulatoryDocumentService method instead.
func NewRegulatoryDocumentService ¶
func NewRegulatoryDocumentService(opts ...option.RequestOption) (r RegulatoryDocumentService)
NewRegulatoryDocumentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RegulatoryDocumentService) Delete ¶
func (r *RegulatoryDocumentService) Delete(ctx context.Context, documentID string, opts ...option.RequestOption) (err error)
Delete a regulatory document. Cannot delete verified documents.
func (*RegulatoryDocumentService) Get ¶
func (r *RegulatoryDocumentService) Get(ctx context.Context, documentID string, opts ...option.RequestOption) (res *RegulatoryDocumentGetResponse, err error)
Get a specific regulatory document.
func (*RegulatoryDocumentService) List ¶
func (r *RegulatoryDocumentService) List(ctx context.Context, query RegulatoryDocumentListParams, opts ...option.RequestOption) (res *pagination.Cursor[RegulatoryDocument], err error)
List regulatory documents for this project.
func (*RegulatoryDocumentService) ListAutoPaging ¶
func (r *RegulatoryDocumentService) ListAutoPaging(ctx context.Context, query RegulatoryDocumentListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[RegulatoryDocument]
List regulatory documents for this project.
func (*RegulatoryDocumentService) New ¶
func (r *RegulatoryDocumentService) New(ctx context.Context, body RegulatoryDocumentNewParams, opts ...option.RequestOption) (res *RegulatoryDocumentNewResponse, err error)
Create a regulatory document record after uploading the file. Use the upload-url endpoint first to get an upload URL.
func (*RegulatoryDocumentService) UploadURL ¶
func (r *RegulatoryDocumentService) UploadURL(ctx context.Context, opts ...option.RequestOption) (res *RegulatoryDocumentUploadURLResponse, err error)
Get a presigned URL to upload a document file. After uploading, use the storageId to create the document record.
type RegulatoryDocumentStatus ¶
type RegulatoryDocumentStatus string
const ( RegulatoryDocumentStatusPending RegulatoryDocumentStatus = "pending" RegulatoryDocumentStatusUploaded RegulatoryDocumentStatus = "uploaded" RegulatoryDocumentStatusVerified RegulatoryDocumentStatus = "verified" RegulatoryDocumentStatusRejected RegulatoryDocumentStatus = "rejected" )
type RegulatoryDocumentUploadURLResponse ¶
type RegulatoryDocumentUploadURLResponse struct {
// Pre-signed URL for uploading the file.
UploadURL string `json:"uploadUrl" api:"required" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
UploadURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RegulatoryDocumentUploadURLResponse) RawJSON ¶
func (r RegulatoryDocumentUploadURLResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RegulatoryDocumentUploadURLResponse) UnmarshalJSON ¶
func (r *RegulatoryDocumentUploadURLResponse) UnmarshalJSON(data []byte) error
type Requirement ¶
type Requirement struct {
ID string `json:"id" api:"required"`
Action string `json:"action" api:"required"`
CountryCode string `json:"countryCode" api:"required"`
PhoneNumberType string `json:"phoneNumberType" api:"required"`
RequirementTypes []RequirementType `json:"requirementTypes" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Action respjson.Field
CountryCode respjson.Field
PhoneNumberType respjson.Field
RequirementTypes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A group of requirements for a specific country/phone type combination.
func (Requirement) RawJSON ¶
func (r Requirement) RawJSON() string
Returns the unmodified JSON received from the API
func (*Requirement) UnmarshalJSON ¶
func (r *Requirement) UnmarshalJSON(data []byte) error
type RequirementAcceptanceCriteria ¶
type RequirementAcceptanceCriteria struct {
AllowedValues []string `json:"allowedValues" api:"nullable"`
MaxLength int64 `json:"maxLength" api:"nullable"`
MinLength int64 `json:"minLength" api:"nullable"`
RegexPattern string `json:"regexPattern" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AllowedValues respjson.Field
MaxLength respjson.Field
MinLength respjson.Field
RegexPattern respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Acceptance criteria for a requirement.
func (RequirementAcceptanceCriteria) RawJSON ¶
func (r RequirementAcceptanceCriteria) RawJSON() string
Returns the unmodified JSON received from the API
func (*RequirementAcceptanceCriteria) UnmarshalJSON ¶
func (r *RequirementAcceptanceCriteria) UnmarshalJSON(data []byte) error
type RequirementFieldType ¶
type RequirementFieldType string
Type of requirement field.
const ( RequirementFieldTypeTextual RequirementFieldType = "textual" RequirementFieldTypeAddress RequirementFieldType = "address" RequirementFieldTypeDocument RequirementFieldType = "document" RequirementFieldTypeAction RequirementFieldType = "action" )
type RequirementType ¶
type RequirementType struct {
ID string `json:"id" api:"required"`
Description string `json:"description" api:"required"`
Name string `json:"name" api:"required"`
// Type of requirement field.
//
// Any of "textual", "address", "document", "action".
Type RequirementFieldType `json:"type" api:"required"`
// Acceptance criteria for a requirement.
AcceptanceCriteria RequirementAcceptanceCriteria `json:"acceptanceCriteria"`
Example string `json:"example" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Description respjson.Field
Name respjson.Field
Type respjson.Field
AcceptanceCriteria respjson.Field
Example respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A specific requirement type within a requirement group.
func (RequirementType) RawJSON ¶
func (r RequirementType) RawJSON() string
Returns the unmodified JSON received from the API
func (*RequirementType) UnmarshalJSON ¶
func (r *RequirementType) UnmarshalJSON(data []byte) error
type Sender ¶
type Sender struct {
ID string `json:"id" api:"required"`
Name string `json:"name" api:"required"`
// Phone number in E.164 format.
PhoneNumber string `json:"phoneNumber" api:"required"`
CreatedAt time.Time `json:"createdAt" format:"date-time"`
// Whether inbound email receiving is enabled for this sender.
EmailReceivingEnabled bool `json:"emailReceivingEnabled"`
// Whether this sender is the project's default.
IsDefault bool `json:"isDefault"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// Webhook configuration for the sender.
Webhook SenderWebhook `json:"webhook"`
// WhatsApp Business Account information. Only present if a WABA is connected.
Whatsapp SenderWhatsapp `json:"whatsapp"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Name respjson.Field
PhoneNumber respjson.Field
CreatedAt respjson.Field
EmailReceivingEnabled respjson.Field
IsDefault respjson.Field
UpdatedAt respjson.Field
Webhook respjson.Field
Whatsapp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Sender) UnmarshalJSON ¶
type SenderAgentExecutionListParams ¶
type SenderAgentExecutionListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Status of an agent execution.
//
// Any of "success", "error", "filtered", "rate_limited", "balance_insufficient".
Status AgentExecutionStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SenderAgentExecutionListParams) URLQuery ¶
func (r SenderAgentExecutionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SenderAgentExecutionListParams's query parameters as `url.Values`.
type SenderAgentExecutionService ¶
type SenderAgentExecutionService struct {
Options []option.RequestOption
}
SenderAgentExecutionService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSenderAgentExecutionService method instead.
func NewSenderAgentExecutionService ¶
func NewSenderAgentExecutionService(opts ...option.RequestOption) (r SenderAgentExecutionService)
NewSenderAgentExecutionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SenderAgentExecutionService) List ¶
func (r *SenderAgentExecutionService) List(ctx context.Context, senderID string, query SenderAgentExecutionListParams, opts ...option.RequestOption) (res *pagination.Cursor[AgentExecution], err error)
List recent agent executions with pagination.
func (*SenderAgentExecutionService) ListAutoPaging ¶
func (r *SenderAgentExecutionService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentExecutionListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[AgentExecution]
List recent agent executions with pagination.
type SenderAgentFlowDeleteParams ¶
type SenderAgentFlowDeleteParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type SenderAgentFlowDuplicateParams ¶
type SenderAgentFlowDuplicateParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
NewName string `json:"newName" api:"required"`
// contains filtered or unexported fields
}
func (SenderAgentFlowDuplicateParams) MarshalJSON ¶
func (r SenderAgentFlowDuplicateParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentFlowDuplicateParams) UnmarshalJSON ¶
func (r *SenderAgentFlowDuplicateParams) UnmarshalJSON(data []byte) error
type SenderAgentFlowDuplicateResponse ¶
type SenderAgentFlowDuplicateResponse struct {
Flow AgentFlow `json:"flow" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Flow respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentFlowDuplicateResponse) RawJSON ¶
func (r SenderAgentFlowDuplicateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentFlowDuplicateResponse) UnmarshalJSON ¶
func (r *SenderAgentFlowDuplicateResponse) UnmarshalJSON(data []byte) error
type SenderAgentFlowGetParams ¶
type SenderAgentFlowGetParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type SenderAgentFlowGetResponse ¶
type SenderAgentFlowGetResponse struct {
Flow AgentFlow `json:"flow" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Flow respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentFlowGetResponse) RawJSON ¶
func (r SenderAgentFlowGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentFlowGetResponse) UnmarshalJSON ¶
func (r *SenderAgentFlowGetResponse) UnmarshalJSON(data []byte) error
type SenderAgentFlowListParams ¶
type SenderAgentFlowListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Enabled param.Opt[bool] `query:"enabled,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SenderAgentFlowListParams) URLQuery ¶
func (r SenderAgentFlowListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SenderAgentFlowListParams's query parameters as `url.Values`.
type SenderAgentFlowNewParams ¶
type SenderAgentFlowNewParams struct {
Name string `json:"name" api:"required"`
Steps []SenderAgentFlowNewParamsStep `json:"steps,omitzero" api:"required"`
Trigger SenderAgentFlowNewParamsTrigger `json:"trigger,omitzero" api:"required"`
Description param.Opt[string] `json:"description,omitzero"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
Priority param.Opt[int64] `json:"priority,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentFlowNewParams) MarshalJSON ¶
func (r SenderAgentFlowNewParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentFlowNewParams) UnmarshalJSON ¶
func (r *SenderAgentFlowNewParams) UnmarshalJSON(data []byte) error
type SenderAgentFlowNewParamsStep ¶
type SenderAgentFlowNewParamsStep struct {
// Unique step identifier.
ID string `json:"id" api:"required"`
// Step configuration (varies by type).
Config map[string]any `json:"config,omitzero" api:"required"`
// Type of flow step.
//
// Any of "message", "collect", "condition", "tool", "llm", "transfer".
Type string `json:"type,omitzero" api:"required"`
// ID of the next step to execute.
NextStepID param.Opt[string] `json:"nextStepId,omitzero"`
// contains filtered or unexported fields
}
The properties ID, Config, Type are required.
func (SenderAgentFlowNewParamsStep) MarshalJSON ¶
func (r SenderAgentFlowNewParamsStep) MarshalJSON() (data []byte, err error)
func (*SenderAgentFlowNewParamsStep) UnmarshalJSON ¶
func (r *SenderAgentFlowNewParamsStep) UnmarshalJSON(data []byte) error
type SenderAgentFlowNewParamsTrigger ¶
type SenderAgentFlowNewParamsTrigger struct {
// Type of trigger for a flow.
//
// Any of "keyword", "intent", "always", "manual".
Type string `json:"type,omitzero" api:"required"`
// Intent that triggers the flow (for intent type).
Intent param.Opt[string] `json:"intent,omitzero"`
// Keywords that trigger the flow (for keyword type).
Keywords []string `json:"keywords,omitzero"`
// contains filtered or unexported fields
}
The property Type is required.
func (SenderAgentFlowNewParamsTrigger) MarshalJSON ¶
func (r SenderAgentFlowNewParamsTrigger) MarshalJSON() (data []byte, err error)
func (*SenderAgentFlowNewParamsTrigger) UnmarshalJSON ¶
func (r *SenderAgentFlowNewParamsTrigger) UnmarshalJSON(data []byte) error
type SenderAgentFlowNewResponse ¶
type SenderAgentFlowNewResponse struct {
Flow AgentFlow `json:"flow" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Flow respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentFlowNewResponse) RawJSON ¶
func (r SenderAgentFlowNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentFlowNewResponse) UnmarshalJSON ¶
func (r *SenderAgentFlowNewResponse) UnmarshalJSON(data []byte) error
type SenderAgentFlowService ¶
type SenderAgentFlowService struct {
Options []option.RequestOption
}
SenderAgentFlowService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSenderAgentFlowService method instead.
func NewSenderAgentFlowService ¶
func NewSenderAgentFlowService(opts ...option.RequestOption) (r SenderAgentFlowService)
NewSenderAgentFlowService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SenderAgentFlowService) Delete ¶
func (r *SenderAgentFlowService) Delete(ctx context.Context, flowID string, body SenderAgentFlowDeleteParams, opts ...option.RequestOption) (err error)
Delete a flow. Cannot delete flows with active sessions.
func (*SenderAgentFlowService) Duplicate ¶
func (r *SenderAgentFlowService) Duplicate(ctx context.Context, flowID string, params SenderAgentFlowDuplicateParams, opts ...option.RequestOption) (res *SenderAgentFlowDuplicateResponse, err error)
Create a copy of an existing flow with a new name.
func (*SenderAgentFlowService) Get ¶
func (r *SenderAgentFlowService) Get(ctx context.Context, flowID string, query SenderAgentFlowGetParams, opts ...option.RequestOption) (res *SenderAgentFlowGetResponse, err error)
Get a specific flow.
func (*SenderAgentFlowService) List ¶
func (r *SenderAgentFlowService) List(ctx context.Context, senderID string, query SenderAgentFlowListParams, opts ...option.RequestOption) (res *pagination.Cursor[AgentFlow], err error)
List flows for an agent.
func (*SenderAgentFlowService) ListAutoPaging ¶
func (r *SenderAgentFlowService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentFlowListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[AgentFlow]
List flows for an agent.
func (*SenderAgentFlowService) New ¶
func (r *SenderAgentFlowService) New(ctx context.Context, senderID string, body SenderAgentFlowNewParams, opts ...option.RequestOption) (res *SenderAgentFlowNewResponse, err error)
Create a new flow for an agent.
func (*SenderAgentFlowService) Update ¶
func (r *SenderAgentFlowService) Update(ctx context.Context, flowID string, params SenderAgentFlowUpdateParams, opts ...option.RequestOption) (res *SenderAgentFlowUpdateResponse, err error)
Update a flow.
type SenderAgentFlowUpdateParams ¶
type SenderAgentFlowUpdateParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
Description param.Opt[string] `json:"description,omitzero"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
Priority param.Opt[int64] `json:"priority,omitzero"`
Steps []SenderAgentFlowUpdateParamsStep `json:"steps,omitzero"`
Trigger SenderAgentFlowUpdateParamsTrigger `json:"trigger,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentFlowUpdateParams) MarshalJSON ¶
func (r SenderAgentFlowUpdateParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentFlowUpdateParams) UnmarshalJSON ¶
func (r *SenderAgentFlowUpdateParams) UnmarshalJSON(data []byte) error
type SenderAgentFlowUpdateParamsStep ¶
type SenderAgentFlowUpdateParamsStep struct {
// Unique step identifier.
ID string `json:"id" api:"required"`
// Step configuration (varies by type).
Config map[string]any `json:"config,omitzero" api:"required"`
// Type of flow step.
//
// Any of "message", "collect", "condition", "tool", "llm", "transfer".
Type string `json:"type,omitzero" api:"required"`
// ID of the next step to execute.
NextStepID param.Opt[string] `json:"nextStepId,omitzero"`
// contains filtered or unexported fields
}
The properties ID, Config, Type are required.
func (SenderAgentFlowUpdateParamsStep) MarshalJSON ¶
func (r SenderAgentFlowUpdateParamsStep) MarshalJSON() (data []byte, err error)
func (*SenderAgentFlowUpdateParamsStep) UnmarshalJSON ¶
func (r *SenderAgentFlowUpdateParamsStep) UnmarshalJSON(data []byte) error
type SenderAgentFlowUpdateParamsTrigger ¶
type SenderAgentFlowUpdateParamsTrigger struct {
// Type of trigger for a flow.
//
// Any of "keyword", "intent", "always", "manual".
Type string `json:"type,omitzero" api:"required"`
// Intent that triggers the flow (for intent type).
Intent param.Opt[string] `json:"intent,omitzero"`
// Keywords that trigger the flow (for keyword type).
Keywords []string `json:"keywords,omitzero"`
// contains filtered or unexported fields
}
The property Type is required.
func (SenderAgentFlowUpdateParamsTrigger) MarshalJSON ¶
func (r SenderAgentFlowUpdateParamsTrigger) MarshalJSON() (data []byte, err error)
func (*SenderAgentFlowUpdateParamsTrigger) UnmarshalJSON ¶
func (r *SenderAgentFlowUpdateParamsTrigger) UnmarshalJSON(data []byte) error
type SenderAgentFlowUpdateResponse ¶
type SenderAgentFlowUpdateResponse struct {
Flow AgentFlow `json:"flow" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Flow respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentFlowUpdateResponse) RawJSON ¶
func (r SenderAgentFlowUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentFlowUpdateResponse) UnmarshalJSON ¶
func (r *SenderAgentFlowUpdateResponse) UnmarshalJSON(data []byte) error
type SenderAgentKnowledgeBaseDeleteParams ¶
type SenderAgentKnowledgeBaseDeleteParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type SenderAgentKnowledgeBaseDocumentListParams ¶
type SenderAgentKnowledgeBaseDocumentListParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SenderAgentKnowledgeBaseDocumentListParams) URLQuery ¶
func (r SenderAgentKnowledgeBaseDocumentListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SenderAgentKnowledgeBaseDocumentListParams's query parameters as `url.Values`.
type SenderAgentKnowledgeBaseDocumentNewParams ¶
type SenderAgentKnowledgeBaseDocumentNewParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
Content string `json:"content" api:"required"`
Title string `json:"title" api:"required"`
// contains filtered or unexported fields
}
func (SenderAgentKnowledgeBaseDocumentNewParams) MarshalJSON ¶
func (r SenderAgentKnowledgeBaseDocumentNewParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentKnowledgeBaseDocumentNewParams) UnmarshalJSON ¶
func (r *SenderAgentKnowledgeBaseDocumentNewParams) UnmarshalJSON(data []byte) error
type SenderAgentKnowledgeBaseDocumentNewResponse ¶
type SenderAgentKnowledgeBaseDocumentNewResponse struct {
Document AgentDocument `json:"document" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Document respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentKnowledgeBaseDocumentNewResponse) RawJSON ¶
func (r SenderAgentKnowledgeBaseDocumentNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentKnowledgeBaseDocumentNewResponse) UnmarshalJSON ¶
func (r *SenderAgentKnowledgeBaseDocumentNewResponse) UnmarshalJSON(data []byte) error
type SenderAgentKnowledgeBaseDocumentService ¶
type SenderAgentKnowledgeBaseDocumentService struct {
Options []option.RequestOption
}
SenderAgentKnowledgeBaseDocumentService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSenderAgentKnowledgeBaseDocumentService method instead.
func NewSenderAgentKnowledgeBaseDocumentService ¶
func NewSenderAgentKnowledgeBaseDocumentService(opts ...option.RequestOption) (r SenderAgentKnowledgeBaseDocumentService)
NewSenderAgentKnowledgeBaseDocumentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SenderAgentKnowledgeBaseDocumentService) Delete ¶
func (r *SenderAgentKnowledgeBaseDocumentService) Delete(ctx context.Context, docID string, body SenderAgentKnowledgeBaseDocumentDeleteParams, opts ...option.RequestOption) (err error)
Delete a document from a knowledge base.
func (*SenderAgentKnowledgeBaseDocumentService) List ¶
func (r *SenderAgentKnowledgeBaseDocumentService) List(ctx context.Context, kbID string, params SenderAgentKnowledgeBaseDocumentListParams, opts ...option.RequestOption) (res *pagination.Cursor[AgentDocument], err error)
List documents in a knowledge base.
func (*SenderAgentKnowledgeBaseDocumentService) ListAutoPaging ¶
func (r *SenderAgentKnowledgeBaseDocumentService) ListAutoPaging(ctx context.Context, kbID string, params SenderAgentKnowledgeBaseDocumentListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[AgentDocument]
List documents in a knowledge base.
func (*SenderAgentKnowledgeBaseDocumentService) New ¶
func (r *SenderAgentKnowledgeBaseDocumentService) New(ctx context.Context, kbID string, params SenderAgentKnowledgeBaseDocumentNewParams, opts ...option.RequestOption) (res *SenderAgentKnowledgeBaseDocumentNewResponse, err error)
Add a document to a knowledge base. The document will be automatically processed for RAG.
type SenderAgentKnowledgeBaseGetParams ¶
type SenderAgentKnowledgeBaseGetParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type SenderAgentKnowledgeBaseGetResponse ¶
type SenderAgentKnowledgeBaseGetResponse struct {
KnowledgeBase AgentKnowledgeBase `json:"knowledgeBase" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
KnowledgeBase respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentKnowledgeBaseGetResponse) RawJSON ¶
func (r SenderAgentKnowledgeBaseGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentKnowledgeBaseGetResponse) UnmarshalJSON ¶
func (r *SenderAgentKnowledgeBaseGetResponse) UnmarshalJSON(data []byte) error
type SenderAgentKnowledgeBaseListParams ¶
type SenderAgentKnowledgeBaseListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SenderAgentKnowledgeBaseListParams) URLQuery ¶
func (r SenderAgentKnowledgeBaseListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SenderAgentKnowledgeBaseListParams's query parameters as `url.Values`.
type SenderAgentKnowledgeBaseNewParams ¶
type SenderAgentKnowledgeBaseNewParams struct {
Name string `json:"name" api:"required"`
Description param.Opt[string] `json:"description,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentKnowledgeBaseNewParams) MarshalJSON ¶
func (r SenderAgentKnowledgeBaseNewParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentKnowledgeBaseNewParams) UnmarshalJSON ¶
func (r *SenderAgentKnowledgeBaseNewParams) UnmarshalJSON(data []byte) error
type SenderAgentKnowledgeBaseNewResponse ¶
type SenderAgentKnowledgeBaseNewResponse struct {
KnowledgeBase AgentKnowledgeBase `json:"knowledgeBase" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
KnowledgeBase respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentKnowledgeBaseNewResponse) RawJSON ¶
func (r SenderAgentKnowledgeBaseNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentKnowledgeBaseNewResponse) UnmarshalJSON ¶
func (r *SenderAgentKnowledgeBaseNewResponse) UnmarshalJSON(data []byte) error
type SenderAgentKnowledgeBaseService ¶
type SenderAgentKnowledgeBaseService struct {
Options []option.RequestOption
Documents SenderAgentKnowledgeBaseDocumentService
}
SenderAgentKnowledgeBaseService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSenderAgentKnowledgeBaseService method instead.
func NewSenderAgentKnowledgeBaseService ¶
func NewSenderAgentKnowledgeBaseService(opts ...option.RequestOption) (r SenderAgentKnowledgeBaseService)
NewSenderAgentKnowledgeBaseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SenderAgentKnowledgeBaseService) Delete ¶
func (r *SenderAgentKnowledgeBaseService) Delete(ctx context.Context, kbID string, body SenderAgentKnowledgeBaseDeleteParams, opts ...option.RequestOption) (err error)
Delete a knowledge base and all its documents.
func (*SenderAgentKnowledgeBaseService) Get ¶
func (r *SenderAgentKnowledgeBaseService) Get(ctx context.Context, kbID string, query SenderAgentKnowledgeBaseGetParams, opts ...option.RequestOption) (res *SenderAgentKnowledgeBaseGetResponse, err error)
Get a specific knowledge base.
func (*SenderAgentKnowledgeBaseService) List ¶
func (r *SenderAgentKnowledgeBaseService) List(ctx context.Context, senderID string, query SenderAgentKnowledgeBaseListParams, opts ...option.RequestOption) (res *pagination.Cursor[AgentKnowledgeBase], err error)
List knowledge bases for an agent.
func (*SenderAgentKnowledgeBaseService) ListAutoPaging ¶
func (r *SenderAgentKnowledgeBaseService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentKnowledgeBaseListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[AgentKnowledgeBase]
List knowledge bases for an agent.
func (*SenderAgentKnowledgeBaseService) New ¶
func (r *SenderAgentKnowledgeBaseService) New(ctx context.Context, senderID string, body SenderAgentKnowledgeBaseNewParams, opts ...option.RequestOption) (res *SenderAgentKnowledgeBaseNewResponse, err error)
Create a new knowledge base for an agent.
func (*SenderAgentKnowledgeBaseService) Update ¶
func (r *SenderAgentKnowledgeBaseService) Update(ctx context.Context, kbID string, params SenderAgentKnowledgeBaseUpdateParams, opts ...option.RequestOption) (res *SenderAgentKnowledgeBaseUpdateResponse, err error)
Update a knowledge base.
type SenderAgentKnowledgeBaseUpdateParams ¶
type SenderAgentKnowledgeBaseUpdateParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
Description param.Opt[string] `json:"description,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentKnowledgeBaseUpdateParams) MarshalJSON ¶
func (r SenderAgentKnowledgeBaseUpdateParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentKnowledgeBaseUpdateParams) UnmarshalJSON ¶
func (r *SenderAgentKnowledgeBaseUpdateParams) UnmarshalJSON(data []byte) error
type SenderAgentKnowledgeBaseUpdateResponse ¶
type SenderAgentKnowledgeBaseUpdateResponse struct {
KnowledgeBase AgentKnowledgeBase `json:"knowledgeBase" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
KnowledgeBase respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentKnowledgeBaseUpdateResponse) RawJSON ¶
func (r SenderAgentKnowledgeBaseUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentKnowledgeBaseUpdateResponse) UnmarshalJSON ¶
func (r *SenderAgentKnowledgeBaseUpdateResponse) UnmarshalJSON(data []byte) error
type SenderAgentNewParams ¶
type SenderAgentNewParams struct {
Model string `json:"model" api:"required"`
Name string `json:"name" api:"required"`
// LLM provider for the AI agent.
//
// Any of "openai", "anthropic", "google", "mistral", "zavu".
Provider AgentProvider `json:"provider,omitzero" api:"required"`
SystemPrompt string `json:"systemPrompt" api:"required"`
// API key for the LLM provider. Required unless provider is 'zavu'.
APIKey param.Opt[string] `json:"apiKey,omitzero"`
ContextWindowMessages param.Opt[int64] `json:"contextWindowMessages,omitzero"`
IncludeContactMetadata param.Opt[bool] `json:"includeContactMetadata,omitzero"`
MaxTokens param.Opt[int64] `json:"maxTokens,omitzero"`
Temperature param.Opt[float64] `json:"temperature,omitzero"`
TriggerOnChannels []string `json:"triggerOnChannels,omitzero"`
TriggerOnMessageTypes []string `json:"triggerOnMessageTypes,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentNewParams) MarshalJSON ¶
func (r SenderAgentNewParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentNewParams) UnmarshalJSON ¶
func (r *SenderAgentNewParams) UnmarshalJSON(data []byte) error
type SenderAgentService ¶
type SenderAgentService struct {
Options []option.RequestOption
Executions SenderAgentExecutionService
Flows SenderAgentFlowService
Tools SenderAgentToolService
KnowledgeBases SenderAgentKnowledgeBaseService
}
SenderAgentService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSenderAgentService method instead.
func NewSenderAgentService ¶
func NewSenderAgentService(opts ...option.RequestOption) (r SenderAgentService)
NewSenderAgentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SenderAgentService) Delete ¶
func (r *SenderAgentService) Delete(ctx context.Context, senderID string, opts ...option.RequestOption) (err error)
Delete an AI agent.
func (*SenderAgentService) Get ¶
func (r *SenderAgentService) Get(ctx context.Context, senderID string, opts ...option.RequestOption) (res *AgentResponse, err error)
Get the AI agent configuration for a sender.
func (*SenderAgentService) New ¶
func (r *SenderAgentService) New(ctx context.Context, senderID string, body SenderAgentNewParams, opts ...option.RequestOption) (res *AgentResponse, err error)
Create an AI agent for a sender. Each sender can have at most one agent.
func (*SenderAgentService) Stats ¶
func (r *SenderAgentService) Stats(ctx context.Context, senderID string, opts ...option.RequestOption) (res *AgentStats, err error)
Get statistics for an AI agent including invocations, tokens, and costs.
func (*SenderAgentService) Update ¶
func (r *SenderAgentService) Update(ctx context.Context, senderID string, body SenderAgentUpdateParams, opts ...option.RequestOption) (res *AgentResponse, err error)
Update an AI agent's configuration.
type SenderAgentToolDeleteParams ¶
type SenderAgentToolDeleteParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type SenderAgentToolGetParams ¶
type SenderAgentToolGetParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type SenderAgentToolGetResponse ¶
type SenderAgentToolGetResponse struct {
Tool AgentTool `json:"tool" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Tool respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentToolGetResponse) RawJSON ¶
func (r SenderAgentToolGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentToolGetResponse) UnmarshalJSON ¶
func (r *SenderAgentToolGetResponse) UnmarshalJSON(data []byte) error
type SenderAgentToolListParams ¶
type SenderAgentToolListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Enabled param.Opt[bool] `query:"enabled,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SenderAgentToolListParams) URLQuery ¶
func (r SenderAgentToolListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SenderAgentToolListParams's query parameters as `url.Values`.
type SenderAgentToolNewParams ¶
type SenderAgentToolNewParams struct {
Description string `json:"description" api:"required"`
Name string `json:"name" api:"required"`
Parameters SenderAgentToolNewParamsParameters `json:"parameters,omitzero" api:"required"`
// Must be HTTPS.
WebhookURL string `json:"webhookUrl" api:"required" format:"uri"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Optional secret for webhook signature verification.
WebhookSecret param.Opt[string] `json:"webhookSecret,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentToolNewParams) MarshalJSON ¶
func (r SenderAgentToolNewParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentToolNewParams) UnmarshalJSON ¶
func (r *SenderAgentToolNewParams) UnmarshalJSON(data []byte) error
type SenderAgentToolNewParamsParameters ¶
type SenderAgentToolNewParamsParameters struct {
Properties map[string]SenderAgentToolNewParamsParametersProperty `json:"properties,omitzero" api:"required"`
Required []string `json:"required,omitzero" api:"required"`
// Any of "object".
Type string `json:"type,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties Properties, Required, Type are required.
func (SenderAgentToolNewParamsParameters) MarshalJSON ¶
func (r SenderAgentToolNewParamsParameters) MarshalJSON() (data []byte, err error)
func (*SenderAgentToolNewParamsParameters) UnmarshalJSON ¶
func (r *SenderAgentToolNewParamsParameters) UnmarshalJSON(data []byte) error
type SenderAgentToolNewParamsParametersProperty ¶
type SenderAgentToolNewParamsParametersProperty struct {
Description param.Opt[string] `json:"description,omitzero"`
Type param.Opt[string] `json:"type,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentToolNewParamsParametersProperty) MarshalJSON ¶
func (r SenderAgentToolNewParamsParametersProperty) MarshalJSON() (data []byte, err error)
func (*SenderAgentToolNewParamsParametersProperty) UnmarshalJSON ¶
func (r *SenderAgentToolNewParamsParametersProperty) UnmarshalJSON(data []byte) error
type SenderAgentToolNewResponse ¶
type SenderAgentToolNewResponse struct {
Tool AgentTool `json:"tool" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Tool respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentToolNewResponse) RawJSON ¶
func (r SenderAgentToolNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentToolNewResponse) UnmarshalJSON ¶
func (r *SenderAgentToolNewResponse) UnmarshalJSON(data []byte) error
type SenderAgentToolService ¶
type SenderAgentToolService struct {
Options []option.RequestOption
}
SenderAgentToolService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSenderAgentToolService method instead.
func NewSenderAgentToolService ¶
func NewSenderAgentToolService(opts ...option.RequestOption) (r SenderAgentToolService)
NewSenderAgentToolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SenderAgentToolService) Delete ¶
func (r *SenderAgentToolService) Delete(ctx context.Context, toolID string, body SenderAgentToolDeleteParams, opts ...option.RequestOption) (err error)
Delete a tool.
func (*SenderAgentToolService) Get ¶
func (r *SenderAgentToolService) Get(ctx context.Context, toolID string, query SenderAgentToolGetParams, opts ...option.RequestOption) (res *SenderAgentToolGetResponse, err error)
Get a specific tool.
func (*SenderAgentToolService) List ¶
func (r *SenderAgentToolService) List(ctx context.Context, senderID string, query SenderAgentToolListParams, opts ...option.RequestOption) (res *pagination.Cursor[AgentTool], err error)
List tools for an agent.
func (*SenderAgentToolService) ListAutoPaging ¶
func (r *SenderAgentToolService) ListAutoPaging(ctx context.Context, senderID string, query SenderAgentToolListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[AgentTool]
List tools for an agent.
func (*SenderAgentToolService) New ¶
func (r *SenderAgentToolService) New(ctx context.Context, senderID string, body SenderAgentToolNewParams, opts ...option.RequestOption) (res *SenderAgentToolNewResponse, err error)
Create a new tool for an agent. Tools allow the agent to call external webhooks.
func (*SenderAgentToolService) Test ¶
func (r *SenderAgentToolService) Test(ctx context.Context, toolID string, params SenderAgentToolTestParams, opts ...option.RequestOption) (res *SenderAgentToolTestResponse, err error)
Test a tool by triggering its webhook with test parameters.
func (*SenderAgentToolService) Update ¶
func (r *SenderAgentToolService) Update(ctx context.Context, toolID string, params SenderAgentToolUpdateParams, opts ...option.RequestOption) (res *SenderAgentToolUpdateResponse, err error)
Update a tool.
type SenderAgentToolTestParams ¶
type SenderAgentToolTestParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
// Parameters to pass to the tool for testing.
TestParams map[string]any `json:"testParams,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (SenderAgentToolTestParams) MarshalJSON ¶
func (r SenderAgentToolTestParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentToolTestParams) UnmarshalJSON ¶
func (r *SenderAgentToolTestParams) UnmarshalJSON(data []byte) error
type SenderAgentToolTestResponse ¶
type SenderAgentToolTestResponse struct {
Scheduled bool `json:"scheduled" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Scheduled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentToolTestResponse) RawJSON ¶
func (r SenderAgentToolTestResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentToolTestResponse) UnmarshalJSON ¶
func (r *SenderAgentToolTestResponse) UnmarshalJSON(data []byte) error
type SenderAgentToolUpdateParams ¶
type SenderAgentToolUpdateParams struct {
SenderID string `path:"senderId" api:"required" json:"-"`
WebhookSecret param.Opt[string] `json:"webhookSecret,omitzero"`
Description param.Opt[string] `json:"description,omitzero"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
WebhookURL param.Opt[string] `json:"webhookUrl,omitzero" format:"uri"`
Parameters SenderAgentToolUpdateParamsParameters `json:"parameters,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentToolUpdateParams) MarshalJSON ¶
func (r SenderAgentToolUpdateParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentToolUpdateParams) UnmarshalJSON ¶
func (r *SenderAgentToolUpdateParams) UnmarshalJSON(data []byte) error
type SenderAgentToolUpdateParamsParameters ¶
type SenderAgentToolUpdateParamsParameters struct {
Properties map[string]SenderAgentToolUpdateParamsParametersProperty `json:"properties,omitzero" api:"required"`
Required []string `json:"required,omitzero" api:"required"`
// Any of "object".
Type string `json:"type,omitzero" api:"required"`
// contains filtered or unexported fields
}
The properties Properties, Required, Type are required.
func (SenderAgentToolUpdateParamsParameters) MarshalJSON ¶
func (r SenderAgentToolUpdateParamsParameters) MarshalJSON() (data []byte, err error)
func (*SenderAgentToolUpdateParamsParameters) UnmarshalJSON ¶
func (r *SenderAgentToolUpdateParamsParameters) UnmarshalJSON(data []byte) error
type SenderAgentToolUpdateParamsParametersProperty ¶
type SenderAgentToolUpdateParamsParametersProperty struct {
Description param.Opt[string] `json:"description,omitzero"`
Type param.Opt[string] `json:"type,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentToolUpdateParamsParametersProperty) MarshalJSON ¶
func (r SenderAgentToolUpdateParamsParametersProperty) MarshalJSON() (data []byte, err error)
func (*SenderAgentToolUpdateParamsParametersProperty) UnmarshalJSON ¶
func (r *SenderAgentToolUpdateParamsParametersProperty) UnmarshalJSON(data []byte) error
type SenderAgentToolUpdateResponse ¶
type SenderAgentToolUpdateResponse struct {
Tool AgentTool `json:"tool" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Tool respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderAgentToolUpdateResponse) RawJSON ¶
func (r SenderAgentToolUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderAgentToolUpdateResponse) UnmarshalJSON ¶
func (r *SenderAgentToolUpdateResponse) UnmarshalJSON(data []byte) error
type SenderAgentUpdateParams ¶
type SenderAgentUpdateParams struct {
MaxTokens param.Opt[int64] `json:"maxTokens,omitzero"`
Temperature param.Opt[float64] `json:"temperature,omitzero"`
APIKey param.Opt[string] `json:"apiKey,omitzero"`
ContextWindowMessages param.Opt[int64] `json:"contextWindowMessages,omitzero"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
IncludeContactMetadata param.Opt[bool] `json:"includeContactMetadata,omitzero"`
Model param.Opt[string] `json:"model,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
SystemPrompt param.Opt[string] `json:"systemPrompt,omitzero"`
// LLM provider for the AI agent.
//
// Any of "openai", "anthropic", "google", "mistral", "zavu".
Provider AgentProvider `json:"provider,omitzero"`
TriggerOnChannels []string `json:"triggerOnChannels,omitzero"`
TriggerOnMessageTypes []string `json:"triggerOnMessageTypes,omitzero"`
// contains filtered or unexported fields
}
func (SenderAgentUpdateParams) MarshalJSON ¶
func (r SenderAgentUpdateParams) MarshalJSON() (data []byte, err error)
func (*SenderAgentUpdateParams) UnmarshalJSON ¶
func (r *SenderAgentUpdateParams) UnmarshalJSON(data []byte) error
type SenderListParams ¶
type SenderListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SenderListParams) URLQuery ¶
func (r SenderListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SenderListParams's query parameters as `url.Values`.
type SenderNewParams ¶
type SenderNewParams struct {
Name string `json:"name" api:"required"`
PhoneNumber string `json:"phoneNumber" api:"required"`
SetAsDefault param.Opt[bool] `json:"setAsDefault,omitzero"`
// HTTPS URL for webhook events.
WebhookURL param.Opt[string] `json:"webhookUrl,omitzero" format:"uri"`
// Events to subscribe to.
WebhookEvents []WebhookEvent `json:"webhookEvents,omitzero"`
// contains filtered or unexported fields
}
func (SenderNewParams) MarshalJSON ¶
func (r SenderNewParams) MarshalJSON() (data []byte, err error)
func (*SenderNewParams) UnmarshalJSON ¶
func (r *SenderNewParams) UnmarshalJSON(data []byte) error
type SenderService ¶
type SenderService struct {
Options []option.RequestOption
Agent SenderAgentService
}
SenderService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSenderService method instead.
func NewSenderService ¶
func NewSenderService(opts ...option.RequestOption) (r SenderService)
NewSenderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SenderService) Delete ¶
func (r *SenderService) Delete(ctx context.Context, senderID string, opts ...option.RequestOption) (err error)
Delete sender
func (*SenderService) Get ¶
func (r *SenderService) Get(ctx context.Context, senderID string, opts ...option.RequestOption) (res *Sender, err error)
Get sender
func (*SenderService) GetProfile ¶
func (r *SenderService) GetProfile(ctx context.Context, senderID string, opts ...option.RequestOption) (res *WhatsappBusinessProfileResponse, err error)
Get the WhatsApp Business profile for a sender. The sender must have a WhatsApp Business Account connected.
func (*SenderService) List ¶
func (r *SenderService) List(ctx context.Context, query SenderListParams, opts ...option.RequestOption) (res *pagination.Cursor[Sender], err error)
List senders
func (*SenderService) ListAutoPaging ¶
func (r *SenderService) ListAutoPaging(ctx context.Context, query SenderListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Sender]
List senders
func (*SenderService) New ¶
func (r *SenderService) New(ctx context.Context, body SenderNewParams, opts ...option.RequestOption) (res *Sender, err error)
Create sender
func (*SenderService) RegenerateWebhookSecret ¶
func (r *SenderService) RegenerateWebhookSecret(ctx context.Context, senderID string, opts ...option.RequestOption) (res *WebhookSecretResponse, err error)
Regenerate the webhook secret for a sender. The old secret will be invalidated immediately.
func (*SenderService) Update ¶
func (r *SenderService) Update(ctx context.Context, senderID string, body SenderUpdateParams, opts ...option.RequestOption) (res *Sender, err error)
Update sender
func (*SenderService) UpdateProfile ¶
func (r *SenderService) UpdateProfile(ctx context.Context, senderID string, body SenderUpdateProfileParams, opts ...option.RequestOption) (res *SenderUpdateProfileResponse, err error)
Update the WhatsApp Business profile for a sender. The sender must have a WhatsApp Business Account connected.
func (*SenderService) UploadProfilePicture ¶
func (r *SenderService) UploadProfilePicture(ctx context.Context, senderID string, body SenderUploadProfilePictureParams, opts ...option.RequestOption) (res *SenderUploadProfilePictureResponse, err error)
Upload a new profile picture for the WhatsApp Business profile. The image will be uploaded to Meta and set as the profile picture.
type SenderUpdateParams ¶
type SenderUpdateParams struct {
// HTTPS URL for webhook events. Set to null to remove webhook.
WebhookURL param.Opt[string] `json:"webhookUrl,omitzero" format:"uri"`
// Enable or disable inbound email receiving for this sender.
EmailReceivingEnabled param.Opt[bool] `json:"emailReceivingEnabled,omitzero"`
Name param.Opt[string] `json:"name,omitzero"`
SetAsDefault param.Opt[bool] `json:"setAsDefault,omitzero"`
// Whether the webhook is active.
WebhookActive param.Opt[bool] `json:"webhookActive,omitzero"`
// Events to subscribe to.
WebhookEvents []WebhookEvent `json:"webhookEvents,omitzero"`
// contains filtered or unexported fields
}
func (SenderUpdateParams) MarshalJSON ¶
func (r SenderUpdateParams) MarshalJSON() (data []byte, err error)
func (*SenderUpdateParams) UnmarshalJSON ¶
func (r *SenderUpdateParams) UnmarshalJSON(data []byte) error
type SenderUpdateProfileParams ¶
type SenderUpdateProfileParams struct {
// Short description of the business (max 139 characters).
About param.Opt[string] `json:"about,omitzero"`
// Physical address of the business (max 256 characters).
Address param.Opt[string] `json:"address,omitzero"`
// Extended description of the business (max 512 characters).
Description param.Opt[string] `json:"description,omitzero"`
// Business email address.
Email param.Opt[string] `json:"email,omitzero" format:"email"`
// Business category for WhatsApp Business profile.
//
// Any of "UNDEFINED", "OTHER", "AUTO", "BEAUTY", "APPAREL", "EDU", "ENTERTAIN",
// "EVENT_PLAN", "FINANCE", "GROCERY", "GOVT", "HOTEL", "HEALTH", "NONPROFIT",
// "PROF_SERVICES", "RETAIL", "TRAVEL", "RESTAURANT", "NOT_A_BIZ".
Vertical WhatsappBusinessProfileVertical `json:"vertical,omitzero"`
// Business website URLs (maximum 2).
Websites []string `json:"websites,omitzero" format:"uri"`
// contains filtered or unexported fields
}
func (SenderUpdateProfileParams) MarshalJSON ¶
func (r SenderUpdateProfileParams) MarshalJSON() (data []byte, err error)
func (*SenderUpdateProfileParams) UnmarshalJSON ¶
func (r *SenderUpdateProfileParams) UnmarshalJSON(data []byte) error
type SenderUpdateProfileResponse ¶
type SenderUpdateProfileResponse struct {
// WhatsApp Business profile information.
Profile WhatsappBusinessProfile `json:"profile" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Profile respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderUpdateProfileResponse) RawJSON ¶
func (r SenderUpdateProfileResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderUpdateProfileResponse) UnmarshalJSON ¶
func (r *SenderUpdateProfileResponse) UnmarshalJSON(data []byte) error
type SenderUploadProfilePictureParams ¶
type SenderUploadProfilePictureParams struct {
// URL of the image to upload.
ImageURL string `json:"imageUrl" api:"required" format:"uri"`
// MIME type of the image.
//
// Any of "image/jpeg", "image/png".
MimeType SenderUploadProfilePictureParamsMimeType `json:"mimeType,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (SenderUploadProfilePictureParams) MarshalJSON ¶
func (r SenderUploadProfilePictureParams) MarshalJSON() (data []byte, err error)
func (*SenderUploadProfilePictureParams) UnmarshalJSON ¶
func (r *SenderUploadProfilePictureParams) UnmarshalJSON(data []byte) error
type SenderUploadProfilePictureParamsMimeType ¶
type SenderUploadProfilePictureParamsMimeType string
MIME type of the image.
const ( SenderUploadProfilePictureParamsMimeTypeImageJpeg SenderUploadProfilePictureParamsMimeType = "image/jpeg" SenderUploadProfilePictureParamsMimeTypeImagePng SenderUploadProfilePictureParamsMimeType = "image/png" )
type SenderUploadProfilePictureResponse ¶
type SenderUploadProfilePictureResponse struct {
// WhatsApp Business profile information.
Profile WhatsappBusinessProfile `json:"profile" api:"required"`
Success bool `json:"success" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Profile respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SenderUploadProfilePictureResponse) RawJSON ¶
func (r SenderUploadProfilePictureResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderUploadProfilePictureResponse) UnmarshalJSON ¶
func (r *SenderUploadProfilePictureResponse) UnmarshalJSON(data []byte) error
type SenderWebhook ¶
type SenderWebhook struct {
// Whether the webhook is active.
Active bool `json:"active" api:"required"`
// List of events the webhook is subscribed to.
Events []WebhookEvent `json:"events" api:"required"`
// HTTPS URL that will receive webhook events.
URL string `json:"url" api:"required" format:"uri"`
// Webhook secret for signature verification. Only returned on create or
// regenerate.
Secret string `json:"secret"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Active respjson.Field
Events respjson.Field
URL respjson.Field
Secret respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Webhook configuration for the sender.
func (SenderWebhook) RawJSON ¶
func (r SenderWebhook) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderWebhook) UnmarshalJSON ¶
func (r *SenderWebhook) UnmarshalJSON(data []byte) error
type SenderWhatsapp ¶
type SenderWhatsapp struct {
// Display phone number.
DisplayPhoneNumber string `json:"displayPhoneNumber"`
// Payment configuration status from Meta.
PaymentStatus SenderWhatsappPaymentStatus `json:"paymentStatus"`
// WhatsApp phone number ID from Meta.
PhoneNumberID string `json:"phoneNumberId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DisplayPhoneNumber respjson.Field
PaymentStatus respjson.Field
PhoneNumberID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
WhatsApp Business Account information. Only present if a WABA is connected.
func (SenderWhatsapp) RawJSON ¶
func (r SenderWhatsapp) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderWhatsapp) UnmarshalJSON ¶
func (r *SenderWhatsapp) UnmarshalJSON(data []byte) error
type SenderWhatsappPaymentStatus ¶
type SenderWhatsappPaymentStatus struct {
// Whether template messages can be sent. Requires setupStatus=COMPLETE and
// methodStatus=VALID.
CanSendTemplates bool `json:"canSendTemplates"`
// Payment method status (VALID, NONE, etc.).
MethodStatus string `json:"methodStatus"`
// Payment setup status (COMPLETE, NOT_STARTED, etc.).
SetupStatus string `json:"setupStatus"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CanSendTemplates respjson.Field
MethodStatus respjson.Field
SetupStatus respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payment configuration status from Meta.
func (SenderWhatsappPaymentStatus) RawJSON ¶
func (r SenderWhatsappPaymentStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*SenderWhatsappPaymentStatus) UnmarshalJSON ¶
func (r *SenderWhatsappPaymentStatus) UnmarshalJSON(data []byte) error
type Template ¶
type Template struct {
ID string `json:"id" api:"required"`
// Template body with variables: {{1}}, {{2}}, etc.
Body string `json:"body" api:"required"`
// WhatsApp template category.
//
// Any of "UTILITY", "MARKETING", "AUTHENTICATION".
Category WhatsappCategory `json:"category" api:"required"`
// Language code.
Language string `json:"language" api:"required"`
// Template name (must match WhatsApp template name).
Name string `json:"name" api:"required"`
// Add 'Do not share this code' disclaimer. Only for AUTHENTICATION templates.
AddSecurityRecommendation bool `json:"addSecurityRecommendation"`
// Template buttons.
Buttons []TemplateButton `json:"buttons"`
// Code expiration time in minutes. Only for AUTHENTICATION templates.
CodeExpirationMinutes int64 `json:"codeExpirationMinutes"`
CreatedAt time.Time `json:"createdAt" format:"date-time"`
Footer string `json:"footer"`
// Header content (text or media URL).
HeaderContent string `json:"headerContent"`
// Type of header (text, image, video, document).
HeaderType string `json:"headerType"`
// Any of "draft", "pending", "approved", "rejected".
Status TemplateStatus `json:"status"`
UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
// List of variable names for documentation.
Variables []string `json:"variables"`
// WhatsApp-specific template information.
Whatsapp TemplateWhatsapp `json:"whatsapp"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Body respjson.Field
Category respjson.Field
Language respjson.Field
Name respjson.Field
AddSecurityRecommendation respjson.Field
Buttons respjson.Field
CodeExpirationMinutes respjson.Field
CreatedAt respjson.Field
Footer respjson.Field
HeaderContent respjson.Field
HeaderType respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
Variables respjson.Field
Whatsapp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Template) UnmarshalJSON ¶
type TemplateButton ¶
type TemplateButton struct {
// OTP button type. Required when type is 'otp'.
//
// Any of "COPY_CODE", "ONE_TAP".
OtpType string `json:"otpType"`
// Android package name. Required for ONE_TAP buttons.
PackageName string `json:"packageName"`
PhoneNumber string `json:"phoneNumber"`
// Android app signature hash. Required for ONE_TAP buttons.
SignatureHash string `json:"signatureHash"`
Text string `json:"text"`
// Any of "quick_reply", "url", "phone", "otp".
Type string `json:"type"`
URL string `json:"url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
OtpType respjson.Field
PackageName respjson.Field
PhoneNumber respjson.Field
SignatureHash respjson.Field
Text respjson.Field
Type respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TemplateButton) RawJSON ¶
func (r TemplateButton) RawJSON() string
Returns the unmodified JSON received from the API
func (*TemplateButton) UnmarshalJSON ¶
func (r *TemplateButton) UnmarshalJSON(data []byte) error
type TemplateListParams ¶
type TemplateListParams struct {
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TemplateListParams) URLQuery ¶
func (r TemplateListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TemplateListParams's query parameters as `url.Values`.
type TemplateNewParams ¶
type TemplateNewParams struct {
Body string `json:"body" api:"required"`
Language string `json:"language" api:"required"`
Name string `json:"name" api:"required"`
// Add 'Do not share this code' disclaimer. Only for AUTHENTICATION templates.
AddSecurityRecommendation param.Opt[bool] `json:"addSecurityRecommendation,omitzero"`
// Code expiration time in minutes. Only for AUTHENTICATION templates.
CodeExpirationMinutes param.Opt[int64] `json:"codeExpirationMinutes,omitzero"`
// Template buttons (max 3).
Buttons []TemplateNewParamsButton `json:"buttons,omitzero"`
Variables []string `json:"variables,omitzero"`
// WhatsApp template category.
//
// Any of "UTILITY", "MARKETING", "AUTHENTICATION".
WhatsappCategory WhatsappCategory `json:"whatsappCategory,omitzero"`
// contains filtered or unexported fields
}
func (TemplateNewParams) MarshalJSON ¶
func (r TemplateNewParams) MarshalJSON() (data []byte, err error)
func (*TemplateNewParams) UnmarshalJSON ¶
func (r *TemplateNewParams) UnmarshalJSON(data []byte) error
type TemplateNewParamsButton ¶
type TemplateNewParamsButton struct {
Text string `json:"text" api:"required"`
// Any of "quick_reply", "url", "phone", "otp".
Type string `json:"type,omitzero" api:"required"`
// Android package name. Required for ONE_TAP buttons.
PackageName param.Opt[string] `json:"packageName,omitzero"`
PhoneNumber param.Opt[string] `json:"phoneNumber,omitzero"`
// Android app signature hash. Required for ONE_TAP buttons.
SignatureHash param.Opt[string] `json:"signatureHash,omitzero"`
URL param.Opt[string] `json:"url,omitzero" format:"uri"`
// Required when type is 'otp'. COPY_CODE shows copy button, ONE_TAP enables
// Android autofill.
//
// Any of "COPY_CODE", "ONE_TAP".
OtpType string `json:"otpType,omitzero"`
// contains filtered or unexported fields
}
The properties Text, Type are required.
func (TemplateNewParamsButton) MarshalJSON ¶
func (r TemplateNewParamsButton) MarshalJSON() (data []byte, err error)
func (*TemplateNewParamsButton) UnmarshalJSON ¶
func (r *TemplateNewParamsButton) UnmarshalJSON(data []byte) error
type TemplateService ¶
type TemplateService struct {
Options []option.RequestOption
}
TemplateService contains methods and other services that help with interacting with the zavudev API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTemplateService method instead.
func NewTemplateService ¶
func NewTemplateService(opts ...option.RequestOption) (r TemplateService)
NewTemplateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TemplateService) Delete ¶
func (r *TemplateService) Delete(ctx context.Context, templateID string, opts ...option.RequestOption) (err error)
Delete template
func (*TemplateService) Get ¶
func (r *TemplateService) Get(ctx context.Context, templateID string, opts ...option.RequestOption) (res *Template, err error)
Get template
func (*TemplateService) List ¶
func (r *TemplateService) List(ctx context.Context, query TemplateListParams, opts ...option.RequestOption) (res *pagination.Cursor[Template], err error)
List WhatsApp message templates for this project.
func (*TemplateService) ListAutoPaging ¶
func (r *TemplateService) ListAutoPaging(ctx context.Context, query TemplateListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Template]
List WhatsApp message templates for this project.
func (*TemplateService) New ¶
func (r *TemplateService) New(ctx context.Context, body TemplateNewParams, opts ...option.RequestOption) (res *Template, err error)
Create a WhatsApp message template. Note: Templates must be approved by Meta before use.
func (*TemplateService) Submit ¶
func (r *TemplateService) Submit(ctx context.Context, templateID string, body TemplateSubmitParams, opts ...option.RequestOption) (res *Template, err error)
Submit a WhatsApp template to Meta for approval. The template must be in draft status and associated with a sender that has a WhatsApp Business Account configured.
type TemplateStatus ¶
type TemplateStatus string
const ( TemplateStatusDraft TemplateStatus = "draft" TemplateStatusPending TemplateStatus = "pending" TemplateStatusApproved TemplateStatus = "approved" TemplateStatusRejected TemplateStatus = "rejected" )
type TemplateSubmitParams ¶
type TemplateSubmitParams struct {
// The sender ID with the WhatsApp Business Account to submit the template to.
SenderID string `json:"senderId" api:"required"`
// Template category. If not provided, uses the category set on the template.
//
// Any of "UTILITY", "MARKETING", "AUTHENTICATION".
Category WhatsappCategory `json:"category,omitzero"`
// contains filtered or unexported fields
}
func (TemplateSubmitParams) MarshalJSON ¶
func (r TemplateSubmitParams) MarshalJSON() (data []byte, err error)
func (*TemplateSubmitParams) UnmarshalJSON ¶
func (r *TemplateSubmitParams) UnmarshalJSON(data []byte) error
type TemplateWhatsapp ¶
type TemplateWhatsapp struct {
// WhatsApp Business Account namespace.
Namespace string `json:"namespace"`
// WhatsApp approval status.
Status string `json:"status"`
// WhatsApp template name.
TemplateName string `json:"templateName"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Namespace respjson.Field
Status respjson.Field
TemplateName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
WhatsApp-specific template information.
func (TemplateWhatsapp) RawJSON ¶
func (r TemplateWhatsapp) RawJSON() string
Returns the unmodified JSON received from the API
func (*TemplateWhatsapp) UnmarshalJSON ¶
func (r *TemplateWhatsapp) UnmarshalJSON(data []byte) error
type WebhookEvent ¶
type WebhookEvent string
Type of event that triggers the webhook.
**Message lifecycle events:**
- `message.queued`: Message created and queued for sending. `data.status` = `queued`
- `message.sent`: Message accepted by the provider. `data.status` = `sent`
- `message.delivered`: Message delivered to recipient. `data.status` = `delivered`
- `message.failed`: Message failed to send. `data.status` = `failed`
**Inbound events:**
- `message.inbound`: New message received from a contact. Reactions are delivered as `message.inbound` with `messageType='reaction'`
- `message.unsupported`: Received a message type that is not supported
**Other events:**
- `conversation.new`: New conversation started with a contact - `template.status_changed`: WhatsApp template approval status changed
const ( WebhookEventMessageQueued WebhookEvent = "message.queued" WebhookEventMessageSent WebhookEvent = "message.sent" WebhookEventMessageDelivered WebhookEvent = "message.delivered" WebhookEventMessageFailed WebhookEvent = "message.failed" WebhookEventMessageInbound WebhookEvent = "message.inbound" WebhookEventMessageUnsupported WebhookEvent = "message.unsupported" WebhookEventConversationNew WebhookEvent = "conversation.new" WebhookEventTemplateStatusChanged WebhookEvent = "template.status_changed" )
type WebhookSecretResponse ¶
type WebhookSecretResponse struct {
// The new webhook secret.
Secret string `json:"secret" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Secret respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookSecretResponse) RawJSON ¶
func (r WebhookSecretResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookSecretResponse) UnmarshalJSON ¶
func (r *WebhookSecretResponse) UnmarshalJSON(data []byte) error
type WhatsappBusinessProfile ¶
type WhatsappBusinessProfile struct {
// Short description of the business (max 139 characters).
About string `json:"about"`
// Physical address of the business (max 256 characters).
Address string `json:"address"`
// Extended description of the business (max 512 characters).
Description string `json:"description"`
// Business email address.
Email string `json:"email" format:"email"`
// URL of the business profile picture.
ProfilePictureURL string `json:"profilePictureUrl" format:"uri"`
// Business category for WhatsApp Business profile.
//
// Any of "UNDEFINED", "OTHER", "AUTO", "BEAUTY", "APPAREL", "EDU", "ENTERTAIN",
// "EVENT_PLAN", "FINANCE", "GROCERY", "GOVT", "HOTEL", "HEALTH", "NONPROFIT",
// "PROF_SERVICES", "RETAIL", "TRAVEL", "RESTAURANT", "NOT_A_BIZ".
Vertical WhatsappBusinessProfileVertical `json:"vertical"`
// Business website URLs (maximum 2).
Websites []string `json:"websites" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
About respjson.Field
Address respjson.Field
Description respjson.Field
Email respjson.Field
ProfilePictureURL respjson.Field
Vertical respjson.Field
Websites respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
WhatsApp Business profile information.
func (WhatsappBusinessProfile) RawJSON ¶
func (r WhatsappBusinessProfile) RawJSON() string
Returns the unmodified JSON received from the API
func (*WhatsappBusinessProfile) UnmarshalJSON ¶
func (r *WhatsappBusinessProfile) UnmarshalJSON(data []byte) error
type WhatsappBusinessProfileResponse ¶
type WhatsappBusinessProfileResponse struct {
// WhatsApp Business profile information.
Profile WhatsappBusinessProfile `json:"profile" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Profile respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WhatsappBusinessProfileResponse) RawJSON ¶
func (r WhatsappBusinessProfileResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WhatsappBusinessProfileResponse) UnmarshalJSON ¶
func (r *WhatsappBusinessProfileResponse) UnmarshalJSON(data []byte) error
type WhatsappBusinessProfileVertical ¶
type WhatsappBusinessProfileVertical string
Business category for WhatsApp Business profile.
const ( WhatsappBusinessProfileVerticalUndefined WhatsappBusinessProfileVertical = "UNDEFINED" WhatsappBusinessProfileVerticalOther WhatsappBusinessProfileVertical = "OTHER" WhatsappBusinessProfileVerticalAuto WhatsappBusinessProfileVertical = "AUTO" WhatsappBusinessProfileVerticalBeauty WhatsappBusinessProfileVertical = "BEAUTY" WhatsappBusinessProfileVerticalApparel WhatsappBusinessProfileVertical = "APPAREL" WhatsappBusinessProfileVerticalEdu WhatsappBusinessProfileVertical = "EDU" WhatsappBusinessProfileVerticalEntertain WhatsappBusinessProfileVertical = "ENTERTAIN" WhatsappBusinessProfileVerticalEventPlan WhatsappBusinessProfileVertical = "EVENT_PLAN" WhatsappBusinessProfileVerticalFinance WhatsappBusinessProfileVertical = "FINANCE" WhatsappBusinessProfileVerticalGrocery WhatsappBusinessProfileVertical = "GROCERY" WhatsappBusinessProfileVerticalGovt WhatsappBusinessProfileVertical = "GOVT" WhatsappBusinessProfileVerticalHotel WhatsappBusinessProfileVertical = "HOTEL" WhatsappBusinessProfileVerticalHealth WhatsappBusinessProfileVertical = "HEALTH" WhatsappBusinessProfileVerticalNonprofit WhatsappBusinessProfileVertical = "NONPROFIT" WhatsappBusinessProfileVerticalProfServices WhatsappBusinessProfileVertical = "PROF_SERVICES" WhatsappBusinessProfileVerticalRetail WhatsappBusinessProfileVertical = "RETAIL" WhatsappBusinessProfileVerticalTravel WhatsappBusinessProfileVertical = "TRAVEL" WhatsappBusinessProfileVerticalRestaurant WhatsappBusinessProfileVertical = "RESTAURANT" WhatsappBusinessProfileVerticalNotABiz WhatsappBusinessProfileVertical = "NOT_A_BIZ" )
type WhatsappCategory ¶
type WhatsappCategory string
WhatsApp template category.
const ( WhatsappCategoryUtility WhatsappCategory = "UTILITY" WhatsappCategoryMarketing WhatsappCategory = "MARKETING" WhatsappCategoryAuthentication WhatsappCategory = "AUTHENTICATION" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|