Documentation
¶
Overview ¶
Package eusend is the official Go SDK for the Eusend API — the EU-native transactional email platform. Its shape mirrors github.com/resend/resend-go, so migrating from Resend is largely a `resend` → `eusend` rename.
client := eusend.NewClient("eu_live_...")
sent, err := client.Emails.Send(&eusend.SendEmailRequest{
From: "Acme <you@yourdomain.com>",
To: []string{"user@example.com"},
Subject: "Hello",
Html: "<p>Hello world</p>",
})
Index ¶
- Constants
- Variables
- func Bool(v bool) *bool
- func String(v string) *string
- type ApiKey
- type ApiKeysSvc
- type ApiKeysSvcImpl
- func (s *ApiKeysSvcImpl) Create(params *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
- func (s *ApiKeysSvcImpl) CreateWithContext(ctx context.Context, params *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
- func (s *ApiKeysSvcImpl) List() ([]ApiKey, error)
- func (s *ApiKeysSvcImpl) ListWithContext(ctx context.Context) ([]ApiKey, error)
- func (s *ApiKeysSvcImpl) Remove(apiKeyId string) (*GenericResponse, error)
- func (s *ApiKeysSvcImpl) RemoveWithContext(ctx context.Context, apiKeyId string) (*GenericResponse, error)
- type Attachment
- type Audience
- type AudienceListItem
- type AudiencesSvc
- type AudiencesSvcImpl
- func (s *AudiencesSvcImpl) BatchCreateContacts(audienceId string, contacts []*CreateContactRequest) (*BatchCreateContactsResponse, error)
- func (s *AudiencesSvcImpl) BatchCreateContactsWithContext(ctx context.Context, audienceId string, contacts []*CreateContactRequest) (*BatchCreateContactsResponse, error)
- func (s *AudiencesSvcImpl) Create(params *CreateAudienceRequest) (*Audience, error)
- func (s *AudiencesSvcImpl) CreateContact(audienceId string, params *CreateContactRequest) (*Contact, error)
- func (s *AudiencesSvcImpl) CreateContactWithContext(ctx context.Context, audienceId string, params *CreateContactRequest) (*Contact, error)
- func (s *AudiencesSvcImpl) CreateWithContext(ctx context.Context, params *CreateAudienceRequest) (*Audience, error)
- func (s *AudiencesSvcImpl) GetContact(audienceId, contactId string) (*Contact, error)
- func (s *AudiencesSvcImpl) GetContactWithContext(ctx context.Context, audienceId, contactId string) (*Contact, error)
- func (s *AudiencesSvcImpl) List() ([]AudienceListItem, error)
- func (s *AudiencesSvcImpl) ListContacts(audienceId string, options *ListContactsOptions) (*ListContactsResponse, error)
- func (s *AudiencesSvcImpl) ListContactsWithContext(ctx context.Context, audienceId string, options *ListContactsOptions) (*ListContactsResponse, error)
- func (s *AudiencesSvcImpl) ListWithContext(ctx context.Context) ([]AudienceListItem, error)
- func (s *AudiencesSvcImpl) Remove(audienceId string) (*GenericResponse, error)
- func (s *AudiencesSvcImpl) RemoveContact(audienceId, contactId string) (*GenericResponse, error)
- func (s *AudiencesSvcImpl) RemoveContactWithContext(ctx context.Context, audienceId, contactId string) (*GenericResponse, error)
- func (s *AudiencesSvcImpl) RemoveWithContext(ctx context.Context, audienceId string) (*GenericResponse, error)
- func (s *AudiencesSvcImpl) UpdateContact(audienceId, contactId string, params *UpdateContactRequest) (*Contact, error)
- func (s *AudiencesSvcImpl) UpdateContactWithContext(ctx context.Context, audienceId, contactId string, ...) (*Contact, error)
- type BatchCreateContactsResponse
- type BatchEmailResponse
- type BatchItemResult
- type BatchSvc
- type BatchSvcImpl
- type Broadcast
- type BroadcastListItem
- type BroadcastsSvc
- type BroadcastsSvcImpl
- func (s *BroadcastsSvcImpl) Cancel(broadcastId string) (*Broadcast, error)
- func (s *BroadcastsSvcImpl) CancelWithContext(ctx context.Context, broadcastId string) (*Broadcast, error)
- func (s *BroadcastsSvcImpl) Create(params *CreateBroadcastRequest) (*Broadcast, error)
- func (s *BroadcastsSvcImpl) CreateWithContext(ctx context.Context, params *CreateBroadcastRequest) (*Broadcast, error)
- func (s *BroadcastsSvcImpl) Get(broadcastId string) (*Broadcast, error)
- func (s *BroadcastsSvcImpl) GetWithContext(ctx context.Context, broadcastId string) (*Broadcast, error)
- func (s *BroadcastsSvcImpl) List() ([]BroadcastListItem, error)
- func (s *BroadcastsSvcImpl) ListWithContext(ctx context.Context) ([]BroadcastListItem, error)
- func (s *BroadcastsSvcImpl) Remove(broadcastId string) (*GenericResponse, error)
- func (s *BroadcastsSvcImpl) RemoveWithContext(ctx context.Context, broadcastId string) (*GenericResponse, error)
- func (s *BroadcastsSvcImpl) Send(broadcastId string, params *SendBroadcastRequest) (*SendBroadcastResponse, error)
- func (s *BroadcastsSvcImpl) SendWithContext(ctx context.Context, broadcastId string, params *SendBroadcastRequest) (*SendBroadcastResponse, error)
- func (s *BroadcastsSvcImpl) Update(broadcastId string, params *UpdateBroadcastRequest) (*Broadcast, error)
- func (s *BroadcastsSvcImpl) UpdateWithContext(ctx context.Context, broadcastId string, params *UpdateBroadcastRequest) (*Broadcast, error)
- type CancelScheduledEmailResponse
- type Client
- func (c *Client) NewRequest(ctx context.Context, method, path string, params any) (*http.Request, error)
- func (c *Client) NewRequestWithOptions(ctx context.Context, method, path string, params any, options Options) (*http.Request, error)
- func (c *Client) Perform(req *http.Request, ret any) (*http.Response, error)
- type Contact
- type CreateApiKeyRequest
- type CreateApiKeyResponse
- type CreateAudienceRequest
- type CreateBroadcastRequest
- type CreateContactRequest
- type CreateDomainRequest
- type CreateDomainResponse
- type CreateTemplateRequest
- type CreateWebhookRequest
- type DnsRecord
- type Domain
- type DomainListItem
- type DomainsSvc
- type DomainsSvcImpl
- func (s *DomainsSvcImpl) Create(params *CreateDomainRequest) (*CreateDomainResponse, error)
- func (s *DomainsSvcImpl) CreateWithContext(ctx context.Context, params *CreateDomainRequest) (*CreateDomainResponse, error)
- func (s *DomainsSvcImpl) Get(domainId string) (*Domain, error)
- func (s *DomainsSvcImpl) GetWithContext(ctx context.Context, domainId string) (*Domain, error)
- func (s *DomainsSvcImpl) List() ([]DomainListItem, error)
- func (s *DomainsSvcImpl) ListWithContext(ctx context.Context) ([]DomainListItem, error)
- func (s *DomainsSvcImpl) Remove(domainId string) (*GenericResponse, error)
- func (s *DomainsSvcImpl) RemoveWithContext(ctx context.Context, domainId string) (*GenericResponse, error)
- func (s *DomainsSvcImpl) Verify(domainId string) (*GenericResponse, error)
- func (s *DomainsSvcImpl) VerifyWithContext(ctx context.Context, domainId string) (*GenericResponse, error)
- type Email
- type EmailEvent
- type EmailListItem
- type EmailsSvc
- type EmailsSvcImpl
- func (s *EmailsSvcImpl) Cancel(emailId string) (*CancelScheduledEmailResponse, error)
- func (s *EmailsSvcImpl) CancelWithContext(ctx context.Context, emailId string) (*CancelScheduledEmailResponse, error)
- func (s *EmailsSvcImpl) Get(emailId string) (*Email, error)
- func (s *EmailsSvcImpl) GetWithContext(ctx context.Context, emailId string) (*Email, error)
- func (s *EmailsSvcImpl) List(options *ListEmailsOptions) (*ListEmailsResponse, error)
- func (s *EmailsSvcImpl) ListWithContext(ctx context.Context, options *ListEmailsOptions) (*ListEmailsResponse, error)
- func (s *EmailsSvcImpl) Send(params *SendEmailRequest) (*SendEmailResponse, error)
- func (s *EmailsSvcImpl) SendWithContext(ctx context.Context, params *SendEmailRequest) (*SendEmailResponse, error)
- func (s *EmailsSvcImpl) SendWithOptions(ctx context.Context, params *SendEmailRequest, options *SendEmailOptions) (*SendEmailResponse, error)
- func (s *EmailsSvcImpl) Update(params *UpdateEmailRequest) (*UpdateEmailResponse, error)
- func (s *EmailsSvcImpl) UpdateWithContext(ctx context.Context, params *UpdateEmailRequest) (*UpdateEmailResponse, error)
- type Error
- type GenericResponse
- type ListContactsOptions
- type ListContactsResponse
- type ListEmailsOptions
- type ListEmailsResponse
- type Options
- type SendBroadcastRequest
- type SendBroadcastResponse
- type SendEmailOptions
- type SendEmailRequest
- type SendEmailResponse
- type Template
- type TemplateListItem
- type TemplatesSvc
- type TemplatesSvcImpl
- func (s *TemplatesSvcImpl) Create(params *CreateTemplateRequest) (*Template, error)
- func (s *TemplatesSvcImpl) CreateWithContext(ctx context.Context, params *CreateTemplateRequest) (*Template, error)
- func (s *TemplatesSvcImpl) Get(templateId string) (*Template, error)
- func (s *TemplatesSvcImpl) GetWithContext(ctx context.Context, templateId string) (*Template, error)
- func (s *TemplatesSvcImpl) List() ([]TemplateListItem, error)
- func (s *TemplatesSvcImpl) ListWithContext(ctx context.Context) ([]TemplateListItem, error)
- func (s *TemplatesSvcImpl) Remove(templateId string) (*GenericResponse, error)
- func (s *TemplatesSvcImpl) RemoveWithContext(ctx context.Context, templateId string) (*GenericResponse, error)
- func (s *TemplatesSvcImpl) Update(templateId string, params *UpdateTemplateRequest) (*Template, error)
- func (s *TemplatesSvcImpl) UpdateWithContext(ctx context.Context, templateId string, params *UpdateTemplateRequest) (*Template, error)
- type UpdateBroadcastRequest
- type UpdateContactRequest
- type UpdateEmailRequest
- type UpdateEmailResponse
- type UpdateTemplateRequest
- type UpdateWebhookRequest
- type Webhook
- type WebhookDelivery
- type WebhooksSvc
- type WebhooksSvcImpl
- func (s *WebhooksSvcImpl) Create(params *CreateWebhookRequest) (*Webhook, error)
- func (s *WebhooksSvcImpl) CreateWithContext(ctx context.Context, params *CreateWebhookRequest) (*Webhook, error)
- func (s *WebhooksSvcImpl) Get(webhookId string) (*Webhook, error)
- func (s *WebhooksSvcImpl) GetWithContext(ctx context.Context, webhookId string) (*Webhook, error)
- func (s *WebhooksSvcImpl) List() ([]Webhook, error)
- func (s *WebhooksSvcImpl) ListWithContext(ctx context.Context) ([]Webhook, error)
- func (s *WebhooksSvcImpl) Remove(webhookId string) (*GenericResponse, error)
- func (s *WebhooksSvcImpl) RemoveWithContext(ctx context.Context, webhookId string) (*GenericResponse, error)
- func (s *WebhooksSvcImpl) Update(webhookId string, params *UpdateWebhookRequest) (*Webhook, error)
- func (s *WebhooksSvcImpl) UpdateWithContext(ctx context.Context, webhookId string, params *UpdateWebhookRequest) (*Webhook, error)
Constants ¶
const ( CodeForbidden = "FORBIDDEN" CodeNotFound = "NOT_FOUND" CodeValidationError = "VALIDATION_ERROR" CodeBadRequest = "BAD_REQUEST" CodeConflict = "CONFLICT" CodeRateLimited = "RATE_LIMITED" CodeMonthlyLimitExceeded = "MONTHLY_LIMIT_EXCEEDED" CodeDailyLimitExceeded = "DAILY_LIMIT_EXCEEDED" CodePlanLimitExceeded = "PLAN_LIMIT_EXCEEDED" CodeDomainNotVerified = "DOMAIN_NOT_VERIFIED" CodeSendingSuspended = "SENDING_SUSPENDED" CodeAllSuppressed = "ALL_SUPPRESSED" CodeAttachmentStorageErr = "ATTACHMENT_STORAGE_ERROR" CodeServicePaused = "SERVICE_PAUSED" CodeInternalError = "INTERNAL_ERROR" CodeApplicationError = "application_error" )
Error codes returned by the API. CodeApplicationError is SDK-only and signals that the request never reached the server (network failure, DNS, timeout).
Variables ¶
var (
ErrFailedToCreateRequest = errors.New("[ERROR]: Failed to create request")
)
Sentinel errors returned when a request object cannot be constructed.
Functions ¶
Types ¶
type ApiKey ¶
type ApiKey struct {
Id string `json:"id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
TestMode bool `json:"test_mode"`
CreatedAt string `json:"created_at"`
LastUsedAt string `json:"last_used_at"`
}
ApiKey is a row from ApiKeys.List. The full key is never returned after creation.
type ApiKeysSvc ¶
type ApiKeysSvc interface {
Create(params *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
CreateWithContext(ctx context.Context, params *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
List() ([]ApiKey, error)
ListWithContext(ctx context.Context) ([]ApiKey, error)
Remove(apiKeyId string) (*GenericResponse, error)
RemoveWithContext(ctx context.Context, apiKeyId string) (*GenericResponse, error)
}
ApiKeysSvc is the /api-keys API.
type ApiKeysSvcImpl ¶
type ApiKeysSvcImpl struct {
// contains filtered or unexported fields
}
func (*ApiKeysSvcImpl) Create ¶
func (s *ApiKeysSvcImpl) Create(params *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
func (*ApiKeysSvcImpl) CreateWithContext ¶
func (s *ApiKeysSvcImpl) CreateWithContext(ctx context.Context, params *CreateApiKeyRequest) (*CreateApiKeyResponse, error)
func (*ApiKeysSvcImpl) List ¶
func (s *ApiKeysSvcImpl) List() ([]ApiKey, error)
func (*ApiKeysSvcImpl) ListWithContext ¶
func (s *ApiKeysSvcImpl) ListWithContext(ctx context.Context) ([]ApiKey, error)
func (*ApiKeysSvcImpl) Remove ¶
func (s *ApiKeysSvcImpl) Remove(apiKeyId string) (*GenericResponse, error)
func (*ApiKeysSvcImpl) RemoveWithContext ¶
func (s *ApiKeysSvcImpl) RemoveWithContext(ctx context.Context, apiKeyId string) (*GenericResponse, error)
type Attachment ¶
type Attachment struct {
Content []byte `json:"content,omitempty"`
Filename string `json:"filename,omitempty"`
Path string `json:"path,omitempty"`
ContentType string `json:"content_type,omitempty"`
ContentId string `json:"content_id,omitempty"`
}
Attachment is a file attached to an email. Provide either Content (raw bytes, base64-encoded on the wire) or Path (a public URL fetched at send time). Set ContentId for an inline attachment referenced from HTML with <img src="cid:...">.
type Audience ¶
type Audience struct {
Id string `json:"id"`
Name string `json:"name"`
OrganizationId string `json:"organizationId"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Audience is returned by Audiences.Create.
type AudienceListItem ¶
type AudienceListItem struct {
Id string `json:"id"`
Name string `json:"name"`
CreatedAt string `json:"createdAt"`
ContactCount int `json:"contactCount"`
}
AudienceListItem is a row from Audiences.List.
type AudiencesSvc ¶
type AudiencesSvc interface {
Create(params *CreateAudienceRequest) (*Audience, error)
CreateWithContext(ctx context.Context, params *CreateAudienceRequest) (*Audience, error)
List() ([]AudienceListItem, error)
ListWithContext(ctx context.Context) ([]AudienceListItem, error)
Remove(audienceId string) (*GenericResponse, error)
RemoveWithContext(ctx context.Context, audienceId string) (*GenericResponse, error)
CreateContact(audienceId string, params *CreateContactRequest) (*Contact, error)
CreateContactWithContext(ctx context.Context, audienceId string, params *CreateContactRequest) (*Contact, error)
BatchCreateContacts(audienceId string, contacts []*CreateContactRequest) (*BatchCreateContactsResponse, error)
BatchCreateContactsWithContext(ctx context.Context, audienceId string, contacts []*CreateContactRequest) (*BatchCreateContactsResponse, error)
ListContacts(audienceId string, options *ListContactsOptions) (*ListContactsResponse, error)
ListContactsWithContext(ctx context.Context, audienceId string, options *ListContactsOptions) (*ListContactsResponse, error)
GetContact(audienceId, contactId string) (*Contact, error)
GetContactWithContext(ctx context.Context, audienceId, contactId string) (*Contact, error)
UpdateContact(audienceId, contactId string, params *UpdateContactRequest) (*Contact, error)
UpdateContactWithContext(ctx context.Context, audienceId, contactId string, params *UpdateContactRequest) (*Contact, error)
RemoveContact(audienceId, contactId string) (*GenericResponse, error)
RemoveContactWithContext(ctx context.Context, audienceId, contactId string) (*GenericResponse, error)
}
AudiencesSvc is the /audiences API, including nested contact operations.
type AudiencesSvcImpl ¶
type AudiencesSvcImpl struct {
// contains filtered or unexported fields
}
func (*AudiencesSvcImpl) BatchCreateContacts ¶
func (s *AudiencesSvcImpl) BatchCreateContacts(audienceId string, contacts []*CreateContactRequest) (*BatchCreateContactsResponse, error)
func (*AudiencesSvcImpl) BatchCreateContactsWithContext ¶
func (s *AudiencesSvcImpl) BatchCreateContactsWithContext(ctx context.Context, audienceId string, contacts []*CreateContactRequest) (*BatchCreateContactsResponse, error)
func (*AudiencesSvcImpl) Create ¶
func (s *AudiencesSvcImpl) Create(params *CreateAudienceRequest) (*Audience, error)
func (*AudiencesSvcImpl) CreateContact ¶
func (s *AudiencesSvcImpl) CreateContact(audienceId string, params *CreateContactRequest) (*Contact, error)
func (*AudiencesSvcImpl) CreateContactWithContext ¶
func (s *AudiencesSvcImpl) CreateContactWithContext(ctx context.Context, audienceId string, params *CreateContactRequest) (*Contact, error)
func (*AudiencesSvcImpl) CreateWithContext ¶
func (s *AudiencesSvcImpl) CreateWithContext(ctx context.Context, params *CreateAudienceRequest) (*Audience, error)
func (*AudiencesSvcImpl) GetContact ¶
func (s *AudiencesSvcImpl) GetContact(audienceId, contactId string) (*Contact, error)
func (*AudiencesSvcImpl) GetContactWithContext ¶
func (*AudiencesSvcImpl) List ¶
func (s *AudiencesSvcImpl) List() ([]AudienceListItem, error)
func (*AudiencesSvcImpl) ListContacts ¶
func (s *AudiencesSvcImpl) ListContacts(audienceId string, options *ListContactsOptions) (*ListContactsResponse, error)
func (*AudiencesSvcImpl) ListContactsWithContext ¶
func (s *AudiencesSvcImpl) ListContactsWithContext(ctx context.Context, audienceId string, options *ListContactsOptions) (*ListContactsResponse, error)
func (*AudiencesSvcImpl) ListWithContext ¶
func (s *AudiencesSvcImpl) ListWithContext(ctx context.Context) ([]AudienceListItem, error)
func (*AudiencesSvcImpl) Remove ¶
func (s *AudiencesSvcImpl) Remove(audienceId string) (*GenericResponse, error)
func (*AudiencesSvcImpl) RemoveContact ¶
func (s *AudiencesSvcImpl) RemoveContact(audienceId, contactId string) (*GenericResponse, error)
func (*AudiencesSvcImpl) RemoveContactWithContext ¶
func (s *AudiencesSvcImpl) RemoveContactWithContext(ctx context.Context, audienceId, contactId string) (*GenericResponse, error)
func (*AudiencesSvcImpl) RemoveWithContext ¶
func (s *AudiencesSvcImpl) RemoveWithContext(ctx context.Context, audienceId string) (*GenericResponse, error)
func (*AudiencesSvcImpl) UpdateContact ¶
func (s *AudiencesSvcImpl) UpdateContact(audienceId, contactId string, params *UpdateContactRequest) (*Contact, error)
func (*AudiencesSvcImpl) UpdateContactWithContext ¶
func (s *AudiencesSvcImpl) UpdateContactWithContext(ctx context.Context, audienceId, contactId string, params *UpdateContactRequest) (*Contact, error)
type BatchCreateContactsResponse ¶
type BatchCreateContactsResponse struct {
Count int `json:"count"`
}
BatchCreateContactsResponse reports how many contacts were written.
type BatchEmailResponse ¶
type BatchEmailResponse struct {
Data []BatchItemResult `json:"data"`
}
BatchEmailResponse is the response from Batch.Send.
type BatchItemResult ¶
type BatchItemResult struct {
Id string `json:"id,omitempty"`
Error string `json:"error,omitempty"`
Code string `json:"code,omitempty"`
}
BatchItemResult is one outcome of a batch send, positionally mapped to the input slice: result[i] describes params[i]. Queued items carry Id; rejected items carry Error and Code. Branch on `if result.Id != ""`.
type BatchSvc ¶
type BatchSvc interface {
Send(params []*SendEmailRequest) (*BatchEmailResponse, error)
SendWithContext(ctx context.Context, params []*SendEmailRequest) (*BatchEmailResponse, error)
}
BatchSvc is the /emails/batch API.
type BatchSvcImpl ¶
type BatchSvcImpl struct {
// contains filtered or unexported fields
}
func (*BatchSvcImpl) Send ¶
func (s *BatchSvcImpl) Send(params []*SendEmailRequest) (*BatchEmailResponse, error)
Send sends up to 100 emails in a single request. Attachments and scheduling are not supported on the batch endpoint and are stripped from each item — send those individually via Emails.Send. A failed item never fails the whole batch; branch on the presence of Id per returned result.
func (*BatchSvcImpl) SendWithContext ¶
func (s *BatchSvcImpl) SendWithContext(ctx context.Context, params []*SendEmailRequest) (*BatchEmailResponse, error)
type Broadcast ¶
type Broadcast struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
AudienceId string `json:"audienceId"`
FromAddress string `json:"fromAddress"`
Subject string `json:"subject"`
Html string `json:"html"`
TemplateId string `json:"templateId"`
TemplateVariables map[string]string `json:"templateVariables"`
ScheduledAt string `json:"scheduledAt"`
RecipientCount int `json:"recipientCount"`
SentCount int `json:"sentCount"`
StartedAt string `json:"startedAt"`
CompletedAt string `json:"completedAt"`
Stats map[string]int `json:"stats"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Broadcast is returned by Broadcasts.Create/Update/Cancel and (with stats) Get.
type BroadcastListItem ¶
type BroadcastListItem struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
AudienceId string `json:"audienceId"`
FromAddress string `json:"fromAddress"`
Subject string `json:"subject"`
RecipientCount int `json:"recipientCount"`
SentCount int `json:"sentCount"`
ScheduledAt string `json:"scheduledAt"`
StartedAt string `json:"startedAt"`
CompletedAt string `json:"completedAt"`
CreatedAt string `json:"createdAt"`
AudienceName string `json:"audienceName"`
}
BroadcastListItem is a row from Broadcasts.List.
type BroadcastsSvc ¶
type BroadcastsSvc interface {
Create(params *CreateBroadcastRequest) (*Broadcast, error)
CreateWithContext(ctx context.Context, params *CreateBroadcastRequest) (*Broadcast, error)
List() ([]BroadcastListItem, error)
ListWithContext(ctx context.Context) ([]BroadcastListItem, error)
Get(broadcastId string) (*Broadcast, error)
GetWithContext(ctx context.Context, broadcastId string) (*Broadcast, error)
Update(broadcastId string, params *UpdateBroadcastRequest) (*Broadcast, error)
UpdateWithContext(ctx context.Context, broadcastId string, params *UpdateBroadcastRequest) (*Broadcast, error)
Send(broadcastId string, params *SendBroadcastRequest) (*SendBroadcastResponse, error)
SendWithContext(ctx context.Context, broadcastId string, params *SendBroadcastRequest) (*SendBroadcastResponse, error)
Cancel(broadcastId string) (*Broadcast, error)
CancelWithContext(ctx context.Context, broadcastId string) (*Broadcast, error)
Remove(broadcastId string) (*GenericResponse, error)
RemoveWithContext(ctx context.Context, broadcastId string) (*GenericResponse, error)
}
BroadcastsSvc is the /broadcasts API.
type BroadcastsSvcImpl ¶
type BroadcastsSvcImpl struct {
// contains filtered or unexported fields
}
func (*BroadcastsSvcImpl) Cancel ¶
func (s *BroadcastsSvcImpl) Cancel(broadcastId string) (*Broadcast, error)
func (*BroadcastsSvcImpl) CancelWithContext ¶
func (*BroadcastsSvcImpl) Create ¶
func (s *BroadcastsSvcImpl) Create(params *CreateBroadcastRequest) (*Broadcast, error)
func (*BroadcastsSvcImpl) CreateWithContext ¶
func (s *BroadcastsSvcImpl) CreateWithContext(ctx context.Context, params *CreateBroadcastRequest) (*Broadcast, error)
func (*BroadcastsSvcImpl) Get ¶
func (s *BroadcastsSvcImpl) Get(broadcastId string) (*Broadcast, error)
func (*BroadcastsSvcImpl) GetWithContext ¶
func (*BroadcastsSvcImpl) List ¶
func (s *BroadcastsSvcImpl) List() ([]BroadcastListItem, error)
func (*BroadcastsSvcImpl) ListWithContext ¶
func (s *BroadcastsSvcImpl) ListWithContext(ctx context.Context) ([]BroadcastListItem, error)
func (*BroadcastsSvcImpl) Remove ¶
func (s *BroadcastsSvcImpl) Remove(broadcastId string) (*GenericResponse, error)
func (*BroadcastsSvcImpl) RemoveWithContext ¶
func (s *BroadcastsSvcImpl) RemoveWithContext(ctx context.Context, broadcastId string) (*GenericResponse, error)
func (*BroadcastsSvcImpl) Send ¶
func (s *BroadcastsSvcImpl) Send(broadcastId string, params *SendBroadcastRequest) (*SendBroadcastResponse, error)
Send sends a broadcast immediately, or schedules it when params.ScheduledAt is set. Calling Send on a paused broadcast resumes it from where it stopped.
func (*BroadcastsSvcImpl) SendWithContext ¶
func (s *BroadcastsSvcImpl) SendWithContext(ctx context.Context, broadcastId string, params *SendBroadcastRequest) (*SendBroadcastResponse, error)
func (*BroadcastsSvcImpl) Update ¶
func (s *BroadcastsSvcImpl) Update(broadcastId string, params *UpdateBroadcastRequest) (*Broadcast, error)
func (*BroadcastsSvcImpl) UpdateWithContext ¶
func (s *BroadcastsSvcImpl) UpdateWithContext(ctx context.Context, broadcastId string, params *UpdateBroadcastRequest) (*Broadcast, error)
type CancelScheduledEmailResponse ¶
CancelScheduledEmailResponse is the response from Emails.Cancel.
type Client ¶
type Client struct {
ApiKey string
BaseURL *url.URL
UserAgent string
Emails EmailsSvc
Batch BatchSvc
ApiKeys ApiKeysSvc
Domains DomainsSvc
Audiences AudiencesSvc
Templates TemplatesSvc
Webhooks WebhooksSvc
Broadcasts BroadcastsSvc
// contains filtered or unexported fields
}
Client is the entry point to the Eusend API. Create one with NewClient and share it across goroutines — it is safe for concurrent use.
func NewClient ¶
NewClient creates a Client with the given API key. If apiKey is empty, the EUSEND_API_KEY environment variable is used.
func NewCustomClient ¶
NewCustomClient creates a Client with a custom *http.Client (for custom timeouts, proxies, etc.).
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, path string, params any) (*http.Request, error)
NewRequest builds an *http.Request against the API, JSON-encoding params when non-nil.
type Contact ¶
type Contact struct {
Id string `json:"id"`
AudienceId string `json:"audienceId"`
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Status string `json:"status"`
UnsubscribedAt string `json:"unsubscribedAt"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Contact is a member of an audience.
type CreateApiKeyRequest ¶
type CreateApiKeyRequest struct {
Name string `json:"name"`
// TestMode issues a sandbox key. Emails sent with a test key are accepted
// and tracked but never delivered.
TestMode bool `json:"test_mode"`
}
CreateApiKeyRequest is the request object for ApiKeys.Create.
type CreateApiKeyResponse ¶
type CreateApiKeyResponse struct {
Id string `json:"id"`
Name string `json:"name"`
Key string `json:"key"`
Prefix string `json:"prefix"`
TestMode bool `json:"test_mode"`
CreatedAt string `json:"created_at"`
}
CreateApiKeyResponse is returned by ApiKeys.Create. Key holds the full secret and is returned only once — store it securely.
type CreateAudienceRequest ¶
type CreateAudienceRequest struct {
Name string `json:"name"`
}
CreateAudienceRequest is the request object for Audiences.Create.
type CreateBroadcastRequest ¶
type CreateBroadcastRequest struct {
Name string `json:"name"`
AudienceId string `json:"audience_id"`
From string `json:"from"`
Subject string `json:"subject"`
Html string `json:"html,omitempty"`
TemplateId string `json:"template_id,omitempty"`
TemplateVariables map[string]string `json:"template_variables,omitempty"`
}
CreateBroadcastRequest is the request object for Broadcasts.Create. Provide either Html or TemplateId.
type CreateContactRequest ¶
type CreateContactRequest struct {
Email string `json:"email"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
}
CreateContactRequest is the request object for Audiences.CreateContact and the item shape for BatchCreateContacts.
type CreateDomainRequest ¶
type CreateDomainRequest struct {
Name string `json:"name"`
}
CreateDomainRequest is the request object for Domains.Create.
type CreateDomainResponse ¶
type CreateDomainResponse struct {
Id string `json:"id"`
Name string `json:"name"`
Dkim DnsRecord `json:"dkim"`
Spf DnsRecord `json:"spf"`
Dmarc DnsRecord `json:"dmarc"`
}
CreateDomainResponse is returned by Domains.Create and carries the DNS records to add.
type CreateTemplateRequest ¶
type CreateTemplateRequest struct {
Name string `json:"name"`
Subject string `json:"subject"`
Html string `json:"html"`
}
CreateTemplateRequest is the request object for Templates.Create. Use {{variable}} placeholders in Subject/Html; values are HTML-escaped at send time.
type CreateWebhookRequest ¶
CreateWebhookRequest is the request object for Webhooks.Create. Pass Events []string{"*"} to subscribe to every event.
type DnsRecord ¶
type DnsRecord struct {
Type string `json:"type"`
Name string `json:"name"`
Value string `json:"value"`
}
DnsRecord is a DNS entry to publish for a domain.
type Domain ¶
type Domain struct {
Id string `json:"id"`
Name string `json:"name"`
DkimPublicKey string `json:"dkimPublicKey"`
DkimSelector string `json:"dkimSelector"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
VerifiedAt string `json:"verifiedAt"`
}
Domain is the response from Domains.Get.
type DomainListItem ¶
type DomainListItem struct {
Id string `json:"id"`
Name string `json:"name"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
}
DomainListItem is a row from Domains.List.
type DomainsSvc ¶
type DomainsSvc interface {
Create(params *CreateDomainRequest) (*CreateDomainResponse, error)
CreateWithContext(ctx context.Context, params *CreateDomainRequest) (*CreateDomainResponse, error)
List() ([]DomainListItem, error)
ListWithContext(ctx context.Context) ([]DomainListItem, error)
Get(domainId string) (*Domain, error)
GetWithContext(ctx context.Context, domainId string) (*Domain, error)
Verify(domainId string) (*GenericResponse, error)
VerifyWithContext(ctx context.Context, domainId string) (*GenericResponse, error)
Remove(domainId string) (*GenericResponse, error)
RemoveWithContext(ctx context.Context, domainId string) (*GenericResponse, error)
}
DomainsSvc is the /domains API.
type DomainsSvcImpl ¶
type DomainsSvcImpl struct {
// contains filtered or unexported fields
}
func (*DomainsSvcImpl) Create ¶
func (s *DomainsSvcImpl) Create(params *CreateDomainRequest) (*CreateDomainResponse, error)
func (*DomainsSvcImpl) CreateWithContext ¶
func (s *DomainsSvcImpl) CreateWithContext(ctx context.Context, params *CreateDomainRequest) (*CreateDomainResponse, error)
func (*DomainsSvcImpl) GetWithContext ¶
func (*DomainsSvcImpl) List ¶
func (s *DomainsSvcImpl) List() ([]DomainListItem, error)
func (*DomainsSvcImpl) ListWithContext ¶
func (s *DomainsSvcImpl) ListWithContext(ctx context.Context) ([]DomainListItem, error)
func (*DomainsSvcImpl) Remove ¶
func (s *DomainsSvcImpl) Remove(domainId string) (*GenericResponse, error)
func (*DomainsSvcImpl) RemoveWithContext ¶
func (s *DomainsSvcImpl) RemoveWithContext(ctx context.Context, domainId string) (*GenericResponse, error)
func (*DomainsSvcImpl) Verify ¶
func (s *DomainsSvcImpl) Verify(domainId string) (*GenericResponse, error)
func (*DomainsSvcImpl) VerifyWithContext ¶
func (s *DomainsSvcImpl) VerifyWithContext(ctx context.Context, domainId string) (*GenericResponse, error)
type Email ¶
type Email struct {
Id string `json:"id"`
From string `json:"from"`
To []string `json:"to"`
Cc []string `json:"cc"`
Bcc []string `json:"bcc"`
ReplyTo []string `json:"replyTo"`
Subject string `json:"subject"`
Html string `json:"html"`
Text string `json:"text"`
Status string `json:"status"`
TestMode bool `json:"testMode"`
TemplateId string `json:"templateId"`
ScheduledAt string `json:"scheduledAt"`
CreatedAt string `json:"createdAt"`
Events []EmailEvent `json:"events"`
}
Email is the response from Emails.Get.
type EmailEvent ¶
type EmailEvent struct {
Id string `json:"id"`
Type string `json:"type"`
Metadata map[string]any `json:"metadata"`
CreatedAt string `json:"createdAt"`
}
EmailEvent is one entry in an email's delivery timeline.
type EmailListItem ¶
type EmailListItem struct {
Id string `json:"id"`
From string `json:"from"`
To []string `json:"to"`
Subject string `json:"subject"`
Status string `json:"status"`
TestMode bool `json:"testMode"`
CreatedAt string `json:"createdAt"`
}
EmailListItem is a row from Emails.List.
type EmailsSvc ¶
type EmailsSvc interface {
Send(params *SendEmailRequest) (*SendEmailResponse, error)
SendWithContext(ctx context.Context, params *SendEmailRequest) (*SendEmailResponse, error)
SendWithOptions(ctx context.Context, params *SendEmailRequest, options *SendEmailOptions) (*SendEmailResponse, error)
Get(emailId string) (*Email, error)
GetWithContext(ctx context.Context, emailId string) (*Email, error)
List(options *ListEmailsOptions) (*ListEmailsResponse, error)
ListWithContext(ctx context.Context, options *ListEmailsOptions) (*ListEmailsResponse, error)
Update(params *UpdateEmailRequest) (*UpdateEmailResponse, error)
UpdateWithContext(ctx context.Context, params *UpdateEmailRequest) (*UpdateEmailResponse, error)
Cancel(emailId string) (*CancelScheduledEmailResponse, error)
CancelWithContext(ctx context.Context, emailId string) (*CancelScheduledEmailResponse, error)
}
EmailsSvc is the /emails API.
type EmailsSvcImpl ¶
type EmailsSvcImpl struct {
// contains filtered or unexported fields
}
func (*EmailsSvcImpl) Cancel ¶
func (s *EmailsSvcImpl) Cancel(emailId string) (*CancelScheduledEmailResponse, error)
Cancel cancels a scheduled email. It fails once the email has started sending.
func (*EmailsSvcImpl) CancelWithContext ¶
func (s *EmailsSvcImpl) CancelWithContext(ctx context.Context, emailId string) (*CancelScheduledEmailResponse, error)
func (*EmailsSvcImpl) Get ¶
func (s *EmailsSvcImpl) Get(emailId string) (*Email, error)
Get retrieves an email by ID, including its delivery events.
func (*EmailsSvcImpl) GetWithContext ¶
func (*EmailsSvcImpl) List ¶
func (s *EmailsSvcImpl) List(options *ListEmailsOptions) (*ListEmailsResponse, error)
List returns a page of emails, most recent first.
func (*EmailsSvcImpl) ListWithContext ¶
func (s *EmailsSvcImpl) ListWithContext(ctx context.Context, options *ListEmailsOptions) (*ListEmailsResponse, error)
func (*EmailsSvcImpl) Send ¶
func (s *EmailsSvcImpl) Send(params *SendEmailRequest) (*SendEmailResponse, error)
Send sends a single email.
func (*EmailsSvcImpl) SendWithContext ¶
func (s *EmailsSvcImpl) SendWithContext(ctx context.Context, params *SendEmailRequest) (*SendEmailResponse, error)
SendWithContext is Send with a caller-supplied context.
func (*EmailsSvcImpl) SendWithOptions ¶
func (s *EmailsSvcImpl) SendWithOptions(ctx context.Context, params *SendEmailRequest, options *SendEmailOptions) (*SendEmailResponse, error)
SendWithOptions is Send with a context and per-call options (e.g. an idempotency key).
func (*EmailsSvcImpl) Update ¶
func (s *EmailsSvcImpl) Update(params *UpdateEmailRequest) (*UpdateEmailResponse, error)
Update reschedules a scheduled email. It fails once the email has started sending.
func (*EmailsSvcImpl) UpdateWithContext ¶
func (s *EmailsSvcImpl) UpdateWithContext(ctx context.Context, params *UpdateEmailRequest) (*UpdateEmailResponse, error)
type Error ¶
type Error struct {
// Message is a human-readable description (the API's `error` field).
Message string `json:"error"`
// Code is a stable machine-readable code (the API's `code` field); see the
// Code* constants. Branch on this rather than on Message.
Code string `json:"code"`
// StatusCode is the HTTP status, or 0 for a network-level failure
// (Code == CodeApplicationError).
StatusCode int `json:"-"`
// RateLimit* are populated from response headers on a 429.
RateLimitReset string `json:"-"`
RateLimitRemaining string `json:"-"`
RetryAfter string `json:"-"`
}
Error is returned when the API responds with a non-2xx status, or when the request never reaches the server. Inspect it with errors.As:
var apiErr *eusend.Error
if errors.As(err, &apiErr) && apiErr.Code == eusend.CodeMonthlyLimitExceeded {
// back off and retry later
}
type GenericResponse ¶
type GenericResponse struct {
Message string `json:"message"`
}
GenericResponse is a simple {"message": "..."} acknowledgement.
type ListContactsOptions ¶
ListContactsOptions filters Audiences.ListContacts. Zero-valued fields are omitted.
type ListContactsResponse ¶
type ListContactsResponse struct {
Data []Contact `json:"data"`
NextCursor string `json:"next_cursor"`
}
ListContactsResponse is a page of contacts.
type ListEmailsOptions ¶
ListEmailsOptions filters Emails.List. Zero-valued fields are omitted.
type ListEmailsResponse ¶
type ListEmailsResponse struct {
Data []EmailListItem `json:"data"`
NextCursor string `json:"next_cursor"`
}
ListEmailsResponse is the response from Emails.List.
type Options ¶
type Options interface {
GetIdempotencyKey() string
}
Options is implemented by per-call option structs (e.g. SendEmailOptions).
type SendBroadcastRequest ¶
type SendBroadcastRequest struct {
// ScheduledAt, when set, schedules the broadcast instead of sending immediately.
ScheduledAt string `json:"scheduled_at,omitempty"`
}
SendBroadcastRequest sends or schedules a broadcast.
type SendBroadcastResponse ¶
type SendBroadcastResponse struct {
Id string `json:"id"`
Status string `json:"status"`
ScheduledAt string `json:"scheduled_at"`
}
SendBroadcastResponse is the response from Broadcasts.Send.
type SendEmailOptions ¶
type SendEmailOptions struct {
// IdempotencyKey makes a send safe to retry: retrying with the same key
// never sends a duplicate and returns the original email's ID.
IdempotencyKey string `json:"-"`
}
SendEmailOptions carries per-call options for Emails.SendWithOptions.
func (SendEmailOptions) GetIdempotencyKey ¶
func (o SendEmailOptions) GetIdempotencyKey() string
GetIdempotencyKey implements the Options interface.
type SendEmailRequest ¶
type SendEmailRequest struct {
// From accepts a bare email ("you@yourdomain.com") or a display-name form
// ("Acme <you@yourdomain.com>"). The domain must be verified on your account.
From string `json:"from"`
To []string `json:"to"`
Subject string `json:"subject,omitempty"`
Bcc []string `json:"bcc,omitempty"`
Cc []string `json:"cc,omitempty"`
ReplyTo []string `json:"reply_to,omitempty"`
Html string `json:"html,omitempty"`
Text string `json:"text,omitempty"`
TemplateId string `json:"template_id,omitempty"`
Variables map[string]any `json:"variables,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
TrackOpens *bool `json:"track_opens,omitempty"`
TrackClicks *bool `json:"track_clicks,omitempty"`
Attachments []*Attachment `json:"attachments,omitempty"`
// ScheduledAt schedules the send for a future time, at most 30 days out.
// Accepts an ISO 8601 string or natural language ("in 1 hour", "tomorrow at
// 9am"), parsed server-side in UTC. Not supported by Batch.Send.
ScheduledAt string `json:"scheduled_at,omitempty"`
}
SendEmailRequest is the request object for Emails.Send. From and To are required; provide at least one of Html, Text, or TemplateId.
type SendEmailResponse ¶
type SendEmailResponse struct {
Id string `json:"id"`
}
SendEmailResponse is the response from Emails.Send.
type Template ¶
type Template struct {
Id string `json:"id"`
Name string `json:"name"`
Subject string `json:"subject"`
Html string `json:"html"`
ReactSource string `json:"reactSource"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Template is a saved email template.
type TemplateListItem ¶
type TemplateListItem struct {
Id string `json:"id"`
Name string `json:"name"`
Subject string `json:"subject"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
TemplateListItem is a row from Templates.List.
type TemplatesSvc ¶
type TemplatesSvc interface {
Create(params *CreateTemplateRequest) (*Template, error)
CreateWithContext(ctx context.Context, params *CreateTemplateRequest) (*Template, error)
List() ([]TemplateListItem, error)
ListWithContext(ctx context.Context) ([]TemplateListItem, error)
Get(templateId string) (*Template, error)
GetWithContext(ctx context.Context, templateId string) (*Template, error)
Update(templateId string, params *UpdateTemplateRequest) (*Template, error)
UpdateWithContext(ctx context.Context, templateId string, params *UpdateTemplateRequest) (*Template, error)
Remove(templateId string) (*GenericResponse, error)
RemoveWithContext(ctx context.Context, templateId string) (*GenericResponse, error)
}
TemplatesSvc is the /templates API.
type TemplatesSvcImpl ¶
type TemplatesSvcImpl struct {
// contains filtered or unexported fields
}
func (*TemplatesSvcImpl) Create ¶
func (s *TemplatesSvcImpl) Create(params *CreateTemplateRequest) (*Template, error)
func (*TemplatesSvcImpl) CreateWithContext ¶
func (s *TemplatesSvcImpl) CreateWithContext(ctx context.Context, params *CreateTemplateRequest) (*Template, error)
func (*TemplatesSvcImpl) GetWithContext ¶
func (*TemplatesSvcImpl) List ¶
func (s *TemplatesSvcImpl) List() ([]TemplateListItem, error)
func (*TemplatesSvcImpl) ListWithContext ¶
func (s *TemplatesSvcImpl) ListWithContext(ctx context.Context) ([]TemplateListItem, error)
func (*TemplatesSvcImpl) Remove ¶
func (s *TemplatesSvcImpl) Remove(templateId string) (*GenericResponse, error)
func (*TemplatesSvcImpl) RemoveWithContext ¶
func (s *TemplatesSvcImpl) RemoveWithContext(ctx context.Context, templateId string) (*GenericResponse, error)
func (*TemplatesSvcImpl) Update ¶
func (s *TemplatesSvcImpl) Update(templateId string, params *UpdateTemplateRequest) (*Template, error)
func (*TemplatesSvcImpl) UpdateWithContext ¶
func (s *TemplatesSvcImpl) UpdateWithContext(ctx context.Context, templateId string, params *UpdateTemplateRequest) (*Template, error)
type UpdateBroadcastRequest ¶
type UpdateBroadcastRequest struct {
Name *string `json:"name,omitempty"`
AudienceId *string `json:"audience_id,omitempty"`
From *string `json:"from,omitempty"`
Subject *string `json:"subject,omitempty"`
Html *string `json:"html,omitempty"`
TemplateId *string `json:"template_id,omitempty"`
TemplateVariables map[string]string `json:"template_variables,omitempty"`
ScheduledAt *string `json:"scheduled_at,omitempty"`
}
UpdateBroadcastRequest updates a broadcast. Empty/nil fields are left unchanged.
type UpdateContactRequest ¶
type UpdateContactRequest struct {
FirstName *string `json:"first_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
Unsubscribed *bool `json:"unsubscribed,omitempty"`
}
UpdateContactRequest updates a contact. Nil fields are left unchanged.
type UpdateEmailRequest ¶
UpdateEmailRequest reschedules a scheduled email.
type UpdateEmailResponse ¶
type UpdateEmailResponse struct {
Id string `json:"id"`
Status string `json:"status"`
ScheduledAt string `json:"scheduled_at"`
}
UpdateEmailResponse is the response from Emails.Update.
type UpdateTemplateRequest ¶
type UpdateTemplateRequest struct {
Name *string `json:"name,omitempty"`
Subject *string `json:"subject,omitempty"`
Html *string `json:"html,omitempty"`
}
UpdateTemplateRequest updates a template. Nil fields are left unchanged.
type UpdateWebhookRequest ¶
type UpdateWebhookRequest struct {
Url *string `json:"url,omitempty"`
Events []string `json:"events,omitempty"`
}
UpdateWebhookRequest updates a webhook. Nil/empty fields are left unchanged.
type Webhook ¶
type Webhook struct {
Id string `json:"id"`
Url string `json:"url"`
Events []string `json:"events"`
Secret string `json:"secret,omitempty"`
CreatedAt string `json:"createdAt"`
Deliveries []WebhookDelivery `json:"deliveries,omitempty"`
}
Webhook is a webhook subscription. Secret is populated only by Create; Deliveries only by Get.
type WebhookDelivery ¶
type WebhookDelivery struct {
Id string `json:"id"`
WebhookId string `json:"webhookId"`
EmailId string `json:"emailId"`
EventType string `json:"eventType"`
Payload map[string]any `json:"payload"`
Status string `json:"status"`
ResponseStatus int `json:"responseStatus"`
Attempts int `json:"attempts"`
CreatedAt string `json:"createdAt"`
LastAttemptAt string `json:"lastAttemptAt"`
}
WebhookDelivery is one delivery attempt of a webhook event.
type WebhooksSvc ¶
type WebhooksSvc interface {
Create(params *CreateWebhookRequest) (*Webhook, error)
CreateWithContext(ctx context.Context, params *CreateWebhookRequest) (*Webhook, error)
List() ([]Webhook, error)
ListWithContext(ctx context.Context) ([]Webhook, error)
Get(webhookId string) (*Webhook, error)
GetWithContext(ctx context.Context, webhookId string) (*Webhook, error)
Update(webhookId string, params *UpdateWebhookRequest) (*Webhook, error)
UpdateWithContext(ctx context.Context, webhookId string, params *UpdateWebhookRequest) (*Webhook, error)
Remove(webhookId string) (*GenericResponse, error)
RemoveWithContext(ctx context.Context, webhookId string) (*GenericResponse, error)
}
WebhooksSvc is the /webhooks API.
type WebhooksSvcImpl ¶
type WebhooksSvcImpl struct {
// contains filtered or unexported fields
}
func (*WebhooksSvcImpl) Create ¶
func (s *WebhooksSvcImpl) Create(params *CreateWebhookRequest) (*Webhook, error)
func (*WebhooksSvcImpl) CreateWithContext ¶
func (s *WebhooksSvcImpl) CreateWithContext(ctx context.Context, params *CreateWebhookRequest) (*Webhook, error)
func (*WebhooksSvcImpl) GetWithContext ¶
func (*WebhooksSvcImpl) List ¶
func (s *WebhooksSvcImpl) List() ([]Webhook, error)
func (*WebhooksSvcImpl) ListWithContext ¶
func (s *WebhooksSvcImpl) ListWithContext(ctx context.Context) ([]Webhook, error)
func (*WebhooksSvcImpl) Remove ¶
func (s *WebhooksSvcImpl) Remove(webhookId string) (*GenericResponse, error)
func (*WebhooksSvcImpl) RemoveWithContext ¶
func (s *WebhooksSvcImpl) RemoveWithContext(ctx context.Context, webhookId string) (*GenericResponse, error)
func (*WebhooksSvcImpl) Update ¶
func (s *WebhooksSvcImpl) Update(webhookId string, params *UpdateWebhookRequest) (*Webhook, error)
func (*WebhooksSvcImpl) UpdateWithContext ¶
func (s *WebhooksSvcImpl) UpdateWithContext(ctx context.Context, webhookId string, params *UpdateWebhookRequest) (*Webhook, error)