Struct gmail::GmailClient
source · pub struct GmailClient { /* private fields */ }
Implementations§
source§impl GmailClient
impl GmailClient
source§impl GmailClient
impl GmailClient
sourcepub fn drafts_list(&self, user_id: &str) -> FluentRequest<'_, DraftsListRequest>
pub fn drafts_list(&self, user_id: &str) -> FluentRequest<'_, DraftsListRequest>
Lists the drafts in the user’s mailbox.
sourcepub fn drafts_create(
&self,
user_id: &str
) -> FluentRequest<'_, DraftsCreateRequest>
pub fn drafts_create( &self, user_id: &str ) -> FluentRequest<'_, DraftsCreateRequest>
Creates a new draft with the DRAFT
label.
sourcepub fn drafts_send(&self, user_id: &str) -> FluentRequest<'_, DraftsSendRequest>
pub fn drafts_send(&self, user_id: &str) -> FluentRequest<'_, DraftsSendRequest>
Sends the specified, existing draft to the recipients in the To
, Cc
, and Bcc
headers.
sourcepub fn drafts_get(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, DraftsGetRequest>
pub fn drafts_get( &self, id: &str, user_id: &str ) -> FluentRequest<'_, DraftsGetRequest>
Gets the specified draft.
sourcepub fn drafts_update(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, DraftsUpdateRequest>
pub fn drafts_update( &self, id: &str, user_id: &str ) -> FluentRequest<'_, DraftsUpdateRequest>
Replaces a draft’s content.
sourcepub fn drafts_delete(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, DraftsDeleteRequest>
pub fn drafts_delete( &self, id: &str, user_id: &str ) -> FluentRequest<'_, DraftsDeleteRequest>
Immediately and permanently deletes the specified draft. Does not simply trash it.
sourcepub fn history_list(
&self,
user_id: &str
) -> FluentRequest<'_, HistoryListRequest>
pub fn history_list( &self, user_id: &str ) -> FluentRequest<'_, HistoryListRequest>
Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId
).
sourcepub fn labels_list(&self, user_id: &str) -> FluentRequest<'_, LabelsListRequest>
pub fn labels_list(&self, user_id: &str) -> FluentRequest<'_, LabelsListRequest>
Lists all labels in the user’s mailbox.
sourcepub fn labels_create(
&self,
user_id: &str
) -> FluentRequest<'_, LabelsCreateRequest>
pub fn labels_create( &self, user_id: &str ) -> FluentRequest<'_, LabelsCreateRequest>
Creates a new label.
sourcepub fn labels_get(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, LabelsGetRequest>
pub fn labels_get( &self, id: &str, user_id: &str ) -> FluentRequest<'_, LabelsGetRequest>
Gets the specified label.
sourcepub fn labels_update(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, LabelsUpdateRequest>
pub fn labels_update( &self, id: &str, user_id: &str ) -> FluentRequest<'_, LabelsUpdateRequest>
Updates the specified label.
sourcepub fn labels_delete(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, LabelsDeleteRequest>
pub fn labels_delete( &self, id: &str, user_id: &str ) -> FluentRequest<'_, LabelsDeleteRequest>
Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.
sourcepub fn labels_patch(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, LabelsPatchRequest>
pub fn labels_patch( &self, id: &str, user_id: &str ) -> FluentRequest<'_, LabelsPatchRequest>
Patch the specified label.
sourcepub fn messages_list(
&self,
user_id: &str
) -> FluentRequest<'_, MessagesListRequest>
pub fn messages_list( &self, user_id: &str ) -> FluentRequest<'_, MessagesListRequest>
Lists the messages in the user’s mailbox.
sourcepub fn messages_insert(
&self,
user_id: &str
) -> FluentRequest<'_, MessagesInsertRequest>
pub fn messages_insert( &self, user_id: &str ) -> FluentRequest<'_, MessagesInsertRequest>
Directly inserts a message into only this user’s mailbox similar to IMAP APPEND
, bypassing most scanning and classification. Does not send a message.
sourcepub fn messages_batch_delete(
&self,
user_id: &str
) -> FluentRequest<'_, MessagesBatchDeleteRequest>
pub fn messages_batch_delete( &self, user_id: &str ) -> FluentRequest<'_, MessagesBatchDeleteRequest>
Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
sourcepub fn messages_batch_modify(
&self,
user_id: &str
) -> FluentRequest<'_, MessagesBatchModifyRequest>
pub fn messages_batch_modify( &self, user_id: &str ) -> FluentRequest<'_, MessagesBatchModifyRequest>
Modifies the labels on the specified messages.
sourcepub fn messages_import(
&self,
user_id: &str
) -> FluentRequest<'_, MessagesImportRequest>
pub fn messages_import( &self, user_id: &str ) -> FluentRequest<'_, MessagesImportRequest>
Imports a message into only this user’s mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn’t perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message. Note: This function doesn’t trigger forwarding rules or filters set up by the user.
sourcepub fn messages_send(
&self,
user_id: &str
) -> FluentRequest<'_, MessagesSendRequest>
pub fn messages_send( &self, user_id: &str ) -> FluentRequest<'_, MessagesSendRequest>
Sends the specified message to the recipients in the To
, Cc
, and Bcc
headers.
sourcepub fn messages_get(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, MessagesGetRequest>
pub fn messages_get( &self, id: &str, user_id: &str ) -> FluentRequest<'_, MessagesGetRequest>
Gets the specified message.
sourcepub fn messages_delete(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, MessagesDeleteRequest>
pub fn messages_delete( &self, id: &str, user_id: &str ) -> FluentRequest<'_, MessagesDeleteRequest>
Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash
instead.
sourcepub fn messages_modify(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, MessagesModifyRequest>
pub fn messages_modify( &self, id: &str, user_id: &str ) -> FluentRequest<'_, MessagesModifyRequest>
Modifies the labels on the specified message.
sourcepub fn messages_trash(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, MessagesTrashRequest>
pub fn messages_trash( &self, id: &str, user_id: &str ) -> FluentRequest<'_, MessagesTrashRequest>
Moves the specified message to the trash.
sourcepub fn messages_untrash(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, MessagesUntrashRequest>
pub fn messages_untrash( &self, id: &str, user_id: &str ) -> FluentRequest<'_, MessagesUntrashRequest>
Removes the specified message from the trash.
sourcepub fn messages_attachments_get(
&self,
id: &str,
message_id: &str,
user_id: &str
) -> FluentRequest<'_, MessagesAttachmentsGetRequest>
pub fn messages_attachments_get( &self, id: &str, message_id: &str, user_id: &str ) -> FluentRequest<'_, MessagesAttachmentsGetRequest>
Gets the specified message attachment.
sourcepub fn get_profile(&self, user_id: &str) -> FluentRequest<'_, GetProfileRequest>
pub fn get_profile(&self, user_id: &str) -> FluentRequest<'_, GetProfileRequest>
Gets the current user’s Gmail profile.
sourcepub fn settings_get_auto_forwarding(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsGetAutoForwardingRequest>
pub fn settings_get_auto_forwarding( &self, user_id: &str ) -> FluentRequest<'_, SettingsGetAutoForwardingRequest>
Gets the auto-forwarding setting for the specified account.
sourcepub fn settings_update_auto_forwarding(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsUpdateAutoForwardingRequest>
pub fn settings_update_auto_forwarding( &self, user_id: &str ) -> FluentRequest<'_, SettingsUpdateAutoForwardingRequest>
Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_delegates_list(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsDelegatesListRequest>
pub fn settings_delegates_list( &self, user_id: &str ) -> FluentRequest<'_, SettingsDelegatesListRequest>
Lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_delegates_create(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsDelegatesCreateRequest>
pub fn settings_delegates_create( &self, user_id: &str ) -> FluentRequest<'_, SettingsDelegatesCreateRequest>
Adds a delegate with its verification status set directly to accepted
, without sending any verification email. The delegate user must be a member of the same G Suite organization as the delegator user. Gmail imposes limitations on the number of delegates and delegators each user in a G Suite organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators. Note that a delegate user must be referred to by their primary email address, and not an email alias. Also note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_delegates_get(
&self,
delegate_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsDelegatesGetRequest>
pub fn settings_delegates_get( &self, delegate_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsDelegatesGetRequest>
Gets the specified delegate. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_delegates_delete(
&self,
delegate_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsDelegatesDeleteRequest>
pub fn settings_delegates_delete( &self, delegate_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsDelegatesDeleteRequest>
Removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_filters_list(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsFiltersListRequest>
pub fn settings_filters_list( &self, user_id: &str ) -> FluentRequest<'_, SettingsFiltersListRequest>
Lists the message filters of a Gmail user.
sourcepub fn settings_filters_create(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsFiltersCreateRequest>
pub fn settings_filters_create( &self, user_id: &str ) -> FluentRequest<'_, SettingsFiltersCreateRequest>
Creates a filter. Note: you can only create a maximum of 1,000 filters.
sourcepub fn settings_filters_get(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, SettingsFiltersGetRequest>
pub fn settings_filters_get( &self, id: &str, user_id: &str ) -> FluentRequest<'_, SettingsFiltersGetRequest>
Gets a filter.
sourcepub fn settings_filters_delete(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, SettingsFiltersDeleteRequest>
pub fn settings_filters_delete( &self, id: &str, user_id: &str ) -> FluentRequest<'_, SettingsFiltersDeleteRequest>
Deletes a filter.
sourcepub fn settings_forwarding_addresses_list(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsForwardingAddressesListRequest>
pub fn settings_forwarding_addresses_list( &self, user_id: &str ) -> FluentRequest<'_, SettingsForwardingAddressesListRequest>
Lists the forwarding addresses for the specified account.
sourcepub fn settings_forwarding_addresses_create(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsForwardingAddressesCreateRequest>
pub fn settings_forwarding_addresses_create( &self, user_id: &str ) -> FluentRequest<'_, SettingsForwardingAddressesCreateRequest>
Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource’s verification status will be set to pending
; otherwise, the resource will be created with verification status set to accepted
. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_forwarding_addresses_get(
&self,
forwarding_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsForwardingAddressesGetRequest>
pub fn settings_forwarding_addresses_get( &self, forwarding_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsForwardingAddressesGetRequest>
Gets the specified forwarding address.
sourcepub fn settings_forwarding_addresses_delete(
&self,
forwarding_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsForwardingAddressesDeleteRequest>
pub fn settings_forwarding_addresses_delete( &self, forwarding_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsForwardingAddressesDeleteRequest>
Deletes the specified forwarding address and revokes any verification that may have been required. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_get_imap(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsGetImapRequest>
pub fn settings_get_imap( &self, user_id: &str ) -> FluentRequest<'_, SettingsGetImapRequest>
Gets IMAP settings.
sourcepub fn settings_update_imap(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsUpdateImapRequest>
pub fn settings_update_imap( &self, user_id: &str ) -> FluentRequest<'_, SettingsUpdateImapRequest>
Updates IMAP settings.
sourcepub fn settings_get_language(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsGetLanguageRequest>
pub fn settings_get_language( &self, user_id: &str ) -> FluentRequest<'_, SettingsGetLanguageRequest>
Gets language settings.
sourcepub fn settings_update_language(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsUpdateLanguageRequest>
pub fn settings_update_language( &self, user_id: &str ) -> FluentRequest<'_, SettingsUpdateLanguageRequest>
Updates language settings. If successful, the return object contains the displayLanguage
that was saved for the user, which may differ from the value passed into the request. This is because the requested displayLanguage
may not be directly supported by Gmail but have a close variant that is, and so the variant may be chosen and saved instead.
sourcepub fn settings_get_pop(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsGetPopRequest>
pub fn settings_get_pop( &self, user_id: &str ) -> FluentRequest<'_, SettingsGetPopRequest>
Gets POP settings.
sourcepub fn settings_update_pop(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsUpdatePopRequest>
pub fn settings_update_pop( &self, user_id: &str ) -> FluentRequest<'_, SettingsUpdatePopRequest>
Updates POP settings.
sourcepub fn settings_send_as_list(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsListRequest>
pub fn settings_send_as_list( &self, user_id: &str ) -> FluentRequest<'_, SettingsSendAsListRequest>
Lists the send-as aliases for the specified account. The result includes the primary send-as address associated with the account as well as any custom “from” aliases.
sourcepub fn settings_send_as_create(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsCreateRequest>
pub fn settings_send_as_create( &self, user_id: &str ) -> FluentRequest<'_, SettingsSendAsCreateRequest>
Creates a custom “from” send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource’s verification status will be set to pending
; otherwise, the resource will be created with verification status set to accepted
. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_send_as_get(
&self,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsGetRequest>
pub fn settings_send_as_get( &self, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsGetRequest>
Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.
sourcepub fn settings_send_as_update(
&self,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsUpdateRequest>
pub fn settings_send_as_update( &self, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsUpdateRequest>
Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority.
sourcepub fn settings_send_as_delete(
&self,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsDeleteRequest>
pub fn settings_send_as_delete( &self, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsDeleteRequest>
Deletes the specified send-as alias. Revokes any verification that may have been required for using it. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_send_as_patch(
&self,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsPatchRequest>
pub fn settings_send_as_patch( &self, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsPatchRequest>
Patch the specified send-as alias.
sourcepub fn settings_send_as_smime_info_list(
&self,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsSmimeInfoListRequest>
pub fn settings_send_as_smime_info_list( &self, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsSmimeInfoListRequest>
Lists S/MIME configs for the specified send-as alias.
sourcepub fn settings_send_as_smime_info_insert(
&self,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsSmimeInfoInsertRequest>
pub fn settings_send_as_smime_info_insert( &self, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsSmimeInfoInsertRequest>
Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.
sourcepub fn settings_send_as_smime_info_get(
&self,
id: &str,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsSmimeInfoGetRequest>
pub fn settings_send_as_smime_info_get( &self, id: &str, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsSmimeInfoGetRequest>
Gets the specified S/MIME config for the specified send-as alias.
sourcepub fn settings_send_as_smime_info_delete(
&self,
id: &str,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsSmimeInfoDeleteRequest>
pub fn settings_send_as_smime_info_delete( &self, id: &str, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsSmimeInfoDeleteRequest>
Deletes the specified S/MIME config for the specified send-as alias.
sourcepub fn settings_send_as_smime_info_set_default(
&self,
id: &str,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsSmimeInfoSetDefaultRequest>
pub fn settings_send_as_smime_info_set_default( &self, id: &str, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsSmimeInfoSetDefaultRequest>
Sets the default S/MIME config for the specified send-as alias.
sourcepub fn settings_send_as_verify(
&self,
send_as_email: &str,
user_id: &str
) -> FluentRequest<'_, SettingsSendAsVerifyRequest>
pub fn settings_send_as_verify( &self, send_as_email: &str, user_id: &str ) -> FluentRequest<'_, SettingsSendAsVerifyRequest>
Sends a verification email to the specified send-as alias address. The verification status must be pending
. This method is only available to service account clients that have been delegated domain-wide authority.
sourcepub fn settings_get_vacation(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsGetVacationRequest>
pub fn settings_get_vacation( &self, user_id: &str ) -> FluentRequest<'_, SettingsGetVacationRequest>
Gets vacation responder settings.
sourcepub fn settings_update_vacation(
&self,
user_id: &str
) -> FluentRequest<'_, SettingsUpdateVacationRequest>
pub fn settings_update_vacation( &self, user_id: &str ) -> FluentRequest<'_, SettingsUpdateVacationRequest>
Updates vacation responder settings.
sourcepub fn stop(&self, user_id: &str) -> FluentRequest<'_, StopRequest>
pub fn stop(&self, user_id: &str) -> FluentRequest<'_, StopRequest>
Stop receiving push notifications for the given user mailbox.
sourcepub fn threads_list(
&self,
user_id: &str
) -> FluentRequest<'_, ThreadsListRequest>
pub fn threads_list( &self, user_id: &str ) -> FluentRequest<'_, ThreadsListRequest>
Lists the threads in the user’s mailbox.
sourcepub fn threads_get(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, ThreadsGetRequest>
pub fn threads_get( &self, id: &str, user_id: &str ) -> FluentRequest<'_, ThreadsGetRequest>
Gets the specified thread.
sourcepub fn threads_delete(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, ThreadsDeleteRequest>
pub fn threads_delete( &self, id: &str, user_id: &str ) -> FluentRequest<'_, ThreadsDeleteRequest>
Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash
instead.
sourcepub fn threads_modify(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, ThreadsModifyRequest>
pub fn threads_modify( &self, id: &str, user_id: &str ) -> FluentRequest<'_, ThreadsModifyRequest>
Modifies the labels applied to the thread. This applies to all messages in the thread.
sourcepub fn threads_trash(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, ThreadsTrashRequest>
pub fn threads_trash( &self, id: &str, user_id: &str ) -> FluentRequest<'_, ThreadsTrashRequest>
Moves the specified thread to the trash.
sourcepub fn threads_untrash(
&self,
id: &str,
user_id: &str
) -> FluentRequest<'_, ThreadsUntrashRequest>
pub fn threads_untrash( &self, id: &str, user_id: &str ) -> FluentRequest<'_, ThreadsUntrashRequest>
Removes the specified thread from the trash.
sourcepub fn watch(&self, user_id: &str) -> FluentRequest<'_, WatchRequest>
pub fn watch(&self, user_id: &str) -> FluentRequest<'_, WatchRequest>
Set up or update a push notification watch on the given user mailbox.