Documentation ¶
Index ¶
- Constants
- func MMSHeadValidation(sl validator.StructLevel)
- func SetupValidation()
- type AudioContent
- type AudioMsg
- type BulkMsgResponse
- type Contact
- type ContactAddress
- type ContactContent
- type ContactEmail
- type ContactMsg
- type ContactName
- type ContactOrg
- type ContactPhone
- type ContactURL
- type DeliveryTimeWindow
- type DocumentContent
- type DocumentMsg
- type EmailDeliveryReportsResponse
- type EmailLogsResponse
- type EmailMsg
- type ErrorDetails
- type ExternallyHostedMedia
- type GetDeliveryReportsOpts
- type GetLogsOpts
- type GetSentBulksOpts
- type GetSentBulksStatusOpts
- type ImageContent
- type ImageMsg
- type InboundMMSOpts
- type InboundMMSResponse
- type InboundMMSResult
- type InteractiveButton
- type InteractiveButtons
- type InteractiveButtonsBody
- type InteractiveButtonsContent
- type InteractiveButtonsFooter
- type InteractiveButtonsHeader
- type InteractiveButtonsMsg
- type InteractiveListAction
- type InteractiveListBody
- type InteractiveListContent
- type InteractiveListFooter
- type InteractiveListHeader
- type InteractiveListMsg
- type InteractiveListSection
- type InteractiveMultiproductAction
- type InteractiveMultiproductBody
- type InteractiveMultiproductContent
- type InteractiveMultiproductFooter
- type InteractiveMultiproductHeader
- type InteractiveMultiproductMsg
- type InteractiveMultiproductSection
- type InteractiveProductAction
- type InteractiveProductBody
- type InteractiveProductContent
- type InteractiveProductFooter
- type InteractiveProductMsg
- type LocationContent
- type LocationMsg
- type MMSHead
- type MMSMsg
- type MMSPrice
- type MMSResponse
- type MMSStatus
- type MMSTime
- type MsgCommon
- type MsgResponse
- type MultipartValidatable
- type OutboundMMSDeliveryReportsOpts
- type OutboundMMSDeliveryReportsResponse
- type OutboundMMSDeliveryResult
- type RequestError
- type RescheduleMessagesOpts
- type RescheduleMessagesRequest
- type RescheduleMessagesResponse
- type ResponseDetails
- type SMSFailover
- type SectionRow
- type SendEmailResponse
- type SentEmailBulksResponse
- type SentEmailBulksStatusResponse
- type SentMMS
- type ServiceException
- type Status
- type StickerContent
- type StickerMsg
- type TemplateBody
- type TemplateButton
- type TemplateCreate
- type TemplateData
- type TemplateHeader
- type TemplateMsg
- type TemplateMsgButton
- type TemplateMsgContent
- type TemplateMsgHeader
- type TemplateMsgs
- type TemplateResponse
- type TemplateStructure
- type TemplatesResponse
- type TextContent
- type TextMsg
- type UpdateScheduledMessagesStatusOpts
- type UpdateScheduledMessagesStatusRequest
- type UpdateScheduledMessagesStatusResponse
- type Validatable
- type ValidateAddressesRequest
- type ValidateAddressesResponse
- type VideoContent
- type VideoMsg
Constants ¶
View Source
const MinDeliveryWindow = 60
View Source
const MinsPerHour = 60
Variables ¶
This section is empty.
Functions ¶
func MMSHeadValidation ¶ added in v1.1.0
func MMSHeadValidation(sl validator.StructLevel)
func SetupValidation ¶
func SetupValidation()
SetupValidation configures struct-level validations for all payload models. This method must be called in order for validation to work, and it is invoked automatically when models are imported.
Types ¶
type AudioContent ¶
type AudioContent struct {
MediaURL string `json:"mediaUrl" validate:"required,url,lte=2048"`
}
type AudioMsg ¶
type AudioMsg struct { MsgCommon Content AudioContent `json:"content" validate:"required"` }
type BulkMsgResponse ¶
type BulkMsgResponse struct { Messages []MsgResponse `json:"messages"` BulkID string `json:"bulkId"` }
type Contact ¶
type Contact struct { Addresses []ContactAddress `json:"addresses,omitempty" validate:"omitempty,dive"` Birthday string `json:"birthday,omitempty"` Emails []ContactEmail `json:"emails,omitempty" validate:"omitempty,dive"` Name ContactName `json:"name" validate:"required"` Org ContactOrg `json:"org,omitempty"` Phones []ContactPhone `json:"phones,omitempty" validate:"omitempty,dive"` Urls []ContactURL `json:"urls,omitempty" validate:"omitempty,dive"` }
type ContactAddress ¶
type ContactAddress struct { Street string `json:"street,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` Zip string `json:"zip,omitempty"` Country string `json:"country,omitempty"` CountryCode string `json:"countryCode,omitempty"` Type string `json:"type,omitempty" validate:"omitempty,oneof=HOME WORK"` }
type ContactContent ¶
type ContactContent struct {
Contacts []Contact `json:"contacts" validate:"required,dive"`
}
type ContactEmail ¶
type ContactMsg ¶
type ContactMsg struct { MsgCommon Content ContactContent `json:"content" validate:"required"` }
func (*ContactMsg) Validate ¶
func (t *ContactMsg) Validate() error
type ContactName ¶
type ContactName struct { FirstName string `json:"firstName" validate:"required"` LastName string `json:"lastName,omitempty"` MiddleName string `json:"middleName,omitempty"` NameSuffix string `json:"nameSuffix,omitempty"` NamePrefix string `json:"namePrefix,omitempty"` FormattedName string `json:"formattedName" validate:"required"` }
type ContactOrg ¶
type ContactPhone ¶
type ContactURL ¶
type DeliveryTimeWindow ¶ added in v1.1.0
type DocumentContent ¶
type DocumentMsg ¶
type DocumentMsg struct { MsgCommon Content DocumentContent `json:"content" validate:"required"` }
func (*DocumentMsg) Marshal ¶ added in v1.1.0
func (t *DocumentMsg) Marshal() (*bytes.Buffer, error)
func (*DocumentMsg) Validate ¶
func (t *DocumentMsg) Validate() error
type EmailDeliveryReportsResponse ¶ added in v1.2.0
type EmailDeliveryReportsResponse struct { Results []struct { BulkID string `json:"bulkId"` MessageID string `json:"messageId"` To string `json:"to"` SentAt string `json:"sentAt"` DoneAt string `json:"doneAt"` MessageCount int `json:"messageCount"` Price struct { PricePerMessage float64 `json:"pricePerMessage"` Currency string `json:"currency"` } `json:"price"` Status struct { GroupID int `json:"groupId"` GroupName string `json:"groupName"` ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Action string `json:"action"` } `json:"status"` Error struct { GroupID int `json:"groupId"` GroupName string `json:"groupName"` ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Permanent bool `json:"permanent"` } `json:"error"` Channel string `json:"channel"` } `json:"results"` }
type EmailLogsResponse ¶ added in v1.2.0
type EmailLogsResponse struct { Results []struct { MessageID string `json:"messageId"` To string `json:"to"` From string `json:"from"` Text string `json:"text"` SentAt string `json:"sentAt"` DoneAt string `json:"doneAt"` MessageCount int `json:"messageCount"` Price struct { PricePerMessage float64 `json:"pricePerMessage"` Currency string `json:"currency"` } `json:"price"` Status struct { GroupID int `json:"groupId"` GroupName string `json:"groupName"` ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Action string `json:"action"` } `json:"status"` BulkID string `json:"bulkId"` Channel string `json:"channel"` } `json:"results"` }
type EmailMsg ¶ added in v1.2.0
type EmailMsg struct { From string `validate:"required"` To string `validate:"required"` Cc string Bcc string Subject string `validate:"required"` Text string BulkID string MessageID string TemplateID int Attachment *os.File InlineImage *os.File HTML string ReplyTo string DefaultPlaceholders string PreserveRecipients bool TrackingURL string `validate:"omitempty,url"` TrackClicks bool TrackOpens bool Track bool CallbackData string IntermediateReport bool NotifyURL string `validate:"omitempty,url"` NotifyContentType string SendAt string LandingPagePlaceholders string LandingPageID string // contains filtered or unexported fields }
func GenerateEmailMsg ¶ added in v1.2.0
func GenerateEmailMsg() EmailMsg
func (*EmailMsg) GetMultipartBoundary ¶ added in v1.2.0
type ErrorDetails ¶
type ErrorDetails struct {
RequestError RequestError `json:"requestError"`
}
type ExternallyHostedMedia ¶ added in v1.1.0
type GetDeliveryReportsOpts ¶ added in v1.2.0
func (*GetDeliveryReportsOpts) Validate ¶ added in v1.2.0
func (o *GetDeliveryReportsOpts) Validate() error
type GetLogsOpts ¶ added in v1.2.0
type GetLogsOpts struct { MessageID string From string To string BulkID string GeneralStatus string SentSince string SentUntil string Limit string }
func (*GetLogsOpts) Validate ¶ added in v1.2.0
func (o *GetLogsOpts) Validate() error
type GetSentBulksOpts ¶ added in v1.2.0
type GetSentBulksOpts struct {
BulkID string `validate:"required"`
}
func (*GetSentBulksOpts) Validate ¶ added in v1.2.0
func (o *GetSentBulksOpts) Validate() error
type GetSentBulksStatusOpts ¶ added in v1.2.0
type GetSentBulksStatusOpts struct {
BulkID string `validate:"required"`
}
func (*GetSentBulksStatusOpts) Validate ¶ added in v1.2.0
func (o *GetSentBulksStatusOpts) Validate() error
type ImageContent ¶
type ImageMsg ¶
type ImageMsg struct { MsgCommon Content ImageContent `json:"content" validate:"required"` }
type InboundMMSOpts ¶ added in v1.1.0
type InboundMMSOpts struct {
Limit string
}
type InboundMMSResponse ¶ added in v1.1.0
type InboundMMSResponse struct {
Results []InboundMMSResult `json:"results"`
}
type InboundMMSResult ¶ added in v1.1.0
type InteractiveButton ¶
type InteractiveButtons ¶
type InteractiveButtons struct {
Buttons []InteractiveButton `json:"buttons" validate:"required,min=1,max=3,dive"`
}
type InteractiveButtonsBody ¶
type InteractiveButtonsBody struct {
Text string `json:"text" validate:"required,lte=1024"`
}
type InteractiveButtonsContent ¶
type InteractiveButtonsContent struct { Body InteractiveButtonsBody `json:"body" validate:"required"` Action InteractiveButtons `json:"action" validate:"required"` Header *InteractiveButtonsHeader `json:"header,omitempty" validate:"omitempty"` }
type InteractiveButtonsFooter ¶
type InteractiveButtonsFooter struct {
}type InteractiveButtonsHeader ¶
type InteractiveButtonsHeader struct { Type string `json:"type" validate:"required,oneof=TEXT VIDEO IMAGE DOCUMENT"` Text string `json:"text,omitempty" validate:"lte=60"` MediaURL string `json:"mediaUrl,omitempty" validate:"omitempty,url,lte=2048"` Filename string `json:"filename,omitempty" validate:"lte=240"` }
type InteractiveButtonsMsg ¶
type InteractiveButtonsMsg struct { MsgCommon Content InteractiveButtonsContent `json:"content" validate:"required"` }
func (*InteractiveButtonsMsg) Marshal ¶ added in v1.1.0
func (t *InteractiveButtonsMsg) Marshal() (*bytes.Buffer, error)
func (*InteractiveButtonsMsg) Validate ¶
func (t *InteractiveButtonsMsg) Validate() error
type InteractiveListAction ¶
type InteractiveListAction struct { Title string `json:"title" validate:"required,lte=20"` Sections []InteractiveListSection `json:"sections" validate:"required,min=1,max=10,dive"` }
type InteractiveListBody ¶
type InteractiveListBody struct {
Text string `json:"text" validate:"required,lte=1024"`
}
type InteractiveListContent ¶
type InteractiveListContent struct { Body InteractiveListBody `json:"body" validate:"required"` Action InteractiveListAction `json:"action" validate:"required"` Header *InteractiveListHeader `json:"header,omitempty" validate:"omitempty"` }
type InteractiveListFooter ¶
type InteractiveListFooter struct {
}type InteractiveListHeader ¶
type InteractiveListMsg ¶
type InteractiveListMsg struct { MsgCommon Content InteractiveListContent `json:"content" validate:"required"` }
func (*InteractiveListMsg) Marshal ¶ added in v1.1.0
func (t *InteractiveListMsg) Marshal() (*bytes.Buffer, error)
func (*InteractiveListMsg) Validate ¶
func (t *InteractiveListMsg) Validate() error
type InteractiveListSection ¶
type InteractiveListSection struct { Title string `json:"title,omitempty" validate:"lte=24"` Rows []SectionRow `json:"rows" validate:"required,min=1,max=10,dive"` }
type InteractiveMultiproductAction ¶
type InteractiveMultiproductAction struct { CatalogID string `json:"catalogId" validate:"required"` Sections []InteractiveMultiproductSection `json:"sections" validate:"required,min=1,max=10,dive"` }
type InteractiveMultiproductBody ¶
type InteractiveMultiproductBody struct {
Text string `json:"text" validate:"required,lte=1024"`
}
type InteractiveMultiproductContent ¶
type InteractiveMultiproductContent struct { Header InteractiveMultiproductHeader `json:"header" validate:"required"` Body InteractiveMultiproductBody `json:"body" validate:"required"` Action InteractiveMultiproductAction `json:"action" validate:"required"` }
type InteractiveMultiproductFooter ¶
type InteractiveMultiproductFooter struct {
}type InteractiveMultiproductMsg ¶
type InteractiveMultiproductMsg struct { MsgCommon Content InteractiveMultiproductContent `json:"content" validate:"required"` }
func (*InteractiveMultiproductMsg) Marshal ¶ added in v1.1.0
func (t *InteractiveMultiproductMsg) Marshal() (*bytes.Buffer, error)
func (*InteractiveMultiproductMsg) Validate ¶
func (t *InteractiveMultiproductMsg) Validate() error
type InteractiveProductBody ¶
type InteractiveProductBody struct {
Text string `json:"text" validate:"required,lte=1024"`
}
type InteractiveProductContent ¶
type InteractiveProductContent struct { Action InteractiveProductAction `json:"action" validate:"required"` Body *InteractiveProductBody `json:"body,omitempty"` }
type InteractiveProductFooter ¶
type InteractiveProductFooter struct {
}type InteractiveProductMsg ¶
type InteractiveProductMsg struct { MsgCommon Content InteractiveProductContent `json:"content" validate:"required"` }
func (*InteractiveProductMsg) Marshal ¶ added in v1.1.0
func (t *InteractiveProductMsg) Marshal() (*bytes.Buffer, error)
func (*InteractiveProductMsg) Validate ¶
func (t *InteractiveProductMsg) Validate() error
type LocationContent ¶
type LocationMsg ¶
type LocationMsg struct { MsgCommon Content LocationContent `json:"content" validate:"required"` }
func (*LocationMsg) Marshal ¶ added in v1.1.0
func (t *LocationMsg) Marshal() (*bytes.Buffer, error)
func (*LocationMsg) Validate ¶
func (t *LocationMsg) Validate() error
type MMSHead ¶ added in v1.1.0
type MMSHead struct { From string `json:"from" validate:"required"` To string `json:"to" validate:"required"` ID string `json:"id,omitempty"` Subject string `json:"subject,omitempty"` ValidityPeriodMinutes int32 `json:"validityPeriodMinutes,omitempty"` CallbackData string `json:"callbackData,omitempty" validate:"lte=200"` NotifyURL string `json:"notifyUrl,omitempty" validate:"omitempty,url"` SendAt string `json:"sendAt,omitempty"` IntermediateReport *bool `json:"intermediateReport,omitempty"` DeliveryTimeWindow *DeliveryTimeWindow `json:"deliveryTimeWindow,omitempty"` }
type MMSMsg ¶ added in v1.1.0
type MMSMsg struct { Head MMSHead `validate:"required"` Text string Media *os.File ExternallyHostedMedia []ExternallyHostedMedia `validate:"dive"` SMIL string // contains filtered or unexported fields }
func (*MMSMsg) GetMultipartBoundary ¶ added in v1.1.0
type MMSResponse ¶ added in v1.1.0
type MsgCommon ¶
type MsgCommon struct { From string `json:"from" validate:"required,lte=24"` To string `json:"to" validate:"required,lte=24"` MessageID string `json:"messageId,omitempty" validate:"lte=50"` CallbackData string `json:"callbackData,omitempty" validate:"lte=4000"` NotifyURL string `json:"notifyUrl,omitempty" validate:"omitempty,url,lte=2048"` }
func GenerateTestMsgCommon ¶
func GenerateTestMsgCommon() MsgCommon
type MsgResponse ¶
type MultipartValidatable ¶ added in v1.1.0
type MultipartValidatable interface { Validatable GetMultipartBoundary() string }
type OutboundMMSDeliveryReportsOpts ¶ added in v1.1.0
type OutboundMMSDeliveryReportsResponse ¶ added in v1.1.0
type OutboundMMSDeliveryReportsResponse struct {
Results []OutboundMMSDeliveryResult `json:"results"`
}
type OutboundMMSDeliveryResult ¶ added in v1.1.0
type OutboundMMSDeliveryResult struct { BulkID string `json:"bulkId"` MessageID string `json:"messageId"` To string `json:"to"` From string `json:"from"` SentAt string `json:"sentAt"` DoneAt string `json:"doneAt"` MMSCount int32 `json:"mmsCount"` MCCMNC string `json:"mccMnc"` CallbackData string `json:"callbackData"` Price MMSPrice `json:"price"` Status MMSStatus `json:"status"` Error MMSStatus `json:"error"` }
type RequestError ¶
type RequestError struct {
ServiceException ServiceException `json:"serviceException"`
}
type RescheduleMessagesOpts ¶ added in v1.2.0
type RescheduleMessagesOpts struct {
BulkID string `validate:"required"`
}
func (*RescheduleMessagesOpts) Validate ¶ added in v1.2.0
func (o *RescheduleMessagesOpts) Validate() error
type RescheduleMessagesRequest ¶ added in v1.2.0
type RescheduleMessagesRequest struct {
SendAt string `json:"sendAt"`
}
func (*RescheduleMessagesRequest) Marshal ¶ added in v1.2.0
func (r *RescheduleMessagesRequest) Marshal() (*bytes.Buffer, error)
func (*RescheduleMessagesRequest) Validate ¶ added in v1.2.0
func (r *RescheduleMessagesRequest) Validate() error
type RescheduleMessagesResponse ¶ added in v1.2.0
type ResponseDetails ¶
type ResponseDetails struct { ErrorResponse ErrorDetails HTTPResponse http.Response }
type SMSFailover ¶
type SectionRow ¶
type SendEmailResponse ¶ added in v1.2.0
type SendEmailResponse struct { BulkID string `json:"bulkId"` Messages []struct { To string `json:"to"` MessageCount int `json:"messageCount"` MessageID string `json:"messageId"` Status struct { GroupID int `json:"groupId"` GroupName string `json:"groupName"` ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` } `json:"status"` } `json:"messages"` }
type SentEmailBulksResponse ¶ added in v1.2.0
type SentEmailBulksStatusResponse ¶ added in v1.2.0
type ServiceException ¶
type StickerContent ¶
type StickerContent struct {
MediaURL string `json:"mediaUrl" validate:"required,url,lte=2048"`
}
type StickerMsg ¶
type StickerMsg struct { MsgCommon Content StickerContent `json:"content" validate:"required"` }
func (*StickerMsg) Validate ¶
func (t *StickerMsg) Validate() error
type TemplateBody ¶
type TemplateBody struct {
Placeholders []string `json:"placeholders" validate:"required,dive,gte=1"`
}
type TemplateButton ¶
type TemplateCreate ¶
type TemplateCreate struct { Name string `json:"name" validate:"required"` Language string `json:"language" validate:"required"` Category string `json:"category" validate:"required"` Structure TemplateStructure `json:"structure" validate:"required"` }
func (*TemplateCreate) Marshal ¶ added in v1.1.0
func (t *TemplateCreate) Marshal() (*bytes.Buffer, error)
func (*TemplateCreate) Validate ¶
func (t *TemplateCreate) Validate() error
type TemplateData ¶
type TemplateData struct { Body TemplateBody `json:"body" validate:"required"` Header *TemplateMsgHeader `json:"header,omitempty"` Buttons []TemplateMsgButton `json:"buttons,omitempty" validate:"omitempty,max=3,dive"` }
type TemplateHeader ¶
type TemplateMsg ¶
type TemplateMsg struct { MsgCommon Content TemplateMsgContent `json:"content" validate:"required"` SMSFailover *SMSFailover `json:"smsFailover,omitempty"` }
type TemplateMsgButton ¶
type TemplateMsgContent ¶
type TemplateMsgContent struct { TemplateName string `json:"templateName" validate:"required,lte=512"` TemplateData TemplateData `json:"templateData" validate:"required"` Language string `json:"language" validate:"required"` }
type TemplateMsgHeader ¶
type TemplateMsgHeader struct { Type string `json:"type" validate:"required,oneof=TEXT DOCUMENT IMAGE VIDEO LOCATION"` Placeholder string `json:"placeholder,omitempty"` MediaURL string `json:"mediaUrl,omitempty" validate:"omitempty,url,lte=2048"` Filename string `json:"filename,omitempty" validate:"lte=240"` Latitude *float32 `json:"latitude,omitempty" validate:"omitempty,latitude"` Longitude *float32 `json:"longitude,omitempty" validate:"omitempty,longitude"` }
type TemplateMsgs ¶
type TemplateMsgs struct { Messages []TemplateMsg `json:"messages" validate:"required,min=1,dive"` BulkID string `json:"bulkId,omitempty" validate:"lte=100"` }
func (*TemplateMsgs) Marshal ¶ added in v1.1.0
func (t *TemplateMsgs) Marshal() (*bytes.Buffer, error)
func (*TemplateMsgs) Validate ¶
func (t *TemplateMsgs) Validate() error
type TemplateResponse ¶
type TemplateStructure ¶
type TemplateStructure struct { Header *TemplateHeader `json:"header,omitempty"` Body string `json:"body" validate:"required"` Buttons []TemplateButton `json:"buttons,omitempty" validate:"omitempty,min=1,max=3,dive"` Type string `json:"type,omitempty" validate:"oneof=TEXT MEDIA UNSUPPORTED"` }
type TemplatesResponse ¶
type TemplatesResponse struct {
Templates []TemplateResponse `json:"templates"`
}
type TextContent ¶
type TextMsg ¶
type TextMsg struct { MsgCommon Content TextContent `json:"content" validate:"required"` }
type UpdateScheduledMessagesStatusOpts ¶ added in v1.2.0
type UpdateScheduledMessagesStatusOpts struct {
BulkID string `validate:"required"`
}
func (*UpdateScheduledMessagesStatusOpts) Validate ¶ added in v1.2.0
func (o *UpdateScheduledMessagesStatusOpts) Validate() error
type UpdateScheduledMessagesStatusRequest ¶ added in v1.2.0
type UpdateScheduledMessagesStatusRequest struct {
Status string `json:"status" validate:"required,oneof=PENDING PAUSED PROCESSING CANCELED FINISHED FAILED"`
}
func (*UpdateScheduledMessagesStatusRequest) Marshal ¶ added in v1.2.0
func (r *UpdateScheduledMessagesStatusRequest) Marshal() (*bytes.Buffer, error)
func (*UpdateScheduledMessagesStatusRequest) Validate ¶ added in v1.2.0
func (r *UpdateScheduledMessagesStatusRequest) Validate() error
type UpdateScheduledMessagesStatusResponse ¶ added in v1.2.0
type Validatable ¶
Validatable should be implemented by all models which represent request payloads. It will be called before a request is made.
type ValidateAddressesRequest ¶ added in v1.2.0
type ValidateAddressesRequest struct {
To string `json:"to"`
}
func (*ValidateAddressesRequest) Marshal ¶ added in v1.2.0
func (v *ValidateAddressesRequest) Marshal() (*bytes.Buffer, error)
func (*ValidateAddressesRequest) Validate ¶ added in v1.2.0
func (v *ValidateAddressesRequest) Validate() error
type ValidateAddressesResponse ¶ added in v1.2.0
type VideoContent ¶
Click to show internal directories.
Click to hide internal directories.