Class: Google::Apis::GmailV1::GmailService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/gmail_v1/service.rb

Overview

Gmail API

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

Examples:

require 'google/apis/gmail_v1'

Gmail = Google::Apis::GmailV1 # Alias the module
service = Gmail::GmailService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://gmail.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGmailService

Returns a new instance of GmailService.



48
49
50
51
52
53
# File 'lib/google/apis/gmail_v1/service.rb', line 48

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-gmail_v1',
        client_version: Google::Apis::GmailV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



41
42
43
# File 'lib/google/apis/gmail_v1/service.rb', line 41

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



46
47
48
# File 'lib/google/apis/gmail_v1/service.rb', line 46

def quota_user
  @quota_user
end

Instance Method Details

#batch_delete_messages(user_id, batch_delete_messages_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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

Parameters:

  • user_id (String)

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

  • batch_delete_messages_request_object (Google::Apis::GmailV1::BatchDeleteMessagesRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



687
688
689
690
691
692
693
694
695
# File 'lib/google/apis/gmail_v1/service.rb', line 687

def batch_delete_messages(user_id, batch_delete_messages_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages/batchDelete', options)
  command.request_representation = Google::Apis::GmailV1::BatchDeleteMessagesRequest::Representation
  command.request_object = batch_delete_messages_request_object
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#batch_modify_messages(user_id, batch_modify_messages_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Modifies the labels on the specified messages.

Parameters:

  • user_id (String)

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

  • batch_modify_messages_request_object (Google::Apis::GmailV1::BatchModifyMessagesRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



719
720
721
722
723
724
725
726
727
# File 'lib/google/apis/gmail_v1/service.rb', line 719

def batch_modify_messages(user_id, batch_modify_messages_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages/batchModify', options)
  command.request_representation = Google::Apis::GmailV1::BatchModifyMessagesRequest::Representation
  command.request_object = batch_modify_messages_request_object
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Draft

Creates a new draft with the DRAFT label.

Parameters:

  • user_id (String)

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

  • draft_object (Google::Apis::GmailV1::Draft) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/google/apis/gmail_v1/service.rb', line 175

def create_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'gmail/v1/users/{userId}/drafts', options)
  else
    command = make_upload_command(:post, 'gmail/v1/users/{userId}/drafts', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::GmailV1::Draft::Representation
  command.request_object = draft_object
  command.response_representation = Google::Apis::GmailV1::Draft::Representation
  command.response_class = Google::Apis::GmailV1::Draft
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_label(user_id, label_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Label

Creates a new label.

Parameters:

  • user_id (String)

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

  • label_object (Google::Apis::GmailV1::Label) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



480
481
482
483
484
485
486
487
488
489
490
# File 'lib/google/apis/gmail_v1/service.rb', line 480

def create_user_label(user_id, label_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/labels', options)
  command.request_representation = Google::Apis::GmailV1::Label::Representation
  command.request_object = label_object
  command.response_representation = Google::Apis::GmailV1::Label::Representation
  command.response_class = Google::Apis::GmailV1::Label
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_cse_identity(user_id, cse_identity_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::CseIdentity

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.

Parameters:

  • user_id (String)

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

  • cse_identity_object (Google::Apis::GmailV1::CseIdentity) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
# File 'lib/google/apis/gmail_v1/service.rb', line 1517

def create_user_setting_cse_identity(user_id, cse_identity_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/cse/identities', options)
  command.request_representation = Google::Apis::GmailV1::CseIdentity::Representation
  command.request_object = cse_identity_object
  command.response_representation = Google::Apis::GmailV1::CseIdentity::Representation
  command.response_class = Google::Apis::GmailV1::CseIdentity
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_cse_keypair(user_id, cse_key_pair_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::CseKeyPair

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

Parameters:

  • user_id (String)

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

  • cse_key_pair_object (Google::Apis::GmailV1::CseKeyPair) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
# File 'lib/google/apis/gmail_v1/service.rb', line 1701

def create_user_setting_cse_keypair(user_id, cse_key_pair_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/cse/keypairs', options)
  command.request_representation = Google::Apis::GmailV1::CseKeyPair::Representation
  command.request_object = cse_key_pair_object
  command.response_representation = Google::Apis::GmailV1::CseKeyPair::Representation
  command.response_class = Google::Apis::GmailV1::CseKeyPair
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_delegate(user_id, delegate_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Delegate

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.

Parameters:

  • user_id (String)

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

  • delegate_object (Google::Apis::GmailV1::Delegate) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
# File 'lib/google/apis/gmail_v1/service.rb', line 1937

def create_user_setting_delegate(user_id, delegate_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/delegates', options)
  command.request_representation = Google::Apis::GmailV1::Delegate::Representation
  command.request_object = delegate_object
  command.response_representation = Google::Apis::GmailV1::Delegate::Representation
  command.response_class = Google::Apis::GmailV1::Delegate
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_filter(user_id, filter_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Filter

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

Parameters:

  • user_id (String)

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

  • filter_object (Google::Apis::GmailV1::Filter) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
# File 'lib/google/apis/gmail_v1/service.rb', line 2076

def create_user_setting_filter(user_id, filter_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/filters', options)
  command.request_representation = Google::Apis::GmailV1::Filter::Representation
  command.request_object = filter_object
  command.response_representation = Google::Apis::GmailV1::Filter::Representation
  command.response_class = Google::Apis::GmailV1::Filter
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_forwarding_address(user_id, forwarding_address_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ForwardingAddress

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.

Parameters:

  • user_id (String)

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

  • forwarding_address_object (Google::Apis::GmailV1::ForwardingAddress) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
# File 'lib/google/apis/gmail_v1/service.rb', line 2211

def create_user_setting_forwarding_address(user_id, forwarding_address_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/forwardingAddresses', options)
  command.request_representation = Google::Apis::GmailV1::ForwardingAddress::Representation
  command.request_object = forwarding_address_object
  command.response_representation = Google::Apis::GmailV1::ForwardingAddress::Representation
  command.response_class = Google::Apis::GmailV1::ForwardingAddress
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_send_as(user_id, send_as_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::SendAs

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.

Parameters:

  • user_id (String)

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

  • send_as_object (Google::Apis::GmailV1::SendAs) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
# File 'lib/google/apis/gmail_v1/service.rb', line 2352

def create_user_setting_send_as(user_id, send_as_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/sendAs', options)
  command.request_representation = Google::Apis::GmailV1::SendAs::Representation
  command.request_object = send_as_object
  command.response_representation = Google::Apis::GmailV1::SendAs::Representation
  command.response_class = Google::Apis::GmailV1::SendAs
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_draft(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the draft to delete.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



217
218
219
220
221
222
223
224
# File 'lib/google/apis/gmail_v1/service.rb', line 217

def delete_user_draft(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/drafts/{id}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_label(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the label to delete.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



516
517
518
519
520
521
522
523
# File 'lib/google/apis/gmail_v1/service.rb', line 516

def delete_user_label(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/labels/{id}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_message(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the message to delete.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



753
754
755
756
757
758
759
760
# File 'lib/google/apis/gmail_v1/service.rb', line 753

def delete_user_message(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/messages/{id}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_cse_identity(user_id, cse_email_address, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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.

Parameters:

  • user_id (String)

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

  • cse_email_address (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1556
1557
1558
1559
1560
1561
1562
1563
# File 'lib/google/apis/gmail_v1/service.rb', line 1556

def delete_user_setting_cse_identity(user_id, cse_email_address, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['cseEmailAddress'] = cse_email_address unless cse_email_address.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_delegate(user_id, delegate_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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.

Parameters:

  • user_id (String)

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

  • delegate_email (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1976
1977
1978
1979
1980
1981
1982
1983
# File 'lib/google/apis/gmail_v1/service.rb', line 1976

def delete_user_setting_delegate(user_id, delegate_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/settings/delegates/{delegateEmail}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['delegateEmail'] = delegate_email unless delegate_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_filter(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Immediately and permanently deletes the specified filter.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the filter to be deleted.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2111
2112
2113
2114
2115
2116
2117
2118
# File 'lib/google/apis/gmail_v1/service.rb', line 2111

def delete_user_setting_filter(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/settings/filters/{id}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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.

Parameters:

  • user_id (String)

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

  • forwarding_email (String)

    The forwarding address to be deleted.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2248
2249
2250
2251
2252
2253
2254
2255
# File 'lib/google/apis/gmail_v1/service.rb', line 2248

def delete_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['forwardingEmail'] = forwarding_email unless forwarding_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_send_a_smime_info(user_id, send_as_email, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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

Parameters:

  • user_id (String)

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

  • send_as_email (String)

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

  • id (String)

    The immutable ID for the SmimeInfo.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2603
2604
2605
2606
2607
2608
2609
2610
2611
# File 'lib/google/apis/gmail_v1/service.rb', line 2603

def delete_user_setting_send_a_smime_info(user_id, send_as_email, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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.

Parameters:

  • user_id (String)

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

  • send_as_email (String)

    The send-as alias to be deleted.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2389
2390
2391
2392
2393
2394
2395
2396
# File 'lib/google/apis/gmail_v1/service.rb', line 2389

def delete_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_thread(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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.

Parameters:

  • user_id (String)

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

  • id (String)

    ID of the Thread to delete.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2786
2787
2788
2789
2790
2791
2792
2793
# File 'lib/google/apis/gmail_v1/service.rb', line 2786

def delete_user_thread(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'gmail/v1/users/{userId}/threads/{id}', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#disable_keypair_cse_key_pair(user_id, key_pair_id, disable_cse_key_pair_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::CseKeyPair

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.

Parameters:

  • user_id (String)

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

  • key_pair_id (String)

    The identifier of the key pair to turn off.

  • disable_cse_key_pair_request_object (Google::Apis::GmailV1::DisableCseKeyPairRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
# File 'lib/google/apis/gmail_v1/service.rb', line 1741

def disable_keypair_cse_key_pair(user_id, key_pair_id, disable_cse_key_pair_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable', options)
  command.request_representation = Google::Apis::GmailV1::DisableCseKeyPairRequest::Representation
  command.request_object = disable_cse_key_pair_request_object
  command.response_representation = Google::Apis::GmailV1::CseKeyPair::Representation
  command.response_class = Google::Apis::GmailV1::CseKeyPair
  command.params['userId'] = user_id unless user_id.nil?
  command.params['keyPairId'] = key_pair_id unless key_pair_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#enable_keypair_cse_key_pair(user_id, key_pair_id, enable_cse_key_pair_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::CseKeyPair

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.

Parameters:

  • user_id (String)

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

  • key_pair_id (String)

    The identifier of the key pair to turn on.

  • enable_cse_key_pair_request_object (Google::Apis::GmailV1::EnableCseKeyPairRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
# File 'lib/google/apis/gmail_v1/service.rb', line 1779

def enable_keypair_cse_key_pair(user_id, key_pair_id, enable_cse_key_pair_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable', options)
  command.request_representation = Google::Apis::GmailV1::EnableCseKeyPairRequest::Representation
  command.request_object = enable_cse_key_pair_request_object
  command.response_representation = Google::Apis::GmailV1::CseKeyPair::Representation
  command.response_class = Google::Apis::GmailV1::CseKeyPair
  command.params['userId'] = user_id unless user_id.nil?
  command.params['keyPairId'] = key_pair_id unless key_pair_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_draft(user_id, id, format: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Draft

Gets the specified draft.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the draft to retrieve.

  • format (String) (defaults to: nil)

    The format to return the draft in.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



251
252
253
254
255
256
257
258
259
260
261
# File 'lib/google/apis/gmail_v1/service.rb', line 251

def get_user_draft(user_id, id, format: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/drafts/{id}', options)
  command.response_representation = Google::Apis::GmailV1::Draft::Representation
  command.response_class = Google::Apis::GmailV1::Draft
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['format'] = format unless format.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_label(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Label

Gets the specified label.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the label to retrieve.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



548
549
550
551
552
553
554
555
556
557
# File 'lib/google/apis/gmail_v1/service.rb', line 548

def get_user_label(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/labels/{id}', options)
  command.response_representation = Google::Apis::GmailV1::Label::Representation
  command.response_class = Google::Apis::GmailV1::Label
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_message(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

Gets the specified message.

Parameters:

  • user_id (String)

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

  • id (String)

    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).

  • format (String) (defaults to: nil)

    The format to return the message in.

  • metadata_headers (Array<String>, String) (defaults to: nil)

    When given and format is METADATA, only include headers specified.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



791
792
793
794
795
796
797
798
799
800
801
802
# File 'lib/google/apis/gmail_v1/service.rb', line 791

def get_user_message(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/messages/{id}', options)
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['format'] = format unless format.nil?
  command.query['metadataHeaders'] =  unless .nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_message_attachment(user_id, message_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::MessagePartBody

Gets the specified message attachment.

Parameters:

  • user_id (String)

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

  • message_id (String)

    The ID of the message containing the attachment.

  • id (String)

    The ID of the attachment.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
# File 'lib/google/apis/gmail_v1/service.rb', line 1148

def get_user_message_attachment(user_id, message_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}', options)
  command.response_representation = Google::Apis::GmailV1::MessagePartBody::Representation
  command.response_class = Google::Apis::GmailV1::MessagePartBody
  command.params['userId'] = user_id unless user_id.nil?
  command.params['messageId'] = message_id unless message_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_profile(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Profile

Gets the current user's Gmail profile.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



76
77
78
79
80
81
82
83
84
# File 'lib/google/apis/gmail_v1/service.rb', line 76

def (user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/profile', options)
  command.response_representation = Google::Apis::GmailV1::Profile::Representation
  command.response_class = Google::Apis::GmailV1::Profile
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_auto_forwarding(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::AutoForwarding

Gets the auto-forwarding setting for the specified account.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1181
1182
1183
1184
1185
1186
1187
1188
1189
# File 'lib/google/apis/gmail_v1/service.rb', line 1181

def get_user_setting_auto_forwarding(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/autoForwarding', options)
  command.response_representation = Google::Apis::GmailV1::AutoForwarding::Representation
  command.response_class = Google::Apis::GmailV1::AutoForwarding
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_cse_identity(user_id, cse_email_address, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::CseIdentity

Retrieves a client-side encryption identity configuration.

Parameters:

  • user_id (String)

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

  • cse_email_address (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
# File 'lib/google/apis/gmail_v1/service.rb', line 1589

def get_user_setting_cse_identity(user_id, cse_email_address, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}', options)
  command.response_representation = Google::Apis::GmailV1::CseIdentity::Representation
  command.response_class = Google::Apis::GmailV1::CseIdentity
  command.params['userId'] = user_id unless user_id.nil?
  command.params['cseEmailAddress'] = cse_email_address unless cse_email_address.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_cse_keypair(user_id, key_pair_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::CseKeyPair

Retrieves an existing client-side encryption key pair.

Parameters:

  • user_id (String)

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

  • key_pair_id (String)

    The identifier of the key pair to retrieve.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
# File 'lib/google/apis/gmail_v1/service.rb', line 1815

def get_user_setting_cse_keypair(user_id, key_pair_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}', options)
  command.response_representation = Google::Apis::GmailV1::CseKeyPair::Representation
  command.response_class = Google::Apis::GmailV1::CseKeyPair
  command.params['userId'] = user_id unless user_id.nil?
  command.params['keyPairId'] = key_pair_id unless key_pair_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_delegate(user_id, delegate_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Delegate

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.

Parameters:

  • user_id (String)

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

  • delegate_email (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
# File 'lib/google/apis/gmail_v1/service.rb', line 2011

def get_user_setting_delegate(user_id, delegate_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/delegates/{delegateEmail}', options)
  command.response_representation = Google::Apis::GmailV1::Delegate::Representation
  command.response_class = Google::Apis::GmailV1::Delegate
  command.params['userId'] = user_id unless user_id.nil?
  command.params['delegateEmail'] = delegate_email unless delegate_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_filter(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Filter

Gets a filter.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the filter to be fetched.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
# File 'lib/google/apis/gmail_v1/service.rb', line 2143

def get_user_setting_filter(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/filters/{id}', options)
  command.response_representation = Google::Apis::GmailV1::Filter::Representation
  command.response_class = Google::Apis::GmailV1::Filter
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ForwardingAddress

Gets the specified forwarding address.

Parameters:

  • user_id (String)

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

  • forwarding_email (String)

    The forwarding address to be retrieved.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
# File 'lib/google/apis/gmail_v1/service.rb', line 2280

def get_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}', options)
  command.response_representation = Google::Apis::GmailV1::ForwardingAddress::Representation
  command.response_class = Google::Apis::GmailV1::ForwardingAddress
  command.params['userId'] = user_id unless user_id.nil?
  command.params['forwardingEmail'] = forwarding_email unless forwarding_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_imap(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ImapSettings

Gets IMAP settings.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1212
1213
1214
1215
1216
1217
1218
1219
1220
# File 'lib/google/apis/gmail_v1/service.rb', line 1212

def get_user_setting_imap(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/imap', options)
  command.response_representation = Google::Apis::GmailV1::ImapSettings::Representation
  command.response_class = Google::Apis::GmailV1::ImapSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_language(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::LanguageSettings

Gets language settings.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1243
1244
1245
1246
1247
1248
1249
1250
1251
# File 'lib/google/apis/gmail_v1/service.rb', line 1243

def get_user_setting_language(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/language', options)
  command.response_representation = Google::Apis::GmailV1::LanguageSettings::Representation
  command.response_class = Google::Apis::GmailV1::LanguageSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_pop(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::PopSettings

Gets POP settings.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1274
1275
1276
1277
1278
1279
1280
1281
1282
# File 'lib/google/apis/gmail_v1/service.rb', line 1274

def get_user_setting_pop(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/pop', options)
  command.response_representation = Google::Apis::GmailV1::PopSettings::Representation
  command.response_class = Google::Apis::GmailV1::PopSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_send_a_smime_info(user_id, send_as_email, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::SmimeInfo

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

Parameters:

  • user_id (String)

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

  • send_as_email (String)

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

  • id (String)

    The immutable ID for the SmimeInfo.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
# File 'lib/google/apis/gmail_v1/service.rb', line 2639

def get_user_setting_send_a_smime_info(user_id, send_as_email, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}', options)
  command.response_representation = Google::Apis::GmailV1::SmimeInfo::Representation
  command.response_class = Google::Apis::GmailV1::SmimeInfo
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::SendAs

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

Parameters:

  • user_id (String)

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

  • send_as_email (String)

    The send-as alias to be retrieved.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
# File 'lib/google/apis/gmail_v1/service.rb', line 2422

def get_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}', options)
  command.response_representation = Google::Apis::GmailV1::SendAs::Representation
  command.response_class = Google::Apis::GmailV1::SendAs
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_vacation(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::VacationSettings

Gets vacation responder settings.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1305
1306
1307
1308
1309
1310
1311
1312
1313
# File 'lib/google/apis/gmail_v1/service.rb', line 1305

def get_user_setting_vacation(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/vacation', options)
  command.response_representation = Google::Apis::GmailV1::VacationSettings::Representation
  command.response_class = Google::Apis::GmailV1::VacationSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_thread(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Thread

Gets the specified thread.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the thread to retrieve.

  • format (String) (defaults to: nil)

    The format to return the messages in.

  • metadata_headers (Array<String>, String) (defaults to: nil)

    When given and format is METADATA, only include headers specified.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
# File 'lib/google/apis/gmail_v1/service.rb', line 2822

def get_user_thread(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/threads/{id}', options)
  command.response_representation = Google::Apis::GmailV1::Thread::Representation
  command.response_class = Google::Apis::GmailV1::Thread
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['format'] = format unless format.nil?
  command.query['metadataHeaders'] =  unless .nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#import_user_message(user_id, message_object = nil, deleted: nil, internal_date_source: nil, never_mark_spam: nil, process_for_calendar: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

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.

Parameters:

  • user_id (String)

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

  • message_object (Google::Apis::GmailV1::Message) (defaults to: nil)
  • deleted (Boolean) (defaults to: nil)

    Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for Google Workspace accounts.

  • internal_date_source (String) (defaults to: nil)

    Source for Gmail's internal date of the message.

  • never_mark_spam (Boolean) (defaults to: nil)

    Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.

  • process_for_calendar (Boolean) (defaults to: nil)

    Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
# File 'lib/google/apis/gmail_v1/service.rb', line 844

def import_user_message(user_id, message_object = nil, deleted: nil, internal_date_source: nil, never_mark_spam: nil, process_for_calendar: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages/import', options)
  else
    command = make_upload_command(:post, 'gmail/v1/users/{userId}/messages/import', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::GmailV1::Message::Representation
  command.request_object = message_object
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.query['deleted'] = deleted unless deleted.nil?
  command.query['internalDateSource'] = internal_date_source unless internal_date_source.nil?
  command.query['neverMarkSpam'] = never_mark_spam unless never_mark_spam.nil?
  command.query['processForCalendar'] = process_for_calendar unless process_for_calendar.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_user_message(user_id, message_object = nil, deleted: nil, internal_date_source: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

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

Parameters:

  • user_id (String)

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

  • message_object (Google::Apis::GmailV1::Message) (defaults to: nil)
  • deleted (Boolean) (defaults to: nil)

    Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for Google Workspace accounts.

  • internal_date_source (String) (defaults to: nil)

    Source for Gmail's internal date of the message.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'lib/google/apis/gmail_v1/service.rb', line 898

def insert_user_message(user_id, message_object = nil, deleted: nil, internal_date_source: nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages', options)
  else
    command = make_upload_command(:post, 'gmail/v1/users/{userId}/messages', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::GmailV1::Message::Representation
  command.request_object = message_object
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.query['deleted'] = deleted unless deleted.nil?
  command.query['internalDateSource'] = internal_date_source unless internal_date_source.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#insert_user_setting_send_a_smime_info(user_id, send_as_email, smime_info_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::SmimeInfo

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

Parameters:

  • user_id (String)

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

  • send_as_email (String)

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

  • smime_info_object (Google::Apis::GmailV1::SmimeInfo) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
# File 'lib/google/apis/gmail_v1/service.rb', line 2677

def insert_user_setting_send_a_smime_info(user_id, send_as_email, smime_info_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo', options)
  command.request_representation = Google::Apis::GmailV1::SmimeInfo::Representation
  command.request_object = smime_info_object
  command.response_representation = Google::Apis::GmailV1::SmimeInfo::Representation
  command.response_class = Google::Apis::GmailV1::SmimeInfo
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_drafts(user_id, include_spam_trash: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListDraftsResponse

Lists the drafts in the user's mailbox.

Parameters:

  • user_id (String)

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

  • include_spam_trash (Boolean) (defaults to: nil)

    Include drafts from SPAM and TRASH in the results.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of drafts to return. This field defaults to 100. The maximum allowed value for this field is 500.

  • page_token (String) (defaults to: nil)

    Page token to retrieve a specific page of results in the list.

  • q (String) (defaults to: nil)

    Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread".

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/google/apis/gmail_v1/service.rb', line 295

def list_user_drafts(user_id, include_spam_trash: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/drafts', options)
  command.response_representation = Google::Apis::GmailV1::ListDraftsResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListDraftsResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['includeSpamTrash'] = include_spam_trash unless include_spam_trash.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['q'] = q unless q.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_histories(user_id, history_types: nil, label_id: nil, max_results: nil, page_token: nil, start_history_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListHistoryResponse

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

Parameters:

  • user_id (String)

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

  • history_types (Array<String>, String) (defaults to: nil)

    History types to be returned by the function

  • label_id (String) (defaults to: nil)

    Only return messages with a label matching the ID.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of history records to return. This field defaults to 100. The maximum allowed value for this field is 500.

  • page_token (String) (defaults to: nil)

    Page token to retrieve a specific page of results in the list.

  • start_history_id (Fixnum) (defaults to: nil)

    Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/google/apis/gmail_v1/service.rb', line 443

def list_user_histories(user_id, history_types: nil, label_id: nil, max_results: nil, page_token: nil, start_history_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/history', options)
  command.response_representation = Google::Apis::GmailV1::ListHistoryResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListHistoryResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['historyTypes'] = history_types unless history_types.nil?
  command.query['labelId'] = label_id unless label_id.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['startHistoryId'] = start_history_id unless start_history_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_labels(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListLabelsResponse

Lists all labels in the user's mailbox.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



580
581
582
583
584
585
586
587
588
# File 'lib/google/apis/gmail_v1/service.rb', line 580

def list_user_labels(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/labels', options)
  command.response_representation = Google::Apis::GmailV1::ListLabelsResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListLabelsResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_messages(user_id, include_spam_trash: nil, label_ids: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListMessagesResponse

Lists the messages in the user's mailbox.

Parameters:

  • user_id (String)

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

  • include_spam_trash (Boolean) (defaults to: nil)

    Include messages from SPAM and TRASH in the results.

  • label_ids (Array<String>, String) (defaults to: nil)

    Only return messages with labels that match all of the specified label IDs. Messages in a thread might have labels that other messages in the same thread don't have. To learn more, see Manage labels on messages and threads.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500.

  • page_token (String) (defaults to: nil)

    Page token to retrieve a specific page of results in the list.

  • q (String) (defaults to: nil)

    Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



957
958
959
960
961
962
963
964
965
966
967
968
969
970
# File 'lib/google/apis/gmail_v1/service.rb', line 957

def list_user_messages(user_id, include_spam_trash: nil, label_ids: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/messages', options)
  command.response_representation = Google::Apis::GmailV1::ListMessagesResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListMessagesResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['includeSpamTrash'] = include_spam_trash unless include_spam_trash.nil?
  command.query['labelIds'] = label_ids unless label_ids.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['q'] = q unless q.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_cse_identities(user_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListCseIdentitiesResponse

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

Parameters:

  • user_id (String)

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

  • page_size (Fixnum) (defaults to: nil)

    The number of identities to return. If not provided, the page size will default to 20 entries.

  • page_token (String) (defaults to: nil)

    Pagination token indicating which page of identities to return. If the token is not supplied, then the API will return the first page of results.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
# File 'lib/google/apis/gmail_v1/service.rb', line 1627

def list_user_setting_cse_identities(user_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/cse/identities', options)
  command.response_representation = Google::Apis::GmailV1::ListCseIdentitiesResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListCseIdentitiesResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_cse_keypairs(user_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListCseKeyPairsResponse

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

Parameters:

  • user_id (String)

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

  • page_size (Fixnum) (defaults to: nil)

    The number of key pairs to return. If not provided, the page size will default to 20 entries.

  • page_token (String) (defaults to: nil)

    Pagination token indicating which page of key pairs to return. If the token is not supplied, then the API will return the first page of results.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
# File 'lib/google/apis/gmail_v1/service.rb', line 1853

def list_user_setting_cse_keypairs(user_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/cse/keypairs', options)
  command.response_representation = Google::Apis::GmailV1::ListCseKeyPairsResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListCseKeyPairsResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_delegates(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListDelegatesResponse

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

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2044
2045
2046
2047
2048
2049
2050
2051
2052
# File 'lib/google/apis/gmail_v1/service.rb', line 2044

def list_user_setting_delegates(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/delegates', options)
  command.response_representation = Google::Apis::GmailV1::ListDelegatesResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListDelegatesResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_filters(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListFiltersResponse

Lists the message filters of a Gmail user.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2175
2176
2177
2178
2179
2180
2181
2182
2183
# File 'lib/google/apis/gmail_v1/service.rb', line 2175

def list_user_setting_filters(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/filters', options)
  command.response_representation = Google::Apis::GmailV1::ListFiltersResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListFiltersResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_forwarding_addresses(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListForwardingAddressesResponse

Lists the forwarding addresses for the specified account.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2312
2313
2314
2315
2316
2317
2318
2319
2320
# File 'lib/google/apis/gmail_v1/service.rb', line 2312

def list_user_setting_forwarding_addresses(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/forwardingAddresses', options)
  command.response_representation = Google::Apis::GmailV1::ListForwardingAddressesResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListForwardingAddressesResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_send_a_smime_infos(user_id, send_as_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListSmimeInfoResponse

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

Parameters:

  • user_id (String)

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

  • send_as_email (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
# File 'lib/google/apis/gmail_v1/service.rb', line 2714

def list_user_setting_send_a_smime_infos(user_id, send_as_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo', options)
  command.response_representation = Google::Apis::GmailV1::ListSmimeInfoResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListSmimeInfoResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_send_as(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListSendAsResponse

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.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2456
2457
2458
2459
2460
2461
2462
2463
2464
# File 'lib/google/apis/gmail_v1/service.rb', line 2456

def list_user_setting_send_as(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/settings/sendAs', options)
  command.response_representation = Google::Apis::GmailV1::ListSendAsResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListSendAsResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_user_threads(user_id, include_spam_trash: nil, label_ids: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ListThreadsResponse

Lists the threads in the user's mailbox.

Parameters:

  • user_id (String)

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

  • include_spam_trash (Boolean) (defaults to: nil)

    Include threads from SPAM and TRASH in the results.

  • label_ids (Array<String>, String) (defaults to: nil)

    Only return threads with labels that match all of the specified label IDs.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500.

  • page_token (String) (defaults to: nil)

    Page token to retrieve a specific page of results in the list.

  • q (String) (defaults to: nil)

    Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
# File 'lib/google/apis/gmail_v1/service.rb', line 2870

def list_user_threads(user_id, include_spam_trash: nil, label_ids: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'gmail/v1/users/{userId}/threads', options)
  command.response_representation = Google::Apis::GmailV1::ListThreadsResponse::Representation
  command.response_class = Google::Apis::GmailV1::ListThreadsResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['includeSpamTrash'] = include_spam_trash unless include_spam_trash.nil?
  command.query['labelIds'] = label_ids unless label_ids.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['q'] = q unless q.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#modify_message(user_id, id, modify_message_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

Modifies the labels on the specified message.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the message to modify.

  • modify_message_request_object (Google::Apis::GmailV1::ModifyMessageRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/google/apis/gmail_v1/service.rb', line 996

def modify_message(user_id, id, modify_message_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages/{id}/modify', options)
  command.request_representation = Google::Apis::GmailV1::ModifyMessageRequest::Representation
  command.request_object = modify_message_request_object
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#modify_thread(user_id, id, modify_thread_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Thread

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

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the thread to modify.

  • modify_thread_request_object (Google::Apis::GmailV1::ModifyThreadRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
# File 'lib/google/apis/gmail_v1/service.rb', line 2910

def modify_thread(user_id, id, modify_thread_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/threads/{id}/modify', options)
  command.request_representation = Google::Apis::GmailV1::ModifyThreadRequest::Representation
  command.request_object = modify_thread_request_object
  command.response_representation = Google::Apis::GmailV1::Thread::Representation
  command.response_class = Google::Apis::GmailV1::Thread
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#obliterate_keypair_cse_key_pair(user_id, key_pair_id, obliterate_cse_key_pair_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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.

Parameters:

  • user_id (String)

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

  • key_pair_id (String)

    The identifier of the key pair to obliterate.

  • obliterate_cse_key_pair_request_object (Google::Apis::GmailV1::ObliterateCseKeyPairRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
# File 'lib/google/apis/gmail_v1/service.rb', line 1894

def obliterate_keypair_cse_key_pair(user_id, key_pair_id, obliterate_cse_key_pair_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate', options)
  command.request_representation = Google::Apis::GmailV1::ObliterateCseKeyPairRequest::Representation
  command.request_object = obliterate_cse_key_pair_request_object
  command.params['userId'] = user_id unless user_id.nil?
  command.params['keyPairId'] = key_pair_id unless key_pair_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Label

Patch the specified label.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the label to update.

  • label_object (Google::Apis::GmailV1::Label) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/google/apis/gmail_v1/service.rb', line 614

def patch_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'gmail/v1/users/{userId}/labels/{id}', options)
  command.request_representation = Google::Apis::GmailV1::Label::Representation
  command.request_object = label_object
  command.response_representation = Google::Apis::GmailV1::Label::Representation
  command.response_class = Google::Apis::GmailV1::Label
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_user_setting_cse_identity(user_id, email_address, cse_identity_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::CseIdentity

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.

Parameters:

  • user_id (String)

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

  • email_address (String)

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

  • cse_identity_object (Google::Apis::GmailV1::CseIdentity) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
# File 'lib/google/apis/gmail_v1/service.rb', line 1665

def patch_user_setting_cse_identity(user_id, email_address, cse_identity_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}', options)
  command.request_representation = Google::Apis::GmailV1::CseIdentity::Representation
  command.request_object = cse_identity_object
  command.response_representation = Google::Apis::GmailV1::CseIdentity::Representation
  command.response_class = Google::Apis::GmailV1::CseIdentity
  command.params['userId'] = user_id unless user_id.nil?
  command.params['emailAddress'] = email_address unless email_address.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_user_setting_send_as(user_id, send_as_email, send_as_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::SendAs

Patch the specified send-as alias.

Parameters:

  • user_id (String)

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

  • send_as_email (String)

    The send-as alias to be updated.

  • send_as_object (Google::Apis::GmailV1::SendAs) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
# File 'lib/google/apis/gmail_v1/service.rb', line 2490

def patch_user_setting_send_as(user_id, send_as_email, send_as_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}', options)
  command.request_representation = Google::Apis::GmailV1::SendAs::Representation
  command.request_object = send_as_object
  command.response_representation = Google::Apis::GmailV1::SendAs::Representation
  command.response_class = Google::Apis::GmailV1::SendAs
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#send_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

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

Parameters:

  • user_id (String)

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

  • draft_object (Google::Apis::GmailV1::Draft) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/google/apis/gmail_v1/service.rb', line 336

def send_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'gmail/v1/users/{userId}/drafts/send', options)
  else
    command = make_upload_command(:post, 'gmail/v1/users/{userId}/drafts/send', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::GmailV1::Draft::Representation
  command.request_object = draft_object
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#send_user_message(user_id, message_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

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

Parameters:

  • user_id (String)

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

  • message_object (Google::Apis::GmailV1::Message) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
# File 'lib/google/apis/gmail_v1/service.rb', line 1037

def send_user_message(user_id, message_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages/send', options)
  else
    command = make_upload_command(:post, 'gmail/v1/users/{userId}/messages/send', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::GmailV1::Message::Representation
  command.request_object = message_object
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#set_user_setting_send_a_smime_info_default(user_id, send_as_email, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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

Parameters:

  • user_id (String)

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

  • send_as_email (String)

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

  • id (String)

    The immutable ID for the SmimeInfo.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2751
2752
2753
2754
2755
2756
2757
2758
2759
# File 'lib/google/apis/gmail_v1/service.rb', line 2751

def set_user_setting_send_a_smime_info_default(user_id, send_as_email, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#stop_user(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Stop receiving push notifications for the given user mailbox.

Parameters:

  • user_id (String)

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

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



107
108
109
110
111
112
113
# File 'lib/google/apis/gmail_v1/service.rb', line 107

def stop_user(user_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/stop', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#trash_user_message(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

Moves the specified message to the trash.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the message to Trash.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
# File 'lib/google/apis/gmail_v1/service.rb', line 1078

def trash_user_message(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages/{id}/trash', options)
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#trash_user_thread(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Thread

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

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the thread to Trash.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
# File 'lib/google/apis/gmail_v1/service.rb', line 2947

def trash_user_thread(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/threads/{id}/trash', options)
  command.response_representation = Google::Apis::GmailV1::Thread::Representation
  command.response_class = Google::Apis::GmailV1::Thread
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#untrash_user_message(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Message

Removes the specified message from the trash.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the message to remove from Trash.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
# File 'lib/google/apis/gmail_v1/service.rb', line 1112

def untrash_user_message(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/messages/{id}/untrash', options)
  command.response_representation = Google::Apis::GmailV1::Message::Representation
  command.response_class = Google::Apis::GmailV1::Message
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#untrash_user_thread(user_id, id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Thread

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

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the thread to remove from Trash.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
# File 'lib/google/apis/gmail_v1/service.rb', line 2982

def untrash_user_thread(user_id, id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/threads/{id}/untrash', options)
  command.response_representation = Google::Apis::GmailV1::Thread::Representation
  command.response_class = Google::Apis::GmailV1::Thread
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_draft(user_id, id, draft_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Draft

Replaces a draft's content.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the draft to update.

  • draft_object (Google::Apis::GmailV1::Draft) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • upload_source (IO, String) (defaults to: nil)

    IO stream or filename containing content to upload

  • content_type (String) (defaults to: nil)

    Content type of the uploaded content.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/google/apis/gmail_v1/service.rb', line 382

def update_user_draft(user_id, id, draft_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command = make_simple_command(:put, 'gmail/v1/users/{userId}/drafts/{id}', options)
  else
    command = make_upload_command(:put, 'gmail/v1/users/{userId}/drafts/{id}', options)
    command.upload_source = upload_source
    command.upload_content_type = content_type
  end
  command.request_representation = Google::Apis::GmailV1::Draft::Representation
  command.request_object = draft_object
  command.response_representation = Google::Apis::GmailV1::Draft::Representation
  command.response_class = Google::Apis::GmailV1::Draft
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::Label

Updates the specified label.

Parameters:

  • user_id (String)

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

  • id (String)

    The ID of the label to update.

  • label_object (Google::Apis::GmailV1::Label) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



651
652
653
654
655
656
657
658
659
660
661
662
# File 'lib/google/apis/gmail_v1/service.rb', line 651

def update_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'gmail/v1/users/{userId}/labels/{id}', options)
  command.request_representation = Google::Apis::GmailV1::Label::Representation
  command.request_object = label_object
  command.response_representation = Google::Apis::GmailV1::Label::Representation
  command.response_class = Google::Apis::GmailV1::Label
  command.params['userId'] = user_id unless user_id.nil?
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_auto_forwarding(user_id, auto_forwarding_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::AutoForwarding

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.

Parameters:

  • user_id (String)

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

  • auto_forwarding_object (Google::Apis::GmailV1::AutoForwarding) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
# File 'lib/google/apis/gmail_v1/service.rb', line 1340

def update_user_setting_auto_forwarding(user_id, auto_forwarding_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'gmail/v1/users/{userId}/settings/autoForwarding', options)
  command.request_representation = Google::Apis::GmailV1::AutoForwarding::Representation
  command.request_object = auto_forwarding_object
  command.response_representation = Google::Apis::GmailV1::AutoForwarding::Representation
  command.response_class = Google::Apis::GmailV1::AutoForwarding
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_imap(user_id, imap_settings_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::ImapSettings

Updates IMAP settings.

Parameters:

  • user_id (String)

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

  • imap_settings_object (Google::Apis::GmailV1::ImapSettings) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
# File 'lib/google/apis/gmail_v1/service.rb', line 1374

def update_user_setting_imap(user_id, imap_settings_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'gmail/v1/users/{userId}/settings/imap', options)
  command.request_representation = Google::Apis::GmailV1::ImapSettings::Representation
  command.request_object = imap_settings_object
  command.response_representation = Google::Apis::GmailV1::ImapSettings::Representation
  command.response_class = Google::Apis::GmailV1::ImapSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_language(user_id, language_settings_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::LanguageSettings

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.

Parameters:

  • user_id (String)

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

  • language_settings_object (Google::Apis::GmailV1::LanguageSettings) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
# File 'lib/google/apis/gmail_v1/service.rb', line 1412

def update_user_setting_language(user_id, language_settings_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'gmail/v1/users/{userId}/settings/language', options)
  command.request_representation = Google::Apis::GmailV1::LanguageSettings::Representation
  command.request_object = language_settings_object
  command.response_representation = Google::Apis::GmailV1::LanguageSettings::Representation
  command.response_class = Google::Apis::GmailV1::LanguageSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_pop(user_id, pop_settings_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::PopSettings

Updates POP settings.

Parameters:

  • user_id (String)

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

  • pop_settings_object (Google::Apis::GmailV1::PopSettings) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
# File 'lib/google/apis/gmail_v1/service.rb', line 1446

def update_user_setting_pop(user_id, pop_settings_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'gmail/v1/users/{userId}/settings/pop', options)
  command.request_representation = Google::Apis::GmailV1::PopSettings::Representation
  command.request_object = pop_settings_object
  command.response_representation = Google::Apis::GmailV1::PopSettings::Representation
  command.response_class = Google::Apis::GmailV1::PopSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_send_as(user_id, send_as_email, send_as_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::SendAs

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.

Parameters:

  • user_id (String)

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

  • send_as_email (String)

    The send-as alias to be updated.

  • send_as_object (Google::Apis::GmailV1::SendAs) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
# File 'lib/google/apis/gmail_v1/service.rb', line 2530

def update_user_setting_send_as(user_id, send_as_email, send_as_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}', options)
  command.request_representation = Google::Apis::GmailV1::SendAs::Representation
  command.request_object = send_as_object
  command.response_representation = Google::Apis::GmailV1::SendAs::Representation
  command.response_class = Google::Apis::GmailV1::SendAs
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_vacation(user_id, vacation_settings_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::VacationSettings

Updates vacation responder settings.

Parameters:

  • user_id (String)

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

  • vacation_settings_object (Google::Apis::GmailV1::VacationSettings) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
# File 'lib/google/apis/gmail_v1/service.rb', line 1480

def update_user_setting_vacation(user_id, vacation_settings_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'gmail/v1/users/{userId}/settings/vacation', options)
  command.request_representation = Google::Apis::GmailV1::VacationSettings::Representation
  command.request_object = vacation_settings_object
  command.response_representation = Google::Apis::GmailV1::VacationSettings::Representation
  command.response_class = Google::Apis::GmailV1::VacationSettings
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#verify_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

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.

Parameters:

  • user_id (String)

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

  • send_as_email (String)

    The send-as alias to be verified.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



2568
2569
2570
2571
2572
2573
2574
2575
# File 'lib/google/apis/gmail_v1/service.rb', line 2568

def verify_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify', options)
  command.params['userId'] = user_id unless user_id.nil?
  command.params['sendAsEmail'] = send_as_email unless send_as_email.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#watch_user(user_id, watch_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::GmailV1::WatchResponse

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

Parameters:

  • user_id (String)

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

  • watch_request_object (Google::Apis::GmailV1::WatchRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



137
138
139
140
141
142
143
144
145
146
147
# File 'lib/google/apis/gmail_v1/service.rb', line 137

def watch_user(user_id, watch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'gmail/v1/users/{userId}/watch', options)
  command.request_representation = Google::Apis::GmailV1::WatchRequest::Representation
  command.request_object = watch_request_object
  command.response_representation = Google::Apis::GmailV1::WatchResponse::Representation
  command.response_class = Google::Apis::GmailV1::WatchResponse
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end