Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type APIKeyListParams
- type APIKeyListResponse
- type APIKeyListResponseAPIKey
- type APIKeyNewParams
- type APIKeyNewResponse
- type APIKeyService
- func (r *APIKeyService) Delete(ctx context.Context, apiKey string, opts ...option.RequestOption) (err error)
- func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *APIKeyListResponse, err error)
- func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKeyNewResponse, err error)
- type AddressesUnionParam
- type AttachmentContentDisposition
- type AttachmentFile
- type AttachmentResponse
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CreateDomainParam
- type CreateInboxParam
- type Domain
- type DomainListParams
- type DomainNewParams
- type DomainRecord
- type DomainService
- func (r *DomainService) Delete(ctx context.Context, domainID string, opts ...option.RequestOption) (err error)
- func (r *DomainService) Get(ctx context.Context, domainID string, opts ...option.RequestOption) (res *Domain, err error)
- func (r *DomainService) GetZoneFile(ctx context.Context, domainID string, opts ...option.RequestOption) (err error)
- func (r *DomainService) List(ctx context.Context, query DomainListParams, opts ...option.RequestOption) (res *ListDomains, err error)
- func (r *DomainService) New(ctx context.Context, body DomainNewParams, opts ...option.RequestOption) (res *Domain, err error)
- func (r *DomainService) Verify(ctx context.Context, domainID string, opts ...option.RequestOption) (err error)
- type DomainStatus
- type Draft
- type DraftListParams
- type DraftSendStatus
- type DraftService
- type Error
- type EventType
- type Inbox
- type InboxDraftDeleteParams
- type InboxDraftGetParams
- type InboxDraftListParams
- type InboxDraftNewParams
- type InboxDraftSendParams
- type InboxDraftService
- func (r *InboxDraftService) Delete(ctx context.Context, draftID string, body InboxDraftDeleteParams, ...) (err error)
- func (r *InboxDraftService) Get(ctx context.Context, draftID string, query InboxDraftGetParams, ...) (res *Draft, err error)
- func (r *InboxDraftService) List(ctx context.Context, inboxID string, query InboxDraftListParams, ...) (res *ListDrafts, err error)
- func (r *InboxDraftService) New(ctx context.Context, inboxID string, body InboxDraftNewParams, ...) (res *Draft, err error)
- func (r *InboxDraftService) Send(ctx context.Context, draftID string, params InboxDraftSendParams, ...) (res *SendMessageResponse, err error)
- func (r *InboxDraftService) Update(ctx context.Context, draftID string, params InboxDraftUpdateParams, ...) (res *Draft, err error)
- type InboxDraftUpdateParams
- type InboxListMetricsParams
- type InboxListParams
- type InboxMessageForwardParams
- type InboxMessageGetAttachmentParams
- type InboxMessageGetParams
- type InboxMessageGetRawParams
- type InboxMessageListParams
- type InboxMessageListResponse
- type InboxMessageListResponseMessage
- type InboxMessageReplyAllParams
- type InboxMessageReplyParams
- type InboxMessageSendParams
- type InboxMessageService
- func (r *InboxMessageService) Forward(ctx context.Context, messageID string, params InboxMessageForwardParams, ...) (res *SendMessageResponse, err error)
- func (r *InboxMessageService) Get(ctx context.Context, messageID string, query InboxMessageGetParams, ...) (res *Message, err error)
- func (r *InboxMessageService) GetAttachment(ctx context.Context, attachmentID string, ...) (res *AttachmentResponse, err error)
- func (r *InboxMessageService) GetRaw(ctx context.Context, messageID string, query InboxMessageGetRawParams, ...) (err error)
- func (r *InboxMessageService) List(ctx context.Context, inboxID string, query InboxMessageListParams, ...) (res *InboxMessageListResponse, err error)
- func (r *InboxMessageService) Reply(ctx context.Context, messageID string, params InboxMessageReplyParams, ...) (res *SendMessageResponse, err error)
- func (r *InboxMessageService) ReplyAll(ctx context.Context, messageID string, params InboxMessageReplyAllParams, ...) (res *SendMessageResponse, err error)
- func (r *InboxMessageService) Send(ctx context.Context, inboxID string, body InboxMessageSendParams, ...) (res *SendMessageResponse, err error)
- func (r *InboxMessageService) Update(ctx context.Context, messageID string, params InboxMessageUpdateParams, ...) (res *Message, err error)
- type InboxMessageUpdateParams
- type InboxNewParams
- type InboxService
- func (r *InboxService) Delete(ctx context.Context, inboxID string, opts ...option.RequestOption) (err error)
- func (r *InboxService) Get(ctx context.Context, inboxID string, opts ...option.RequestOption) (res *Inbox, err error)
- func (r *InboxService) List(ctx context.Context, query InboxListParams, opts ...option.RequestOption) (res *ListInboxes, err error)
- func (r *InboxService) ListMetrics(ctx context.Context, inboxID string, query InboxListMetricsParams, ...) (res *ListMetrics, err error)
- func (r *InboxService) New(ctx context.Context, body InboxNewParams, opts ...option.RequestOption) (res *Inbox, err error)
- func (r *InboxService) Update(ctx context.Context, inboxID string, body InboxUpdateParams, ...) (res *Inbox, err error)
- type InboxThreadDeleteParams
- type InboxThreadGetAttachmentParams
- type InboxThreadGetParams
- type InboxThreadListParams
- type InboxThreadService
- func (r *InboxThreadService) Delete(ctx context.Context, threadID string, body InboxThreadDeleteParams, ...) (err error)
- func (r *InboxThreadService) Get(ctx context.Context, threadID string, query InboxThreadGetParams, ...) (res *Thread, err error)
- func (r *InboxThreadService) GetAttachment(ctx context.Context, attachmentID string, query InboxThreadGetAttachmentParams, ...) (res *AttachmentResponse, err error)
- func (r *InboxThreadService) List(ctx context.Context, inboxID string, query InboxThreadListParams, ...) (res *ListThreads, err error)
- type InboxUpdateParams
- type ListDomains
- type ListDomainsDomain
- type ListDrafts
- type ListDraftsDraft
- type ListInboxes
- type ListMetrics
- type ListMetricsMessage
- type ListThreads
- type ListThreadsThread
- type Message
- type MetricEventType
- type MetricListParams
- type MetricService
- type OrganizationGetResponse
- type OrganizationService
- type Pod
- type PodDomainDeleteParams
- type PodDomainListParams
- type PodDomainNewParams
- type PodDomainService
- func (r *PodDomainService) Delete(ctx context.Context, domainID string, body PodDomainDeleteParams, ...) (err error)
- func (r *PodDomainService) List(ctx context.Context, podID string, query PodDomainListParams, ...) (res *ListDomains, err error)
- func (r *PodDomainService) New(ctx context.Context, podID string, body PodDomainNewParams, ...) (res *Domain, err error)
- type PodDraftGetParams
- type PodDraftListParams
- type PodDraftService
- type PodInboxDeleteParams
- type PodInboxGetParams
- type PodInboxListParams
- type PodInboxNewParams
- type PodInboxService
- func (r *PodInboxService) Delete(ctx context.Context, inboxID string, body PodInboxDeleteParams, ...) (err error)
- func (r *PodInboxService) Get(ctx context.Context, inboxID string, query PodInboxGetParams, ...) (res *Inbox, err error)
- func (r *PodInboxService) List(ctx context.Context, podID string, query PodInboxListParams, ...) (res *ListInboxes, err error)
- func (r *PodInboxService) New(ctx context.Context, podID string, body PodInboxNewParams, ...) (res *Inbox, err error)
- type PodListParams
- type PodListResponse
- type PodNewParams
- type PodService
- func (r *PodService) Delete(ctx context.Context, podID string, opts ...option.RequestOption) (err error)
- func (r *PodService) Get(ctx context.Context, podID string, opts ...option.RequestOption) (res *Pod, err error)
- func (r *PodService) List(ctx context.Context, query PodListParams, opts ...option.RequestOption) (res *PodListResponse, err error)
- func (r *PodService) New(ctx context.Context, body PodNewParams, opts ...option.RequestOption) (res *Pod, err error)
- type PodThreadGetAttachmentParams
- type PodThreadGetParams
- type PodThreadListParams
- type PodThreadService
- func (r *PodThreadService) Get(ctx context.Context, threadID string, query PodThreadGetParams, ...) (res *Thread, err error)
- func (r *PodThreadService) GetAttachment(ctx context.Context, attachmentID string, query PodThreadGetAttachmentParams, ...) (res *AttachmentResponse, err error)
- func (r *PodThreadService) List(ctx context.Context, podID string, query PodThreadListParams, ...) (res *ListThreads, err error)
- type SendAttachmentParam
- type SendMessageRequestParam
- type SendMessageResponse
- type Thread
- type ThreadGetAttachmentParams
- type ThreadListParams
- type ThreadService
- func (r *ThreadService) Get(ctx context.Context, threadID string, opts ...option.RequestOption) (res *Thread, err error)
- func (r *ThreadService) GetAttachment(ctx context.Context, attachmentID string, query ThreadGetAttachmentParams, ...) (res *AttachmentResponse, err error)
- func (r *ThreadService) List(ctx context.Context, query ThreadListParams, opts ...option.RequestOption) (res *ListThreads, err error)
- type UpdateMessageParam
- type Webhook
- type WebhookListParams
- type WebhookListResponse
- type WebhookNewParams
- type WebhookService
- func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (err error)
- func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *Webhook, err error)
- func (r *WebhookService) List(ctx context.Context, query WebhookListParams, opts ...option.RequestOption) (res *WebhookListResponse, err error)
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *Webhook, err error)
- func (r *WebhookService) Update(ctx context.Context, webhookID string, body WebhookUpdateParams, ...) (res *Webhook, err error)
- type WebhookUpdateParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (AGENTMAIL_API_KEY, AGENTMAIL_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type APIKeyListParams ¶
type APIKeyListParams struct {
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (APIKeyListParams) URLQuery ¶
func (r APIKeyListParams) URLQuery() (v url.Values, err error)
URLQuery serializes APIKeyListParams's query parameters as `url.Values`.
type APIKeyListResponse ¶
type APIKeyListResponse struct {
// Ordered by `created_at` descending.
APIKeys []APIKeyListResponseAPIKey `json:"api_keys" api:"required"`
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
APIKeys respjson.Field
Count respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (APIKeyListResponse) RawJSON ¶
func (r APIKeyListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*APIKeyListResponse) UnmarshalJSON ¶
func (r *APIKeyListResponse) UnmarshalJSON(data []byte) error
type APIKeyListResponseAPIKey ¶
type APIKeyListResponseAPIKey struct {
// ID of api key.
APIKeyID string `json:"api_key_id" api:"required"`
// Time at which api key was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Name of api key.
Name string `json:"name" api:"required"`
// Prefix of api key.
Prefix string `json:"prefix" api:"required"`
// Time at which api key was last used.
UsedAt time.Time `json:"used_at" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
APIKeyID respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Prefix respjson.Field
UsedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (APIKeyListResponseAPIKey) RawJSON ¶
func (r APIKeyListResponseAPIKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*APIKeyListResponseAPIKey) UnmarshalJSON ¶
func (r *APIKeyListResponseAPIKey) UnmarshalJSON(data []byte) error
type APIKeyNewParams ¶
type APIKeyNewParams struct {
// Name of api key.
Name string `json:"name" api:"required"`
// contains filtered or unexported fields
}
func (APIKeyNewParams) MarshalJSON ¶
func (r APIKeyNewParams) MarshalJSON() (data []byte, err error)
func (*APIKeyNewParams) UnmarshalJSON ¶
func (r *APIKeyNewParams) UnmarshalJSON(data []byte) error
type APIKeyNewResponse ¶
type APIKeyNewResponse struct {
// API key.
APIKey string `json:"api_key" api:"required"`
// ID of api key.
APIKeyID string `json:"api_key_id" api:"required"`
// Time at which api key was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Name of api key.
Name string `json:"name" api:"required"`
// Prefix of api key.
Prefix string `json:"prefix" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
APIKey respjson.Field
APIKeyID respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Prefix respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (APIKeyNewResponse) RawJSON ¶
func (r APIKeyNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*APIKeyNewResponse) UnmarshalJSON ¶
func (r *APIKeyNewResponse) UnmarshalJSON(data []byte) error
type APIKeyService ¶
type APIKeyService struct {
Options []option.RequestOption
}
APIKeyService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAPIKeyService method instead.
func NewAPIKeyService ¶
func NewAPIKeyService(opts ...option.RequestOption) (r APIKeyService)
NewAPIKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*APIKeyService) Delete ¶
func (r *APIKeyService) Delete(ctx context.Context, apiKey string, opts ...option.RequestOption) (err error)
Delete API Key
func (*APIKeyService) List ¶
func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *APIKeyListResponse, err error)
List API Keys
func (*APIKeyService) New ¶
func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKeyNewResponse, err error)
Create API Key
type AddressesUnionParam ¶
type AddressesUnionParam struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfStringArray []string `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (AddressesUnionParam) MarshalJSON ¶
func (u AddressesUnionParam) MarshalJSON() ([]byte, error)
func (*AddressesUnionParam) UnmarshalJSON ¶
func (u *AddressesUnionParam) UnmarshalJSON(data []byte) error
type AttachmentContentDisposition ¶
type AttachmentContentDisposition string
Content disposition of attachment.
const ( AttachmentContentDispositionInline AttachmentContentDisposition = "inline" AttachmentContentDispositionAttachment AttachmentContentDisposition = "attachment" )
type AttachmentFile ¶
type AttachmentFile struct {
// ID of attachment.
AttachmentID string `json:"attachment_id" api:"required"`
// Size of attachment in bytes.
Size int64 `json:"size" api:"required"`
// Content disposition of attachment.
//
// Any of "inline", "attachment".
ContentDisposition AttachmentContentDisposition `json:"content_disposition" api:"nullable"`
// Content ID of attachment.
ContentID string `json:"content_id" api:"nullable"`
// Content type of attachment.
ContentType string `json:"content_type" api:"nullable"`
// Filename of attachment.
Filename string `json:"filename" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AttachmentID respjson.Field
Size respjson.Field
ContentDisposition respjson.Field
ContentID respjson.Field
ContentType respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AttachmentFile) RawJSON ¶
func (r AttachmentFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*AttachmentFile) UnmarshalJSON ¶
func (r *AttachmentFile) UnmarshalJSON(data []byte) error
type AttachmentResponse ¶
type AttachmentResponse struct {
// ID of attachment.
AttachmentID string `json:"attachment_id" api:"required"`
// URL to download the attachment.
DownloadURL string `json:"download_url" api:"required"`
// Time at which the download URL expires.
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
// Size of attachment in bytes.
Size int64 `json:"size" api:"required"`
// Content disposition of attachment.
//
// Any of "inline", "attachment".
ContentDisposition AttachmentContentDisposition `json:"content_disposition" api:"nullable"`
// Content ID of attachment.
ContentID string `json:"content_id" api:"nullable"`
// Content type of attachment.
ContentType string `json:"content_type" api:"nullable"`
// Filename of attachment.
Filename string `json:"filename" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AttachmentID respjson.Field
DownloadURL respjson.Field
ExpiresAt respjson.Field
Size respjson.Field
ContentDisposition respjson.Field
ContentID respjson.Field
ContentType respjson.Field
Filename respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AttachmentResponse) RawJSON ¶
func (r AttachmentResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AttachmentResponse) UnmarshalJSON ¶
func (r *AttachmentResponse) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
Inboxes InboxService
Pods PodService
Webhooks WebhookService
APIKeys APIKeyService
Domains DomainService
Drafts DraftService
Metrics MetricService
Organizations OrganizationService
Threads ThreadService
}
Client creates a struct with services and top level methods that help with interacting with the agentmail API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (AGENTMAIL_API_KEY, AGENTMAIL_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CreateDomainParam ¶
type CreateDomainParam struct {
// The name of the domain. (e.g., "example.com")
Domain string `json:"domain" api:"required"`
// Bounce and complaint notifications are sent to your inboxes.
FeedbackEnabled bool `json:"feedback_enabled" api:"required"`
// contains filtered or unexported fields
}
The properties Domain, FeedbackEnabled are required.
func (CreateDomainParam) MarshalJSON ¶
func (r CreateDomainParam) MarshalJSON() (data []byte, err error)
func (*CreateDomainParam) UnmarshalJSON ¶
func (r *CreateDomainParam) UnmarshalJSON(data []byte) error
type CreateInboxParam ¶
type CreateInboxParam struct {
// Client ID of inbox.
ClientID param.Opt[string] `json:"client_id,omitzero"`
// Display name: `Display Name <[email protected]>`.
DisplayName param.Opt[string] `json:"display_name,omitzero"`
// Domain of address. Must be verified domain. Defaults to `agentmail.to`.
Domain param.Opt[string] `json:"domain,omitzero"`
// Username of address. Randomly generated if not specified.
Username param.Opt[string] `json:"username,omitzero"`
// contains filtered or unexported fields
}
func (CreateInboxParam) MarshalJSON ¶
func (r CreateInboxParam) MarshalJSON() (data []byte, err error)
func (*CreateInboxParam) UnmarshalJSON ¶
func (r *CreateInboxParam) UnmarshalJSON(data []byte) error
type Domain ¶
type Domain struct {
// Time at which the domain was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// The name of the domain. (e.g., " your-domain.com")
DomainID string `json:"domain_id" api:"required"`
// Bounce and complaint notifications are sent to your inboxes.
FeedbackEnabled bool `json:"feedback_enabled" api:"required"`
// A list of DNS records required to verify the domain.
Records []DomainRecord `json:"records" api:"required"`
// The verification status of the domain.
//
// Any of "NOT_STARTED", "PENDING", "INVALID", "FAILED", "VERIFYING", "VERIFIED".
Status DomainStatus `json:"status" api:"required"`
// Time at which the domain was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Client ID of domain.
ClientID string `json:"client_id" api:"nullable"`
// ID of pod.
PodID string `json:"pod_id" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
DomainID respjson.Field
FeedbackEnabled respjson.Field
Records respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
ClientID respjson.Field
PodID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Domain) UnmarshalJSON ¶
type DomainListParams ¶
type DomainListParams struct {
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (DomainListParams) URLQuery ¶
func (r DomainListParams) URLQuery() (v url.Values, err error)
URLQuery serializes DomainListParams's query parameters as `url.Values`.
type DomainNewParams ¶
type DomainNewParams struct {
CreateDomain CreateDomainParam
// contains filtered or unexported fields
}
func (DomainNewParams) MarshalJSON ¶
func (r DomainNewParams) MarshalJSON() (data []byte, err error)
func (*DomainNewParams) UnmarshalJSON ¶
func (r *DomainNewParams) UnmarshalJSON(data []byte) error
type DomainRecord ¶
type DomainRecord struct {
// The name or host of the record.
Name string `json:"name" api:"required"`
// The verification status of this specific record.
//
// Any of "MISSING", "INVALID", "VALID".
Status string `json:"status" api:"required"`
// The type of the DNS record.
//
// Any of "TXT", "CNAME", "MX".
Type string `json:"type" api:"required"`
// The value of the record.
Value string `json:"value" api:"required"`
// The priority of the MX record.
Priority int64 `json:"priority" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Status respjson.Field
Type respjson.Field
Value respjson.Field
Priority respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DomainRecord) RawJSON ¶
func (r DomainRecord) RawJSON() string
Returns the unmodified JSON received from the API
func (*DomainRecord) UnmarshalJSON ¶
func (r *DomainRecord) UnmarshalJSON(data []byte) error
type DomainService ¶
type DomainService struct {
Options []option.RequestOption
}
DomainService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDomainService method instead.
func NewDomainService ¶
func NewDomainService(opts ...option.RequestOption) (r DomainService)
NewDomainService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DomainService) Delete ¶
func (r *DomainService) Delete(ctx context.Context, domainID string, opts ...option.RequestOption) (err error)
Delete Domain
func (*DomainService) Get ¶
func (r *DomainService) Get(ctx context.Context, domainID string, opts ...option.RequestOption) (res *Domain, err error)
Get Domain
func (*DomainService) GetZoneFile ¶
func (r *DomainService) GetZoneFile(ctx context.Context, domainID string, opts ...option.RequestOption) (err error)
Get Zone File
func (*DomainService) List ¶
func (r *DomainService) List(ctx context.Context, query DomainListParams, opts ...option.RequestOption) (res *ListDomains, err error)
List Domains
func (*DomainService) New ¶
func (r *DomainService) New(ctx context.Context, body DomainNewParams, opts ...option.RequestOption) (res *Domain, err error)
Create Domain
func (*DomainService) Verify ¶
func (r *DomainService) Verify(ctx context.Context, domainID string, opts ...option.RequestOption) (err error)
Verify Domain
type DomainStatus ¶
type DomainStatus string
The verification status of the domain.
const ( DomainStatusNotStarted DomainStatus = "NOT_STARTED" DomainStatusPending DomainStatus = "PENDING" DomainStatusInvalid DomainStatus = "INVALID" DomainStatusFailed DomainStatus = "FAILED" DomainStatusVerifying DomainStatus = "VERIFYING" DomainStatusVerified DomainStatus = "VERIFIED" )
type Draft ¶
type Draft struct {
// Time at which draft was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// ID of draft.
DraftID string `json:"draft_id" api:"required"`
// ID of inbox.
InboxID string `json:"inbox_id" api:"required"`
// Labels of draft.
Labels []string `json:"labels" api:"required"`
// ID of thread.
ThreadID string `json:"thread_id" api:"required"`
// Time at which draft was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Attachments in draft.
Attachments []AttachmentFile `json:"attachments" api:"nullable"`
// Addresses of BCC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Bcc []string `json:"bcc" api:"nullable"`
// Addresses of CC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Cc []string `json:"cc" api:"nullable"`
// Client ID of draft.
ClientID string `json:"client_id" api:"nullable"`
// HTML body of draft.
HTML string `json:"html" api:"nullable"`
// ID of message being replied to.
InReplyTo string `json:"in_reply_to" api:"nullable"`
// Text preview of draft.
Preview string `json:"preview" api:"nullable"`
// IDs of previous messages in thread.
References []string `json:"references" api:"nullable"`
// Reply-to addresses. In format `[email protected]` or
// `Display Name <[email protected]>`.
ReplyTo []string `json:"reply_to" api:"nullable"`
// Time at which to schedule send draft.
SendAt time.Time `json:"send_at" api:"nullable" format:"date-time"`
// Schedule send status of draft.
//
// Any of "scheduled", "sending", "failed".
SendStatus DraftSendStatus `json:"send_status" api:"nullable"`
// Subject of draft.
Subject string `json:"subject" api:"nullable"`
// Plain text body of draft.
Text string `json:"text" api:"nullable"`
// Addresses of recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
To []string `json:"to" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
DraftID respjson.Field
InboxID respjson.Field
Labels respjson.Field
ThreadID respjson.Field
UpdatedAt respjson.Field
Attachments respjson.Field
Bcc respjson.Field
Cc respjson.Field
ClientID respjson.Field
HTML respjson.Field
InReplyTo respjson.Field
Preview respjson.Field
References respjson.Field
ReplyTo respjson.Field
SendAt respjson.Field
SendStatus respjson.Field
Subject respjson.Field
Text respjson.Field
To respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Draft) UnmarshalJSON ¶
type DraftListParams ¶
type DraftListParams struct {
// Timestamp after which to filter by.
After param.Opt[time.Time] `query:"after,omitzero" format:"date-time" json:"-"`
// Sort in ascending temporal order.
Ascending param.Opt[bool] `query:"ascending,omitzero" json:"-"`
// Timestamp before which to filter by.
Before param.Opt[time.Time] `query:"before,omitzero" format:"date-time" json:"-"`
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// Labels to filter by.
Labels []string `query:"labels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (DraftListParams) URLQuery ¶
func (r DraftListParams) URLQuery() (v url.Values, err error)
URLQuery serializes DraftListParams's query parameters as `url.Values`.
type DraftSendStatus ¶
type DraftSendStatus string
Schedule send status of draft.
const ( DraftSendStatusScheduled DraftSendStatus = "scheduled" DraftSendStatusSending DraftSendStatus = "sending" DraftSendStatusFailed DraftSendStatus = "failed" )
type DraftService ¶
type DraftService struct {
Options []option.RequestOption
}
DraftService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDraftService method instead.
func NewDraftService ¶
func NewDraftService(opts ...option.RequestOption) (r DraftService)
NewDraftService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DraftService) Get ¶
func (r *DraftService) Get(ctx context.Context, draftID string, opts ...option.RequestOption) (res *Draft, err error)
Get Draft
func (*DraftService) List ¶
func (r *DraftService) List(ctx context.Context, query DraftListParams, opts ...option.RequestOption) (res *ListDrafts, err error)
List Drafts
type EventType ¶
type EventType string
const ( EventTypeMessageReceived EventType = "message.received" EventTypeMessageSent EventType = "message.sent" EventTypeMessageDelivered EventType = "message.delivered" EventTypeMessageBounced EventType = "message.bounced" EventTypeMessageComplained EventType = "message.complained" EventTypeMessageRejected EventType = "message.rejected" EventTypeDomainVerified EventType = "domain.verified" )
type Inbox ¶
type Inbox struct {
// Time at which inbox was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// ID of inbox.
InboxID string `json:"inbox_id" api:"required"`
// ID of pod.
PodID string `json:"pod_id" api:"required"`
// Time at which inbox was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Client ID of inbox.
ClientID string `json:"client_id" api:"nullable"`
// Display name: `Display Name <[email protected]>`.
DisplayName string `json:"display_name" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
InboxID respjson.Field
PodID respjson.Field
UpdatedAt respjson.Field
ClientID respjson.Field
DisplayName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Inbox) UnmarshalJSON ¶
type InboxDraftDeleteParams ¶
type InboxDraftDeleteParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type InboxDraftGetParams ¶
type InboxDraftGetParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type InboxDraftListParams ¶
type InboxDraftListParams struct {
// Timestamp after which to filter by.
After param.Opt[time.Time] `query:"after,omitzero" format:"date-time" json:"-"`
// Sort in ascending temporal order.
Ascending param.Opt[bool] `query:"ascending,omitzero" json:"-"`
// Timestamp before which to filter by.
Before param.Opt[time.Time] `query:"before,omitzero" format:"date-time" json:"-"`
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// Labels to filter by.
Labels []string `query:"labels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (InboxDraftListParams) URLQuery ¶
func (r InboxDraftListParams) URLQuery() (v url.Values, err error)
URLQuery serializes InboxDraftListParams's query parameters as `url.Values`.
type InboxDraftNewParams ¶
type InboxDraftNewParams struct {
// Client ID of draft.
ClientID param.Opt[string] `json:"client_id,omitzero"`
// HTML body of draft.
HTML param.Opt[string] `json:"html,omitzero"`
// ID of message being replied to.
InReplyTo param.Opt[string] `json:"in_reply_to,omitzero"`
// Time at which to schedule send draft.
SendAt param.Opt[time.Time] `json:"send_at,omitzero" format:"date-time"`
// Subject of draft.
Subject param.Opt[string] `json:"subject,omitzero"`
// Plain text body of draft.
Text param.Opt[string] `json:"text,omitzero"`
// Addresses of BCC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Bcc []string `json:"bcc,omitzero"`
// Addresses of CC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Cc []string `json:"cc,omitzero"`
// Labels of draft.
Labels []string `json:"labels,omitzero"`
// Reply-to addresses. In format `[email protected]` or
// `Display Name <[email protected]>`.
ReplyTo []string `json:"reply_to,omitzero"`
// Addresses of recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
To []string `json:"to,omitzero"`
// contains filtered or unexported fields
}
func (InboxDraftNewParams) MarshalJSON ¶
func (r InboxDraftNewParams) MarshalJSON() (data []byte, err error)
func (*InboxDraftNewParams) UnmarshalJSON ¶
func (r *InboxDraftNewParams) UnmarshalJSON(data []byte) error
type InboxDraftSendParams ¶
type InboxDraftSendParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
UpdateMessage UpdateMessageParam
// contains filtered or unexported fields
}
func (InboxDraftSendParams) MarshalJSON ¶
func (r InboxDraftSendParams) MarshalJSON() (data []byte, err error)
func (*InboxDraftSendParams) UnmarshalJSON ¶
func (r *InboxDraftSendParams) UnmarshalJSON(data []byte) error
type InboxDraftService ¶
type InboxDraftService struct {
Options []option.RequestOption
}
InboxDraftService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxDraftService method instead.
func NewInboxDraftService ¶
func NewInboxDraftService(opts ...option.RequestOption) (r InboxDraftService)
NewInboxDraftService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*InboxDraftService) Delete ¶
func (r *InboxDraftService) Delete(ctx context.Context, draftID string, body InboxDraftDeleteParams, opts ...option.RequestOption) (err error)
Delete Draft
func (*InboxDraftService) Get ¶
func (r *InboxDraftService) Get(ctx context.Context, draftID string, query InboxDraftGetParams, opts ...option.RequestOption) (res *Draft, err error)
Get Draft
func (*InboxDraftService) List ¶
func (r *InboxDraftService) List(ctx context.Context, inboxID string, query InboxDraftListParams, opts ...option.RequestOption) (res *ListDrafts, err error)
List Drafts
func (*InboxDraftService) New ¶
func (r *InboxDraftService) New(ctx context.Context, inboxID string, body InboxDraftNewParams, opts ...option.RequestOption) (res *Draft, err error)
Create Draft
func (*InboxDraftService) Send ¶
func (r *InboxDraftService) Send(ctx context.Context, draftID string, params InboxDraftSendParams, opts ...option.RequestOption) (res *SendMessageResponse, err error)
Send Draft
func (*InboxDraftService) Update ¶
func (r *InboxDraftService) Update(ctx context.Context, draftID string, params InboxDraftUpdateParams, opts ...option.RequestOption) (res *Draft, err error)
Update Draft
type InboxDraftUpdateParams ¶
type InboxDraftUpdateParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// HTML body of draft.
HTML param.Opt[string] `json:"html,omitzero"`
// Time at which to schedule send draft.
SendAt param.Opt[time.Time] `json:"send_at,omitzero" format:"date-time"`
// Subject of draft.
Subject param.Opt[string] `json:"subject,omitzero"`
// Plain text body of draft.
Text param.Opt[string] `json:"text,omitzero"`
// Addresses of BCC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Bcc []string `json:"bcc,omitzero"`
// Addresses of CC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Cc []string `json:"cc,omitzero"`
// Reply-to addresses. In format `[email protected]` or
// `Display Name <[email protected]>`.
ReplyTo []string `json:"reply_to,omitzero"`
// Addresses of recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
To []string `json:"to,omitzero"`
// contains filtered or unexported fields
}
func (InboxDraftUpdateParams) MarshalJSON ¶
func (r InboxDraftUpdateParams) MarshalJSON() (data []byte, err error)
func (*InboxDraftUpdateParams) UnmarshalJSON ¶
func (r *InboxDraftUpdateParams) UnmarshalJSON(data []byte) error
type InboxListMetricsParams ¶
type InboxListMetricsParams struct {
// End timestamp for the metrics query range.
EndTimestamp time.Time `query:"end_timestamp" api:"required" format:"date-time" json:"-"`
// Start timestamp for the metrics query range.
StartTimestamp time.Time `query:"start_timestamp" api:"required" format:"date-time" json:"-"`
// List of metric event types to filter by.
EventTypes []MetricEventType `query:"event_types,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (InboxListMetricsParams) URLQuery ¶
func (r InboxListMetricsParams) URLQuery() (v url.Values, err error)
URLQuery serializes InboxListMetricsParams's query parameters as `url.Values`.
type InboxListParams ¶
type InboxListParams struct {
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (InboxListParams) URLQuery ¶
func (r InboxListParams) URLQuery() (v url.Values, err error)
URLQuery serializes InboxListParams's query parameters as `url.Values`.
type InboxMessageForwardParams ¶
type InboxMessageForwardParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
SendMessageRequest SendMessageRequestParam
// contains filtered or unexported fields
}
func (InboxMessageForwardParams) MarshalJSON ¶
func (r InboxMessageForwardParams) MarshalJSON() (data []byte, err error)
func (*InboxMessageForwardParams) UnmarshalJSON ¶
func (r *InboxMessageForwardParams) UnmarshalJSON(data []byte) error
type InboxMessageGetParams ¶
type InboxMessageGetParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type InboxMessageGetRawParams ¶
type InboxMessageGetRawParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type InboxMessageListParams ¶
type InboxMessageListParams struct {
// Timestamp after which to filter by.
After param.Opt[time.Time] `query:"after,omitzero" format:"date-time" json:"-"`
// Sort in ascending temporal order.
Ascending param.Opt[bool] `query:"ascending,omitzero" json:"-"`
// Timestamp before which to filter by.
Before param.Opt[time.Time] `query:"before,omitzero" format:"date-time" json:"-"`
// Include spam in results.
IncludeSpam param.Opt[bool] `query:"include_spam,omitzero" json:"-"`
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// Labels to filter by.
Labels []string `query:"labels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (InboxMessageListParams) URLQuery ¶
func (r InboxMessageListParams) URLQuery() (v url.Values, err error)
URLQuery serializes InboxMessageListParams's query parameters as `url.Values`.
type InboxMessageListResponse ¶
type InboxMessageListResponse struct {
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Ordered by `timestamp` descending.
Messages []InboxMessageListResponseMessage `json:"messages" api:"required"`
// Limit of number of items returned.
Limit int64 `json:"limit" api:"nullable"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Messages respjson.Field
Limit respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InboxMessageListResponse) RawJSON ¶
func (r InboxMessageListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*InboxMessageListResponse) UnmarshalJSON ¶
func (r *InboxMessageListResponse) UnmarshalJSON(data []byte) error
type InboxMessageListResponseMessage ¶
type InboxMessageListResponseMessage struct {
// Time at which message was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Address of sender. In format `[email protected]` or
// `Display Name <[email protected]>`.
From string `json:"from" api:"required"`
// ID of inbox.
InboxID string `json:"inbox_id" api:"required"`
// Labels of message.
Labels []string `json:"labels" api:"required"`
// ID of message.
MessageID string `json:"message_id" api:"required"`
// Size of message in bytes.
Size int64 `json:"size" api:"required"`
// ID of thread.
ThreadID string `json:"thread_id" api:"required"`
// Time at which message was sent or drafted.
Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
// Addresses of recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
To []string `json:"to" api:"required"`
// Time at which message was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Attachments in message.
Attachments []AttachmentFile `json:"attachments" api:"nullable"`
// Addresses of BCC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Bcc []string `json:"bcc" api:"nullable"`
// Addresses of CC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Cc []string `json:"cc" api:"nullable"`
// Headers in message.
Headers map[string]string `json:"headers" api:"nullable"`
// ID of message being replied to.
InReplyTo string `json:"in_reply_to" api:"nullable"`
// Text preview of message.
Preview string `json:"preview" api:"nullable"`
// IDs of previous messages in thread.
References []string `json:"references" api:"nullable"`
// Subject of message.
Subject string `json:"subject" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
From respjson.Field
InboxID respjson.Field
Labels respjson.Field
MessageID respjson.Field
Size respjson.Field
ThreadID respjson.Field
Timestamp respjson.Field
To respjson.Field
UpdatedAt respjson.Field
Attachments respjson.Field
Bcc respjson.Field
Cc respjson.Field
Headers respjson.Field
InReplyTo respjson.Field
Preview respjson.Field
References respjson.Field
Subject respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (InboxMessageListResponseMessage) RawJSON ¶
func (r InboxMessageListResponseMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*InboxMessageListResponseMessage) UnmarshalJSON ¶
func (r *InboxMessageListResponseMessage) UnmarshalJSON(data []byte) error
type InboxMessageReplyAllParams ¶
type InboxMessageReplyAllParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// HTML body of message.
HTML param.Opt[string] `json:"html,omitzero"`
// Plain text body of message.
Text param.Opt[string] `json:"text,omitzero"`
// Attachments to include in message.
Attachments []SendAttachmentParam `json:"attachments,omitzero"`
// Headers to include in message.
Headers map[string]string `json:"headers,omitzero"`
// Labels of message.
Labels []string `json:"labels,omitzero"`
// Reply-to address or addresses.
ReplyTo AddressesUnionParam `json:"reply_to,omitzero"`
// contains filtered or unexported fields
}
func (InboxMessageReplyAllParams) MarshalJSON ¶
func (r InboxMessageReplyAllParams) MarshalJSON() (data []byte, err error)
func (*InboxMessageReplyAllParams) UnmarshalJSON ¶
func (r *InboxMessageReplyAllParams) UnmarshalJSON(data []byte) error
type InboxMessageReplyParams ¶
type InboxMessageReplyParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// HTML body of message.
HTML param.Opt[string] `json:"html,omitzero"`
// Reply to all recipients of the original message.
ReplyAll param.Opt[bool] `json:"reply_all,omitzero"`
// Plain text body of message.
Text param.Opt[string] `json:"text,omitzero"`
// Attachments to include in message.
Attachments []SendAttachmentParam `json:"attachments,omitzero"`
// Headers to include in message.
Headers map[string]string `json:"headers,omitzero"`
// Labels of message.
Labels []string `json:"labels,omitzero"`
// BCC recipient address or addresses.
Bcc AddressesUnionParam `json:"bcc,omitzero"`
// CC recipient address or addresses.
Cc AddressesUnionParam `json:"cc,omitzero"`
// Reply-to address or addresses.
ReplyTo AddressesUnionParam `json:"reply_to,omitzero"`
// Recipient address or addresses.
To AddressesUnionParam `json:"to,omitzero"`
// contains filtered or unexported fields
}
func (InboxMessageReplyParams) MarshalJSON ¶
func (r InboxMessageReplyParams) MarshalJSON() (data []byte, err error)
func (*InboxMessageReplyParams) UnmarshalJSON ¶
func (r *InboxMessageReplyParams) UnmarshalJSON(data []byte) error
type InboxMessageSendParams ¶
type InboxMessageSendParams struct {
SendMessageRequest SendMessageRequestParam
// contains filtered or unexported fields
}
func (InboxMessageSendParams) MarshalJSON ¶
func (r InboxMessageSendParams) MarshalJSON() (data []byte, err error)
func (*InboxMessageSendParams) UnmarshalJSON ¶
func (r *InboxMessageSendParams) UnmarshalJSON(data []byte) error
type InboxMessageService ¶
type InboxMessageService struct {
Options []option.RequestOption
}
InboxMessageService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxMessageService method instead.
func NewInboxMessageService ¶
func NewInboxMessageService(opts ...option.RequestOption) (r InboxMessageService)
NewInboxMessageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*InboxMessageService) Forward ¶
func (r *InboxMessageService) Forward(ctx context.Context, messageID string, params InboxMessageForwardParams, opts ...option.RequestOption) (res *SendMessageResponse, err error)
Forward Message
func (*InboxMessageService) Get ¶
func (r *InboxMessageService) Get(ctx context.Context, messageID string, query InboxMessageGetParams, opts ...option.RequestOption) (res *Message, err error)
Get Message
func (*InboxMessageService) GetAttachment ¶
func (r *InboxMessageService) GetAttachment(ctx context.Context, attachmentID string, query InboxMessageGetAttachmentParams, opts ...option.RequestOption) (res *AttachmentResponse, err error)
Get Attachment
func (*InboxMessageService) GetRaw ¶
func (r *InboxMessageService) GetRaw(ctx context.Context, messageID string, query InboxMessageGetRawParams, opts ...option.RequestOption) (err error)
Get Raw Message
func (*InboxMessageService) List ¶
func (r *InboxMessageService) List(ctx context.Context, inboxID string, query InboxMessageListParams, opts ...option.RequestOption) (res *InboxMessageListResponse, err error)
List Messages
func (*InboxMessageService) Reply ¶
func (r *InboxMessageService) Reply(ctx context.Context, messageID string, params InboxMessageReplyParams, opts ...option.RequestOption) (res *SendMessageResponse, err error)
Reply To Message
func (*InboxMessageService) ReplyAll ¶
func (r *InboxMessageService) ReplyAll(ctx context.Context, messageID string, params InboxMessageReplyAllParams, opts ...option.RequestOption) (res *SendMessageResponse, err error)
Reply All Message
func (*InboxMessageService) Send ¶
func (r *InboxMessageService) Send(ctx context.Context, inboxID string, body InboxMessageSendParams, opts ...option.RequestOption) (res *SendMessageResponse, err error)
Send Message
func (*InboxMessageService) Update ¶
func (r *InboxMessageService) Update(ctx context.Context, messageID string, params InboxMessageUpdateParams, opts ...option.RequestOption) (res *Message, err error)
Update Message
type InboxMessageUpdateParams ¶
type InboxMessageUpdateParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
UpdateMessage UpdateMessageParam
// contains filtered or unexported fields
}
func (InboxMessageUpdateParams) MarshalJSON ¶
func (r InboxMessageUpdateParams) MarshalJSON() (data []byte, err error)
func (*InboxMessageUpdateParams) UnmarshalJSON ¶
func (r *InboxMessageUpdateParams) UnmarshalJSON(data []byte) error
type InboxNewParams ¶
type InboxNewParams struct {
CreateInbox CreateInboxParam
// contains filtered or unexported fields
}
func (InboxNewParams) MarshalJSON ¶
func (r InboxNewParams) MarshalJSON() (data []byte, err error)
func (*InboxNewParams) UnmarshalJSON ¶
func (r *InboxNewParams) UnmarshalJSON(data []byte) error
type InboxService ¶
type InboxService struct {
Options []option.RequestOption
Drafts InboxDraftService
Messages InboxMessageService
Threads InboxThreadService
}
InboxService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxService method instead.
func NewInboxService ¶
func NewInboxService(opts ...option.RequestOption) (r InboxService)
NewInboxService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*InboxService) Delete ¶
func (r *InboxService) Delete(ctx context.Context, inboxID string, opts ...option.RequestOption) (err error)
Delete Inbox
func (*InboxService) Get ¶
func (r *InboxService) Get(ctx context.Context, inboxID string, opts ...option.RequestOption) (res *Inbox, err error)
Get Inbox
func (*InboxService) List ¶
func (r *InboxService) List(ctx context.Context, query InboxListParams, opts ...option.RequestOption) (res *ListInboxes, err error)
List Inboxes
func (*InboxService) ListMetrics ¶
func (r *InboxService) ListMetrics(ctx context.Context, inboxID string, query InboxListMetricsParams, opts ...option.RequestOption) (res *ListMetrics, err error)
List Metrics
func (*InboxService) New ¶
func (r *InboxService) New(ctx context.Context, body InboxNewParams, opts ...option.RequestOption) (res *Inbox, err error)
Create Inbox
func (*InboxService) Update ¶
func (r *InboxService) Update(ctx context.Context, inboxID string, body InboxUpdateParams, opts ...option.RequestOption) (res *Inbox, err error)
Update Inbox
type InboxThreadDeleteParams ¶
type InboxThreadDeleteParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type InboxThreadGetParams ¶
type InboxThreadGetParams struct {
// ID of inbox.
InboxID string `path:"inbox_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type InboxThreadListParams ¶
type InboxThreadListParams struct {
// Timestamp after which to filter by.
After param.Opt[time.Time] `query:"after,omitzero" format:"date-time" json:"-"`
// Sort in ascending temporal order.
Ascending param.Opt[bool] `query:"ascending,omitzero" json:"-"`
// Timestamp before which to filter by.
Before param.Opt[time.Time] `query:"before,omitzero" format:"date-time" json:"-"`
// Include spam in results.
IncludeSpam param.Opt[bool] `query:"include_spam,omitzero" json:"-"`
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// Labels to filter by.
Labels []string `query:"labels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (InboxThreadListParams) URLQuery ¶
func (r InboxThreadListParams) URLQuery() (v url.Values, err error)
URLQuery serializes InboxThreadListParams's query parameters as `url.Values`.
type InboxThreadService ¶
type InboxThreadService struct {
Options []option.RequestOption
}
InboxThreadService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxThreadService method instead.
func NewInboxThreadService ¶
func NewInboxThreadService(opts ...option.RequestOption) (r InboxThreadService)
NewInboxThreadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*InboxThreadService) Delete ¶
func (r *InboxThreadService) Delete(ctx context.Context, threadID string, body InboxThreadDeleteParams, opts ...option.RequestOption) (err error)
Delete Thread
func (*InboxThreadService) Get ¶
func (r *InboxThreadService) Get(ctx context.Context, threadID string, query InboxThreadGetParams, opts ...option.RequestOption) (res *Thread, err error)
Get Thread
func (*InboxThreadService) GetAttachment ¶
func (r *InboxThreadService) GetAttachment(ctx context.Context, attachmentID string, query InboxThreadGetAttachmentParams, opts ...option.RequestOption) (res *AttachmentResponse, err error)
Get Attachment
func (*InboxThreadService) List ¶
func (r *InboxThreadService) List(ctx context.Context, inboxID string, query InboxThreadListParams, opts ...option.RequestOption) (res *ListThreads, err error)
List Threads
type InboxUpdateParams ¶
type InboxUpdateParams struct {
// Display name: `Display Name <[email protected]>`.
DisplayName string `json:"display_name" api:"required"`
// contains filtered or unexported fields
}
func (InboxUpdateParams) MarshalJSON ¶
func (r InboxUpdateParams) MarshalJSON() (data []byte, err error)
func (*InboxUpdateParams) UnmarshalJSON ¶
func (r *InboxUpdateParams) UnmarshalJSON(data []byte) error
type ListDomains ¶
type ListDomains struct {
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Ordered by `created_at` descending.
Domains []ListDomainsDomain `json:"domains" api:"required"`
// Limit of number of items returned.
Limit int64 `json:"limit" api:"nullable"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Domains respjson.Field
Limit respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListDomains) RawJSON ¶
func (r ListDomains) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDomains) UnmarshalJSON ¶
func (r *ListDomains) UnmarshalJSON(data []byte) error
type ListDomainsDomain ¶
type ListDomainsDomain struct {
// Time at which the domain was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// The name of the domain. (e.g., " your-domain.com")
DomainID string `json:"domain_id" api:"required"`
// Bounce and complaint notifications are sent to your inboxes.
FeedbackEnabled bool `json:"feedback_enabled" api:"required"`
// Time at which the domain was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Client ID of domain.
ClientID string `json:"client_id" api:"nullable"`
// ID of pod.
PodID string `json:"pod_id" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
DomainID respjson.Field
FeedbackEnabled respjson.Field
UpdatedAt respjson.Field
ClientID respjson.Field
PodID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListDomainsDomain) RawJSON ¶
func (r ListDomainsDomain) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDomainsDomain) UnmarshalJSON ¶
func (r *ListDomainsDomain) UnmarshalJSON(data []byte) error
type ListDrafts ¶
type ListDrafts struct {
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Ordered by `updated_at` descending.
Drafts []ListDraftsDraft `json:"drafts" api:"required"`
// Limit of number of items returned.
Limit int64 `json:"limit" api:"nullable"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Drafts respjson.Field
Limit respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListDrafts) RawJSON ¶
func (r ListDrafts) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDrafts) UnmarshalJSON ¶
func (r *ListDrafts) UnmarshalJSON(data []byte) error
type ListDraftsDraft ¶
type ListDraftsDraft struct {
// ID of draft.
DraftID string `json:"draft_id" api:"required"`
// ID of inbox.
InboxID string `json:"inbox_id" api:"required"`
// Labels of draft.
Labels []string `json:"labels" api:"required"`
// ID of thread.
ThreadID string `json:"thread_id" api:"required"`
// Time at which draft was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Attachments in draft.
Attachments []AttachmentFile `json:"attachments" api:"nullable"`
// Addresses of BCC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Bcc []string `json:"bcc" api:"nullable"`
// Addresses of CC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Cc []string `json:"cc" api:"nullable"`
// Text preview of draft.
Preview string `json:"preview" api:"nullable"`
// Time at which to schedule send draft.
SendAt time.Time `json:"send_at" api:"nullable" format:"date-time"`
// Schedule send status of draft.
//
// Any of "scheduled", "sending", "failed".
SendStatus DraftSendStatus `json:"send_status" api:"nullable"`
// Subject of draft.
Subject string `json:"subject" api:"nullable"`
// Addresses of recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
To []string `json:"to" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DraftID respjson.Field
InboxID respjson.Field
Labels respjson.Field
ThreadID respjson.Field
UpdatedAt respjson.Field
Attachments respjson.Field
Bcc respjson.Field
Cc respjson.Field
Preview respjson.Field
SendAt respjson.Field
SendStatus respjson.Field
Subject respjson.Field
To respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListDraftsDraft) RawJSON ¶
func (r ListDraftsDraft) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListDraftsDraft) UnmarshalJSON ¶
func (r *ListDraftsDraft) UnmarshalJSON(data []byte) error
type ListInboxes ¶
type ListInboxes struct {
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Ordered by `created_at` descending.
Inboxes []Inbox `json:"inboxes" api:"required"`
// Limit of number of items returned.
Limit int64 `json:"limit" api:"nullable"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Inboxes respjson.Field
Limit respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListInboxes) RawJSON ¶
func (r ListInboxes) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListInboxes) UnmarshalJSON ¶
func (r *ListInboxes) UnmarshalJSON(data []byte) error
type ListMetrics ¶
type ListMetrics struct {
// Message metrics grouped by event type.
Message ListMetricsMessage `json:"message" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListMetrics) RawJSON ¶
func (r ListMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListMetrics) UnmarshalJSON ¶
func (r *ListMetrics) UnmarshalJSON(data []byte) error
type ListMetricsMessage ¶
type ListMetricsMessage struct {
// Timestamps when messages bounced.
Bounced []time.Time `json:"bounced" api:"nullable" format:"date-time"`
// Timestamps when messages received complaints.
Complained []time.Time `json:"complained" api:"nullable" format:"date-time"`
// Timestamps when messages were delayed.
Delayed []time.Time `json:"delayed" api:"nullable" format:"date-time"`
// Timestamps when messages were delivered.
Delivered []time.Time `json:"delivered" api:"nullable" format:"date-time"`
// Timestamps when messages were received.
Received []time.Time `json:"received" api:"nullable" format:"date-time"`
// Timestamps when messages were rejected.
Rejected []time.Time `json:"rejected" api:"nullable" format:"date-time"`
// Timestamps when messages were sent.
Sent []time.Time `json:"sent" api:"nullable" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Bounced respjson.Field
Complained respjson.Field
Delayed respjson.Field
Delivered respjson.Field
Received respjson.Field
Rejected respjson.Field
Sent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Message metrics grouped by event type.
func (ListMetricsMessage) RawJSON ¶
func (r ListMetricsMessage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListMetricsMessage) UnmarshalJSON ¶
func (r *ListMetricsMessage) UnmarshalJSON(data []byte) error
type ListThreads ¶
type ListThreads struct {
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Ordered by `timestamp` descending.
Threads []ListThreadsThread `json:"threads" api:"required"`
// Limit of number of items returned.
Limit int64 `json:"limit" api:"nullable"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Threads respjson.Field
Limit respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListThreads) RawJSON ¶
func (r ListThreads) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListThreads) UnmarshalJSON ¶
func (r *ListThreads) UnmarshalJSON(data []byte) error
type ListThreadsThread ¶
type ListThreadsThread struct {
// Time at which thread was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// ID of inbox.
InboxID string `json:"inbox_id" api:"required"`
// Labels of thread.
Labels []string `json:"labels" api:"required"`
// ID of last message in thread.
LastMessageID string `json:"last_message_id" api:"required"`
// Number of messages in thread.
MessageCount int64 `json:"message_count" api:"required"`
// Recipients in thread. In format `[email protected]` or
// `Display Name <[email protected]>`.
Recipients []string `json:"recipients" api:"required"`
// Senders in thread. In format `[email protected]` or
// `Display Name <[email protected]>`.
Senders []string `json:"senders" api:"required"`
// Size of thread in bytes.
Size int64 `json:"size" api:"required"`
// ID of thread.
ThreadID string `json:"thread_id" api:"required"`
// Timestamp of last sent or received message.
Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
// Time at which thread was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Attachments in thread.
Attachments []AttachmentFile `json:"attachments" api:"nullable"`
// Text preview of last message in thread.
Preview string `json:"preview" api:"nullable"`
// Timestamp of last received message.
ReceivedTimestamp time.Time `json:"received_timestamp" api:"nullable" format:"date-time"`
// Timestamp of last sent message.
SentTimestamp time.Time `json:"sent_timestamp" api:"nullable" format:"date-time"`
// Subject of thread.
Subject string `json:"subject" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
InboxID respjson.Field
Labels respjson.Field
LastMessageID respjson.Field
MessageCount respjson.Field
Recipients respjson.Field
Senders respjson.Field
Size respjson.Field
ThreadID respjson.Field
Timestamp respjson.Field
UpdatedAt respjson.Field
Attachments respjson.Field
Preview respjson.Field
ReceivedTimestamp respjson.Field
SentTimestamp respjson.Field
Subject respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ListThreadsThread) RawJSON ¶
func (r ListThreadsThread) RawJSON() string
Returns the unmodified JSON received from the API
func (*ListThreadsThread) UnmarshalJSON ¶
func (r *ListThreadsThread) UnmarshalJSON(data []byte) error
type Message ¶
type Message struct {
// Time at which message was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Address of sender. In format `[email protected]` or
// `Display Name <[email protected]>`.
From string `json:"from" api:"required"`
// ID of inbox.
InboxID string `json:"inbox_id" api:"required"`
// Labels of message.
Labels []string `json:"labels" api:"required"`
// ID of message.
MessageID string `json:"message_id" api:"required"`
// Size of message in bytes.
Size int64 `json:"size" api:"required"`
// ID of thread.
ThreadID string `json:"thread_id" api:"required"`
// Time at which message was sent or drafted.
Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
// Addresses of recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
To []string `json:"to" api:"required"`
// Time at which message was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Attachments in message.
Attachments []AttachmentFile `json:"attachments" api:"nullable"`
// Addresses of BCC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Bcc []string `json:"bcc" api:"nullable"`
// Addresses of CC recipients. In format `[email protected]` or
// `Display Name <[email protected]>`.
Cc []string `json:"cc" api:"nullable"`
// Extracted new HTML content.
ExtractedHTML string `json:"extracted_html" api:"nullable"`
// Extracted new text content.
ExtractedText string `json:"extracted_text" api:"nullable"`
// Headers in message.
Headers map[string]string `json:"headers" api:"nullable"`
// HTML body of message.
HTML string `json:"html" api:"nullable"`
// ID of message being replied to.
InReplyTo string `json:"in_reply_to" api:"nullable"`
// Text preview of message.
Preview string `json:"preview" api:"nullable"`
// IDs of previous messages in thread.
References []string `json:"references" api:"nullable"`
// Reply-to addresses. In format `[email protected]` or
// `Display Name <[email protected]>`.
ReplyTo []string `json:"reply_to" api:"nullable"`
// Subject of message.
Subject string `json:"subject" api:"nullable"`
// Plain text body of message.
Text string `json:"text" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
From respjson.Field
InboxID respjson.Field
Labels respjson.Field
MessageID respjson.Field
Size respjson.Field
ThreadID respjson.Field
Timestamp respjson.Field
To respjson.Field
UpdatedAt respjson.Field
Attachments respjson.Field
Bcc respjson.Field
Cc respjson.Field
ExtractedHTML respjson.Field
ExtractedText respjson.Field
Headers respjson.Field
HTML respjson.Field
InReplyTo respjson.Field
Preview respjson.Field
References respjson.Field
ReplyTo respjson.Field
Subject respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Message) UnmarshalJSON ¶
type MetricEventType ¶
type MetricEventType string
Type of metric event.
const ( MetricEventTypeMessageSent MetricEventType = "message.sent" MetricEventTypeMessageDelivered MetricEventType = "message.delivered" MetricEventTypeMessageBounced MetricEventType = "message.bounced" MetricEventTypeMessageDelayed MetricEventType = "message.delayed" MetricEventTypeMessageRejected MetricEventType = "message.rejected" MetricEventTypeMessageComplained MetricEventType = "message.complained" MetricEventTypeMessageReceived MetricEventType = "message.received" )
type MetricListParams ¶
type MetricListParams struct {
// End timestamp for the metrics query range.
EndTimestamp time.Time `query:"end_timestamp" api:"required" format:"date-time" json:"-"`
// Start timestamp for the metrics query range.
StartTimestamp time.Time `query:"start_timestamp" api:"required" format:"date-time" json:"-"`
// List of metric event types to filter by.
EventTypes []MetricEventType `query:"event_types,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MetricListParams) URLQuery ¶
func (r MetricListParams) URLQuery() (v url.Values, err error)
URLQuery serializes MetricListParams's query parameters as `url.Values`.
type MetricService ¶
type MetricService struct {
Options []option.RequestOption
}
MetricService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMetricService method instead.
func NewMetricService ¶
func NewMetricService(opts ...option.RequestOption) (r MetricService)
NewMetricService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MetricService) List ¶
func (r *MetricService) List(ctx context.Context, query MetricListParams, opts ...option.RequestOption) (res *ListMetrics, err error)
List Metrics
type OrganizationGetResponse ¶
type OrganizationGetResponse struct {
// Time at which organization was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Current number of domains.
DomainCount int64 `json:"domain_count" api:"required"`
// Current number of inboxes.
InboxCount int64 `json:"inbox_count" api:"required"`
// ID of organization.
OrganizationID string `json:"organization_id" api:"required"`
// Time at which organization was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Maximum number of domains allowed.
DomainLimit int64 `json:"domain_limit" api:"nullable"`
// Maximum number of inboxes allowed.
InboxLimit int64 `json:"inbox_limit" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
DomainCount respjson.Field
InboxCount respjson.Field
OrganizationID respjson.Field
UpdatedAt respjson.Field
DomainLimit respjson.Field
InboxLimit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Organization details with usage limits and counts.
func (OrganizationGetResponse) RawJSON ¶
func (r OrganizationGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OrganizationGetResponse) UnmarshalJSON ¶
func (r *OrganizationGetResponse) UnmarshalJSON(data []byte) error
type OrganizationService ¶
type OrganizationService struct {
Options []option.RequestOption
}
OrganizationService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrganizationService method instead.
func NewOrganizationService ¶
func NewOrganizationService(opts ...option.RequestOption) (r OrganizationService)
NewOrganizationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*OrganizationService) Get ¶
func (r *OrganizationService) Get(ctx context.Context, opts ...option.RequestOption) (res *OrganizationGetResponse, err error)
Get the current organization.
type Pod ¶
type Pod struct {
// Time at which pod was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Name of pod.
Name string `json:"name" api:"required"`
// ID of pod.
PodID string `json:"pod_id" api:"required"`
// Time at which pod was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Client ID of pod.
ClientID string `json:"client_id" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Name respjson.Field
PodID respjson.Field
UpdatedAt respjson.Field
ClientID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Pod) UnmarshalJSON ¶
type PodDomainDeleteParams ¶
type PodDomainDeleteParams struct {
// ID of pod.
PodID string `path:"pod_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type PodDomainListParams ¶
type PodDomainListParams struct {
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PodDomainListParams) URLQuery ¶
func (r PodDomainListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PodDomainListParams's query parameters as `url.Values`.
type PodDomainNewParams ¶
type PodDomainNewParams struct {
CreateDomain CreateDomainParam
// contains filtered or unexported fields
}
func (PodDomainNewParams) MarshalJSON ¶
func (r PodDomainNewParams) MarshalJSON() (data []byte, err error)
func (*PodDomainNewParams) UnmarshalJSON ¶
func (r *PodDomainNewParams) UnmarshalJSON(data []byte) error
type PodDomainService ¶
type PodDomainService struct {
Options []option.RequestOption
}
PodDomainService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPodDomainService method instead.
func NewPodDomainService ¶
func NewPodDomainService(opts ...option.RequestOption) (r PodDomainService)
NewPodDomainService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PodDomainService) Delete ¶
func (r *PodDomainService) Delete(ctx context.Context, domainID string, body PodDomainDeleteParams, opts ...option.RequestOption) (err error)
Delete Domain
func (*PodDomainService) List ¶
func (r *PodDomainService) List(ctx context.Context, podID string, query PodDomainListParams, opts ...option.RequestOption) (res *ListDomains, err error)
List Domains
func (*PodDomainService) New ¶
func (r *PodDomainService) New(ctx context.Context, podID string, body PodDomainNewParams, opts ...option.RequestOption) (res *Domain, err error)
Create Domain
type PodDraftGetParams ¶
type PodDraftGetParams struct {
// ID of pod.
PodID string `path:"pod_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type PodDraftListParams ¶
type PodDraftListParams struct {
// Timestamp after which to filter by.
After param.Opt[time.Time] `query:"after,omitzero" format:"date-time" json:"-"`
// Sort in ascending temporal order.
Ascending param.Opt[bool] `query:"ascending,omitzero" json:"-"`
// Timestamp before which to filter by.
Before param.Opt[time.Time] `query:"before,omitzero" format:"date-time" json:"-"`
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// Labels to filter by.
Labels []string `query:"labels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PodDraftListParams) URLQuery ¶
func (r PodDraftListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PodDraftListParams's query parameters as `url.Values`.
type PodDraftService ¶
type PodDraftService struct {
Options []option.RequestOption
}
PodDraftService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPodDraftService method instead.
func NewPodDraftService ¶
func NewPodDraftService(opts ...option.RequestOption) (r PodDraftService)
NewPodDraftService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PodDraftService) Get ¶
func (r *PodDraftService) Get(ctx context.Context, draftID string, query PodDraftGetParams, opts ...option.RequestOption) (res *Draft, err error)
Get Draft
func (*PodDraftService) List ¶
func (r *PodDraftService) List(ctx context.Context, podID string, query PodDraftListParams, opts ...option.RequestOption) (res *ListDrafts, err error)
List Drafts
type PodInboxDeleteParams ¶
type PodInboxDeleteParams struct {
// ID of pod.
PodID string `path:"pod_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type PodInboxGetParams ¶
type PodInboxGetParams struct {
// ID of pod.
PodID string `path:"pod_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type PodInboxListParams ¶
type PodInboxListParams struct {
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PodInboxListParams) URLQuery ¶
func (r PodInboxListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PodInboxListParams's query parameters as `url.Values`.
type PodInboxNewParams ¶
type PodInboxNewParams struct {
CreateInbox CreateInboxParam
// contains filtered or unexported fields
}
func (PodInboxNewParams) MarshalJSON ¶
func (r PodInboxNewParams) MarshalJSON() (data []byte, err error)
func (*PodInboxNewParams) UnmarshalJSON ¶
func (r *PodInboxNewParams) UnmarshalJSON(data []byte) error
type PodInboxService ¶
type PodInboxService struct {
Options []option.RequestOption
}
PodInboxService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPodInboxService method instead.
func NewPodInboxService ¶
func NewPodInboxService(opts ...option.RequestOption) (r PodInboxService)
NewPodInboxService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PodInboxService) Delete ¶
func (r *PodInboxService) Delete(ctx context.Context, inboxID string, body PodInboxDeleteParams, opts ...option.RequestOption) (err error)
Delete Inbox
func (*PodInboxService) Get ¶
func (r *PodInboxService) Get(ctx context.Context, inboxID string, query PodInboxGetParams, opts ...option.RequestOption) (res *Inbox, err error)
Get Inbox
func (*PodInboxService) List ¶
func (r *PodInboxService) List(ctx context.Context, podID string, query PodInboxListParams, opts ...option.RequestOption) (res *ListInboxes, err error)
List Inboxes
func (*PodInboxService) New ¶
func (r *PodInboxService) New(ctx context.Context, podID string, body PodInboxNewParams, opts ...option.RequestOption) (res *Inbox, err error)
Create Inbox
type PodListParams ¶
type PodListParams struct {
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PodListParams) URLQuery ¶
func (r PodListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PodListParams's query parameters as `url.Values`.
type PodListResponse ¶
type PodListResponse struct {
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Ordered by `created_at` descending.
Pods []Pod `json:"pods" api:"required"`
// Limit of number of items returned.
Limit int64 `json:"limit" api:"nullable"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Pods respjson.Field
Limit respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PodListResponse) RawJSON ¶
func (r PodListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PodListResponse) UnmarshalJSON ¶
func (r *PodListResponse) UnmarshalJSON(data []byte) error
type PodNewParams ¶
type PodNewParams struct {
// Client ID of pod.
ClientID param.Opt[string] `json:"client_id,omitzero"`
// Name of pod.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (PodNewParams) MarshalJSON ¶
func (r PodNewParams) MarshalJSON() (data []byte, err error)
func (*PodNewParams) UnmarshalJSON ¶
func (r *PodNewParams) UnmarshalJSON(data []byte) error
type PodService ¶
type PodService struct {
Options []option.RequestOption
Domains PodDomainService
Drafts PodDraftService
Inboxes PodInboxService
Threads PodThreadService
}
PodService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPodService method instead.
func NewPodService ¶
func NewPodService(opts ...option.RequestOption) (r PodService)
NewPodService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PodService) Delete ¶
func (r *PodService) Delete(ctx context.Context, podID string, opts ...option.RequestOption) (err error)
Delete Pod
func (*PodService) Get ¶
func (r *PodService) Get(ctx context.Context, podID string, opts ...option.RequestOption) (res *Pod, err error)
Get Pod
func (*PodService) List ¶
func (r *PodService) List(ctx context.Context, query PodListParams, opts ...option.RequestOption) (res *PodListResponse, err error)
List Pods
func (*PodService) New ¶
func (r *PodService) New(ctx context.Context, body PodNewParams, opts ...option.RequestOption) (res *Pod, err error)
Create Pod
type PodThreadGetParams ¶
type PodThreadGetParams struct {
// ID of pod.
PodID string `path:"pod_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type PodThreadListParams ¶
type PodThreadListParams struct {
// Timestamp after which to filter by.
After param.Opt[time.Time] `query:"after,omitzero" format:"date-time" json:"-"`
// Sort in ascending temporal order.
Ascending param.Opt[bool] `query:"ascending,omitzero" json:"-"`
// Timestamp before which to filter by.
Before param.Opt[time.Time] `query:"before,omitzero" format:"date-time" json:"-"`
// Include spam in results.
IncludeSpam param.Opt[bool] `query:"include_spam,omitzero" json:"-"`
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// Labels to filter by.
Labels []string `query:"labels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (PodThreadListParams) URLQuery ¶
func (r PodThreadListParams) URLQuery() (v url.Values, err error)
URLQuery serializes PodThreadListParams's query parameters as `url.Values`.
type PodThreadService ¶
type PodThreadService struct {
Options []option.RequestOption
}
PodThreadService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPodThreadService method instead.
func NewPodThreadService ¶
func NewPodThreadService(opts ...option.RequestOption) (r PodThreadService)
NewPodThreadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PodThreadService) Get ¶
func (r *PodThreadService) Get(ctx context.Context, threadID string, query PodThreadGetParams, opts ...option.RequestOption) (res *Thread, err error)
Get Thread
func (*PodThreadService) GetAttachment ¶
func (r *PodThreadService) GetAttachment(ctx context.Context, attachmentID string, query PodThreadGetAttachmentParams, opts ...option.RequestOption) (res *AttachmentResponse, err error)
Get Attachment
func (*PodThreadService) List ¶
func (r *PodThreadService) List(ctx context.Context, podID string, query PodThreadListParams, opts ...option.RequestOption) (res *ListThreads, err error)
List Threads
type SendAttachmentParam ¶
type SendAttachmentParam struct {
// Base64 encoded content of attachment.
Content param.Opt[string] `json:"content,omitzero"`
// Content ID of attachment.
ContentID param.Opt[string] `json:"content_id,omitzero"`
// Content type of attachment.
ContentType param.Opt[string] `json:"content_type,omitzero"`
// Filename of attachment.
Filename param.Opt[string] `json:"filename,omitzero"`
// URL to the attachment.
URL param.Opt[string] `json:"url,omitzero"`
// Content disposition of attachment.
//
// Any of "inline", "attachment".
ContentDisposition AttachmentContentDisposition `json:"content_disposition,omitzero"`
// contains filtered or unexported fields
}
func (SendAttachmentParam) MarshalJSON ¶
func (r SendAttachmentParam) MarshalJSON() (data []byte, err error)
func (*SendAttachmentParam) UnmarshalJSON ¶
func (r *SendAttachmentParam) UnmarshalJSON(data []byte) error
type SendMessageRequestParam ¶
type SendMessageRequestParam struct {
// HTML body of message.
HTML param.Opt[string] `json:"html,omitzero"`
// Subject of message.
Subject param.Opt[string] `json:"subject,omitzero"`
// Plain text body of message.
Text param.Opt[string] `json:"text,omitzero"`
// Attachments to include in message.
Attachments []SendAttachmentParam `json:"attachments,omitzero"`
// Headers to include in message.
Headers map[string]string `json:"headers,omitzero"`
// Labels of message.
Labels []string `json:"labels,omitzero"`
// BCC recipient address or addresses.
Bcc AddressesUnionParam `json:"bcc,omitzero"`
// CC recipient address or addresses.
Cc AddressesUnionParam `json:"cc,omitzero"`
// Reply-to address or addresses.
ReplyTo AddressesUnionParam `json:"reply_to,omitzero"`
// Recipient address or addresses.
To AddressesUnionParam `json:"to,omitzero"`
// contains filtered or unexported fields
}
func (SendMessageRequestParam) MarshalJSON ¶
func (r SendMessageRequestParam) MarshalJSON() (data []byte, err error)
func (*SendMessageRequestParam) UnmarshalJSON ¶
func (r *SendMessageRequestParam) UnmarshalJSON(data []byte) error
type SendMessageResponse ¶
type SendMessageResponse struct {
// ID of message.
MessageID string `json:"message_id" api:"required"`
// ID of thread.
ThreadID string `json:"thread_id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MessageID respjson.Field
ThreadID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SendMessageResponse) RawJSON ¶
func (r SendMessageResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SendMessageResponse) UnmarshalJSON ¶
func (r *SendMessageResponse) UnmarshalJSON(data []byte) error
type Thread ¶
type Thread struct {
// Time at which thread was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// ID of inbox.
InboxID string `json:"inbox_id" api:"required"`
// Labels of thread.
Labels []string `json:"labels" api:"required"`
// ID of last message in thread.
LastMessageID string `json:"last_message_id" api:"required"`
// Number of messages in thread.
MessageCount int64 `json:"message_count" api:"required"`
// Messages in thread. Ordered by `timestamp` ascending.
Messages []Message `json:"messages" api:"required"`
// Recipients in thread. In format `[email protected]` or
// `Display Name <[email protected]>`.
Recipients []string `json:"recipients" api:"required"`
// Senders in thread. In format `[email protected]` or
// `Display Name <[email protected]>`.
Senders []string `json:"senders" api:"required"`
// Size of thread in bytes.
Size int64 `json:"size" api:"required"`
// ID of thread.
ThreadID string `json:"thread_id" api:"required"`
// Timestamp of last sent or received message.
Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
// Time at which thread was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Attachments in thread.
Attachments []AttachmentFile `json:"attachments" api:"nullable"`
// Text preview of last message in thread.
Preview string `json:"preview" api:"nullable"`
// Timestamp of last received message.
ReceivedTimestamp time.Time `json:"received_timestamp" api:"nullable" format:"date-time"`
// Timestamp of last sent message.
SentTimestamp time.Time `json:"sent_timestamp" api:"nullable" format:"date-time"`
// Subject of thread.
Subject string `json:"subject" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
InboxID respjson.Field
Labels respjson.Field
LastMessageID respjson.Field
MessageCount respjson.Field
Messages respjson.Field
Recipients respjson.Field
Senders respjson.Field
Size respjson.Field
ThreadID respjson.Field
Timestamp respjson.Field
UpdatedAt respjson.Field
Attachments respjson.Field
Preview respjson.Field
ReceivedTimestamp respjson.Field
SentTimestamp respjson.Field
Subject respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Thread) UnmarshalJSON ¶
type ThreadGetAttachmentParams ¶
type ThreadGetAttachmentParams struct {
// ID of thread.
ThreadID string `path:"thread_id" api:"required" json:"-"`
// contains filtered or unexported fields
}
type ThreadListParams ¶
type ThreadListParams struct {
// Timestamp after which to filter by.
After param.Opt[time.Time] `query:"after,omitzero" format:"date-time" json:"-"`
// Sort in ascending temporal order.
Ascending param.Opt[bool] `query:"ascending,omitzero" json:"-"`
// Timestamp before which to filter by.
Before param.Opt[time.Time] `query:"before,omitzero" format:"date-time" json:"-"`
// Include spam in results.
IncludeSpam param.Opt[bool] `query:"include_spam,omitzero" json:"-"`
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// Labels to filter by.
Labels []string `query:"labels,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ThreadListParams) URLQuery ¶
func (r ThreadListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ThreadListParams's query parameters as `url.Values`.
type ThreadService ¶
type ThreadService struct {
Options []option.RequestOption
}
ThreadService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewThreadService method instead.
func NewThreadService ¶
func NewThreadService(opts ...option.RequestOption) (r ThreadService)
NewThreadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ThreadService) Get ¶
func (r *ThreadService) Get(ctx context.Context, threadID string, opts ...option.RequestOption) (res *Thread, err error)
Get Thread
func (*ThreadService) GetAttachment ¶
func (r *ThreadService) GetAttachment(ctx context.Context, attachmentID string, query ThreadGetAttachmentParams, opts ...option.RequestOption) (res *AttachmentResponse, err error)
Get Attachment
func (*ThreadService) List ¶
func (r *ThreadService) List(ctx context.Context, query ThreadListParams, opts ...option.RequestOption) (res *ListThreads, err error)
List Threads
type UpdateMessageParam ¶
type UpdateMessageParam struct {
// Labels to add to message.
AddLabels []string `json:"add_labels,omitzero"`
// Labels to remove from message.
RemoveLabels []string `json:"remove_labels,omitzero"`
// contains filtered or unexported fields
}
func (UpdateMessageParam) MarshalJSON ¶
func (r UpdateMessageParam) MarshalJSON() (data []byte, err error)
func (*UpdateMessageParam) UnmarshalJSON ¶
func (r *UpdateMessageParam) UnmarshalJSON(data []byte) error
type Webhook ¶
type Webhook struct {
// Time at which webhook was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Webhook is enabled.
Enabled bool `json:"enabled" api:"required"`
// Secret for webhook signature verification.
Secret string `json:"secret" api:"required"`
// Time at which webhook was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// URL of webhook endpoint.
URL string `json:"url" api:"required"`
// ID of webhook.
WebhookID string `json:"webhook_id" api:"required"`
// Client ID of webhook.
ClientID string `json:"client_id" api:"nullable"`
// Event types for which to send events.
EventTypes []EventType `json:"event_types" api:"nullable"`
// Inboxes for which to send events. Maximum 10 per webhook.
InboxIDs []string `json:"inbox_ids" api:"nullable"`
// Pods for which to send events. Maximum 10 per webhook.
PodIDs []string `json:"pod_ids" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Enabled respjson.Field
Secret respjson.Field
UpdatedAt respjson.Field
URL respjson.Field
WebhookID respjson.Field
ClientID respjson.Field
EventTypes respjson.Field
InboxIDs respjson.Field
PodIDs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Webhook) UnmarshalJSON ¶
type WebhookListParams ¶
type WebhookListParams struct {
// Limit of number of items returned.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Page token for pagination.
PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WebhookListParams) URLQuery ¶
func (r WebhookListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WebhookListParams's query parameters as `url.Values`.
type WebhookListResponse ¶
type WebhookListResponse struct {
// Number of items returned.
Count int64 `json:"count" api:"required"`
// Ordered by `created_at` descending.
Webhooks []Webhook `json:"webhooks" api:"required"`
// Limit of number of items returned.
Limit int64 `json:"limit" api:"nullable"`
// Page token for pagination.
NextPageToken string `json:"next_page_token" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Webhooks respjson.Field
Limit respjson.Field
NextPageToken respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookListResponse) RawJSON ¶
func (r WebhookListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponse) UnmarshalJSON ¶
func (r *WebhookListResponse) UnmarshalJSON(data []byte) error
type WebhookNewParams ¶
type WebhookNewParams struct {
// Event types for which to send events.
EventTypes []EventType `json:"event_types,omitzero" api:"required"`
// URL of webhook endpoint.
URL string `json:"url" api:"required"`
// Client ID of webhook.
ClientID param.Opt[string] `json:"client_id,omitzero"`
// Inboxes for which to send events. Maximum 10 per webhook.
InboxIDs []string `json:"inbox_ids,omitzero"`
// Pods for which to send events. Maximum 10 per webhook.
PodIDs []string `json:"pod_ids,omitzero"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookService ¶
type WebhookService struct {
Options []option.RequestOption
}
WebhookService contains methods and other services that help with interacting with the agentmail API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Delete ¶
func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (err error)
Delete Webhook
func (*WebhookService) Get ¶
func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *Webhook, err error)
Get Webhook
func (*WebhookService) List ¶
func (r *WebhookService) List(ctx context.Context, query WebhookListParams, opts ...option.RequestOption) (res *WebhookListResponse, err error)
List Webhooks
func (*WebhookService) New ¶
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *Webhook, err error)
Create Webhook
func (*WebhookService) Update ¶
func (r *WebhookService) Update(ctx context.Context, webhookID string, body WebhookUpdateParams, opts ...option.RequestOption) (res *Webhook, err error)
Update Webhook
type WebhookUpdateParams ¶
type WebhookUpdateParams struct {
// Inbox IDs to subscribe to the webhook.
AddInboxIDs []string `json:"add_inbox_ids,omitzero"`
// Pod IDs to subscribe to the webhook.
AddPodIDs []string `json:"add_pod_ids,omitzero"`
// Inbox IDs to unsubscribe from the webhook.
RemoveInboxIDs []string `json:"remove_inbox_ids,omitzero"`
// Pod IDs to unsubscribe from the webhook.
RemovePodIDs []string `json:"remove_pod_ids,omitzero"`
// contains filtered or unexported fields
}
func (WebhookUpdateParams) MarshalJSON ¶
func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error)
func (*WebhookUpdateParams) UnmarshalJSON ¶
func (r *WebhookUpdateParams) UnmarshalJSON(data []byte) error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|