transport_api_client

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 11 Imported by: 0

README

Transport API Client

A Go client library for interacting with the Message Gateway Transport API. This client provides methods for managing channels, templates, and message operations in a messaging platform.

Features

  • REST API Client: Generated from OpenAPI specification for type-safe API interactions
  • Transport-Level Operations: Methods for managing messaging transport including:
    • Channel management (activation, deactivation, updates)
    • Template management (activation, deactivation, updates)
    • Message operations (sending, editing, deleting)
    • File handling (uploading, retrieving)
    • Message reactions and read status management

Installation

go get github.com/retailcrm/transport-api-client-gen

Usage

Initializing the Client
package main

import (
    "context"
    "log"

    "github.com/retailcrm/trabsport-api-client-gen"
)

func main() {
    // Create a new client with the server URL
    client, err := transport_api_client.NewClientWithResponses("https://api.example.com")
    if err != nil {
        log.Fatalf("Error creating client: %v", err)
    }

    // Use the client to make API calls
    // ...
}
API Examples
Listing Channels
ctx := context.Background()
resp, err := client.ListChannelsWithResponse(ctx, nil)
if err != nil {
    log.Fatalf("Error listing channels: %v", err)
}

if resp.JSON200 != nil {
    for _, channel := range resp.JSON200.Channels {
        log.Printf("Channel: %s", channel.Name)
    }
}
Activating a Channel
ctx := context.Background()
request := transport_api_client.ActivateChannelJSONRequestBody{
    ChannelID: "channel123",
    Token:     "your-channel-token",
}

resp, err := client.ActivateChannelWithResponse(ctx, request)
if err != nil {
    log.Fatalf("Error activating channel: %v", err)
}

if resp.JSON200 != nil {
    log.Printf("Channel activated successfully")
}
Sending a Message
ctx := context.Background()
message := transport_api_client.SendMessageJSONRequestBody{
    ChannelID: "channel123",
    UserID:    "user456",
    Type:      "text",
    Content: transport_api_client.MessageContent{
        Text: "Hello from the transport API!",
    },
}

resp, err := client.SendMessageWithResponse(ctx, message)
if err != nil {
    log.Fatalf("Error sending message: %v", err)
}

if resp.JSON200 != nil {
    log.Printf("Message sent with ID: %s", resp.JSON200.MessageID)
}
Working with Templates
// Get available templates
ctx := context.Background()
resp, err := client.GetTemplatesWithResponse(ctx)
if err != nil {
    log.Fatalf("Error getting templates: %v", err)
}

if resp.JSON200 != nil {
    for _, template := range resp.JSON200.Templates {
        log.Printf("Template: %s", template.Name)
    }
}

// Activate a template
activateReq := transport_api_client.ActivateTemplateJSONRequestBody{
    TemplateCode: "welcome_message",
    Language:     "en",
}

activateResp, err := client.ActivateTemplateWithResponse(ctx, "channel123", activateReq)
if err != nil {
    log.Fatalf("Error activating template: %v", err)
}

if activateResp.JSON200 != nil {
    log.Printf("Template activated successfully")
}
File Operations
// Upload a file by URL
ctx := context.Background()
uploadReq := transport_api_client.UploadFileByUrlJSONRequestBody{
    URL:      "https://example.com/image.jpg",
    Filename: "image.jpg",
}

uploadResp, err := client.UploadFileByUrlWithResponse(ctx, uploadReq)
if err != nil {
    log.Fatalf("Error uploading file: %v", err)
}

if uploadResp.JSON200 != nil {
    fileID := uploadResp.JSON200.FileUUID
    log.Printf("File uploaded with ID: %s", fileID)

    // Get file URL
    fileResp, err := client.GetFileUrlWithResponse(ctx, transport_api_client.FileUUIDPath(fileID))
    if err != nil {
        log.Fatalf("Error getting file URL: %v", err)
    }

    if fileResp.JSON200 != nil {
        log.Printf("File URL: %s", fileResp.JSON200.URL)
    }
}

Error Handling

The client provides detailed error responses that can be handled as follows:

resp, err := client.SendMessageWithResponse(ctx, message)
if err != nil {
    log.Fatalf("Error sending message: %v", err)
}

if resp.JSONDefault != nil {
    log.Printf("API Error: %s - %s", resp.JSONDefault.Code, resp.JSONDefault.Message)
}

License

This library is distributed under the terms of the license agreement provided with the software.

Documentation

Overview

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

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

Index

Constants

View Source
const (
	Transport_tokenScopes = "transport_token.Scopes"
)

Variables

This section is empty.

Functions

func NewAckMessageRequest

func NewAckMessageRequest(server string, body AckMessageJSONRequestBody) (*http.Request, error)

NewAckMessageRequest calls the generic AckMessage builder with application/json body

func NewAckMessageRequestWithBody

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

NewAckMessageRequestWithBody generates requests for AckMessage with any type of body

func NewActivateChannelRequest

func NewActivateChannelRequest(server string, body ActivateChannelJSONRequestBody) (*http.Request, error)

NewActivateChannelRequest calls the generic ActivateChannel builder with application/json body

func NewActivateChannelRequestWithBody

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

NewActivateChannelRequestWithBody generates requests for ActivateChannel with any type of body

func NewActivateTemplateRequest

func NewActivateTemplateRequest(server string, channelID ChannelID, body ActivateTemplateJSONRequestBody) (*http.Request, error)

NewActivateTemplateRequest calls the generic ActivateTemplate builder with application/json body

func NewActivateTemplateRequestWithBody

func NewActivateTemplateRequestWithBody(server string, channelID ChannelID, contentType string, body io.Reader) (*http.Request, error)

NewActivateTemplateRequestWithBody generates requests for ActivateTemplate with any type of body

func NewAddMessageReactionRequest

func NewAddMessageReactionRequest(server string, body AddMessageReactionJSONRequestBody) (*http.Request, error)

NewAddMessageReactionRequest calls the generic AddMessageReaction builder with application/json body

func NewAddMessageReactionRequestWithBody

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

NewAddMessageReactionRequestWithBody generates requests for AddMessageReaction with any type of body

func NewDeactivateChannelRequest

func NewDeactivateChannelRequest(server string, channelID ChannelID) (*http.Request, error)

NewDeactivateChannelRequest generates requests for DeactivateChannel

func NewDeactivateTemplateRequest

func NewDeactivateTemplateRequest(server string, channelID ChannelID, templateCode TemplateCodePath) (*http.Request, error)

NewDeactivateTemplateRequest generates requests for DeactivateTemplate

func NewDeleteMessageReactionRequest

func NewDeleteMessageReactionRequest(server string, body DeleteMessageReactionJSONRequestBody) (*http.Request, error)

NewDeleteMessageReactionRequest calls the generic DeleteMessageReaction builder with application/json body

func NewDeleteMessageReactionRequestWithBody

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

NewDeleteMessageReactionRequestWithBody generates requests for DeleteMessageReaction with any type of body

func NewDeleteMessageRequest

func NewDeleteMessageRequest(server string, body DeleteMessageJSONRequestBody) (*http.Request, error)

NewDeleteMessageRequest calls the generic DeleteMessage builder with application/json body

func NewDeleteMessageRequestWithBody

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

NewDeleteMessageRequestWithBody generates requests for DeleteMessage with any type of body

func NewEditMessageRequest

func NewEditMessageRequest(server string, body EditMessageJSONRequestBody) (*http.Request, error)

NewEditMessageRequest calls the generic EditMessage builder with application/json body

func NewEditMessageRequestWithBody

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

NewEditMessageRequestWithBody generates requests for EditMessage with any type of body

func NewGetFileUrlRequest

func NewGetFileUrlRequest(server string, id FileUUIDPath) (*http.Request, error)

NewGetFileUrlRequest generates requests for GetFileUrl

func NewGetTemplatesRequest

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

NewGetTemplatesRequest generates requests for GetTemplates

func NewListChannelsRequest

func NewListChannelsRequest(server string, params *ListChannelsParams) (*http.Request, error)

NewListChannelsRequest generates requests for ListChannels

func NewMarkMessageReadRequest

func NewMarkMessageReadRequest(server string, body MarkMessageReadJSONRequestBody) (*http.Request, error)

NewMarkMessageReadRequest calls the generic MarkMessageRead builder with application/json body

func NewMarkMessageReadRequestWithBody

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

NewMarkMessageReadRequestWithBody generates requests for MarkMessageRead with any type of body

func NewMarkMessagesReadUntilRequest

func NewMarkMessagesReadUntilRequest(server string, body MarkMessagesReadUntilJSONRequestBody) (*http.Request, error)

NewMarkMessagesReadUntilRequest calls the generic MarkMessagesReadUntil builder with application/json body

func NewMarkMessagesReadUntilRequestWithBody

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

NewMarkMessagesReadUntilRequestWithBody generates requests for MarkMessagesReadUntil with any type of body

func NewRestoreMessageRequest

func NewRestoreMessageRequest(server string, body RestoreMessageJSONRequestBody) (*http.Request, error)

NewRestoreMessageRequest calls the generic RestoreMessage builder with application/json body

func NewRestoreMessageRequestWithBody

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

NewRestoreMessageRequestWithBody generates requests for RestoreMessage with any type of body

func NewSendHistoryMessageRequest

func NewSendHistoryMessageRequest(server string, body SendHistoryMessageJSONRequestBody) (*http.Request, error)

NewSendHistoryMessageRequest calls the generic SendHistoryMessage builder with application/json body

func NewSendHistoryMessageRequestWithBody

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

NewSendHistoryMessageRequestWithBody generates requests for SendHistoryMessage with any type of body

func NewSendMessageRequest

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

NewSendMessageRequest calls the generic SendMessage builder with application/json body

func NewSendMessageRequestWithBody

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

NewSendMessageRequestWithBody generates requests for SendMessage with any type of body

func NewUpdateChannelRequest

func NewUpdateChannelRequest(server string, channelID ChannelID, body UpdateChannelJSONRequestBody) (*http.Request, error)

NewUpdateChannelRequest calls the generic UpdateChannel builder with application/json body

func NewUpdateChannelRequestWithBody

func NewUpdateChannelRequestWithBody(server string, channelID ChannelID, contentType string, body io.Reader) (*http.Request, error)

NewUpdateChannelRequestWithBody generates requests for UpdateChannel with any type of body

func NewUpdateTemplateRequest

func NewUpdateTemplateRequest(server string, channelID ChannelID, templateCode TemplateCodePath, body UpdateTemplateJSONRequestBody) (*http.Request, error)

NewUpdateTemplateRequest calls the generic UpdateTemplate builder with application/json body

func NewUpdateTemplateRequestWithBody

func NewUpdateTemplateRequestWithBody(server string, channelID ChannelID, templateCode TemplateCodePath, contentType string, body io.Reader) (*http.Request, error)

NewUpdateTemplateRequestWithBody generates requests for UpdateTemplate with any type of body

func NewUploadFileByUrlRequest

func NewUploadFileByUrlRequest(server string, body UploadFileByUrlJSONRequestBody) (*http.Request, error)

NewUploadFileByUrlRequest calls the generic UploadFileByUrl builder with application/json body

func NewUploadFileByUrlRequestWithBody

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

NewUploadFileByUrlRequestWithBody generates requests for UploadFileByUrl with any type of body

func NewUploadFileRequestWithBody

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

NewUploadFileRequestWithBody generates requests for UploadFile with any type of body

Types

type AckMessageJSONBody

type AckMessageJSONBody struct {
	// Channel Sending channel identifier
	Channel int64 `binding:"required" json:"channel"`

	// CreatedAt Date and time of sending
	CreatedAt *time.Time    `json:"created_at"`
	Error     *SendingError `json:"error"`

	// ExternalMessageID External identifier of a message
	// Deprecated:
	ExternalMessageID *string `binding:"omitempty,max=255" json:"external_message_id,omitempty" mod:"trim,escape"`

	// Message Message identifier
	Message *MessageIdentifier `json:"message,omitempty"`

	// TransportMessageID Message identifier in transport
	TransportMessageID *string `binding:"omitempty,max=255" json:"transport_message_id" mod:"trim,escape"`
}

AckMessageJSONBody defines parameters for AckMessage.

type AckMessageJSONRequestBody

type AckMessageJSONRequestBody AckMessageJSONBody

AckMessageJSONRequestBody defines body for AckMessage for application/json ContentType.

type AckMessageRequest

type AckMessageRequest struct {
	// Channel Sending channel identifier
	Channel int64 `binding:"required" json:"channel"`

	// CreatedAt Date and time of sending
	CreatedAt *time.Time    `json:"created_at"`
	Error     *SendingError `json:"error"`

	// ExternalMessageID External identifier of a message
	// Deprecated:
	ExternalMessageID *string `binding:"omitempty,max=255" json:"external_message_id,omitempty" mod:"trim,escape"`

	// Message Message identifier
	Message *MessageIdentifier `json:"message,omitempty"`

	// TransportMessageID Message identifier in transport
	TransportMessageID *string `binding:"omitempty,max=255" json:"transport_message_id" mod:"trim,escape"`
}

AckMessageRequest defines model for AckMessageRequest.

type AckMessageResp

type AckMessageResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseAckMessageResp

func ParseAckMessageResp(rsp *http.Response) (*AckMessageResp, error)

ParseAckMessageResp parses an HTTP response from a AckMessageWithResponse call

func (AckMessageResp) Status

func (r AckMessageResp) Status() string

Status returns HTTPResponse.Status

func (AckMessageResp) StatusCode

func (r AckMessageResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ActivateChannelJSONBody

type ActivateChannelJSONBody struct {
	// AvatarUrl Channel avatar URL
	AvatarUrl *string `binding:"omitempty,max=255" json:"avatar_url,omitempty" mod:"trim,escape"`

	// ExternalID External identifier of a channel
	ExternalID string `binding:"omitempty,max=64" json:"external_id" mod:"trim,escape"`

	// ID Channel identifier
	ID int64 `binding:"min=0" json:"id"`

	// Name Channel name
	Name *string `binding:"omitempty,max=100" json:"name,omitempty" mod:"trim,escape"`

	// Settings Channel settings
	Settings ChannelSettings `json:"settings,omitempty"`
	Type     ChannelType     `binding:"required,enum-valid" json:"type"`
}

ActivateChannelJSONBody defines parameters for ActivateChannel.

type ActivateChannelJSONRequestBody

type ActivateChannelJSONRequestBody ActivateChannelJSONBody

ActivateChannelJSONRequestBody defines body for ActivateChannel for application/json ContentType.

type ActivateChannelRequest

type ActivateChannelRequest struct {
	// AvatarUrl Channel avatar URL
	AvatarUrl *string `binding:"omitempty,max=255" json:"avatar_url,omitempty" mod:"trim,escape"`

	// ExternalID External identifier of a channel
	ExternalID string `binding:"omitempty,max=64" json:"external_id" mod:"trim,escape"`

	// ID Channel identifier
	ID int64 `binding:"min=0" json:"id"`

	// Name Channel name
	Name *string `binding:"omitempty,max=100" json:"name,omitempty" mod:"trim,escape"`

	// Settings Channel settings
	Settings ChannelSettings `json:"settings,omitempty"`
	Type     ChannelType     `binding:"required,enum-valid" json:"type"`
}

ActivateChannelRequest defines model for ActivateChannelRequest.

type ActivateChannelResp

type ActivateChannelResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ActivateChannelResponse
	JSON201      *ActivateChannelResponse
	JSONDefault  *ErrorResponse
}

func ParseActivateChannelResp

func ParseActivateChannelResp(rsp *http.Response) (*ActivateChannelResp, error)

ParseActivateChannelResp parses an HTTP response from a ActivateChannelWithResponse call

func (ActivateChannelResp) Status

func (r ActivateChannelResp) Status() string

Status returns HTTPResponse.Status

func (ActivateChannelResp) StatusCode

func (r ActivateChannelResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ActivateChannelResponse

type ActivateChannelResponse struct {
	// ActivatedAt Date and time of channel activation
	ActivatedAt time.Time `json:"activated_at" time_format:"2006-01-02T15:04:05Z07:00"`

	// ID Channel identifier
	ID int64 `json:"id"`
}

ActivateChannelResponse defines model for ActivateChannelResponse.

type ActivateTemplateJSONBody

type ActivateTemplateJSONBody struct {
	// Body Template body
	Body string `json:"body" mod:"trim,escape"`

	// Buttons List of template buttons
	Buttons *TemplateButtons `json:"buttons,omitempty"`

	// Category Template category
	Category *string `json:"category,omitempty" mod:"trim,escape"`

	// Code Template unique code
	Code string `binding:"required,min=1,max=512" json:"code,omitempty" mod:"trim,escape"`

	// Footer Template footer
	Footer *string `json:"footer,omitempty" mod:"trim,escape"`

	// Header Header section of the template
	Header *TemplateHeader `json:"header,omitempty"`

	// Lang Template language
	Lang *string `json:"lang,omitempty" mod:"trim,escape"`

	// Name Template name
	Name               string                      `binding:"required,min=1,max=512" json:"name" mod:"trim,escape"`
	Quality            *TemplateQuality            `binding:"omitempty,enum-valid" json:"quality,omitempty"`
	RejectionReason    *RejectReason               `binding:"omitempty,enum-valid" json:"rejection_reason,omitempty" mod:"trim,escape"`
	Template           []TemplateItem              `json:"template"`
	Type               *TemplateType               `binding:"required" json:"type,omitempty"`
	VerificationStatus *TemplateVerificationStatus `binding:"omitempty,enum-valid" json:"verification_status,omitempty"`
}

ActivateTemplateJSONBody defines parameters for ActivateTemplate.

type ActivateTemplateJSONRequestBody

type ActivateTemplateJSONRequestBody ActivateTemplateJSONBody

ActivateTemplateJSONRequestBody defines body for ActivateTemplate for application/json ContentType.

type ActivateTemplateRequest

type ActivateTemplateRequest struct {
	// Body Template body
	Body string `json:"body" mod:"trim,escape"`

	// Buttons List of template buttons
	Buttons *TemplateButtons `json:"buttons,omitempty"`

	// Category Template category
	Category *string `json:"category,omitempty" mod:"trim,escape"`

	// Code Template unique code
	Code string `binding:"required,min=1,max=512" json:"code,omitempty" mod:"trim,escape"`

	// Footer Template footer
	Footer *string `json:"footer,omitempty" mod:"trim,escape"`

	// Header Header section of the template
	Header *TemplateHeader `json:"header,omitempty"`

	// Lang Template language
	Lang *string `json:"lang,omitempty" mod:"trim,escape"`

	// Name Template name
	Name               string                      `binding:"required,min=1,max=512" json:"name" mod:"trim,escape"`
	Quality            *TemplateQuality            `binding:"omitempty,enum-valid" json:"quality,omitempty"`
	RejectionReason    *RejectReason               `binding:"omitempty,enum-valid" json:"rejection_reason,omitempty" mod:"trim,escape"`
	Template           []TemplateItem              `json:"template"`
	Type               *TemplateType               `binding:"required" json:"type,omitempty"`
	VerificationStatus *TemplateVerificationStatus `binding:"omitempty,enum-valid" json:"verification_status,omitempty"`
}

ActivateTemplateRequest defines model for ActivateTemplateRequest.

type ActivateTemplateResp

type ActivateTemplateResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseActivateTemplateResp

func ParseActivateTemplateResp(rsp *http.Response) (*ActivateTemplateResp, error)

ParseActivateTemplateResp parses an HTTP response from a ActivateTemplateWithResponse call

func (ActivateTemplateResp) Status

func (r ActivateTemplateResp) Status() string

Status returns HTTPResponse.Status

func (ActivateTemplateResp) StatusCode

func (r ActivateTemplateResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AddMessageReactionJSONBody

type AddMessageReactionJSONBody struct {
	// Channel Sending channel identifier
	Channel int64             `binding:"required" json:"channel"`
	Message MessageIdentifier `binding:"required" json:"message"`

	// Reaction Removable reaction
	Reaction string `binding:"required" json:"reaction"`
}

AddMessageReactionJSONBody defines parameters for AddMessageReaction.

type AddMessageReactionJSONRequestBody

type AddMessageReactionJSONRequestBody AddMessageReactionJSONBody

AddMessageReactionJSONRequestBody defines body for AddMessageReaction for application/json ContentType.

type AddMessageReactionResp

type AddMessageReactionResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseAddMessageReactionResp

func ParseAddMessageReactionResp(rsp *http.Response) (*AddMessageReactionResp, error)

ParseAddMessageReactionResp parses an HTTP response from a AddMessageReactionWithResponse call

func (AddMessageReactionResp) Status

func (r AddMessageReactionResp) Status() string

Status returns HTTPResponse.Status

func (AddMessageReactionResp) StatusCode

func (r AddMessageReactionResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type AddReactionRequest

type AddReactionRequest struct {
	// Channel Sending channel identifier
	Channel int64             `binding:"required" json:"channel"`
	Message MessageIdentifier `binding:"required" json:"message"`

	// Reaction Removable reaction
	Reaction string `binding:"required" json:"reaction"`
}

AddReactionRequest defines model for AddReactionRequest.

type AudioMessageSetting

type AudioMessageSetting struct {
	// Creating Support for operation with messages of the given type
	Creating ChannelFeature `json:"creating,omitempty"`

	// Deleting Support for operation with messages of the given type
	Deleting ChannelFeature `json:"deleting,omitempty"`

	// MaxItemSize Maximum audio size to send
	MaxItemSize *int64 `json:"max_item_size,omitempty"`

	// MaxItemsCount Maximum number of audio attachments per message
	MaxItemsCount *int `json:"max_items_count,omitempty"`

	// Quoting Support for operation with messages of the given type
	Quoting ChannelFeature `json:"quoting,omitempty"`

	// Reaction Support for operation with messages of the given type
	Reaction ChannelFeature `json:"reaction,omitempty"`
}

AudioMessageSetting Audio messages support

type Boolean

type Boolean string

Boolean Boolean type

const (
	BooleanFalse Boolean = "false"
	BooleanN0    Boolean = "0"
	BooleanN1    Boolean = "1"
	BooleanTrue  Boolean = "true"
)

Defines values for Boolean.

func (Boolean) EnumValues

func (Boolean) EnumValues() []string

EnumValues returns all valid values for Boolean.

func (*Boolean) UnmarshalJSON

func (v *Boolean) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Boolean.

func (Boolean) ValidateEnum

func (v Boolean) ValidateEnum() error

Validate validates the value of Boolean.

type Channel

type Channel struct {
	ActivatedAt   time.Time       `json:"activated_at" time_format:"2006-01-02T15:04:05.999999Z07:00"`
	CreatedAt     time.Time       `json:"created_at" time_format:"2006-01-02T15:04:05.999999Z07:00"`
	DeactivatedAt *time.Time      `json:"deactivated_at" time_format:"2006-01-02T15:04:05.999999Z07:00"`
	ExternalID    *string         `json:"external_id"`
	ID            int64           `json:"id"`
	IsActive      bool            `json:"is_active"`
	Name          *string         `json:"name"`
	Settings      ChannelSettings `json:"settings"`

	// Type Channel types
	Type      ChannelType `json:"type"`
	UpdatedAt *time.Time  `json:"updated_at" time_format:"2006-01-02T15:04:05.999999Z07:00"`
}

Channel Channel

type ChannelActiveQuery

type ChannelActiveQuery = Boolean

ChannelActiveQuery Boolean type

type ChannelFeature

type ChannelFeature string

ChannelFeature Support for operation with messages of the given type

const (
	ChannelFeatureBoth    ChannelFeature = "both"
	ChannelFeatureNone    ChannelFeature = "none"
	ChannelFeatureReceive ChannelFeature = "receive"
	ChannelFeatureSend    ChannelFeature = "send"
)

Defines values for ChannelFeature.

func (ChannelFeature) EnumValues

func (ChannelFeature) EnumValues() []string

EnumValues returns all valid values for ChannelFeature.

func (*ChannelFeature) UnmarshalJSON

func (v *ChannelFeature) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ChannelFeature.

func (ChannelFeature) ValidateEnum

func (v ChannelFeature) ValidateEnum() error

Validate validates the value of ChannelFeature.

type ChannelID

type ChannelID = int64

ChannelID defines model for ChannelIdPath.

type ChannelSettings

type ChannelSettings struct {
	// Audio Audio messages support
	Audio AudioMessageSetting `json:"audio,omitempty"`

	// CustomerExternalId Support for external customer identifiers
	CustomerExternalId CustomerExternalId `json:"customer_external_id,omitempty"`

	// File File messages support
	File FileMessageSetting `json:"file,omitempty"`

	// Image Media messages support
	Image ImageMessageSetting `json:"image,omitempty"`

	// Order Order messages support
	Order OrderMessageSetting `json:"order,omitempty"`

	// Product Product messages support
	Product ProductMessageSetting `json:"product,omitempty"`

	// Reactions Support for working with reactions for messages
	Reactions Reactions `json:"reactions,omitempty"`

	// SendingPolicy Message sending policy
	SendingPolicy SendingPolicy `json:"sending_policy,omitempty"`

	// Status Transmitting message status information
	Status StatusSetting `json:"status,omitempty"`

	// Suggestions Support for quick response types
	Suggestions Suggestions `json:"suggestions,omitempty"`

	// Template Support for message templates
	Template TemplateSetting `json:"template,omitempty"`

	// Text Text messages support
	Text TextMessageSetting `json:"text,omitempty"`

	// Whatsapp WhatsApp channel properties
	Whatsapp *WAChannelProperties `json:"whatsapp,omitempty"`
}

ChannelSettings Channel settings

type ChannelType

type ChannelType string

ChannelType Channel types

const (
	ChannelTypeAvito         ChannelType = "avito"
	ChannelTypeConsultant    ChannelType = "consultant"
	ChannelTypeCustom        ChannelType = "custom"
	ChannelTypeDrom          ChannelType = "drom"
	ChannelTypeFbmessenger   ChannelType = "fbmessenger"
	ChannelTypeInstagram     ChannelType = "instagram"
	ChannelTypeMax           ChannelType = "max"
	ChannelTypeMegaMarket    ChannelType = "mega_market"
	ChannelTypeOdnoklassniki ChannelType = "odnoklassniki"
	ChannelTypeOzon          ChannelType = "ozon"
	ChannelTypeSkype         ChannelType = "skype"
	ChannelTypeTelegram      ChannelType = "telegram"
	ChannelTypeViber         ChannelType = "viber"
	ChannelTypeVk            ChannelType = "vk"
	ChannelTypeWhatsapp      ChannelType = "whatsapp"
	ChannelTypeWildberries   ChannelType = "wildberries"
	ChannelTypeYandexChat    ChannelType = "yandex_chat"
	ChannelTypeYandexMarket  ChannelType = "yandex_market"
	ChannelTypeYoula         ChannelType = "youla"
)

Defines values for ChannelType.

func (ChannelType) EnumValues

func (ChannelType) EnumValues() []string

EnumValues returns all valid values for ChannelType.

func (*ChannelType) UnmarshalJSON

func (v *ChannelType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ChannelType.

func (ChannelType) ValidateEnum

func (v ChannelType) ValidateEnum() error

Validate validates the value of ChannelType.

type ChannelTypeQuery

type ChannelTypeQuery = []ChannelType

ChannelTypeQuery defines model for ChannelTypeQuery.

type ChannelsListResponse

type ChannelsListResponse = []Channel

ChannelsListResponse defines model for ChannelsListResponse.

type Client

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

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

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

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

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

Creates a new Client, with reasonable defaults

func (*Client) AckMessage

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

func (*Client) AckMessageWithBody

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

func (*Client) ActivateChannel

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

func (*Client) ActivateChannelWithBody

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

func (*Client) ActivateTemplate

func (c *Client) ActivateTemplate(ctx context.Context, channelID ChannelID, body ActivateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ActivateTemplateWithBody

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

func (*Client) AddMessageReaction

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

func (*Client) AddMessageReactionWithBody

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

func (*Client) DeactivateChannel

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

func (*Client) DeactivateTemplate

func (c *Client) DeactivateTemplate(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteMessage

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

func (*Client) DeleteMessageReaction

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

func (*Client) DeleteMessageReactionWithBody

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

func (*Client) DeleteMessageWithBody

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

func (*Client) EditMessage

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

func (*Client) EditMessageWithBody

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

func (*Client) GetFileUrl

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

func (*Client) GetTemplates

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

func (*Client) ListChannels

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

func (*Client) MarkMessageRead

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

func (*Client) MarkMessageReadWithBody

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

func (*Client) MarkMessagesReadUntil

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

func (*Client) MarkMessagesReadUntilWithBody

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

func (*Client) RestoreMessage

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

func (*Client) RestoreMessageWithBody

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

func (*Client) SendHistoryMessage

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

func (*Client) SendHistoryMessageWithBody

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

func (*Client) SendMessage

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

func (*Client) SendMessageWithBody

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

func (*Client) UpdateChannel

func (c *Client) UpdateChannel(ctx context.Context, channelID ChannelID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateChannelWithBody

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

func (*Client) UpdateTemplate

func (c *Client) UpdateTemplate(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateTemplateWithBody

func (c *Client) UpdateTemplateWithBody(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UploadFileByUrl

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

func (*Client) UploadFileByUrlWithBody

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

func (*Client) UploadFileWithBody

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

type ClientInterface

type ClientInterface interface {
	// ListChannels request
	ListChannels(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ActivateChannelWithBody request with any body
	ActivateChannelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	ActivateChannel(ctx context.Context, body ActivateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeactivateChannel request
	DeactivateChannel(ctx context.Context, channelID ChannelID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateChannelWithBody request with any body
	UpdateChannelWithBody(ctx context.Context, channelID ChannelID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateChannel(ctx context.Context, channelID ChannelID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ActivateTemplateWithBody request with any body
	ActivateTemplateWithBody(ctx context.Context, channelID ChannelID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	ActivateTemplate(ctx context.Context, channelID ChannelID, body ActivateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeactivateTemplate request
	DeactivateTemplate(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateTemplateWithBody request with any body
	UpdateTemplateWithBody(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateTemplate(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UploadFileWithBody request with any body
	UploadFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UploadFileByUrlWithBody request with any body
	UploadFileByUrlWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UploadFileByUrl(ctx context.Context, body UploadFileByUrlJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFileUrl request
	GetFileUrl(ctx context.Context, id FileUUIDPath, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteMessageWithBody request with any body
	DeleteMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	DeleteMessage(ctx context.Context, body DeleteMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SendMessageWithBody request with any body
	SendMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SendMessage(ctx context.Context, body SendMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// EditMessageWithBody request with any body
	EditMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	EditMessage(ctx context.Context, body EditMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AckMessageWithBody request with any body
	AckMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AckMessage(ctx context.Context, body AckMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SendHistoryMessageWithBody request with any body
	SendHistoryMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	SendHistoryMessage(ctx context.Context, body SendHistoryMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteMessageReactionWithBody request with any body
	DeleteMessageReactionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	DeleteMessageReaction(ctx context.Context, body DeleteMessageReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddMessageReactionWithBody request with any body
	AddMessageReactionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddMessageReaction(ctx context.Context, body AddMessageReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MarkMessageReadWithBody request with any body
	MarkMessageReadWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	MarkMessageRead(ctx context.Context, body MarkMessageReadJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MarkMessagesReadUntilWithBody request with any body
	MarkMessagesReadUntilWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	MarkMessagesReadUntil(ctx context.Context, body MarkMessagesReadUntilJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RestoreMessageWithBody request with any body
	RestoreMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	RestoreMessage(ctx context.Context, body RestoreMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetTemplates request
	GetTemplates(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

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

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

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

func WithTransportToken added in v0.0.5

func WithTransportToken(token string) ClientOption

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

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

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

func (*ClientWithResponses) AckMessageWithBodyWithResponse

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

AckMessageWithBodyWithResponse request with arbitrary body returning *AckMessageResp

func (*ClientWithResponses) AckMessageWithResponse

func (c *ClientWithResponses) AckMessageWithResponse(ctx context.Context, body AckMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*AckMessageResp, error)

func (*ClientWithResponses) ActivateChannelWithBodyWithResponse

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

ActivateChannelWithBodyWithResponse request with arbitrary body returning *ActivateChannelResp

func (*ClientWithResponses) ActivateChannelWithResponse

func (c *ClientWithResponses) ActivateChannelWithResponse(ctx context.Context, body ActivateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*ActivateChannelResp, error)

func (*ClientWithResponses) ActivateTemplateWithBodyWithResponse

func (c *ClientWithResponses) ActivateTemplateWithBodyWithResponse(ctx context.Context, channelID ChannelID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ActivateTemplateResp, error)

ActivateTemplateWithBodyWithResponse request with arbitrary body returning *ActivateTemplateResp

func (*ClientWithResponses) ActivateTemplateWithResponse

func (c *ClientWithResponses) ActivateTemplateWithResponse(ctx context.Context, channelID ChannelID, body ActivateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*ActivateTemplateResp, error)

func (*ClientWithResponses) AddMessageReactionWithBodyWithResponse

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

AddMessageReactionWithBodyWithResponse request with arbitrary body returning *AddMessageReactionResp

func (*ClientWithResponses) AddMessageReactionWithResponse

func (c *ClientWithResponses) AddMessageReactionWithResponse(ctx context.Context, body AddMessageReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*AddMessageReactionResp, error)

func (*ClientWithResponses) DeactivateChannelWithResponse

func (c *ClientWithResponses) DeactivateChannelWithResponse(ctx context.Context, channelID ChannelID, reqEditors ...RequestEditorFn) (*DeactivateChannelResp, error)

DeactivateChannelWithResponse request returning *DeactivateChannelResp

func (*ClientWithResponses) DeactivateTemplateWithResponse

func (c *ClientWithResponses) DeactivateTemplateWithResponse(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, reqEditors ...RequestEditorFn) (*DeactivateTemplateResp, error)

DeactivateTemplateWithResponse request returning *DeactivateTemplateResp

func (*ClientWithResponses) DeleteMessageReactionWithBodyWithResponse

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

DeleteMessageReactionWithBodyWithResponse request with arbitrary body returning *DeleteMessageReactionResp

func (*ClientWithResponses) DeleteMessageReactionWithResponse

func (c *ClientWithResponses) DeleteMessageReactionWithResponse(ctx context.Context, body DeleteMessageReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteMessageReactionResp, error)

func (*ClientWithResponses) DeleteMessageWithBodyWithResponse

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

DeleteMessageWithBodyWithResponse request with arbitrary body returning *DeleteMessageResp

func (*ClientWithResponses) DeleteMessageWithResponse

func (c *ClientWithResponses) DeleteMessageWithResponse(ctx context.Context, body DeleteMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteMessageResp, error)

func (*ClientWithResponses) EditMessageWithBodyWithResponse

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

EditMessageWithBodyWithResponse request with arbitrary body returning *EditMessageResp

func (*ClientWithResponses) EditMessageWithResponse

func (c *ClientWithResponses) EditMessageWithResponse(ctx context.Context, body EditMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*EditMessageResp, error)

func (*ClientWithResponses) GetFileUrlWithResponse

func (c *ClientWithResponses) GetFileUrlWithResponse(ctx context.Context, id FileUUIDPath, reqEditors ...RequestEditorFn) (*GetFileUrlResp, error)

GetFileUrlWithResponse request returning *GetFileUrlResp

func (*ClientWithResponses) GetTemplatesWithResponse

func (c *ClientWithResponses) GetTemplatesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTemplatesResp, error)

GetTemplatesWithResponse request returning *GetTemplatesResp

func (*ClientWithResponses) ListChannelsWithResponse

func (c *ClientWithResponses) ListChannelsWithResponse(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*ListChannelsResp, error)

ListChannelsWithResponse request returning *ListChannelsResp

func (*ClientWithResponses) MarkMessageReadWithBodyWithResponse

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

MarkMessageReadWithBodyWithResponse request with arbitrary body returning *MarkMessageReadResp

func (*ClientWithResponses) MarkMessageReadWithResponse

func (c *ClientWithResponses) MarkMessageReadWithResponse(ctx context.Context, body MarkMessageReadJSONRequestBody, reqEditors ...RequestEditorFn) (*MarkMessageReadResp, error)

func (*ClientWithResponses) MarkMessagesReadUntilWithBodyWithResponse

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

MarkMessagesReadUntilWithBodyWithResponse request with arbitrary body returning *MarkMessagesReadUntilResp

func (*ClientWithResponses) MarkMessagesReadUntilWithResponse

func (c *ClientWithResponses) MarkMessagesReadUntilWithResponse(ctx context.Context, body MarkMessagesReadUntilJSONRequestBody, reqEditors ...RequestEditorFn) (*MarkMessagesReadUntilResp, error)

func (*ClientWithResponses) RestoreMessageWithBodyWithResponse

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

RestoreMessageWithBodyWithResponse request with arbitrary body returning *RestoreMessageResp

func (*ClientWithResponses) RestoreMessageWithResponse

func (c *ClientWithResponses) RestoreMessageWithResponse(ctx context.Context, body RestoreMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*RestoreMessageResp, error)

func (*ClientWithResponses) SendHistoryMessageWithBodyWithResponse

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

SendHistoryMessageWithBodyWithResponse request with arbitrary body returning *SendHistoryMessageResp

func (*ClientWithResponses) SendHistoryMessageWithResponse

func (c *ClientWithResponses) SendHistoryMessageWithResponse(ctx context.Context, body SendHistoryMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SendHistoryMessageResp, error)

func (*ClientWithResponses) SendMessageWithBodyWithResponse

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

SendMessageWithBodyWithResponse request with arbitrary body returning *SendMessageResp

func (*ClientWithResponses) SendMessageWithResponse

func (c *ClientWithResponses) SendMessageWithResponse(ctx context.Context, body SendMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SendMessageResp, error)

func (*ClientWithResponses) UpdateChannelWithBodyWithResponse

func (c *ClientWithResponses) UpdateChannelWithBodyWithResponse(ctx context.Context, channelID ChannelID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResp, error)

UpdateChannelWithBodyWithResponse request with arbitrary body returning *UpdateChannelResp

func (*ClientWithResponses) UpdateChannelWithResponse

func (c *ClientWithResponses) UpdateChannelWithResponse(ctx context.Context, channelID ChannelID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResp, error)

func (*ClientWithResponses) UpdateTemplateWithBodyWithResponse

func (c *ClientWithResponses) UpdateTemplateWithBodyWithResponse(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTemplateResp, error)

UpdateTemplateWithBodyWithResponse request with arbitrary body returning *UpdateTemplateResp

func (*ClientWithResponses) UpdateTemplateWithResponse

func (c *ClientWithResponses) UpdateTemplateWithResponse(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTemplateResp, error)

func (*ClientWithResponses) UploadFileByUrlWithBodyWithResponse

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

UploadFileByUrlWithBodyWithResponse request with arbitrary body returning *UploadFileByUrlResp

func (*ClientWithResponses) UploadFileByUrlWithResponse

func (c *ClientWithResponses) UploadFileByUrlWithResponse(ctx context.Context, body UploadFileByUrlJSONRequestBody, reqEditors ...RequestEditorFn) (*UploadFileByUrlResp, error)

func (*ClientWithResponses) UploadFileWithBodyWithResponse

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

UploadFileWithBodyWithResponse request with arbitrary body returning *UploadFileResp

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListChannelsWithResponse request
	ListChannelsWithResponse(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*ListChannelsResp, error)

	// ActivateChannelWithBodyWithResponse request with any body
	ActivateChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ActivateChannelResp, error)

	ActivateChannelWithResponse(ctx context.Context, body ActivateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*ActivateChannelResp, error)

	// DeactivateChannelWithResponse request
	DeactivateChannelWithResponse(ctx context.Context, channelID ChannelID, reqEditors ...RequestEditorFn) (*DeactivateChannelResp, error)

	// UpdateChannelWithBodyWithResponse request with any body
	UpdateChannelWithBodyWithResponse(ctx context.Context, channelID ChannelID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResp, error)

	UpdateChannelWithResponse(ctx context.Context, channelID ChannelID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResp, error)

	// ActivateTemplateWithBodyWithResponse request with any body
	ActivateTemplateWithBodyWithResponse(ctx context.Context, channelID ChannelID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ActivateTemplateResp, error)

	ActivateTemplateWithResponse(ctx context.Context, channelID ChannelID, body ActivateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*ActivateTemplateResp, error)

	// DeactivateTemplateWithResponse request
	DeactivateTemplateWithResponse(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, reqEditors ...RequestEditorFn) (*DeactivateTemplateResp, error)

	// UpdateTemplateWithBodyWithResponse request with any body
	UpdateTemplateWithBodyWithResponse(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTemplateResp, error)

	UpdateTemplateWithResponse(ctx context.Context, channelID ChannelID, templateCode TemplateCodePath, body UpdateTemplateJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTemplateResp, error)

	// UploadFileWithBodyWithResponse request with any body
	UploadFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UploadFileResp, error)

	// UploadFileByUrlWithBodyWithResponse request with any body
	UploadFileByUrlWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UploadFileByUrlResp, error)

	UploadFileByUrlWithResponse(ctx context.Context, body UploadFileByUrlJSONRequestBody, reqEditors ...RequestEditorFn) (*UploadFileByUrlResp, error)

	// GetFileUrlWithResponse request
	GetFileUrlWithResponse(ctx context.Context, id FileUUIDPath, reqEditors ...RequestEditorFn) (*GetFileUrlResp, error)

	// DeleteMessageWithBodyWithResponse request with any body
	DeleteMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteMessageResp, error)

	DeleteMessageWithResponse(ctx context.Context, body DeleteMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteMessageResp, error)

	// SendMessageWithBodyWithResponse request with any body
	SendMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendMessageResp, error)

	SendMessageWithResponse(ctx context.Context, body SendMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SendMessageResp, error)

	// EditMessageWithBodyWithResponse request with any body
	EditMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EditMessageResp, error)

	EditMessageWithResponse(ctx context.Context, body EditMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*EditMessageResp, error)

	// AckMessageWithBodyWithResponse request with any body
	AckMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AckMessageResp, error)

	AckMessageWithResponse(ctx context.Context, body AckMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*AckMessageResp, error)

	// SendHistoryMessageWithBodyWithResponse request with any body
	SendHistoryMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SendHistoryMessageResp, error)

	SendHistoryMessageWithResponse(ctx context.Context, body SendHistoryMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*SendHistoryMessageResp, error)

	// DeleteMessageReactionWithBodyWithResponse request with any body
	DeleteMessageReactionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteMessageReactionResp, error)

	DeleteMessageReactionWithResponse(ctx context.Context, body DeleteMessageReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteMessageReactionResp, error)

	// AddMessageReactionWithBodyWithResponse request with any body
	AddMessageReactionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddMessageReactionResp, error)

	AddMessageReactionWithResponse(ctx context.Context, body AddMessageReactionJSONRequestBody, reqEditors ...RequestEditorFn) (*AddMessageReactionResp, error)

	// MarkMessageReadWithBodyWithResponse request with any body
	MarkMessageReadWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MarkMessageReadResp, error)

	MarkMessageReadWithResponse(ctx context.Context, body MarkMessageReadJSONRequestBody, reqEditors ...RequestEditorFn) (*MarkMessageReadResp, error)

	// MarkMessagesReadUntilWithBodyWithResponse request with any body
	MarkMessagesReadUntilWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MarkMessagesReadUntilResp, error)

	MarkMessagesReadUntilWithResponse(ctx context.Context, body MarkMessagesReadUntilJSONRequestBody, reqEditors ...RequestEditorFn) (*MarkMessagesReadUntilResp, error)

	// RestoreMessageWithBodyWithResponse request with any body
	RestoreMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RestoreMessageResp, error)

	RestoreMessageWithResponse(ctx context.Context, body RestoreMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*RestoreMessageResp, error)

	// GetTemplatesWithResponse request
	GetTemplatesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTemplatesResp, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Cost

type Cost struct {
	// Currency Currency code
	Currency string `binding:"required,currency" json:"currency"`

	// Value Numerical value of the cost
	Value float64 `binding:"gte=0" json:"value"`
}

Cost Represents a monetary value with its corresponding currency

type CustomerExternalId

type CustomerExternalId string

CustomerExternalId Support for external customer identifiers

const (
	CustomerExternalIdAny   CustomerExternalId = "any"
	CustomerExternalIdPhone CustomerExternalId = "phone"
)

Defines values for CustomerExternalId.

func (CustomerExternalId) EnumValues

func (CustomerExternalId) EnumValues() []string

EnumValues returns all valid values for CustomerExternalId.

func (*CustomerExternalId) UnmarshalJSON

func (v *CustomerExternalId) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CustomerExternalId.

func (CustomerExternalId) ValidateEnum

func (v CustomerExternalId) ValidateEnum() error

Validate validates the value of CustomerExternalId.

type DeactivateChannelResp

type DeactivateChannelResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DeactivateChannelResponse
	JSONDefault  *ErrorResponse
}

func ParseDeactivateChannelResp

func ParseDeactivateChannelResp(rsp *http.Response) (*DeactivateChannelResp, error)

ParseDeactivateChannelResp parses an HTTP response from a DeactivateChannelWithResponse call

func (DeactivateChannelResp) Status

func (r DeactivateChannelResp) Status() string

Status returns HTTPResponse.Status

func (DeactivateChannelResp) StatusCode

func (r DeactivateChannelResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeactivateChannelResponse

type DeactivateChannelResponse struct {
	// DeactivatedAt Date and time of channel deactivation
	DeactivatedAt time.Time `json:"deactivated_at" time_format:"2006-01-02T15:04:05Z07:00"`

	// ID Identifier of the deactivated channel
	ID int64 `json:"id"`
}

DeactivateChannelResponse defines model for DeactivateChannelResponse.

type DeactivateTemplateResp

type DeactivateTemplateResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseDeactivateTemplateResp

func ParseDeactivateTemplateResp(rsp *http.Response) (*DeactivateTemplateResp, error)

ParseDeactivateTemplateResp parses an HTTP response from a DeactivateTemplateWithResponse call

func (DeactivateTemplateResp) Status

func (r DeactivateTemplateResp) Status() string

Status returns HTTPResponse.Status

func (DeactivateTemplateResp) StatusCode

func (r DeactivateTemplateResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteMessageJSONBody

type DeleteMessageJSONBody struct {
	// Channel Channel identifier
	Channel int64             `binding:"required" json:"channel"`
	Message MessageIdentifier `binding:"required" json:"message"`
}

DeleteMessageJSONBody defines parameters for DeleteMessage.

type DeleteMessageJSONRequestBody

type DeleteMessageJSONRequestBody DeleteMessageJSONBody

DeleteMessageJSONRequestBody defines body for DeleteMessage for application/json ContentType.

type DeleteMessageReactionJSONBody

type DeleteMessageReactionJSONBody struct {
	// Channel Sending channel identifier
	Channel int64             `binding:"required" json:"channel"`
	Message MessageIdentifier `binding:"required" json:"message"`

	// Reaction Removable reaction
	Reaction *string `binding:"omitempty" json:"reaction"`
}

DeleteMessageReactionJSONBody defines parameters for DeleteMessageReaction.

type DeleteMessageReactionJSONRequestBody

type DeleteMessageReactionJSONRequestBody DeleteMessageReactionJSONBody

DeleteMessageReactionJSONRequestBody defines body for DeleteMessageReaction for application/json ContentType.

type DeleteMessageReactionResp

type DeleteMessageReactionResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseDeleteMessageReactionResp

func ParseDeleteMessageReactionResp(rsp *http.Response) (*DeleteMessageReactionResp, error)

ParseDeleteMessageReactionResp parses an HTTP response from a DeleteMessageReactionWithResponse call

func (DeleteMessageReactionResp) Status

func (r DeleteMessageReactionResp) Status() string

Status returns HTTPResponse.Status

func (DeleteMessageReactionResp) StatusCode

func (r DeleteMessageReactionResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteMessageRequest

type DeleteMessageRequest struct {
	// Channel Channel identifier
	Channel int64             `binding:"required" json:"channel"`
	Message MessageIdentifier `binding:"required" json:"message"`
}

DeleteMessageRequest defines model for DeleteMessageRequest.

type DeleteMessageResp

type DeleteMessageResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *MessageResponse
	JSONDefault  *ErrorResponse
}

func ParseDeleteMessageResp

func ParseDeleteMessageResp(rsp *http.Response) (*DeleteMessageResp, error)

ParseDeleteMessageResp parses an HTTP response from a DeleteMessageWithResponse call

func (DeleteMessageResp) Status

func (r DeleteMessageResp) Status() string

Status returns HTTPResponse.Status

func (DeleteMessageResp) StatusCode

func (r DeleteMessageResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteReactionRequest

type DeleteReactionRequest struct {
	// Channel Sending channel identifier
	Channel int64             `binding:"required" json:"channel"`
	Message MessageIdentifier `binding:"required" json:"message"`

	// Reaction Removable reaction
	Reaction *string `binding:"omitempty" json:"reaction"`
}

DeleteReactionRequest defines model for DeleteReactionRequest.

type EditMessageJSONBody

type EditMessageJSONBody struct {
	// Channel Message channel
	Channel int64                     `binding:"required" json:"channel"`
	Message EditMessageRequestMessage `binding:"required" json:"message"`
}

EditMessageJSONBody defines parameters for EditMessage.

type EditMessageJSONRequestBody

type EditMessageJSONRequestBody EditMessageJSONBody

EditMessageJSONRequestBody defines body for EditMessage for application/json ContentType.

type EditMessageRequest

type EditMessageRequest struct {
	// Channel Message channel
	Channel int64                     `binding:"required" json:"channel"`
	Message EditMessageRequestMessage `binding:"required" json:"message"`
}

EditMessageRequest defines model for EditMessageRequest.

type EditMessageRequestMessage

type EditMessageRequestMessage struct {
	// EditedAt Date and time of last update of message
	EditedAt int64 `json:"edited_at,omitempty"`

	// ExternalID External identifier of the message
	ExternalID *string `binding:"omitempty,max=255" json:"external_id,omitempty" mod:"trim,escape"`

	// ID Message identifier in MessageGateway
	ID *int64 `json:"id,omitempty"`

	// PageLink Link to the page from which the message was sent
	PageLink *string `json:"page_link,omitempty" mod:"trim,escape"`

	// Text Message text
	Text string `binding:"required,min=1,max=65535" json:"text" mod:"trim,escape"`
}

EditMessageRequestMessage defines model for EditMessageRequestMessage.

type EditMessageResp

type EditMessageResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseEditMessageResp

func ParseEditMessageResp(rsp *http.Response) (*EditMessageResp, error)

ParseEditMessageResp parses an HTTP response from a EditMessageWithResponse call

func (EditMessageResp) Status

func (r EditMessageResp) Status() string

Status returns HTTPResponse.Status

func (EditMessageResp) StatusCode

func (r EditMessageResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type EmptyResponse

type EmptyResponse = map[string]interface{}

EmptyResponse defines model for EmptyResponse.

type ErrorResponse

type ErrorResponse struct {
	// Errors List of errors
	Errors *[]string `json:"errors,omitempty"`
}

ErrorResponse defines model for ErrorResponse.

type File

type File struct {
	// Url File download URL
	Url string `json:"Url,omitempty"`

	// ID UUID of the uploaded file
	ID openapi_types.UUID `json:"id"`

	// MimeType MIME file type
	MimeType string `json:"mime_type,omitempty"`

	// Size File size (in bytes)
	Size int `json:"size"`

	// Type File type
	Type FileType `json:"type"`
}

File defines model for File.

type FileBase

type FileBase struct {
	// ID UUID of the uploaded file
	ID openapi_types.UUID `json:"id"`

	// Size File size (in bytes)
	Size int `json:"size"`

	// Type File type
	Type FileType `json:"type"`
}

FileBase Base file information

type FileMessageSetting

type FileMessageSetting struct {
	// Creating Support for operation with messages of the given type
	Creating ChannelFeature `json:"creating,omitempty"`

	// Deleting Support for operation with messages of the given type
	Deleting ChannelFeature `json:"deleting,omitempty"`

	// Editing Support for operation with messages of the given type
	Editing ChannelFeature `json:"editing,omitempty"`

	// MaxItemSize Maximum file size to send
	MaxItemSize *int64 `json:"max_item_size,omitempty"`

	// MaxItemsCount Maximum number of file attachments per message
	MaxItemsCount *int `json:"max_items_count,omitempty"`

	// NoteMaxCharsCount Maximum number of characters in a file message annotation
	NoteMaxCharsCount *uint16 `json:"note_max_chars_count,omitempty"`

	// Quoting Support for operation with messages of the given type
	Quoting ChannelFeature `json:"quoting,omitempty"`

	// Reaction Support for operation with messages of the given type
	Reaction ChannelFeature `json:"reaction,omitempty"`
}

FileMessageSetting File messages support

type FileResponse

type FileResponse = File

FileResponse File information

type FileType

type FileType string

FileType File type

const (
	FileTypeAudio FileType = "audio"
	FileTypeFile  FileType = "file"
	FileTypeImage FileType = "image"
	FileTypeNone  FileType = "none"
	FileTypeVideo FileType = "video"
)

Defines values for FileType.

func (FileType) EnumValues

func (FileType) EnumValues() []string

EnumValues returns all valid values for FileType.

func (*FileType) UnmarshalJSON

func (v *FileType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for FileType.

func (FileType) ValidateEnum

func (v FileType) ValidateEnum() error

Validate validates the value of FileType.

type FileUUIDPath

type FileUUIDPath = string

FileUUIDPath defines model for FileUUIDPath.

type GetFileUrlResp

type GetFileUrlResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *FileResponse
	JSONDefault  *ErrorResponse
}

func ParseGetFileUrlResp

func ParseGetFileUrlResp(rsp *http.Response) (*GetFileUrlResp, error)

ParseGetFileUrlResp parses an HTTP response from a GetFileUrlWithResponse call

func (GetFileUrlResp) Status

func (r GetFileUrlResp) Status() string

Status returns HTTPResponse.Status

func (GetFileUrlResp) StatusCode

func (r GetFileUrlResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTemplatesResp

type GetTemplatesResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *TemplateListResponse
	JSONDefault  *ErrorResponse
}

func ParseGetTemplatesResp

func ParseGetTemplatesResp(rsp *http.Response) (*GetTemplatesResp, error)

ParseGetTemplatesResp parses an HTTP response from a GetTemplatesWithResponse call

func (GetTemplatesResp) Status

func (r GetTemplatesResp) Status() string

Status returns HTTPResponse.Status

func (GetTemplatesResp) StatusCode

func (r GetTemplatesResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Histogram

type Histogram = []int

Histogram Sound diagram (for audio type messages only)

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ID

type ID = int

ID defines model for IDQuery.

type ImageMessageSetting

type ImageMessageSetting struct {
	// Creating Support for operation with messages of the given type
	Creating ChannelFeature `json:"creating,omitempty"`

	// Deleting Support for operation with messages of the given type
	Deleting ChannelFeature `json:"deleting,omitempty"`

	// Editing Support for operation with messages of the given type
	Editing ChannelFeature `json:"editing,omitempty"`

	// MaxItemSize Maximum image size to send
	MaxItemSize *int64 `json:"max_item_size,omitempty"`

	// MaxItemsCount Maximum number of media attachments per message
	MaxItemsCount *int `json:"max_items_count,omitempty"`

	// NoteMaxCharsCount Maximum number of characters in a media message annotation
	NoteMaxCharsCount *uint16 `json:"note_max_chars_count,omitempty"`

	// Quoting Support for operation with messages of the given type
	Quoting ChannelFeature `json:"quoting,omitempty"`

	// Reaction Support for operation with messages of the given type
	Reaction ChannelFeature `json:"reaction,omitempty"`
}

ImageMessageSetting Media messages support

type LimitQuery

type LimitQuery = int

LimitQuery defines model for LimitQuery.

type ListChannelsParams

type ListChannelsParams struct {
	// ID Identifier of the requested object
	ID ID `binding:"omitempty,min=1" form:"id,omitempty" json:"id,omitempty"`

	// Active Channel activity flag
	Active *ChannelActiveQuery `binding:"omitempty,enum-valid" form:"active,omitempty" json:"active,omitempty"`

	// Types Channel types
	Types ChannelTypeQuery `binding:"omitempty,enum-valid" form:"types,omitempty" json:"types,omitempty"`

	// Since Lower limit of the date of the last object update
	Since SinceQuery `form:"since,omitempty" json:"since,omitempty" time_format:"2006-01-02T15:04:05.999999Z07:00" time_utc:"1"`

	// Until Upper limit of the date of the last object update
	Until UntilQuery `form:"until,omitempty" json:"until,omitempty" time_format:"2006-01-02T15:04:05.999999Z07:00" time_utc:"1"`

	// Limit The number of elements in the response. Default value is 100
	Limit LimitQuery `binding:"omitempty,min=1,max=1000" form:"limit,omitempty" json:"limit,omitempty"`
}

ListChannelsParams defines parameters for ListChannels.

type ListChannelsResp

type ListChannelsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ChannelsListResponse
	JSONDefault  *ErrorResponse
}

func ParseListChannelsResp

func ParseListChannelsResp(rsp *http.Response) (*ListChannelsResp, error)

ParseListChannelsResp parses an HTTP response from a ListChannelsWithResponse call

func (ListChannelsResp) Status

func (r ListChannelsResp) Status() string

Status returns HTTPResponse.Status

func (ListChannelsResp) StatusCode

func (r ListChannelsResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type MarkMessageReadJSONBody

type MarkMessageReadJSONBody struct {
	// ChannelID Identifier of the sending channel
	ChannelID int64             `binding:"required" json:"channel_id"`
	Message   MessageIdentifier `binding:"required" json:"message"`
}

MarkMessageReadJSONBody defines parameters for MarkMessageRead.

type MarkMessageReadJSONRequestBody

type MarkMessageReadJSONRequestBody MarkMessageReadJSONBody

MarkMessageReadJSONRequestBody defines body for MarkMessageRead for application/json ContentType.

type MarkMessageReadRequest

type MarkMessageReadRequest struct {
	// ChannelID Identifier of the sending channel
	ChannelID int64             `binding:"required" json:"channel_id"`
	Message   MessageIdentifier `binding:"required" json:"message"`
}

MarkMessageReadRequest defines model for MarkMessageReadRequest.

type MarkMessageReadResp

type MarkMessageReadResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseMarkMessageReadResp

func ParseMarkMessageReadResp(rsp *http.Response) (*MarkMessageReadResp, error)

ParseMarkMessageReadResp parses an HTTP response from a MarkMessageReadWithResponse call

func (MarkMessageReadResp) Status

func (r MarkMessageReadResp) Status() string

Status returns HTTPResponse.Status

func (MarkMessageReadResp) StatusCode

func (r MarkMessageReadResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type MarkMessagesReadUntilJSONBody

type MarkMessagesReadUntilJSONBody struct {
	// ChannelID Channel identifier
	ChannelID int64 `binding:"required,min=1" json:"channel_id"`

	// CustomerExternalID Customer external identifier
	CustomerExternalID string `binding:"required" json:"customer_external_id" mod:"trim,escape"`

	// Until Read until date
	Until time.Time `binding:"required" json:"until"`
}

MarkMessagesReadUntilJSONBody defines parameters for MarkMessagesReadUntil.

type MarkMessagesReadUntilJSONRequestBody

type MarkMessagesReadUntilJSONRequestBody MarkMessagesReadUntilJSONBody

MarkMessagesReadUntilJSONRequestBody defines body for MarkMessagesReadUntil for application/json ContentType.

type MarkMessagesReadUntilRequest

type MarkMessagesReadUntilRequest struct {
	// ChannelID Channel identifier
	ChannelID int64 `binding:"required,min=1" json:"channel_id"`

	// CustomerExternalID Customer external identifier
	CustomerExternalID string `binding:"required" json:"customer_external_id" mod:"trim,escape"`

	// Until Read until date
	Until time.Time `binding:"required" json:"until"`
}

MarkMessagesReadUntilRequest defines model for MarkMessagesReadUntilRequest.

type MarkMessagesReadUntilResp

type MarkMessagesReadUntilResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *MarkMessagesReadUntilResponse
	JSONDefault  *ErrorResponse
}

func ParseMarkMessagesReadUntilResp

func ParseMarkMessagesReadUntilResp(rsp *http.Response) (*MarkMessagesReadUntilResp, error)

ParseMarkMessagesReadUntilResp parses an HTTP response from a MarkMessagesReadUntilWithResponse call

func (MarkMessagesReadUntilResp) Status

func (r MarkMessagesReadUntilResp) Status() string

Status returns HTTPResponse.Status

func (MarkMessagesReadUntilResp) StatusCode

func (r MarkMessagesReadUntilResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type MarkMessagesReadUntilResponse

type MarkMessagesReadUntilResponse struct {
	// IDs Identifiers of messages marked as read
	IDs []int64 `json:"ids"`
}

MarkMessagesReadUntilResponse defines model for MarkMessagesReadUntilResponse.

type Message

type Message struct {
	// Action System action of the message (for system type messages only)
	Action SystemAction `json:"action"`

	// Actions Actions available for this message
	Actions []MessageAction `json:"actions,omitempty"`

	// ChatID Chat identifier
	ChatID int64 `json:"chat_id"`

	// Content Message text
	Content string `json:"content,omitempty"`

	// Dialog Message dialog
	Dialog *MessageDialog `json:"dialog,omitempty"`

	// Error Message error details (only for messages with status `failed`)
	Error *MessageError `json:"error,omitempty"`

	// From Details about a user
	From *UserRef `json:"from,omitempty"`

	// ID Message identifier
	ID int64 `json:"id"`

	// IsEdit Message editing indicator
	IsEdit bool `json:"is_edit"`

	// IsRead Message read indicator
	IsRead bool          `json:"is_read"`
	Items  []MessageFile `json:"items,omitempty"`

	// Note Media data annotation (for media message)
	Note string `json:"note,omitempty"`

	// Order Represents the details of an order within a message
	Order *MessageOrder `json:"order,omitempty"`

	// Product Describes a product mentioned in a message
	Product *MessageProduct `json:"product,omitempty"`

	// Quote Quoted message
	Quote *QuoteMessage `json:"quote,omitempty"`

	// Responsible Details about a user
	Responsible *UserRef `json:"responsible,omitempty"`

	// Scope Message scope
	Scope MessageScope `json:"scope"`

	// Status Message status
	Status MessageStatus `json:"status"`

	// Time Message creation time
	Time time.Time `json:"time"`

	// TransportAttachments Transport attachments
	TransportAttachments *MessageTransportAttachments `json:"transport_attachments,omitempty"`

	// Type Message type
	Type MessageType `json:"type"`

	// User Details about a user
	User *UserRef `json:"user,omitempty"`
}

Message defines model for Message.

type MessageAction

type MessageAction string

MessageAction Defines possible actions that can be performed on a message

const (
	MessageActionDelete MessageAction = "delete"
	MessageActionEdit   MessageAction = "edit"
	MessageActionQuote  MessageAction = "quote"
)

Defines values for MessageAction.

func (MessageAction) EnumValues

func (MessageAction) EnumValues() []string

EnumValues returns all valid values for MessageAction.

func (*MessageAction) UnmarshalJSON

func (v *MessageAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MessageAction.

func (MessageAction) ValidateEnum

func (v MessageAction) ValidateEnum() error

Validate validates the value of MessageAction.

type MessageDialog

type MessageDialog struct {
	// ID Dialog identifier
	ID int64 `json:"id"`
}

MessageDialog Message dialog

type MessageError

type MessageError struct {
	Code MessageErrorCode `binding:"enum-valid" json:"code"`

	// Message Text description of error
	Message string `json:"message,omitempty"`
}

MessageError Message error details (only for messages with status `failed`)

type MessageErrorCode

type MessageErrorCode string

MessageErrorCode Message error code

const (
	MessageErrorCodeAccessRestricted  MessageErrorCode = "access_restricted"
	MessageErrorCodeAsyncSendTimeout  MessageErrorCode = "async_send_timeout"
	MessageErrorCodeCustomerNotExists MessageErrorCode = "customer_not_exists"
	MessageErrorCodeGeneral           MessageErrorCode = "general"
	MessageErrorCodeMalformedResponse MessageErrorCode = "malformed_response"
	MessageErrorCodeNetworkError      MessageErrorCode = "network_error"
	MessageErrorCodeReplyTimedOut     MessageErrorCode = "reply_timed_out"
	MessageErrorCodeSpamSuspicion     MessageErrorCode = "spam_suspicion"
	MessageErrorCodeUnknown           MessageErrorCode = "unknown"
)

Defines values for MessageErrorCode.

func (MessageErrorCode) EnumValues

func (MessageErrorCode) EnumValues() []string

EnumValues returns all valid values for MessageErrorCode.

func (*MessageErrorCode) UnmarshalJSON

func (v *MessageErrorCode) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MessageErrorCode.

func (MessageErrorCode) ValidateEnum

func (v MessageErrorCode) ValidateEnum() error

Validate validates the value of MessageErrorCode.

type MessageFile

type MessageFile struct {
	// Caption Text description of the media attachment
	Caption string `json:"caption,omitempty"`

	// Duration Audio recording duration (for audio type messages only)
	Duration int `json:"duration,omitempty"`

	// Height Image height in pixels (for image type messages only)
	Height    int       `json:"height,omitempty"`
	Histogram Histogram `json:"histogram,omitempty"`

	// ID UUID of the attached file
	ID   openapi_types.UUID `json:"id,omitempty"`
	Kind FileType           `json:"kind,omitempty"`

	// PreviewURL URL for previewing or downloading the file
	PreviewURL string `json:"preview_url,omitempty"`

	// Size Attachment size (in bytes)
	Size int `json:"size,omitempty"`

	// Transcription Transcription of the uploaded file
	Transcription string `json:"transcription,omitempty"`

	// Type Attachment type
	Type string `json:"type,omitempty"`

	// Width Image width in pixels (for image type messages only)
	Width int `json:"width,omitempty"`
}

MessageFile Attached message file

type MessageIdentifier

type MessageIdentifier struct {
	// ExternalID External identifier of the message
	ExternalID *string `binding:"omitempty,max=255" json:"external_id,omitempty" mod:"trim,escape"`

	// ID Message identifier in MessageGateway
	ID *int64 `json:"id,omitempty"`
}

MessageIdentifier Message identifier

type MessageOrder

type MessageOrder struct {
	// Cost Represents a monetary value with its corresponding currency
	Cost *Cost `json:"cost,omitempty"`

	// Date Order creation date
	Date *time.Time `json:"date,omitempty"`

	// Delivery Order delivery information
	Delivery *MessageOrderDelivery `json:"delivery,omitempty"`

	// Discount Represents a monetary value with its corresponding currency
	Discount *Cost `json:"discount,omitempty"`

	// ExternalID External identifier of an order
	ExternalID int64 `json:"external_id,omitempty"`

	// Items Array of order items
	Items []MessageOrderItem `json:"items,omitempty"`

	// Number Order number
	Number string `binding:"max=255" json:"number,omitempty"`

	// Payments Payments array
	Payments []MessageOrderPayment `json:"payments,omitempty"`

	// Status Order status
	Status *MessageOrderStatus `json:"status,omitempty"`

	// Url Order URL
	Url string `binding:"max=2048" json:"url,omitempty"`
}

MessageOrder Represents the details of an order within a message

type MessageOrderDelivery

type MessageOrderDelivery struct {
	// Address Delivery address
	Address string `json:"address,omitempty"`

	// Comment Delivery comment
	Comment string `json:"comment,omitempty"`

	// Name Delivery method name
	Name string `json:"name,omitempty"`

	// Price Represents a monetary value with its corresponding currency
	Price *Cost `json:"price,omitempty"`
}

MessageOrderDelivery Order delivery information

type MessageOrderItem

type MessageOrderItem struct {
	// ExternalID External identifier of a product
	ExternalID int64 `json:"external_id,omitempty"`

	// Img Product image
	Img string `binding:"max=2048" json:"img,omitempty"`

	// Name Product name
	Name string `binding:"max=255" json:"name,omitempty"`

	// Price Represents a monetary value with its corresponding currency
	Price    *Cost    `json:"price,omitempty"`
	Quantity Quantity `json:"quantity,omitempty"`

	// Url Product URL
	Url string `binding:"max=2048" json:"url,omitempty"`
}

MessageOrderItem Order product

type MessageOrderPayment

type MessageOrderPayment struct {
	// Amount Represents a monetary value with its corresponding currency
	Amount *Cost `json:"amount,omitempty"`

	// Name Payment name
	Name string `json:"name,omitempty"`

	// Status Order payment status
	Status *MessageOrderPaymentStatus `json:"status,omitempty"`
}

MessageOrderPayment Order payment information

type MessageOrderPaymentStatus

type MessageOrderPaymentStatus struct {
	// Name Payment name
	Name string `json:"name,omitempty"`

	// Payed Payment execution indicator
	Payed *bool `json:"payed,omitempty"`
}

MessageOrderPaymentStatus Order payment status

type MessageOrderStatus

type MessageOrderStatus struct {
	Code MessageOrderStatusCode `binding:"enum-valid" json:"code,omitempty"`

	// Name Status name
	Name string `binding:"max=255" json:"name,omitempty"`
}

MessageOrderStatus Order status

type MessageOrderStatusCode

type MessageOrderStatusCode string

MessageOrderStatusCode Status code

const (
	MessageOrderStatusCodeApproval   MessageOrderStatusCode = "approval"
	MessageOrderStatusCodeAssembling MessageOrderStatusCode = "assembling"
	MessageOrderStatusCodeCancel     MessageOrderStatusCode = "cancel"
	MessageOrderStatusCodeComplete   MessageOrderStatusCode = "complete"
	MessageOrderStatusCodeDelivery   MessageOrderStatusCode = "delivery"
	MessageOrderStatusCodeNew        MessageOrderStatusCode = "new"
)

Defines values for MessageOrderStatusCode.

func (MessageOrderStatusCode) EnumValues

func (MessageOrderStatusCode) EnumValues() []string

EnumValues returns all valid values for MessageOrderStatusCode.

func (*MessageOrderStatusCode) UnmarshalJSON

func (v *MessageOrderStatusCode) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MessageOrderStatusCode.

func (MessageOrderStatusCode) ValidateEnum

func (v MessageOrderStatusCode) ValidateEnum() error

Validate validates the value of MessageOrderStatusCode.

type MessageProduct

type MessageProduct struct {
	// Article Product description
	Article string `binding:"max=128" json:"article,omitempty"`

	// Cost Represents a monetary value with its corresponding currency
	Cost *Cost `json:"cost,omitempty"`

	// ID Product identifier
	ID uint64 `json:"id"`

	// Img Product image URL
	Img string `binding:"max=2048" json:"img,omitempty"`

	// Name Product name
	Name string `binding:"required,min=1,max=255" json:"name"`

	// Unit Units of measure of the product
	Unit string `binding:"max=16" json:"unit"`

	// Url Product URL
	Url string `binding:"max=2048" json:"url,omitempty"`
}

MessageProduct Describes a product mentioned in a message

type MessageResponse

type MessageResponse = Message

MessageResponse Contains details of a message

type MessageScope

type MessageScope string

MessageScope Message scope

const (
	MessageScopePrivate   MessageScope = "private"
	MessageScopePublic    MessageScope = "public"
	MessageScopeUndefined MessageScope = "undefined"
)

Defines values for MessageScope.

func (MessageScope) EnumValues

func (MessageScope) EnumValues() []string

EnumValues returns all valid values for MessageScope.

func (*MessageScope) UnmarshalJSON

func (v *MessageScope) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MessageScope.

func (MessageScope) ValidateEnum

func (v MessageScope) ValidateEnum() error

Validate validates the value of MessageScope.

type MessageStatus

type MessageStatus string

MessageStatus Message status

const (
	MessageStatusFailed    MessageStatus = "failed"
	MessageStatusReceived  MessageStatus = "received"
	MessageStatusSeen      MessageStatus = "seen"
	MessageStatusSending   MessageStatus = "sending"
	MessageStatusSent      MessageStatus = "sent"
	MessageStatusUndefined MessageStatus = "undefined"
)

Defines values for MessageStatus.

func (MessageStatus) EnumValues

func (MessageStatus) EnumValues() []string

EnumValues returns all valid values for MessageStatus.

func (*MessageStatus) UnmarshalJSON

func (v *MessageStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MessageStatus.

func (MessageStatus) ValidateEnum

func (v MessageStatus) ValidateEnum() error

Validate validates the value of MessageStatus.

type MessageTransportAttachments

type MessageTransportAttachments struct {
	// Suggestions Quick responses
	Suggestions []Suggestion `json:"suggestions,omitempty"`
}

MessageTransportAttachments Transport attachments

type MessageType

type MessageType string

MessageType Message type

const (
	MessageTypeAudio   MessageType = "audio"
	MessageTypeCommand MessageType = "command"
	MessageTypeFile    MessageType = "file"
	MessageTypeImage   MessageType = "image"
	MessageTypeOrder   MessageType = "order"
	MessageTypeProduct MessageType = "product"
	MessageTypeSystem  MessageType = "system"
	MessageTypeText    MessageType = "text"
)

Defines values for MessageType.

func (MessageType) EnumValues

func (MessageType) EnumValues() []string

EnumValues returns all valid values for MessageType.

func (*MessageType) UnmarshalJSON

func (v *MessageType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for MessageType.

func (MessageType) ValidateEnum

func (v MessageType) ValidateEnum() error

Validate validates the value of MessageType.

type OrderMessageSetting

type OrderMessageSetting struct {
	// Creating Support for operation with messages of the given type
	Creating ChannelFeature `json:"creating,omitempty"`

	// Deleting Support for operation with messages of the given type
	Deleting ChannelFeature `json:"deleting,omitempty"`

	// Editing Support for operation with messages of the given type
	Editing ChannelFeature `json:"editing,omitempty"`

	// Quoting Support for operation with messages of the given type
	Quoting ChannelFeature `json:"quoting,omitempty"`

	// Reaction Support for operation with messages of the given type
	Reaction ChannelFeature `json:"reaction,omitempty"`
}

OrderMessageSetting Order messages support

type Originator

type Originator string

Originator Message sender type

const (
	OriginatorChannel  Originator = "channel"
	OriginatorCustomer Originator = "customer"
	OriginatorUser     Originator = "user"
)

Defines values for Originator.

func (Originator) EnumValues

func (Originator) EnumValues() []string

EnumValues returns all valid values for Originator.

func (*Originator) UnmarshalJSON

func (v *Originator) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Originator.

func (Originator) ValidateEnum

func (v Originator) ValidateEnum() error

Validate validates the value of Originator.

type ProductMessageSetting

type ProductMessageSetting struct {
	// Creating Support for operation with messages of the given type
	Creating ChannelFeature `json:"creating,omitempty"`

	// Deleting Support for operation with messages of the given type
	Deleting ChannelFeature `json:"deleting,omitempty"`

	// Editing Support for operation with messages of the given type
	Editing ChannelFeature `json:"editing,omitempty"`

	// Quoting Support for operation with messages of the given type
	Quoting ChannelFeature `json:"quoting,omitempty"`

	// Reaction Support for operation with messages of the given type
	Reaction ChannelFeature `json:"reaction,omitempty"`
}

ProductMessageSetting Product messages support

type Quantity

type Quantity struct {
	// Unit Units of measure
	Unit string `binding:"max=16" json:"unit,omitempty"`

	// Value Quantitative value
	Value float64 `binding:"gte=0" json:"value,omitempty"`
}

Quantity Quantity

type QuoteMessage

type QuoteMessage struct {
	// Content Message text
	Content string `json:"content,omitempty"`

	// From Details about a user
	From *UserRef `json:"from,omitempty"`

	// ID Identifier of the quoted message
	ID int64 `json:"id,omitempty"`

	// Items Media attachments of the quoted message
	Items []MessageFile `json:"items,omitempty"`

	// Time Message sending time
	Time time.Time   `json:"time,omitempty"`
	Type MessageType `binding:"enum-valid" json:"type,omitempty"`
}

QuoteMessage Quoted message

type Reactions

type Reactions struct {
	// Dictionary Dictionary of available reactions
	Dictionary []string `json:"dictionary,omitempty"`

	// MaxCount Maximum number of reactions added from the system
	MaxCount int64 `json:"max_count,omitempty"`
}

Reactions Support for working with reactions for messages

type RejectReason

type RejectReason string

RejectReason Reason for template rejection (for `Rejected` status)

const (
	RejectReasonAbusiveContent    RejectReason = "abusive_content"
	RejectReasonIncorrectCategory RejectReason = "incorrect_category"
	RejectReasonInvalidFormat     RejectReason = "invalid_format"
	RejectReasonScam              RejectReason = "scam"
)

Defines values for RejectReason.

func (RejectReason) EnumValues

func (RejectReason) EnumValues() []string

EnumValues returns all valid values for RejectReason.

func (*RejectReason) UnmarshalJSON

func (v *RejectReason) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for RejectReason.

func (RejectReason) ValidateEnum

func (v RejectReason) ValidateEnum() error

Validate validates the value of RejectReason.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RestoreMessageJSONBody

type RestoreMessageJSONBody struct {
	// ChannelID Identifier of the sending channel
	ChannelID int64             `binding:"required" json:"channel_id"`
	Message   MessageIdentifier `binding:"required" json:"message"`
}

RestoreMessageJSONBody defines parameters for RestoreMessage.

type RestoreMessageJSONRequestBody

type RestoreMessageJSONRequestBody RestoreMessageJSONBody

RestoreMessageJSONRequestBody defines body for RestoreMessage for application/json ContentType.

type RestoreMessageRequest

type RestoreMessageRequest struct {
	// ChannelID Identifier of the sending channel
	ChannelID int64             `binding:"required" json:"channel_id"`
	Message   MessageIdentifier `binding:"required" json:"message"`
}

RestoreMessageRequest defines model for RestoreMessageRequest.

type RestoreMessageResp

type RestoreMessageResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *MessageResponse
	JSONDefault  *ErrorResponse
}

func ParseRestoreMessageResp

func ParseRestoreMessageResp(rsp *http.Response) (*RestoreMessageResp, error)

ParseRestoreMessageResp parses an HTTP response from a RestoreMessageWithResponse call

func (RestoreMessageResp) Status

func (r RestoreMessageResp) Status() string

Status returns HTTPResponse.Status

func (RestoreMessageResp) StatusCode

func (r RestoreMessageResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SendHistoryMessageJSONBody

type SendHistoryMessageJSONBody struct {
	// ChannelID Channel identifier
	ChannelID int64                       `binding:"required" json:"channel_id"`
	Customer  *SendMessageRequestCustomer `binding:"required" json:"customer"`

	// ExternalChatID External identifier
	ExternalChatID string                    `binding:"omitempty,min=0,max=64" json:"external_chat_id"`
	Message        SendMessageRequestMessage `binding:"required" json:"message"`
	Originator     Originator                `binding:"omitempty,enum-valid" json:"originator"`
	Quote          *MessageIdentifier        `binding:"omitempty" json:"quote"`

	// ReplyDeadline Deadline for response
	ReplyDeadline *time.Time `binding:"omitempty" json:"reply_deadline"`
}

SendHistoryMessageJSONBody defines parameters for SendHistoryMessage.

type SendHistoryMessageJSONRequestBody

type SendHistoryMessageJSONRequestBody SendHistoryMessageJSONBody

SendHistoryMessageJSONRequestBody defines body for SendHistoryMessage for application/json ContentType.

type SendHistoryMessageRequest

type SendHistoryMessageRequest struct {
	// ChannelID Channel identifier
	ChannelID int64                       `binding:"required" json:"channel_id"`
	Customer  *SendMessageRequestCustomer `binding:"required" json:"customer"`

	// ExternalChatID External identifier
	ExternalChatID string                    `binding:"omitempty,min=0,max=64" json:"external_chat_id"`
	Message        SendMessageRequestMessage `binding:"required" json:"message"`
	Originator     Originator                `binding:"omitempty,enum-valid" json:"originator"`
	Quote          *MessageIdentifier        `binding:"omitempty" json:"quote"`

	// ReplyDeadline Deadline for response
	ReplyDeadline *time.Time `binding:"omitempty" json:"reply_deadline"`
}

SendHistoryMessageRequest defines model for SendHistoryMessageRequest.

type SendHistoryMessageResp

type SendHistoryMessageResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SendMessageResponse
	JSONDefault  *ErrorResponse
}

func ParseSendHistoryMessageResp

func ParseSendHistoryMessageResp(rsp *http.Response) (*SendHistoryMessageResp, error)

ParseSendHistoryMessageResp parses an HTTP response from a SendHistoryMessageWithResponse call

func (SendHistoryMessageResp) Status

func (r SendHistoryMessageResp) Status() string

Status returns HTTPResponse.Status

func (SendHistoryMessageResp) StatusCode

func (r SendHistoryMessageResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SendMessageJSONBody

type SendMessageJSONBody struct {
	// Channel Channel identifier
	Channel  int64                       `binding:"required" json:"channel"`
	Customer *SendMessageRequestCustomer `binding:"omitempty" json:"customer"`

	// ExternalChatID External identifier
	ExternalChatID string                    `binding:"min=0,max=64" json:"external_chat_id"`
	Message        SendMessageRequestMessage `binding:"required" json:"message"`
	Originator     Originator                `binding:"enum-valid" json:"originator"`
	Quote          *MessageIdentifier        `json:"quote"`

	// ReplyDeadline Deadline for response
	ReplyDeadline *time.Time `binding:"omitempty" json:"reply_deadline"`

	// SecondaryExternalChatIDs Array of additional external chat identifiers
	SecondaryExternalChatIDs []string `binding:"omitempty,dive,min=0,max=64" json:"secondary_external_chat_ids"`
	// Deprecated:
	User *SendMessageRequestCustomer `binding:"omitempty" json:"user"`
}

SendMessageJSONBody defines parameters for SendMessage.

type SendMessageJSONRequestBody

type SendMessageJSONRequestBody SendMessageJSONBody

SendMessageJSONRequestBody defines body for SendMessage for application/json ContentType.

type SendMessageRequest

type SendMessageRequest struct {
	// Channel Channel identifier
	Channel  int64                       `binding:"required" json:"channel"`
	Customer *SendMessageRequestCustomer `binding:"omitempty" json:"customer"`

	// ExternalChatID External identifier
	ExternalChatID string                    `binding:"min=0,max=64" json:"external_chat_id"`
	Message        SendMessageRequestMessage `binding:"required" json:"message"`
	Originator     Originator                `binding:"enum-valid" json:"originator"`
	Quote          *MessageIdentifier        `json:"quote"`

	// ReplyDeadline Deadline for response
	ReplyDeadline *time.Time `binding:"omitempty" json:"reply_deadline"`

	// SecondaryExternalChatIDs Array of additional external chat identifiers
	SecondaryExternalChatIDs []string `binding:"omitempty,dive,min=0,max=64" json:"secondary_external_chat_ids"`
	// Deprecated:
	User *SendMessageRequestCustomer `binding:"omitempty" json:"user"`
}

SendMessageRequest defines model for SendMessageRequest.

type SendMessageRequestCustomer

type SendMessageRequestCustomer struct {
	// Avatar Sender avatar URL
	Avatar *string `json:"avatar" mod:"trim,escape"`

	// Country Sender country code
	Country *string `json:"country" mod:"trim,escape"`

	// Email Sender email
	Email *string `json:"email" mod:"trim,escape"`

	// ExternalID External identifier of the sender
	ExternalID string `binding:"required,min=1,max=64" json:"external_id" mod:"trim,escape"`

	// FirstName Sender name
	FirstName *string `binding:"omitempty,max=255" json:"first_name" mod:"trim,escape"`

	// Language Sender language
	Language *string `json:"language" mod:"trim,escape"`

	// LastName Sender last name
	LastName *string `binding:"omitempty,max=255" json:"last_name,omitempty" mod:"trim,escape"`

	// Nickname Sender nickname
	Nickname string `binding:"required,min=1,max=255" json:"nickname" mod:"trim,escape"`

	// Phone Sender phone
	Phone *string `json:"phone" mod:"trim,escape"`

	// ProfileURL Sender profile URL
	ProfileURL *string `json:"profile_url" mod:"trim,escape"`

	// SecondaryExternalIDs Array of additional external customer identifiers
	SecondaryExternalIDs []string `binding:"omitempty,dive,min=0,max=64" json:"secondary_external_ids"`
	Utm                  *Utm     `json:"utm"`
}

SendMessageRequestCustomer Contains information about the customer sending a message

type SendMessageRequestMessage

type SendMessageRequestMessage struct {
	// CreatedAt Message creation date
	CreatedAt *time.Time `binding:"omitempty" json:"created_at"`

	// ExternalID External identifier of a message
	ExternalID *string `binding:"omitempty,min=0,max=255" json:"external_id"`

	// Items List of media objects in a message
	Items []SendMessageRequestMessageFileItem `binding:"omitempty,min=1,max=20,dive" json:"items"`

	// Note Message description (for messages with media data)
	Note  string        `binding:"omitempty,min=1,max=64000" json:"note" mod:"trim,escape"`
	Order *MessageOrder `binding:"required_if=Type order" json:"order,omitempty"`

	// PageLink Link to the page from which the message was sent
	PageLink *string         `binding:"omitempty,web_url_length,web_url" json:"page_link,omitempty"`
	Product  *MessageProduct `binding:"required_if=Type product" json:"product,omitempty"`

	// Text Message text
	Text string      `binding:"min=0,max=65535" json:"text"`
	Type MessageType `binding:"required,enum-valid" json:"type"`
}

SendMessageRequestMessage Defines the message content in a sending request

type SendMessageRequestMessageFileItem

type SendMessageRequestMessageFileItem struct {
	// Caption Description of the message media attachment
	Caption string `binding:"omitempty,max=1024" json:"caption,omitempty" mod:"trim,escape"`

	// ID UUID of the uploaded file
	ID openapi_types.UUID `binding:"required" json:"id"`
}

SendMessageRequestMessageFileItem Represents a file attachment in a message

type SendMessageResp

type SendMessageResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *SendMessageResponse
	JSONDefault  *ErrorResponse
}

func ParseSendMessageResp

func ParseSendMessageResp(rsp *http.Response) (*SendMessageResp, error)

ParseSendMessageResp parses an HTTP response from a SendMessageWithResponse call

func (SendMessageResp) Status

func (r SendMessageResp) Status() string

Status returns HTTPResponse.Status

func (SendMessageResp) StatusCode

func (r SendMessageResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SendMessageResponse

type SendMessageResponse struct {
	// MessageId Identifier of the created message
	MessageId int64 `json:"message_id"`

	// Time Message creation time
	Time time.Time `json:"time"`

	// Warnings Warnings that occurred while creating a message
	Warnings []string `json:"warnings,omitempty"`
}

SendMessageResponse defines model for SendMessageResponse.

type SendingError

type SendingError struct {
	Code SendingErrorCode `binding:"enum-valid" json:"code"`

	// ExternalCode External error code
	ExternalCode *string `binding:"omitempty,max=100" json:"external_code,omitempty"`

	// Message Description of the error that occurred while sending
	Message string `json:"message" mod:"trim,escape"`
}

SendingError Details about the error that occurred during the sending process

type SendingErrorCode

type SendingErrorCode string

SendingErrorCode Code representing possible sending error codes

const (
	SendingErrorCodeAccessRestricted  SendingErrorCode = "access_restricted"
	SendingErrorCodeCustomerNotExists SendingErrorCode = "customer_not_exists"
	SendingErrorCodeGeneral           SendingErrorCode = "general"
	SendingErrorCodeReplyTimedOut     SendingErrorCode = "reply_timed_out"
	SendingErrorCodeSpamSuspicion     SendingErrorCode = "spam_suspicion"
)

Defines values for SendingErrorCode.

func (SendingErrorCode) EnumValues

func (SendingErrorCode) EnumValues() []string

EnumValues returns all valid values for SendingErrorCode.

func (*SendingErrorCode) UnmarshalJSON

func (v *SendingErrorCode) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SendingErrorCode.

func (SendingErrorCode) ValidateEnum

func (v SendingErrorCode) ValidateEnum() error

Validate validates the value of SendingErrorCode.

type SendingPolicy

type SendingPolicy struct {
	// AfterReplyTimeout Types of messages to send after response time expires
	AfterReplyTimeout SendingPolicyAfterReplyTimeout `json:"after_reply_timeout,omitempty"`

	// NewCustomer Types of messages to send to a new customer
	NewCustomer SendingPolicyNewCustomer `json:"new_customer,omitempty"`

	// Outgoing Outgoing message support
	Outgoing SendingPolicyOutgoing `json:"outgoing,omitempty"`
}

SendingPolicy Message sending policy

type SendingPolicyAfterReplyTimeout

type SendingPolicyAfterReplyTimeout string

SendingPolicyAfterReplyTimeout Types of messages to send after response time expires

const (
	SendingPolicyAfterReplyTimeoutNo       SendingPolicyAfterReplyTimeout = "no"
	SendingPolicyAfterReplyTimeoutTemplate SendingPolicyAfterReplyTimeout = "template"
)

Defines values for SendingPolicyAfterReplyTimeout.

func (SendingPolicyAfterReplyTimeout) EnumValues

func (SendingPolicyAfterReplyTimeout) EnumValues() []string

EnumValues returns all valid values for SendingPolicyAfterReplyTimeout.

func (*SendingPolicyAfterReplyTimeout) UnmarshalJSON

func (v *SendingPolicyAfterReplyTimeout) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SendingPolicyAfterReplyTimeout.

func (SendingPolicyAfterReplyTimeout) ValidateEnum

func (v SendingPolicyAfterReplyTimeout) ValidateEnum() error

Validate validates the value of SendingPolicyAfterReplyTimeout.

type SendingPolicyNewCustomer

type SendingPolicyNewCustomer string

SendingPolicyNewCustomer Types of messages to send to a new customer

const (
	SendingPolicyNewCustomerNo       SendingPolicyNewCustomer = "no"
	SendingPolicyNewCustomerTemplate SendingPolicyNewCustomer = "template"
	SendingPolicyNewCustomerText     SendingPolicyNewCustomer = "text"
)

Defines values for SendingPolicyNewCustomer.

func (SendingPolicyNewCustomer) EnumValues

func (SendingPolicyNewCustomer) EnumValues() []string

EnumValues returns all valid values for SendingPolicyNewCustomer.

func (*SendingPolicyNewCustomer) UnmarshalJSON

func (v *SendingPolicyNewCustomer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SendingPolicyNewCustomer.

func (SendingPolicyNewCustomer) ValidateEnum

func (v SendingPolicyNewCustomer) ValidateEnum() error

Validate validates the value of SendingPolicyNewCustomer.

type SendingPolicyOutgoing

type SendingPolicyOutgoing string

SendingPolicyOutgoing Outgoing message support

const (
	SendingPolicyOutgoingAllowed    SendingPolicyOutgoing = "allowed"
	SendingPolicyOutgoingRestricted SendingPolicyOutgoing = "restricted"
)

Defines values for SendingPolicyOutgoing.

func (SendingPolicyOutgoing) EnumValues

func (SendingPolicyOutgoing) EnumValues() []string

EnumValues returns all valid values for SendingPolicyOutgoing.

func (*SendingPolicyOutgoing) UnmarshalJSON

func (v *SendingPolicyOutgoing) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SendingPolicyOutgoing.

func (SendingPolicyOutgoing) ValidateEnum

func (v SendingPolicyOutgoing) ValidateEnum() error

Validate validates the value of SendingPolicyOutgoing.

type SinceQuery

type SinceQuery = time.Time

SinceQuery defines model for SinceQuery.

type StatusSetting

type StatusSetting struct {
	// Delivered Support for operation with messages of the given type
	Delivered ChannelFeature `json:"delivered,omitempty"`

	// Read Support for operation with messages of the given type
	Read ChannelFeature `json:"read,omitempty"`
}

StatusSetting Transmitting message status information

type Suggestion

type Suggestion struct {
	// Payload Quick response payload
	Payload string `json:"payload,omitempty"`

	// Title Quick response name
	Title string         `json:"title,omitempty"`
	Type  SuggestionType `binding:"enum-valid" json:"type,omitempty"`
}

Suggestion Quick response suggestion

type SuggestionType

type SuggestionType string

SuggestionType Quick response type

const (
	SuggestionTypeEmail SuggestionType = "email"
	SuggestionTypePhone SuggestionType = "phone"
	SuggestionTypeText  SuggestionType = "text"
	SuggestionTypeUrl   SuggestionType = "url"
)

Defines values for SuggestionType.

func (SuggestionType) EnumValues

func (SuggestionType) EnumValues() []string

EnumValues returns all valid values for SuggestionType.

func (*SuggestionType) UnmarshalJSON

func (v *SuggestionType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SuggestionType.

func (SuggestionType) ValidateEnum

func (v SuggestionType) ValidateEnum() error

Validate validates the value of SuggestionType.

type Suggestions

type Suggestions struct {
	// Email Support for operation with messages of the given type
	Email ChannelFeature `json:"email,omitempty"`

	// Phone Support for operation with messages of the given type
	Phone ChannelFeature `json:"phone,omitempty"`

	// Text Support for operation with messages of the given type
	Text ChannelFeature `json:"text,omitempty"`

	// Url Support for operation with messages of the given type
	Url ChannelFeature `json:"url,omitempty"`
}

Suggestions Support for quick response types

type SystemAction

type SystemAction string

SystemAction System action of the message (for system type messages only)

const (
	SystemActionCustomerBlocked   SystemAction = "customer_blocked"
	SystemActionCustomerUnblocked SystemAction = "customer_unblocked"
	SystemActionDialogAssign      SystemAction = "dialog_assign"
	SystemActionDialogClosed      SystemAction = "dialog_closed"
	SystemActionDialogOpened      SystemAction = "dialog_opened"
	SystemActionDialogUnassign    SystemAction = "dialog_unassign"
	SystemActionUserJoined        SystemAction = "user_joined"
	SystemActionUserLeft          SystemAction = "user_left"
)

Defines values for SystemAction.

func (SystemAction) EnumValues

func (SystemAction) EnumValues() []string

EnumValues returns all valid values for SystemAction.

func (*SystemAction) UnmarshalJSON

func (v *SystemAction) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for SystemAction.

func (SystemAction) ValidateEnum

func (v SystemAction) ValidateEnum() error

Validate validates the value of SystemAction.

type SystemMessage

type SystemMessage struct {
	// Action System action of the message (for system type messages only)
	Action SystemAction `json:"action"`

	// Responsible Details about a user
	Responsible *UserRef `json:"responsible,omitempty"`

	// User Details about a user
	User *UserRef `json:"user,omitempty"`
}

SystemMessage Represents system-generated events in messaging

type Template

type Template struct {
	// Body Template body
	Body string `json:"body" mod:"trim,escape"`

	// Buttons List of template buttons
	Buttons *TemplateButtons `json:"buttons,omitempty"`

	// Category Template category
	Category string `json:"category,omitempty"`

	// ChannelID Channel identifier
	ChannelID int64 `json:"channel_id"`

	// Code Template unique code
	Code *string `json:"code"`

	// Enabled Template activity indicator
	Enabled bool `json:"enabled"`

	// Example Template example
	Example *TemplateExample `json:"example,omitempty"`

	// Footer Template footer
	Footer string `json:"footer,omitempty"`

	// Header Header section of the template
	Header *TemplateHeader `json:"header,omitempty"`

	// ID Template identifier
	ID int64 `json:"id"`

	// Lang Template language
	Lang string `json:"lang,omitempty"`

	// Name Template name
	Name               string                     `binding:"required,min=1,max=512" json:"name" mod:"trim,escape"`
	Quality            *TemplateQuality           `binding:"omitempty,enum-valid" json:"quality,omitempty"`
	RejectionReason    RejectReason               `binding:"omitempty,enum-valid" json:"rejection_reason,omitempty"`
	Template           []TemplateItem             `json:"template"`
	Type               TemplateType               `json:"type,omitempty"`
	VerificationStatus TemplateVerificationStatus `binding:"omitempty,enum-valid" json:"verification_status,omitempty"`
}

Template defines model for Template.

type TemplateBase

type TemplateBase struct {
	// Body Template body
	Body string `json:"body" mod:"trim,escape"`

	// Buttons List of template buttons
	Buttons *TemplateButtons `json:"buttons,omitempty"`

	// Category Template category
	Category *string `json:"category,omitempty" mod:"trim,escape"`

	// Footer Template footer
	Footer *string `json:"footer,omitempty" mod:"trim,escape"`

	// Header Header section of the template
	Header *TemplateHeader `json:"header,omitempty"`

	// Lang Template language
	Lang *string `json:"lang,omitempty" mod:"trim,escape"`

	// Name Template name
	Name               string                      `binding:"required,min=1,max=512" json:"name" mod:"trim,escape"`
	Quality            *TemplateQuality            `binding:"omitempty,enum-valid" json:"quality,omitempty"`
	RejectionReason    *RejectReason               `binding:"omitempty,enum-valid" json:"rejection_reason,omitempty" mod:"trim,escape"`
	Template           []TemplateItem              `json:"template"`
	VerificationStatus *TemplateVerificationStatus `binding:"omitempty,enum-valid" json:"verification_status,omitempty"`
}

TemplateBase Template base

type TemplateButton

type TemplateButton struct {
	// Label Button name
	Label string `json:"label"`

	// Phone Phone number (for button type `phone`)
	Phone *string `json:"phone,omitempty"`

	// Type Button type
	Type TemplateButtonType `json:"type"`

	// Url URL address (for button type `url`)
	Url *string `json:"url,omitempty"`
}

TemplateButton Template button

type TemplateButtonType

type TemplateButtonType string

TemplateButtonType Button type

const (
	TemplateButtonTypePhone TemplateButtonType = "phone"
	TemplateButtonTypePlain TemplateButtonType = "plain"
	TemplateButtonTypeUrl   TemplateButtonType = "url"
)

Defines values for TemplateButtonType.

func (TemplateButtonType) EnumValues

func (TemplateButtonType) EnumValues() []string

EnumValues returns all valid values for TemplateButtonType.

func (*TemplateButtonType) UnmarshalJSON

func (v *TemplateButtonType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateButtonType.

func (TemplateButtonType) ValidateEnum

func (v TemplateButtonType) ValidateEnum() error

Validate validates the value of TemplateButtonType.

type TemplateButtons

type TemplateButtons struct {
	Items []TemplateButton `json:"items,omitempty"`
}

TemplateButtons List of template buttons

type TemplateCodePath

type TemplateCodePath = string

TemplateCodePath defines model for TemplateCodePath.

type TemplateExample

type TemplateExample struct {
	// Attachments Template attachments
	Attachments []TemplateExampleAttachment `json:"attachments,omitempty"`

	// Body Array of example template body values
	Body []string `json:"body,omitempty"`

	// Buttons Array of example template button values
	Buttons [][]string `json:"buttons,omitempty"`

	// Header Array of example values for the header section of the template
	Header []string `json:"header,omitempty"`
}

TemplateExample Template example

type TemplateExampleAttachment

type TemplateExampleAttachment struct {
	// Caption Original file name
	Caption string `json:"caption,omitempty"`

	// Id UID of the uploaded file
	Id openapi_types.UUID `json:"id"`
}

TemplateExampleAttachment Example of a template attachment

type TemplateHeader

type TemplateHeader struct {
	Content TemplateHeaderContent `json:"content,omitempty"`
}

TemplateHeader Header section of the template

type TemplateHeaderContent

type TemplateHeaderContent struct {
	// Body Text content of the header section (for content type `text`)
	Body string `json:"body,omitempty"`

	// Type Header section type
	Type TemplateHeaderContentType `json:"type"`
}

TemplateHeaderContent Template header content

type TemplateHeaderContentType

type TemplateHeaderContentType string

TemplateHeaderContentType Header section type

const (
	TemplateHeaderContentTypeDocument TemplateHeaderContentType = "document"
	TemplateHeaderContentTypeImage    TemplateHeaderContentType = "image"
	TemplateHeaderContentTypeText     TemplateHeaderContentType = "text"
	TemplateHeaderContentTypeVideo    TemplateHeaderContentType = "video"
)

Defines values for TemplateHeaderContentType.

func (TemplateHeaderContentType) EnumValues

func (TemplateHeaderContentType) EnumValues() []string

EnumValues returns all valid values for TemplateHeaderContentType.

func (*TemplateHeaderContentType) UnmarshalJSON

func (v *TemplateHeaderContentType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateHeaderContentType.

func (TemplateHeaderContentType) ValidateEnum

func (v TemplateHeaderContentType) ValidateEnum() error

Validate validates the value of TemplateHeaderContentType.

type TemplateItem

type TemplateItem struct {
	// Text Text of the template item (for type `text`)
	Text string           `json:"text,omitempty"`
	Type TemplateItemType `json:"-"`

	// VarType Template variable (for type `var`)
	VarType TemplateVarType `json:"var,omitempty"`
}

TemplateItem Template item

type TemplateItemType

type TemplateItemType uint8

TemplateItemType Template item type

const (
	TemplateItemTypeText TemplateItemType = 1
	TemplateItemTypeVar  TemplateItemType = 2
)

Defines values for TemplateItemType.

func (TemplateItemType) EnumValues

func (TemplateItemType) EnumValues() []string

EnumValues returns all valid values for TemplateItemType.

func (*TemplateItemType) UnmarshalJSON

func (v *TemplateItemType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateItemType.

func (TemplateItemType) ValidateEnum

func (v TemplateItemType) ValidateEnum() error

Validate validates the value of TemplateItemType.

type TemplateListResponse

type TemplateListResponse = []Template

TemplateListResponse defines model for TemplateListResponse.

type TemplateQuality

type TemplateQuality string

TemplateQuality Template quality

const (
	TemplateQualityHigh    TemplateQuality = "high"
	TemplateQualityLow     TemplateQuality = "low"
	TemplateQualityMedium  TemplateQuality = "medium"
	TemplateQualityPending TemplateQuality = "pending"
)

Defines values for TemplateQuality.

func (TemplateQuality) EnumValues

func (TemplateQuality) EnumValues() []string

EnumValues returns all valid values for TemplateQuality.

func (*TemplateQuality) UnmarshalJSON

func (v *TemplateQuality) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateQuality.

func (TemplateQuality) ValidateEnum

func (v TemplateQuality) ValidateEnum() error

Validate validates the value of TemplateQuality.

type TemplateSetting

type TemplateSetting struct {
	// Creation Support for creating templates in the system
	Creation bool `json:"creation,omitempty"`
}

TemplateSetting Support for message templates

type TemplateType

type TemplateType string

TemplateType Template type

const (
	TemplateTypeMedia TemplateType = "media"
	TemplateTypeText  TemplateType = "text"
)

Defines values for TemplateType.

func (TemplateType) EnumValues

func (TemplateType) EnumValues() []string

EnumValues returns all valid values for TemplateType.

func (*TemplateType) UnmarshalJSON

func (v *TemplateType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateType.

func (TemplateType) ValidateEnum

func (v TemplateType) ValidateEnum() error

Validate validates the value of TemplateType.

type TemplateVarType

type TemplateVarType uint8

TemplateVarType Template variable type

const (
	TemplateVarTypeCustom    TemplateVarType = 0
	TemplateVarTypeFirstname TemplateVarType = 2
	TemplateVarTypeLastname  TemplateVarType = 3
	TemplateVarTypeName      TemplateVarType = 1
)

Defines values for TemplateVarType.

func (TemplateVarType) EnumValues

func (TemplateVarType) EnumValues() []string

EnumValues returns all valid values for TemplateVarType.

func (*TemplateVarType) UnmarshalJSON

func (v *TemplateVarType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateVarType.

func (TemplateVarType) ValidateEnum

func (v TemplateVarType) ValidateEnum() error

Validate validates the value of TemplateVarType.

type TemplateVerificationStatus

type TemplateVerificationStatus string

TemplateVerificationStatus Template verification status

const (
	TemplateVerificationStatusApproved TemplateVerificationStatus = "approved"
	TemplateVerificationStatusDisabled TemplateVerificationStatus = "disabled"
	TemplateVerificationStatusPaused   TemplateVerificationStatus = "paused"
	TemplateVerificationStatusPending  TemplateVerificationStatus = "pending"
	TemplateVerificationStatusRejected TemplateVerificationStatus = "rejected"
)

Defines values for TemplateVerificationStatus.

func (TemplateVerificationStatus) EnumValues

func (TemplateVerificationStatus) EnumValues() []string

EnumValues returns all valid values for TemplateVerificationStatus.

func (*TemplateVerificationStatus) UnmarshalJSON

func (v *TemplateVerificationStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for TemplateVerificationStatus.

func (TemplateVerificationStatus) ValidateEnum

func (v TemplateVerificationStatus) ValidateEnum() error

Validate validates the value of TemplateVerificationStatus.

type TextMessage

type TextMessage struct {
	// Content Message text
	Content string `json:"content,omitempty"`

	// Quote Quoted message
	Quote *QuoteMessage `json:"quote,omitempty"`
}

TextMessage Text message

type TextMessageSetting

type TextMessageSetting struct {
	// Creating Support for operation with messages of the given type
	Creating ChannelFeature `json:"creating,omitempty"`

	// Deleting Support for operation with messages of the given type
	Deleting ChannelFeature `json:"deleting,omitempty"`

	// Editing Support for operation with messages of the given type
	Editing ChannelFeature `json:"editing,omitempty"`

	// MaxCharsCount Maximum number of characters in a text message
	MaxCharsCount *uint16 `json:"max_chars_count,omitempty"`

	// Quoting Support for operation with messages of the given type
	Quoting ChannelFeature `json:"quoting,omitempty"`

	// Reaction Support for operation with messages of the given type
	Reaction ChannelFeature `json:"reaction,omitempty"`
}

TextMessageSetting Text messages support

type UntilQuery

type UntilQuery = time.Time

UntilQuery defines model for UntilQuery.

type UpdateChannelJSONBody

type UpdateChannelJSONBody struct {
	// AvatarUrl Channel avatar URL
	AvatarUrl *string `binding:"omitempty,max=255" json:"avatar_url,omitempty" mod:"trim,escape"`

	// ExternalID External identifier
	ExternalID *string `binding:"omitempty,max=64" json:"external_id,omitempty" mod:"trim,escape"`

	// Name Channel name
	Name *string `binding:"omitempty,max=100" json:"name,omitempty" mod:"trim,escape"`

	// Settings Channel settings
	Settings ChannelSettings `json:"settings,omitempty"`
	Type     *ChannelType    `binding:"omitempty,enum-valid" json:"type,omitempty"`
}

UpdateChannelJSONBody defines parameters for UpdateChannel.

type UpdateChannelJSONRequestBody

type UpdateChannelJSONRequestBody UpdateChannelJSONBody

UpdateChannelJSONRequestBody defines body for UpdateChannel for application/json ContentType.

type UpdateChannelRequest

type UpdateChannelRequest struct {
	// AvatarUrl Channel avatar URL
	AvatarUrl *string `binding:"omitempty,max=255" json:"avatar_url,omitempty" mod:"trim,escape"`

	// ExternalID External identifier
	ExternalID *string `binding:"omitempty,max=64" json:"external_id,omitempty" mod:"trim,escape"`

	// Name Channel name
	Name *string `binding:"omitempty,max=100" json:"name,omitempty" mod:"trim,escape"`

	// Settings Channel settings
	Settings ChannelSettings `json:"settings,omitempty"`
	Type     *ChannelType    `binding:"omitempty,enum-valid" json:"type,omitempty"`
}

UpdateChannelRequest defines model for UpdateChannelRequest.

type UpdateChannelResp

type UpdateChannelResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UpdateChannelResponse
	JSONDefault  *ErrorResponse
}

func ParseUpdateChannelResp

func ParseUpdateChannelResp(rsp *http.Response) (*UpdateChannelResp, error)

ParseUpdateChannelResp parses an HTTP response from a UpdateChannelWithResponse call

func (UpdateChannelResp) Status

func (r UpdateChannelResp) Status() string

Status returns HTTPResponse.Status

func (UpdateChannelResp) StatusCode

func (r UpdateChannelResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UpdateChannelResponse

type UpdateChannelResponse struct {
	// ID Channel identifier
	ID int64 `json:"id"`

	// UpdatedAt Date and time of last update
	UpdatedAt time.Time `json:"updated_at" time_format:"2006-01-02T15:04:05Z07:00"`
}

UpdateChannelResponse defines model for UpdateChannelResponse.

type UpdateTemplateJSONBody

type UpdateTemplateJSONBody struct {
	// Body Template body
	Body string `json:"body" mod:"trim,escape"`

	// Buttons List of template buttons
	Buttons *TemplateButtons `json:"buttons,omitempty"`

	// Category Template category
	Category *string `json:"category,omitempty" mod:"trim,escape"`

	// Footer Template footer
	Footer *string `json:"footer,omitempty" mod:"trim,escape"`

	// Header Header section of the template
	Header *TemplateHeader `json:"header,omitempty"`

	// Lang Template language
	Lang *string `json:"lang,omitempty" mod:"trim,escape"`

	// Name Template name
	Name               string                     `binding:"required,min=1,max=512" json:"name" mod:"trim,escape"`
	Quality            *TemplateQuality           `binding:"omitempty,enum-valid" json:"quality,omitempty"`
	RejectionReason    *RejectReason              `binding:"omitempty,enum-valid" json:"rejection_reason,omitempty" mod:"trim,escape"`
	Template           []TemplateItem             `json:"template"`
	VerificationStatus TemplateVerificationStatus `binding:"omitempty,enum-valid" json:"verification_status,omitempty"`
}

UpdateTemplateJSONBody defines parameters for UpdateTemplate.

type UpdateTemplateJSONRequestBody

type UpdateTemplateJSONRequestBody UpdateTemplateJSONBody

UpdateTemplateJSONRequestBody defines body for UpdateTemplate for application/json ContentType.

type UpdateTemplateRequest

type UpdateTemplateRequest struct {
	// Body Template body
	Body string `json:"body" mod:"trim,escape"`

	// Buttons List of template buttons
	Buttons *TemplateButtons `json:"buttons,omitempty"`

	// Category Template category
	Category *string `json:"category,omitempty" mod:"trim,escape"`

	// Footer Template footer
	Footer *string `json:"footer,omitempty" mod:"trim,escape"`

	// Header Header section of the template
	Header *TemplateHeader `json:"header,omitempty"`

	// Lang Template language
	Lang *string `json:"lang,omitempty" mod:"trim,escape"`

	// Name Template name
	Name               string                     `binding:"required,min=1,max=512" json:"name" mod:"trim,escape"`
	Quality            *TemplateQuality           `binding:"omitempty,enum-valid" json:"quality,omitempty"`
	RejectionReason    *RejectReason              `binding:"omitempty,enum-valid" json:"rejection_reason,omitempty" mod:"trim,escape"`
	Template           []TemplateItem             `json:"template"`
	VerificationStatus TemplateVerificationStatus `binding:"omitempty,enum-valid" json:"verification_status,omitempty"`
}

UpdateTemplateRequest defines model for UpdateTemplateRequest.

type UpdateTemplateResp

type UpdateTemplateResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *EmptyResponse
	JSONDefault  *ErrorResponse
}

func ParseUpdateTemplateResp

func ParseUpdateTemplateResp(rsp *http.Response) (*UpdateTemplateResp, error)

ParseUpdateTemplateResp parses an HTTP response from a UpdateTemplateWithResponse call

func (UpdateTemplateResp) Status

func (r UpdateTemplateResp) Status() string

Status returns HTTPResponse.Status

func (UpdateTemplateResp) StatusCode

func (r UpdateTemplateResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UploadFileByUrlJSONBody

type UploadFileByUrlJSONBody struct {
	// Url Upload source URL
	Url string `binding:"web_url" json:"url" mod:"trim,escape"`
}

UploadFileByUrlJSONBody defines parameters for UploadFileByUrl.

type UploadFileByUrlJSONRequestBody

type UploadFileByUrlJSONRequestBody UploadFileByUrlJSONBody

UploadFileByUrlJSONRequestBody defines body for UploadFileByUrl for application/json ContentType.

type UploadFileByUrlRequest

type UploadFileByUrlRequest struct {
	// Url Upload source URL
	Url string `binding:"web_url" json:"url" mod:"trim,escape"`
}

UploadFileByUrlRequest defines model for UploadFileByUrlRequest.

type UploadFileByUrlResp

type UploadFileByUrlResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UploadFileResponse
	JSONDefault  *ErrorResponse
}

func ParseUploadFileByUrlResp

func ParseUploadFileByUrlResp(rsp *http.Response) (*UploadFileByUrlResp, error)

ParseUploadFileByUrlResp parses an HTTP response from a UploadFileByUrlWithResponse call

func (UploadFileByUrlResp) Status

func (r UploadFileByUrlResp) Status() string

Status returns HTTPResponse.Status

func (UploadFileByUrlResp) StatusCode

func (r UploadFileByUrlResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UploadFileMultipartBody

type UploadFileMultipartBody = openapi_types.File

UploadFileMultipartBody defines parameters for UploadFile.

type UploadFileMultipartRequestBody

type UploadFileMultipartRequestBody = UploadFileMultipartBody

UploadFileMultipartRequestBody defines body for UploadFile for multipart/form-data ContentType.

type UploadFileResp

type UploadFileResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UploadFileResponse
	JSONDefault  *ErrorResponse
}

func ParseUploadFileResp

func ParseUploadFileResp(rsp *http.Response) (*UploadFileResp, error)

ParseUploadFileResp parses an HTTP response from a UploadFileWithResponse call

func (UploadFileResp) Status

func (r UploadFileResp) Status() string

Status returns HTTPResponse.Status

func (UploadFileResp) StatusCode

func (r UploadFileResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UploadFileResponse

type UploadFileResponse = FileBase

UploadFileResponse Base file information

type UserRef

type UserRef struct {
	// Available User status indicator (for user of the user type only)
	Available bool `json:"available,omitempty"`

	// Avatar User avatar
	Avatar string `json:"avatar,omitempty"`

	// Email User email (for customer type user only)
	Email string `json:"email,omitempty"`

	// ExternalID External identifier of a user
	ExternalID string `json:"external_id"`

	// FirstName User name (for customer and user types only)
	FirstName string `json:"first_name,omitempty"`

	// ID User identifier
	ID int64 `json:"id"`

	// IsBlocked User blocking indicator (for customer type user only)
	IsBlocked bool `json:"is_blocked,omitempty"`

	// IsSystem System user indicator (for bot type user only)
	IsSystem bool `json:"is_system,omitempty"`

	// IsTechnicalAccount Technical account indicator (for user of the user type only)
	IsTechnicalAccount bool `json:"is_technical_account,omitempty"`

	// LastName User last name (for customer and user types only)
	LastName string `json:"last_name,omitempty"`

	// Name User nickname
	Name string `json:"name"`

	// Phone User phone number
	Phone string `json:"phone,omitempty"`

	// Type User type
	Type UserType `json:"type"`

	// Username User name (for customer type user only)
	Username string `json:"username,omitempty"`
}

UserRef Details about a user

type UserType

type UserType string

UserType User type

const (
	UserTypeBot      UserType = "bot"
	UserTypeChannel  UserType = "channel"
	UserTypeCustomer UserType = "customer"
	UserTypeUser     UserType = "user"
)

Defines values for UserType.

func (UserType) EnumValues

func (UserType) EnumValues() []string

EnumValues returns all valid values for UserType.

func (*UserType) UnmarshalJSON

func (v *UserType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for UserType.

func (UserType) ValidateEnum

func (v UserType) ValidateEnum() error

Validate validates the value of UserType.

type Utm

type Utm struct {
	// Campaign Campaign
	Campaign *string `binding:"omitempty,min=1,max=255" json:"campaign,omitempty"`

	// Content Ad content
	Content *string `binding:"omitempty,min=1,max=255" json:"content,omitempty"`

	// Medium Medium
	Medium *string `binding:"omitempty,min=1,max=255" json:"medium,omitempty"`

	// Source Source
	Source *string `binding:"omitempty,min=1,max=255" json:"source,omitempty"`

	// Term Keyword
	Term *string `binding:"omitempty,min=1,max=255" json:"term,omitempty"`
}

Utm UTM parameters for tracking marketing campaigns

type WAChannelProperties

type WAChannelProperties struct {
	ChannelQuality *WAChannelQuality `binding:"omitempty,enum-valid" json:"channel_quality,omitempty"`
	ChannelStatus  *WAChannelStatus  `binding:"omitempty,enum-valid" json:"channel_status,omitempty"`
	Tier           *int              `binding:"omitempty,min=0" json:"tier,omitempty"`
}

WAChannelProperties WhatsApp channel properties

type WAChannelQuality

type WAChannelQuality string

WAChannelQuality WhatsApp channel quality

const (
	WAChannelQualityHigh   WAChannelQuality = "high"
	WAChannelQualityLow    WAChannelQuality = "low"
	WAChannelQualityMedium WAChannelQuality = "medium"
)

Defines values for WAChannelQuality.

func (WAChannelQuality) EnumValues

func (WAChannelQuality) EnumValues() []string

EnumValues returns all valid values for WAChannelQuality.

func (*WAChannelQuality) UnmarshalJSON

func (v *WAChannelQuality) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for WAChannelQuality.

func (WAChannelQuality) ValidateEnum

func (v WAChannelQuality) ValidateEnum() error

Validate validates the value of WAChannelQuality.

type WAChannelStatus

type WAChannelStatus string

WAChannelStatus WhatsApp channel status

const (
	WAChannelStatusConnected  WAChannelStatus = "connected"
	WAChannelStatusFlagged    WAChannelStatus = "flagged"
	WAChannelStatusOffline    WAChannelStatus = "offline"
	WAChannelStatusPending    WAChannelStatus = "pending"
	WAChannelStatusRestricted WAChannelStatus = "restricted"
)

Defines values for WAChannelStatus.

func (WAChannelStatus) EnumValues

func (WAChannelStatus) EnumValues() []string

EnumValues returns all valid values for WAChannelStatus.

func (*WAChannelStatus) UnmarshalJSON

func (v *WAChannelStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for WAChannelStatus.

func (WAChannelStatus) ValidateEnum

func (v WAChannelStatus) ValidateEnum() error

Validate validates the value of WAChannelStatus.

Jump to

Keyboard shortcuts

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