Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Gmail

import { Gmail } from "https://googleapis.deno.dev/v1/gmail:v1.ts";

The Gmail API lets you view and manage Gmail mailbox data like threads, messages, and labels.

class Gmail {
constructor(client?: CredentialsClient, baseUrl?: string);
async usersDraftsCreate(userId: string, req: Draft): Promise<Draft>;
async usersDraftsDelete(id: string, userId: string): Promise<void>;
async usersDraftsGet(
id: string,
userId: string,
): Promise<Draft>;
async usersDraftsList(userId: string, opts?: UsersDraftsListOptions): Promise<ListDraftsResponse>;
async usersDraftsSend(userId: string, req: Draft): Promise<Message>;
async usersDraftsUpdate(
id: string,
userId: string,
req: Draft,
): Promise<Draft>;
async usersGetProfile(userId: string, opts?: UsersGetProfileOptions): Promise<Profile>;
async usersHistoryList(userId: string, opts?: UsersHistoryListOptions): Promise<ListHistoryResponse>;
async usersLabelsCreate(userId: string, req: Label): Promise<Label>;
async usersLabelsDelete(id: string, userId: string): Promise<void>;
async usersLabelsGet(id: string, userId: string): Promise<Label>;
async usersLabelsList(userId: string): Promise<ListLabelsResponse>;
async usersLabelsPatch(
id: string,
userId: string,
req: Label,
): Promise<Label>;
async usersLabelsUpdate(
id: string,
userId: string,
req: Label,
): Promise<Label>;
async usersMessagesAttachmentsGet(
id: string,
messageId: string,
userId: string,
): Promise<MessagePartBody>;
async usersMessagesBatchDelete(userId: string, req: BatchDeleteMessagesRequest): Promise<void>;
async usersMessagesBatchModify(userId: string, req: BatchModifyMessagesRequest): Promise<void>;
async usersMessagesDelete(id: string, userId: string): Promise<void>;
async usersMessagesGet(
id: string,
userId: string,
): Promise<Message>;
async usersMessagesImport(
userId: string,
req: Message,
): Promise<Message>;
async usersMessagesInsert(
userId: string,
req: Message,
): Promise<Message>;
async usersMessagesList(userId: string, opts?: UsersMessagesListOptions): Promise<ListMessagesResponse>;
async usersMessagesModify(
id: string,
userId: string,
): Promise<Message>;
async usersMessagesSend(userId: string, req: Message): Promise<Message>;
async usersMessagesTrash(id: string, userId: string): Promise<Message>;
async usersMessagesUntrash(id: string, userId: string): Promise<Message>;
async usersSettingsCseIdentitiesCreate(userId: string, req: CseIdentity): Promise<CseIdentity>;
async usersSettingsCseIdentitiesDelete(cseEmailAddress: string, userId: string): Promise<void>;
async usersSettingsCseIdentitiesGet(cseEmailAddress: string, userId: string): Promise<CseIdentity>;
async usersSettingsCseIdentitiesList(userId: string, opts?: UsersSettingsCseIdentitiesListOptions): Promise<ListCseIdentitiesResponse>;
async usersSettingsCseIdentitiesPatch(
emailAddress: string,
userId: string,
): Promise<CseIdentity>;
async usersSettingsCseKeypairsCreate(userId: string, req: CseKeyPair): Promise<CseKeyPair>;
async usersSettingsCseKeypairsDisable(
keyPairId: string,
userId: string,
): Promise<CseKeyPair>;
async usersSettingsCseKeypairsEnable(
keyPairId: string,
userId: string,
): Promise<CseKeyPair>;
async usersSettingsCseKeypairsGet(keyPairId: string, userId: string): Promise<CseKeyPair>;
async usersSettingsCseKeypairsList(userId: string, opts?: UsersSettingsCseKeypairsListOptions): Promise<ListCseKeyPairsResponse>;
async usersSettingsCseKeypairsObliterate(
keyPairId: string,
userId: string,
): Promise<void>;
async usersSettingsDelegatesCreate(userId: string, req: Delegate): Promise<Delegate>;
async usersSettingsDelegatesDelete(delegateEmail: string, userId: string): Promise<void>;
async usersSettingsDelegatesGet(delegateEmail: string, userId: string): Promise<Delegate>;
async usersSettingsDelegatesList(userId: string): Promise<ListDelegatesResponse>;
async usersSettingsFiltersCreate(userId: string, req: Filter): Promise<Filter>;
async usersSettingsFiltersDelete(id: string, userId: string): Promise<void>;
async usersSettingsFiltersGet(id: string, userId: string): Promise<Filter>;
async usersSettingsFiltersList(userId: string): Promise<ListFiltersResponse>;
async usersSettingsForwardingAddressesCreate(userId: string, req: ForwardingAddress): Promise<ForwardingAddress>;
async usersSettingsForwardingAddressesDelete(forwardingEmail: string, userId: string): Promise<void>;
async usersSettingsForwardingAddressesGet(forwardingEmail: string, userId: string): Promise<ForwardingAddress>;
async usersSettingsForwardingAddressesList(userId: string): Promise<ListForwardingAddressesResponse>;
async usersSettingsGetAutoForwarding(userId: string): Promise<AutoForwarding>;
async usersSettingsGetImap(userId: string): Promise<ImapSettings>;
async usersSettingsGetLanguage(userId: string): Promise<LanguageSettings>;
async usersSettingsGetPop(userId: string): Promise<PopSettings>;
async usersSettingsGetVacation(userId: string): Promise<VacationSettings>;
async usersSettingsSendAsCreate(userId: string, req: SendAs): Promise<SendAs>;
async usersSettingsSendAsDelete(sendAsEmail: string, userId: string): Promise<void>;
async usersSettingsSendAsGet(sendAsEmail: string, userId: string): Promise<SendAs>;
async usersSettingsSendAsList(userId: string): Promise<ListSendAsResponse>;
async usersSettingsSendAsPatch(
sendAsEmail: string,
userId: string,
req: SendAs,
): Promise<SendAs>;
async usersSettingsSendAsSmimeInfoDelete(
id: string,
sendAsEmail: string,
userId: string,
): Promise<void>;
async usersSettingsSendAsSmimeInfoGet(
id: string,
sendAsEmail: string,
userId: string,
): Promise<SmimeInfo>;
async usersSettingsSendAsSmimeInfoInsert(
sendAsEmail: string,
userId: string,
req: SmimeInfo,
): Promise<SmimeInfo>;
async usersSettingsSendAsSmimeInfoList(sendAsEmail: string, userId: string): Promise<ListSmimeInfoResponse>;
async usersSettingsSendAsSmimeInfoSetDefault(
id: string,
sendAsEmail: string,
userId: string,
): Promise<void>;
async usersSettingsSendAsUpdate(
sendAsEmail: string,
userId: string,
req: SendAs,
): Promise<SendAs>;
async usersSettingsSendAsVerify(sendAsEmail: string, userId: string): Promise<void>;
async usersSettingsUpdateAutoForwarding(userId: string, req: AutoForwarding): Promise<AutoForwarding>;
async usersSettingsUpdateImap(userId: string, req: ImapSettings): Promise<ImapSettings>;
async usersSettingsUpdateLanguage(userId: string, req: LanguageSettings): Promise<LanguageSettings>;
async usersSettingsUpdatePop(userId: string, req: PopSettings): Promise<PopSettings>;
async usersSettingsUpdateVacation(userId: string, req: VacationSettings): Promise<VacationSettings>;
async usersStop(userId: string): Promise<void>;
async usersThreadsDelete(id: string, userId: string): Promise<void>;
async usersThreadsGet(
id: string,
userId: string,
): Promise<Thread>;
async usersThreadsList(userId: string, opts?: UsersThreadsListOptions): Promise<ListThreadsResponse>;
async usersThreadsModify(
id: string,
userId: string,
): Promise<Thread>;
async usersThreadsTrash(id: string, userId: string): Promise<Thread>;
async usersThreadsUntrash(id: string, userId: string): Promise<Thread>;
async usersWatch(userId: string, req: WatchRequest): Promise<WatchResponse>;
}

§Constructors

§
new Gmail(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§
usersDraftsCreate(userId: string, req: Draft): Promise<Draft>
[src]

Creates a new draft with the DRAFT label.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersDraftsDelete(id: string, userId: string): Promise<void>
[src]

Immediately and permanently deletes the specified draft. Does not simply trash it.

@param id

The ID of the draft to delete.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersDraftsGet(id: string, userId: string, opts?: UsersDraftsGetOptions): Promise<Draft>
[src]

Gets the specified draft.

@param id

The ID of the draft to retrieve.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersDraftsList(userId: string, opts?: UsersDraftsListOptions): Promise<ListDraftsResponse>
[src]

Lists the drafts in the user's mailbox.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersDraftsSend(userId: string, req: Draft): Promise<Message>
[src]

Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersDraftsUpdate(id: string, userId: string, req: Draft): Promise<Draft>
[src]

Replaces a draft's content.

@param id

The ID of the draft to update.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersGetProfile(userId: string, opts?: UsersGetProfileOptions): Promise<Profile>
[src]

Gets the current user's Gmail profile.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersHistoryList(userId: string, opts?: UsersHistoryListOptions): Promise<ListHistoryResponse>
[src]

Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersLabelsCreate(userId: string, req: Label): Promise<Label>
[src]

Creates a new label.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersLabelsDelete(id: string, userId: string): Promise<void>
[src]

Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.

@param id

The ID of the label to delete.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersLabelsGet(id: string, userId: string): Promise<Label>
[src]

Gets the specified label.

@param id

The ID of the label to retrieve.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersLabelsList(userId: string): Promise<ListLabelsResponse>
[src]

Lists all labels in the user's mailbox.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersLabelsPatch(id: string, userId: string, req: Label): Promise<Label>
[src]

Patch the specified label.

@param id

The ID of the label to update.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersLabelsUpdate(id: string, userId: string, req: Label): Promise<Label>
[src]

Updates the specified label.

@param id

The ID of the label to update.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesAttachmentsGet(id: string, messageId: string, userId: string, opts?: UsersMessagesAttachmentsGetOptions): Promise<MessagePartBody>
[src]

Gets the specified message attachment.

@param id

The ID of the attachment.

@param messageId

The ID of the message containing the attachment.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesBatchDelete(userId: string, req: BatchDeleteMessagesRequest): Promise<void>
[src]

Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesBatchModify(userId: string, req: BatchModifyMessagesRequest): Promise<void>
[src]

Modifies the labels on the specified messages.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesDelete(id: string, userId: string): Promise<void>
[src]

Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.

@param id

The ID of the message to delete.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesGet(id: string, userId: string, opts?: UsersMessagesGetOptions): Promise<Message>
[src]

Gets the specified message.

@param id

The ID of the message to retrieve. This ID is usually retrieved using messages.list. The ID is also contained in the result when a message is inserted (messages.insert) or imported (messages.import).

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesImport(userId: string, req: Message, opts?: UsersMessagesImportOptions): Promise<Message>
[src]

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.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesInsert(userId: string, req: Message, opts?: UsersMessagesInsertOptions): Promise<Message>
[src]

Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesList(userId: string, opts?: UsersMessagesListOptions): Promise<ListMessagesResponse>
[src]

Lists the messages in the user's mailbox.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesModify(id: string, userId: string, req: ModifyMessageRequest): Promise<Message>
[src]

Modifies the labels on the specified message.

@param id

The ID of the message to modify.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesSend(userId: string, req: Message): Promise<Message>
[src]

Sends the specified message to the recipients in the To, Cc, and Bcc headers. For example usage, see Sending email.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesTrash(id: string, userId: string): Promise<Message>
[src]

Moves the specified message to the trash.

@param id

The ID of the message to Trash.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersMessagesUntrash(id: string, userId: string): Promise<Message>
[src]

Removes the specified message from the trash.

@param id

The ID of the message to remove from Trash.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersSettingsCseIdentitiesCreate(userId: string, req: CseIdentity): Promise<CseIdentity>
[src]

Creates and configures a client-side encryption identity that's authorized to send mail from the user account. Google publishes the S/MIME certificate to a shared domain-wide directory so that people within a Google Workspace organization can encrypt and send mail to the identity.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseIdentitiesDelete(cseEmailAddress: string, userId: string): Promise<void>
[src]

Deletes a client-side encryption identity. The authenticated user can no longer use the identity to send encrypted messages. You cannot restore the identity after you delete it. Instead, use the CreateCseIdentity method to create another identity with the same configuration.

@param cseEmailAddress

The primary email address associated with the client-side encryption identity configuration that's removed.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseIdentitiesGet(cseEmailAddress: string, userId: string): Promise<CseIdentity>
[src]

Retrieves a client-side encryption identity configuration.

@param cseEmailAddress

The primary email address associated with the client-side encryption identity configuration that's retrieved.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseIdentitiesList(userId: string, opts?: UsersSettingsCseIdentitiesListOptions): Promise<ListCseIdentitiesResponse>
[src]

Lists the client-side encrypted identities for an authenticated user.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseIdentitiesPatch(emailAddress: string, userId: string, req: CseIdentity): Promise<CseIdentity>
[src]

Associates a different key pair with an existing client-side encryption identity. The updated key pair must validate against Google's S/MIME certificate profiles.

@param emailAddress

The email address of the client-side encryption identity to update.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseKeypairsCreate(userId: string, req: CseKeyPair): Promise<CseKeyPair>
[src]

Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseKeypairsDisable(keyPairId: string, userId: string, req: DisableCseKeyPairRequest): Promise<CseKeyPair>
[src]

Turns off a client-side encryption key pair. The authenticated user can no longer use the key pair to decrypt incoming CSE message texts or sign outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the key pair. After 30 days, you can permanently delete the key pair by using the ObliterateCseKeyPair method.

@param keyPairId

The identifier of the key pair to turn off.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseKeypairsEnable(keyPairId: string, userId: string, req: EnableCseKeyPairRequest): Promise<CseKeyPair>
[src]

Turns on a client-side encryption key pair that was turned off. The key pair becomes active again for any associated client-side encryption identities.

@param keyPairId

The identifier of the key pair to turn on.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseKeypairsGet(keyPairId: string, userId: string): Promise<CseKeyPair>
[src]

Retrieves an existing client-side encryption key pair.

@param keyPairId

The identifier of the key pair to retrieve.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseKeypairsList(userId: string, opts?: UsersSettingsCseKeypairsListOptions): Promise<ListCseKeyPairsResponse>
[src]

Lists client-side encryption key pairs for an authenticated user.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsCseKeypairsObliterate(keyPairId: string, userId: string, req: ObliterateCseKeyPairRequest): Promise<void>
[src]

Deletes a client-side encryption key pair permanently and immediately. You can only permanently delete key pairs that have been turned off for more than 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail can't restore or decrypt any messages that were encrypted by an obliterated key. Authenticated users and Google Workspace administrators lose access to reading the encrypted messages.

@param keyPairId

The identifier of the key pair to obliterate.

@param userId

The requester's primary email address. To indicate the authenticated user, you can use the special value me.

§
usersSettingsDelegatesCreate(userId: string, req: Delegate): Promise<Delegate>
[src]

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 Google Workspace organization as the delegator user. Gmail imposes limitations on the number of delegates and delegators each user in a Google Workspace 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.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsDelegatesDelete(delegateEmail: string, userId: string): Promise<void>
[src]

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.

@param delegateEmail

The email address of the user to be removed as a delegate.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsDelegatesGet(delegateEmail: string, userId: string): Promise<Delegate>
[src]

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.

@param delegateEmail

The email address of the user whose delegate relationship is to be retrieved.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsDelegatesList(userId: string): Promise<ListDelegatesResponse>
[src]

Lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsFiltersCreate(userId: string, req: Filter): Promise<Filter>
[src]

Creates a filter. Note: you can only create a maximum of 1,000 filters.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsFiltersDelete(id: string, userId: string): Promise<void>
[src]

Immediately and permanently deletes the specified filter.

@param id

The ID of the filter to be deleted.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsFiltersGet(id: string, userId: string): Promise<Filter>
[src]

Gets a filter.

@param id

The ID of the filter to be fetched.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsFiltersList(userId: string): Promise<ListFiltersResponse>
[src]

Lists the message filters of a Gmail user.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsForwardingAddressesCreate(userId: string, req: ForwardingAddress): Promise<ForwardingAddress>
[src]

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.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsForwardingAddressesDelete(forwardingEmail: string, userId: string): Promise<void>
[src]

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.

@param forwardingEmail

The forwarding address to be deleted.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsForwardingAddressesGet(forwardingEmail: string, userId: string): Promise<ForwardingAddress>
[src]

Gets the specified forwarding address.

@param forwardingEmail

The forwarding address to be retrieved.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsForwardingAddressesList(userId: string): Promise<ListForwardingAddressesResponse>
[src]

Lists the forwarding addresses for the specified account.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsGetAutoForwarding(userId: string): Promise<AutoForwarding>
[src]

Gets the auto-forwarding setting for the specified account.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsGetImap(userId: string): Promise<ImapSettings>
[src]

Gets IMAP settings.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsGetLanguage(userId: string): Promise<LanguageSettings>
[src]

Gets language settings.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsGetPop(userId: string): Promise<PopSettings>
[src]

Gets POP settings.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsGetVacation(userId: string): Promise<VacationSettings>
[src]

Gets vacation responder settings.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsSendAsCreate(userId: string, req: SendAs): Promise<SendAs>
[src]

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.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsSendAsDelete(sendAsEmail: string, userId: string): Promise<void>
[src]

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.

@param sendAsEmail

The send-as alias to be deleted.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsSendAsGet(sendAsEmail: string, userId: string): Promise<SendAs>
[src]

Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.

@param sendAsEmail

The send-as alias to be retrieved.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsSendAsList(userId: string): Promise<ListSendAsResponse>
[src]

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.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsSendAsPatch(sendAsEmail: string, userId: string, req: SendAs): Promise<SendAs>
[src]

Patch the specified send-as alias.

@param sendAsEmail

The send-as alias to be updated.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsSendAsSmimeInfoDelete(id: string, sendAsEmail: string, userId: string): Promise<void>
[src]

Deletes the specified S/MIME config for the specified send-as alias.

@param id

The immutable ID for the SmimeInfo.

@param sendAsEmail

The email address that appears in the "From:" header for mail sent using this alias.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersSettingsSendAsSmimeInfoGet(id: string, sendAsEmail: string, userId: string): Promise<SmimeInfo>
[src]

Gets the specified S/MIME config for the specified send-as alias.

@param id

The immutable ID for the SmimeInfo.

@param sendAsEmail

The email address that appears in the "From:" header for mail sent using this alias.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersSettingsSendAsSmimeInfoInsert(sendAsEmail: string, userId: string, req: SmimeInfo): Promise<SmimeInfo>
[src]

Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.

@param sendAsEmail

The email address that appears in the "From:" header for mail sent using this alias.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersSettingsSendAsSmimeInfoList(sendAsEmail: string, userId: string): Promise<ListSmimeInfoResponse>
[src]

Lists S/MIME configs for the specified send-as alias.

@param sendAsEmail

The email address that appears in the "From:" header for mail sent using this alias.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersSettingsSendAsSmimeInfoSetDefault(id: string, sendAsEmail: string, userId: string): Promise<void>
[src]

Sets the default S/MIME config for the specified send-as alias.

@param id

The immutable ID for the SmimeInfo.

@param sendAsEmail

The email address that appears in the "From:" header for mail sent using this alias.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersSettingsSendAsUpdate(sendAsEmail: string, userId: string, req: SendAs): Promise<SendAs>
[src]

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.

@param sendAsEmail

The send-as alias to be updated.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsSendAsVerify(sendAsEmail: string, userId: string): Promise<void>
[src]

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.

@param sendAsEmail

The send-as alias to be verified.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsUpdateAutoForwarding(userId: string, req: AutoForwarding): Promise<AutoForwarding>
[src]

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.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsUpdateImap(userId: string, req: ImapSettings): Promise<ImapSettings>
[src]

Updates IMAP settings.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsUpdateLanguage(userId: string, req: LanguageSettings): Promise<LanguageSettings>
[src]

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.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsUpdatePop(userId: string, req: PopSettings): Promise<PopSettings>
[src]

Updates POP settings.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersSettingsUpdateVacation(userId: string, req: VacationSettings): Promise<VacationSettings>
[src]

Updates vacation responder settings.

@param userId

User's email address. The special value "me" can be used to indicate the authenticated user.

§
usersStop(userId: string): Promise<void>
[src]

Stop receiving push notifications for the given user mailbox.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersThreadsDelete(id: string, userId: string): Promise<void>
[src]

Immediately and permanently deletes the specified thread. Any messages that belong to the thread are also deleted. This operation cannot be undone. Prefer threads.trash instead.

@param id

ID of the Thread to delete.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersThreadsGet(id: string, userId: string, opts?: UsersThreadsGetOptions): Promise<Thread>
[src]

Gets the specified thread.

@param id

The ID of the thread to retrieve.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersThreadsList(userId: string, opts?: UsersThreadsListOptions): Promise<ListThreadsResponse>
[src]

Lists the threads in the user's mailbox.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersThreadsModify(id: string, userId: string, req: ModifyThreadRequest): Promise<Thread>
[src]

Modifies the labels applied to the thread. This applies to all messages in the thread.

@param id

The ID of the thread to modify.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersThreadsTrash(id: string, userId: string): Promise<Thread>
[src]

Moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash.

@param id

The ID of the thread to Trash.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersThreadsUntrash(id: string, userId: string): Promise<Thread>
[src]

Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash.

@param id

The ID of the thread to remove from Trash.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.

§
usersWatch(userId: string, req: WatchRequest): Promise<WatchResponse>
[src]

Set up or update a push notification watch on the given user mailbox.

@param userId

The user's email address. The special value me can be used to indicate the authenticated user.