sendgrid

package module
v0.0.0-...-0bc1669 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 16 Imported by: 0

README

SendGrid API in Go

GoDoc test lint codecov

This library supports most if not all of the SendGrid REST calls.

Installing

go get
$ go get -u github.com/i10416/sendgrid

Example

Get Teammate
package main

import (
	"context"
	"log"
	"os"

	"github.com/i10416/sendgrid"
)

func main() {
	apiKey := os.Getenv("SENDGRID_API_KEY")

	c := sendgrid.New(apiKey)
	u, err := c.GetTeammate(context.TODO(), "username")
	if err != nil {
		fmt.Printf("%s\n", err)
		return
	}
	log.Printf("user: %#v\n", u)
}

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func OptionBaseURL

func OptionBaseURL(endpoint string) func(*Client)

OptionBaseURL - provide a custom base url to the sendgrid client.

func OptionDebug

func OptionDebug(b bool) func(*Client)

OptionDebug enable debugging for the client

func OptionHTTPClient

func OptionHTTPClient(client httpClient) func(*Client)

OptionHTTPClient - provide a custom http client to the sendgrid client.

func OptionLog

func OptionLog(l logger) func(*Client)

OptionLog set logging for client.

func OptionSubuser

func OptionSubuser(subuser string) func(*Client)

OptionBaseURL - provide a custom base url to the sendgrid client.

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

Types

type APIKey

type APIKey struct {
	ApiKeyId string `json:"api_key_id,omitempty"`
	Name     string `json:"name,omitempty"`
}

type ARecord

type ARecord struct {
	Valid bool   `json:"valid,omitempty"`
	Type  string `json:"type,omitempty"`
	Host  string `json:"host,omitempty"`
	Data  string `json:"data,omitempty"`
}

type ARecordValidationResults

type ARecordValidationResults struct {
	Valid  bool   `json:"valid,omitempty"`
	Reason string `json:"reason,omitempty"`
}

type ASM

type ASM struct {
	GroupID         int   `json:"group_id"`
	GroupsToDisplay []int `json:"groups_to_display,omitempty"`
}

ASM represents Advanced Suppression Manager settings

type Alert

type Alert struct {
	ID         int64  `json:"id,omitempty"`
	EmailTo    string `json:"email_to,omitempty"`
	Frequency  string `json:"frequency,omitempty"`
	Type       string `json:"type,omitempty"`
	Percentage int64  `json:"percentage,omitempty"`
	CreatedAt  int64  `json:"created_at,omitempty"`
	UpdatedAt  int64  `json:"updated_at,omitempty"`
}

type AllowlistRule

type AllowlistRule struct {
	ID int64  `json:"id"`
	Ip string `json:"ip"`
}

type Attachment

type Attachment struct {
	Content     string `json:"content"`
	Type        string `json:"type,omitempty"`
	Filename    string `json:"filename"`
	Disposition string `json:"disposition,omitempty"`
	ContentID   string `json:"content_id,omitempty"`
}

Attachment represents an email attachment

type Block

type Block struct {
	Created int64  `json:"created"`
	Email   string `json:"email"`
	Reason  string `json:"reason"`
}

Block represents a blocked email

type Bounce

type Bounce struct {
	Created int64  `json:"created"`
	Email   string `json:"email"`
	Reason  string `json:"reason"`
	Status  string `json:"status"`
}

Bounce represents a bounced email

type BrandedLink struct {
	ID        int64          `json:"id,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Subdomain string         `json:"subdomain,omitempty"`
	Username  string         `json:"username,omitempty"`
	UserID    int64          `json:"user_id,omitempty"`
	Default   bool           `json:"default,omitempty"`
	Valid     bool           `json:"valid,omitempty"`
	Legacy    bool           `json:"legacy,omitempty"`
	DNS       DNSBrandedLink `json:"dns,omitempty"`
}

type CategoryStat

type CategoryStat struct {
	Date  string     `json:"date,omitempty"`
	Stats []StatItem `json:"stats,omitempty"`
}

CategoryStat represents category statistics

type ClickTrackingSetting

type ClickTrackingSetting struct {
	Enable     *bool `json:"enable,omitempty"`
	EnableText *bool `json:"enable_text,omitempty"`
}

ClickTrackingSetting represents click tracking settings

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client : sendgrid client

func New

func New(apiKey string, options ...Option) *Client

New builds a sendgrid client from the provided token, baseURL and options

func (*Client) AddIPToAuthenticatedDomain

func (c *Client) AddIPToAuthenticatedDomain(ctx context.Context, domainId int64, input *InputAddIPToAuthenticatedDomain) (*OutputAddIPToAuthenticatedDomain, error)

NOTE: The 'dns' key in the API response for adding an IP to the authenticated domain is different from what is documented. see: https://docs.sendgrid.com/api-reference/domain-authentication/add-an-ip-to-an-authenticated-domain#responses

func (*Client) AddIPToPool

func (c *Client) AddIPToPool(ctx context.Context, poolName, ip string) error

AddIPToPool adds an IP address to a pool see: https://www.twilio.com/docs/sendgrid/api-reference/ip-pools/add-an-ip-address-to-a-pool

func (*Client) AddOptions

func (c *Client) AddOptions(s string, opts interface{}) (string, error)

AddOptions adds the parameters in opt as URL query parameters to s. opt must be a struct whose fields may contain "url" tags.

func (*Client) AuthenticateDomain

func (c *Client) AuthenticateDomain(ctx context.Context, input *InputAuthenticateDomain) (*OutputAuthenticateDomain, error)

func (*Client) CompletedStepsVerifiedSender

func (c *Client) CompletedStepsVerifiedSender(ctx context.Context) (*CompletedStepsVerifiedSender, error)

func (*Client) CreateAPIKey

func (c *Client) CreateAPIKey(ctx context.Context, input *InputCreateAPIKey) (*OutputCreateAPIKey, error)

func (*Client) CreateAllowlistRule

func (c *Client) CreateAllowlistRule(ctx context.Context, input *InputCreateAllowlistRule) (*OutputCreateAllowlistRule, error)
func (c *Client) CreateBrandedLink(ctx context.Context, input *InputCreateBrandedLink) (*OutputCreateBrandedLink, error)

func (*Client) CreateCustomField

func (c *Client) CreateCustomField(ctx context.Context, input *InputCreateCustomField) (*CustomField, error)

func (*Client) CreateIPPool

func (c *Client) CreateIPPool(ctx context.Context, name string) (*IPPool, error)

CreateIPPool creates an IP pool see: https://www.twilio.com/docs/sendgrid/api-reference/ip-pools/create-an-ip-pool

func (*Client) CreateSSOCertificate

func (c *Client) CreateSSOCertificate(ctx context.Context, input *InputCreateSSOCertificate) (*OutputCreateSSOCertificate, error)

func (*Client) CreateSegment

func (c *Client) CreateSegment(ctx context.Context, input *InputCreateSegment) (*Segment, error)

func (*Client) CreateSubuser

func (c *Client) CreateSubuser(ctx context.Context, input *InputCreateSubuser) (*OutputCreateSubuser, error)

func (*Client) Debug

func (c *Client) Debug() bool

Debug returns if debug is enabled.

func (*Client) Debugf

func (c *Client) Debugf(format string, v ...interface{})

Debugf print a formatted debug line.

func (*Client) Debugln

func (c *Client) Debugln(v ...interface{})

Debugln print a debug line.

func (*Client) DeleteAPIKey

func (c *Client) DeleteAPIKey(ctx context.Context, apiKeyId string) error

func (*Client) DeleteAllowlistRule

func (c *Client) DeleteAllowlistRule(ctx context.Context, id int64) error

func (*Client) DeleteAuthenticatedDomain

func (c *Client) DeleteAuthenticatedDomain(ctx context.Context, domainId int64) error

func (*Client) DeleteBlock

func (c *Client) DeleteBlock(ctx context.Context, email string) error

DeleteBlock deletes a specific block see: https://www.twilio.com/docs/sendgrid/api-reference/blocks/delete-a-specific-block

func (*Client) DeleteBlocks

func (c *Client) DeleteBlocks(ctx context.Context, input *InputDeleteSuppressions) error

DeleteBlocks deletes blocks see: https://www.twilio.com/docs/sendgrid/api-reference/blocks/delete-blocks

func (*Client) DeleteBounce

func (c *Client) DeleteBounce(ctx context.Context, email string) error

DeleteBounce deletes a specific bounce see: https://www.twilio.com/docs/sendgrid/api-reference/bounces/delete-a-bounce

func (*Client) DeleteBounces

func (c *Client) DeleteBounces(ctx context.Context, input *InputDeleteSuppressions) error

DeleteBounces deletes bounces see: https://www.twilio.com/docs/sendgrid/api-reference/bounces/delete-bounces

func (c *Client) DeleteBrandedLink(ctx context.Context, id int64) error

func (*Client) DeleteCustomField

func (c *Client) DeleteCustomField(ctx context.Context, id int64) error

func (*Client) DeleteIPPool

func (c *Client) DeleteIPPool(ctx context.Context, name string) error

DeleteIPPool deletes an IP pool see: https://www.twilio.com/docs/sendgrid/api-reference/ip-pools/delete-an-ip-pool

func (*Client) DeleteInvalidEmail

func (c *Client) DeleteInvalidEmail(ctx context.Context, email string) error

DeleteInvalidEmail deletes a specific invalid email see: https://www.twilio.com/docs/sendgrid/api-reference/invalid-emails/delete-a-specific-invalid-email

func (*Client) DeleteInvalidEmails

func (c *Client) DeleteInvalidEmails(ctx context.Context, input *InputDeleteSuppressions) error

DeleteInvalidEmails deletes invalid emails see: https://www.twilio.com/docs/sendgrid/api-reference/invalid-emails/delete-invalid-emails

func (*Client) DeletePendingTeammate

func (c *Client) DeletePendingTeammate(ctx context.Context, token string) error

func (*Client) DeleteSegment

func (c *Client) DeleteSegment(ctx context.Context, id int64) error

func (*Client) DeleteSpamReport

func (c *Client) DeleteSpamReport(ctx context.Context, email string) error

DeleteSpamReport deletes a specific spam report see: https://www.twilio.com/docs/sendgrid/api-reference/spam-reports/delete-a-specific-spam-report

func (*Client) DeleteSpamReports

func (c *Client) DeleteSpamReports(ctx context.Context, input *InputDeleteSuppressions) error

DeleteSpamReports deletes spam reports see: https://www.twilio.com/docs/sendgrid/api-reference/spam-reports/delete-spam-reports

func (*Client) DeleteSubuser

func (c *Client) DeleteSubuser(ctx context.Context, username string) error

func (*Client) DeleteTeammate

func (c *Client) DeleteTeammate(ctx context.Context, username string) error

func (*Client) DeleteVerifiedSender

func (c *Client) DeleteVerifiedSender(ctx context.Context, id int64) error

func (*Client) DisassociateAuthenticatedDomainFromSubuser

func (c *Client) DisassociateAuthenticatedDomainFromSubuser(ctx context.Context, subuserName string) error

func (*Client) DisassociateBrandedLinkWithSubuser

func (c *Client) DisassociateBrandedLinkWithSubuser(ctx context.Context, username string) error

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) error

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.

The provided ctx must be non-nil, if it is nil an error is returned. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) GetAPIKey

func (c *Client) GetAPIKey(ctx context.Context, apiKeyId string) (*OutputGetAPIKey, error)

func (*Client) GetAPIKeys

func (c *Client) GetAPIKeys(ctx context.Context) (*OutputGetAPIKeys, error)

func (*Client) GetAllIPWarmupStatus

func (c *Client) GetAllIPWarmupStatus(ctx context.Context) ([]IPWarmupStatus, error)

GetAllIPWarmupStatus retrieves all IP warmup statuses see: https://www.twilio.com/docs/sendgrid/api-reference/ip-warmup/retrieve-all-ip-warmup-statuses

func (*Client) GetAllowlistRule

func (c *Client) GetAllowlistRule(ctx context.Context, id int64) (*AllowlistRule, error)

func (*Client) GetAssignedIPAddresses

func (c *Client) GetAssignedIPAddresses(ctx context.Context) ([]IPAddress, error)

GetAssignedIPAddresses retrieves all assigned IP addresses see: https://www.twilio.com/docs/sendgrid/api-reference/ip-addresses/retrieve-all-assigned-ips

func (*Client) GetAuthenticatedDomain

func (c *Client) GetAuthenticatedDomain(ctx context.Context, domainId int64) (*OutputGetAuthenticatedDomain, error)

func (*Client) GetAuthenticatedDomainAssociatedWithSubuser

func (c *Client) GetAuthenticatedDomainAssociatedWithSubuser(ctx context.Context, subuserName string) (*OutputGetAuthenticatedDomainAssociatedWithSubuser, error)

func (*Client) GetAuthenticatedDomains

func (c *Client) GetAuthenticatedDomains(ctx context.Context, input *InputGetAuthenticatedDomains) ([]*DomainAuthentication, error)

func (*Client) GetBlock

func (c *Client) GetBlock(ctx context.Context, email string) (*Block, error)

GetBlock retrieves a specific block see: https://www.twilio.com/docs/sendgrid/api-reference/blocks/retrieve-a-specific-block

func (*Client) GetBlocks

func (c *Client) GetBlocks(ctx context.Context, opts *SuppressionListOptions) ([]Block, error)

GetBlocks retrieves all blocks see: https://www.twilio.com/docs/sendgrid/api-reference/blocks/retrieve-all-blocks

func (*Client) GetBounce

func (c *Client) GetBounce(ctx context.Context, email string) (*Bounce, error)

GetBounce retrieves a specific bounce see: https://www.twilio.com/docs/sendgrid/api-reference/bounces/retrieve-a-bounce

func (*Client) GetBounces

func (c *Client) GetBounces(ctx context.Context, opts *SuppressionListOptions) ([]Bounce, error)

GetBounces retrieves all bounces see: https://www.twilio.com/docs/sendgrid/api-reference/bounces/retrieve-all-bounces

func (c *Client) GetBrandedLink(ctx context.Context, id int64) (*OutputGetBrandedLink, error)
func (c *Client) GetBrandedLinks(ctx context.Context, input *InputGetBrandedLinks) ([]*BrandedLink, error)

func (*Client) GetCategoryStats

func (c *Client) GetCategoryStats(ctx context.Context, categories []string, opts *StatsOptions) ([]CategoryStat, error)

GetCategoryStats retrieves category email statistics see: https://www.twilio.com/docs/sendgrid/api-reference/categories-statistics/retrieve-email-statistics-for-categories

func (*Client) GetCustomField

func (c *Client) GetCustomField(ctx context.Context, id int64) (*CustomField, error)

func (*Client) GetDefaultAuthentication

func (c *Client) GetDefaultAuthentication(ctx context.Context, input *InputGetDefaultAuthentication) (*OutputGetDefaultAuthentication, error)
func (c *Client) GetDefaultBrandedLink(ctx context.Context) (*OutputGetDefaultBrandedLink, error)

func (*Client) GetGlobalStats

func (c *Client) GetGlobalStats(ctx context.Context, opts *StatsOptions) ([]GlobalStat, error)

GetGlobalStats retrieves global email statistics see: https://www.twilio.com/docs/sendgrid/api-reference/stats/retrieve-global-email-statistics

func (*Client) GetIPAddress

func (c *Client) GetIPAddress(ctx context.Context, ip string) (*IPAddress, error)

GetIPAddress retrieves a specific IP address see: https://www.twilio.com/docs/sendgrid/api-reference/ip-addresses/retrieve-an-ip-address

func (*Client) GetIPAddresses

func (c *Client) GetIPAddresses(ctx context.Context) ([]IPAddress, error)

GetIPAddresses retrieves all IP addresses see: https://www.twilio.com/docs/sendgrid/api-reference/ip-addresses/retrieve-all-ip-addresses

func (*Client) GetIPPool

func (c *Client) GetIPPool(ctx context.Context, name string) (*IPPool, error)

GetIPPool retrieves a specific IP pool see: https://www.twilio.com/docs/sendgrid/api-reference/ip-pools/retrieve-an-ip-pool

func (*Client) GetIPPools

func (c *Client) GetIPPools(ctx context.Context) ([]IPPool, error)

GetIPPools retrieves all IP pools see: https://www.twilio.com/docs/sendgrid/api-reference/ip-pools/retrieve-all-ip-pools

func (*Client) GetIPWarmupStatus

func (c *Client) GetIPWarmupStatus(ctx context.Context, ip string) (*IPWarmupStatus, error)

GetIPWarmupStatus retrieves IP warmup status see: https://www.twilio.com/docs/sendgrid/api-reference/ip-warmup/retrieve-ip-warmup-status

func (*Client) GetInvalidEmail

func (c *Client) GetInvalidEmail(ctx context.Context, email string) (*InvalidEmail, error)

GetInvalidEmail retrieves a specific invalid email see: https://www.twilio.com/docs/sendgrid/api-reference/invalid-emails/retrieve-an-invalid-email

func (*Client) GetInvalidEmails

func (c *Client) GetInvalidEmails(ctx context.Context, opts *SuppressionListOptions) ([]InvalidEmail, error)

GetInvalidEmails retrieves all invalid emails see: https://www.twilio.com/docs/sendgrid/api-reference/invalid-emails/retrieve-all-invalid-emails

func (*Client) GetPendingTeammates

func (c *Client) GetPendingTeammates(ctx context.Context) (*OutputGetPendingTeammates, error)

func (*Client) GetRemainingIPCount

func (c *Client) GetRemainingIPCount(ctx context.Context) (map[string]interface{}, error)

GetRemainingIPCount retrieves remaining IP count see: https://www.twilio.com/docs/sendgrid/api-reference/ip-addresses/retrieve-remaining-ip-count

func (*Client) GetSegment

func (c *Client) GetSegment(ctx context.Context, id int64) (*Segment, error)

func (*Client) GetSenderVerificationDomainWarnList

func (c *Client) GetSenderVerificationDomainWarnList(ctx context.Context) (*CompletedStepsVerifiedSender, error)

see: https://docs.sendgrid.com/api-reference/sender-verification/domain-warn-list This endpoint returns a list of domains known to implement DMARC and categorizes them by failure type — hard failure or soft failure. Domains listed as hard failures will not deliver mail when used as a Sender Identity due to the domain's DMARC policy settings.

func (*Client) GetSpamReport

func (c *Client) GetSpamReport(ctx context.Context, email string) (*SpamReport, error)

GetSpamReport retrieves a specific spam report see: https://www.twilio.com/docs/sendgrid/api-reference/spam-reports/retrieve-a-specific-spam-report

func (*Client) GetSpamReports

func (c *Client) GetSpamReports(ctx context.Context, opts *SuppressionListOptions) ([]SpamReport, error)

GetSpamReports retrieves all spam reports see: https://www.twilio.com/docs/sendgrid/api-reference/spam-reports/retrieve-all-spam-reports

func (c *Client) GetSubuserBrandedLink(ctx context.Context, subuser string) (*OutputGetSubuserBrandedLink, error)

func (*Client) GetSubuserMonthlyStats

func (c *Client) GetSubuserMonthlyStats(ctx context.Context, opts *StatsOptions) ([]SubuserStat, error)

GetSubuserMonthlyStats retrieves monthly subuser statistics see: https://www.twilio.com/docs/sendgrid/api-reference/subuser-statistics/retrieve-monthly-stats-for-all-subusers

func (*Client) GetSubuserReputations

func (c *Client) GetSubuserReputations(ctx context.Context, usernames string) ([]*Reputation, error)

func (*Client) GetSubuserStats

func (c *Client) GetSubuserStats(ctx context.Context, subusers []string, opts *StatsOptions) ([]SubuserStat, error)

GetSubuserStats retrieves subuser email statistics see: https://www.twilio.com/docs/sendgrid/api-reference/subuser-statistics/retrieve-email-statistics-for-your-subusers

func (*Client) GetSubusers

func (c *Client) GetSubusers(ctx context.Context, input *InputGetSubusers) ([]*Subuser, error)

func (*Client) GetTeammate

func (c *Client) GetTeammate(ctx context.Context, username string) (*OutputGetTeammate, error)

func (*Client) GetTeammates

func (c *Client) GetTeammates(ctx context.Context, input *InputGetTeammates) (*OutputGetTeammates, error)

func (*Client) GetVerifiedSenders

func (c *Client) GetVerifiedSenders(ctx context.Context, input *InputGetVerifiedSenders) ([]*VerifiedSender, error)

func (*Client) InviteTeammate

func (c *Client) InviteTeammate(ctx context.Context, input *InputInviteTeammate) (*OutputInviteTeammate, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

func (*Client) RemoveIPFromAuthenticatedDomain

func (c *Client) RemoveIPFromAuthenticatedDomain(ctx context.Context, domainId int64, ip string) error

NOTE: The 'dns' key in the API response for removing an IP to the authenticated domain is different from what is documented. see: https://docs.sendgrid.com/api-reference/domain-authentication/remove-an-ip-from-an-authenticated-domain#responses

func (*Client) RemoveIPFromPool

func (c *Client) RemoveIPFromPool(ctx context.Context, poolName, ip string) error

RemoveIPFromPool removes an IP address from a pool see: https://www.twilio.com/docs/sendgrid/api-reference/ip-pools/remove-an-ip-address-from-a-pool

func (*Client) ResendVerifiedSenderRequest

func (c *Client) ResendVerifiedSenderRequest(ctx context.Context, id int64) error

func (*Client) SendMail

func (c *Client) SendMail(ctx context.Context, input *InputSendMail) (*OutputSendMail, error)

SendMail sends an email using SendGrid's mail/send API see: https://www.twilio.com/docs/sendgrid/api-reference/mail-send/mail-send

func (*Client) StartIPWarmup

func (c *Client) StartIPWarmup(ctx context.Context, ip string) (*IPWarmupStatus, error)

StartIPWarmup starts IP warmup process see: https://www.twilio.com/docs/sendgrid/api-reference/ip-warmup/start-ip-warmup

func (*Client) StopIPWarmup

func (c *Client) StopIPWarmup(ctx context.Context, ip string) (*IPWarmupStatus, error)

StopIPWarmup stops IP warmup process see: https://www.twilio.com/docs/sendgrid/api-reference/ip-warmup/stop-ip-warmup

func (*Client) UpdateAPIKeyName

func (c *Client) UpdateAPIKeyName(ctx context.Context, apiKeyId string, input *InputUpdateAPIKeyName) (*OutputUpdateAPIKeyName, error)

func (*Client) UpdateAPIKeyNameAndScopes

func (c *Client) UpdateAPIKeyNameAndScopes(ctx context.Context, apiKeyId string, input *InputUpdateAPIKeyNameAndScopes) (*OutputUpdateAPIKeyNameAndScopes, error)
func (c *Client) UpdateBrandedLink(ctx context.Context, id int64, input *InputUpdateBrandedLink) (*OutputUpdateBrandedLink, error)

func (*Client) UpdateDomainAuthentication

func (c *Client) UpdateDomainAuthentication(ctx context.Context, domainId int64, input *InputUpdateDomainAuthentication) (*OutputUpdateDomainAuthentication, error)

func (*Client) UpdateIPPool

func (c *Client) UpdateIPPool(ctx context.Context, oldName, newName string) (*IPPool, error)

UpdateIPPool updates an IP pool name see: https://www.twilio.com/docs/sendgrid/api-reference/ip-pools/update-an-ip-pool

func (*Client) UpdateSegment

func (c *Client) UpdateSegment(ctx context.Context, input *InputUpdateSegment) (*Segment, error)

func (*Client) UpdateSubuserIps

func (c *Client) UpdateSubuserIps(ctx context.Context, username string, ips []string) error

func (*Client) UpdateSubuserStatus

func (c *Client) UpdateSubuserStatus(ctx context.Context, username string, input *InputUpdateSubuserStatus) error

func (*Client) UpdateTeammatePermissions

func (c *Client) UpdateTeammatePermissions(ctx context.Context, username string, input *InputUpdateTeammatePermissions) (*OutputUpdateTeammatePermissions, error)

func (*Client) UpdateVerifiedSender

func (c *Client) UpdateVerifiedSender(ctx context.Context, id int64, input *InputUpdateVerifiedSender) (*OutputUpdateVerifiedSender, error)
func (c *Client) ValidateBrandedLink(ctx context.Context, id int64) (*OutputValidateBrandedLink, error)

func (*Client) ValidateDomainAuthentication

func (c *Client) ValidateDomainAuthentication(ctx context.Context, domainId int64) (*OutputValidateDomainAuthentication, error)

func (*Client) VerifySenderRequest

func (c *Client) VerifySenderRequest(ctx context.Context, token string) error

type CompletedStepsVerifiedSender

type CompletedStepsVerifiedSender struct {
	SenderVerified bool `json:"sender_verified,omitempty"`
	DomainVerified bool `json:"domain_verified,omitempty"`
}

type Content

type Content struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

Content represents email content with type and value

func NewContent

func NewContent(contentType, value string) *Content

NewContent creates a new Content struct

type CreditAllocation

type CreditAllocation struct {
	Type string `json:"type"`
}

type CustomField

type CustomField struct {
	ID   int64  `json:"id,omitempty"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type DNS

type DNS struct {
	MailCname Record `json:"mail_cname,omitempty"`
	Dkim1     Record `json:"dkim1,omitempty"`
	Dkim2     Record `json:"dkim2,omitempty"`
}
type DNSBrandedLink struct {
	DomainCname Record `json:"domain_cname,omitempty"`
	OwnerCname  Record `json:"owner_cname,omitempty"`
}

type Design

type Design struct {
	ID           string `json:"id,omitempty"`
	UpdatedAt    string `json:"updated_at,omitempty"`
	CreatedAt    string `json:"created_at,omitempty"`
	ThumbnailURL string `json:"thumbnail_url,omitempty"`
	Name         string `json:"name,omitempty"`
	Editor       string `json:"editor,omitempty"`
}

type DomainAuthentication

type DomainAuthentication struct {
	ID                      int64                         `json:"id,omitempty"`
	UserID                  int64                         `json:"user_id,omitempty"`
	Subdomain               string                        `json:"subdomain,omitempty"`
	Domain                  string                        `json:"domain,omitempty"`
	Username                string                        `json:"username,omitempty"`
	IPs                     []string                      `json:"ips,omitempty"`
	CustomSpf               bool                          `json:"custom_spf,omitempty"`
	Default                 bool                          `json:"default,omitempty"`
	Legacy                  bool                          `json:"legacy,omitempty"`
	AutomaticSecurity       bool                          `json:"automatic_security,omitempty"`
	Valid                   bool                          `json:"valid,omitempty"`
	DNS                     DNS                           `json:"dns,omitempty"`
	Subusers                []SubuserSenderAuthentication `json:"subusers,omitempty"`
	LastValidationAttemptAt int64                         `json:"last_validation_attempt_at,omitempty"`
}

type Email

type Email struct {
	Email string `json:"email"`
	Name  string `json:"name,omitempty"`
}

Email represents an email address with optional name

func NewEmail

func NewEmail(email, name string) *Email

NewEmail creates a new Email struct

type Error

type Error struct {
	Field   *string `json:"field,omitempty"`
	Message *string `json:"message,omitempty"`
}

Error is sendgrid error

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse is sendgrid error response

func (ErrorResponse) Err

func (t ErrorResponse) Err() error

Err : error

type ErrorsResponse

type ErrorsResponse struct {
	Errors []*Error `json:"errors"`
}

ErrorsResponse is sendgrid error response

func (ErrorsResponse) Errs

func (t ErrorsResponse) Errs() error

Errs : error list

type EventWebhook

type EventWebhook struct {
	ID               string `json:"id,omitempty"`
	Enabled          bool   `json:"enabled,omitempty"`
	URL              string `json:"url,omitempty"`
	GroupResubscribe bool   `json:"group_resubscribe,omitempty"`
	Delivered        bool   `json:"delivered,omitempty"`
	GroupUnsubscribe bool   `json:"group_unsubscribe,omitempty"`
	SpamReport       bool   `json:"spam_report,omitempty"`
	Bounce           bool   `json:"bounce,omitempty"`
	Deferred         bool   `json:"deferred,omitempty"`
	Unsubscribe      bool   `json:"unsubscribe,omitempty"`
	Processed        bool   `json:"processed,omitempty"`
	Open             bool   `json:"open,omitempty"`
	Click            bool   `json:"click,omitempty"`
	Dropped          bool   `json:"dropped,omitempty"`
	FriendlyName     string `json:"friendly_name,omitempty"`
	OAuthClientID    string `json:"oauth_client_id,omitempty"`
	OAuthTokenURL    string `json:"oauth_token_url,omitempty"`
	PublicKey        string `json:"public_key,omitempty"`
}

type FooterSetting

type FooterSetting struct {
	Enable *bool  `json:"enable,omitempty"`
	Text   string `json:"text,omitempty"`
	HTML   string `json:"html,omitempty"`
}

FooterSetting represents footer settings

type GlobalStat

type GlobalStat struct {
	Date  string      `json:"date,omitempty"`
	Stats StatMetrics `json:"stats,omitempty"`
}

GlobalStat represents global statistics

type GoogleAnalyticsSetting

type GoogleAnalyticsSetting struct {
	Enable      *bool  `json:"enable,omitempty"`
	UTMSource   string `json:"utm_source,omitempty"`
	UTMMedium   string `json:"utm_medium,omitempty"`
	UTMTerm     string `json:"utm_term,omitempty"`
	UTMContent  string `json:"utm_content,omitempty"`
	UTMCampaign string `json:"utm_campaign,omitempty"`
}

GoogleAnalyticsSetting represents Google Analytics settings

type IPAddress

type IPAddress struct {
	IP         string   `json:"ip,omitempty"`
	Pools      []string `json:"pools,omitempty"`
	Warmup     bool     `json:"warmup,omitempty"`
	StartDate  int64    `json:"start_date,omitempty"`
	Subusers   []string `json:"subusers,omitempty"`
	Rdns       string   `json:"rdns,omitempty"`
	AssignedAt int64    `json:"assigned_at,omitempty"`
}

IPAddress represents an IP address

type IPPool

type IPPool struct {
	Name string `json:"name,omitempty"`
}

IPPool represents an IP pool

type IPWarmupStatus

type IPWarmupStatus struct {
	IP     string `json:"ip,omitempty"`
	Warmup bool   `json:"warmup,omitempty"`
}

IPWarmupStatus represents IP warmup status

type InboundParseWebhook

type InboundParseWebhook struct {
	URL       string `json:"url,omitempty"`
	Hostname  string `json:"hostname,omitempty"`
	SpamCheck bool   `json:"spam_check,omitempty"`
	SendRaw   bool   `json:"send_raw,omitempty"`
}

type InputAddIPToAuthenticatedDomain

type InputAddIPToAuthenticatedDomain struct {
	IP string `json:"ip,omitempty"`
}

type InputAddIPToPool

type InputAddIPToPool struct {
	IP string `json:"ip"`
}

InputAddIPToPool represents the request to add an IP to a pool

type InputAssignIPToSubuser

type InputAssignIPToSubuser struct {
	IPs []string `json:"ips"`
}

InputAssignIPToSubuser represents the request to assign an IP to a subuser

type InputAssociateAuthenticatedDomainWithSubuser

type InputAssociateAuthenticatedDomainWithSubuser struct {
	Username string `json:"username,omitempty"`
}

type InputAssociateBrandedLinkWithSubuser

type InputAssociateBrandedLinkWithSubuser struct {
	Username string `json:"username,omitempty"`
}

type InputAuthenticateDomain

type InputAuthenticateDomain struct {
	Domain             string   `json:"domain,omitempty"`
	Subdomain          string   `json:"subdomain,omitempty"`
	Username           string   `json:"username,omitempty"`
	IPs                []string `json:"ips,omitempty"`
	CustomSpf          bool     `json:"custom_spf,omitempty"`
	Default            bool     `json:"default,omitempty"`
	AutomaticSecurity  bool     `json:"automatic_security,omitempty"`
	CustomDkimSelector string   `json:"custom_dkim_selector,omitempty"`
}

type InputCreateAPIKey

type InputCreateAPIKey struct {
	Name   string   `json:"name,omitempty"`
	Scopes []string `json:"scopes,omitempty"`
}

type InputCreateAlert

type InputCreateAlert struct {
	Type       string `json:"type,omitempty"`
	EmailTo    string `json:"email_to,omitempty"`
	Frequency  string `json:"frequency,omitempty"`
	Percentage int64  `json:"percentage,omitempty"`
}

type InputCreateAllowlistRule

type InputCreateAllowlistRule struct {
	Ips []InputCreateAllowlistRuleIp `json:"ips"`
}

type InputCreateAllowlistRuleIp

type InputCreateAllowlistRuleIp struct {
	Ip string `json:"ip"`
}
type InputCreateBrandedLink struct {
	Domain    string `json:"domain,omitempty"`
	Subdomain string `json:"subdomain,omitempty"`
	Default   bool   `json:"default"`
}

type InputCreateCustomField

type InputCreateCustomField struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type InputCreateDesign

type InputCreateDesign struct {
	Name                 string   `json:"name,omitempty"`
	Editor               string   `json:"editor,omitempty"`
	HTMLContent          string   `json:"html_content,omitempty"`
	PlainContent         string   `json:"plain_content,omitempty"`
	GeneratePlainContent bool     `json:"generate_plain_content"`
	Subject              string   `json:"subject,omitempty"`
	Categories           []string `json:"categories,omitempty"`
}

type InputCreateEventWebhook

type InputCreateEventWebhook struct {
	Enabled           bool   `json:"enabled"`
	URL               string `json:"url,omitempty"`
	GroupResubscribe  bool   `json:"group_resubscribe"`
	Delivered         bool   `json:"delivered"`
	GroupUnsubscribe  bool   `json:"group_unsubscribe"`
	SpamReport        bool   `json:"spam_report"`
	Bounce            bool   `json:"bounce"`
	Deferred          bool   `json:"deferred"`
	Unsubscribe       bool   `json:"unsubscribe"`
	Processed         bool   `json:"processed"`
	Open              bool   `json:"open"`
	Click             bool   `json:"click"`
	Dropped           bool   `json:"dropped"`
	FriendlyName      string `json:"friendly_name,omitempty"`
	OAuthClientID     string `json:"oauth_client_id,omitempty"`
	OAuthClientSecret string `json:"oauth_client_secret,omitempty"`
	OAuthTokenURL     string `json:"oauth_token_url,omitempty"`
}

type InputCreateInboundParseWebhook

type InputCreateInboundParseWebhook struct {
	URL       string `json:"url,omitempty"`
	Hostname  string `json:"hostname,omitempty"`
	SpamCheck bool   `json:"spam_check"`
	SendRaw   bool   `json:"send_raw"`
}

type InputCreateReverseDNS

type InputCreateReverseDNS struct {
	IP        string `json:"ip,omitempty"`
	Subdomain string `json:"subdomain,omitempty"`
	Domain    string `json:"domain,omitempty"`
}

type InputCreateSSOCertificate

type InputCreateSSOCertificate struct {
	PublicCertificate string `json:"public_certificate,omitempty"`
	Enabled           bool   `json:"enabled"`
	IntegrationID     string `json:"integration_id,omitempty"`
}

type InputCreateSSOIntegration

type InputCreateSSOIntegration struct {
	Name                 string `json:"name,omitempty"`
	Enabled              bool   `json:"enabled"`
	SigninURL            string `json:"signin_url,omitempty"`
	SignoutURL           string `json:"signout_url,omitempty"`
	EntityID             string `json:"entity_id,omitempty"`
	CompletedIntegration bool   `json:"completed_integration"`
}

type InputCreateSSOTeammate

type InputCreateSSOTeammate struct {
	Email                      string               `json:"email"`
	FirstName                  string               `json:"first_name"`
	LastName                   string               `json:"last_name"`
	IsAdmin                    bool                 `json:"is_admin"`
	IsSSO                      bool                 `json:"is_sso"`
	Persona                    string               `json:"persona,omitempty"`
	Scopes                     []string             `json:"scopes,omitempty"`
	HasRestrictedSubuserAccess bool                 `json:"has_restricted_subuser_access,omitempty"`
	SubuserAccess              []InputSubuserAccess `json:"subuser_access,omitempty"`
}

type InputCreateSegment

type InputCreateSegment struct {
	Name       string             `json:"name"`
	Conditions []SegmentCondition `json:"conditions"`
}

type InputCreateSubuser

type InputCreateSubuser struct {
	Username string   `json:"username"`
	Email    string   `json:"email"`
	Password string   `json:"password"`
	Ips      []string `json:"ips"`
}

type InputCreateSuppressionGroup

type InputCreateSuppressionGroup struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	IsDefault   bool   `json:"is_default"`
}

type InputCreateTemplate

type InputCreateTemplate struct {
	Name       string `json:"name,omitempty"`
	Generation string `json:"generation,omitempty"`
}

type InputCreateTemplateVersion

type InputCreateTemplateVersion struct {
	Active               int    `json:"active,omitempty"`
	Name                 string `json:"name,omitempty"`
	HTMLContent          string `json:"html_content,omitempty"`
	PlainContent         string `json:"plain_content,omitempty"`
	GeneratePlainContent bool   `json:"generate_plain_content"`
	Subject              string `json:"subject,omitempty"`
	Editor               string `json:"editor,omitempty"`
	TestData             string `json:"test_data,omitempty"`
}

type InputCreateVerifiedSenderRequest

type InputCreateVerifiedSenderRequest struct {
	Nickname    string `json:"nickname,omitempty"`
	FromEmail   string `json:"from_email,omitempty"`
	FromName    string `json:"from_name,omitempty"`
	ReplyTo     string `json:"reply_to,omitempty"`
	ReplyToName string `json:"reply_to_name,omitempty"`
	Address     string `json:"address,omitempty"`
	Address2    string `json:"address2,omitempty"`
	State       string `json:"state,omitempty"`
	City        string `json:"city,omitempty"`
	Zip         string `json:"zip,omitempty"`
	Country     string `json:"country,omitempty"`
}

type InputDeleteSuppressions

type InputDeleteSuppressions struct {
	Emails    []string `json:"emails,omitempty"`
	DeleteAll bool     `json:"delete_all,omitempty"`
}

InputDeleteSuppressions represents the request body for deleting suppressions

type InputDuplicateTemplate

type InputDuplicateTemplate struct {
	Name string `json:"name,omitempty"`
}

type InputGetAuthenticatedDomains

type InputGetAuthenticatedDomains struct {
	Limit           int
	Offset          int
	ExcludeSubusers bool
	Username        string
	Domain          string
}
type InputGetBrandedLinks struct {
	Limit int
}

type InputGetCustomField

type InputGetCustomField struct {
	ID int64
}

type InputGetDefaultAuthentication

type InputGetDefaultAuthentication struct {
	Domain string
}

type InputGetReverseDNSs

type InputGetReverseDNSs struct {
	Limit  int    `json:"limit,omitempty"`
	Offset int    `json:"offset,omitempty"`
	IP     string `json:"ip,omitempty"`
}

type InputGetSSOIntegrations

type InputGetSSOIntegrations struct {
	Si bool `json:"si,omitempty"`
}

type InputGetSubusers

type InputGetSubusers struct {
	Username string
	Limit    int
	Offset   int
}

type InputGetTeammateSubuserAccess

type InputGetTeammateSubuserAccess struct {
	AfterSubuserID int64  `json:"after_subuser_id,omitempty"`
	Limit          int64  `json:"limit,omitempty"`
	Username       string `json:"username,omitempty"`
}

type InputGetTeammates

type InputGetTeammates struct {
	Limit  int `json:"limit,omitempty"`
	Offset int `json:"offset,omitempty"`
}

type InputGetTemplates

type InputGetTemplates struct {
	Generations string
	PageSize    int
	PageToken   string
}

type InputGetVerifiedSenders

type InputGetVerifiedSenders struct {
	Limit      int
	LastSeenID int
	ID         int64
}

type InputInviteTeammate

type InputInviteTeammate struct {
	Email   string   `json:"email"`
	IsAdmin bool     `json:"is_admin"`
	Scopes  []string `json:"scopes"`
}

type InputSendMail

type InputSendMail struct {
	Personalizations []*Personalization `json:"personalizations"`
	From             *Email             `json:"from"`
	ReplyTo          *ReplyTo           `json:"reply_to,omitempty"`
	ReplyToList      []*ReplyToList     `json:"reply_to_list,omitempty"`
	Subject          string             `json:"subject,omitempty"`
	Content          []*Content         `json:"content,omitempty"`
	Attachments      []*Attachment      `json:"attachments,omitempty"`
	TemplateID       string             `json:"template_id,omitempty"`
	Headers          map[string]string  `json:"headers,omitempty"`
	Categories       []string           `json:"categories,omitempty"`
	CustomArgs       map[string]string  `json:"custom_args,omitempty"`
	SendAt           int64              `json:"send_at,omitempty"`
	BatchID          string             `json:"batch_id,omitempty"`
	ASM              *ASM               `json:"asm,omitempty"`
	IPPoolName       string             `json:"ip_pool_name,omitempty"`
	MailSettings     *MailSettings      `json:"mail_settings,omitempty"`
	TrackingSettings *TrackingSettings  `json:"tracking_settings,omitempty"`
}

InputSendMail represents the request body for sending mail

func NewInputSendMail

func NewInputSendMail() *InputSendMail

NewInputSendMail creates a new InputSendMail struct

func (*InputSendMail) AddAttachment

func (m *InputSendMail) AddAttachment(attachment *Attachment)

AddAttachment adds an attachment to the mail

func (*InputSendMail) AddCategory

func (m *InputSendMail) AddCategory(category string)

AddCategory adds a category to the mail

func (*InputSendMail) AddContent

func (m *InputSendMail) AddContent(content *Content)

AddContent adds content to the mail

func (*InputSendMail) AddPersonalization

func (m *InputSendMail) AddPersonalization(personalization *Personalization)

AddPersonalization adds a personalization to the mail

func (*InputSendMail) SetFrom

func (m *InputSendMail) SetFrom(from *Email)

SetFrom sets the from email address

func (*InputSendMail) SetSendAt

func (m *InputSendMail) SetSendAt(sendAt time.Time)

SetSendAt sets the send time for the mail

func (*InputSendMail) SetSubject

func (m *InputSendMail) SetSubject(subject string)

SetSubject sets the email subject

func (*InputSendMail) SetTemplateID

func (m *InputSendMail) SetTemplateID(templateID string)

SetTemplateID sets the template ID for the mail

type InputSubuserAccess

type InputSubuserAccess struct {
	ID             int64    `json:"id,omitempty"`
	PermissionType string   `json:"permission_type,omitempty"`
	Scopes         []string `json:"scopes,omitempty"`
}

type InputToggleSignatureVerification

type InputToggleSignatureVerification struct {
	Enabled bool `json:"enabled"`
}

type InputUpdateAPIKeyName

type InputUpdateAPIKeyName struct {
	Name string `json:"name"`
}

type InputUpdateAPIKeyNameAndScopes

type InputUpdateAPIKeyNameAndScopes struct {
	Name   string   `json:"name"`
	Scopes []string `json:"scopes,omitempty"`
}

type InputUpdateAlert

type InputUpdateAlert struct {
	EmailTo    string `json:"email_to,omitempty"`
	Frequency  string `json:"frequency,omitempty"`
	Percentage int64  `json:"percentage,omitempty"`
}
type InputUpdateBrandedLink struct {
	Default bool `json:"default"`
}

type InputUpdateClickTrackingSettings

type InputUpdateClickTrackingSettings struct {
	Enabled bool `json:"enabled"`
}

type InputUpdateDesign

type InputUpdateDesign struct {
	Name                 string   `json:"name,omitempty"`
	HTMLContent          string   `json:"html_content,omitempty"`
	PlainContent         string   `json:"plain_content,omitempty"`
	GeneratePlainContent bool     `json:"generate_plain_content"`
	Subject              string   `json:"subject,omitempty"`
	Categories           []string `json:"categories,omitempty"`
}

type InputUpdateDomainAuthentication

type InputUpdateDomainAuthentication struct {
	Default   bool `json:"default"`
	CustomSpf bool `json:"custom_spf"`
}

type InputUpdateEnforceTLS

type InputUpdateEnforceTLS struct {
	RequireTLS       bool    `json:"require_tls"`
	RequireValidCert bool    `json:"require_valid_cert"`
	Version          float64 `json:"version,omitempty"`
}

type InputUpdateEventWebhook

type InputUpdateEventWebhook struct {
	Enabled           bool   `json:"enabled"`
	URL               string `json:"url,omitempty"`
	GroupResubscribe  bool   `json:"group_resubscribe"`
	Delivered         bool   `json:"delivered"`
	GroupUnsubscribe  bool   `json:"group_unsubscribe"`
	SpamReport        bool   `json:"spam_report"`
	Bounce            bool   `json:"bounce"`
	Deferred          bool   `json:"deferred"`
	Unsubscribe       bool   `json:"unsubscribe"`
	Processed         bool   `json:"processed"`
	Open              bool   `json:"open"`
	Click             bool   `json:"click"`
	Dropped           bool   `json:"dropped"`
	FriendlyName      string `json:"friendly_name,omitempty"`
	OAuthClientID     string `json:"oauth_client_id,omitempty"`
	OAuthClientSecret string `json:"oauth_client_secret,omitempty"`
	OAuthTokenURL     string `json:"oauth_token_url,omitempty"`
}

type InputUpdateGoogleAnalyticsSettings

type InputUpdateGoogleAnalyticsSettings struct {
	Enabled     bool   `json:"enabled"`
	UTMCampaign string `json:"utm_campaign,omitempty"`
	UTMContent  string `json:"utm_content,omitempty"`
	UTMMedium   string `json:"utm_medium,omitempty"`
	UTMSource   string `json:"utm_source,omitempty"`
	UTMTerm     string `json:"utm_term,omitempty"`
}

type InputUpdateInboundParseWebhook

type InputUpdateInboundParseWebhook struct {
	URL       string `json:"url,omitempty"`
	SpamCheck bool   `json:"spam_check"`
	SendRaw   bool   `json:"send_raw"`
}

type InputUpdateOpenTrackingSettings

type InputUpdateOpenTrackingSettings struct {
	Enabled bool `json:"enabled"`
}

type InputUpdateSSOCertificate

type InputUpdateSSOCertificate struct {
	PublicCertificate string `json:"public_certificate,omitempty"`
	Enabled           bool   `json:"enabled"`
	IntegrationID     string `json:"integration_id,omitempty"`
}

type InputUpdateSSOIntegration

type InputUpdateSSOIntegration struct {
	Name                 string `json:"name,omitempty"`
	Enabled              bool   `json:"enabled"`
	SigninURL            string `json:"signin_url,omitempty"`
	SignoutURL           string `json:"signout_url,omitempty"`
	EntityID             string `json:"entity_id,omitempty"`
	CompletedIntegration bool   `json:"completed_integration"`
}

type InputUpdateSSOTeammate

type InputUpdateSSOTeammate struct {
	FirstName                  string               `json:"first_name"`
	LastName                   string               `json:"last_name"`
	IsAdmin                    bool                 `json:"is_admin"`
	Persona                    string               `json:"persona,omitempty"`
	Scopes                     []string             `json:"scopes,omitempty"`
	HasRestrictedSubuserAccess bool                 `json:"has_restricted_subuser_access,omitempty"`
	SubuserAccess              []InputSubuserAccess `json:"subuser_access,omitempty"`
}

type InputUpdateSegment

type InputUpdateSegment struct {
	Name       string             `json:"name,omitempty"`
	Conditions []SegmentCondition `json:"conditions,omitempty"`
}

type InputUpdateSubscriptionTrackingSettings

type InputUpdateSubscriptionTrackingSettings struct {
	Enabled      bool   `json:"enabled"`
	HTMLContent  string `json:"html_content,omitempty"`
	Landing      string `json:"landing,omitempty"`
	PlainContent string `json:"plain_content,omitempty"`
	Replace      string `json:"replace,omitempty"`
	URL          string `json:"url,omitempty"`
}

type InputUpdateSubuserStatus

type InputUpdateSubuserStatus struct {
	Disabled bool `json:"disabled"`
}

type InputUpdateSuppressionGroup

type InputUpdateSuppressionGroup struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	IsDefault   bool   `json:"is_default"`
}

type InputUpdateTeammatePermissions

type InputUpdateTeammatePermissions struct {
	IsAdmin bool     `json:"is_admin"`
	Scopes  []string `json:"scopes"`
}

type InputUpdateTemplate

type InputUpdateTemplate struct {
	Name string `json:"name,omitempty"`
}

type InputUpdateTemplateVersion

type InputUpdateTemplateVersion struct {
	Active               int    `json:"active,omitempty"`
	Name                 string `json:"name,omitempty"`
	HTMLContent          string `json:"html_content,omitempty"`
	PlainContent         string `json:"plain_content,omitempty"`
	GeneratePlainContent bool   `json:"generate_plain_content"`
	Subject              string `json:"subject,omitempty"`
	Editor               string `json:"editor,omitempty"`
	TestData             string `json:"test_data,omitempty"`
}

type InputUpdateVerifiedSender

type InputUpdateVerifiedSender struct {
	Nickname    string `json:"nickname,omitempty"`
	FromEmail   string `json:"from_email,omitempty"`
	FromName    string `json:"from_name,omitempty"`
	ReplyTo     string `json:"reply_to,omitempty"`
	ReplyToName string `json:"reply_to_name,omitempty"`
	Address     string `json:"address,omitempty"`
	Address2    string `json:"address2,omitempty"`
	State       string `json:"state,omitempty"`
	City        string `json:"city,omitempty"`
	Zip         string `json:"zip,omitempty"`
	Country     string `json:"country,omitempty"`
}

type InvalidEmail

type InvalidEmail struct {
	Created int64  `json:"created"`
	Email   string `json:"email"`
	Reason  string `json:"reason"`
}

InvalidEmail represents an invalid email

type MailSettings

type MailSettings struct {
	BypassListManagement        *Setting          `json:"bypass_list_management,omitempty"`
	BypassSpamManagement        *Setting          `json:"bypass_spam_management,omitempty"`
	BypassBounceManagement      *Setting          `json:"bypass_bounce_management,omitempty"`
	BypassUnsubscribeManagement *Setting          `json:"bypass_unsubscribe_management,omitempty"`
	Footer                      *FooterSetting    `json:"footer,omitempty"`
	SandBoxMode                 *Setting          `json:"sandbox_mode,omitempty"`
	SpamCheck                   *SpamCheckSetting `json:"spam_check,omitempty"`
}

MailSettings contains various mail settings

type Member

type Member struct {
	Teammate

	Company string   `json:"company,omitempty"`
	IsSSO   bool     `json:"is_sso,omitempty"`
	Scopes  []string `json:"scopes,omitempty"`
}

consolidating normal teammate and SSO teammate fields

type Metadata

type Metadata struct {
	Prev  string `json:"prev,omitempty"`
	Self  string `json:"self,omitempty"`
	Next  string `json:"next,omitempty"`
	Count int    `json:"count,omitempty"`
}

type MetadataGetTeammateSubuserAccess

type MetadataGetTeammateSubuserAccess struct {
	NextParams NextParams `json:"next_params,omitempty"`
}

type NextParams

type NextParams struct {
	Limit          int64  `json:"limit"`
	AfterSubuserID int64  `json:"after_subuser_id,omitempty"`
	Username       string `json:"username,omitempty"`
}

type OpenTrackingSetting

type OpenTrackingSetting struct {
	Enable          *bool  `json:"enable,omitempty"`
	SubstitutionTag string `json:"substitution_tag,omitempty"`
}

OpenTrackingSetting represents open tracking settings

type Option

type Option func(*Client)

Option defines an option for a Client

type OutputActivateTemplateVersion

type OutputActivateTemplateVersion struct {
	ID                   string    `json:"id,omitempty"`
	TemplateID           string    `json:"template_id,omitempty"`
	Active               int       `json:"active,omitempty"`
	Name                 string    `json:"name,omitempty"`
	HTMLContent          string    `json:"html_content,omitempty"`
	PlainContent         string    `json:"plain_content,omitempty"`
	GeneratePlainContent bool      `json:"generate_plain_content,omitempty"`
	Subject              string    `json:"subject,omitempty"`
	Editor               string    `json:"editor,omitempty"`
	TestData             string    `json:"test_data,omitempty"`
	UpdatedAt            string    `json:"updated_at,omitempty"`
	Warnings             []Warning `json:"warnings,omitempty"`
	ThumbnailURL         string    `json:"thumbnail_url,omitempty"`
}

type OutputAddIPToAuthenticatedDomain

type OutputAddIPToAuthenticatedDomain struct {
	ID                      int64    `json:"id,omitempty"`
	UserID                  int64    `json:"user_id,omitempty"`
	Subdomain               string   `json:"subdomain,omitempty"`
	Domain                  string   `json:"domain,omitempty"`
	Username                string   `json:"username,omitempty"`
	IPs                     []string `json:"ips,omitempty"`
	CustomSpf               bool     `json:"custom_spf,omitempty"`
	Default                 bool     `json:"default,omitempty"`
	Legacy                  bool     `json:"legacy,omitempty"`
	AutomaticSecurity       bool     `json:"automatic_security,omitempty"`
	Valid                   bool     `json:"valid,omitempty"`
	DNS                     DNS      `json:"dns,omitempty"`
	LastValidationAttemptAt int64    `json:"last_validation_attempt_at,omitempty"`
}

type OutputAssignedIPs

type OutputAssignedIPs struct {
	IPs []string `json:"ips,omitempty"`
}

OutputAssignedIPs represents the response for assigned IPs

type OutputAssociateAuthenticatedDomainWithSubuser

type OutputAssociateAuthenticatedDomainWithSubuser struct {
	ID                      int64    `json:"id,omitempty"`
	UserID                  int64    `json:"user_id,omitempty"`
	Subdomain               string   `json:"subdomain,omitempty"`
	Domain                  string   `json:"domain,omitempty"`
	Username                string   `json:"username,omitempty"`
	IPs                     []string `json:"ips,omitempty"`
	CustomSpf               bool     `json:"custom_spf,omitempty"`
	Default                 bool     `json:"default,omitempty"`
	Legacy                  bool     `json:"legacy,omitempty"`
	AutomaticSecurity       bool     `json:"automatic_security,omitempty"`
	Valid                   bool     `json:"valid,omitempty"`
	DNS                     DNS      `json:"dns,omitempty"`
	LastValidationAttemptAt int64    `json:"last_validation_attempt_at,omitempty"`
}

type OutputAssociateBrandedLinkWithSubuser

type OutputAssociateBrandedLinkWithSubuser struct {
	ID        int64          `json:"id,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Subdomain string         `json:"subdomain,omitempty"`
	Username  string         `json:"username,omitempty"`
	UserID    int64          `json:"user_id,omitempty"`
	Default   bool           `json:"default,omitempty"`
	Valid     bool           `json:"valid,omitempty"`
	Legacy    bool           `json:"legacy,omitempty"`
	DNS       DNSBrandedLink `json:"dns,omitempty"`
}

type OutputAuthenticateDomain

type OutputAuthenticateDomain struct {
	ID                int64    `json:"id,omitempty"`
	UserID            int64    `json:"user_id,omitempty"`
	Subdomain         string   `json:"subdomain,omitempty"`
	Domain            string   `json:"domain,omitempty"`
	Username          string   `json:"username,omitempty"`
	IPs               []string `json:"ips,omitempty"`
	CustomSpf         bool     `json:"custom_spf,omitempty"`
	Default           bool     `json:"default,omitempty"`
	Legacy            bool     `json:"legacy,omitempty"`
	AutomaticSecurity bool     `json:"automatic_security,omitempty"`
	Valid             bool     `json:"valid,omitempty"`
	DNS               DNS      `json:"dns,omitempty"`
}

type OutputCompletedStepsVerifiedSender

type OutputCompletedStepsVerifiedSender struct {
	CompletedStepsVerifiedSender *CompletedStepsVerifiedSender `json:"results,omitempty"`
}

type OutputCreateAPIKey

type OutputCreateAPIKey struct {
	ApiKey   string   `json:"api_key,omitempty"`
	ApiKeyId string   `json:"api_key_id,omitempty"`
	Name     string   `json:"name,omitempty"`
	Scopes   []string `json:"scopes,omitempty"`
}

type OutputCreateAlert

type OutputCreateAlert struct {
	ID         int64  `json:"id,omitempty"`
	EmailTo    string `json:"email_to,omitempty"`
	Frequency  string `json:"frequency,omitempty"`
	Type       string `json:"type,omitempty"`
	Percentage int64  `json:"percentage,omitempty"`
	CreatedAt  int64  `json:"created_at,omitempty"`
	UpdatedAt  int64  `json:"updated_at,omitempty"`
}

type OutputCreateAllowlistRule

type OutputCreateAllowlistRule struct {
	Result []AllowlistRule `json:"result"`
}
type OutputCreateBrandedLink struct {
	ID        int64          `json:"id,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Subdomain string         `json:"subdomain,omitempty"`
	Username  string         `json:"username,omitempty"`
	UserID    int64          `json:"user_id,omitempty"`
	Default   bool           `json:"default,omitempty"`
	Valid     bool           `json:"valid,omitempty"`
	Legacy    bool           `json:"legacy,omitempty"`
	DNS       DNSBrandedLink `json:"dns,omitempty"`
}

type OutputCreateDesign

type OutputCreateDesign struct {
	ID                   string   `json:"id,omitempty"`
	UpdatedAt            string   `json:"updated_at,omitempty"`
	CreatedAt            string   `json:"created_at,omitempty"`
	ThumbnailURL         string   `json:"thumbnail_url,omitempty"`
	Name                 string   `json:"name,omitempty"`
	Editor               string   `json:"editor,omitempty"`
	HTMLContent          string   `json:"html_content,omitempty"`
	PlainContent         string   `json:"plain_content,omitempty"`
	GeneratePlainContent bool     `json:"generate_plain_content,omitempty"`
	Subject              string   `json:"subject,omitempty"`
	Categories           []string `json:"categories,omitempty"`
}

type OutputCreateEventWebhook

type OutputCreateEventWebhook struct {
	ID                  string `json:"id,omitempty"`
	Enabled             bool   `json:"enabled,omitempty"`
	URL                 string `json:"url,omitempty"`
	AccountStatusChange bool   `json:"account_status_change,omitempty"`
	GroupResubscribe    bool   `json:"group_resubscribe,omitempty"`
	Delivered           bool   `json:"delivered,omitempty"`
	GroupUnsubscribe    bool   `json:"group_unsubscribe,omitempty"`
	SpamReport          bool   `json:"spam_report,omitempty"`
	Bounce              bool   `json:"bounce,omitempty"`
	Deferred            bool   `json:"deferred,omitempty"`
	Unsubscribe         bool   `json:"unsubscribe,omitempty"`
	Processed           bool   `json:"processed,omitempty"`
	Open                bool   `json:"open,omitempty"`
	Click               bool   `json:"click,omitempty"`
	Dropped             bool   `json:"dropped,omitempty"`
	FriendlyName        string `json:"friendly_name,omitempty"`
	CreatedDate         string `json:"created_date,omitempty"`
	UpdatedDate         string `json:"updated_date,omitempty"`
	OAuthClientID       string `json:"oauth_client_id,omitempty"`
	OAuthTokenURL       string `json:"oauth_token_url,omitempty"`
}

type OutputCreateInboundParseWebhook

type OutputCreateInboundParseWebhook struct {
	URL       string `json:"url,omitempty"`
	Hostname  string `json:"hostname,omitempty"`
	SpamCheck bool   `json:"spam_check,omitempty"`
	SendRaw   bool   `json:"send_raw,omitempty"`
}

type OutputCreateReverseDNS

type OutputCreateReverseDNS struct {
	ID                      int64   `json:"id,omitempty"`
	IP                      string  `json:"ip,omitempty"`
	RDNS                    string  `json:"rdns,omitempty"`
	Users                   []*User `json:"users,omitempty"`
	Subdomain               string  `json:"subdomain,omitempty"`
	Domain                  string  `json:"domain,omitempty"`
	Valid                   bool    `json:"valid,omitempty"`
	Legacy                  bool    `json:"legacy,omitempty"`
	LastValidationAttemptAt int64   `json:"last_validation_attempt_at,omitempty"`
	ARecord                 ARecord `json:"a_record,omitempty"`
}

type OutputCreateSSOCertificate

type OutputCreateSSOCertificate struct {
	ID                int64  `json:"id,omitempty"`
	PublicCertificate string `json:"public_certificate,omitempty"`
	NotBefore         int64  `json:"not_before,omitempty"`
	NotAfter          int64  `json:"not_after,omitempty"`
	IntegrationID     string `json:"integration_id,omitempty"`
}

type OutputCreateSSOIntegration

type OutputCreateSSOIntegration struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Enabled              bool   `json:"enabled,omitempty"`
	SigninURL            string `json:"signin_url,omitempty"`
	SignoutURL           string `json:"signout_url,omitempty"`
	EntityID             string `json:"entity_id,omitempty"`
	CompletedIntegration bool   `json:"completed_integration,omitempty"`
	LastUpdated          int64  `json:"last_updated,omitempty"`
	SingleSignonURL      string `json:"single_signon_url,omitempty"`
	AudienceURL          string `json:"audience_url,omitempty"`
}

type OutputCreateSSOTeammate

type OutputCreateSSOTeammate struct {
	FirstName                  string                `json:"first_name,omitempty"`
	LastName                   string                `json:"last_name,omitempty"`
	Email                      string                `json:"email,omitempty"`
	IsAdmin                    bool                  `json:"is_admin,omitempty"`
	IsSSO                      bool                  `json:"is_sso,omitempty"`
	Scopes                     []string              `json:"scopes,omitempty"`
	HasRestrictedSubuserAccess bool                  `json:"has_restricted_subuser_access,omitempty"`
	SubuserAccess              []OutputSubuserAccess `json:"subuser_access,omitempty"`
}

type OutputCreateSubuser

type OutputCreateSubuser struct {
	UserID             int64            `json:"user_id"`
	Username           string           `json:"username"`
	Email              string           `json:"email"`
	SignupSessionToken string           `json:"signup_session_token"`
	AuthorizationToken string           `json:"authorization_token"`
	CreditAllocation   CreditAllocation `json:"credit_allocation"`
}

type OutputCreateSuppressionGroup

type OutputCreateSuppressionGroup struct {
	ID          int64  `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	IsDefault   bool   `json:"is_default,omitempty"`
}

type OutputCreateTemplate

type OutputCreateTemplate struct {
	ID         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Generation string    `json:"generation,omitempty"`
	UpdatedAt  string    `json:"updated_at,omitempty"`
	Versions   []Version `json:"versions,omitempty"`
	Warning    Warning   `json:"warning,omitempty"`
}

type OutputCreateTemplateVersion

type OutputCreateTemplateVersion struct {
	ID                   string    `json:"id,omitempty"`
	TemplateID           string    `json:"template_id,omitempty"`
	Active               int       `json:"active,omitempty"`
	Name                 string    `json:"name,omitempty"`
	HTMLContent          string    `json:"html_content,omitempty"`
	PlainContent         string    `json:"plain_content,omitempty"`
	GeneratePlainContent bool      `json:"generate_plain_content,omitempty"`
	Subject              string    `json:"subject,omitempty"`
	Editor               string    `json:"editor,omitempty"`
	TestData             string    `json:"test_data,omitempty"`
	UpdatedAt            string    `json:"updated_at,omitempty"`
	Warnings             []Warning `json:"warnings,omitempty"`
	ThumbnailURL         string    `json:"thumbnail_url,omitempty"`
}

type OutputCreateVerifiedSenderRequest

type OutputCreateVerifiedSenderRequest struct {
	ID          int64  `json:"id,omitempty"`
	Nickname    string `json:"nickname,omitempty"`
	FromEmail   string `json:"from_email,omitempty"`
	FromName    string `json:"from_name,omitempty"`
	ReplyTo     string `json:"reply_to,omitempty"`
	ReplyToName string `json:"reply_to_name,omitempty"`
	Address     string `json:"address,omitempty"`
	Address2    string `json:"address2,omitempty"`
	State       string `json:"state,omitempty"`
	City        string `json:"city,omitempty"`
	Zip         string `json:"zip,omitempty"`
	Country     string `json:"country,omitempty"`
	Verified    bool   `json:"verified,omitempty"`
	Locked      bool   `json:"locked,omitempty"`
}

type OutputDuplicateTemplate

type OutputDuplicateTemplate struct {
	ID         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Generation string    `json:"generation,omitempty"`
	UpdatedAt  string    `json:"updated_at,omitempty"`
	Versions   []Version `json:"versions,omitempty"`
	Warning    Warning   `json:"warning,omitempty"`
}

type OutputGetAPIKey

type OutputGetAPIKey struct {
	ApiKeyId string   `json:"api_key_id,omitempty"`
	Name     string   `json:"name,omitempty"`
	Scopes   []string `json:"scopes,omitempty"`
}

type OutputGetAPIKeys

type OutputGetAPIKeys struct {
	APIKeys []APIKey `json:"result,omitempty"`
}

type OutputGetAlert

type OutputGetAlert struct {
	ID         int64  `json:"id,omitempty"`
	EmailTo    string `json:"email_to,omitempty"`
	Frequency  string `json:"frequency,omitempty"`
	Type       string `json:"type,omitempty"`
	Percentage int64  `json:"percentage,omitempty"`
	CreatedAt  int64  `json:"created_at,omitempty"`
	UpdatedAt  int64  `json:"updated_at,omitempty"`
}

type OutputGetAllowlistRule

type OutputGetAllowlistRule struct {
	Result AllowlistRule `json:"result"`
}

type OutputGetAuthenticatedDomain

type OutputGetAuthenticatedDomain struct {
	ID                int64    `json:"id,omitempty"`
	UserID            int64    `json:"user_id,omitempty"`
	Subdomain         string   `json:"subdomain,omitempty"`
	Domain            string   `json:"domain,omitempty"`
	Username          string   `json:"username,omitempty"`
	IPs               []string `json:"ips,omitempty"`
	CustomSpf         bool     `json:"custom_spf,omitempty"`
	Default           bool     `json:"default,omitempty"`
	Legacy            bool     `json:"legacy,omitempty"`
	AutomaticSecurity bool     `json:"automatic_security,omitempty"`
	Valid             bool     `json:"valid,omitempty"`
	DNS               DNS      `json:"dns,omitempty"`
}

type OutputGetAuthenticatedDomainAssociatedWithSubuser

type OutputGetAuthenticatedDomainAssociatedWithSubuser struct {
	ID                      int64    `json:"id,omitempty"`
	UserID                  int64    `json:"user_id,omitempty"`
	Subdomain               string   `json:"subdomain,omitempty"`
	Domain                  string   `json:"domain,omitempty"`
	Username                string   `json:"username,omitempty"`
	IPs                     []string `json:"ips,omitempty"`
	CustomSpf               bool     `json:"custom_spf,omitempty"`
	Default                 bool     `json:"default,omitempty"`
	Legacy                  bool     `json:"legacy,omitempty"`
	AutomaticSecurity       bool     `json:"automatic_security,omitempty"`
	Valid                   bool     `json:"valid,omitempty"`
	DNS                     DNS      `json:"dns,omitempty"`
	LastValidationAttemptAt int64    `json:"last_validation_attempt_at,omitempty"`
}

type OutputGetBlocks

type OutputGetBlocks struct {
	Blocks []Block `json:"blocks,omitempty"`
}

OutputGetBlocks represents the response for blocks list

type OutputGetBounces

type OutputGetBounces struct {
	Bounces []Bounce `json:"bounces,omitempty"`
}

OutputGetBounces represents the response for bounces list

type OutputGetBrandedLink struct {
	ID        int64          `json:"id,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Subdomain string         `json:"subdomain,omitempty"`
	Username  string         `json:"username,omitempty"`
	UserID    int64          `json:"user_id,omitempty"`
	Default   bool           `json:"default,omitempty"`
	Valid     bool           `json:"valid,omitempty"`
	Legacy    bool           `json:"legacy,omitempty"`
	DNS       DNSBrandedLink `json:"dns,omitempty"`
}

type OutputGetClickTrackingSettings

type OutputGetClickTrackingSettings struct {
	EnableText bool `json:"enable_text,omitempty"`
	Enabled    bool `json:"enabled,omitempty"`
}

type OutputGetDefaultAuthentication

type OutputGetDefaultAuthentication struct {
	ID                      int64                         `json:"id,omitempty"`
	UserID                  int64                         `json:"user_id,omitempty"`
	Subdomain               string                        `json:"subdomain,omitempty"`
	Domain                  string                        `json:"domain,omitempty"`
	Username                string                        `json:"username,omitempty"`
	IPs                     []string                      `json:"ips,omitempty"`
	CustomSpf               bool                          `json:"custom_spf,omitempty"`
	Default                 bool                          `json:"default,omitempty"`
	Legacy                  bool                          `json:"legacy,omitempty"`
	AutomaticSecurity       bool                          `json:"automatic_security,omitempty"`
	Valid                   bool                          `json:"valid,omitempty"`
	DNS                     DNS                           `json:"dns,omitempty"`
	Subusers                []SubuserSenderAuthentication `json:"subusers,omitempty"`
	LastValidationAttemptAt int64                         `json:"last_validation_attempt_at,omitempty"`
}
type OutputGetDefaultBrandedLink struct {
	ID        int64          `json:"id,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Subdomain string         `json:"subdomain,omitempty"`
	Username  string         `json:"username,omitempty"`
	UserID    int64          `json:"user_id,omitempty"`
	Default   bool           `json:"default,omitempty"`
	Valid     bool           `json:"valid,omitempty"`
	Legacy    bool           `json:"legacy,omitempty"`
	DNS       DNSBrandedLink `json:"dns,omitempty"`
}

type OutputGetDesign

type OutputGetDesign struct {
	ID                   string   `json:"id,omitempty"`
	UpdatedAt            string   `json:"updated_at,omitempty"`
	CreatedAt            string   `json:"created_at,omitempty"`
	ThumbnailURL         string   `json:"thumbnail_url,omitempty"`
	Name                 string   `json:"name,omitempty"`
	Editor               string   `json:"editor,omitempty"`
	HTMLContent          string   `json:"html_content,omitempty"`
	PlainContent         string   `json:"plain_content,omitempty"`
	GeneratePlainContent bool     `json:"generate_plain_content,omitempty"`
	Subject              string   `json:"subject,omitempty"`
	Categories           []string `json:"categories,omitempty"`
}

type OutputGetDesigns

type OutputGetDesigns struct {
	Result   []*Design `json:"result,omitempty"`
	Metadata _Metadata `json:"_metadata,omitempty"`
}

type OutputGetEnforceTLS

type OutputGetEnforceTLS struct {
	RequireTLS       bool    `json:"require_tls,omitempty"`
	RequireValidCert bool    `json:"require_valid_cert,omitempty"`
	Version          float64 `json:"version,omitempty"`
}

type OutputGetEventWebhook

type OutputGetEventWebhook struct {
	ID               string `json:"id,omitempty"`
	Enabled          bool   `json:"enabled,omitempty"`
	URL              string `json:"url,omitempty"`
	GroupResubscribe bool   `json:"group_resubscribe,omitempty"`
	Delivered        bool   `json:"delivered,omitempty"`
	GroupUnsubscribe bool   `json:"group_unsubscribe,omitempty"`
	SpamReport       bool   `json:"spam_report,omitempty"`
	Bounce           bool   `json:"bounce,omitempty"`
	Deferred         bool   `json:"deferred,omitempty"`
	Unsubscribe      bool   `json:"unsubscribe,omitempty"`
	Processed        bool   `json:"processed,omitempty"`
	Open             bool   `json:"open,omitempty"`
	Click            bool   `json:"click,omitempty"`
	Dropped          bool   `json:"dropped,omitempty"`
	FriendlyName     string `json:"friendly_name,omitempty"`
	OAuthClientID    string `json:"oauth_client_id,omitempty"`
	OAuthTokenURL    string `json:"oauth_token_url,omitempty"`
	PublicKey        string `json:"public_key,omitempty"`
}

type OutputGetEventWebhooks

type OutputGetEventWebhooks struct {
	MaxAllowed int             `json:"max_allowed,omitempty"`
	Webhooks   []*EventWebhook `json:"webhooks,omitempty"`
}

type OutputGetGoogleAnalyticsSettings

type OutputGetGoogleAnalyticsSettings struct {
	Enabled     bool   `json:"enabled,omitempty"`
	UTMCampaign string `json:"utm_campaign,omitempty"`
	UTMContent  string `json:"utm_content,omitempty"`
	UTMMedium   string `json:"utm_medium,omitempty"`
	UTMSource   string `json:"utm_source,omitempty"`
	UTMTerm     string `json:"utm_term,omitempty"`
}

type OutputGetInboundParseWebhook

type OutputGetInboundParseWebhook struct {
	URL       string `json:"url,omitempty"`
	Hostname  string `json:"hostname,omitempty"`
	SpamCheck bool   `json:"spam_check,omitempty"`
	SendRaw   bool   `json:"send_raw,omitempty"`
}

type OutputGetInboundParseWebhooks

type OutputGetInboundParseWebhooks struct {
	Result []*InboundParseWebhook `json:"result,omitempty"`
}

type OutputGetInvalidEmails

type OutputGetInvalidEmails struct {
	InvalidEmails []InvalidEmail `json:"invalid_emails,omitempty"`
}

OutputGetInvalidEmails represents the response for invalid emails list

type OutputGetOpenTrackingSettings

type OutputGetOpenTrackingSettings struct {
	Enabled bool `json:"enabled,omitempty"`
}

type OutputGetPendingTeammates

type OutputGetPendingTeammates struct {
	PendingTeammates []PendingTeammate `json:"result,omitempty"`
}

type OutputGetReverseDNS

type OutputGetReverseDNS struct {
	ID                      int64   `json:"id,omitempty"`
	IP                      string  `json:"ip,omitempty"`
	RDNS                    string  `json:"rdns,omitempty"`
	Users                   []*User `json:"users,omitempty"`
	Subdomain               string  `json:"subdomain,omitempty"`
	Domain                  string  `json:"domain,omitempty"`
	Valid                   bool    `json:"valid,omitempty"`
	Legacy                  bool    `json:"legacy,omitempty"`
	LastValidationAttemptAt int64   `json:"last_validation_attempt_at,omitempty"`
	ARecord                 ARecord `json:"a_record,omitempty"`
}

type OutputGetSSOCertificate

type OutputGetSSOCertificate struct {
	ID                int64  `json:"id,omitempty"`
	PublicCertificate string `json:"public_certificate,omitempty"`
	NotBefore         int64  `json:"not_before,omitempty"`
	NotAfter          int64  `json:"not_after,omitempty"`
	IntegrationID     string `json:"integration_id,omitempty"`
}

type OutputGetSSOIntegration

type OutputGetSSOIntegration struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Enabled              bool   `json:"enabled,omitempty"`
	SigninURL            string `json:"signin_url,omitempty"`
	SignoutURL           string `json:"signout_url,omitempty"`
	EntityID             string `json:"entity_id,omitempty"`
	CompletedIntegration bool   `json:"completed_integration,omitempty"`
	LastUpdated          int64  `json:"last_updated,omitempty"`
	SingleSignonURL      string `json:"single_signon_url,omitempty"`
	AudienceURL          string `json:"audience_url,omitempty"`
}

type OutputGetSignedEventWebhooksPublicKey

type OutputGetSignedEventWebhooksPublicKey struct {
	PublicKey string `json:"public_key,omitempty"`
}

type OutputGetSpamReports

type OutputGetSpamReports struct {
	SpamReports []SpamReport `json:"spam_reports,omitempty"`
}

OutputGetSpamReports represents the response for spam reports list

type OutputGetSubscriptionTrackingSettings

type OutputGetSubscriptionTrackingSettings struct {
	Enabled      bool   `json:"enabled,omitempty"`
	HTMLContent  string `json:"html_content,omitempty"`
	Landing      string `json:"landing,omitempty"`
	PlainContent string `json:"plain_content,omitempty"`
	Replace      string `json:"replace,omitempty"`
	URL          string `json:"url,omitempty"`
}
type OutputGetSubuserBrandedLink struct {
	ID        int64          `json:"id,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Subdomain string         `json:"subdomain,omitempty"`
	Username  string         `json:"username,omitempty"`
	UserID    int64          `json:"user_id,omitempty"`
	Default   bool           `json:"default,omitempty"`
	Valid     bool           `json:"valid,omitempty"`
	Legacy    bool           `json:"legacy,omitempty"`
	DNS       DNSBrandedLink `json:"dns,omitempty"`
}

type OutputGetTeammate

type OutputGetTeammate struct {
	Username  string   `json:"username,omitempty"`
	FirstName string   `json:"first_name,omitempty"`
	LastName  string   `json:"last_name,omitempty"`
	Email     string   `json:"email,omitempty"`
	Scopes    []string `json:"scopes,omitempty"`
	UserType  string   `json:"user_type,omitempty"`
	IsAdmin   bool     `json:"is_admin,omitempty"`
	Phone     string   `json:"phone,omitempty"`
	Website   string   `json:"website,omitempty"`
	Address   string   `json:"address,omitempty"`
	Address2  string   `json:"address2,omitempty"`
	City      string   `json:"city,omitempty"`
	State     string   `json:"state,omitempty"`
	Zip       string   `json:"zip,omitempty"`
	Country   string   `json:"country,omitempty"`
}

type OutputGetTeammateSubuserAccess

type OutputGetTeammateSubuserAccess struct {
	HasRestrictedSubuserAccess bool                             `json:"has_restricted_subuser_access,omitempty"`
	SubuserAccess              []SubuserAccess                  `json:"subuser_access,omitempty"`
	Metadata                   MetadataGetTeammateSubuserAccess `json:"_metadata,omitempty"`
}

type OutputGetTeammates

type OutputGetTeammates struct {
	Teammates []Teammate `json:"result,omitempty"`
}

type OutputGetTemplate

type OutputGetTemplate struct {
	ID         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Generation string    `json:"generation,omitempty"`
	UpdatedAt  string    `json:"updated_at,omitempty"`
	Versions   []Version `json:"versions,omitempty"`
	Warning    Warning   `json:"warning,omitempty"`
}

type OutputGetTemplateVersion

type OutputGetTemplateVersion struct {
	ID                   string  `json:"id,omitempty"`
	TemplateID           string  `json:"template_id,omitempty"`
	Active               int     `json:"active,omitempty"`
	Name                 string  `json:"name,omitempty"`
	HTMLContent          string  `json:"html_content,omitempty"`
	PlainContent         string  `json:"plain_content,omitempty"`
	GeneratePlainContent bool    `json:"generate_plain_content,omitempty"`
	Subject              string  `json:"subject,omitempty"`
	Editor               string  `json:"editor,omitempty"`
	TestData             string  `json:"test_data,omitempty"`
	UpdatedAt            string  `json:"updated_at,omitempty"`
	Warnings             Warning `json:"warnings,omitempty"`
	ThumbnailURL         string  `json:"thumbnail_url,omitempty"`
}

type OutputGetTemplates

type OutputGetTemplates struct {
	Templates []Template `json:"result,omitempty"`
	Metadata  Metadata   `json:"_metadata,omitempty"`
}

type OutputGetTrackingSettings

type OutputGetTrackingSettings struct {
	Result []*ResultGetTrackingSettings `json:"result,omitempty"`
}

type OutputGetVerifiedSenders

type OutputGetVerifiedSenders struct {
	VerifiedSenders []*VerifiedSender `json:"results,omitempty"`
}

type OutputInviteTeammate

type OutputInviteTeammate struct {
	Token   string   `json:"token,omitempty"`
	Email   string   `json:"email"`
	IsAdmin bool     `json:"is_admin"`
	Scopes  []string `json:"scopes"`
}

type OutputSendMail

type OutputSendMail struct {
	MessageID string `json:"message-id,omitempty"`
}

OutputSendMail represents the response from sending mail

type OutputSubuserAccess

type OutputSubuserAccess struct {
	ID             int64    `json:"id,omitempty"`
	Username       string   `json:"username,omitempty"`
	Email          string   `json:"email,omitempty"`
	Disabled       bool     `json:"disabled,omitempty"`
	PermissionType string   `json:"permission_type,omitempty"`
	Scopes         []string `json:"scopes,omitempty"`
}

type OutputToggleSignatureVerification

type OutputToggleSignatureVerification struct {
	ID        string `json:"id,omitempty"`
	PublicKey string `json:"public_key,omitempty"`
}

type OutputUpdateAPIKeyName

type OutputUpdateAPIKeyName struct {
	ApiKeyId string `json:"api_key_id,omitempty"`
	Name     string `json:"name,omitempty"`
}

type OutputUpdateAPIKeyNameAndScopes

type OutputUpdateAPIKeyNameAndScopes struct {
	ApiKeyId string   `json:"api_key_id,omitempty"`
	Name     string   `json:"name"`
	Scopes   []string `json:"scopes,omitempty"`
}

type OutputUpdateAlert

type OutputUpdateAlert struct {
	ID         int64  `json:"id,omitempty"`
	EmailTo    string `json:"email_to,omitempty"`
	Frequency  string `json:"frequency,omitempty"`
	Type       string `json:"type,omitempty"`
	Percentage int64  `json:"percentage,omitempty"`
	CreatedAt  int64  `json:"created_at,omitempty"`
	UpdatedAt  int64  `json:"updated_at,omitempty"`
}
type OutputUpdateBrandedLink struct {
	ID        int64          `json:"id,omitempty"`
	Domain    string         `json:"domain,omitempty"`
	Subdomain string         `json:"subdomain,omitempty"`
	Username  string         `json:"username,omitempty"`
	UserID    int64          `json:"user_id,omitempty"`
	Default   bool           `json:"default,omitempty"`
	Valid     bool           `json:"valid,omitempty"`
	Legacy    bool           `json:"legacy,omitempty"`
	DNS       DNSBrandedLink `json:"dns,omitempty"`
}

type OutputUpdateClickTrackingSettings

type OutputUpdateClickTrackingSettings struct {
	EnableText bool `json:"enable_text,omitempty"`
	Enabled    bool `json:"enabled,omitempty"`
}

type OutputUpdateDesign

type OutputUpdateDesign struct {
	ID                   string   `json:"id,omitempty"`
	UpdatedAt            string   `json:"updated_at,omitempty"`
	CreatedAt            string   `json:"created_at,omitempty"`
	ThumbnailURL         string   `json:"thumbnail_url,omitempty"`
	Name                 string   `json:"name,omitempty"`
	Editor               string   `json:"editor,omitempty"`
	HTMLContent          string   `json:"html_content,omitempty"`
	PlainContent         string   `json:"plain_content,omitempty"`
	GeneratePlainContent bool     `json:"generate_plain_content,omitempty"`
	Subject              string   `json:"subject,omitempty"`
	Categories           []string `json:"categories,omitempty"`
}

type OutputUpdateDomainAuthentication

type OutputUpdateDomainAuthentication struct {
	ID                      int64                         `json:"id,omitempty"`
	UserID                  int64                         `json:"user_id,omitempty"`
	Subdomain               string                        `json:"subdomain,omitempty"`
	Domain                  string                        `json:"domain,omitempty"`
	Username                string                        `json:"username,omitempty"`
	IPs                     []string                      `json:"ips,omitempty"`
	CustomSpf               bool                          `json:"custom_spf,omitempty"`
	Default                 bool                          `json:"default,omitempty"`
	Legacy                  bool                          `json:"legacy,omitempty"`
	AutomaticSecurity       bool                          `json:"automatic_security,omitempty"`
	Valid                   bool                          `json:"valid,omitempty"`
	DNS                     DNS                           `json:"dns,omitempty"`
	Subusers                []SubuserSenderAuthentication `json:"subusers,omitempty"`
	LastValidationAttemptAt int64                         `json:"last_validation_attempt_at,omitempty"`
}

type OutputUpdateEnforceTLS

type OutputUpdateEnforceTLS struct {
	RequireTLS       bool    `json:"require_tls,omitempty"`
	RequireValidCert bool    `json:"require_valid_cert,omitempty"`
	Version          float64 `json:"version,omitempty"`
}

type OutputUpdateEventWebhook

type OutputUpdateEventWebhook struct {
	ID               string `json:"id,omitempty"`
	Enabled          bool   `json:"enabled,omitempty"`
	URL              string `json:"url,omitempty"`
	GroupResubscribe bool   `json:"group_resubscribe,omitempty"`
	Delivered        bool   `json:"delivered,omitempty"`
	GroupUnsubscribe bool   `json:"group_unsubscribe,omitempty"`
	SpamReport       bool   `json:"spam_report,omitempty"`
	Bounce           bool   `json:"bounce,omitempty"`
	Deferred         bool   `json:"deferred,omitempty"`
	Unsubscribe      bool   `json:"unsubscribe,omitempty"`
	Processed        bool   `json:"processed,omitempty"`
	Open             bool   `json:"open,omitempty"`
	Click            bool   `json:"click,omitempty"`
	Dropped          bool   `json:"dropped,omitempty"`
	FriendlyName     string `json:"friendly_name,omitempty"`
	CreatedDate      string `json:"created_date,omitempty"`
	UpdatedDate      string `json:"updated_date,omitempty"`
	OAuthClientID    string `json:"oauth_client_id,omitempty"`
	OAuthTokenURL    string `json:"oauth_token_url,omitempty"`
}

type OutputUpdateGoogleAnalyticsSettings

type OutputUpdateGoogleAnalyticsSettings struct {
	Enabled     bool   `json:"enabled,omitempty"`
	UTMCampaign string `json:"utm_campaign,omitempty"`
	UTMContent  string `json:"utm_content,omitempty"`
	UTMMedium   string `json:"utm_medium,omitempty"`
	UTMSource   string `json:"utm_source,omitempty"`
	UTMTerm     string `json:"utm_term,omitempty"`
}

type OutputUpdateInboundParseWebhook

type OutputUpdateInboundParseWebhook struct {
	URL       string `json:"url,omitempty"`
	Hostname  string `json:"hostname,omitempty"`
	SpamCheck bool   `json:"spam_check,omitempty"`
	SendRaw   bool   `json:"send_raw,omitempty"`
}

type OutputUpdateOpenTrackingSettings

type OutputUpdateOpenTrackingSettings struct {
	Enabled bool `json:"enabled,omitempty"`
}

type OutputUpdateSSOCertificate

type OutputUpdateSSOCertificate struct {
	ID                int64  `json:"id,omitempty"`
	PublicCertificate string `json:"public_certificate,omitempty"`
	NotBefore         int64  `json:"not_before,omitempty"`
	NotAfter          int64  `json:"not_after,omitempty"`
	IntegrationID     string `json:"integration_id,omitempty"`
}

type OutputUpdateSSOIntegration

type OutputUpdateSSOIntegration struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Enabled              bool   `json:"enabled,omitempty"`
	SigninURL            string `json:"signin_url,omitempty"`
	SignoutURL           string `json:"signout_url,omitempty"`
	EntityID             string `json:"entity_id,omitempty"`
	CompletedIntegration bool   `json:"completed_integration,omitempty"`
	LastUpdated          int64  `json:"last_updated,omitempty"`
	SingleSignonURL      string `json:"single_signon_url,omitempty"`
	AudienceURL          string `json:"audience_url,omitempty"`
}

type OutputUpdateSSOTeammate

type OutputUpdateSSOTeammate struct {
	Address                    string                `json:"address,omitempty"`
	Address2                   string                `json:"address2,omitempty"`
	City                       string                `json:"city,omitempty"`
	Company                    string                `json:"company,omitempty"`
	Country                    string                `json:"country,omitempty"`
	Username                   string                `json:"username,omitempty"`
	Phone                      string                `json:"phone,omitempty"`
	State                      string                `json:"state,omitempty"`
	UserType                   string                `json:"user_type,omitempty"`
	Website                    string                `json:"website,omitempty"`
	Zip                        string                `json:"zip,omitempty"`
	FirstName                  string                `json:"first_name,omitempty"`
	LastName                   string                `json:"last_name,omitempty"`
	Email                      string                `json:"email,omitempty"`
	IsAdmin                    bool                  `json:"is_admin,omitempty"`
	IsSSO                      bool                  `json:"is_sso,omitempty"`
	Scopes                     []string              `json:"scopes,omitempty"`
	HasRestrictedSubuserAccess bool                  `json:"has_restricted_subuser_access,omitempty"`
	SubuserAccess              []OutputSubuserAccess `json:"subuser_access,omitempty"`
}

type OutputUpdateSubscriptionTrackingSettings

type OutputUpdateSubscriptionTrackingSettings struct {
	Enabled      bool   `json:"enabled,omitempty"`
	HTMLContent  string `json:"html_content,omitempty"`
	Landing      string `json:"landing,omitempty"`
	PlainContent string `json:"plain_content,omitempty"`
	Replace      string `json:"replace,omitempty"`
	URL          string `json:"url,omitempty"`
}

type OutputUpdateSuppressionGroup

type OutputUpdateSuppressionGroup struct {
	ID              int64  `json:"id,omitempty"`
	Name            string `json:"name,omitempty"`
	Description     string `json:"description,omitempty"`
	IsDefault       bool   `json:"is_default,omitempty"`
	LastEmailSentAt string `json:"last_email_sent_at,omitempty"`
	Unsubscribes    int64  `json:"unsubscribes,omitempty"`
}

type OutputUpdateTeammatePermissions

type OutputUpdateTeammatePermissions struct {
	Username  string   `json:"username,omitempty"`
	FirstName string   `json:"first_name,omitempty"`
	LastName  string   `json:"last_name,omitempty"`
	Email     string   `json:"email,omitempty"`
	Scopes    []string `json:"scopes,omitempty"`
	UserType  string   `json:"user_type,omitempty"`
	IsAdmin   bool     `json:"is_admin,omitempty"`
	Phone     string   `json:"phone,omitempty"`
	Website   string   `json:"website,omitempty"`
	Address   string   `json:"address,omitempty"`
	Address2  string   `json:"address2,omitempty"`
	City      string   `json:"city,omitempty"`
	State     string   `json:"state,omitempty"`
	Zip       string   `json:"zip,omitempty"`
	Country   string   `json:"country,omitempty"`
}

type OutputUpdateTemplate

type OutputUpdateTemplate struct {
	ID         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Generation string    `json:"generation,omitempty"`
	UpdatedAt  string    `json:"updated_at,omitempty"`
	Versions   []Version `json:"versions,omitempty"`
}

type OutputUpdateTemplateVersion

type OutputUpdateTemplateVersion struct {
	ID                   string    `json:"id,omitempty"`
	TemplateID           string    `json:"template_id,omitempty"`
	Active               int       `json:"active,omitempty"`
	Name                 string    `json:"name,omitempty"`
	HTMLContent          string    `json:"html_content,omitempty"`
	PlainContent         string    `json:"plain_content,omitempty"`
	GeneratePlainContent bool      `json:"generate_plain_content,omitempty"`
	Subject              string    `json:"subject,omitempty"`
	Editor               string    `json:"editor,omitempty"`
	TestData             string    `json:"test_data,omitempty"`
	UpdatedAt            string    `json:"updated_at,omitempty"`
	Warnings             []Warning `json:"warnings,omitempty"`
	ThumbnailURL         string    `json:"thumbnail_url,omitempty"`
}

type OutputUpdateVerifiedSender

type OutputUpdateVerifiedSender struct {
	ID          int64  `json:"id,omitempty"`
	Nickname    string `json:"nickname,omitempty"`
	FromEmail   string `json:"from_email,omitempty"`
	FromName    string `json:"from_name,omitempty"`
	ReplyTo     string `json:"reply_to,omitempty"`
	ReplyToName string `json:"reply_to_name,omitempty"`
	Address     string `json:"address,omitempty"`
	Address2    string `json:"address2,omitempty"`
	State       string `json:"state,omitempty"`
	City        string `json:"city,omitempty"`
	Zip         string `json:"zip,omitempty"`
	Country     string `json:"country,omitempty"`
	Verified    bool   `json:"verified,omitempty"`
	Locked      bool   `json:"locked,omitempty"`
}
type OutputValidateBrandedLink struct {
	ID                int64                        `json:"id,omitempty"`
	Valid             bool                         `json:"valid,omitempty"`
	ValidationResults ValidationResultsBrandedLink `json:"validation_results,omitempty"`
}

type OutputValidateDomainAuthentication

type OutputValidateDomainAuthentication struct {
	ID                int64             `json:"id,omitempty"`
	Valid             bool              `json:"valid,omitempty"`
	ValidationResults ValidationResults `json:"validation_results,omitempty"`
}

type OutputValidateReverseDNS

type OutputValidateReverseDNS struct {
	ID                int64                       `json:"id,omitempty"`
	Valid             bool                        `json:"valid,omitempty"`
	ValidationResults ValidationResultsReverseDNS `json:"validation_results,omitempty"`
}

type PendingTeammate

type PendingTeammate struct {
	Email          string   `json:"email,omitempty"`
	Scopes         []string `json:"scopes,omitempty"`
	IsAdmin        bool     `json:"is_admin,omitempty"`
	Token          string   `json:"token,omitempty"`
	ExpirationDate int      `json:"expiration_date,omitempty"`
}

type Personalization

type Personalization struct {
	To                  []*Email               `json:"to,omitempty"`
	Cc                  []*Email               `json:"cc,omitempty"`
	Bcc                 []*Email               `json:"bcc,omitempty"`
	Subject             string                 `json:"subject,omitempty"`
	Headers             map[string]string      `json:"headers,omitempty"`
	Substitutions       map[string]string      `json:"substitutions,omitempty"`
	DynamicTemplateData map[string]interface{} `json:"dynamic_template_data,omitempty"`
	CustomArgs          map[string]string      `json:"custom_args,omitempty"`
	SendAt              int64                  `json:"send_at,omitempty"`
}

Personalization contains personalized data for recipients

func NewPersonalization

func NewPersonalization() *Personalization

NewPersonalization creates a new Personalization struct

func (*Personalization) AddBcc

func (p *Personalization) AddBcc(email *Email)

AddBcc adds a BCC recipient to personalization

func (*Personalization) AddCc

func (p *Personalization) AddCc(email *Email)

AddCc adds a CC recipient to personalization

func (*Personalization) AddTo

func (p *Personalization) AddTo(email *Email)

AddTo adds a recipient to personalization

func (*Personalization) SetSendAt

func (p *Personalization) SetSendAt(sendAt time.Time)

SetSendAt sets the send time for personalization

type RateLimitedError

type RateLimitedError struct {
	RetryAfter time.Duration
}

func (*RateLimitedError) Error

func (e *RateLimitedError) Error() string

type Record

type Record struct {
	Valid bool   `json:"valid,omitempty"`
	Type  string `json:"type,omitempty"`
	Host  string `json:"host,omitempty"`
	Data  string `json:"data,omitempty"`
}

type ReplyTo

type ReplyTo struct {
	Email string `json:"email"`
	Name  string `json:"name,omitempty"`
}

ReplyTo represents reply-to settings

type ReplyToList

type ReplyToList struct {
	Email string `json:"email"`
	Name  string `json:"name,omitempty"`
}

ReplyToList represents a list of reply-to addresses

type Reputation

type Reputation struct {
	Reputation float64 `json:"reputation,omitempty"`
	Username   string  `json:"username,omitempty"`
}

type ResultGetTrackingSettings

type ResultGetTrackingSettings struct {
	Name        string `json:"name,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Enabled     bool   `json:"enabled,omitempty"`
}

type SSOCertificate

type SSOCertificate struct {
	ID                int64  `json:"id,omitempty"`
	PublicCertificate string `json:"public_certificate,omitempty"`
	NotBefore         int64  `json:"not_before,omitempty"`
	NotAfter          int64  `json:"not_after,omitempty"`
	IntegrationID     string `json:"integration_id,omitempty"`
}

type SSOIntegration

type SSOIntegration struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Enabled              bool   `json:"enabled,omitempty"`
	SigninURL            string `json:"signin_url,omitempty"`
	SignoutURL           string `json:"signout_url,omitempty"`
	EntityID             string `json:"entity_id,omitempty"`
	CompletedIntegration bool   `json:"completed_integration,omitempty"`
	LastUpdated          int64  `json:"last_updated,omitempty"`
	SingleSignonURL      string `json:"single_signon_url,omitempty"`
	AudienceURL          string `json:"audience_url,omitempty"`
}

type Segment

type Segment struct {
	ID         int64              `json:"id,omitempty"`
	Name       string             `json:"name"`
	Conditions []SegmentCondition `json:"conditions"`
}

type SegmentCondition

type SegmentCondition struct {
	Field    string `json:"field"`
	Value    string `json:"value"`
	Operator string `json:"operator"`
	AndOr    string `json:"and_or"`
}

type Setting

type Setting struct {
	Enable *bool `json:"enable,omitempty"`
}

Setting represents a boolean setting

type SpamCheckSetting

type SpamCheckSetting struct {
	Enable    *bool  `json:"enable,omitempty"`
	Threshold int    `json:"threshold,omitempty"`
	PostToURL string `json:"post_to_url,omitempty"`
}

SpamCheckSetting represents spam check settings

type SpamReport

type SpamReport struct {
	Created int64  `json:"created"`
	Email   string `json:"email"`
	IP      string `json:"ip"`
}

SpamReport represents a spam report

type Stat

type Stat struct {
	Date  string     `json:"date,omitempty"`
	Stats []StatItem `json:"stats,omitempty"`
}

Stat represents statistics data

type StatItem

type StatItem struct {
	Metrics StatMetrics `json:"metrics,omitempty"`
	Name    string      `json:"name,omitempty"`
	Type    string      `json:"type,omitempty"`
}

StatItem represents individual statistic metrics

type StatMetrics

type StatMetrics struct {
	Blocks           int `json:"blocks,omitempty"`
	BounceDrops      int `json:"bounce_drops,omitempty"`
	Bounces          int `json:"bounces,omitempty"`
	Clicks           int `json:"clicks,omitempty"`
	DeferredDrops    int `json:"deferred_drops,omitempty"`
	Delivered        int `json:"delivered,omitempty"`
	InvalidEmails    int `json:"invalid_emails,omitempty"`
	Opens            int `json:"opens,omitempty"`
	Processed        int `json:"processed,omitempty"`
	Requests         int `json:"requests,omitempty"`
	SpamReportDrops  int `json:"spam_report_drops,omitempty"`
	SpamReports      int `json:"spam_reports,omitempty"`
	UniqueClicks     int `json:"unique_clicks,omitempty"`
	UniqueOpens      int `json:"unique_opens,omitempty"`
	UnsubscribeDrops int `json:"unsubscribe_drops,omitempty"`
	Unsubscribes     int `json:"unsubscribes,omitempty"`
}

StatMetrics represents metric data

type StatsOptions

type StatsOptions struct {
	StartDate   string   `url:"start_date,omitempty"`
	EndDate     string   `url:"end_date,omitempty"`
	Aggregation string   `url:"aggregated_by,omitempty"`
	Categories  []string `url:"-"`
	Subusers    []string `url:"-"`
	Tags        []string `url:"-"`
	Limit       int      `url:"limit,omitempty"`
	Offset      int      `url:"offset,omitempty"`
}

StatsOptions represents query parameters for stats requests

type SubscriptionTrackingSetting

type SubscriptionTrackingSetting struct {
	Enable          *bool  `json:"enable,omitempty"`
	Text            string `json:"text,omitempty"`
	HTML            string `json:"html,omitempty"`
	SubstitutionTag string `json:"substitution_tag,omitempty"`
}

SubscriptionTrackingSetting represents subscription tracking settings

type Subuser

type Subuser struct {
	ID       int64  `json:"id,omitempty"`
	Disabled bool   `json:"disabled,omitempty"`
	Username string `json:"username,omitempty"`
	Email    string `json:"email,omitempty"`
}

type SubuserAccess

type SubuserAccess struct {
	ID             int64    `json:"id,omitempty"`
	Username       string   `json:"username,omitempty"`
	Email          string   `json:"email,omitempty"`
	Disabled       bool     `json:"disabled,omitempty"`
	PermissionType string   `json:"permission_type,omitempty"`
	Scopes         []string `json:"scopes,omitempty"`
}

type SubuserSenderAuthentication

type SubuserSenderAuthentication struct {
	UserID   int64  `json:"user_id,omitempty"`
	Username string `json:"username,omitempty"`
}

type SubuserStat

type SubuserStat struct {
	Date  string     `json:"date,omitempty"`
	Stats []StatItem `json:"stats,omitempty"`
}

SubuserStat represents subuser statistics

type SuppressionGroup

type SuppressionGroup struct {
	ID              int64  `json:"id,omitempty"`
	Name            string `json:"name,omitempty"`
	Description     string `json:"description,omitempty"`
	IsDefault       bool   `json:"is_default,omitempty"`
	Unsubscribes    int64  `json:"unsubscribes,omitempty"`
	LastEmailSentAt string `json:"last_email_sent_at,omitempty"`
}

type SuppressionListOptions

type SuppressionListOptions struct {
	StartTime int64  `url:"start_time,omitempty"`
	EndTime   int64  `url:"end_time,omitempty"`
	Limit     int    `url:"limit,omitempty"`
	Offset    int    `url:"offset,omitempty"`
	Email     string `url:"email,omitempty"`
}

SuppressionListOptions represents query parameters for suppression list requests

type Teammate

type Teammate struct {
	Username  string `json:"username,omitempty"`
	Email     string `json:"email,omitempty"`
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
	UserType  string `json:"user_type,omitempty"`
	IsAdmin   bool   `json:"is_admin,omitempty"`
	Phone     string `json:"phone,omitempty"`
	Website   string `json:"website,omitempty"`
	Address   string `json:"address,omitempty"`
	Address2  string `json:"address2,omitempty"`
	City      string `json:"city,omitempty"`
	State     string `json:"state,omitempty"`
	Zip       string `json:"zip,omitempty"`
	Country   string `json:"country,omitempty"`
}

type Template

type Template struct {
	ID         string    `json:"id,omitempty"`
	Name       string    `json:"name,omitempty"`
	Generation string    `json:"generation,omitempty"`
	UpdatedAt  string    `json:"updated_at,omitempty"`
	Versions   []Version `json:"versions,omitempty"`
}

type TrackingSettings

type TrackingSettings struct {
	ClickTracking        *ClickTrackingSetting        `json:"click_tracking,omitempty"`
	OpenTracking         *OpenTrackingSetting         `json:"open_tracking,omitempty"`
	SubscriptionTracking *SubscriptionTrackingSetting `json:"subscription_tracking,omitempty"`
	GoogleAnalytics      *GoogleAnalyticsSetting      `json:"ganalytics,omitempty"`
}

TrackingSettings contains various tracking settings

type User

type User struct {
	Username string `json:"username,omitempty"`
	UserID   int64  `json:"user_id,omitempty"`
}

type ValidationResult

type ValidationResult struct {
	Valid  bool   `json:"valid,omitempty"`
	Reason string `json:"reason,omitempty"`
}

type ValidationResults

type ValidationResults struct {
	MailCname ValidationResult `json:"mail_cname,omitempty"`
	Dkim1     ValidationResult `json:"dkim1,omitempty"`
	Dkim2     ValidationResult `json:"dkim2,omitempty"`
	SPF       ValidationResult `json:"spf,omitempty"`
}
type ValidationResultsBrandedLink struct {
	DomainCname ValidationResult `json:"domain_cname,omitempty"`
	OwnerCname  ValidationResult `json:"owner_cname,omitempty"`
}

type ValidationResultsReverseDNS

type ValidationResultsReverseDNS struct {
	ARecordValidationResults ARecordValidationResults `json:"a_record,omitempty"`
}

type VerifiedSender

type VerifiedSender struct {
	ID          int64  `json:"id,omitempty"`
	Nickname    string `json:"nickname,omitempty"`
	FromEmail   string `json:"from_email,omitempty"`
	FromName    string `json:"from_name,omitempty"`
	ReplyTo     string `json:"reply_to,omitempty"`
	ReplyToName string `json:"reply_to_name,omitempty"`
	Address     string `json:"address,omitempty"`
	Address2    string `json:"address2,omitempty"`
	State       string `json:"state,omitempty"`
	City        string `json:"city,omitempty"`
	Zip         string `json:"zip,omitempty"`
	Country     string `json:"country,omitempty"`
	Verified    bool   `json:"verified,omitempty"`
	Locked      bool   `json:"locked,omitempty"`
}

type Version

type Version struct {
	ID                   string `json:"id,omitempty"`
	TemplateID           string `json:"template_id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Subject              string `json:"subject,omitempty"`
	UpdatedAt            string `json:"updated_at,omitempty"`
	GeneratePlainContent bool   `json:"generate_plain_content,omitempty"`
	HTMLContent          string `json:"html_content,omitempty"`
	PlainContent         string `json:"plain_content,omitempty"`
	Editor               string `json:"editor,omitempty"`
	ThumbnailURL         string `json:"thumbnail_url,omitempty"`
}

type Warning

type Warning struct {
	Message string `json:"message,omitempty"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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