pub struct Scoped<'c, S> { /* private fields */ }Expand description
A Client bound to a Scope. Returned by Client::org,
Client::inbox, and Client::pod; the resource methods it exposes
depend on which capability traits the scope S implements.
Implementations§
Source§impl<S: AccountScopes> Scoped<'_, S>
Accounts can also be listed through an inbox or pod handle; writes stay
org-only.
impl<S: AccountScopes> Scoped<'_, S>
Accounts can also be listed through an inbox or pod handle; writes stay org-only.
Sourcepub async fn list_accounts(&self, page: Page) -> Result<AccountList, Error>
pub async fn list_accounts(&self, page: Page) -> Result<AccountList, Error>
GET {scope}/accounts, accounts connected through that inbox or pod.
Source§impl<S: ApiKeys> Scoped<'_, S>
impl<S: ApiKeys> Scoped<'_, S>
Sourcepub async fn create_api_key(
&self,
key: CreateApiKey,
) -> Result<CreatedApiKey, Error>
pub async fn create_api_key( &self, key: CreateApiKey, ) -> Result<CreatedApiKey, Error>
POST {scope}/api-keys, mint a new API key. The full secret is in
CreatedApiKey::api_key and is shown only here; store it now.
Sourcepub async fn list_api_keys(&self, page: Page) -> Result<ApiKeyList, Error>
pub async fn list_api_keys(&self, page: Page) -> Result<ApiKeyList, Error>
GET {scope}/api-keys, one page.
Sourcepub async fn list_all_api_keys(&self) -> Result<Vec<ApiKey>, Error>
pub async fn list_all_api_keys(&self) -> Result<Vec<ApiKey>, Error>
Every API key, draining pagination.
Sourcepub async fn delete_api_key(&self, api_key_id: &str) -> Result<(), Error>
pub async fn delete_api_key(&self, api_key_id: &str) -> Result<(), Error>
DELETE {scope}/api-keys/{api_key_id}.
Sourcepub async fn update_api_key(
&self,
api_key_id: &str,
update: UpdateApiKey,
) -> Result<ApiKey, Error>
pub async fn update_api_key( &self, api_key_id: &str, update: UpdateApiKey, ) -> Result<ApiKey, Error>
PATCH {scope}/api-keys/{api_key_id}, rename the key and/or replace
its permission set.
Source§impl Scoped<'_, InboxScope<'_>>
The inbox’s calendar. Every calendar endpoint is inbox-scoped; writes take
an optional etag (from a prior read) for optimistic concurrency, and the
API answers 428 when a newer revision exists.
impl Scoped<'_, InboxScope<'_>>
The inbox’s calendar. Every calendar endpoint is inbox-scoped; writes take
an optional etag (from a prior read) for optimistic concurrency, and the
API answers 428 when a newer revision exists.
Sourcepub async fn get_calendar(
&self,
consistency: Option<Consistency>,
) -> Result<Calendar, Error>
pub async fn get_calendar( &self, consistency: Option<Consistency>, ) -> Result<Calendar, Error>
GET {base}/calendar, the inbox’s calendar settings.
Sourcepub async fn update_calendar(
&self,
timezone: &str,
etag: Option<&str>,
) -> Result<Calendar, Error>
pub async fn update_calendar( &self, timezone: &str, etag: Option<&str>, ) -> Result<Calendar, Error>
PATCH {base}/calendar, move the calendar to another IANA timezone.
Pass the etag from a prior read to reject concurrent edits.
Sourcepub async fn get_agenda(
&self,
query: CalendarEventsQuery,
) -> Result<CalendarEventList, Error>
pub async fn get_agenda( &self, query: CalendarEventsQuery, ) -> Result<CalendarEventList, Error>
GET {base}/calendar/agenda, occurrences in a window, flattened:
recurring series appear as their individual instances.
Sourcepub async fn list_all_agenda(
&self,
query: CalendarEventsQuery,
) -> Result<Vec<CalendarEvent>, Error>
pub async fn list_all_agenda( &self, query: CalendarEventsQuery, ) -> Result<Vec<CalendarEvent>, Error>
Every occurrence in the query’s window, draining pagination.
Sourcepub async fn list_calendar_events(
&self,
page: Page,
) -> Result<CalendarEventList, Error>
pub async fn list_calendar_events( &self, page: Page, ) -> Result<CalendarEventList, Error>
GET {base}/calendar/events, one page of the calendar’s stored events
(series stay unexpanded; use the agenda for flattened occurrences).
Sourcepub async fn list_all_calendar_events(
&self,
) -> Result<Vec<CalendarEvent>, Error>
pub async fn list_all_calendar_events( &self, ) -> Result<Vec<CalendarEvent>, Error>
Every stored event, draining pagination.
Sourcepub async fn create_calendar_event(
&self,
event: CreateCalendarEvent,
) -> Result<CalendarEventMutation, Error>
pub async fn create_calendar_event( &self, event: CreateCalendarEvent, ) -> Result<CalendarEventMutation, Error>
POST {base}/calendar/events, create an event (or series, with a
recurrence rule).
Sourcepub async fn get_calendar_event(
&self,
event_id: &str,
consistency: Option<Consistency>,
) -> Result<CalendarEvent, Error>
pub async fn get_calendar_event( &self, event_id: &str, consistency: Option<Consistency>, ) -> Result<CalendarEvent, Error>
GET {base}/calendar/events/{event_id}.
Sourcepub async fn update_calendar_event(
&self,
event_id: &str,
update: UpdateCalendarEvent,
mode: Option<MutationMode>,
etag: Option<&str>,
) -> Result<CalendarEventMutation, Error>
pub async fn update_calendar_event( &self, event_id: &str, update: UpdateCalendarEvent, mode: Option<MutationMode>, etag: Option<&str>, ) -> Result<CalendarEventMutation, Error>
PATCH {base}/calendar/events/{event_id}. On a series instance, pass
mode to move just that occurrence or it and every later one.
Sourcepub async fn delete_calendar_event(
&self,
event_id: &str,
mode: Option<MutationMode>,
send_invites: Option<bool>,
etag: Option<&str>,
) -> Result<DeleteCalendarEventResult, Error>
pub async fn delete_calendar_event( &self, event_id: &str, mode: Option<MutationMode>, send_invites: Option<bool>, etag: Option<&str>, ) -> Result<DeleteCalendarEventResult, Error>
DELETE {base}/calendar/events/{event_id}. On a series instance,
mode picks between cancelling just that occurrence and every future
one.
Sourcepub async fn list_calendar_event_instances(
&self,
event_id: &str,
query: CalendarEventsQuery,
) -> Result<CalendarEventList, Error>
pub async fn list_calendar_event_instances( &self, event_id: &str, query: CalendarEventsQuery, ) -> Result<CalendarEventList, Error>
GET {base}/calendar/events/{event_id}/instances, the occurrences of
a recurring event in a window.
Sourcepub async fn list_all_calendar_event_instances(
&self,
event_id: &str,
query: CalendarEventsQuery,
) -> Result<Vec<CalendarEvent>, Error>
pub async fn list_all_calendar_event_instances( &self, event_id: &str, query: CalendarEventsQuery, ) -> Result<Vec<CalendarEvent>, Error>
Every instance of a recurring event in the query’s window, draining pagination.
Sourcepub async fn respond_to_calendar_event(
&self,
event_id: &str,
respond: RespondToCalendarEvent,
etag: Option<&str>,
) -> Result<CalendarEventMutation, Error>
pub async fn respond_to_calendar_event( &self, event_id: &str, respond: RespondToCalendarEvent, etag: Option<&str>, ) -> Result<CalendarEventMutation, Error>
POST {base}/calendar/events/{event_id}/respond, reply to an invite
on behalf of this inbox.
Source§impl<S: Domains> Scoped<'_, S>
impl<S: Domains> Scoped<'_, S>
Sourcepub async fn create_domain(&self, domain: CreateDomain) -> Result<Domain, Error>
pub async fn create_domain(&self, domain: CreateDomain) -> Result<Domain, Error>
POST {scope}/domains, add a sending domain. The response carries the
DNS VerificationRecords to publish.
Sourcepub async fn list_domains(&self, page: Page) -> Result<DomainList, Error>
pub async fn list_domains(&self, page: Page) -> Result<DomainList, Error>
GET {scope}/domains, one page.
Sourcepub async fn list_all_domains(&self) -> Result<Vec<Domain>, Error>
pub async fn list_all_domains(&self) -> Result<Vec<Domain>, Error>
Every domain, draining pagination.
Sourcepub async fn get_domain(&self, domain_id: &str) -> Result<Domain, Error>
pub async fn get_domain(&self, domain_id: &str) -> Result<Domain, Error>
GET {scope}/domains/{domain_id}.
Sourcepub async fn update_domain(
&self,
domain_id: &str,
update: UpdateDomain,
) -> Result<Domain, Error>
pub async fn update_domain( &self, domain_id: &str, update: UpdateDomain, ) -> Result<Domain, Error>
PATCH {scope}/domains/{domain_id}, toggle feedback and subdomain
settings.
Sourcepub async fn delete_domain(&self, domain_id: &str) -> Result<(), Error>
pub async fn delete_domain(&self, domain_id: &str) -> Result<(), Error>
DELETE {scope}/domains/{domain_id}.
Sourcepub async fn verify_domain(&self, domain_id: &str) -> Result<(), Error>
pub async fn verify_domain(&self, domain_id: &str) -> Result<(), Error>
POST {scope}/domains/{domain_id}/verify, ask the API to re-check the
DNS records; poll Scoped::get_domain for the resulting status.
Source§impl Scoped<'_, OrgScope>
Provider setup links exist only at the organization scope.
impl Scoped<'_, OrgScope>
Provider setup links exist only at the organization scope.
Sourcepub async fn get_domain_setup_link(
&self,
domain_id: &str,
) -> Result<DomainSetupLink, Error>
pub async fn get_domain_setup_link( &self, domain_id: &str, ) -> Result<DomainSetupLink, Error>
GET /v0/domains/{domain_id}/setup-link, a one-click DNS setup flow
for the domain’s provider, when one is DomainSetupLink::supported.
Source§impl<S: Drafts> Scoped<'_, S>
impl<S: Drafts> Scoped<'_, S>
Sourcepub async fn list_drafts(&self, page: Page) -> Result<DraftList, Error>
pub async fn list_drafts(&self, page: Page) -> Result<DraftList, Error>
GET {scope}/drafts, one page. Drafts are readable at every scope but
only created and sent from an Client::inbox.
Sourcepub async fn list_all_drafts(&self) -> Result<Vec<Draft>, Error>
pub async fn list_all_drafts(&self) -> Result<Vec<Draft>, Error>
Every draft, draining pagination.
Sourcepub async fn get_draft(&self, draft_id: &str) -> Result<Draft, Error>
pub async fn get_draft(&self, draft_id: &str) -> Result<Draft, Error>
GET {scope}/drafts/{draft_id}.
Sourcepub async fn get_draft_attachment(
&self,
draft_id: &str,
attachment_id: &str,
) -> Result<Attachment, Error>
pub async fn get_draft_attachment( &self, draft_id: &str, attachment_id: &str, ) -> Result<Attachment, Error>
GET {scope}/drafts/{draft_id}/attachments/{attachment_id}.
Source§impl Scoped<'_, InboxScope<'_>>
impl Scoped<'_, InboxScope<'_>>
Sourcepub async fn create_draft(&self, draft: CreateDraft) -> Result<Draft, Error>
pub async fn create_draft(&self, draft: CreateDraft) -> Result<Draft, Error>
POST /v0/inboxes/{inbox_id}/drafts, create a draft. Supply
in_reply_to to create a reply draft (with reply_all to address the
whole thread) or forward_of to create a forward draft.
Sourcepub async fn update_draft(
&self,
draft_id: &str,
update: UpdateDraft,
) -> Result<Draft, Error>
pub async fn update_draft( &self, draft_id: &str, update: UpdateDraft, ) -> Result<Draft, Error>
PATCH /v0/inboxes/{inbox_id}/drafts/{draft_id}, edit an existing draft.
Sourcepub async fn delete_draft(&self, draft_id: &str) -> Result<(), Error>
pub async fn delete_draft(&self, draft_id: &str) -> Result<(), Error>
DELETE /v0/inboxes/{inbox_id}/drafts/{draft_id}.
Sourcepub async fn send_draft(&self, draft_id: &str) -> Result<SentMessage, Error>
pub async fn send_draft(&self, draft_id: &str) -> Result<SentMessage, Error>
POST /v0/inboxes/{inbox_id}/drafts/{draft_id}/send, send a draft. The
draft is deleted after a successful send.
Source§impl Scoped<'_, InboxScope<'_>>
impl Scoped<'_, InboxScope<'_>>
Sourcepub async fn list_events(&self, page: Page) -> Result<InboxEventList, Error>
pub async fn list_events(&self, page: Page) -> Result<InboxEventList, Error>
GET /v0/inboxes/{inbox_id}/events, one page of the inbox’s audit log.
Sourcepub async fn list_all_events(&self) -> Result<Vec<InboxEvent>, Error>
pub async fn list_all_events(&self) -> Result<Vec<InboxEvent>, Error>
Every inbox event, draining pagination.
Source§impl<S: Inboxes> Scoped<'_, S>
impl<S: Inboxes> Scoped<'_, S>
Sourcepub async fn create_inbox(&self, inbox: CreateInbox) -> Result<Inbox, Error>
pub async fn create_inbox(&self, inbox: CreateInbox) -> Result<Inbox, Error>
POST {scope}/inboxes, a new agent-owned email address. At Client::org
this creates a standalone inbox; at Client::pod it creates the inbox
inside that pod. Free plans get {username}@agentmail.to; custom domains
must be verified first.
Sourcepub async fn list_inboxes(&self, page: Page) -> Result<InboxList, Error>
pub async fn list_inboxes(&self, page: Page) -> Result<InboxList, Error>
GET {scope}/inboxes, one page.
Sourcepub async fn list_all_inboxes(&self) -> Result<Vec<Inbox>, Error>
pub async fn list_all_inboxes(&self) -> Result<Vec<Inbox>, Error>
Every inbox in the scope, draining pagination.
Sourcepub async fn get_inbox(&self, inbox_id: &str) -> Result<Inbox, Error>
pub async fn get_inbox(&self, inbox_id: &str) -> Result<Inbox, Error>
GET {scope}/inboxes/{inbox_id}.
Sourcepub async fn update_inbox(
&self,
inbox_id: &str,
update: UpdateInbox,
) -> Result<Inbox, Error>
pub async fn update_inbox( &self, inbox_id: &str, update: UpdateInbox, ) -> Result<Inbox, Error>
PATCH {scope}/inboxes/{inbox_id}, update display name and/or metadata.
Sourcepub async fn delete_inbox(&self, inbox_id: &str) -> Result<(), Error>
pub async fn delete_inbox(&self, inbox_id: &str) -> Result<(), Error>
DELETE {scope}/inboxes/{inbox_id}.
Source§impl Scoped<'_, InboxScope<'_>>
impl Scoped<'_, InboxScope<'_>>
POST /v0/inboxes/{inbox_id}/authorize, complete the browser
authorization flow for this inbox: the human approves in their browser,
and this call exchanges the resulting auth_token for a scoped API
key (AuthorizeInboxResult::api_key_id).
Source§impl<S: Lists> Scoped<'_, S>
impl<S: Lists> Scoped<'_, S>
Sourcepub async fn list_entries(
&self,
direction: ListDirection,
kind: ListKind,
page: Page,
) -> Result<ListEntries, Error>
pub async fn list_entries( &self, direction: ListDirection, kind: ListKind, page: Page, ) -> Result<ListEntries, Error>
GET {scope}/lists/{direction}/{kind}, one page of entries.
Sourcepub async fn list_all_entries(
&self,
direction: ListDirection,
kind: ListKind,
) -> Result<Vec<ListEntry>, Error>
pub async fn list_all_entries( &self, direction: ListDirection, kind: ListKind, ) -> Result<Vec<ListEntry>, Error>
Every entry in the list, draining pagination.
Sourcepub async fn create_list_entry(
&self,
direction: ListDirection,
kind: ListKind,
entry: CreateListEntry,
) -> Result<ListEntry, Error>
pub async fn create_list_entry( &self, direction: ListDirection, kind: ListKind, entry: CreateListEntry, ) -> Result<ListEntry, Error>
POST {scope}/lists/{direction}/{kind}, add an address or domain.
Sourcepub async fn get_list_entry(
&self,
direction: ListDirection,
kind: ListKind,
entry: &str,
) -> Result<ListEntry, Error>
pub async fn get_list_entry( &self, direction: ListDirection, kind: ListKind, entry: &str, ) -> Result<ListEntry, Error>
GET {scope}/lists/{direction}/{kind}/{entry}.
Sourcepub async fn delete_list_entry(
&self,
direction: ListDirection,
kind: ListKind,
entry: &str,
) -> Result<(), Error>
pub async fn delete_list_entry( &self, direction: ListDirection, kind: ListKind, entry: &str, ) -> Result<(), Error>
DELETE {scope}/lists/{direction}/{kind}/{entry}.
Source§impl Scoped<'_, InboxScope<'_>>
Messages exist only within an inbox, so these methods live on
client.inbox(id).
impl Scoped<'_, InboxScope<'_>>
Messages exist only within an inbox, so these methods live on
client.inbox(id).
Sourcepub async fn send_message(
&self,
message: SendMessage,
) -> Result<SentMessage, Error>
pub async fn send_message( &self, message: SendMessage, ) -> Result<SentMessage, Error>
POST /v0/inboxes/{inbox_id}/messages/send.
Sourcepub async fn send_text(
&self,
to: &str,
subject: &str,
text: &str,
) -> Result<SentMessage, Error>
pub async fn send_text( &self, to: &str, subject: &str, text: &str, ) -> Result<SentMessage, Error>
Send a plain-text message to a single recipient: the common case, in one
line. For anything richer (HTML, cc/bcc, attachments, labels), build a
SendMessage and call Scoped::send_message.
Sourcepub async fn list_messages(
&self,
filters: MessageListFilters,
) -> Result<MessageList, Error>
pub async fn list_messages( &self, filters: MessageListFilters, ) -> Result<MessageList, Error>
GET /v0/inboxes/{inbox_id}/messages, one page. Pass
MessageListFilters::default for the first unfiltered page.
Sourcepub async fn list_all_messages(
&self,
filters: MessageListFilters,
) -> Result<Vec<Message>, Error>
pub async fn list_all_messages( &self, filters: MessageListFilters, ) -> Result<Vec<Message>, Error>
Every message matching filters, draining pagination.
Sourcepub async fn search_messages(
&self,
query: &str,
filters: MessageListFilters,
) -> Result<MessageList, Error>
pub async fn search_messages( &self, query: &str, filters: MessageListFilters, ) -> Result<MessageList, Error>
GET /v0/inboxes/{inbox_id}/messages/search (q required).
Sourcepub async fn search_all_messages(
&self,
query: &str,
filters: MessageListFilters,
) -> Result<Vec<Message>, Error>
pub async fn search_all_messages( &self, query: &str, filters: MessageListFilters, ) -> Result<Vec<Message>, Error>
Every message matching a search, draining pagination.
Sourcepub async fn get_message(&self, message_id: &str) -> Result<Message, Error>
pub async fn get_message(&self, message_id: &str) -> Result<Message, Error>
GET /v0/inboxes/{inbox_id}/messages/{message_id}.
Sourcepub async fn update_message(
&self,
message_id: &str,
update: UpdateMessage,
) -> Result<UpdatedMessage, Error>
pub async fn update_message( &self, message_id: &str, update: UpdateMessage, ) -> Result<UpdatedMessage, Error>
PATCH /v0/inboxes/{inbox_id}/messages/{message_id}, add/remove labels
(read state is a label). Returns the id and labels after the change.
Sourcepub async fn delete_message(&self, message_id: &str) -> Result<(), Error>
pub async fn delete_message(&self, message_id: &str) -> Result<(), Error>
DELETE /v0/inboxes/{inbox_id}/messages/{message_id}.
Sourcepub async fn reply_to_message(
&self,
message_id: &str,
reply: ReplyToMessage,
) -> Result<SentMessage, Error>
pub async fn reply_to_message( &self, message_id: &str, reply: ReplyToMessage, ) -> Result<SentMessage, Error>
POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply, reply to a
message (recipients derived from the parent).
Sourcepub async fn reply_all_to_message(
&self,
message_id: &str,
reply: ReplyToMessage,
) -> Result<SentMessage, Error>
pub async fn reply_all_to_message( &self, message_id: &str, reply: ReplyToMessage, ) -> Result<SentMessage, Error>
POST /v0/inboxes/{inbox_id}/messages/{message_id}/reply-all.
Sourcepub async fn forward_message(
&self,
message_id: &str,
message: SendMessage,
) -> Result<SentMessage, Error>
pub async fn forward_message( &self, message_id: &str, message: SendMessage, ) -> Result<SentMessage, Error>
POST /v0/inboxes/{inbox_id}/messages/{message_id}/forward. Reuses
SendMessage for the new recipients and any added body.
Sourcepub async fn get_raw_message(
&self,
message_id: &str,
) -> Result<RawMessage, Error>
pub async fn get_raw_message( &self, message_id: &str, ) -> Result<RawMessage, Error>
GET /v0/inboxes/{inbox_id}/messages/{message_id}/raw, a presigned URL
for the raw RFC 822 (.eml) source; fetch the bytes with
Client::download_raw.
Sourcepub async fn get_message_attachment(
&self,
message_id: &str,
attachment_id: &str,
) -> Result<Attachment, Error>
pub async fn get_message_attachment( &self, message_id: &str, attachment_id: &str, ) -> Result<Attachment, Error>
GET /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}.
Sourcepub async fn batch_get_messages(
&self,
message_ids: Vec<String>,
) -> Result<BatchGetMessagesResponse, Error>
pub async fn batch_get_messages( &self, message_ids: Vec<String>, ) -> Result<BatchGetMessagesResponse, Error>
POST /v0/inboxes/{inbox_id}/messages/batch-get, fetch many messages by
id in one call.
Sourcepub async fn batch_update_messages(
&self,
update: BatchUpdateMessages,
) -> Result<BatchUpdateMessagesResponse, Error>
pub async fn batch_update_messages( &self, update: BatchUpdateMessages, ) -> Result<BatchUpdateMessagesResponse, Error>
POST /v0/inboxes/{inbox_id}/messages/batch-update, apply the same label
changes to many messages at once.
Source§impl<S: Metrics> Scoped<'_, S>
impl<S: Metrics> Scoped<'_, S>
Sourcepub async fn get_metrics_events(
&self,
query: MetricsQuery,
) -> Result<MetricsEvents, Error>
pub async fn get_metrics_events( &self, query: MetricsQuery, ) -> Result<MetricsEvents, Error>
GET {scope}/metrics/events, event counts bucketed over time, keyed by
event type.
Sourcepub async fn get_metrics_usage(
&self,
query: MetricsQuery,
) -> Result<MetricsUsage, Error>
pub async fn get_metrics_usage( &self, query: MetricsQuery, ) -> Result<MetricsUsage, Error>
GET {scope}/metrics/usage, usage values bucketed over time, keyed by
usage type.
Sourcepub async fn get_metrics_rates(
&self,
query: MetricsQuery,
) -> Result<MetricsRates, Error>
pub async fn get_metrics_rates( &self, query: MetricsQuery, ) -> Result<MetricsRates, Error>
GET {scope}/metrics/rates, bounce/complaint rates bucketed over time,
keyed by rate type. Set MetricsQuery::window to pick the window
each rate is computed over.
Source§impl<S: Threads> Scoped<'_, S>
impl<S: Threads> Scoped<'_, S>
Sourcepub async fn list_threads(
&self,
filters: ThreadListFilters,
) -> Result<ThreadList, Error>
pub async fn list_threads( &self, filters: ThreadListFilters, ) -> Result<ThreadList, Error>
GET {scope}/threads, one page. Pass ThreadListFilters::default for
the first unfiltered page; carry next_page_token back in for more, or
use Scoped::list_all_threads to drain every page.
Sourcepub async fn list_all_threads(
&self,
filters: ThreadListFilters,
) -> Result<Vec<Thread>, Error>
pub async fn list_all_threads( &self, filters: ThreadListFilters, ) -> Result<Vec<Thread>, Error>
Every thread matching filters, draining pagination.
Sourcepub async fn search_threads(
&self,
query: &str,
filters: ThreadListFilters,
) -> Result<ThreadList, Error>
pub async fn search_threads( &self, query: &str, filters: ThreadListFilters, ) -> Result<ThreadList, Error>
GET {scope}/threads/search, full-text search (q required); matches
come back in Thread::highlights.
Sourcepub async fn search_all_threads(
&self,
query: &str,
filters: ThreadListFilters,
) -> Result<Vec<Thread>, Error>
pub async fn search_all_threads( &self, query: &str, filters: ThreadListFilters, ) -> Result<Vec<Thread>, Error>
Every thread matching a search, draining pagination.
Sourcepub async fn get_thread(&self, thread_id: &str) -> Result<Thread, Error>
pub async fn get_thread(&self, thread_id: &str) -> Result<Thread, Error>
GET {scope}/threads/{thread_id}, the full thread with its messages.
Sourcepub async fn update_thread(
&self,
thread_id: &str,
update: UpdateThread,
) -> Result<UpdatedThread, Error>
pub async fn update_thread( &self, thread_id: &str, update: UpdateThread, ) -> Result<UpdatedThread, Error>
PATCH {scope}/threads/{thread_id}, add and/or remove labels across the
thread. Returns the thread id and its labels after the change.
Sourcepub async fn delete_thread(&self, thread_id: &str) -> Result<(), Error>
pub async fn delete_thread(&self, thread_id: &str) -> Result<(), Error>
DELETE {scope}/threads/{thread_id}.
Sourcepub async fn get_thread_attachment(
&self,
thread_id: &str,
attachment_id: &str,
) -> Result<Attachment, Error>
pub async fn get_thread_attachment( &self, thread_id: &str, attachment_id: &str, ) -> Result<Attachment, Error>
GET {scope}/threads/{thread_id}/attachments/{attachment_id}, the
attachment metadata with a short-lived download_url; fetch the bytes
with Client::download_attachment.
Source§impl<S: Webhooks> Scoped<'_, S>
impl<S: Webhooks> Scoped<'_, S>
Sourcepub async fn create_webhook(
&self,
webhook: CreateWebhook,
) -> Result<Webhook, Error>
pub async fn create_webhook( &self, webhook: CreateWebhook, ) -> Result<Webhook, Error>
POST {scope}/webhooks, subscribe an HTTPS endpoint to events (e.g.
message.received). The response carries the signing secret exactly
once; store it. Inbox and pod scopes ignore inbox_ids/pod_ids (the
scope already targets the delivery); set those only at Client::org.
Sourcepub async fn list_webhooks(&self, page: Page) -> Result<WebhookList, Error>
pub async fn list_webhooks(&self, page: Page) -> Result<WebhookList, Error>
GET {scope}/webhooks, one page.
Sourcepub async fn list_all_webhooks(&self) -> Result<Vec<Webhook>, Error>
pub async fn list_all_webhooks(&self) -> Result<Vec<Webhook>, Error>
Every webhook, draining pagination.
Sourcepub async fn get_webhook(&self, webhook_id: &str) -> Result<Webhook, Error>
pub async fn get_webhook(&self, webhook_id: &str) -> Result<Webhook, Error>
GET {scope}/webhooks/{webhook_id}.
Sourcepub async fn update_webhook(
&self,
webhook_id: &str,
update: UpdateWebhook,
) -> Result<Webhook, Error>
pub async fn update_webhook( &self, webhook_id: &str, update: UpdateWebhook, ) -> Result<Webhook, Error>
PATCH {scope}/webhooks/{webhook_id}, edit event types and inbox/pod
targeting (see UpdateWebhook).
Sourcepub async fn delete_webhook(&self, webhook_id: &str) -> Result<(), Error>
pub async fn delete_webhook(&self, webhook_id: &str) -> Result<(), Error>
DELETE {scope}/webhooks/{webhook_id}.
Sourcepub async fn get_webhook_headers(
&self,
webhook_id: &str,
) -> Result<WebhookHeaderNames, Error>
pub async fn get_webhook_headers( &self, webhook_id: &str, ) -> Result<WebhookHeaderNames, Error>
GET {scope}/webhooks/{webhook_id}/headers, the names of the extra
headers sent with each delivery (values are never returned).
Sourcepub async fn update_webhook_headers(
&self,
webhook_id: &str,
update: UpdateWebhookHeaders,
) -> Result<(), Error>
pub async fn update_webhook_headers( &self, webhook_id: &str, update: UpdateWebhookHeaders, ) -> Result<(), Error>
PATCH {scope}/webhooks/{webhook_id}/headers, set/replace headers and
remove others by name. Responds 204 with no body.