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

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/gmail_v1/service.rb

Overview

Gmail API

Access Gmail mailboxes including sending user email.

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

Constructor Details

#initializeGmailService

Returns a new instance of GmailService.



51
52
53
# File 'generated/google/apis/gmail_v1/service.rb', line 51

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



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

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. Overrides userIp if both are provided.

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. Overrides userIp if both are provided.



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

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



49
50
51
# File 'generated/google/apis/gmail_v1/service.rb', line 49

def user_ip
  @user_ip
end

Instance Method Details

#batch_delete_messages(user_id, batch_delete_messages_request_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



766
767
768
769
770
771
772
773
774
775
# File 'generated/google/apis/gmail_v1/service.rb', line 766

def batch_delete_messages(user_id, batch_delete_messages_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#create_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'generated/google/apis/gmail_v1/service.rb', line 194

def create_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command =  make_simple_command(:post, '{userId}/drafts', options)
  else
    command = make_upload_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#create_user_label(user_id, label_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



529
530
531
532
533
534
535
536
537
538
539
540
# File 'generated/google/apis/gmail_v1/service.rb', line 529

def create_user_label(user_id, label_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_filter(user_id, filter_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
# File 'generated/google/apis/gmail_v1/service.rb', line 1576

def create_user_setting_filter(user_id, filter_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_forwarding_address(user_id, forwarding_address_object = nil, fields: nil, quota_user: nil, user_ip: 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.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
# File 'generated/google/apis/gmail_v1/service.rb', line 1730

def create_user_setting_forwarding_address(user_id, forwarding_address_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#create_user_setting_send_as(user_id, send_as_object = nil, fields: nil, quota_user: nil, user_ip: 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.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
# File 'generated/google/apis/gmail_v1/service.rb', line 1888

def create_user_setting_send_as(user_id, send_as_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_draft(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



241
242
243
244
245
246
247
248
249
# File 'generated/google/apis/gmail_v1/service.rb', line 241

def delete_user_draft(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_label(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



570
571
572
573
574
575
576
577
578
# File 'generated/google/apis/gmail_v1/service.rb', line 570

def delete_user_label(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



805
806
807
808
809
810
811
812
813
# File 'generated/google/apis/gmail_v1/service.rb', line 805

def delete_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_filter(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



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

def delete_user_setting_filter(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, user_ip: 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.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



1771
1772
1773
1774
1775
1776
1777
1778
1779
# File 'generated/google/apis/gmail_v1/service.rb', line 1771

def delete_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, user_ip: 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.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



1929
1930
1931
1932
1933
1934
1935
1936
1937
# File 'generated/google/apis/gmail_v1/service.rb', line 1929

def delete_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#delete_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



2169
2170
2171
2172
2173
2174
2175
2176
2177
# File 'generated/google/apis/gmail_v1/service.rb', line 2169

def delete_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:delete, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_draft(user_id, id, format: nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



280
281
282
283
284
285
286
287
288
289
290
291
# File 'generated/google/apis/gmail_v1/service.rb', line 280

def get_user_draft(user_id, id, format: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_label(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def get_user_label(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_message(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



846
847
848
849
850
851
852
853
854
855
856
857
858
# File 'generated/google/apis/gmail_v1/service.rb', line 846

def get_user_message(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_message_attachment(user_id, message_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
# File 'generated/google/apis/gmail_v1/service.rb', line 1236

def get_user_message_attachment(user_id, message_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_profile(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



80
81
82
83
84
85
86
87
88
89
# File 'generated/google/apis/gmail_v1/service.rb', line 80

def (user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_auto_forwarding(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def get_user_setting_auto_forwarding(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_filter(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
# File 'generated/google/apis/gmail_v1/service.rb', line 1653

def get_user_setting_filter(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
# File 'generated/google/apis/gmail_v1/service.rb', line 1808

def get_user_setting_forwarding_address(user_id, forwarding_email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_imap(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
# File 'generated/google/apis/gmail_v1/service.rb', line 1310

def get_user_setting_imap(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_pop(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
# File 'generated/google/apis/gmail_v1/service.rb', line 1346

def get_user_setting_pop(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
# File 'generated/google/apis/gmail_v1/service.rb', line 1967

def get_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_setting_vacation(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
# File 'generated/google/apis/gmail_v1/service.rb', line 1382

def get_user_setting_vacation(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#get_user_thread(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def get_user_thread(user_id, id, format: nil, metadata_headers: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: 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.

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 Apps Vault to a Vault administrator. Only used for Google Apps for Work 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
# File 'generated/google/apis/gmail_v1/service.rb', line 904

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, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command =  make_simple_command(:post, '{userId}/messages/import', options)
  else
    command = make_upload_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: 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 Apps Vault to a Vault administrator. Only used for Google Apps for Work 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
# File 'generated/google/apis/gmail_v1/service.rb', line 964

def insert_user_message(user_id, message_object = nil, deleted: nil, internal_date_source: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command =  make_simple_command(:post, '{userId}/messages', options)
  else
    command = make_upload_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'generated/google/apis/gmail_v1/service.rb', line 328

def list_user_drafts(user_id, include_spam_trash: nil, max_results: nil, page_token: nil, q: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_user_histories(user_id, label_id: nil, max_results: nil, page_token: nil, start_history_id: nil, fields: nil, quota_user: nil, user_ip: 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.

  • 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 (String) (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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'generated/google/apis/gmail_v1/service.rb', line 488

def list_user_histories(user_id, label_id: nil, max_results: nil, page_token: nil, start_history_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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['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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_user_labels(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def list_user_labels(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: 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".

  • 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

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, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_filters(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
# File 'generated/google/apis/gmail_v1/service.rb', line 1690

def list_user_setting_filters(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_forwarding_addresses(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
# File 'generated/google/apis/gmail_v1/service.rb', line 1845

def list_user_setting_forwarding_addresses(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#list_user_setting_send_as(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
# File 'generated/google/apis/gmail_v1/service.rb', line 2006

def list_user_setting_send_as(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: 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".

  • 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
# File 'generated/google/apis/gmail_v1/service.rb', line 2261

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, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#modify_message(user_id, id, modify_message_request_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
# File 'generated/google/apis/gmail_v1/service.rb', line 1066

def modify_message(user_id, id, modify_message_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#modify_thread(user_id, id, modify_thread_request_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
# File 'generated/google/apis/gmail_v1/service.rb', line 2306

def modify_thread(user_id, id, modify_thread_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

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

Updates the specified label. This method supports patch semantics.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



683
684
685
686
687
688
689
690
691
692
693
694
695
# File 'generated/google/apis/gmail_v1/service.rb', line 683

def patch_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:patch, '{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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: 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. This method supports patch semantics.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
# File 'generated/google/apis/gmail_v1/service.rb', line 2046

def patch_user_setting_send_as(user_id, send_as_email, send_as_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:patch, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#send_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



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

def send_user_draft(user_id, draft_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command =  make_simple_command(:post, '{userId}/drafts/send', options)
  else
    command = make_upload_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#send_user_message(user_id, message_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
# File 'generated/google/apis/gmail_v1/service.rb', line 1110

def send_user_message(user_id, message_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command =  make_simple_command(:post, '{userId}/messages/send', options)
  else
    command = make_upload_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#stop_user(user_id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



116
117
118
119
120
121
122
123
# File 'generated/google/apis/gmail_v1/service.rb', line 116

def stop_user(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#trash_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
# File 'generated/google/apis/gmail_v1/service.rb', line 1156

def trash_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#trash_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
# File 'generated/google/apis/gmail_v1/service.rb', line 2347

def trash_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#untrash_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def untrash_user_message(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#untrash_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

def untrash_user_thread(user_id, id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_user_draft(user_id, id, draft_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'generated/google/apis/gmail_v1/service.rb', line 425

def update_user_draft(user_id, id, draft_object = nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
  if upload_source.nil?
    command =  make_simple_command(:put, '{userId}/drafts/{id}', options)
  else
    command = make_upload_command(:put, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



725
726
727
728
729
730
731
732
733
734
735
736
737
# File 'generated/google/apis/gmail_v1/service.rb', line 725

def update_user_label(user_id, id, label_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:put, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_auto_forwarding(user_id, auto_forwarding_object = nil, fields: nil, quota_user: nil, user_ip: 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.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
# File 'generated/google/apis/gmail_v1/service.rb', line 1420

def update_user_setting_auto_forwarding(user_id, auto_forwarding_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:put, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_imap(user_id, imap_settings_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
# File 'generated/google/apis/gmail_v1/service.rb', line 1459

def update_user_setting_imap(user_id, imap_settings_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:put, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_pop(user_id, pop_settings_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
# File 'generated/google/apis/gmail_v1/service.rb', line 1498

def update_user_setting_pop(user_id, pop_settings_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:put, '{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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: 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.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
# File 'generated/google/apis/gmail_v1/service.rb', line 2089

def update_user_setting_send_as(user_id, send_as_email, send_as_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:put, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#update_user_setting_vacation(user_id, vacation_settings_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
# File 'generated/google/apis/gmail_v1/service.rb', line 1537

def update_user_setting_vacation(user_id, vacation_settings_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:put, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#verify_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, user_ip: 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.

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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



2131
2132
2133
2134
2135
2136
2137
2138
2139
# File 'generated/google/apis/gmail_v1/service.rb', line 2131

def verify_user_setting_send_as(user_id, send_as_email, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#watch_user(user_id, watch_request_object = nil, fields: nil, quota_user: nil, user_ip: 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



151
152
153
154
155
156
157
158
159
160
161
162
# File 'generated/google/apis/gmail_v1/service.rb', line 151

def watch_user(user_id, watch_request_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '{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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end