|
| 1 | +# Copyright 2019 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# NOTE: This file is auto generated by the elixir code generator program. |
| 16 | +# Do not edit this file manually. |
| 17 | + |
| 18 | +defmodule GoogleApi.Chat.V1.Api.CustomEmojis do |
| 19 | + @moduledoc """ |
| 20 | + API calls for all endpoints tagged `CustomEmojis`. |
| 21 | + """ |
| 22 | + |
| 23 | + alias GoogleApi.Chat.V1.Connection |
| 24 | + alias GoogleApi.Gax.{Request, Response} |
| 25 | + |
| 26 | + @library_version Mix.Project.config() |> Keyword.get(:version, "") |
| 27 | + |
| 28 | + @doc """ |
| 29 | + Creates a custom emoji. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see [Learn about custom emojis in Google Chat](https://support.google.com/chat/answer/12800149) and [Manage custom emoji permissions](https://support.google.com/a/answer/12850085). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). |
| 30 | +
|
| 31 | + ## Parameters |
| 32 | +
|
| 33 | + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server |
| 34 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 35 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 36 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 37 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 38 | + * `:callback` (*type:* `String.t`) - JSONP |
| 39 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 40 | + * `: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. |
| 41 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 42 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 43 | + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. |
| 44 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 45 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 46 | + * `:body` (*type:* `GoogleApi.Chat.V1.Model.CustomEmoji.t`) - |
| 47 | + * `opts` (*type:* `keyword()`) - Call options |
| 48 | +
|
| 49 | + ## Returns |
| 50 | +
|
| 51 | + * `{:ok, %GoogleApi.Chat.V1.Model.CustomEmoji{}}` on success |
| 52 | + * `{:error, info}` on failure |
| 53 | + """ |
| 54 | + @spec chat_custom_emojis_create(Tesla.Env.client(), keyword(), keyword()) :: |
| 55 | + {:ok, GoogleApi.Chat.V1.Model.CustomEmoji.t()} |
| 56 | + | {:ok, Tesla.Env.t()} |
| 57 | + | {:ok, list()} |
| 58 | + | {:error, any()} |
| 59 | + def chat_custom_emojis_create(connection, optional_params \\ [], opts \\ []) do |
| 60 | + optional_params_config = %{ |
| 61 | + :"$.xgafv" => :query, |
| 62 | + :access_token => :query, |
| 63 | + :alt => :query, |
| 64 | + :callback => :query, |
| 65 | + :fields => :query, |
| 66 | + :key => :query, |
| 67 | + :oauth_token => :query, |
| 68 | + :prettyPrint => :query, |
| 69 | + :quotaUser => :query, |
| 70 | + :uploadType => :query, |
| 71 | + :upload_protocol => :query, |
| 72 | + :body => :body |
| 73 | + } |
| 74 | + |
| 75 | + request = |
| 76 | + Request.new() |
| 77 | + |> Request.method(:post) |
| 78 | + |> Request.url("/v1/customEmojis", %{}) |
| 79 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 80 | + |> Request.library_version(@library_version) |
| 81 | + |
| 82 | + connection |
| 83 | + |> Connection.execute(request) |
| 84 | + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.CustomEmoji{}]) |
| 85 | + end |
| 86 | + |
| 87 | + @doc """ |
| 88 | + Deletes a custom emoji. By default, users can only delete custom emoji they created. [Emoji managers](https://support.google.com/a/answer/12850085) assigned by the administrator can delete any custom emoji in the organization. See [Learn about custom emojis in Google Chat](https://support.google.com/chat/answer/12800149). Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see [Learn about custom emojis in Google Chat](https://support.google.com/chat/answer/12800149) and [Manage custom emoji permissions](https://support.google.com/a/answer/12850085). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). |
| 89 | +
|
| 90 | + ## Parameters |
| 91 | +
|
| 92 | + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server |
| 93 | + * `name` (*type:* `String.t`) - Required. Resource name of the custom emoji to delete. Format: `customEmojis/{customEmoji}` You can use the emoji name as an alias for `{customEmoji}`. For example, `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name for a custom emoji. |
| 94 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 95 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 96 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 97 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 98 | + * `:callback` (*type:* `String.t`) - JSONP |
| 99 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 100 | + * `: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. |
| 101 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 102 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 103 | + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. |
| 104 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 105 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 106 | + * `opts` (*type:* `keyword()`) - Call options |
| 107 | +
|
| 108 | + ## Returns |
| 109 | +
|
| 110 | + * `{:ok, %GoogleApi.Chat.V1.Model.Empty{}}` on success |
| 111 | + * `{:error, info}` on failure |
| 112 | + """ |
| 113 | + @spec chat_custom_emojis_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) :: |
| 114 | + {:ok, GoogleApi.Chat.V1.Model.Empty.t()} |
| 115 | + | {:ok, Tesla.Env.t()} |
| 116 | + | {:ok, list()} |
| 117 | + | {:error, any()} |
| 118 | + def chat_custom_emojis_delete(connection, name, optional_params \\ [], opts \\ []) do |
| 119 | + optional_params_config = %{ |
| 120 | + :"$.xgafv" => :query, |
| 121 | + :access_token => :query, |
| 122 | + :alt => :query, |
| 123 | + :callback => :query, |
| 124 | + :fields => :query, |
| 125 | + :key => :query, |
| 126 | + :oauth_token => :query, |
| 127 | + :prettyPrint => :query, |
| 128 | + :quotaUser => :query, |
| 129 | + :uploadType => :query, |
| 130 | + :upload_protocol => :query |
| 131 | + } |
| 132 | + |
| 133 | + request = |
| 134 | + Request.new() |
| 135 | + |> Request.method(:delete) |
| 136 | + |> Request.url("/v1/{+name}", %{ |
| 137 | + "name" => URI.encode(name, &URI.char_unreserved?/1) |
| 138 | + }) |
| 139 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 140 | + |> Request.library_version(@library_version) |
| 141 | + |
| 142 | + connection |
| 143 | + |> Connection.execute(request) |
| 144 | + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Empty{}]) |
| 145 | + end |
| 146 | + |
| 147 | + @doc """ |
| 148 | + Returns details about a custom emoji. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see [Learn about custom emojis in Google Chat](https://support.google.com/chat/answer/12800149) and [Manage custom emoji permissions](https://support.google.com/a/answer/12850085). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). |
| 149 | +
|
| 150 | + ## Parameters |
| 151 | +
|
| 152 | + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server |
| 153 | + * `name` (*type:* `String.t`) - Required. Resource name of the custom emoji. Format: `customEmojis/{customEmoji}` You can use the emoji name as an alias for `{customEmoji}`. For example, `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name for a custom emoji. |
| 154 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 155 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 156 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 157 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 158 | + * `:callback` (*type:* `String.t`) - JSONP |
| 159 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 160 | + * `: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. |
| 161 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 162 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 163 | + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. |
| 164 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 165 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 166 | + * `opts` (*type:* `keyword()`) - Call options |
| 167 | +
|
| 168 | + ## Returns |
| 169 | +
|
| 170 | + * `{:ok, %GoogleApi.Chat.V1.Model.CustomEmoji{}}` on success |
| 171 | + * `{:error, info}` on failure |
| 172 | + """ |
| 173 | + @spec chat_custom_emojis_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: |
| 174 | + {:ok, GoogleApi.Chat.V1.Model.CustomEmoji.t()} |
| 175 | + | {:ok, Tesla.Env.t()} |
| 176 | + | {:ok, list()} |
| 177 | + | {:error, any()} |
| 178 | + def chat_custom_emojis_get(connection, name, optional_params \\ [], opts \\ []) do |
| 179 | + optional_params_config = %{ |
| 180 | + :"$.xgafv" => :query, |
| 181 | + :access_token => :query, |
| 182 | + :alt => :query, |
| 183 | + :callback => :query, |
| 184 | + :fields => :query, |
| 185 | + :key => :query, |
| 186 | + :oauth_token => :query, |
| 187 | + :prettyPrint => :query, |
| 188 | + :quotaUser => :query, |
| 189 | + :uploadType => :query, |
| 190 | + :upload_protocol => :query |
| 191 | + } |
| 192 | + |
| 193 | + request = |
| 194 | + Request.new() |
| 195 | + |> Request.method(:get) |
| 196 | + |> Request.url("/v1/{+name}", %{ |
| 197 | + "name" => URI.encode(name, &URI.char_unreserved?/1) |
| 198 | + }) |
| 199 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 200 | + |> Request.library_version(@library_version) |
| 201 | + |
| 202 | + connection |
| 203 | + |> Connection.execute(request) |
| 204 | + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.CustomEmoji{}]) |
| 205 | + end |
| 206 | + |
| 207 | + @doc """ |
| 208 | + Lists custom emojis visible to the authenticated user. Custom emojis are only available for Google Workspace accounts, and the administrator must turn custom emojis on for the organization. For more information, see [Learn about custom emojis in Google Chat](https://support.google.com/chat/answer/12800149) and [Manage custom emoji permissions](https://support.google.com/a/answer/12850085). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). |
| 209 | +
|
| 210 | + ## Parameters |
| 211 | +
|
| 212 | + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server |
| 213 | + * `optional_params` (*type:* `keyword()`) - Optional parameters |
| 214 | + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. |
| 215 | + * `:access_token` (*type:* `String.t`) - OAuth access token. |
| 216 | + * `:alt` (*type:* `String.t`) - Data format for response. |
| 217 | + * `:callback` (*type:* `String.t`) - JSONP |
| 218 | + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. |
| 219 | + * `: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. |
| 220 | + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. |
| 221 | + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. |
| 222 | + * `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. |
| 223 | + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). |
| 224 | + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). |
| 225 | + * `:filter` (*type:* `String.t`) - Optional. A query filter. Supports filtering by creator. To filter by creator, you must specify a valid value. Currently only `creator("users/me")` and `NOT creator("users/me")` are accepted to filter custom emojis by whether they were created by the calling user or not. For example, the following query returns custom emojis created by the caller: ``` creator("users/me") ``` Invalid queries are rejected with an `INVALID_ARGUMENT` error. |
| 226 | + * `:pageSize` (*type:* `integer()`) - Optional. The maximum number of custom emojis returned. The service can return fewer custom emojis than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200. |
| 227 | + * `:pageToken` (*type:* `String.t`) - Optional. (If resuming from a previous query.) A page token received from a previous list custom emoji call. Provide this to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results. |
| 228 | + * `opts` (*type:* `keyword()`) - Call options |
| 229 | +
|
| 230 | + ## Returns |
| 231 | +
|
| 232 | + * `{:ok, %GoogleApi.Chat.V1.Model.ListCustomEmojisResponse{}}` on success |
| 233 | + * `{:error, info}` on failure |
| 234 | + """ |
| 235 | + @spec chat_custom_emojis_list(Tesla.Env.client(), keyword(), keyword()) :: |
| 236 | + {:ok, GoogleApi.Chat.V1.Model.ListCustomEmojisResponse.t()} |
| 237 | + | {:ok, Tesla.Env.t()} |
| 238 | + | {:ok, list()} |
| 239 | + | {:error, any()} |
| 240 | + def chat_custom_emojis_list(connection, optional_params \\ [], opts \\ []) do |
| 241 | + optional_params_config = %{ |
| 242 | + :"$.xgafv" => :query, |
| 243 | + :access_token => :query, |
| 244 | + :alt => :query, |
| 245 | + :callback => :query, |
| 246 | + :fields => :query, |
| 247 | + :key => :query, |
| 248 | + :oauth_token => :query, |
| 249 | + :prettyPrint => :query, |
| 250 | + :quotaUser => :query, |
| 251 | + :uploadType => :query, |
| 252 | + :upload_protocol => :query, |
| 253 | + :filter => :query, |
| 254 | + :pageSize => :query, |
| 255 | + :pageToken => :query |
| 256 | + } |
| 257 | + |
| 258 | + request = |
| 259 | + Request.new() |
| 260 | + |> Request.method(:get) |
| 261 | + |> Request.url("/v1/customEmojis", %{}) |
| 262 | + |> Request.add_optional_params(optional_params_config, optional_params) |
| 263 | + |> Request.library_version(@library_version) |
| 264 | + |
| 265 | + connection |
| 266 | + |> Connection.execute(request) |
| 267 | + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.ListCustomEmojisResponse{}]) |
| 268 | + end |
| 269 | +end |
0 commit comments