Versions in this module Expand all Collapse all v0 v0.1.0 Aug 25, 2017 Changes in this version + var EventDocumentationFormat = "/api/v%d/webhooks/events/documentation" + var MessageEventsPathFormat = "/api/v%d/message-events" + var MessageEventsSamplesPathFormat = "/api/v%d/message-events/events/samples" + var MetricsPathFormat = "/api/v%d/metrics/deliverability" + var RecipientListsPathFormat = "/api/v%d/recipient-lists" + var SubaccountGrants = []string + var SubaccountStatuses = []string + var SubaccountsPathFormat = "/api/v%d/subaccounts" + var SuppressionListsPathFormat = "/api/v%d/suppression-list" + var TemplatesPathFormat = "/api/v%d/templates" + var TransmissionsPathFormat = "/api/v%d/transmissions" + var WebhooksPathFormat = "/api/v%d/webhooks" + func Is2XX(code int) bool + func ParseContent(content interface{}) (err error) + func ParseEvents(rawEventsPtr []*json.RawMessage) (*[]events.Event, error) + func ParseRecipients(recips interface{}) (ra *[]Recipient, err error) + type Address struct + Email string + HeaderTo string + Name string + func ParseAddress(addr interface{}) (a Address, err error) + type Attachment struct + B64Data string + Filename string + MIMEType string + type Client struct + Client *http.Client + Config *Config + Headers *http.Header + func (c *Client) DoRequest(ctx context.Context, method, urlStr string, data []byte) (*Response, error) + func (c *Client) EventDocumentation() (g map[string]*EventGroup, res *Response, err error) + func (c *Client) EventDocumentationContext(ctx context.Context) (groups map[string]*EventGroup, res *Response, err error) + func (c *Client) EventSamples(types *[]string) (*events.Events, *Response, error) + func (c *Client) EventSamplesContext(ctx context.Context, types *[]string) (*events.Events, *Response, error) + func (c *Client) HttpDelete(ctx context.Context, url string) (*Response, error) + func (c *Client) HttpGet(ctx context.Context, url string) (*Response, error) + func (c *Client) HttpPost(ctx context.Context, url string, data []byte) (*Response, error) + func (c *Client) HttpPut(ctx context.Context, url string, data []byte) (*Response, error) + func (c *Client) Init(cfg *Config) error + func (c *Client) MessageEventsSearch(ep *EventsPage) (*Response, error) + func (c *Client) MessageEventsSearchContext(ctx context.Context, ep *EventsPage) (*Response, error) + func (c *Client) QueryMetrics(m *Metrics) (*Response, error) + func (c *Client) QueryMetricsContext(ctx context.Context, m *Metrics) (*Response, error) + func (c *Client) RecipientListCreate(rl *RecipientList) (id string, res *Response, err error) + func (c *Client) RecipientListCreateContext(ctx context.Context, rl *RecipientList) (id string, res *Response, err error) + func (c *Client) RecipientLists() ([]RecipientList, *Response, error) + func (c *Client) RecipientListsContext(ctx context.Context) ([]RecipientList, *Response, error) + func (c *Client) Send(t *Transmission) (id string, res *Response, err error) + func (c *Client) SendContext(ctx context.Context, t *Transmission) (id string, res *Response, err error) + func (c *Client) Subaccount(id int) (subaccount *Subaccount, res *Response, err error) + func (c *Client) SubaccountContext(ctx context.Context, id int) (subaccount *Subaccount, res *Response, err error) + func (c *Client) SubaccountCreate(s *Subaccount) (res *Response, err error) + func (c *Client) SubaccountCreateContext(ctx context.Context, s *Subaccount) (res *Response, err error) + func (c *Client) SubaccountUpdate(s *Subaccount) (res *Response, err error) + func (c *Client) SubaccountUpdateContext(ctx context.Context, s *Subaccount) (res *Response, err error) + func (c *Client) Subaccounts() (subaccounts []Subaccount, res *Response, err error) + func (c *Client) SubaccountsContext(ctx context.Context) (subaccounts []Subaccount, res *Response, err error) + func (c *Client) SuppressionDelete(email string) (res *Response, err error) + func (c *Client) SuppressionDeleteContext(ctx context.Context, email string) (res *Response, err error) + func (c *Client) SuppressionList(sp *SuppressionPage) (*Response, error) + func (c *Client) SuppressionListContext(ctx context.Context, sp *SuppressionPage) (*Response, error) + func (c *Client) SuppressionRetrieve(email string, sp *SuppressionPage) (*Response, error) + func (c *Client) SuppressionRetrieveContext(ctx context.Context, email string, sp *SuppressionPage) (*Response, error) + func (c *Client) SuppressionSearch(sp *SuppressionPage) (*Response, error) + func (c *Client) SuppressionSearchContext(ctx context.Context, sp *SuppressionPage) (*Response, error) + func (c *Client) SuppressionUpsert(entries []WritableSuppressionEntry) (*Response, error) + func (c *Client) SuppressionUpsertContext(ctx context.Context, entries []WritableSuppressionEntry) (*Response, error) + func (c *Client) TemplateCreate(t *Template) (id string, res *Response, err error) + func (c *Client) TemplateCreateContext(ctx context.Context, t *Template) (id string, res *Response, err error) + func (c *Client) TemplateDelete(id string) (res *Response, err error) + func (c *Client) TemplateDeleteContext(ctx context.Context, id string) (res *Response, err error) + func (c *Client) TemplateGet(t *Template, draft bool) (*Response, error) + func (c *Client) TemplateGetContext(ctx context.Context, t *Template, draft bool) (*Response, error) + func (c *Client) TemplatePreview(id string, payload *PreviewOptions) (res *Response, err error) + func (c *Client) TemplatePreviewContext(ctx context.Context, id string, payload *PreviewOptions) (res *Response, err error) + func (c *Client) TemplateUpdate(t *Template, updatePublished bool) (res *Response, err error) + func (c *Client) TemplateUpdateContext(ctx context.Context, t *Template, updatePublished bool) (res *Response, err error) + func (c *Client) Templates() ([]Template, *Response, error) + func (c *Client) TemplatesContext(ctx context.Context) (tl []Template, res *Response, err error) + func (c *Client) Transmission(t *Transmission) (*Response, error) + func (c *Client) TransmissionContext(ctx context.Context, t *Transmission) (*Response, error) + func (c *Client) TransmissionDelete(t *Transmission) (*Response, error) + func (c *Client) TransmissionDeleteContext(ctx context.Context, t *Transmission) (*Response, error) + func (c *Client) Transmissions(t *Transmission) ([]Transmission, *Response, error) + func (c *Client) TransmissionsContext(ctx context.Context, t *Transmission) ([]Transmission, *Response, error) + func (c *Client) WebhookDetail(q *WebhookDetailWrapper) (*Response, error) + func (c *Client) WebhookDetailContext(ctx context.Context, d *WebhookDetailWrapper) (*Response, error) + func (c *Client) WebhookStatus(s *WebhookStatusWrapper) (*Response, error) + func (c *Client) WebhookStatusContext(ctx context.Context, s *WebhookStatusWrapper) (*Response, error) + func (c *Client) Webhooks(l *WebhookListWrapper) (*Response, error) + func (c *Client) WebhooksContext(ctx context.Context, l *WebhookListWrapper) (*Response, error) + type Config struct + ApiKey string + ApiVersion int + BaseUrl string + Password string + Username string + Verbose bool + func NewConfig(m map[string]string) (*Config, error) + type Content struct + Attachments []Attachment + EmailRFC822 string + From interface{} + HTML string + Headers map[string]string + InlineImages []InlineImage + ReplyTo string + Subject string + Text string + type EventField struct + Description string + SampleValue interface{} + type EventGroup struct + Description string + DisplayName string + Events map[string]EventMeta + Name string + type EventMeta struct + Description string + DisplayName string + Fields map[string]EventField + Name string + type EventsPage struct + Errors []interface{} + Events events.Events + FirstPage string + LastPage string + NextPage string + Params map[string]string + PrevPage string + TotalCount int + func (ep *EventsPage) Next() (*EventsPage, *Response, error) + func (ep *EventsPage) NextContext(ctx context.Context) (*EventsPage, *Response, error) + func (ep *EventsPage) UnmarshalJSON(data []byte) error + type From struct + Email string + Name string + func ParseFrom(from interface{}) (f From, err error) + type InlineImage Attachment + type MetricItem struct + Binding string + BindingGroup string + CampaignId string + CountAccepted int + CountAdminBounce int + CountBlockBounce int + CountBounce int + CountClicked int + CountDelayed int + CountDelayedFirst int + CountDelivered int + CountDeliveredFirst int + CountDeliveredSubsequent int + CountGenerationFailed int + CountGenerationRejection int + CountHardBounce int + CountInbandBounce int + CountInjected int + CountOutofbandBounce int + CountPolicyRejection int + CountRejected int + CountRendered int + CountSent int + CountSoftBounce int + CountSpamComplaint int + CountTargeted int + CountUndeterminedBounce int + CountUniqueClicked int + CountUniqueConfirmedOpened int + CountUniqueRendered int + Domain string + TemplateId string + TimeStamp string + TotalDeliveryTimeFirst int + TotalDeliveryTimeSubsequent int + TotalMsgVolume int + WatchedDomain string + type Metrics struct + Errors []interface{} + ExtraPath string + Links []map[string]string + Params map[string]string + Results []MetricItem + TotalCount int + type PreviewOptions struct + SubstitutionData map[string]interface{} + type RFC3339 time.Time + func (r *RFC3339) MarshalJSON() ([]byte, error) + type Recipient struct + Address interface{} + Metadata interface{} + ReturnPath string + SubstitutionData interface{} + Tags []string + func (r Recipient) Validate() error + type RecipientList struct + Accepted *int + Attributes interface{} + Description string + ID string + Name string + Recipients []Recipient + func (rl *RecipientList) Validate() error + type Response struct + Body []byte + Errors SPErrors + HTTP *http.Response + Results interface{} + Verbose map[string]string + func (r *Response) AssertJson() error + func (r *Response) ParseResponse() error + func (r *Response) ReadBody() ([]byte, error) + func (res *Response) HTTPError() error + type SPError struct + Code string + Description string + Line int + Message string + Part string + type SPErrors []SPError + func (e SPErrors) Error() string + type Subaccount struct + ComplianceStatus string + Grants []string + ID int + IPPool string + Key string + KeyLabel string + Name string + ShortKey string + Status string + type SuppressionEntry struct + Created string + Description string + Email string + NonTransactional bool + Recipient string + Source string + Transactional bool + Type string + Updated string + type SuppressionPage struct + Errors []struct{ ... } + FirstPage string + LastPage string + Links []struct{ ... } + NextPage string + Params map[string]string + PrevPage string + Recipients []SuppressionEntry + Results []*SuppressionEntry + TotalCount int + func (sp *SuppressionPage) Next() (*SuppressionPage, *Response, error) + func (sp *SuppressionPage) NextContext(ctx context.Context) (*SuppressionPage, *Response, error) + type Template struct + Content Content + Description string + ID string + LastUpdate time.Time + LastUse time.Time + Name string + Options *TmplOptions + Published bool + func (t *Template) Validate() error + type TmplOptions struct + ClickTracking *bool + OpenTracking *bool + Transactional *bool + type Transmission struct + CampaignID string + Content interface{} + Description string + ID string + Metadata interface{} + NumFailedGeneration *int + NumGenerated *int + NumInvalidRecipients *int + Options *TxOptions + Recipients interface{} + ReturnPath string + State string + SubstitutionData interface{} + TotalRecipients *int + func (t *Transmission) Validate() error + type TxOptions struct + IPPool string + InlineCSS *bool + Sandbox *bool + SkipSuppression *bool + StartTime *RFC3339 + Transactional *bool + type WebhookCommon struct + Errors []interface{} + Params map[string]string + type WebhookDetailWrapper struct + ID string + Results *WebhookItem + type WebhookItem struct + AuthCredentials struct{ ... } + AuthRequestDetails struct{ ... } + AuthToken string + AuthType string + Events []string + ID string + LastFailure string + LastSuccessful string + Links []struct{ ... } + Name string + Target string + type WebhookListWrapper struct + Results []WebhookItem + type WebhookStatus struct + Attempts int + BatchID string + FailureCode string + ResponseCode string + Timestamp string + type WebhookStatusWrapper struct + ID string + Results []WebhookStatus + type WritableSuppressionEntry struct + Description string + Recipient string + Type string