sendgrid

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBodyNotNil low error displayed when the prepared body for a POST call
	// to the API is nil.
	ErrBodyNotNil = errors.New("body must not be nil")

	// ErrNameRequired error displayed when an api key name wasn't specified.
	ErrNameRequired = errors.New("a name is required")

	// ErrAPIKeyIDRequired error displayed when an api key ID wasn't specified.
	ErrAPIKeyIDRequired = errors.New("an API Key ID is required")

	// ErrFailedCreatingAPIKey error displayed when the provider can not create an api key.
	ErrFailedCreatingAPIKey = errors.New("failed creating apiKey")

	// ErrFailedDeletingAPIKey error displayed when the provider can not delete an api key.
	ErrFailedDeletingAPIKey = errors.New("failed deleting apiKey")

	// ErrUsernameRequired error displayed when a subUser username wasn't specified.
	ErrUsernameRequired = errors.New("a username is required")

	// ErrEmailRequired error displayed when a subUser email wasn't specified.
	ErrEmailRequired = errors.New("an email is required")

	// ErrPasswordRequired error displayed when a subUser password wasn't specified.
	ErrPasswordRequired = errors.New("a password is required")

	// ErrIPRequired error displayed when at least one IP per subUser wasn't specified.
	ErrIPRequired = errors.New("at least one ip address is required")

	// ErrFailedCreatingSubUser error displayed when the provider can not create a subuser.
	ErrFailedCreatingSubUser = errors.New("failed creating subUser")

	// ErrFailedDeletingSubUser error displayed when the provider can not delete a subuser.
	ErrFailedDeletingSubUser = errors.New("failed deleting subUser")

	// ErrTemplateIDRequired error displayed when a template ID wasn't specified.
	ErrTemplateIDRequired = errors.New("a template ID is required")

	// ErrTemplateNameRequired error displayed when a template name wasn't specified.
	ErrTemplateNameRequired = errors.New("a template name is required")

	// ErrTemplateVersionIDRequired error displayed when a template version ID wasn't specified.
	ErrTemplateVersionIDRequired = errors.New("a template version ID is required")

	// ErrTemplateVersionNameRequired error displayed when a template version ID wasn't specified.
	ErrTemplateVersionNameRequired = errors.New("a template version name is required")

	// ErrTemplateVersionSubjectRequired error displayed when a template version subject wasn't specified.
	ErrTemplateVersionSubjectRequired = errors.New("a template version subject is required")

	ErrFailedCreatingUnsubscribeGroup = errors.New("failed to create unsubscribe list")

	ErrUnsubscribeGroupIDRequired = errors.New("unsubscribe list id is required")

	ErrFailedDeletingUnsubscribeGroup = errors.New("failed deleting unsubscribe list")

	ErrFailedCreatingParseWebhook = errors.New("failed to create parse webhook")

	ErrFailedDeletingParseWebhook = errors.New("failed deleting parse webhook")

	ErrHostnameRequired = errors.New("a hostname is required")

	ErrURLRequired = errors.New("a url is required")

	ErrFailedPatchingEventWebhook = errors.New("failed to patch event webhook")

	ErrFailedCreatingDomainAuthentication = errors.New("failed to create domain authentication")

	ErrDomainAuthenticationIDRequired = errors.New("id for domain authentication is required")

	ErrFailedDeletingDomainAuthentication = errors.New("failed deleting domain authentication")

	ErrLinkBrandingIDRequired = errors.New("link branding id is required")

	ErrFailedDeletingLinkBranding = errors.New("failed to delete link branding")

	ErrFailedCreatingLinkBranding = errors.New("failed to create link branding")

	// ErrSubUserPassword should be empty.
	ErrSubUserPassword = errors.New("new password must be non empty")

	// ErrSSOIntegrationMissingField error displayed when a required SSO integration field is not specified.
	ErrSSOIntegrationMissingField = errors.New("SSO integration field is missing")

	// ErrFailedCreatingSSOIntegration error displayed when an SSO integration creation request fails.
	ErrFailedCreatingSSOIntegration = errors.New("failed to create SSO integration")

	// ErrFailedUpdatingSSOIntegration error displayed when an SSO integration update request fails.
	ErrFailedUpdatingSSOIntegration = errors.New("failed to update SSO integration")

	// ErrSSOCertificateMissingField error displayed when a required SSO certificate field is not specified.
	ErrSSOCertificateMissingField = errors.New("SSO certificate field is missing")

	// ErrFailedCreatingSSOCertificate error displayed when an SSO certificate creation request fails.
	ErrFailedCreatingSSOCertificate = errors.New("failed to create SSO certificate")

	// ErrFailedUpdatingSSOCertificate error displayed when an SSO certificate update request fails.
	ErrFailedUpdatingSSOCertificate = errors.New("failed to update SSO certificate")
)

Functions

func ParseDomainAuthentication added in v0.2.1

func ParseDomainAuthentication(respBody string) (*DomainAuthentication, RequestError)

func RetryOnRateLimit added in v0.1.6

func RetryOnRateLimit(
	ctx context.Context, d *schema.ResourceData, f func() (interface{}, RequestError)) (interface{}, error)

RetryOnRateLimit management of RequestErrors, and launch a retry if needed.

Types

type APIKey added in v0.1.1

type APIKey struct {
	ID     string   `json:"api_key_id,omitempty"` //nolint:tagliatelle
	APIKey string   `json:"api_key,omitempty"`    //nolint:tagliatelle
	Name   string   `json:"name,omitempty"`
	Scopes []string `json:"scopes,omitempty"`
}

APIKey is a Sendgrid API key.

type Client

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

Client is a Sendgrid client.

func NewClient

func NewClient(apiKey, host, onBehalfOf string) *Client

NewClient creates a Sendgrid Client.

func (*Client) ConfigureEventWebhookSigning added in v0.2.0

func (c *Client) ConfigureEventWebhookSigning(enabled bool) (*EventWebhookSigning, RequestError)

func (*Client) CreateAPIKey added in v0.1.1

func (c *Client) CreateAPIKey(name string, scopes []string) (*APIKey, RequestError)

CreateAPIKey creates an APIKey and returns it.

func (*Client) CreateDomainAuthentication added in v0.2.0

func (c *Client) CreateDomainAuthentication(
	domain string,
	subdomain string,
	ips []string,
	customSpf bool,
	isDefault bool,
	automaticSecurity bool,
	customDKIMSelector string) (*DomainAuthentication, RequestError)

CreateDomainAuthentication creates an DomainAuthentication and returns it.

func (*Client) CreateLinkBranding added in v0.2.0

func (c *Client) CreateLinkBranding(domain string, subdomain string, isDefault bool) (*LinkBranding, RequestError)

CreateLinkBranding creates an LinkBranding and returns it.

func (*Client) CreateParseWebhook added in v0.2.0

func (c *Client) CreateParseWebhook(
	hostname string,
	url string,
	spamCheck bool,
	sendRaw bool) (*ParseWebhook, RequestError)

CreateParseWebhook creates an ParseWebhook and returns it.

func (Client) CreateSSOCertificate added in v0.2.1

func (c Client) CreateSSOCertificate(
	publicCertificate string,
	integrationID string,
) (*SSOCertificate, RequestError)

CreateSSOCertificate creates an SSO certificate and returns it.

func (Client) CreateSSOIntegration added in v0.2.1

func (c Client) CreateSSOIntegration(
	name string,
	enabled bool,
	signInURL string,
	signOutURL string,
	entityID string,
) (*SSOIntegration, RequestError)

CreateSSOIntegration creates an SSO integration and returns it.

func (*Client) CreateSubuser added in v0.1.1

func (c *Client) CreateSubuser(username, email, password string, ips []string) (*SubUser, RequestError)

CreateSubuser creates a subuser and returns it.

func (*Client) CreateTemplate

func (c *Client) CreateTemplate(name, generation string) (*Template, error)

CreateTemplate creates a transactional template and returns it.

func (*Client) CreateTemplateVersion

func (c *Client) CreateTemplateVersion(t TemplateVersion) (*TemplateVersion, error)

CreateTemplateVersion creates a new version of a transactional template and returns it.

func (*Client) CreateUnsubscribeGroup added in v0.2.0

func (c *Client) CreateUnsubscribeGroup(
	name string,
	description string,
	isDefault bool) (*UnsubscribeGroup, RequestError)

CreateUnsubscribeGroup creates an UnsubscribeGroup and returns it.

func (*Client) DeleteAPIKey added in v0.1.1

func (c *Client) DeleteAPIKey(id string) (bool, RequestError)

DeleteAPIKey deletes an APIKey.

func (*Client) DeleteDomainAuthentication added in v0.2.0

func (c *Client) DeleteDomainAuthentication(id string) (bool, RequestError)

DeleteDomainAuthentication deletes an DomainAuthentication.

func (*Client) DeleteLinkBranding added in v0.2.0

func (c *Client) DeleteLinkBranding(id string) (bool, RequestError)

DeleteLinkBranding deletes an LinkBranding.

func (*Client) DeleteParseWebhook added in v0.2.0

func (c *Client) DeleteParseWebhook(hostname string) (bool, RequestError)

DeleteParseWebhook deletes an ParseWebhook.

func (Client) DeleteSSOCertificate added in v0.2.1

func (c Client) DeleteSSOCertificate(id string) (bool, RequestError)

DeleteSSOCertificate deletes an SSO certificate by ID.

func (Client) DeleteSSOIntegration added in v0.2.1

func (c Client) DeleteSSOIntegration(id string) (bool, RequestError)

DeleteSSOIntegration deletes an SSO integration by ID.

func (*Client) DeleteSubuser added in v0.1.1

func (c *Client) DeleteSubuser(username string) (bool, RequestError)

DeleteSubuser deletes a subuser.

func (*Client) DeleteTemplate

func (c *Client) DeleteTemplate(id string) (bool, error)

DeleteTemplate deletes a transactional template.

func (*Client) DeleteTemplateVersion

func (c *Client) DeleteTemplateVersion(templateID, id string) (bool, error)

DeleteTemplateVersion deletes a version of a transactional template.

func (*Client) DeleteUnsubscribeGroup added in v0.2.0

func (c *Client) DeleteUnsubscribeGroup(id string) (bool, RequestError)

DeleteUnsubscribeGroup deletes an UnsubscribeGroup.

func (*Client) Get

func (c *Client) Get(method rest.Method, endpoint string) (string, int, error)

Get gets a resource from Sendgrid.

func (Client) ListSSOCertificates added in v0.2.1

func (c Client) ListSSOCertificates() ([]*SSOCertificate, RequestError)

ListSSOCertificates retrieves all existing SSO certificates.

func (Client) ListSSOIntegrations added in v0.2.1

func (c Client) ListSSOIntegrations() ([]*SSOIntegration, RequestError)

ListSSOIntegrations returns a list of SSO integrations.

func (*Client) PatchEventWebhook added in v0.2.0

func (c *Client) PatchEventWebhook(
	enabled bool,
	url string,
	groupResubscribe bool,
	delivered bool,
	groupUnsubscribe bool,
	spamReport bool,
	bounce bool,
	deferred bool,
	unsubscribe bool,
	processed bool,
	open bool,
	click bool,
	dropped bool,
	oauthClientID string,
	oauthClientSecret string,
	oauthTokenURL string) (*EventWebhook, RequestError)

CreateEventWebhook creates an EventWebhook and returns it.

func (*Client) Post

func (c *Client) Post(method rest.Method, endpoint string, body interface{}) (string, int, error)

Post posts a resource to Sendgrid.

func (*Client) ReadAPIKey added in v0.1.1

func (c *Client) ReadAPIKey(id string) (*APIKey, RequestError)

ReadAPIKey retreives an APIKey and returns it.

func (*Client) ReadAPIKeys added in v0.2.0

func (c *Client) ReadAPIKeys() ([]APIKey, RequestError)

func (*Client) ReadDomainAuthentication added in v0.2.0

func (c *Client) ReadDomainAuthentication(id string) (*DomainAuthentication, RequestError)

ReadDomainAuthentication retrieves an DomainAuthentication and returns it.

func (*Client) ReadEventWebhook added in v0.2.0

func (c *Client) ReadEventWebhook() (*EventWebhook, RequestError)

ReadEventWebhook retrieves an EventWebhook and returns it.

func (*Client) ReadEventWebhookSigning added in v0.2.0

func (c *Client) ReadEventWebhookSigning() (*EventWebhookSigning, RequestError)

func (*Client) ReadLinkBranding added in v0.2.0

func (c *Client) ReadLinkBranding(id string) (*LinkBranding, RequestError)

ReadLinkBranding retrieves an LinkBranding and returns it.

func (*Client) ReadParseWebhook added in v0.2.0

func (c *Client) ReadParseWebhook(hostname string) (*ParseWebhook, RequestError)

ReadParseWebhook retreives an ParseWebhook and returns it.

func (Client) ReadSSOCertificate added in v0.2.1

func (c Client) ReadSSOCertificate(id string) (*SSOCertificate, RequestError)

ReadSSOCertificate retrieves an SSO certificate by ID.

func (Client) ReadSSOIntegration added in v0.2.1

func (c Client) ReadSSOIntegration(id string) (*SSOIntegration, RequestError)

ReadSSOIntegration retrieves an SSO integration by ID.

func (*Client) ReadSubUser added in v0.1.4

func (c *Client) ReadSubUser(username string) ([]SubUser, RequestError)

ReadSubUser retreives a subuser and returns it.

func (*Client) ReadTemplate

func (c *Client) ReadTemplate(id string) (*Template, error)

ReadTemplate retreives a transactional template and returns it.

func (*Client) ReadTemplateVersion

func (c *Client) ReadTemplateVersion(templateID, id string) (*TemplateVersion, error)

ReadTemplateVersion retreives a version of a transactional template and returns it.

func (*Client) ReadTemplates added in v0.2.0

func (c *Client) ReadTemplates(generation string) ([]Template, error)

func (*Client) ReadUnsubscribeGroup added in v0.2.0

func (c *Client) ReadUnsubscribeGroup(id string) (*UnsubscribeGroup, RequestError)

ReadUnsubscribeGroup retreives an UnsubscribeGroup and returns it.

func (*Client) ReadUnsubscribeGroups added in v0.2.0

func (c *Client) ReadUnsubscribeGroups() ([]UnsubscribeGroup, RequestError)

ReadUnsubscribeGroups retrieves all UnsubscribeGroup and returns them.

func (*Client) UpdateAPIKey added in v0.1.1

func (c *Client) UpdateAPIKey(id, name string, scopes []string) (*APIKey, RequestError)

UpdateAPIKey edits an APIKey and returns it.

func (*Client) UpdateDomainAuthentication added in v0.2.0

func (c *Client) UpdateDomainAuthentication(
	id string,
	isDefault bool,
	customSPF bool) (*DomainAuthentication, RequestError)

UpdateDomainAuthentication edits an DomainAuthentication and returns it.

func (*Client) UpdateLinkBranding added in v0.2.0

func (c *Client) UpdateLinkBranding(id string, isDefault bool) (*LinkBranding, RequestError)

UpdateLinkBranding edits an LinkBranding and returns it.

func (*Client) UpdateParseWebhook added in v0.2.0

func (c *Client) UpdateParseWebhook(hostname string, spamCheck bool, sendRaw bool) RequestError

UpdateParseWebhook edits an ParseWebhook and returns it.

func (Client) UpdateSSOCertificate added in v0.2.1

func (c Client) UpdateSSOCertificate(
	id string,
	publicCertificate string,
	integrationID string,
) (*SSOCertificate, RequestError)

UpdateSSOCertificate updates an existing SSO certificate by ID.

func (Client) UpdateSSOIntegration added in v0.2.1

func (c Client) UpdateSSOIntegration(
	id string,
	name string,
	enabled bool,
	signInURL string,
	signOutURL string,
	entityID string,
) (*SSOIntegration, RequestError)

UpdateSSOIntegration updates an existing SSO integration by ID.

func (*Client) UpdateSubuser added in v0.1.1

func (c *Client) UpdateSubuser(username string, disabled bool) (bool, RequestError)

UpdateSubuser enables/disables a subuser.

func (*Client) UpdateSubuserIPs added in v0.2.0

func (c *Client) UpdateSubuserIPs(username string, ips []string) RequestError

func (*Client) UpdateSubuserPassword added in v0.2.0

func (c *Client) UpdateSubuserPassword(username string, oldPassword string, newPassword string) RequestError

func (*Client) UpdateTemplate

func (c *Client) UpdateTemplate(id, name string) (*Template, error)

UpdateTemplate edits a transactional template and returns it. We can't change the "generation" of a transactional template.

func (*Client) UpdateTemplateVersion

func (c *Client) UpdateTemplateVersion(t TemplateVersion) (*TemplateVersion, error)

UpdateTemplateVersion edits a version of a transactional template and returns it.

func (*Client) UpdateUnsubscribeGroup added in v0.2.0

func (c *Client) UpdateUnsubscribeGroup(
	id string,
	name string,
	description string,
	isDefault bool) (*UnsubscribeGroup, RequestError)

UpdateUnsubscribeGroup edits an UnsubscribeGroup and returns it.

func (*Client) ValidateDomainAuthentication added in v0.2.0

func (c *Client) ValidateDomainAuthentication(id string) RequestError

func (*Client) ValidateLinkBranding added in v0.2.0

func (c *Client) ValidateLinkBranding(id string) RequestError

type DomainAuthentication added in v0.2.0

type DomainAuthentication struct {
	ID                 int32                   `json:"id,omitempty"`
	UserID             int32                   `json:"user_id,omitempty"` //nolint:tagliatelle
	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"` //nolint:tagliatelle
	IsDefault          bool                    `json:"default"`
	AutomaticSecurity  bool                    `json:"automatic_security"`   //nolint:tagliatelle
	CustomDKIMSelector string                  `json:"custom_dkim_selector"` //nolint:tagliatelle
	Legacy             bool                    `json:"legacy,omitempty"`
	Valid              bool                    `json:"valid,omitempty"`
	DNS                DomainAuthenticationDNS `json:"dns,omitempty"`
}

DomainAuthentication is a Sendgrid domain authentication.

type DomainAuthenticationDNS added in v0.2.0

type DomainAuthenticationDNS struct {
	MailCNAME    DomainAuthenticationDNSValue `json:"mail_cname,omitempty"` //nolint:tagliatelle
	DKIM1        DomainAuthenticationDNSValue `json:"dkim1,omitempty"`
	DKIM2        DomainAuthenticationDNSValue `json:"dkim2,omitempty"`
	MailServer   DomainAuthenticationDNSValue `json:"mail_server,omitempty"`   //nolint:tagliatelle
	SubDomainSPF DomainAuthenticationDNSValue `json:"subdomain_spf,omitempty"` //nolint:tagliatelle
	DKIM         DomainAuthenticationDNSValue `json:"dkim,omitempty"`
}

type DomainAuthenticationDNSValue added in v0.2.0

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

type EventWebhook added in v0.2.0

type EventWebhook struct {
	Enabled           bool   `json:"enabled"`
	URL               string `json:"url,omitempty"`
	GroupResubscribe  bool   `json:"group_resubscribe"` //nolint:tagliatelle
	Delivered         bool   `json:"delivered"`
	GroupUnsubscribe  bool   `json:"group_unsubscribe"` //nolint:tagliatelle
	SpamReport        bool   `json:"spam_report"`       //nolint:tagliatelle
	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"`
	OAuthClientID     string `json:"oauth_client_id,omitempty"`     //nolint:tagliatelle
	OAuthClientSecret string `json:"oauth_client_secret,omitempty"` //nolint:tagliatelle
	OAuthTokenURL     string `json:"oauth_token_url,omitempty"`     //nolint:tagliatelle
}

EventWebhook is a Sendgrid event webhook settings.

type EventWebhookSigning added in v0.2.0

type EventWebhookSigning struct {
	Enabled   bool   `json:"enabled"`
	PublicKey string `json:"public_key"` //nolint:tagliatelle
}

type LinkBranding added in v0.2.0

type LinkBranding struct {
	ID        int32           `json:"id,omitempty"`
	UserID    int32           `json:"user_id,omitempty"` //nolint:tagliatelle
	Domain    string          `json:"domain,omitempty"`
	Subdomain string          `json:"subdomain,omitempty"`
	Username  string          `json:"username,omitempty"`
	IsDefault bool            `json:"default"`
	Legacy    bool            `json:"legacy,omitempty"`
	Valid     bool            `json:"valid,omitempty"`
	DNS       LinkBrandingDNS `json:"dns,omitempty"`
}

LinkBranding is a Sendgrid domain authentication.

type LinkBrandingDNS added in v0.2.0

type LinkBrandingDNS struct {
	DomainCNAME LinkBrandingDNSValue `json:"domain_cname,omitempty"` //nolint:tagliatelle
	OwnerCNAME  LinkBrandingDNSValue `json:"owner_cname,omitempty"`  //nolint:tagliatelle
}

type LinkBrandingDNSValue added in v0.2.0

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

type ParseWebhook added in v0.2.0

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

ParseWebhook is a Sendgrid inbound parse settings.

type RequestError added in v0.1.4

type RequestError struct {
	StatusCode int
	Err        error
}

RequestError struct permits to embed to return the statucode and the error to the parent function.

type SSOCertificate added in v0.2.1

type SSOCertificate struct {
	PublicCertificate string `json:"public_certificate"` //nolint:tagliatelle
	IntegrationID     string `json:"integration_id"`     //nolint:tagliatelle
	ID                int32  `json:"id,omitempty"`
}

SSOCertificate maps a public certificate to an SSO integration, allowing the SSO integration to verify SAML requests from an IdP.

type SSOIntegration added in v0.2.1

type SSOIntegration struct {
	CompletedIntegration bool   `json:"completed_integration,omitempty"` //nolint:tagliatelle
	Enabled              bool   `json:"enabled"`
	Name                 string `json:"name"`
	SignInURL            string `json:"signin_url"`  //nolint:tagliatelle
	SignOutURL           string `json:"signout_url"` //nolint:tagliatelle
	EntityID             string `json:"entity_id"`   //nolint:tagliatelle
	ID                   string `json:"id,omitempty"`
	SingleSignOnURL      string `json:"single_signon_url,omitempty"` //nolint:tagliatelle
	AudienceURL          string `json:"audience_url,omitempty"`      //nolint:tagliatelle
}

SSOIntegration is a Sendgrid SSO configuration set.

type SubUser added in v0.1.4

type SubUser struct {
	ID                 int              `json:"id,omitempty"`
	UserID             int              `json:"user_id,omitempty"` //nolint:tagliatelle
	UserName           string           `json:"username,omitempty"`
	Password           string           `json:"password,omitempty"`
	ConfirmPassword    string           `json:"confirm_password,omitempty"` //nolint:tagliatelle
	Email              string           `json:"email,omitempty"`
	IPs                []string         `json:"ips,omitempty"`
	Disabled           bool             `json:"disabled,omitempty"`
	SignupSessionToken string           `json:"signup_session_token,omitempty"` //nolint:tagliatelle
	AuthorizationToken string           `json:"authorization_token,omitempty"`  //nolint:tagliatelle
	CreditAllocation   creditAllocation `json:"credit_allocation,omitempty"`    //nolint:tagliatelle
}

SubUser is a Sendgrid SubUser.

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"` //nolint:tagliatelle
	Versions   []TemplateVersion `json:"versions,omitempty"`
	Warnings   []string          `json:"warnings,omitempty"`
}

Template is a Sendgrid transactional template.

type TemplateVersion

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

TemplateVersion is a Sendgrid transactional template version.

type Templates added in v0.2.0

type Templates struct {
	Result []Template `json:"result"`
}

type UnsubscribeGroup added in v0.2.0

type UnsubscribeGroup struct {
	ID           int32  `json:"id,omitempty"`
	Name         string `json:"name,omitempty"`
	Description  string `json:"description,omitempty"`
	IsDefault    bool   `json:"is_default"` //nolint:tagliatelle
	Unsubscribes int32  `json:"unsubscribes,omitempty"`
}

UnsubscribeGroup is a Sendgrid - Suppressions - Unsubscribe Group.

type UpdateSubUserPassword added in v0.2.0

type UpdateSubUserPassword struct {
	NewPassword string `json:"new_password"` //nolint:tagliatelle
	OldPassword string `json:"old_password"` //nolint:tagliatelle
}

Jump to

Keyboard shortcuts

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