# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # NOTE: This file is auto generated by the elixir code generator program. # Do not edit this file manually. defmodule GoogleApi.Gmail.V1.Api.Users do @moduledoc """ API calls for all endpoints tagged `Users`. """ alias GoogleApi.Gmail.V1.Connection alias GoogleApi.Gax.{Request, Response} @library_version Mix.Project.config() |> Keyword.get(:version, "") @doc """ Gets the current user's Gmail profile. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Profile{}}` on success * `{:error, info}` on failure """ @spec gmail_users_get_profile(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Profile.t()} | {:error, Tesla.Env.t()} def gmail_users_get_profile(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/profile", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Profile{}]) end @doc """ Stop receiving push notifications for the given user mailbox. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_stop(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_stop(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/stop", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Set up or update a push notification watch on the given user mailbox. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.WatchRequest.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.WatchResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_watch(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.WatchResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_watch(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/watch", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.WatchResponse{}]) end @doc """ Creates a new draft with the DRAFT label. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Draft{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_create(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Draft.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_create(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/drafts", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Draft{}]) end @doc """ Creates a new draft with the DRAFT label. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "resumable". * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_create_resumable( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_drafts_create_resumable( connection, user_id, upload_type, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/resumable/upload/gmail/v1/users/{userId}/drafts", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Creates a new draft with the DRAFT label. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". * `metadata` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - object metadata * `data` (*type:* `String.t`) - Path to file * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Draft{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_create_simple( Tesla.Env.client(), String.t(), String.t(), GoogleApi.Gmail.V1.Model.Draft.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Draft.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_create_simple( connection, user_id, upload_type, metadata, data, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/upload/gmail/v1/users/{userId}/drafts", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_param(:body, :metadata, metadata) |> Request.add_param(:file, :data, data) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Draft{}]) end @doc """ Immediately and permanently deletes the specified draft. Does not simply trash it. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the draft to delete. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_drafts_delete(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/drafts/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified draft. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the draft to retrieve. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:format` (*type:* `String.t`) - The format to return the draft in. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Draft{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_get(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Draft.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_get(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :format => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/drafts/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Draft{}]) end @doc """ Lists the drafts in the user's mailbox. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:includeSpamTrash` (*type:* `boolean()`) - Include drafts from SPAM and TRASH in the results. * `:maxResults` (*type:* `integer()`) - Maximum number of drafts to return. * `:pageToken` (*type:* `String.t`) - Page token to retrieve a specific page of results in the list. * `:q` (*type:* `String.t`) - Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListDraftsResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListDraftsResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :includeSpamTrash => :query, :maxResults => :query, :pageToken => :query, :q => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/drafts", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListDraftsResponse{}]) end @doc """ Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_send(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_send(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/drafts/send", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "resumable". * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_send_resumable( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_drafts_send_resumable( connection, user_id, upload_type, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/resumable/upload/gmail/v1/users/{userId}/drafts/send", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". * `metadata` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - object metadata * `data` (*type:* `String.t`) - Path to file * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_send_simple( Tesla.Env.client(), String.t(), String.t(), GoogleApi.Gmail.V1.Model.Draft.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_send_simple( connection, user_id, upload_type, metadata, data, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/upload/gmail/v1/users/{userId}/drafts/send", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_param(:body, :metadata, metadata) |> Request.add_param(:file, :data, data) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Replaces a draft's content. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the draft to update. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Draft{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_update( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Draft.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_update(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/drafts/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Draft{}]) end @doc """ Replaces a draft's content. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the draft to update. * `upload_type` (*type:* `String.t`) - Upload type. Must be "resumable". * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_update_resumable( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_drafts_update_resumable( connection, user_id, id, upload_type, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/resumable/upload/gmail/v1/users/{userId}/drafts/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Replaces a draft's content. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the draft to update. * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". * `metadata` (*type:* `GoogleApi.Gmail.V1.Model.Draft.t`) - object metadata * `data` (*type:* `String.t`) - Path to file * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Draft{}}` on success * `{:error, info}` on failure """ @spec gmail_users_drafts_update_simple( Tesla.Env.client(), String.t(), String.t(), String.t(), GoogleApi.Gmail.V1.Model.Draft.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Draft.t()} | {:error, Tesla.Env.t()} def gmail_users_drafts_update_simple( connection, user_id, id, upload_type, metadata, data, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:put) |> Request.url("/upload/gmail/v1/users/{userId}/drafts/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_param(:body, :metadata, metadata) |> Request.add_param(:file, :data, data) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Draft{}]) end @doc """ Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId). ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:historyTypes` (*type:* `list(String.t)`) - History types to be returned by the function * `:labelId` (*type:* `String.t`) - Only return messages with a label matching the ID. * `:maxResults` (*type:* `integer()`) - The maximum number of history records to return. * `:pageToken` (*type:* `String.t`) - Page token to retrieve a specific page of results in the list. * `:startHistoryId` (*type:* `String.t`) - 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. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListHistoryResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_history_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListHistoryResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_history_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :historyTypes => :query, :labelId => :query, :maxResults => :query, :pageToken => :query, :startHistoryId => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/history", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListHistoryResponse{}]) end @doc """ Creates a new label. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Label.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Label{}}` on success * `{:error, info}` on failure """ @spec gmail_users_labels_create(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Label.t()} | {:error, Tesla.Env.t()} def gmail_users_labels_create(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/labels", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Label{}]) end @doc """ Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the label to delete. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_labels_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_labels_delete(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/labels/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified label. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the label to retrieve. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Label{}}` on success * `{:error, info}` on failure """ @spec gmail_users_labels_get(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Label.t()} | {:error, Tesla.Env.t()} def gmail_users_labels_get(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/labels/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Label{}]) end @doc """ Lists all labels in the user's mailbox. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListLabelsResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_labels_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListLabelsResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_labels_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/labels", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListLabelsResponse{}]) end @doc """ Updates the specified label. This method supports patch semantics. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the label to update. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Label.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Label{}}` on success * `{:error, info}` on failure """ @spec gmail_users_labels_patch(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Label.t()} | {:error, Tesla.Env.t()} def gmail_users_labels_patch(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:patch) |> Request.url("/gmail/v1/users/{userId}/labels/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Label{}]) end @doc """ Updates the specified label. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the label to update. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Label.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Label{}}` on success * `{:error, info}` on failure """ @spec gmail_users_labels_update( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Label.t()} | {:error, Tesla.Env.t()} def gmail_users_labels_update(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/labels/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Label{}]) end @doc """ Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.BatchDeleteMessagesRequest.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_batch_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_messages_batch_delete(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages/batchDelete", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Modifies the labels on the specified messages. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.BatchModifyMessagesRequest.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_batch_modify(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_messages_batch_modify(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages/batchModify", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the message to delete. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_messages_delete(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/messages/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified message. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the message to retrieve. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:format` (*type:* `String.t`) - The format to return the message in. * `:metadataHeaders` (*type:* `list(String.t)`) - When given and format is METADATA, only include headers specified. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_get(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_get(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :format => :query, :metadataHeaders => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/messages/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ 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 * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:deleted` (*type:* `boolean()`) - Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. * `:internalDateSource` (*type:* `String.t`) - Source for Gmail's internal date of the message. * `:neverMarkSpam` (*type:* `boolean()`) - Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. * `:processForCalendar` (*type:* `boolean()`) - Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_import(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_import(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :deleted => :query, :internalDateSource => :query, :neverMarkSpam => :query, :processForCalendar => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages/import", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ 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 * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "resumable". * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:deleted` (*type:* `boolean()`) - Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. * `:internalDateSource` (*type:* `String.t`) - Source for Gmail's internal date of the message. * `:neverMarkSpam` (*type:* `boolean()`) - Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. * `:processForCalendar` (*type:* `boolean()`) - Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_import_resumable( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_messages_import_resumable( connection, user_id, upload_type, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :deleted => :query, :internalDateSource => :query, :neverMarkSpam => :query, :processForCalendar => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/resumable/upload/gmail/v1/users/{userId}/messages/import", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ 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 * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". * `metadata` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - object metadata * `data` (*type:* `String.t`) - Path to file * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:deleted` (*type:* `boolean()`) - Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. * `:internalDateSource` (*type:* `String.t`) - Source for Gmail's internal date of the message. * `:neverMarkSpam` (*type:* `boolean()`) - Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. * `:processForCalendar` (*type:* `boolean()`) - Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_import_simple( Tesla.Env.client(), String.t(), String.t(), GoogleApi.Gmail.V1.Model.Message.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_import_simple( connection, user_id, upload_type, metadata, data, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :deleted => :query, :internalDateSource => :query, :neverMarkSpam => :query, :processForCalendar => :query } request = Request.new() |> Request.method(:post) |> Request.url("/upload/gmail/v1/users/{userId}/messages/import", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_param(:body, :metadata, metadata) |> Request.add_param(:file, :data, data) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ 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 * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:deleted` (*type:* `boolean()`) - Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. * `:internalDateSource` (*type:* `String.t`) - Source for Gmail's internal date of the message. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_insert(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_insert(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :deleted => :query, :internalDateSource => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ 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 * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "resumable". * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:deleted` (*type:* `boolean()`) - Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. * `:internalDateSource` (*type:* `String.t`) - Source for Gmail's internal date of the message. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_insert_resumable( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_messages_insert_resumable( connection, user_id, upload_type, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :deleted => :query, :internalDateSource => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/resumable/upload/gmail/v1/users/{userId}/messages", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ 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 * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". * `metadata` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - object metadata * `data` (*type:* `String.t`) - Path to file * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:deleted` (*type:* `boolean()`) - Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. * `:internalDateSource` (*type:* `String.t`) - Source for Gmail's internal date of the message. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_insert_simple( Tesla.Env.client(), String.t(), String.t(), GoogleApi.Gmail.V1.Model.Message.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_insert_simple( connection, user_id, upload_type, metadata, data, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :deleted => :query, :internalDateSource => :query } request = Request.new() |> Request.method(:post) |> Request.url("/upload/gmail/v1/users/{userId}/messages", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_param(:body, :metadata, metadata) |> Request.add_param(:file, :data, data) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Lists the messages in the user's mailbox. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:includeSpamTrash` (*type:* `boolean()`) - Include messages from SPAM and TRASH in the results. * `:labelIds` (*type:* `list(String.t)`) - Only return messages with labels that match all of the specified label IDs. * `:maxResults` (*type:* `integer()`) - Maximum number of messages to return. * `:pageToken` (*type:* `String.t`) - Page token to retrieve a specific page of results in the list. * `:q` (*type:* `String.t`) - Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListMessagesResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListMessagesResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :includeSpamTrash => :query, :labelIds => :query, :maxResults => :query, :pageToken => :query, :q => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/messages", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListMessagesResponse{}]) end @doc """ Modifies the labels on the specified message. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the message to modify. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.ModifyMessageRequest.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_modify( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_modify(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages/{id}/modify", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Sends the specified message to the recipients in the To, Cc, and Bcc headers. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_send(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_send(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages/send", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Sends the specified message to the recipients in the To, Cc, and Bcc headers. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "resumable". * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_send_resumable( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_messages_send_resumable( connection, user_id, upload_type, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/resumable/upload/gmail/v1/users/{userId}/messages/send", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Sends the specified message to the recipients in the To, Cc, and Bcc headers. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". * `metadata` (*type:* `GoogleApi.Gmail.V1.Model.Message.t`) - object metadata * `data` (*type:* `String.t`) - Path to file * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_send_simple( Tesla.Env.client(), String.t(), String.t(), GoogleApi.Gmail.V1.Model.Message.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_send_simple( connection, user_id, upload_type, metadata, data, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/upload/gmail/v1/users/{userId}/messages/send", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_param(:query, :uploadType, upload_type) |> Request.add_param(:body, :metadata, metadata) |> Request.add_param(:file, :data, data) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Moves the specified message to the trash. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the message to Trash. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_trash( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_trash(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages/{id}/trash", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Removes the specified message from the trash. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the message to remove from Trash. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Message{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_untrash( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Message.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_untrash(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/messages/{id}/untrash", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Message{}]) end @doc """ Gets the specified message attachment. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `message_id` (*type:* `String.t`) - The ID of the message containing the attachment. * `id` (*type:* `String.t`) - The ID of the attachment. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.MessagePartBody{}}` on success * `{:error, info}` on failure """ @spec gmail_users_messages_attachments_get( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.MessagePartBody.t()} | {:error, Tesla.Env.t()} def gmail_users_messages_attachments_get( connection, user_id, message_id, id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "messageId" => URI.encode(message_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.MessagePartBody{}]) end @doc """ Gets the auto-forwarding setting for the specified account. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.AutoForwarding{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_get_auto_forwarding( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.AutoForwarding.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_get_auto_forwarding( connection, user_id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/autoForwarding", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.AutoForwarding{}]) end @doc """ Gets IMAP settings. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ImapSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_get_imap(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ImapSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_get_imap(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/imap", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ImapSettings{}]) end @doc """ Gets language settings. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.LanguageSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_get_language(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.LanguageSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_get_language(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/language", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.LanguageSettings{}]) end @doc """ Gets POP settings. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.PopSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_get_pop(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.PopSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_get_pop(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/pop", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.PopSettings{}]) end @doc """ Gets vacation responder settings. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.VacationSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_get_vacation(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.VacationSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_get_vacation(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/vacation", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.VacationSettings{}]) end @doc """ Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.AutoForwarding.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.AutoForwarding{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_update_auto_forwarding( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.AutoForwarding.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_update_auto_forwarding( connection, user_id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/settings/autoForwarding", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.AutoForwarding{}]) end @doc """ Updates IMAP settings. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.ImapSettings.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ImapSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_update_imap(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ImapSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_update_imap(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/settings/imap", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ImapSettings{}]) end @doc """ Updates language settings. If successful, the return object contains the displayLanguage that was saved for the user, which may differ from the value passed into the request. This is because the requested displayLanguage may not be directly supported by Gmail but have a close variant that is, and so the variant may be chosen and saved instead. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.LanguageSettings.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.LanguageSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_update_language(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.LanguageSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_update_language(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/settings/language", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.LanguageSettings{}]) end @doc """ Updates POP settings. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.PopSettings.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.PopSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_update_pop(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.PopSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_update_pop(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/settings/pop", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.PopSettings{}]) end @doc """ Updates vacation responder settings. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.VacationSettings.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.VacationSettings{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_update_vacation(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.VacationSettings.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_update_vacation(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/settings/vacation", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.VacationSettings{}]) end @doc """ Adds a delegate with its verification status set directly to accepted, without sending any verification email. The delegate user must be a member of the same G Suite organization as the delegator user. Gmail imposes limtations on the number of delegates and delegators each user in a G Suite organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators. Note that a delegate user must be referred to by their primary email address, and not an email alias. Also note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Delegate.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Delegate{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_delegates_create( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Delegate.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_delegates_create( connection, user_id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/settings/delegates", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Delegate{}]) end @doc """ Removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `delegate_email` (*type:* `String.t`) - The email address of the user to be removed as a delegate. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_delegates_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_settings_delegates_delete( connection, user_id, delegate_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "delegateEmail" => URI.encode(delegate_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified delegate. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `delegate_email` (*type:* `String.t`) - The email address of the user whose delegate relationship is to be retrieved. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Delegate{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_delegates_get( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Delegate.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_delegates_get( connection, user_id, delegate_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "delegateEmail" => URI.encode(delegate_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Delegate{}]) end @doc """ Lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListDelegatesResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_delegates_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListDelegatesResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_delegates_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/delegates", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListDelegatesResponse{}]) end @doc """ Creates a filter. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.Filter.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Filter{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_filters_create(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Filter.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_filters_create(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/settings/filters", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Filter{}]) end @doc """ Deletes a filter. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the filter to be deleted. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_filters_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_settings_filters_delete( connection, user_id, id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/settings/filters/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets a filter. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the filter to be fetched. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Filter{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_filters_get( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Filter.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_filters_get(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/filters/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Filter{}]) end @doc """ Lists the message filters of a Gmail user. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListFiltersResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_filters_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListFiltersResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_filters_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/filters", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListFiltersResponse{}]) end @doc """ Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.ForwardingAddress.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ForwardingAddress{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_forwarding_addresses_create( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.ForwardingAddress.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_forwarding_addresses_create( connection, user_id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/settings/forwardingAddresses", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ForwardingAddress{}]) end @doc """ Deletes the specified forwarding address and revokes any verification that may have been required. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `forwarding_email` (*type:* `String.t`) - The forwarding address to be deleted. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_forwarding_addresses_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_settings_forwarding_addresses_delete( connection, user_id, forwarding_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "forwardingEmail" => URI.encode(forwarding_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified forwarding address. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `forwarding_email` (*type:* `String.t`) - The forwarding address to be retrieved. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ForwardingAddress{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_forwarding_addresses_get( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.ForwardingAddress.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_forwarding_addresses_get( connection, user_id, forwarding_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "forwardingEmail" => URI.encode(forwarding_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ForwardingAddress{}]) end @doc """ Lists the forwarding addresses for the specified account. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListForwardingAddressesResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_forwarding_addresses_list( Tesla.Env.client(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.ListForwardingAddressesResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_forwarding_addresses_list( connection, user_id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/forwardingAddresses", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode( opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListForwardingAddressesResponse{}] ) end @doc """ Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.SendAs.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.SendAs{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_create(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.SendAs.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_create(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.SendAs{}]) end @doc """ Deletes the specified send-as alias. Revokes any verification that may have been required for using it. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The send-as alias to be deleted. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_delete( connection, user_id, send_as_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The send-as alias to be retrieved. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.SendAs{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_get( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.SendAs.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_get( connection, user_id, send_as_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.SendAs{}]) end @doc """ 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 * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListSendAsResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListSendAsResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListSendAsResponse{}]) end @doc """ Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. This method supports patch semantics. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The send-as alias to be updated. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.SendAs.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.SendAs{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_patch( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.SendAs.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_patch( connection, user_id, send_as_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:patch) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.SendAs{}]) end @doc """ Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The send-as alias to be updated. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.SendAs.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.SendAs{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_update( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.SendAs.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_update( connection, user_id, send_as_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:put) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.SendAs{}]) end @doc """ Sends a verification email to the specified send-as alias address. The verification status must be pending. This method is only available to service account clients that have been delegated domain-wide authority. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - User's email address. The special value "me" can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The send-as alias to be verified. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_verify( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_verify( connection, user_id, send_as_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Deletes the specified S/MIME config for the specified send-as alias. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The email address that appears in the "From:" header for mail sent using this alias. * `id` (*type:* `String.t`) - The immutable ID for the SmimeInfo. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_smime_info_delete( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_smime_info_delete( connection, user_id, send_as_email, id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified S/MIME config for the specified send-as alias. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The email address that appears in the "From:" header for mail sent using this alias. * `id` (*type:* `String.t`) - The immutable ID for the SmimeInfo. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.SmimeInfo{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_smime_info_get( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.SmimeInfo.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_smime_info_get( connection, user_id, send_as_email, id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.SmimeInfo{}]) end @doc """ Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The email address that appears in the "From:" header for mail sent using this alias. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.SmimeInfo.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.SmimeInfo{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_smime_info_insert( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.SmimeInfo.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_smime_info_insert( connection, user_id, send_as_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.SmimeInfo{}]) end @doc """ Lists S/MIME configs for the specified send-as alias. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The email address that appears in the "From:" header for mail sent using this alias. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListSmimeInfoResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_smime_info_list( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.ListSmimeInfoResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_smime_info_list( connection, user_id, send_as_email, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListSmimeInfoResponse{}]) end @doc """ Sets the default S/MIME config for the specified send-as alias. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `send_as_email` (*type:* `String.t`) - The email address that appears in the "From:" header for mail sent using this alias. * `id` (*type:* `String.t`) - The immutable ID for the SmimeInfo. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_settings_send_as_smime_info_set_default( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_settings_send_as_smime_info_set_default( connection, user_id, send_as_email, id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url( "/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "sendAsEmail" => URI.encode(send_as_email, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) } ) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - ID of the Thread to delete. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %{}}` on success * `{:error, info}` on failure """ @spec gmail_users_threads_delete( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, nil} | {:error, Tesla.Env.t()} def gmail_users_threads_delete(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:delete) |> Request.url("/gmail/v1/users/{userId}/threads/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [decode: false]) end @doc """ Gets the specified thread. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the thread to retrieve. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:format` (*type:* `String.t`) - The format to return the messages in. * `:metadataHeaders` (*type:* `list(String.t)`) - When given and format is METADATA, only include headers specified. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Thread{}}` on success * `{:error, info}` on failure """ @spec gmail_users_threads_get(Tesla.Env.client(), String.t(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.Thread.t()} | {:error, Tesla.Env.t()} def gmail_users_threads_get(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :format => :query, :metadataHeaders => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/threads/{id}", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Thread{}]) end @doc """ Lists the threads in the user's mailbox. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:includeSpamTrash` (*type:* `boolean()`) - Include threads from SPAM and TRASH in the results. * `:labelIds` (*type:* `list(String.t)`) - Only return threads with labels that match all of the specified label IDs. * `:maxResults` (*type:* `integer()`) - Maximum number of threads to return. * `:pageToken` (*type:* `String.t`) - Page token to retrieve a specific page of results in the list. * `:q` (*type:* `String.t`) - Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.ListThreadsResponse{}}` on success * `{:error, info}` on failure """ @spec gmail_users_threads_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Gmail.V1.Model.ListThreadsResponse.t()} | {:error, Tesla.Env.t()} def gmail_users_threads_list(connection, user_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :includeSpamTrash => :query, :labelIds => :query, :maxResults => :query, :pageToken => :query, :q => :query } request = Request.new() |> Request.method(:get) |> Request.url("/gmail/v1/users/{userId}/threads", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.ListThreadsResponse{}]) end @doc """ Modifies the labels applied to the thread. This applies to all messages in the thread. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the thread to modify. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `:body` (*type:* `GoogleApi.Gmail.V1.Model.ModifyThreadRequest.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Thread{}}` on success * `{:error, info}` on failure """ @spec gmail_users_threads_modify( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Thread.t()} | {:error, Tesla.Env.t()} def gmail_users_threads_modify(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :body => :body } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/threads/{id}/modify", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Thread{}]) end @doc """ Moves the specified thread to the trash. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the thread to Trash. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Thread{}}` on success * `{:error, info}` on failure """ @spec gmail_users_threads_trash( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Thread.t()} | {:error, Tesla.Env.t()} def gmail_users_threads_trash(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/threads/{id}/trash", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Thread{}]) end @doc """ Removes the specified thread from the trash. ## Parameters * `connection` (*type:* `GoogleApi.Gmail.V1.Connection.t`) - Connection to server * `user_id` (*type:* `String.t`) - The user's email address. The special value me can be used to indicate the authenticated user. * `id` (*type:* `String.t`) - The ID of the thread to remove from Trash. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:alt` (*type:* `String.t`) - Data format for the response. * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. * `:key` (*type:* `String.t`) - 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. * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. * `:quotaUser` (*type:* `String.t`) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters. * `:userIp` (*type:* `String.t`) - Deprecated. Please use quotaUser instead. * `opts` (*type:* `keyword()`) - Call options ## Returns * `{:ok, %GoogleApi.Gmail.V1.Model.Thread{}}` on success * `{:error, info}` on failure """ @spec gmail_users_threads_untrash( Tesla.Env.client(), String.t(), String.t(), keyword(), keyword() ) :: {:ok, GoogleApi.Gmail.V1.Model.Thread.t()} | {:error, Tesla.Env.t()} def gmail_users_threads_untrash(connection, user_id, id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query } request = Request.new() |> Request.method(:post) |> Request.url("/gmail/v1/users/{userId}/threads/{id}/untrash", %{ "userId" => URI.encode(user_id, &URI.char_unreserved?/1), "id" => URI.encode(id, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Gmail.V1.Model.Thread{}]) end end