Documentation
¶
Overview ¶
Package tem provides methods and message types of the tem v1alpha1 API.
Index ¶
- Constants
- type API
- func (s *API) CancelEmail(req *CancelEmailRequest, opts ...scw.RequestOption) (*Email, error)
- func (s *API) CheckDomain(req *CheckDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) CreateDomain(req *CreateDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) CreateEmail(req *CreateEmailRequest, opts ...scw.RequestOption) (*CreateEmailResponse, error)
- func (s *API) GetDomain(req *GetDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) GetEmail(req *GetEmailRequest, opts ...scw.RequestOption) (*Email, error)
- func (s *API) GetServiceInfo(req *GetServiceInfoRequest, opts ...scw.RequestOption) (*scw.ServiceInfo, error)
- func (s *API) GetStatistics(req *GetStatisticsRequest, opts ...scw.RequestOption) (*Statistics, error)
- func (s *API) ListDomains(req *ListDomainsRequest, opts ...scw.RequestOption) (*ListDomainsResponse, error)
- func (s *API) ListEmails(req *ListEmailsRequest, opts ...scw.RequestOption) (*ListEmailsResponse, error)
- func (s *API) Regions() []scw.Region
- func (s *API) RevokeDomain(req *RevokeDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) WaitForDomain(req *WaitForDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- type CancelEmailRequest
- type CheckDomainRequest
- type CreateDomainRequest
- type CreateEmailRequest
- type CreateEmailRequestAddress
- type CreateEmailRequestAttachment
- type CreateEmailResponse
- type Domain
- type DomainStatistics
- type DomainStatus
- type Email
- type EmailRcptType
- type EmailStatus
- type EmailTry
- type GetDomainRequest
- type GetEmailRequest
- type GetServiceInfoRequest
- type GetStatisticsRequest
- type ListDomainsRequest
- type ListDomainsResponse
- type ListEmailsRequest
- type ListEmailsResponse
- type RevokeDomainRequest
- type Statistics
- type WaitForDomainRequest
Constants ¶
const ( // DomainStatusUnknown is [insert doc]. DomainStatusUnknown = DomainStatus("unknown") // DomainStatusChecked is [insert doc]. DomainStatusChecked = DomainStatus("checked") // DomainStatusUnchecked is [insert doc]. DomainStatusUnchecked = DomainStatus("unchecked") // DomainStatusInvalid is [insert doc]. DomainStatusInvalid = DomainStatus("invalid") // DomainStatusLocked is [insert doc]. DomainStatusLocked = DomainStatus("locked") // DomainStatusRevoked is [insert doc]. DomainStatusRevoked = DomainStatus("revoked") // DomainStatusPending is [insert doc]. DomainStatusPending = DomainStatus("pending") )
const ( // EmailRcptTypeUnknownRcptType is [insert doc]. EmailRcptTypeUnknownRcptType = EmailRcptType("unknown_rcpt_type") // EmailRcptTypeTo is [insert doc]. EmailRcptTypeTo = EmailRcptType("to") // EmailRcptTypeCc is [insert doc]. EmailRcptTypeCc = EmailRcptType("cc") // EmailRcptTypeBcc is [insert doc]. EmailRcptTypeBcc = EmailRcptType("bcc") )
const ( // EmailStatusUnknown is [insert doc]. EmailStatusUnknown = EmailStatus("unknown") // EmailStatusNew is [insert doc]. EmailStatusNew = EmailStatus("new") // EmailStatusSending is [insert doc]. EmailStatusSending = EmailStatus("sending") // EmailStatusSent is [insert doc]. EmailStatusSent = EmailStatus("sent") // EmailStatusFailed is [insert doc]. EmailStatusFailed = EmailStatus("failed") // EmailStatusCanceled is [insert doc]. EmailStatusCanceled = EmailStatus("canceled") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API: tem
func (*API) CancelEmail ¶
func (s *API) CancelEmail(req *CancelEmailRequest, opts ...scw.RequestOption) (*Email, error)
CancelEmail: try to cancel an email if it has not yet been sent
func (*API) CheckDomain ¶
func (s *API) CheckDomain(req *CheckDomainRequest, opts ...scw.RequestOption) (*Domain, error)
CheckDomain: ask for an immediate check of a domain (DNS check)
func (*API) CreateDomain ¶
func (s *API) CreateDomain(req *CreateDomainRequest, opts ...scw.RequestOption) (*Domain, error)
CreateDomain: register a domain in a project
func (*API) CreateEmail ¶
func (s *API) CreateEmail(req *CreateEmailRequest, opts ...scw.RequestOption) (*CreateEmailResponse, error)
CreateEmail: send an email
func (*API) GetDomain ¶
func (s *API) GetDomain(req *GetDomainRequest, opts ...scw.RequestOption) (*Domain, error)
GetDomain: get information about a domain
func (*API) GetEmail ¶
func (s *API) GetEmail(req *GetEmailRequest, opts ...scw.RequestOption) (*Email, error)
GetEmail: get information about an email
func (*API) GetServiceInfo ¶
func (s *API) GetServiceInfo(req *GetServiceInfoRequest, opts ...scw.RequestOption) (*scw.ServiceInfo, error)
func (*API) GetStatistics ¶
func (s *API) GetStatistics(req *GetStatisticsRequest, opts ...scw.RequestOption) (*Statistics, error)
GetStatistics: get statistics on the email statuses
func (*API) ListDomains ¶
func (s *API) ListDomains(req *ListDomainsRequest, opts ...scw.RequestOption) (*ListDomainsResponse, error)
ListDomains: list domains in a project and/or in an organization
func (*API) ListEmails ¶
func (s *API) ListEmails(req *ListEmailsRequest, opts ...scw.RequestOption) (*ListEmailsResponse, error)
ListEmails: list emails sent from a domain and/or for a project and/or for an organization
func (*API) RevokeDomain ¶
func (s *API) RevokeDomain(req *RevokeDomainRequest, opts ...scw.RequestOption) (*Domain, error)
RevokeDomain: revoke a domain
func (*API) WaitForDomain ¶
func (s *API) WaitForDomain(req *WaitForDomainRequest, opts ...scw.RequestOption) (*Domain, error)
WaitForDomain wait for the domain to be in a "terminal state" before returning. This function can be used to wait for a domain to be checked for example.
type CancelEmailRequest ¶
type CheckDomainRequest ¶
type CreateDomainRequest ¶
type CreateEmailRequest ¶
type CreateEmailRequest struct {
// Region:
//
// Region to target. If none is passed will use default region from the config
Region scw.Region `json:"-"`
// From: sender information (must be from a checked domain declared in the project)
From *CreateEmailRequestAddress `json:"from"`
// To: array of recipient information (limited to 1 recipient)
To []*CreateEmailRequestAddress `json:"to"`
// Cc: array of recipient information (unimplemented)
Cc []*CreateEmailRequestAddress `json:"cc"`
// Bcc: array of recipient information (unimplemented)
Bcc []*CreateEmailRequestAddress `json:"bcc"`
// Subject: message subject
Subject string `json:"subject"`
// Text: text content
Text string `json:"text"`
// HTML: HTML content
HTML string `json:"html"`
// ProjectID: ID of the project in which to create the email
ProjectID string `json:"project_id"`
// Attachments: array of attachments
Attachments []*CreateEmailRequestAttachment `json:"attachments"`
// SendBefore: maximum date to deliver mail
SendBefore *time.Time `json:"send_before"`
}
type CreateEmailRequestAddress ¶
type CreateEmailRequestAddress struct {
// Email: email address
Email string `json:"email"`
// Name: optional display name
Name *string `json:"name"`
}
CreateEmailRequestAddress: create email request. address
type CreateEmailRequestAttachment ¶
type CreateEmailRequestAttachment struct {
// Name: filename of the attachment
Name string `json:"name"`
// Type: mIME type of the attachment (Currently only allow, text files, pdf and html files)
Type string `json:"type"`
// Content: content of the attachment, encoded in base64
Content []byte `json:"content"`
}
CreateEmailRequestAttachment: create email request. attachment
type CreateEmailResponse ¶
type CreateEmailResponse struct {
// Emails: single page of emails matching the requested criteria
Emails []*Email `json:"emails"`
}
CreateEmailResponse: create email response
type Domain ¶
type Domain struct {
// ID: ID of the domain
ID string `json:"id"`
// OrganizationID: ID of the organization to which the domain belongs
OrganizationID string `json:"organization_id"`
// ProjectID: ID of the project
ProjectID string `json:"project_id"`
// Name: domain name (example.com)
Name string `json:"name"`
// Status: status of the domain
//
// Default value: unknown
Status DomainStatus `json:"status"`
// CreatedAt: date and time of domain's creation
CreatedAt *time.Time `json:"created_at"`
// NextCheckAt: date and time of the next scheduled check
NextCheckAt *time.Time `json:"next_check_at"`
// LastValidAt: date and time the domain was last found to be valid
LastValidAt *time.Time `json:"last_valid_at"`
// RevokedAt: date and time of the revocation of the domain
RevokedAt *time.Time `json:"revoked_at"`
// LastError: error message if the last check failed
LastError *string `json:"last_error"`
// SpfConfig: snippet of the SPF record that should be registered in the DNS zone
SpfConfig string `json:"spf_config"`
// DkimConfig: dKIM public key, as should be recorded in the DNS zone
DkimConfig string `json:"dkim_config"`
// Statistics: domain's statistics
Statistics *DomainStatistics `json:"statistics"`
Region scw.Region `json:"region"`
}
Domain: domain
type DomainStatistics ¶
type DomainStatus ¶
type DomainStatus string
func (DomainStatus) MarshalJSON ¶
func (enum DomainStatus) MarshalJSON() ([]byte, error)
func (DomainStatus) String ¶
func (enum DomainStatus) String() string
func (*DomainStatus) UnmarshalJSON ¶
func (enum *DomainStatus) UnmarshalJSON(data []byte) error
type Email ¶
type Email struct {
// ID: technical ID of the email
ID string `json:"id"`
// MessageID: messageID of the email
MessageID string `json:"message_id"`
// ProjectID: ID of the project to which the email belongs
ProjectID string `json:"project_id"`
// MailFrom: email address of the sender
MailFrom string `json:"mail_from"`
// RcptTo: email address of the recipient
RcptTo string `json:"rcpt_to"`
// RcptType: type of the recipient
//
// Default value: unknown_rcpt_type
RcptType EmailRcptType `json:"rcpt_type"`
// CreatedAt: creation date of the email object
CreatedAt *time.Time `json:"created_at"`
// UpdatedAt: last update time of the email object
UpdatedAt *time.Time `json:"updated_at"`
// Status: status of the email
//
// Default value: unknown
Status EmailStatus `json:"status"`
// StatusDetails: additional information on the status
StatusDetails *string `json:"status_details"`
// TryCount: total number of attempts to send the email
TryCount uint32 `json:"try_count"`
// LastTries: informations about the latest three attempts to send the email
LastTries []*EmailTry `json:"last_tries"`
}
Email: email
type EmailRcptType ¶
type EmailRcptType string
func (EmailRcptType) MarshalJSON ¶
func (enum EmailRcptType) MarshalJSON() ([]byte, error)
func (EmailRcptType) String ¶
func (enum EmailRcptType) String() string
func (*EmailRcptType) UnmarshalJSON ¶
func (enum *EmailRcptType) UnmarshalJSON(data []byte) error
type EmailStatus ¶
type EmailStatus string
func (EmailStatus) MarshalJSON ¶
func (enum EmailStatus) MarshalJSON() ([]byte, error)
func (EmailStatus) String ¶
func (enum EmailStatus) String() string
func (*EmailStatus) UnmarshalJSON ¶
func (enum *EmailStatus) UnmarshalJSON(data []byte) error
type EmailTry ¶
type EmailTry struct {
// Rank: rank number of this attempt to send the email
Rank uint32 `json:"rank"`
// TriedAt: date of the attempt
TriedAt *time.Time `json:"tried_at"`
// Code: the SMTP status code received after the attempt. 0 if the attempt did not reach an SMTP server.
Code int32 `json:"code"`
// Message: the SMTP message received, if any. If the attempt did not reach an SMTP server, the message says why.
Message string `json:"message"`
}
EmailTry: email. try
type GetDomainRequest ¶
type GetEmailRequest ¶
type GetServiceInfoRequest ¶
type GetStatisticsRequest ¶
type GetStatisticsRequest struct {
// Region:
//
// Region to target. If none is passed will use default region from the config
Region scw.Region `json:"-"`
// ProjectID: optional, count emails for this project
ProjectID *string `json:"-"`
// DomainID: optional, count emails send from this domain (must be coherent with the `project_id` and the `organization_id`)
DomainID *string `json:"-"`
// Since: optional, count emails created after this date
Since *time.Time `json:"-"`
// Until: optional, count emails created before this date
Until *time.Time `json:"-"`
// MailFrom: optional, count emails sent with this `mail_from` sender's address
MailFrom *string `json:"-"`
}
type ListDomainsRequest ¶
type ListDomainsRequest struct {
// Region:
//
// Region to target. If none is passed will use default region from the config
Region scw.Region `json:"-"`
// Page: page number (1 for the first page)
Page *int32 `json:"-"`
// PageSize: page size
PageSize *uint32 `json:"-"`
ProjectID *string `json:"-"`
Status []DomainStatus `json:"-"`
OrganizationID *string `json:"-"`
Name *string `json:"-"`
}
type ListDomainsResponse ¶
type ListDomainsResponse struct {
// TotalCount: total number of domains matching the request (without pagination)
TotalCount uint32 `json:"total_count"`
Domains []*Domain `json:"domains"`
}
ListDomainsResponse: list domains response
func (*ListDomainsResponse) UnsafeAppend ¶
func (r *ListDomainsResponse) UnsafeAppend(res interface{}) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListDomainsResponse) UnsafeGetTotalCount ¶
func (r *ListDomainsResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListEmailsRequest ¶
type ListEmailsRequest struct {
// Region:
//
// Region to target. If none is passed will use default region from the config
Region scw.Region `json:"-"`
Page *int32 `json:"-"`
PageSize *uint32 `json:"-"`
// ProjectID: optional ID of the project in which to list the emails
ProjectID *string `json:"-"`
// DomainID: optional ID of the domain for which to list the emails
DomainID *string `json:"-"`
// MessageID: optional ID of the message for which to list the emails
MessageID *string `json:"-"`
// Since: optional, list emails created after this date
Since *time.Time `json:"-"`
// Until: optional, list emails created before this date
Until *time.Time `json:"-"`
// MailFrom: optional, list emails sent with this `mail_from` sender's address
MailFrom *string `json:"-"`
// MailTo: optional, list emails sent with this `mail_to` recipient's address
MailTo *string `json:"-"`
// Statuses: optional, list emails having any of this status
Statuses []EmailStatus `json:"-"`
}
type ListEmailsResponse ¶
type ListEmailsResponse struct {
// TotalCount: count of all emails matching the requested criteria
TotalCount uint32 `json:"total_count"`
// Emails: single page of emails matching the requested criteria
Emails []*Email `json:"emails"`
}
ListEmailsResponse: list emails response
func (*ListEmailsResponse) UnsafeAppend ¶
func (r *ListEmailsResponse) UnsafeAppend(res interface{}) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListEmailsResponse) UnsafeGetTotalCount ¶
func (r *ListEmailsResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type RevokeDomainRequest ¶
type Statistics ¶
type Statistics struct {
// TotalCount: total number of emails matching the request criteria
TotalCount uint32 `json:"total_count"`
// NewCount: number of emails still in the `new` transient state (received from the API, not yet processed)
NewCount uint32 `json:"new_count"`
// SendingCount: number of emails still in the `sending` transient state (received from the API, not yet in their final status)
SendingCount uint32 `json:"sending_count"`
// SentCount: number of emails in the final `sent` state (have been delivered to the target mail system)
SentCount uint32 `json:"sent_count"`
// FailedCount: number of emails in the final `failed` state (refused by the target mail system with a final error status)
FailedCount uint32 `json:"failed_count"`
// CanceledCount: number of emails in the final `canceled` state (canceled by customer's request)
CanceledCount uint32 `json:"canceled_count"`
}
Statistics: statistics