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

Inherits:
Core::BaseService show all
Defined in:
generated/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:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeGmailService

Returns a new instance of GmailService.


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

def initialize
  super('https://gmail.googleapis.com/', '')
  @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.


39
40
41
# File 'generated/google/apis/gmail_v1/service.rb', line 39

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.


44
45
46
# File 'generated/google/apis/gmail_v1/service.rb', line 44

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:


681
682
683
684
685
686
687
688
689
# File 'generated/google/apis/gmail_v1/service.rb', line 681

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:


713
714
715
716
717
718
719
720
721
# File 'generated/google/apis/gmail_v1/service.rb', line 713

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:


171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'generated/google/apis/gmail_v1/service.rb', line 171

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:


474
475
476
477
478
479
480
481
482
483
484
# File 'generated/google/apis/gmail_v1/service.rb', line 474

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_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 G Suite organization as the delegator user. Gmail imposes limitations on the number of delegates and delegators each user in a G Suite organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators. Note that a delegate user must be referred to by their primary email address, and not an email alias. Also note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use. This method is only available to service account clients that have been delegated domain-wide authority.

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:


1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
# File 'generated/google/apis/gmail_v1/service.rb', line 1510

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.

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:


1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
# File 'generated/google/apis/gmail_v1/service.rb', line 1649

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:


1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
# File 'generated/google/apis/gmail_v1/service.rb', line 1784

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:


1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
# File 'generated/google/apis/gmail_v1/service.rb', line 1925

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:


213
214
215
216
217
218
219
220
# File 'generated/google/apis/gmail_v1/service.rb', line 213

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:


510
511
512
513
514
515
516
517
# File 'generated/google/apis/gmail_v1/service.rb', line 510

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:


747
748
749
750
751
752
753
754
# File 'generated/google/apis/gmail_v1/service.rb', line 747

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_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:


1549
1550
1551
1552
1553
1554
1555
1556
# File 'generated/google/apis/gmail_v1/service.rb', line 1549

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.

Deletes 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 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:


1684
1685
1686
1687
1688
1689
1690
1691
# File 'generated/google/apis/gmail_v1/service.rb', line 1684

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:


1821
1822
1823
1824
1825
1826
1827
1828
# File 'generated/google/apis/gmail_v1/service.rb', line 1821

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:


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

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:


1962
1963
1964
1965
1966
1967
1968
1969
# File 'generated/google/apis/gmail_v1/service.rb', line 1962

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


2358
2359
2360
2361
2362
2363
2364
2365
# File 'generated/google/apis/gmail_v1/service.rb', line 2358

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

#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:


247
248
249
250
251
252
253
254
255
256
257
# File 'generated/google/apis/gmail_v1/service.rb', line 247

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:


542
543
544
545
546
547
548
549
550
551
# File 'generated/google/apis/gmail_v1/service.rb', line 542

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.

  • 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:


783
784
785
786
787
788
789
790
791
792
793
794
# File 'generated/google/apis/gmail_v1/service.rb', line 783

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:


1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
# File 'generated/google/apis/gmail_v1/service.rb', line 1134

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:


72
73
74
75
76
77
78
79
80
# File 'generated/google/apis/gmail_v1/service.rb', line 72

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:


1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'generated/google/apis/gmail_v1/service.rb', line 1167

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_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:


1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
# File 'generated/google/apis/gmail_v1/service.rb', line 1584

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:


1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
# File 'generated/google/apis/gmail_v1/service.rb', line 1716

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:


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

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:


1198
1199
1200
1201
1202
1203
1204
1205
1206
# File 'generated/google/apis/gmail_v1/service.rb', line 1198

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:


1229
1230
1231
1232
1233
1234
1235
1236
1237
# File 'generated/google/apis/gmail_v1/service.rb', line 1229

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:


1260
1261
1262
1263
1264
1265
1266
1267
1268
# File 'generated/google/apis/gmail_v1/service.rb', line 1260

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:


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

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:


1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
# File 'generated/google/apis/gmail_v1/service.rb', line 1995

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:


1291
1292
1293
1294
1295
1296
1297
1298
1299
# File 'generated/google/apis/gmail_v1/service.rb', line 1291

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:


2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
# File 'generated/google/apis/gmail_v1/service.rb', line 2394

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. Does not send a message. Note: This function doesn't trigger forwarding rules or filters set up by the user.

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 G Suite 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:


836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
# File 'generated/google/apis/gmail_v1/service.rb', line 836

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 G Suite 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:


890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
# File 'generated/google/apis/gmail_v1/service.rb', line 890

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:


2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
# File 'generated/google/apis/gmail_v1/service.rb', line 2250

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.

  • 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:[email protected] 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:


290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'generated/google/apis/gmail_v1/service.rb', line 290

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)

    The maximum number of history records to return.

  • 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:


437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'generated/google/apis/gmail_v1/service.rb', line 437

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:


574
575
576
577
578
579
580
581
582
# File 'generated/google/apis/gmail_v1/service.rb', line 574

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.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of messages to return.

  • 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:[email protected] 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:


944
945
946
947
948
949
950
951
952
953
954
955
956
957
# File 'generated/google/apis/gmail_v1/service.rb', line 944

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_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:


1617
1618
1619
1620
1621
1622
1623
1624
1625
# File 'generated/google/apis/gmail_v1/service.rb', line 1617

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:


1748
1749
1750
1751
1752
1753
1754
1755
1756
# File 'generated/google/apis/gmail_v1/service.rb', line 1748

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:


1885
1886
1887
1888
1889
1890
1891
1892
1893
# File 'generated/google/apis/gmail_v1/service.rb', line 1885

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:


2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
# File 'generated/google/apis/gmail_v1/service.rb', line 2287

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:


2029
2030
2031
2032
2033
2034
2035
2036
2037
# File 'generated/google/apis/gmail_v1/service.rb', line 2029

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.

  • 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:[email protected] 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:


2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
# File 'generated/google/apis/gmail_v1/service.rb', line 2441

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:


983
984
985
986
987
988
989
990
991
992
993
994
# File 'generated/google/apis/gmail_v1/service.rb', line 983

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:


2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
# File 'generated/google/apis/gmail_v1/service.rb', line 2481

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

#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:


608
609
610
611
612
613
614
615
616
617
618
619
# File 'generated/google/apis/gmail_v1/service.rb', line 608

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_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:


2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
# File 'generated/google/apis/gmail_v1/service.rb', line 2063

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:


331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'generated/google/apis/gmail_v1/service.rb', line 331

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.

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:


1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
# File 'generated/google/apis/gmail_v1/service.rb', line 1023

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:


2324
2325
2326
2327
2328
2329
2330
2331
2332
# File 'generated/google/apis/gmail_v1/service.rb', line 2324

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:


103
104
105
106
107
108
109
# File 'generated/google/apis/gmail_v1/service.rb', line 103

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:


1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'generated/google/apis/gmail_v1/service.rb', line 1064

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.

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:


2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
# File 'generated/google/apis/gmail_v1/service.rb', line 2517

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:


1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
# File 'generated/google/apis/gmail_v1/service.rb', line 1098

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.

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:


2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
# File 'generated/google/apis/gmail_v1/service.rb', line 2551

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:


377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File 'generated/google/apis/gmail_v1/service.rb', line 377

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:


645
646
647
648
649
650
651
652
653
654
655
656
# File 'generated/google/apis/gmail_v1/service.rb', line 645

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:


1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
# File 'generated/google/apis/gmail_v1/service.rb', line 1326

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:


1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
# File 'generated/google/apis/gmail_v1/service.rb', line 1360

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:


1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
# File 'generated/google/apis/gmail_v1/service.rb', line 1398

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:


1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
# File 'generated/google/apis/gmail_v1/service.rb', line 1432

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:


2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
# File 'generated/google/apis/gmail_v1/service.rb', line 2103

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:


1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
# File 'generated/google/apis/gmail_v1/service.rb', line 1466

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:


2141
2142
2143
2144
2145
2146
2147
2148
# File 'generated/google/apis/gmail_v1/service.rb', line 2141

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:


133
134
135
136
137
138
139
140
141
142
143
# File 'generated/google/apis/gmail_v1/service.rb', line 133

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