From 89824517bf2ac9a0240b5bdd8736a9acfe736964 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 12 Mar 2024 02:38:04 +0000 Subject: [PATCH] feat: Automated regeneration of Chat client --- clients/chat/README.md | 2 +- .../chat/lib/google_api/chat/v1/api/dms.ex | 237 ----- .../chat/lib/google_api/chat/v1/api/media.ex | 298 ++++++ .../chat/lib/google_api/chat/v1/api/rooms.ex | 237 ----- .../chat/lib/google_api/chat/v1/api/spaces.ex | 951 ++++++++++++++++-- .../chat/lib/google_api/chat/v1/connection.ex | 37 +- .../chat/lib/google_api/chat/v1/metadata.ex | 2 +- .../chat/v1/model/action_parameter.ex | 2 +- .../chat/v1/model/action_response.ex | 9 +- .../google_api/chat/v1/model/annotation.ex | 2 +- .../google_api/chat/v1/model/attached_gif.ex | 46 + .../google_api/chat/v1/model/attachment.ex | 16 +- .../chat/v1/model/attachment_data_ref.ex | 7 +- .../lib/google_api/chat/v1/model/button.ex | 4 +- .../chat/lib/google_api/chat/v1/model/card.ex | 2 +- .../google_api/chat/v1/model/card_header.ex | 4 +- .../google_api/chat/v1/model/card_with_id.ex | 6 +- .../model/chat_client_data_source_markup.ex | 46 + .../lib/google_api/chat/v1/model/color.ex | 2 +- .../chat/v1/model/common_event_object.ex | 6 +- .../v1/model/complete_import_space_request.ex | 41 + .../model/complete_import_space_response.ex | 46 + .../google_api/chat/v1/model/custom_emoji.ex | 46 + .../google_api/chat/v1/model/date_input.ex | 2 +- .../chat/v1/model/date_time_input.ex | 2 +- .../chat/v1/model/deletion_metadata.ex | 46 + .../chat/v1/model/deprecated_event.ex | 22 +- .../lib/google_api/chat/v1/model/dialog.ex | 2 +- .../chat/v1/model/drive_data_ref.ex | 2 +- .../lib/google_api/chat/v1/model/emoji.ex | 49 + .../chat/v1/model/emoji_reaction_summary.ex | 49 + .../google_api/chat/v1/model/form_action.ex | 4 +- .../v1/model/google_apps_card_v1_action.ex | 6 +- .../google_apps_card_v1_action_parameter.ex | 2 +- .../model/google_apps_card_v1_border_style.ex | 2 +- .../v1/model/google_apps_card_v1_button.ex | 10 +- .../model/google_apps_card_v1_button_list.ex | 2 +- .../chat/v1/model/google_apps_card_v1_card.ex | 17 +- .../model/google_apps_card_v1_card_action.ex | 2 +- .../google_apps_card_v1_card_fixed_footer.ex | 4 +- .../model/google_apps_card_v1_card_header.ex | 6 +- .../v1/model/google_apps_card_v1_column.ex | 55 + .../v1/model/google_apps_card_v1_columns.ex | 46 + .../google_apps_card_v1_date_time_picker.ex | 14 +- .../google_apps_card_v1_decorated_text.ex | 16 +- .../v1/model/google_apps_card_v1_divider.ex | 2 +- .../chat/v1/model/google_apps_card_v1_grid.ex | 2 +- .../v1/model/google_apps_card_v1_grid_item.ex | 4 +- .../chat/v1/model/google_apps_card_v1_icon.ex | 8 +- .../v1/model/google_apps_card_v1_image.ex | 8 +- .../google_apps_card_v1_image_component.ex | 2 +- .../google_apps_card_v1_image_crop_style.ex | 4 +- .../v1/model/google_apps_card_v1_on_click.ex | 6 +- .../v1/model/google_apps_card_v1_open_link.ex | 6 +- ...oogle_apps_card_v1_platform_data_source.ex | 49 + .../v1/model/google_apps_card_v1_section.ex | 6 +- .../google_apps_card_v1_selection_input.ex | 23 +- .../google_apps_card_v1_selection_item.ex | 14 +- .../google_apps_card_v1_suggestion_item.ex | 4 +- .../model/google_apps_card_v1_suggestions.ex | 2 +- .../google_apps_card_v1_switch_control.ex | 8 +- .../model/google_apps_card_v1_text_input.ex | 19 +- .../google_apps_card_v1_text_paragraph.ex | 2 +- .../v1/model/google_apps_card_v1_widget.ex | 22 +- .../v1/model/google_apps_card_v1_widgets.ex | 64 ++ .../lib/google_api/chat/v1/model/group.ex | 46 + .../v1/model/host_app_data_source_markup.ex | 46 + .../lib/google_api/chat/v1/model/image.ex | 6 +- .../google_api/chat/v1/model/image_button.ex | 8 +- .../lib/google_api/chat/v1/model/inputs.ex | 10 +- .../lib/google_api/chat/v1/model/key_value.ex | 12 +- .../v1/model/list_memberships_response.ex | 4 +- .../chat/v1/model/list_messages_response.ex | 49 + .../chat/v1/model/list_reactions_response.ex | 49 + .../chat/v1/model/list_spaces_response.ex | 4 +- .../google_api/chat/v1/model/matched_url.ex | 4 +- .../google_api/chat/v1/model/membership.ex | 14 +- .../lib/google_api/chat/v1/model/message.ex | 51 +- .../lib/google_api/chat/v1/model/on_click.ex | 6 +- .../chat/v1/model/quoted_message_metadata.ex | 49 + .../lib/google_api/chat/v1/model/reaction.ex | 52 + .../lib/google_api/chat/v1/model/section.ex | 6 +- .../chat/v1/model/selection_items.ex | 46 + .../chat/v1/model/set_up_space_request.ex | 52 + .../google_api/chat/v1/model/slash_command.ex | 2 +- .../chat/v1/model/slash_command_metadata.ex | 4 +- .../lib/google_api/chat/v1/model/space.ex | 24 +- .../chat/v1/model/space_data_source.ex | 46 + .../google_api/chat/v1/model/space_details.ex | 4 +- .../google_api/chat/v1/model/string_inputs.ex | 2 +- .../google_api/chat/v1/model/text_button.ex | 4 +- .../chat/v1/model/text_paragraph.ex | 2 +- .../lib/google_api/chat/v1/model/thread.ex | 6 +- .../google_api/chat/v1/model/time_input.ex | 2 +- .../lib/google_api/chat/v1/model/time_zone.ex | 2 +- .../chat/v1/model/updated_widget.ex | 49 + .../v1/model/upload_attachment_request.ex | 46 + .../v1/model/upload_attachment_response.ex | 46 + .../chat/lib/google_api/chat/v1/model/user.ex | 4 +- .../google_api/chat/v1/model/widget_markup.ex | 4 +- clients/chat/mix.exs | 2 +- 101 files changed, 2643 insertions(+), 784 deletions(-) delete mode 100644 clients/chat/lib/google_api/chat/v1/api/dms.ex delete mode 100644 clients/chat/lib/google_api/chat/v1/api/rooms.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/attached_gif.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/chat_client_data_source_markup.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/complete_import_space_request.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/complete_import_space_response.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/custom_emoji.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/deletion_metadata.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/emoji.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/emoji_reaction_summary.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_column.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_columns.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_platform_data_source.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widgets.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/group.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/host_app_data_source_markup.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/list_messages_response.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/list_reactions_response.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/quoted_message_metadata.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/reaction.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/selection_items.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/set_up_space_request.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/space_data_source.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/updated_widget.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/upload_attachment_request.ex create mode 100644 clients/chat/lib/google_api/chat/v1/model/upload_attachment_response.ex diff --git a/clients/chat/README.md b/clients/chat/README.md index 0b3d056803..cabfecf3ca 100644 --- a/clients/chat/README.md +++ b/clients/chat/README.md @@ -2,7 +2,7 @@ Google Chat API client library. -Enables apps to fetch information and perform actions in Google Chat. Authentication is a prerequisite for using the Google Chat REST API. +The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages. ## Installation diff --git a/clients/chat/lib/google_api/chat/v1/api/dms.ex b/clients/chat/lib/google_api/chat/v1/api/dms.ex deleted file mode 100644 index 3c97e9c933..0000000000 --- a/clients/chat/lib/google_api/chat/v1/api/dms.ex +++ /dev/null @@ -1,237 +0,0 @@ -# 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.Chat.V1.Api.Dms do - @moduledoc """ - API calls for all endpoints tagged `Dms`. - """ - - alias GoogleApi.Chat.V1.Connection - alias GoogleApi.Gax.{Request, Response} - - @library_version Mix.Project.config() |> Keyword.get(:version, "") - - @doc """ - Legacy path for creating message. Calling these will result in a BadRequest response. - - ## Parameters - - * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} - * `optional_params` (*type:* `keyword()`) - Optional parameters - * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. - * `:access_token` (*type:* `String.t`) - OAuth access token. - * `:alt` (*type:* `String.t`) - Data format for response. - * `:callback` (*type:* `String.t`) - JSONP - * `: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`) - 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. - * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). - * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. - * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). - * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success - * `{:error, info}` on failure - """ - @spec chat_dms_messages(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def chat_dms_messages(connection, parent, optional_params \\ [], opts \\ []) do - optional_params_config = %{ - :"$.xgafv" => :query, - :access_token => :query, - :alt => :query, - :callback => :query, - :fields => :query, - :key => :query, - :oauth_token => :query, - :prettyPrint => :query, - :quotaUser => :query, - :uploadType => :query, - :upload_protocol => :query, - :messageId => :query, - :messageReplyOption => :query, - :requestId => :query, - :threadKey => :query, - :body => :body - } - - request = - Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/messages", %{ - "parent" => URI.encode(parent, &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.Chat.V1.Model.Message{}]) - end - - @doc """ - Legacy path for creating message. Calling these will result in a BadRequest response. - - ## Parameters - - * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} - * `optional_params` (*type:* `keyword()`) - Optional parameters - * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. - * `:access_token` (*type:* `String.t`) - OAuth access token. - * `:alt` (*type:* `String.t`) - Data format for response. - * `:callback` (*type:* `String.t`) - JSONP - * `: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`) - 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. - * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). - * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. - * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). - * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success - * `{:error, info}` on failure - """ - @spec chat_dms_webhooks(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def chat_dms_webhooks(connection, parent, optional_params \\ [], opts \\ []) do - optional_params_config = %{ - :"$.xgafv" => :query, - :access_token => :query, - :alt => :query, - :callback => :query, - :fields => :query, - :key => :query, - :oauth_token => :query, - :prettyPrint => :query, - :quotaUser => :query, - :uploadType => :query, - :upload_protocol => :query, - :messageId => :query, - :messageReplyOption => :query, - :requestId => :query, - :threadKey => :query, - :body => :body - } - - request = - Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/webhooks", %{ - "parent" => URI.encode(parent, &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.Chat.V1.Model.Message{}]) - end - - @doc """ - Legacy path for creating message. Calling these will result in a BadRequest response. - - ## Parameters - - * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} - * `optional_params` (*type:* `keyword()`) - Optional parameters - * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. - * `:access_token` (*type:* `String.t`) - OAuth access token. - * `:alt` (*type:* `String.t`) - Data format for response. - * `:callback` (*type:* `String.t`) - JSONP - * `: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`) - 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. - * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). - * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. - * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). - * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success - * `{:error, info}` on failure - """ - @spec chat_dms_conversations_messages(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def chat_dms_conversations_messages(connection, parent, optional_params \\ [], opts \\ []) do - optional_params_config = %{ - :"$.xgafv" => :query, - :access_token => :query, - :alt => :query, - :callback => :query, - :fields => :query, - :key => :query, - :oauth_token => :query, - :prettyPrint => :query, - :quotaUser => :query, - :uploadType => :query, - :upload_protocol => :query, - :messageId => :query, - :messageReplyOption => :query, - :requestId => :query, - :threadKey => :query, - :body => :body - } - - request = - Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/messages", %{ - "parent" => URI.encode(parent, &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.Chat.V1.Model.Message{}]) - end -end diff --git a/clients/chat/lib/google_api/chat/v1/api/media.ex b/clients/chat/lib/google_api/chat/v1/api/media.ex index 5febc3b8ac..11c0f24d0e 100644 --- a/clients/chat/lib/google_api/chat/v1/api/media.ex +++ b/clients/chat/lib/google_api/chat/v1/api/media.ex @@ -89,4 +89,302 @@ defmodule GoogleApi.Chat.V1.Api.Media do |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Media{}]) end + + @doc """ + Uploads an attachment. For an example, see [Upload media as a file attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}". + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Chat.V1.Model.UploadAttachmentRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.UploadAttachmentResponse{}}` on success + * `{:error, info}` on failure + """ + @spec chat_media_upload(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.UploadAttachmentResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_media_upload(connection, parent, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/{+parent}/attachments:upload", %{ + "parent" => URI.encode(parent, &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.Chat.V1.Model.UploadAttachmentResponse{}]) + end + + @doc """ + Uploads an attachment. For an example, see [Upload media as a file attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}". + * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". + * `metadata` (*type:* `GoogleApi.Chat.V1.Model.UploadAttachmentRequest.t`) - object metadata + * `data` (*type:* `iodata`) - Content to upload, as a string or iolist + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.UploadAttachmentResponse{}}` on success + * `{:error, info}` on failure + """ + @spec chat_media_upload_iodata( + Tesla.Env.client(), + String.t(), + String.t(), + GoogleApi.Chat.V1.Model.UploadAttachmentRequest.t(), + iodata, + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Chat.V1.Model.UploadAttachmentResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_media_upload_iodata( + connection, + parent, + upload_type, + metadata, + data, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/upload/v1/{+parent}/attachments:upload", %{ + "parent" => URI.encode(parent, &URI.char_unreserved?/1) + }) + |> Request.add_param(:query, :uploadType, upload_type) + |> Request.add_param(:body, :metadata, metadata) + |> Request.add_param(:body, :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.Chat.V1.Model.UploadAttachmentResponse{}]) + end + + @doc """ + Uploads an attachment. For an example, see [Upload media as a file attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}". + * `upload_type` (*type:* `String.t`) - Upload type. Must be "resumable". + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Chat.V1.Model.UploadAttachmentRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %{}}` on success + * `{:error, info}` on failure + """ + @spec chat_media_upload_resumable( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: {:ok, nil} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} + def chat_media_upload_resumable( + connection, + parent, + upload_type, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/resumable/upload/v1/{+parent}/attachments:upload", %{ + "parent" => URI.encode(parent, &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 """ + Uploads an attachment. For an example, see [Upload media as a file attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/upload). Requires user [authentication](https://developers.google.com/chat/api/guides/auth/users). You can upload attachments up to 200 MB. Certain file types aren't supported. For details, see [File types blocked by Google Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. Resource name of the Chat space in which the attachment is uploaded. Format "spaces/{space}". + * `upload_type` (*type:* `String.t`) - Upload type. Must be "multipart". + * `metadata` (*type:* `GoogleApi.Chat.V1.Model.UploadAttachmentRequest.t`) - object metadata + * `data` (*type:* `String.t`) - Path to file containing content to upload + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.UploadAttachmentResponse{}}` on success + * `{:error, info}` on failure + """ + @spec chat_media_upload_simple( + Tesla.Env.client(), + String.t(), + String.t(), + GoogleApi.Chat.V1.Model.UploadAttachmentRequest.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Chat.V1.Model.UploadAttachmentResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_media_upload_simple( + connection, + parent, + upload_type, + metadata, + data, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/upload/v1/{+parent}/attachments:upload", %{ + "parent" => URI.encode(parent, &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.Chat.V1.Model.UploadAttachmentResponse{}]) + end end diff --git a/clients/chat/lib/google_api/chat/v1/api/rooms.ex b/clients/chat/lib/google_api/chat/v1/api/rooms.ex deleted file mode 100644 index c258a167b6..0000000000 --- a/clients/chat/lib/google_api/chat/v1/api/rooms.ex +++ /dev/null @@ -1,237 +0,0 @@ -# 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.Chat.V1.Api.Rooms do - @moduledoc """ - API calls for all endpoints tagged `Rooms`. - """ - - alias GoogleApi.Chat.V1.Connection - alias GoogleApi.Gax.{Request, Response} - - @library_version Mix.Project.config() |> Keyword.get(:version, "") - - @doc """ - Legacy path for creating message. Calling these will result in a BadRequest response. - - ## Parameters - - * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} - * `optional_params` (*type:* `keyword()`) - Optional parameters - * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. - * `:access_token` (*type:* `String.t`) - OAuth access token. - * `:alt` (*type:* `String.t`) - Data format for response. - * `:callback` (*type:* `String.t`) - JSONP - * `: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`) - 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. - * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). - * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. - * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). - * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success - * `{:error, info}` on failure - """ - @spec chat_rooms_messages(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def chat_rooms_messages(connection, parent, optional_params \\ [], opts \\ []) do - optional_params_config = %{ - :"$.xgafv" => :query, - :access_token => :query, - :alt => :query, - :callback => :query, - :fields => :query, - :key => :query, - :oauth_token => :query, - :prettyPrint => :query, - :quotaUser => :query, - :uploadType => :query, - :upload_protocol => :query, - :messageId => :query, - :messageReplyOption => :query, - :requestId => :query, - :threadKey => :query, - :body => :body - } - - request = - Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/messages", %{ - "parent" => URI.encode(parent, &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.Chat.V1.Model.Message{}]) - end - - @doc """ - Legacy path for creating message. Calling these will result in a BadRequest response. - - ## Parameters - - * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} - * `optional_params` (*type:* `keyword()`) - Optional parameters - * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. - * `:access_token` (*type:* `String.t`) - OAuth access token. - * `:alt` (*type:* `String.t`) - Data format for response. - * `:callback` (*type:* `String.t`) - JSONP - * `: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`) - 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. - * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). - * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. - * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). - * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success - * `{:error, info}` on failure - """ - @spec chat_rooms_webhooks(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def chat_rooms_webhooks(connection, parent, optional_params \\ [], opts \\ []) do - optional_params_config = %{ - :"$.xgafv" => :query, - :access_token => :query, - :alt => :query, - :callback => :query, - :fields => :query, - :key => :query, - :oauth_token => :query, - :prettyPrint => :query, - :quotaUser => :query, - :uploadType => :query, - :upload_protocol => :query, - :messageId => :query, - :messageReplyOption => :query, - :requestId => :query, - :threadKey => :query, - :body => :body - } - - request = - Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/webhooks", %{ - "parent" => URI.encode(parent, &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.Chat.V1.Model.Message{}]) - end - - @doc """ - Legacy path for creating message. Calling these will result in a BadRequest response. - - ## Parameters - - * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} - * `optional_params` (*type:* `keyword()`) - Optional parameters - * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. - * `:access_token` (*type:* `String.t`) - OAuth access token. - * `:alt` (*type:* `String.t`) - Data format for response. - * `:callback` (*type:* `String.t`) - JSONP - * `: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`) - 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. - * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). - * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. - * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). - * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - - * `opts` (*type:* `keyword()`) - Call options - - ## Returns - - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success - * `{:error, info}` on failure - """ - @spec chat_rooms_conversations_messages(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} - | {:ok, Tesla.Env.t()} - | {:ok, list()} - | {:error, any()} - def chat_rooms_conversations_messages(connection, parent, optional_params \\ [], opts \\ []) do - optional_params_config = %{ - :"$.xgafv" => :query, - :access_token => :query, - :alt => :query, - :callback => :query, - :fields => :query, - :key => :query, - :oauth_token => :query, - :prettyPrint => :query, - :quotaUser => :query, - :uploadType => :query, - :upload_protocol => :query, - :messageId => :query, - :messageReplyOption => :query, - :requestId => :query, - :threadKey => :query, - :body => :body - } - - request = - Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/messages", %{ - "parent" => URI.encode(parent, &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.Chat.V1.Model.Message{}]) - end -end diff --git a/clients/chat/lib/google_api/chat/v1/api/spaces.ex b/clients/chat/lib/google_api/chat/v1/api/spaces.ex index cdbac7e913..74c34909b8 100644 --- a/clients/chat/lib/google_api/chat/v1/api/spaces.ex +++ b/clients/chat/lib/google_api/chat/v1/api/spaces.ex @@ -26,12 +26,12 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do @library_version Mix.Project.config() |> Keyword.get(:version, "") @doc """ - Returns a space. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). Supports [user authentication](https://developers.google.com/chat/api/guides/auth/users) as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.spaces` or `chat.spaces.readonly` authorization scope. + Completes the [import process](https://developers.google.com/chat/api/guides/import-data) for the specified space and makes it visible to users. Requires app authentication and domain-wide delegation. For more information, see [Authorize Google Chat apps to import data](https://developers.google.com/chat/api/guides/authorize-import). ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `name` (*type:* `String.t`) - Required. Resource name of the space, in the form "spaces/*". Format: spaces/{space} + * `name` (*type:* `String.t`) - Required. Resource name of the import mode space. Format: `spaces/{space}` * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -44,6 +44,373 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Chat.V1.Model.CompleteImportSpaceRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.CompleteImportSpaceResponse{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_complete_import(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.CompleteImportSpaceResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_complete_import(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/{+name}:completeImport", %{ + "name" => URI.encode(name, &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.Chat.V1.Model.CompleteImportSpaceResponse{}]) + end + + @doc """ + Creates a named space. Spaces grouped by topics aren't supported. For an example, see [Create a space](https://developers.google.com/chat/api/guides/v1/spaces/create). If you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:requestId` (*type:* `String.t`) - Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error. + * `:body` (*type:* `GoogleApi.Chat.V1.Model.Space.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Space{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_create(Tesla.Env.client(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Space.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_create(connection, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :requestId => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/spaces", %{}) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Space{}]) + end + + @doc """ + Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see [Delete a space](https://developers.google.com/chat/api/guides/v1/spaces/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) from a user who has permission to delete the space. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Required. Resource name of the space to delete. Format: `spaces/{space}` + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Empty{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Empty.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_delete(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query + } + + request = + Request.new() + |> Request.method(:delete) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &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.Chat.V1.Model.Empty{}]) + end + + @doc """ + Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [user authentication](https://developers.google.com/chat/api/guides/auth/users), returns the direct message space between the specified user and the authenticated user. With [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts), returns the direct message space between the specified user and the calling Chat app. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users) or [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:name` (*type:* `String.t`) - Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `id` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API profile ID is `123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Space{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_find_direct_message(Tesla.Env.client(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Space.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_find_direct_message(connection, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :name => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/spaces:findDirectMessage", %{}) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Space{}]) + end + + @doc """ + Returns details about a space. For an example, see [Get a space](https://developers.google.com/chat/api/guides/v1/spaces/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Required. Resource name of the space, in the form "spaces/*". Format: `spaces/{space}` + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Space{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Space.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_get(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &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.Chat.V1.Model.Space{}]) + end + + @doc """ + Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see [List spaces](https://developers.google.com/chat/api/guides/v1/spaces/list). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:filter` (*type:* `String.t`) - Optional. A query filter. You can filter spaces by the space type ([`space_type`](https://developers.google.com/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = "SPACE" spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. + * `:pageSize` (*type:* `integer()`) - Optional. The maximum number of spaces to return. The service might return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return an `INVALID_ARGUMENT` error. + * `:pageToken` (*type:* `String.t`) - Optional. A page token, received from a previous list spaces call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.ListSpacesResponse{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_list(Tesla.Env.client(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.ListSpacesResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_list(connection, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :filter => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/spaces", %{}) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.ListSpacesResponse{}]) + end + + @doc """ + Updates a space. For an example, see [Update a space](https://developers.google.com/chat/api/guides/v1/spaces/update). If you're updating the `displayName` field and receive the error message `ALREADY_EXISTS`, try a different display name.. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Resource name of the space. Format: `spaces/{space}` + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:updateMask` (*type:* `String.t`) - Required. The updated field paths, comma separated if there are multiple. Currently supported field paths: - `display_name` (Only supports changing the display name of a space with the `SPACE` type, or when also including the `space_type` mask to change a `GROUP_CHAT` space type to `SPACE`. Trying to update the display name of a `GROUP_CHAT` or a `DIRECT_MESSAGE` space results in an invalid argument error. If you receive the error message `ALREADY_EXISTS` when updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.) - `space_type` (Only supports changing a `GROUP_CHAT` space type to `SPACE`. Include `display_name` together with `space_type` in the update mask and ensure that the specified space has a non-empty display name and the `SPACE` space type. Including the `space_type` mask and the `SPACE` type in the specified space when updating the display name is optional if the existing space already has the `SPACE` type. Trying to update the space type in other ways results in an invalid argument error). - `space_details` - `space_history_state` (Supports [turning history on or off for the space](https://support.google.com/chat/answer/7664687) if [the organization allows users to change their history setting](https://support.google.com/a/answer/7664184). Warning: mutually exclusive with all other field paths.) - Developer Preview: `access_settings.audience` (Supports changing the [access setting](https://support.google.com/chat/answer/11971020) of a space. If no audience is specified in the access setting, the space's access setting is updated to restricted. Warning: mutually exclusive with all other field paths.) + * `:body` (*type:* `GoogleApi.Chat.V1.Model.Space.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns @@ -51,12 +418,255 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `{:ok, %GoogleApi.Chat.V1.Model.Space{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Space.t()} + @spec chat_spaces_patch(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Space.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_patch(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :updateMask => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:patch) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &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.Chat.V1.Model.Space{}]) + end + + @doc """ + Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see [Set up a space](https://developers.google.com/chat/api/guides/v1/spaces/set-up). To specify the human members to add, add memberships with the appropriate `member.name` in the `SetUpSpaceRequest`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. For a space or group chat, if the caller blocks or is blocked by some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [create a membership](https://developers.google.com/chat/api/guides/v1/members/create). If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Chat.V1.Model.SetUpSpaceRequest.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Space{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_setup(Tesla.Env.client(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Space.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_setup(connection, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/spaces:setup", %{}) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Space{}]) + end + + @doc """ + Creates a human membership or app membership for the calling app. Creating memberships for other apps isn't supported. For an example, see [ Create a membership](https://developers.google.com/chat/api/guides/v1/members/create). When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). To specify the member to add, set the `membership.member.name` in the `CreateMembershipRequest`: - To add the calling app to a space or a direct message between two human users, use `users/app`. Unable to add other apps to the space. - To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. The resource name of the space for which to create the membership. Format: spaces/{space} + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Chat.V1.Model.Membership.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Membership{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_members_create(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Membership.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_members_create(connection, parent, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/{+parent}/members", %{ + "parent" => URI.encode(parent, &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.Chat.V1.Model.Membership{}]) + end + + @doc """ + Deletes a membership. For an example, see [Delete a membership](https://developers.google.com/chat/api/guides/v1/members/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the `chat.memberships` scope and `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. When deleting an app membership, requires the `chat.memberships.app` scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Membership{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_members_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Membership.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_members_delete(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query + } + + request = + Request.new() + |> Request.method(:delete) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &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.Chat.V1.Model.Membership{}]) + end + + @doc """ + Returns details about a membership. For an example, see [Get a membership](https://developers.google.com/chat/api/guides/v1/members/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Required. Resource name of the membership to retrieve. To get the app's own membership, you can optionally use `spaces/{space}/members/app`. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app` When [authenticated as a user](https://developers.google.com/chat/api/guides/auth/users), you can use the user's email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Membership{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_members_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Membership.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_get(connection, name, optional_params \\ [], opts \\ []) do + def chat_spaces_members_get(connection, name, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -82,15 +692,16 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do connection |> Connection.execute(request) - |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Space{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Membership{}]) end @doc """ - Lists spaces the caller is a member of. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). Supports [user authentication](https://developers.google.com/chat/api/guides/auth/users) as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.spaces` or `chat.spaces.readonly` authorization scope. Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent. + Lists memberships in a space. For an example, see [List memberships](https://developers.google.com/chat/api/guides/v1/members/list). Listing memberships with [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with [User authentication](https://developers.google.com/chat/api/guides/auth/users) lists memberships in spaces that the authenticated user has access to. Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. The resource name of the space for which to fetch a membership list. Format: spaces/{space} * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -103,21 +714,24 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:pageSize` (*type:* `integer()`) - Optional. The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000; values above 1000 are coerced to 1000. Negative values return an INVALID_ARGUMENT error. - * `:pageToken` (*type:* `String.t`) - Optional. A page token, received from a previous list spaces call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided must match the call that provided the page token. + * `:filter` (*type:* `String.t`) - Optional. A query filter. You can filter memberships by a member's role ([`role`](https://developers.google.com/chat/api/reference/rest/v1/spaces.members#membershiprole)) and type ([`member.type`](https://developers.google.com/chat/api/reference/rest/v1/User#type)). To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. To filter by type, set `member.type` to `HUMAN` or `BOT`. To filter by both role and type, use the `AND` operator. To filter by either role or type, use the `OR` operator. For example, the following queries are valid: ``` role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" member.type = "HUMAN" AND role = "ROLE_MANAGER" ``` The following queries are invalid: ``` member.type = "HUMAN" AND member.type = "BOT" role = "ROLE_MANAGER" AND role = "ROLE_MEMBER" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. + * `:pageSize` (*type:* `integer()`) - Optional. The maximum number of memberships to return. The service might return fewer than this value. If unspecified, at most 100 memberships are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return an `INVALID_ARGUMENT` error. + * `:pageToken` (*type:* `String.t`) - Optional. A page token, received from a previous call to list memberships. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. + * `:showGroups` (*type:* `boolean()`) - Optional. When `true`, also returns memberships associated with a Google Group, in addition to other types of memberships. If a filter is set, Google Group memberships that don't match the filter criteria aren't returned. + * `:showInvited` (*type:* `boolean()`) - Optional. When `true`, also returns memberships associated with invited members, in addition to other types of memberships. If a filter is set, invited memberships that don't match the filter criteria aren't returned. Currently requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). * `opts` (*type:* `keyword()`) - Call options ## Returns - * `{:ok, %GoogleApi.Chat.V1.Model.ListSpacesResponse{}}` on success + * `{:ok, %GoogleApi.Chat.V1.Model.ListMembershipsResponse{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_list(Tesla.Env.client(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.ListSpacesResponse.t()} + @spec chat_spaces_members_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.ListMembershipsResponse.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_list(connection, optional_params \\ [], opts \\ []) do + def chat_spaces_members_list(connection, parent, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -130,29 +744,34 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do :quotaUser => :query, :uploadType => :query, :upload_protocol => :query, + :filter => :query, :pageSize => :query, - :pageToken => :query + :pageToken => :query, + :showGroups => :query, + :showInvited => :query } request = Request.new() |> Request.method(:get) - |> Request.url("/v1/spaces", %{}) + |> Request.url("/v1/{+parent}/members", %{ + "parent" => URI.encode(parent, &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.Chat.V1.Model.ListSpacesResponse{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.ListMembershipsResponse{}]) end @doc """ - Legacy path for creating message. Calling these will result in a BadRequest response. + Creates a message in a Google Chat space. For an example, see [Create a message](https://developers.google.com/chat/api/guides/v1/messages/create). Calling this method requires [authentication](https://developers.google.com/chat/api/guides/auth) and supports the following authentication types: - For text messages, user authentication or app authentication are supported. - For card messages, only app authentication is supported. (Only Chat apps can create card messages.) ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} + * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: `spaces/{space}` * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -165,10 +784,10 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). + * `:messageId` (*type:* `String.t`) - Optional. A custom ID for a message. Lets Chat apps get, update, or delete a message without needing to store the system-assigned ID in the message's resource name (represented in the message `name` field). The value for this field must meet the following requirements: * Begins with `client-`. For example, `client-custom-name` is a valid custom ID, but `custom-name` is not. * Contains up to 63 characters and only lowercase letters, numbers, and hyphens. * Is unique within a space. A Chat app can't use the same custom ID for different messages. For details, see [Name a message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). + * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. ID for the thread. Supports up to 4000 characters. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options @@ -177,12 +796,12 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_webhooks(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + @spec chat_spaces_messages_create(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Chat.V1.Model.Message.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_webhooks(connection, parent, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_create(connection, parent, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -205,7 +824,7 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do request = Request.new() |> Request.method(:post) - |> Request.url("/v1/{+parent}/webhooks", %{ + |> Request.url("/v1/{+parent}/messages", %{ "parent" => URI.encode(parent, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) @@ -217,12 +836,12 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do end @doc """ - Returns a membership. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + Deletes a message. For an example, see [Delete a message](https://developers.google.com/chat/api/guides/v1/messages/delete). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only delete messages created by the calling Chat app. ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `name` (*type:* `String.t`) - Required. Resource name of the membership to retrieve. Format: spaces/{space}/members/{member} + * `name` (*type:* `String.t`) - Required. Resource name of the message. Format: `spaces/{space}/messages/{message}` If you've set a custom ID for your message, you can use the value from the `clientAssignedMessageId` field for `{message}`. For details, see [Name a message] (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -235,19 +854,81 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:force` (*type:* `boolean()`) - When `true`, deleting a message also deletes its threaded replies. When `false`, if a message has threaded replies, deletion fails. Only applies when [authenticating as a user](https://developers.google.com/chat/api/guides/auth/users). Has no effect when [authenticating as a Chat app] (https://developers.google.com/chat/api/guides/auth/service-accounts). * `opts` (*type:* `keyword()`) - Call options ## Returns - * `{:ok, %GoogleApi.Chat.V1.Model.Membership{}}` on success + * `{:ok, %GoogleApi.Chat.V1.Model.Empty{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_members_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Membership.t()} + @spec chat_spaces_messages_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_members_get(connection, name, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_delete(connection, name, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :force => :query + } + + request = + Request.new() + |> Request.method(:delete) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &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.Chat.V1.Model.Empty{}]) + end + + @doc """ + Returns details about a message. For an example, see [Read a message](https://developers.google.com/chat/api/guides/v1/messages/get). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). Note: Might return a message from a blocked member or space. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `name` (*type:* `String.t`) - Required. Resource name of the message. Format: `spaces/{space}/messages/{message}` If you've set a custom ID for your message, you can use the value from the `clientAssignedMessageId` field for `{message}`. For details, see [Name a message] (https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_messages_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Message.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_messages_get(connection, name, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -273,16 +954,16 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do connection |> Connection.execute(request) - |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Membership{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Message{}]) end @doc """ - Lists memberships in a space. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. For an example, see [List messages](/chat/api/guides/v1/messages/list). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space for which to fetch a membership list. Format: spaces/{space} + * `parent` (*type:* `String.t`) - Required. The resource name of the space to list messages from. Format: `spaces/{space}` * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -295,21 +976,24 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:pageSize` (*type:* `integer()`) - The maximum number of memberships to return. The service may return fewer than this value. If unspecified, at most 100 memberships are returned. The maximum value is 1000; values above 1000 are coerced to 1000. Negative values return an INVALID_ARGUMENT error. - * `:pageToken` (*type:* `String.t`) - A page token, received from a previous list memberships call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided must match the call that provided the page token. + * `:filter` (*type:* `String.t`) - A query filter. You can filter messages by date (`create_time`) and thread (`thread.name`). To filter messages by the date they were created, specify the `create_time` with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and double quotation marks. For example, `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to list messages that were created after a timestamp, or the less than operator `<` to list messages that were created before a timestamp. To filter messages within a time interval, use the `AND` operator between two timestamps. To filter by thread, specify the `thread.name`, formatted as `spaces/{space}/threads/{thread}`. You can only specify one `thread.name` per query. To filter by both thread and date, use the `AND` operator in your query. For example, the following queries are valid: ``` create_time > "2012-04-21T11:30:00-04:00" create_time > "2012-04-21T11:30:00-04:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123 create_time > "2012-04-21T11:30:00+00:00" AND create_time < "2013-01-01T00:00:00+00:00" AND thread.name = spaces/AAAAAAAAAAA/threads/123 thread.name = spaces/AAAAAAAAAAA/threads/123 ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. + * `:orderBy` (*type:* `String.t`) - Optional, if resuming from a previous query. How the list of messages is ordered. Specify a value to order by an ordering operation. Valid ordering operation values are as follows: - `ASC` for ascending. - `DESC` for descending. The default ordering is `create_time ASC`. + * `:pageSize` (*type:* `integer()`) - The maximum number of messages returned. The service might return fewer messages than this value. If unspecified, at most 25 are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return an `INVALID_ARGUMENT` error. + * `:pageToken` (*type:* `String.t`) - Optional, if resuming from a previous query. A page token received from a previous list messages call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. + * `:showDeleted` (*type:* `boolean()`) - Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable. * `opts` (*type:* `keyword()`) - Call options ## Returns - * `{:ok, %GoogleApi.Chat.V1.Model.ListMembershipsResponse{}}` on success + * `{:ok, %GoogleApi.Chat.V1.Model.ListMessagesResponse{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_members_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.ListMembershipsResponse.t()} + @spec chat_spaces_messages_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.ListMessagesResponse.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_members_list(connection, parent, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_list(connection, parent, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -322,14 +1006,17 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do :quotaUser => :query, :uploadType => :query, :upload_protocol => :query, + :filter => :query, + :orderBy => :query, :pageSize => :query, - :pageToken => :query + :pageToken => :query, + :showDeleted => :query } request = Request.new() |> Request.method(:get) - |> Request.url("/v1/{+parent}/members", %{ + |> Request.url("/v1/{+parent}/messages", %{ "parent" => URI.encode(parent, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) @@ -337,16 +1024,16 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do connection |> Connection.execute(request) - |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.ListMembershipsResponse{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.ListMessagesResponse{}]) end @doc """ - Creates a message. For example usage, see [Create a message](https://developers.google.com/chat/api/guides/crudl/messages#create_a_message). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). Supports [user authentication](https://developers.google.com/chat/api/guides/auth/users) as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` or `chat.messages.create` authorization scope. + Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only update messages created by the calling Chat app. ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `parent` (*type:* `String.t`) - Required. The resource name of the space in which to create a message. Format: spaces/{space} + * `name` (*type:* `String.t`) - Resource name of the message. Format: `spaces/{space}/messages/{message}` Where `{space}` is the ID of the space where the message is posted and `{message}` is a system-assigned ID for the message. For example, `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing `{message}` with the value from the `clientAssignedMessageId` field. For example, `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name a message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -359,10 +1046,8 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:messageId` (*type:* `String.t`) - Optional. A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `:messageReplyOption` (*type:* `String.t`) - Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. - * `:requestId` (*type:* `String.t`) - Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. - * `:threadKey` (*type:* `String.t`) - Optional. Deprecated: Use thread.thread_key instead. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). + * `:allowMissing` (*type:* `boolean()`) - Optional. If `true` and the message isn't found, a new message is created and `updateMask` is ignored. The specified message ID must be [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) or the request fails. + * `:updateMask` (*type:* `String.t`) - Required. The field paths to update. Separate multiple values with commas or use `*` to update all field paths. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - Developer Preview: `accessory_widgets` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options @@ -371,12 +1056,12 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_messages_create(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + @spec chat_spaces_messages_patch(Tesla.Env.client(), String.t(), keyword(), keyword()) :: {:ok, GoogleApi.Chat.V1.Model.Message.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_messages_create(connection, parent, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_patch(connection, name, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -389,18 +1074,16 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do :quotaUser => :query, :uploadType => :query, :upload_protocol => :query, - :messageId => :query, - :messageReplyOption => :query, - :requestId => :query, - :threadKey => :query, + :allowMissing => :query, + :updateMask => :query, :body => :body } request = Request.new() - |> Request.method(:post) - |> Request.url("/v1/{+parent}/messages", %{ - "parent" => URI.encode(parent, &URI.char_unreserved?/1) + |> Request.method(:patch) + |> Request.url("/v1/{+name}", %{ + "name" => URI.encode(name, &URI.char_unreserved?/1) }) |> Request.add_optional_params(optional_params_config, optional_params) |> Request.library_version(@library_version) @@ -411,12 +1094,12 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do end @doc """ - Deletes a message. For example usage, see [Delete a message](https://developers.google.com/chat/api/guides/crudl/messages#delete_a_message). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). Supports [user authentication](https://developers.google.com/chat/api/guides/auth/users) as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` authorization scope. + Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/chat/api/guides/v1/messages/update). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Supports [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts) and [user authentication](https://developers.google.com/chat/api/guides/auth/users). When using app authentication, requests can only update messages created by the calling Chat app. ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `name` (*type:* `String.t`) - Required. Resource name of the message to be deleted, in the form "spaces/*/messages/*" Example: spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB + * `name` (*type:* `String.t`) - Resource name of the message. Format: `spaces/{space}/messages/{message}` Where `{space}` is the ID of the space where the message is posted and `{message}` is a system-assigned ID for the message. For example, `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing `{message}` with the value from the `clientAssignedMessageId` field. For example, `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name a message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -429,19 +1112,22 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:allowMissing` (*type:* `boolean()`) - Optional. If `true` and the message isn't found, a new message is created and `updateMask` is ignored. The specified message ID must be [client-assigned](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message) or the request fails. + * `:updateMask` (*type:* `String.t`) - Required. The field paths to update. Separate multiple values with commas or use `*` to update all field paths. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - Developer Preview: `accessory_widgets` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) + * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns - * `{:ok, %GoogleApi.Chat.V1.Model.Empty{}}` on success + * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_messages_delete(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Empty.t()} + @spec chat_spaces_messages_update(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Message.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_messages_delete(connection, name, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_update(connection, name, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -453,12 +1139,15 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do :prettyPrint => :query, :quotaUser => :query, :uploadType => :query, - :upload_protocol => :query + :upload_protocol => :query, + :allowMissing => :query, + :updateMask => :query, + :body => :body } request = Request.new() - |> Request.method(:delete) + |> Request.method(:put) |> Request.url("/v1/{+name}", %{ "name" => URI.encode(name, &URI.char_unreserved?/1) }) @@ -467,16 +1156,16 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do connection |> Connection.execute(request) - |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Empty{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Message{}]) end @doc """ - Returns a message. For example usage, see [Read a message](https://developers.google.com/chat/api/guides/crudl/messages#read_a_message). Requires [authentication](https://developers.google.com/chat/api/guides/auth). Fully supports [Service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). Supports [user authentication](https://developers.google.com/chat/api/guides/auth/users) as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. [User authentication](https://developers.google.com/chat/api/guides/auth/users) requires the `chat.messages` or `chat.messages.readonly` authorization scope. Note: Might return a message from a blocked member or space. + Gets the metadata of a message attachment. The attachment data is fetched using the [media API](https://developers.google.com/chat/api/reference/rest/v1/media/download). For an example, see [Get a message attachment](https://developers.google.com/chat/api/guides/v1/media-and-attachments/get). Requires [app authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `name` (*type:* `String.t`) - Required. Resource name of the message to retrieve. Format: spaces/{space}/messages/{message} If the message begins with `client-`, then it has a custom name assigned by a Chat app that created it with the Chat REST API. That Chat app (but not others) can pass the custom name to get, update, or delete the message. To learn more, see [create and name a message] (https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). + * `name` (*type:* `String.t`) - Required. Resource name of the attachment, in the form `spaces/*/messages/*/attachments/*`. * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -493,15 +1182,15 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do ## Returns - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success + * `{:ok, %GoogleApi.Chat.V1.Model.Attachment{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_messages_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} + @spec chat_spaces_messages_attachments_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.Attachment.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_messages_get(connection, name, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_attachments_get(connection, name, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -527,16 +1216,16 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do connection |> Connection.execute(request) - |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Message{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Attachment{}]) end @doc """ - Updates a message. For example usage, see [Update a message](https://developers.google.com/chat/api/guides/crudl/messages#update_a_message). Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + Creates a reaction and adds it to a message. For an example, see [Create a reaction](https://developers.google.com/chat/api/guides/v1/reactions/create). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). Only unicode emoji are supported. ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `name` (*type:* `String.t`) - Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB` + * `parent` (*type:* `String.t`) - Required. The message where the reaction is created. Format: `spaces/{space}/messages/{message}` * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -549,22 +1238,25 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do * `: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. * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). - * `:allowMissing` (*type:* `boolean()`) - Optional. If `true` and the message is not found, a new message is created and `updateMask` is ignored. The specified message ID must be [client-assigned](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message) or the request fails. - * `:updateMask` (*type:* `String.t`) - Required. The field paths to update. Separate multiple values with commas. Currently supported field paths: - text - cards (Requires [service account authentication](/chat/api/guides/auth/service-accounts).) - cards_v2 - * `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) - + * `:body` (*type:* `GoogleApi.Chat.V1.Model.Reaction.t`) - * `opts` (*type:* `keyword()`) - Call options ## Returns - * `{:ok, %GoogleApi.Chat.V1.Model.Message{}}` on success + * `{:ok, %GoogleApi.Chat.V1.Model.Reaction{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_messages_update(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Message.t()} + @spec chat_spaces_messages_reactions_create( + Tesla.Env.client(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Chat.V1.Model.Reaction.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_messages_update(connection, name, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_reactions_create(connection, parent, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -577,32 +1269,30 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do :quotaUser => :query, :uploadType => :query, :upload_protocol => :query, - :allowMissing => :query, - :updateMask => :query, :body => :body } request = Request.new() - |> Request.method(:put) - |> Request.url("/v1/{+name}", %{ - "name" => URI.encode(name, &URI.char_unreserved?/1) + |> Request.method(:post) + |> Request.url("/v1/{+parent}/reactions", %{ + "parent" => URI.encode(parent, &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.Chat.V1.Model.Message{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Reaction{}]) end @doc """ - Gets the metadata of a message attachment. The attachment data is fetched using the media API. Requires [service account authentication](https://developers.google.com/chat/api/guides/auth/service-accounts). + Deletes a reaction to a message. For an example, see [Delete a reaction](https://developers.google.com/chat/api/guides/v1/reactions/delete). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). ## Parameters * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server - * `name` (*type:* `String.t`) - Required. Resource name of the attachment, in the form "spaces/*/messages/*/attachments/*". + * `name` (*type:* `String.t`) - Required. Name of the reaction to delete. Format: `spaces/{space}/messages/{message}/reactions/{reaction}` * `optional_params` (*type:* `keyword()`) - Optional parameters * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. * `:access_token` (*type:* `String.t`) - OAuth access token. @@ -619,15 +1309,20 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do ## Returns - * `{:ok, %GoogleApi.Chat.V1.Model.Attachment{}}` on success + * `{:ok, %GoogleApi.Chat.V1.Model.Empty{}}` on success * `{:error, info}` on failure """ - @spec chat_spaces_messages_attachments_get(Tesla.Env.client(), String.t(), keyword(), keyword()) :: - {:ok, GoogleApi.Chat.V1.Model.Attachment.t()} + @spec chat_spaces_messages_reactions_delete( + Tesla.Env.client(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Chat.V1.Model.Empty.t()} | {:ok, Tesla.Env.t()} | {:ok, list()} | {:error, any()} - def chat_spaces_messages_attachments_get(connection, name, optional_params \\ [], opts \\ []) do + def chat_spaces_messages_reactions_delete(connection, name, optional_params \\ [], opts \\ []) do optional_params_config = %{ :"$.xgafv" => :query, :access_token => :query, @@ -644,7 +1339,7 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do request = Request.new() - |> Request.method(:get) + |> Request.method(:delete) |> Request.url("/v1/{+name}", %{ "name" => URI.encode(name, &URI.char_unreserved?/1) }) @@ -653,6 +1348,72 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do connection |> Connection.execute(request) - |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Attachment{}]) + |> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.Empty{}]) + end + + @doc """ + Lists reactions to a message. For an example, see [List reactions](https://developers.google.com/chat/api/guides/v1/reactions/list). Requires [user authentication](https://developers.google.com/chat/api/guides/auth/users). + + ## Parameters + + * `connection` (*type:* `GoogleApi.Chat.V1.Connection.t`) - Connection to server + * `parent` (*type:* `String.t`) - Required. The message users reacted to. Format: `spaces/{space}/messages/{message}` + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `: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`) - 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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:filter` (*type:* `String.t`) - Optional. A query filter. You can filter reactions by [emoji](https://developers.google.com/chat/api/reference/rest/v1/Emoji) (either `emoji.unicode` or `emoji.custom_emoji.uid`) and [user](https://developers.google.com/chat/api/reference/rest/v1/User) (`user.name`). To filter reactions for multiple emojis or users, join similar fields with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode = "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`. To filter reactions by emoji and user, use the `AND` operator, such as `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`. If your query uses both `AND` and `OR`, group them with parentheses. For example, the following queries are valid: ``` user.name = "users/{user}" emoji.unicode = "🙂" emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" OR emoji.unicode = "👍" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" AND user.name = "users/{user}" (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}") AND user.name = "users/{user}" ``` The following queries are invalid: ``` emoji.unicode = "🙂" AND emoji.unicode = "👍" emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}" emoji.unicode = "🙂" OR user.name = "users/{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR user.name = "users/{user}" emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" AND user.name = "users/{user}" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error. + * `:pageSize` (*type:* `integer()`) - Optional. The maximum number of reactions returned. The service can return fewer reactions than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200. + * `:pageToken` (*type:* `String.t`) - Optional. (If resuming from a previous query.) A page token received from a previous list reactions 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. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Chat.V1.Model.ListReactionsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec chat_spaces_messages_reactions_list(Tesla.Env.client(), String.t(), keyword(), keyword()) :: + {:ok, GoogleApi.Chat.V1.Model.ListReactionsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def chat_spaces_messages_reactions_list(connection, parent, optional_params \\ [], opts \\ []) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :filter => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/{+parent}/reactions", %{ + "parent" => URI.encode(parent, &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.Chat.V1.Model.ListReactionsResponse{}]) end end diff --git a/clients/chat/lib/google_api/chat/v1/connection.ex b/clients/chat/lib/google_api/chat/v1/connection.ex index 72d476f408..a4e8df8a4d 100644 --- a/clients/chat/lib/google_api/chat/v1/connection.ex +++ b/clients/chat/lib/google_api/chat/v1/connection.ex @@ -24,17 +24,50 @@ defmodule GoogleApi.Chat.V1.Connection do use GoogleApi.Gax.Connection, scopes: [ + # Private Service: https://www.googleapis.com/auth/chat.bot + "https://www.googleapis.com/auth/chat.bot", + + # Delete conversations and spaces & remove access to associated files in Google Chat + "https://www.googleapis.com/auth/chat.delete", + + # Import spaces, messages, and memberships into Google Chat. + "https://www.googleapis.com/auth/chat.import", + # View, add, and remove members from conversations in Google Chat "https://www.googleapis.com/auth/chat.memberships", + # Add and remove itself from conversations in Google Chat + "https://www.googleapis.com/auth/chat.memberships.app", + + # View members in Google Chat conversations. + "https://www.googleapis.com/auth/chat.memberships.readonly", + # View, compose, send, update, and delete messages, and add, view, and delete reactions to messages. "https://www.googleapis.com/auth/chat.messages", # Compose and send messages in Google Chat "https://www.googleapis.com/auth/chat.messages.create", - # view messages and reactions in Google Chat - "https://www.googleapis.com/auth/chat.messages.readonly" + # View, add, and delete reactions to messages in Google Chat + "https://www.googleapis.com/auth/chat.messages.reactions", + + # Add reactions to messages in Google Chat + "https://www.googleapis.com/auth/chat.messages.reactions.create", + + # View reactions to messages in Google Chat + "https://www.googleapis.com/auth/chat.messages.reactions.readonly", + + # View messages and reactions in Google Chat + "https://www.googleapis.com/auth/chat.messages.readonly", + + # Create conversations and spaces and see or edit metadata (including history settings and access settings) in Google Chat + "https://www.googleapis.com/auth/chat.spaces", + + # Create new conversations in Google Chat + "https://www.googleapis.com/auth/chat.spaces.create", + + # View chat and spaces in Google Chat + "https://www.googleapis.com/auth/chat.spaces.readonly" ], otp_app: :google_api_chat, base_url: "https://chat.googleapis.com/" diff --git a/clients/chat/lib/google_api/chat/v1/metadata.ex b/clients/chat/lib/google_api/chat/v1/metadata.ex index b34cc913a1..8c4c94509e 100644 --- a/clients/chat/lib/google_api/chat/v1/metadata.ex +++ b/clients/chat/lib/google_api/chat/v1/metadata.ex @@ -20,7 +20,7 @@ defmodule GoogleApi.Chat.V1 do API client metadata for GoogleApi.Chat.V1. """ - @discovery_revision "20221112" + @discovery_revision "20240305" def discovery_revision(), do: @discovery_revision end diff --git a/clients/chat/lib/google_api/chat/v1/model/action_parameter.ex b/clients/chat/lib/google_api/chat/v1/model/action_parameter.ex index fa9a16f468..ef9f6a4b2e 100644 --- a/clients/chat/lib/google_api/chat/v1/model/action_parameter.ex +++ b/clients/chat/lib/google_api/chat/v1/model/action_parameter.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.ActionParameter do @moduledoc """ - List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters. + List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze one day, snooze next week. You might use `action method = snooze()`, passing the snooze type and snooze time in the list of string parameters. ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/action_response.ex b/clients/chat/lib/google_api/chat/v1/model/action_response.ex index 200f35de2c..3d1ef526e4 100644 --- a/clients/chat/lib/google_api/chat/v1/model/action_response.ex +++ b/clients/chat/lib/google_api/chat/v1/model/action_response.ex @@ -17,13 +17,14 @@ defmodule GoogleApi.Chat.V1.Model.ActionResponse do @moduledoc """ - Parameters that a Chat app can use to configure how it's response is posted. + Parameters that a Chat app can use to configure how its response is posted. ## Attributes - * `dialogAction` (*type:* `GoogleApi.Chat.V1.Model.DialogAction.t`, *default:* `nil`) - Input only. A response to an event related to a [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be accompanied by `ResponseType.Dialog`. + * `dialogAction` (*type:* `GoogleApi.Chat.V1.Model.DialogAction.t`, *default:* `nil`) - Input only. A response to an interaction event related to a [dialog](https://developers.google.com/chat/how-tos/dialogs). Must be accompanied by `ResponseType.Dialog`. * `type` (*type:* `String.t`, *default:* `nil`) - Input only. The type of Chat app response. - * `url` (*type:* `String.t`, *default:* `nil`) - Input only. URL for users to auth or config. (Only for REQUEST_CONFIG response types.) + * `updatedWidget` (*type:* `GoogleApi.Chat.V1.Model.UpdatedWidget.t`, *default:* `nil`) - Input only. The response of the updated widget. + * `url` (*type:* `String.t`, *default:* `nil`) - Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.) """ use GoogleApi.Gax.ModelBase @@ -31,11 +32,13 @@ defmodule GoogleApi.Chat.V1.Model.ActionResponse do @type t :: %__MODULE__{ :dialogAction => GoogleApi.Chat.V1.Model.DialogAction.t() | nil, :type => String.t() | nil, + :updatedWidget => GoogleApi.Chat.V1.Model.UpdatedWidget.t() | nil, :url => String.t() | nil } field(:dialogAction, as: GoogleApi.Chat.V1.Model.DialogAction) field(:type) + field(:updatedWidget, as: GoogleApi.Chat.V1.Model.UpdatedWidget) field(:url) end diff --git a/clients/chat/lib/google_api/chat/v1/model/annotation.ex b/clients/chat/lib/google_api/chat/v1/model/annotation.ex index f6b11599dc..8b53c48a76 100644 --- a/clients/chat/lib/google_api/chat/v1/model/annotation.ex +++ b/clients/chat/lib/google_api/chat/v1/model/annotation.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.Annotation do @moduledoc """ - Annotations associated with the plain-text body of the message. Example plain-text message body: ``` Hello @FooBot how are you!" ``` The corresponding annotations metadata: ``` "annotations":[{ "type":"USER_MENTION", "startIndex":6, "length":7, "userMention": { "user": { "name":"users/107946847022116401880", "displayName":"FooBot", "avatarUrl":"https://goo.gl/aeDtrS", "type":"BOT" }, "type":"MENTION" } }] ``` + Output only. Annotations associated with the plain-text body of the message. To add basic formatting to a text message, see [Format text messages](https://developers.google.com/chat/format-messages). Example plain-text message body: ``` Hello @FooBot how are you!" ``` The corresponding annotations metadata: ``` "annotations":[{ "type":"USER_MENTION", "startIndex":6, "length":7, "userMention": { "user": { "name":"users/{user}", "displayName":"FooBot", "avatarUrl":"https://goo.gl/aeDtrS", "type":"BOT" }, "type":"MENTION" } }] ``` ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/attached_gif.ex b/clients/chat/lib/google_api/chat/v1/model/attached_gif.ex new file mode 100644 index 0000000000..7121e58711 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/attached_gif.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.AttachedGif do + @moduledoc """ + A GIF image that's specified by a URL. + + ## Attributes + + * `uri` (*type:* `String.t`, *default:* `nil`) - Output only. The URL that hosts the GIF image. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :uri => String.t() | nil + } + + field(:uri) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.AttachedGif do + def decode(value, options) do + GoogleApi.Chat.V1.Model.AttachedGif.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.AttachedGif do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/attachment.ex b/clients/chat/lib/google_api/chat/v1/model/attachment.ex index 90b6b9dbc6..b23d62e17e 100644 --- a/clients/chat/lib/google_api/chat/v1/model/attachment.ex +++ b/clients/chat/lib/google_api/chat/v1/model/attachment.ex @@ -21,14 +21,14 @@ defmodule GoogleApi.Chat.V1.Model.Attachment do ## Attributes - * `attachmentDataRef` (*type:* `GoogleApi.Chat.V1.Model.AttachmentDataRef.t`, *default:* `nil`) - A reference to the attachment data. This is used with the media API to download the attachment data. - * `contentName` (*type:* `String.t`, *default:* `nil`) - The original file name for the content, not the full path. - * `contentType` (*type:* `String.t`, *default:* `nil`) - The content type (MIME type) of the file. - * `downloadUri` (*type:* `String.t`, *default:* `nil`) - Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps should not use this URL to download attachment content. - * `driveDataRef` (*type:* `GoogleApi.Chat.V1.Model.DriveDataRef.t`, *default:* `nil`) - A reference to the drive attachment. This is used with the Drive API. - * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the attachment, in the form "spaces/*/messages/*/attachments/*". - * `source` (*type:* `String.t`, *default:* `nil`) - The source of the attachment. - * `thumbnailUri` (*type:* `String.t`, *default:* `nil`) - Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps should not use this URL to download attachment content. + * `attachmentDataRef` (*type:* `GoogleApi.Chat.V1.Model.AttachmentDataRef.t`, *default:* `nil`) - A reference to the attachment data. This field is used with the media API to download the attachment data. + * `contentName` (*type:* `String.t`, *default:* `nil`) - Output only. The original file name for the content, not the full path. + * `contentType` (*type:* `String.t`, *default:* `nil`) - Output only. The content type (MIME type) of the file. + * `downloadUri` (*type:* `String.t`, *default:* `nil`) - Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content. + * `driveDataRef` (*type:* `GoogleApi.Chat.V1.Model.DriveDataRef.t`, *default:* `nil`) - Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API. + * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the attachment, in the form `spaces/*/messages/*/attachments/*`. + * `source` (*type:* `String.t`, *default:* `nil`) - Output only. The source of the attachment. + * `thumbnailUri` (*type:* `String.t`, *default:* `nil`) - Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/attachment_data_ref.ex b/clients/chat/lib/google_api/chat/v1/model/attachment_data_ref.ex index fb3d1651b5..de4d717ead 100644 --- a/clients/chat/lib/google_api/chat/v1/model/attachment_data_ref.ex +++ b/clients/chat/lib/google_api/chat/v1/model/attachment_data_ref.ex @@ -17,19 +17,22 @@ defmodule GoogleApi.Chat.V1.Model.AttachmentDataRef do @moduledoc """ - A reference to the data of an attachment. + ## Attributes - * `resourceName` (*type:* `String.t`, *default:* `nil`) - The resource name of the attachment data. This is used with the media API to download the attachment data. + * `attachmentUploadToken` (*type:* `String.t`, *default:* `nil`) - Opaque token containing a reference to an uploaded attachment. Treated by clients as an opaque string and used to create or update Chat messages with attachments. + * `resourceName` (*type:* `String.t`, *default:* `nil`) - The resource name of the attachment data. This field is used with the media API to download the attachment data. """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ + :attachmentUploadToken => String.t() | nil, :resourceName => String.t() | nil } + field(:attachmentUploadToken) field(:resourceName) end diff --git a/clients/chat/lib/google_api/chat/v1/model/button.ex b/clients/chat/lib/google_api/chat/v1/model/button.ex index 6d9394ee81..5722ff7a56 100644 --- a/clients/chat/lib/google_api/chat/v1/model/button.ex +++ b/clients/chat/lib/google_api/chat/v1/model/button.ex @@ -21,8 +21,8 @@ defmodule GoogleApi.Chat.V1.Model.Button do ## Attributes - * `imageButton` (*type:* `GoogleApi.Chat.V1.Model.ImageButton.t`, *default:* `nil`) - A button with image and onclick action. - * `textButton` (*type:* `GoogleApi.Chat.V1.Model.TextButton.t`, *default:* `nil`) - A button with text and onclick action. + * `imageButton` (*type:* `GoogleApi.Chat.V1.Model.ImageButton.t`, *default:* `nil`) - A button with image and `onclick` action. + * `textButton` (*type:* `GoogleApi.Chat.V1.Model.TextButton.t`, *default:* `nil`) - A button with text and `onclick` action. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/card.ex b/clients/chat/lib/google_api/chat/v1/model/card.ex index 6b770fc384..cfda0d23c5 100644 --- a/clients/chat/lib/google_api/chat/v1/model/card.ex +++ b/clients/chat/lib/google_api/chat/v1/model/card.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.Card do @moduledoc """ - A card is a UI element that can contain UI widgets such as texts, images. + A card is a UI element that can contain UI widgets such as text and images. ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/card_header.ex b/clients/chat/lib/google_api/chat/v1/model/card_header.ex index 65bfc952ff..0605756a3b 100644 --- a/clients/chat/lib/google_api/chat/v1/model/card_header.ex +++ b/clients/chat/lib/google_api/chat/v1/model/card_header.ex @@ -21,10 +21,10 @@ defmodule GoogleApi.Chat.V1.Model.CardHeader do ## Attributes - * `imageStyle` (*type:* `String.t`, *default:* `nil`) - The image's type (e.g. square border or circular border). + * `imageStyle` (*type:* `String.t`, *default:* `nil`) - The image's type (for example, square border or circular border). * `imageUrl` (*type:* `String.t`, *default:* `nil`) - The URL of the image in the card header. * `subtitle` (*type:* `String.t`, *default:* `nil`) - The subtitle of the card header. - * `title` (*type:* `String.t`, *default:* `nil`) - The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each will take up 1 line. If only the title is specified, it will take up both lines. + * `title` (*type:* `String.t`, *default:* `nil`) - The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each takes up one line. If only the title is specified, it takes up both lines. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/card_with_id.ex b/clients/chat/lib/google_api/chat/v1/model/card_with_id.ex index 1698c18b90..010d03d6a4 100644 --- a/clients/chat/lib/google_api/chat/v1/model/card_with_id.ex +++ b/clients/chat/lib/google_api/chat/v1/model/card_with_id.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Chat.V1.Model.CardWithId do @moduledoc """ - Widgets for Chat apps to specify. + A [card](https://developers.google.com/chat/api/reference/rest/v1/cards) in a Google Chat message. Only Chat apps can create cards. If your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the message can't contain cards. [Card builder](https://addons.gsuite.google.com/uikit/builder) ## Attributes - * `card` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card.t`, *default:* `nil`) - Card proto that allows Chat apps to specify UI elements and editable widgets. - * `cardId` (*type:* `String.t`, *default:* `nil`) - Required for `cardsV2` messages. Chat app-specified identifier for this widget. Scoped within a message. + * `card` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card.t`, *default:* `nil`) - A card. Maximum size is 32 KB. + * `cardId` (*type:* `String.t`, *default:* `nil`) - Required if the message contains multiple cards. A unique identifier for a card in a message. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/chat_client_data_source_markup.ex b/clients/chat/lib/google_api/chat/v1/model/chat_client_data_source_markup.ex new file mode 100644 index 0000000000..e1b17b78f6 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/chat_client_data_source_markup.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.ChatClientDataSourceMarkup do + @moduledoc """ + For a `SelectionInput` widget that uses a multiselect menu, a data source from Google Chat. The data source populates selection items for the multiselect menu. For example, a user can select Google Chat spaces that they're a member of. [Google Chat apps](https://developers.google.com/workspace/chat): + + ## Attributes + + * `spaceDataSource` (*type:* `GoogleApi.Chat.V1.Model.SpaceDataSource.t`, *default:* `nil`) - Google Chat spaces that the user is a member of. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :spaceDataSource => GoogleApi.Chat.V1.Model.SpaceDataSource.t() | nil + } + + field(:spaceDataSource, as: GoogleApi.Chat.V1.Model.SpaceDataSource) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.ChatClientDataSourceMarkup do + def decode(value, options) do + GoogleApi.Chat.V1.Model.ChatClientDataSourceMarkup.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.ChatClientDataSourceMarkup do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/color.ex b/clients/chat/lib/google_api/chat/v1/model/color.ex index d2c4ff9bd2..78dbcae2fa 100644 --- a/clients/chat/lib/google_api/chat/v1/model/color.ex +++ b/clients/chat/lib/google_api/chat/v1/model/color.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.Color do @moduledoc """ - Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ... + Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ... ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/common_event_object.ex b/clients/chat/lib/google_api/chat/v1/model/common_event_object.ex index 285147e6ab..434c5b3cd3 100644 --- a/clients/chat/lib/google_api/chat/v1/model/common_event_object.ex +++ b/clients/chat/lib/google_api/chat/v1/model/common_event_object.ex @@ -21,13 +21,13 @@ defmodule GoogleApi.Chat.V1.Model.CommonEventObject do ## Attributes - * `formInputs` (*type:* `%{optional(String.t) => GoogleApi.Chat.V1.Model.Inputs.t}`, *default:* `nil`) - A map containing the current values of the widgets in a card. The map keys are the string IDs assigned to each widget, and the values represent inputs to the widget. Depending on the input data type, a different object represents each input: For single-value widgets, `StringInput`. For multi-value widgets, an array of `StringInput` objects. For a date-time picker, a `DateTimeInput`. For a date-only picker, a `DateInput`. For a time-only picker, a `TimeInput`. Corresponds with the data entered by a user on a card in a [dialog](https://developers.google.com/chat/how-tos/dialogs). + * `formInputs` (*type:* `%{optional(String.t) => GoogleApi.Chat.V1.Model.Inputs.t}`, *default:* `nil`) - A map containing the values that a user inputs in a widget from a card or dialog. The map keys are the string IDs assigned to each widget, and the values represent inputs to the widget. For details, see [Process information inputted by users](https://developers.google.com/chat/ui/read-form-data). * `hostApp` (*type:* `String.t`, *default:* `nil`) - The hostApp enum which indicates the app the add-on is invoked from. Always `CHAT` for Chat apps. * `invokedFunction` (*type:* `String.t`, *default:* `nil`) - Name of the invoked function associated with the widget. Only set for Chat apps. * `parameters` (*type:* `map()`, *default:* `nil`) - Custom [parameters](/chat/api/reference/rest/v1/cards#ActionParameter) passed to the invoked function. Both keys and values must be strings. * `platform` (*type:* `String.t`, *default:* `nil`) - The platform enum which indicates the platform where the event originates (`WEB`, `IOS`, or `ANDROID`). Not supported by Chat apps. - * `timeZone` (*type:* `GoogleApi.Chat.V1.Model.TimeZone.t`, *default:* `nil`) - The timezone ID and offset from Coordinated Universal Time (UTC). - * `userLocale` (*type:* `String.t`, *default:* `nil`) - The full `locale.displayName` in the format of [ISO 639 language code]-[ISO 3166 country/region code] such as "en-US". Not supported by Chat apps. + * `timeZone` (*type:* `GoogleApi.Chat.V1.Model.TimeZone.t`, *default:* `nil`) - The timezone ID and offset from Coordinated Universal Time (UTC). Only supported for the event types [`CARD_CLICKED`](https://developers.google.com/chat/api/reference/rest/v1/EventType#ENUM_VALUES.CARD_CLICKED) and [`SUBMIT_DIALOG`](https://developers.google.com/chat/api/reference/rest/v1/DialogEventType#ENUM_VALUES.SUBMIT_DIALOG). + * `userLocale` (*type:* `String.t`, *default:* `nil`) - The full `locale.displayName` in the format of [ISO 639 language code]-[ISO 3166 country/region code] such as "en-US". """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/complete_import_space_request.ex b/clients/chat/lib/google_api/chat/v1/model/complete_import_space_request.ex new file mode 100644 index 0000000000..4ed120bf07 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/complete_import_space_request.ex @@ -0,0 +1,41 @@ +# 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.Chat.V1.Model.CompleteImportSpaceRequest do + @moduledoc """ + Request message for completing the import process for a space. + + ## Attributes + + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{} +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.CompleteImportSpaceRequest do + def decode(value, options) do + GoogleApi.Chat.V1.Model.CompleteImportSpaceRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.CompleteImportSpaceRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/complete_import_space_response.ex b/clients/chat/lib/google_api/chat/v1/model/complete_import_space_response.ex new file mode 100644 index 0000000000..290bee19b1 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/complete_import_space_response.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.CompleteImportSpaceResponse do + @moduledoc """ + + + ## Attributes + + * `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - The import mode space. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :space => GoogleApi.Chat.V1.Model.Space.t() | nil + } + + field(:space, as: GoogleApi.Chat.V1.Model.Space) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.CompleteImportSpaceResponse do + def decode(value, options) do + GoogleApi.Chat.V1.Model.CompleteImportSpaceResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.CompleteImportSpaceResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/custom_emoji.ex b/clients/chat/lib/google_api/chat/v1/model/custom_emoji.ex new file mode 100644 index 0000000000..1f64306732 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/custom_emoji.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.CustomEmoji do + @moduledoc """ + Represents a custom emoji. + + ## Attributes + + * `uid` (*type:* `String.t`, *default:* `nil`) - Unique key for the custom emoji resource. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :uid => String.t() | nil + } + + field(:uid) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.CustomEmoji do + def decode(value, options) do + GoogleApi.Chat.V1.Model.CustomEmoji.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.CustomEmoji do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/date_input.ex b/clients/chat/lib/google_api/chat/v1/model/date_input.ex index 8039ab1f16..315f85f376 100644 --- a/clients/chat/lib/google_api/chat/v1/model/date_input.ex +++ b/clients/chat/lib/google_api/chat/v1/model/date_input.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.DateInput do @moduledoc """ - Date input values. Not supported by Chat apps. + Date input values. ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/date_time_input.ex b/clients/chat/lib/google_api/chat/v1/model/date_time_input.ex index d6d2ca8d8b..dc9bd606be 100644 --- a/clients/chat/lib/google_api/chat/v1/model/date_time_input.ex +++ b/clients/chat/lib/google_api/chat/v1/model/date_time_input.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.DateTimeInput do @moduledoc """ - Date and time input values. Not supported by Chat apps. + Date and time input values. ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/deletion_metadata.ex b/clients/chat/lib/google_api/chat/v1/model/deletion_metadata.ex new file mode 100644 index 0000000000..83ef35f28e --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/deletion_metadata.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.DeletionMetadata do + @moduledoc """ + Information about a deleted message. A message is deleted when `delete_time` is set. + + ## Attributes + + * `deletionType` (*type:* `String.t`, *default:* `nil`) - Indicates who deleted the message. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :deletionType => String.t() | nil + } + + field(:deletionType) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.DeletionMetadata do + def decode(value, options) do + GoogleApi.Chat.V1.Model.DeletionMetadata.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.DeletionMetadata do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/deprecated_event.ex b/clients/chat/lib/google_api/chat/v1/model/deprecated_event.ex index d7ab9ea156..5325d468e0 100644 --- a/clients/chat/lib/google_api/chat/v1/model/deprecated_event.ex +++ b/clients/chat/lib/google_api/chat/v1/model/deprecated_event.ex @@ -17,22 +17,22 @@ defmodule GoogleApi.Chat.V1.Model.DeprecatedEvent do @moduledoc """ - Google Chat events. + A Google Chat app interaction event. To learn about interaction events, see [Receive and respond to interactions with your Google Chat app](https://developers.google.com/chat/api/guides/message-formats). To learn about event types and for example event payloads, see [Types of Google Chat app interaction events](https://developers.google.com/chat/api/guides/message-formats/events). ## Attributes - * `action` (*type:* `GoogleApi.Chat.V1.Model.FormAction.t`, *default:* `nil`) - The form action data associated with an interactive card that was clicked. Only populated for CARD_CLICKED events. See the [Interactive Cards guide](/chat/how-tos/cards-onclick) for more information. + * `action` (*type:* `GoogleApi.Chat.V1.Model.FormAction.t`, *default:* `nil`) - For `CARD_CLICKED` interaction events, the form action data associated when a user clicks a card or dialog. To learn more, see [Read form data input by users on cards](https://developers.google.com/chat/ui/read-form-data). * `common` (*type:* `GoogleApi.Chat.V1.Model.CommonEventObject.t`, *default:* `nil`) - Represents information about the user's client, such as locale, host app, and platform. For Chat apps, `CommonEventObject` includes information submitted by users interacting with [dialogs](https://developers.google.com/chat/how-tos/dialogs), like data entered on a card. - * `configCompleteRedirectUrl` (*type:* `String.t`, *default:* `nil`) - The URL the Chat app should redirect the user to after they have completed an authorization or configuration flow outside of Google Chat. See the [Authorizing access to 3p services guide](/chat/how-tos/auth-3p) for more information. - * `dialogEventType` (*type:* `String.t`, *default:* `nil`) - The type of [dialog](https://developers.google.com/chat/how-tos/dialogs) event received. - * `eventTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp indicating when the event occurred. - * `isDialogEvent` (*type:* `boolean()`, *default:* `nil`) - True when the event is related to [dialogs](https://developers.google.com/chat/how-tos/dialogs). - * `message` (*type:* `GoogleApi.Chat.V1.Model.Message.t`, *default:* `nil`) - The message that triggered the event, if applicable. - * `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - The space in which the event occurred. - * `threadKey` (*type:* `String.t`, *default:* `nil`) - The Chat app-defined key for the thread related to the event. See the thread_key field of the `spaces.message.create` request for more information. + * `configCompleteRedirectUrl` (*type:* `String.t`, *default:* `nil`) - The URL the Chat app should redirect the user to after they have completed an authorization or configuration flow outside of Google Chat. For more information, see [Connect a Chat app with other services & tools](https://developers.google.com/chat/how-tos/connect-web-services-tools). + * `dialogEventType` (*type:* `String.t`, *default:* `nil`) - The type of [dialog](https://developers.google.com/chat/how-tos/dialogs) interaction event received. + * `eventTime` (*type:* `DateTime.t`, *default:* `nil`) - The timestamp indicating when the interaction event occurred. + * `isDialogEvent` (*type:* `boolean()`, *default:* `nil`) - For `CARD_CLICKED` interaction events, whether the user interacted with a [dialog](https://developers.google.com/chat/how-tos/dialogs). + * `message` (*type:* `GoogleApi.Chat.V1.Model.Message.t`, *default:* `nil`) - The message that triggered the interaction event, if applicable. + * `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - The space in which the interaction event occurred. + * `threadKey` (*type:* `String.t`, *default:* `nil`) - The Chat app-defined key for the thread related to the interaction event. See [`spaces.messages.thread.threadKey`](/chat/api/reference/rest/v1/spaces.messages#Thread.FIELDS.thread_key) for more information. * `token` (*type:* `String.t`, *default:* `nil`) - A secret value that legacy Chat apps can use to verify if a request is from Google. Google randomly generates the token, and its value remains static. You can obtain, revoke, or regenerate the token from the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat) in the Google Cloud Console. Modern Chat apps don't use this field. It is absent from API responses and the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat). - * `type` (*type:* `String.t`, *default:* `nil`) - The type of the event. - * `user` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - The user that triggered the event. + * `type` (*type:* `String.t`, *default:* `nil`) - The type of interaction event. For details, see [Types of Google Chat app interaction events](https://developers.google.com/chat/api/guides/message-formats/events). + * `user` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - The user that triggered the interaction event. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/dialog.ex b/clients/chat/lib/google_api/chat/v1/model/dialog.ex index 24ff23c1d2..4dabacd17a 100644 --- a/clients/chat/lib/google_api/chat/v1/model/dialog.ex +++ b/clients/chat/lib/google_api/chat/v1/model/dialog.ex @@ -21,7 +21,7 @@ defmodule GoogleApi.Chat.V1.Model.Dialog do ## Attributes - * `body` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card.t`, *default:* `nil`) - Input only. Body of the dialog, which is rendered in a modal. Google Chat apps do not support the following card entities: `DateTimePicker`, `OnChangeAction`. + * `body` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card.t`, *default:* `nil`) - Input only. Body of the dialog, which is rendered in a modal. Google Chat apps don't support the following card entities: `DateTimePicker`, `OnChangeAction`. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/drive_data_ref.ex b/clients/chat/lib/google_api/chat/v1/model/drive_data_ref.ex index 7d651e3907..8b6dae5882 100644 --- a/clients/chat/lib/google_api/chat/v1/model/drive_data_ref.ex +++ b/clients/chat/lib/google_api/chat/v1/model/drive_data_ref.ex @@ -21,7 +21,7 @@ defmodule GoogleApi.Chat.V1.Model.DriveDataRef do ## Attributes - * `driveFileId` (*type:* `String.t`, *default:* `nil`) - The id for the drive file, for use with the Drive API. + * `driveFileId` (*type:* `String.t`, *default:* `nil`) - The ID for the drive file. Use with the Drive API. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/emoji.ex b/clients/chat/lib/google_api/chat/v1/model/emoji.ex new file mode 100644 index 0000000000..28ceca4a75 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/emoji.ex @@ -0,0 +1,49 @@ +# 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.Chat.V1.Model.Emoji do + @moduledoc """ + An emoji that is used as a reaction to a message. + + ## Attributes + + * `customEmoji` (*type:* `GoogleApi.Chat.V1.Model.CustomEmoji.t`, *default:* `nil`) - Output only. A custom emoji. + * `unicode` (*type:* `String.t`, *default:* `nil`) - A basic emoji represented by a unicode string. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :customEmoji => GoogleApi.Chat.V1.Model.CustomEmoji.t() | nil, + :unicode => String.t() | nil + } + + field(:customEmoji, as: GoogleApi.Chat.V1.Model.CustomEmoji) + field(:unicode) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.Emoji do + def decode(value, options) do + GoogleApi.Chat.V1.Model.Emoji.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.Emoji do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/emoji_reaction_summary.ex b/clients/chat/lib/google_api/chat/v1/model/emoji_reaction_summary.ex new file mode 100644 index 0000000000..fac0871ea6 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/emoji_reaction_summary.ex @@ -0,0 +1,49 @@ +# 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.Chat.V1.Model.EmojiReactionSummary do + @moduledoc """ + The number of people who reacted to a message with a specific emoji. + + ## Attributes + + * `emoji` (*type:* `GoogleApi.Chat.V1.Model.Emoji.t`, *default:* `nil`) - Emoji associated with the reactions. + * `reactionCount` (*type:* `integer()`, *default:* `nil`) - The total number of reactions using the associated emoji. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :emoji => GoogleApi.Chat.V1.Model.Emoji.t() | nil, + :reactionCount => integer() | nil + } + + field(:emoji, as: GoogleApi.Chat.V1.Model.Emoji) + field(:reactionCount) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.EmojiReactionSummary do + def decode(value, options) do + GoogleApi.Chat.V1.Model.EmojiReactionSummary.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.EmojiReactionSummary do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/form_action.ex b/clients/chat/lib/google_api/chat/v1/model/form_action.ex index 676b560fe6..60fb1a68d9 100644 --- a/clients/chat/lib/google_api/chat/v1/model/form_action.ex +++ b/clients/chat/lib/google_api/chat/v1/model/form_action.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.FormAction do @moduledoc """ - A form action describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. + A form action describes the behavior when the form is submitted. For example, you can invoke Apps Script to handle the form. ## Attributes - * `actionMethodName` (*type:* `String.t`, *default:* `nil`) - The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the Chat app as part of the card click event. The same method name can be used for several elements that trigger a common behavior if desired. + * `actionMethodName` (*type:* `String.t`, *default:* `nil`) - The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the Chat app as part of the card click event. You can use the same method name for several elements that trigger a common behavior. * `parameters` (*type:* `list(GoogleApi.Chat.V1.Model.ActionParameter.t)`, *default:* `nil`) - List of action parameters. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action.ex index b7481e4954..1d48d684a3 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action.ex @@ -17,15 +17,15 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action do @moduledoc """ - An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. + An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes * `function` (*type:* `String.t`, *default:* `nil`) - A custom function to invoke when the containing element is clicked or othrwise activated. For example usage, see [Create interactive cards](https://developers.google.com/chat/how-tos/cards-onclick). - * `interaction` (*type:* `String.t`, *default:* `nil`) - Optional. Required when opening a [dialog](https://developers.google.com/chat/how-tos/dialogs). What to do in response to an interaction with a user, such as a user clicking button on a card message. If unspecified, the app responds by executing an `action` - like opening a link or running a function - as normal. By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When specified, a loading indicator is not shown. Supported by Chat apps, but not Google Workspace Add-ons. If specified for an add-on, the entire card is stripped and nothing is shown in the client. + * `interaction` (*type:* `String.t`, *default:* `nil`) - Optional. Required when opening a [dialog](https://developers.google.com/chat/how-tos/dialogs). What to do in response to an interaction with a user, such as a user clicking a button in a card message. If unspecified, the app responds by executing an `action`—like opening a link or running a function—as normal. By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/chat/how-tos/dialogs). When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client. [Google Chat apps](https://developers.google.com/workspace/chat): * `loadIndicator` (*type:* `String.t`, *default:* `nil`) - Specifies the loading indicator that the action displays while making the call to the action. * `parameters` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1ActionParameter.t)`, *default:* `nil`) - List of action parameters. - * `persistValues` (*type:* `boolean()`, *default:* `nil`) - Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. When using [LoadIndicator.NONE](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for actions, `persist_values` = `true`is recommended, as it ensures that any changes made by the user after form or on change actions are sent to the server are not overwritten by the response. If `false`, the form values are cleared when the action is triggered. When `persist_values` is set to `false`, it is strongly recommended that the card use [LoadIndicator.SPINNER](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) for all actions, as this locks the UI to ensure no changes are made by the user while the action is being processed. Not supported by Chat apps. + * `persistValues` (*type:* `boolean()`, *default:* `nil`) - Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. To let the user make changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `NONE`. For [card messages](https://developers.google.com/chat/api/guides/v1/messages/create#create) in Chat apps, you must also set the action's [`ResponseType`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#responsetype) to `UPDATE_MESSAGE` and use the same [`card_id`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#CardWithId) from the card that contained the action. If `false`, the form values are cleared when the action is triggered. To prevent the user from making changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `SPINNER`. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action_parameter.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action_parameter.ex index 0d4fbdbece..c990bcf14d 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action_parameter.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_action_parameter.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1ActionParameter do @moduledoc """ - List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze 1 day, snooze next week. You might use action method = snooze(), passing the snooze type and snooze time in the list of string parameters. To learn more, see [CommonEventObject](https://developers.google.com/chat/api/reference/rest/v1/Event#commoneventobject). + List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze one day, or snooze next week. You might use `action method = snooze()`, passing the snooze type and snooze time in the list of string parameters. To learn more, see [`CommonEventObject`](https://developers.google.com/chat/api/reference/rest/v1/Event#commoneventobject). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_border_style.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_border_style.ex index 76bda549ae..8e6a4ff233 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_border_style.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_border_style.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1BorderStyle do @moduledoc """ - Represents the complete border style applied to items in a widget. + The style options for the border of a card or widget, including the border type and color. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button.ex index defeeb4e44..3619a097aa 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button.ex @@ -17,15 +17,15 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button do @moduledoc """ - A text, icon, or text + icon button that users can click. To make an image a clickable button, specify an Image (not an ImageComponent) and set an `onClick` action. + A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Button list](https://developers.google.com/chat/ui/widgets/button-list). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `altText` (*type:* `String.t`, *default:* `nil`) - The alternative text used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat". Has no effect when an icon is set; use `icon.alt_text` instead. - * `color` (*type:* `GoogleApi.Chat.V1.Model.Color.t`, *default:* `nil`) - If set, the button is filled with a solid background color and the font color changes to maintain contrast with the background color. For example, setting a blue background will likely result in white text. If unset, the image background is white and the font color is blue. For red, green and blue, the value of each field is a `float` number that can be expressed in either of two ways: as a number between 0 and 255 divided by 255 (153/255) or as a value between 0 and 1 (0.6). 0 represents the absence of a color and 1 or 255/255 represent the full presence of that color on the RGB scale. Optionally set alpha, which sets a level of transparency using this equation: ``` pixel color = alpha * (this color) + (1.0 - alpha) * (background color) ``` For alpha, a value of 1 corresponds with a solid color, and a value of 0 corresponds with a completely transparent color. For example, the following color represents a half transparent red: ``` "color": { "red": 1, "green": 0, "blue": 0, "alpha": 0.5 } ``` + * `altText` (*type:* `String.t`, *default:* `nil`) - The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat". + * `color` (*type:* `GoogleApi.Chat.V1.Model.Color.t`, *default:* `nil`) - If set, the button is filled with a solid background color and the font color changes to maintain contrast with the background color. For example, setting a blue background likely results in white text. If unset, the image background is white and the font color is blue. For red, green, and blue, the value of each field is a `float` number that you can express in either of two ways: as a number between 0 and 255 divided by 255 (153/255), or as a value between 0 and 1 (0.6). 0 represents the absence of a color and 1 or 255/255 represent the full presence of that color on the RGB scale. Optionally set `alpha`, which sets a level of transparency using this equation: ``` pixel color = alpha * (this color) + (1.0 - alpha) * (background color) ``` For `alpha`, a value of `1` corresponds with a solid color, and a value of `0` corresponds with a completely transparent color. For example, the following color represents a half transparent red: ``` "color": { "red": 1, "green": 0, "blue": 0, "alpha": 0.5 } ``` * `disabled` (*type:* `boolean()`, *default:* `nil`) - If `true`, the button is displayed in an inactive state and doesn't respond to user actions. - * `icon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - The icon image. If both `icon` and `text` are set, then the icon appears in place of the text. Support for both an icon and text is coming soon. - * `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - The action to perform when the button is clicked, such as opening a hyperlink or running a custom function. + * `icon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - The icon image. If both `icon` and `text` are set, then the icon appears before the text. + * `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - Required. The action to perform when a user clicks the button, such as opening a hyperlink or running a custom function. * `text` (*type:* `String.t`, *default:* `nil`) - The text displayed inside the button. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button_list.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button_list.ex index efb1529c96..5784f60e85 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button_list.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_button_list.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList do @moduledoc """ - A list of buttons layed out horizontally. + A list of buttons layed out horizontally. For an example in Google Chat apps, see [Button list](https://developers.google.com/chat/ui/widgets/button-list). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card.ex index 2d5577e4ce..0939efed5c 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card.ex @@ -17,17 +17,18 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card do @moduledoc """ - Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step. In Google Chat, cards appear in several places: - As stand-alone messages. - Accompanying a text message, just beneath the text message. - As a [dialog](https://developers.google.com/chat/how-tos/dialogs). The following example JSON creates a "contact card" that features: - A header with the contact's name, job title, avatar picture. - A section with the contact information, including formatted text. - Buttons that users can click to share the contact or see more or less info. ![Example contact card](https://developers.google.com/chat/images/card_api_reference.png) ``` { "cardsV2": [ { "cardId": "unique-card-id", "card": { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", "imageAltText": "Avatar for Sasha", }, "sections": [ { "header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount": 1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL", }, "text": "sasha@example.com", } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON", }, "text": "Online", }, }, { "decoratedText": { "startIcon": { "knownIcon": "PHONE", }, "text": "+1 (555) 555-1234", } }, { "buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": { "url": "https://example.com/share", } } }, { "text": "Edit", "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType", "value": "EDIT", } ], } } }, ], } }, ], }, ], }, } ], } ``` + A card interface displayed in a Google Chat message or Google Workspace Add-on. Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step. [Card builder](https://addons.gsuite.google.com/uikit/builder) To learn how to build cards, see the following documentation: * For Google Chat apps, see [Design dynamic, interactive, and consistent UIs with cards](https://developers.google.com/chat/ui). * For Google Workspace Add-ons, see [Card-based interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). **Example: Card message for a Google Chat app** ![Example contact card](https://developers.google.com/chat/images/card_api_reference.png) To create the sample card message in Google Chat, use the following JSON: ``` { "cardsV2": [ { "cardId": "unique-card-id", "card": { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", "imageAltText": "Avatar for Sasha" }, "sections": [ { "header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount": 1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL" }, "text": "sasha@example.com" } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON" }, "text": "Online" } }, { "decoratedText": { "startIcon": { "knownIcon": "PHONE" }, "text": "+1 (555) 555-1234" } }, { "buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": { "url": "https://example.com/share" } } }, { "text": "Edit", "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType", "value": "EDIT" } ] } } } ] } } ] } ] } } ] } ``` ## Attributes - * `cardActions` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardAction.t)`, *default:* `nil`) - The card's actions. Actions are added to the card's toolbar menu. Because Chat app cards have no toolbar, `cardActions[]` is not supported by Chat apps. For example, the following JSON constructs a card action menu with Settings and Send Feedback options: ``` "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] ``` - * `displayStyle` (*type:* `String.t`, *default:* `nil`) - In Google Workspace add-ons, sets the display properties of the `peekCardHeader`. Not supported by Chat apps. - * `fixedFooter` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardFixedFooter.t`, *default:* `nil`) - The fixed footer shown at the bottom of this card. Setting `fixedFooter` without specifying a `primaryButton` or a `secondaryButton` causes an error. Chat apps support `fixedFooter` in [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not in [card messages](https://developers.google.com/chat/api/guides/message-formats/cards). + * `cardActions` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardAction.t)`, *default:* `nil`) - The card's actions. Actions are added to the card's toolbar menu. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] ``` + * `displayStyle` (*type:* `String.t`, *default:* `nil`) - In Google Workspace Add-ons, sets the display properties of the `peekCardHeader`. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): + * `fixedFooter` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardFixedFooter.t`, *default:* `nil`) - The fixed footer shown at the bottom of this card. Setting `fixedFooter` without specifying a `primaryButton` or a `secondaryButton` causes an error. For Chat apps, you can use fixed footers in [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not [card messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): * `header` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader.t`, *default:* `nil`) - The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card. - * `name` (*type:* `String.t`, *default:* `nil`) - Name of the card. Used as a card identifier in card navigation. Because Chat apps don't support card navigation, they ignore this field. - * `peekCardHeader` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader.t`, *default:* `nil`) - When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards. Not supported by Chat apps. - * `sections` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Section.t)`, *default:* `nil`) - Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. + * `name` (*type:* `String.t`, *default:* `nil`) - Name of the card. Used as a card identifier in card navigation. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): + * `peekCardHeader` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader.t`, *default:* `nil`) - When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): + * `sectionDividerStyle` (*type:* `String.t`, *default:* `nil`) - The divider style between sections. + * `sections` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Section.t)`, *default:* `nil`) - Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see [Card section](https://developers.google.com/chat/ui/widgets/card-section). """ use GoogleApi.Gax.ModelBase @@ -39,6 +40,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card do :header => GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader.t() | nil, :name => String.t() | nil, :peekCardHeader => GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader.t() | nil, + :sectionDividerStyle => String.t() | nil, :sections => list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Section.t()) | nil } @@ -48,6 +50,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card do field(:header, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader) field(:name) field(:peekCardHeader, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader) + field(:sectionDividerStyle) field(:sections, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Section, type: :list) end diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_action.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_action.ex index a15d546b2c..8d38ea480e 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_action.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_action.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardAction do @moduledoc """ - A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser. Not supported by Chat apps. + A card action is the action associated with the card. For example, an invoice card might include actions such as delete invoice, email invoice, or open the invoice in a browser. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_fixed_footer.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_fixed_footer.ex index 91f5c88473..d41da1acbb 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_fixed_footer.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_fixed_footer.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardFixedFooter do @moduledoc """ - A persistent (sticky) footer that that appears at the bottom of the card. Setting `fixedFooter` without specifying a `primaryButton` or a `secondaryButton` causes an error. Chat apps support `fixedFooter` in [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not in [card messages](https://developers.google.com/chat/api/guides/message-formats/cards). + A persistent (sticky) footer that that appears at the bottom of the card. Setting `fixedFooter` without specifying a `primaryButton` or a `secondaryButton` causes an error. For Chat apps, you can use fixed footers in [dialogs](https://developers.google.com/chat/how-tos/dialogs), but not [card messages](https://developers.google.com/chat/api/guides/v1/messages/create#create). For an example in Google Chat apps, see [Card footer](https://developers.google.com/chat/ui/widgets/card-fixed-footer). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes * `primaryButton` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button.t`, *default:* `nil`) - The primary button of the fixed footer. The button must be a text button with text and color set. - * `secondaryButton` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button.t`, *default:* `nil`) - The secondary button of the fixed footer. The button must be a text button with text and color set. `primaryButton` must be set if `secondaryButton` is set. + * `secondaryButton` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button.t`, *default:* `nil`) - The secondary button of the fixed footer. The button must be a text button with text and color set. If `secondaryButton` is set, you must also set `primaryButton`. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_header.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_header.ex index 1fbc5b2bdd..9e09d56f38 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_header.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_card_header.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1CardHeader do @moduledoc """ - Represents a card header. + Represents a card header. For an example in Google Chat apps, see [Card header](https://developers.google.com/chat/ui/widgets/card-header). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `imageAltText` (*type:* `String.t`, *default:* `nil`) - The alternative text of this image which is used for accessibility. - * `imageType` (*type:* `String.t`, *default:* `nil`) - The shape used to crop the image. + * `imageAltText` (*type:* `String.t`, *default:* `nil`) - The alternative text of this image that's used for accessibility. + * `imageType` (*type:* `String.t`, *default:* `nil`) - The shape used to crop the image. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): * `imageUrl` (*type:* `String.t`, *default:* `nil`) - The HTTPS URL of the image in the card header. * `subtitle` (*type:* `String.t`, *default:* `nil`) - The subtitle of the card header. If specified, appears on its own line below the `title`. * `title` (*type:* `String.t`, *default:* `nil`) - Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines. diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_column.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_column.ex new file mode 100644 index 0000000000..77041cda38 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_column.ex @@ -0,0 +1,55 @@ +# 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.Chat.V1.Model.GoogleAppsCardV1Column do + @moduledoc """ + A column. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): Columns for Google Workspace Add-ons are in Developer Preview. + + ## Attributes + + * `horizontalAlignment` (*type:* `String.t`, *default:* `nil`) - Specifies whether widgets align to the left, right, or center of a column. + * `horizontalSizeStyle` (*type:* `String.t`, *default:* `nil`) - Specifies how a column fills the width of the card. + * `verticalAlignment` (*type:* `String.t`, *default:* `nil`) - Specifies whether widgets align to the top, bottom, or center of a column. + * `widgets` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widgets.t)`, *default:* `nil`) - An array of widgets included in a column. Widgets appear in the order that they are specified. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :horizontalAlignment => String.t() | nil, + :horizontalSizeStyle => String.t() | nil, + :verticalAlignment => String.t() | nil, + :widgets => list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widgets.t()) | nil + } + + field(:horizontalAlignment) + field(:horizontalSizeStyle) + field(:verticalAlignment) + field(:widgets, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widgets, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Column do + def decode(value, options) do + GoogleApi.Chat.V1.Model.GoogleAppsCardV1Column.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Column do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_columns.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_columns.ex new file mode 100644 index 0000000000..4206d4215c --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_columns.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.GoogleAppsCardV1Columns do + @moduledoc """ + The `Columns` widget displays up to 2 columns in a card or dialog. You can add widgets to each column; the widgets appear in the order that they are specified. For an example in Google Chat apps, see [Columns](https://developers.google.com/chat/ui/widgets/columns). The height of each column is determined by the taller column. For example, if the first column is taller than the second column, both columns have the height of the first column. Because each column can contain a different number of widgets, you can't define rows or align widgets between the columns. Columns are displayed side-by-side. You can customize the width of each column using the `HorizontalSizeStyle` field. If the user's screen width is too narrow, the second column wraps below the first: * On web, the second column wraps if the screen width is less than or equal to 480 pixels. * On iOS devices, the second column wraps if the screen width is less than or equal to 300 pt. * On Android devices, the second column wraps if the screen width is less than or equal to 320 dp. To include more than 2 columns, or to use rows, use the `Grid` widget. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): Columns for Google Workspace Add-ons are in Developer Preview. + + ## Attributes + + * `columnItems` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Column.t)`, *default:* `nil`) - An array of columns. You can include up to 2 columns in a card or dialog. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :columnItems => list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Column.t()) | nil + } + + field(:columnItems, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Column, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Columns do + def decode(value, options) do + GoogleApi.Chat.V1.Model.GoogleAppsCardV1Columns.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Columns do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_date_time_picker.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_date_time_picker.ex index 08af06a527..43894fce3e 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_date_time_picker.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_date_time_picker.ex @@ -17,16 +17,16 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker do @moduledoc """ - Lets users specify a date, a time, or both a date and a time. Accepts text input from users, but features an interactive date and time selector that helps users enter correctly-formatted dates and times. If users enter a date or time incorrectly, the widget shows an error that prompts users to enter the correct format. Not supported by Chat apps. Support by Chat apps coming soon. + Lets users input a date, a time, or both a date and a time. For an example in Google Chat apps, see [Date time picker](https://developers.google.com/chat/ui/widgets/date-time-picker). Users can input text or use the picker to select dates and times. If users input an invalid date or time, the picker shows an error that prompts users to input the information correctly. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `label` (*type:* `String.t`, *default:* `nil`) - The text that prompts users to enter a date, time, or datetime. Specify text that helps the user enter the information your app needs. For example, if users are setting an appointment, then a label like "Appointment date" or "Appointment date and time" might work well. - * `name` (*type:* `String.t`, *default:* `nil`) - The name by which the datetime picker is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). - * `onChangeAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - Triggered when the user clicks **Save** or **Clear** from the datetime picker interface. - * `timezoneOffsetDate` (*type:* `integer()`, *default:* `nil`) - The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If not set, it uses the user's time zone setting on the client side. - * `type` (*type:* `String.t`, *default:* `nil`) - What kind of date and time input the datetime picker supports. - * `valueMsEpoch` (*type:* `String.t`, *default:* `nil`) - The value displayed as the default value before user input or previous user input, represented in milliseconds ([Epoch time](https://en.wikipedia.org/wiki/Unix_time)). For `DATE_AND_TIME` type, the full epoch value is used. For `DATE_ONLY` type, only date of the epoch time is used. For `TIME_ONLY` type, only time of the epoch time is used. For example, to represent 3:00 AM, set epoch time to `3 * 60 * 60 * 1000`. + * `label` (*type:* `String.t`, *default:* `nil`) - The text that prompts users to input a date, a time, or a date and time. For example, if users are scheduling an appointment, use a label such as `Appointment date` or `Appointment date and time`. + * `name` (*type:* `String.t`, *default:* `nil`) - The name by which the `DateTimePicker` is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). + * `onChangeAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - Triggered when the user clicks **Save** or **Clear** from the `DateTimePicker` interface. + * `timezoneOffsetDate` (*type:* `integer()`, *default:* `nil`) - The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If unset, the value defaults to the user's time zone setting. + * `type` (*type:* `String.t`, *default:* `nil`) - Whether the widget supports inputting a date, a time, or the date and time. + * `valueMsEpoch` (*type:* `String.t`, *default:* `nil`) - The default value displayed in the widget, in milliseconds since [Unix epoch time](https://en.wikipedia.org/wiki/Unix_time). Specify the value based on the type of picker (`DateTimePickerType`): * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use `1672531200000`. * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use `43200000` (or `12 * 60 * 60 * 1000`). """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_decorated_text.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_decorated_text.ex index 69c34052a9..d8f9e963d4 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_decorated_text.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_decorated_text.ex @@ -17,19 +17,19 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText do @moduledoc """ - A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget or a button after the text. + A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget, or a button after the text. For an example in Google Chat apps, see [Decorated text](https://developers.google.com/chat/ui/widgets/decorated-text). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `bottomLabel` (*type:* `String.t`, *default:* `nil`) - The text that appears below `text`. Always truncates. Supports simple formatting. See Text formatting for formatting details. - * `button` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button.t`, *default:* `nil`) - A button that can be clicked to trigger an action. - * `endIcon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - An icon displayed after the text. Supports [standard](https://developers.google.com/chat/api/guides/message-formats/cards#builtinicons) and [custom](https://developers.google.com/chat/api/guides/message-formats/cards#customicons) icons. + * `bottomLabel` (*type:* `String.t`, *default:* `nil`) - The text that appears below `text`. Always wraps. + * `button` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Button.t`, *default:* `nil`) - A button that a user can click to trigger an action. + * `endIcon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - An icon displayed after the text. Supports [built-in](https://developers.google.com/chat/format-messages#builtinicons) and [custom](https://developers.google.com/chat/format-messages#customicons) icons. * `icon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - Deprecated in favor of `startIcon`. - * `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - When users click on `topLabel` or `bottomLabel`, this action triggers. + * `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - This action is triggered when users click `topLabel` or `bottomLabel`. * `startIcon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon.t`, *default:* `nil`) - The icon displayed in front of the text. - * `switchControl` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1SwitchControl.t`, *default:* `nil`) - A switch widget can be clicked to change its state and trigger an action. Currently supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) is coming soon. - * `text` (*type:* `String.t`, *default:* `nil`) - Required. The primary text. Supports simple formatting. See Text formatting for formatting details. - * `topLabel` (*type:* `String.t`, *default:* `nil`) - The text that appears above `text`. Always truncates. Supports simple formatting. See Text formatting for formatting details. + * `switchControl` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1SwitchControl.t`, *default:* `nil`) - A switch widget that a user can click to change its state and trigger an action. + * `text` (*type:* `String.t`, *default:* `nil`) - Required. The primary text. Supports simple formatting. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * `topLabel` (*type:* `String.t`, *default:* `nil`) - The text that appears above `text`. Always truncates. * `wrapText` (*type:* `boolean()`, *default:* `nil`) - The wrap text setting. If `true`, the text wraps and displays on multiple lines. Otherwise, the text is truncated. Only applies to `text`, not `topLabel` and `bottomLabel`. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_divider.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_divider.ex index 28d559a11f..12ebd0a7ab 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_divider.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_divider.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Divider do @moduledoc """ - Displays a divider between widgets, a horizontal line. For example, the following JSON creates a divider: ``` "divider": { } ``` + Displays a divider between widgets as a horizontal line. For an example in Google Chat apps, see [Divider](https://developers.google.com/chat/ui/widgets/divider). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): For example, the following JSON creates a divider: ``` "divider": {} ``` ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid.ex index 3c5ebb832b..2b11643f11 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Grid do @moduledoc """ - Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. Currently supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) is coming soon. For example, the following JSON creates a 2 column grid with a single item: ``` "grid": { "title": "A fine collection of items", "numColumns": 2, "borderStyle": { "type": "STROKE", "cornerRadius": 4.0 }, "items": [ "image": { "imageUri": "https://www.example.com/image.png", "cropStyle": { "type": "SQUARE" }, "borderStyle": { "type": "STROKE" } }, "title": "An item", "textAlignment": "CENTER" ], "onClick": { "openLink": { "url":"https://www.example.com" } } } ``` + Displays a grid with a collection of items. Items can only include text or images. For responsive columns, or to include more than text or images, use `Columns`. For an example in Google Chat apps, see [Grid](https://developers.google.com/chat/ui/widgets/grid). A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): For example, the following JSON creates a 2 column grid with a single item: ``` "grid": { "title": "A fine collection of items", "columnCount": 2, "borderStyle": { "type": "STROKE", "cornerRadius": 4 }, "items": [ { "image": { "imageUri": "https://www.example.com/image.png", "cropStyle": { "type": "SQUARE" }, "borderStyle": { "type": "STROKE" } }, "title": "An item", "textAlignment": "CENTER" } ], "onClick": { "openLink": { "url": "https://www.example.com" } } } ``` ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid_item.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid_item.ex index 2e51d4dc9d..d53746066b 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid_item.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_grid_item.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1GridItem do @moduledoc """ - Represents a single item in the grid layout. + Represents an item in a grid layout. Items can contain text, an image, or both text and an image. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `id` (*type:* `String.t`, *default:* `nil`) - A user-specified identifier for this grid item. This identifier is returned in the parent Grid's onClick callback parameters. + * `id` (*type:* `String.t`, *default:* `nil`) - A user-specified identifier for this grid item. This identifier is returned in the parent grid's `onClick` callback parameters. * `image` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1ImageComponent.t`, *default:* `nil`) - The image that displays in the grid item. * `layout` (*type:* `String.t`, *default:* `nil`) - The layout to use for the grid item. * `subtitle` (*type:* `String.t`, *default:* `nil`) - The grid item's subtitle. diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_icon.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_icon.ex index b86557a42d..6c61b429a4 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_icon.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_icon.ex @@ -17,14 +17,14 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon do @moduledoc """ - An icon displayed in a widget on a card. Supports [standard](https://developers.google.com/chat/api/guides/message-formats/cards) and [custom](https://developers.google.com/chat/api/guides/message-formats/cards#customicons) icons. + An icon displayed in a widget on a card. For an example in Google Chat apps, see [Icon](https://developers.google.com/chat/ui/widgets/icon). Supports [built-in](https://developers.google.com/chat/format-messages#builtinicons) and [custom](https://developers.google.com/chat/format-messages#customicons) icons. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `altText` (*type:* `String.t`, *default:* `nil`) - Optional. A description of the icon used for accessibility. If unspecified, a default value is provided. As a best practice, you should set a helpful description. For example, if an icon displays a user's account portrait, you could describe it as "A user's account portrait." If the icon displays in a Button, this alt text takes precedence and overwrites the button's alt text, so you should write alt text for the button: Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat". + * `altText` (*type:* `String.t`, *default:* `nil`) - Optional. A description of the icon used for accessibility. If unspecified, the default value `Button` is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, `A user's account portrait`, or `Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/chat`. If the icon is set in a `Button`, the `altText` appears as helper text when the user hovers over the button. However, if the button also sets `text`, the icon's `altText` is ignored. * `iconUrl` (*type:* `String.t`, *default:* `nil`) - Display a custom icon hosted at an HTTPS URL. For example: ``` "iconUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png" ``` Supported file types include `.png` and `.jpg`. - * `imageType` (*type:* `String.t`, *default:* `nil`) - The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a standard icon. - * `knownIcon` (*type:* `String.t`, *default:* `nil`) - Display one of the standard icons provided by Google Workspace. For example, to display an airplane icon, specify `AIRPLANE`. For a bus, specify `BUS`. For a full list of supported icons, see [standard icons](https://developers.google.com/chat/api/guides/message-formats/cards). + * `imageType` (*type:* `String.t`, *default:* `nil`) - The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a built-in icon. + * `knownIcon` (*type:* `String.t`, *default:* `nil`) - Display one of the built-in icons provided by Google Workspace. For example, to display an airplane icon, specify `AIRPLANE`. For a bus, specify `BUS`. For a full list of supported icons, see [built-in icons](https://developers.google.com/chat/format-messages#builtinicons). """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image.ex index 99157f7217..b04a1f2a3e 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image.ex @@ -17,13 +17,13 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image do @moduledoc """ - An image that is specified by a URL and can have an `onClick` action. + An image that is specified by a URL and can have an `onClick` action. For an example, see [Image](https://developers.google.com/chat/ui/widgets/image). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `altText` (*type:* `String.t`, *default:* `nil`) - The alternative text of this image, used for accessibility. - * `imageUrl` (*type:* `String.t`, *default:* `nil`) - The `https` URL that hosts the image. For example: ``` https://developers.google.com/chat/images/quickstart-app-avatar.png ``` - * `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - When a user clicks on the image, the click triggers this action. + * `altText` (*type:* `String.t`, *default:* `nil`) - The alternative text of this image that's used for accessibility. + * `imageUrl` (*type:* `String.t`, *default:* `nil`) - The HTTPS URL that hosts the image. For example: ``` https://developers.google.com/chat/images/quickstart-app-avatar.png ``` + * `onClick` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick.t`, *default:* `nil`) - When a user clicks the image, the click triggers this action. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_component.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_component.ex index 56ed48195e..d498b1c48c 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_component.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_component.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1ImageComponent do @moduledoc """ - Represents an image. + Represents an image. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_crop_style.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_crop_style.ex index fcfe43b4bf..e52fc079ef 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_crop_style.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_image_crop_style.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1ImageCropStyle do @moduledoc """ - Represents the crop style applied to an image. For example, here's how to apply a 16 by 9 aspect ratio: ``` cropStyle { "type": "RECTANGLE_CUSTOM", "aspectRatio": 16/9 } ``` + Represents the crop style applied to an image. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): For example, here's how to apply a 16:9 aspect ratio: ``` cropStyle { "type": "RECTANGLE_CUSTOM", "aspectRatio": 16/9 } ``` ## Attributes - * `aspectRatio` (*type:* `float()`, *default:* `nil`) - The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. For example, here's how to apply a 16 by 9 aspect ratio: ``` cropStyle { "type": "RECTANGLE_CUSTOM", "aspectRatio": 16/9 } ``` + * `aspectRatio` (*type:* `float()`, *default:* `nil`) - The aspect ratio to use if the crop type is `RECTANGLE_CUSTOM`. For example, here's how to apply a 16:9 aspect ratio: ``` cropStyle { "type": "RECTANGLE_CUSTOM", "aspectRatio": 16/9 } ``` * `type` (*type:* `String.t`, *default:* `nil`) - The crop type. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_on_click.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_on_click.ex index 70ad7e023c..bc5f97e833 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_on_click.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_on_click.ex @@ -17,13 +17,13 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1OnClick do @moduledoc """ - Represents how to respond when users click an interactive element on a card, such as a button. + Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes * `action` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - If specified, an action is triggered by this `onClick`. - * `card` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card.t`, *default:* `nil`) - A new card is pushed to the card stack after clicking if specified. Supported by Google Workspace Add-ons, but not Chat apps. - * `openDynamicLinkAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - An add-on triggers this action when the action needs to open a link. This differs from the `open_link` above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back. + * `card` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Card.t`, *default:* `nil`) - A new card is pushed to the card stack after clicking if specified. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): + * `openDynamicLinkAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - An add-on triggers this action when the action needs to open a link. This differs from the `open_link` above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): * `openLink` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1OpenLink.t`, *default:* `nil`) - If specified, this `onClick` triggers an open link action. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_open_link.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_open_link.ex index 8f73f4aae2..1a34e428da 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_open_link.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_open_link.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1OpenLink do @moduledoc """ - Represents an `onClick` event that opens a hyperlink. + Represents an `onClick` event that opens a hyperlink. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `onClose` (*type:* `String.t`, *default:* `nil`) - Whether the client forgets about a link after opening it, or observes it until the window closes. Not supported by Chat apps. - * `openAs` (*type:* `String.t`, *default:* `nil`) - How to open a link. Not supported by Chat apps. + * `onClose` (*type:* `String.t`, *default:* `nil`) - Whether the client forgets about a link after opening it, or observes it until the window closes. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): + * `openAs` (*type:* `String.t`, *default:* `nil`) - How to open a link. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): * `url` (*type:* `String.t`, *default:* `nil`) - The URL to open. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_platform_data_source.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_platform_data_source.ex new file mode 100644 index 0000000000..f987e8f690 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_platform_data_source.ex @@ -0,0 +1,49 @@ +# 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.Chat.V1.Model.GoogleAppsCardV1PlatformDataSource do + @moduledoc """ + For a `SelectionInput` widget that uses a multiselect menu, a data source from Google Workspace. Used to populate items in a multiselect menu. [Google Chat apps](https://developers.google.com/workspace/chat): + + ## Attributes + + * `commonDataSource` (*type:* `String.t`, *default:* `nil`) - A data source shared by all Google Workspace applications, such as users in a Google Workspace organization. + * `hostAppDataSource` (*type:* `GoogleApi.Chat.V1.Model.HostAppDataSourceMarkup.t`, *default:* `nil`) - A data source that's unique to a Google Workspace host application, such spaces in Google Chat. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :commonDataSource => String.t() | nil, + :hostAppDataSource => GoogleApi.Chat.V1.Model.HostAppDataSourceMarkup.t() | nil + } + + field(:commonDataSource) + field(:hostAppDataSource, as: GoogleApi.Chat.V1.Model.HostAppDataSourceMarkup) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1PlatformDataSource do + def decode(value, options) do + GoogleApi.Chat.V1.Model.GoogleAppsCardV1PlatformDataSource.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1PlatformDataSource do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_section.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_section.ex index 8cc7a6a838..8549c490a3 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_section.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_section.ex @@ -17,14 +17,14 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Section do @moduledoc """ - A section contains a collection of widgets that are rendered vertically in the order that they are specified. + A section contains a collection of widgets that are rendered vertically in the order that they're specified. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes * `collapsible` (*type:* `boolean()`, *default:* `nil`) - Indicates whether this section is collapsible. Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking **Show more**. Users can hide the widgets again by clicking **Show less**. To determine which widgets are hidden, specify `uncollapsibleWidgetsCount`. - * `header` (*type:* `String.t`, *default:* `nil`) - Text that appears at the top of a section. Supports [simple HTML formatted text](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * `header` (*type:* `String.t`, *default:* `nil`) - Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). * `uncollapsibleWidgetsCount` (*type:* `integer()`, *default:* `nil`) - The number of uncollapsible widgets which remain visible even when a section is collapsed. For example, when a section contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, the first two widgets are always shown and the last three are collapsed by default. The `uncollapsibleWidgetsCount` is taken into account only when `collapsible` is `true`. - * `widgets` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widget.t)`, *default:* `nil`) - All the widgets in the section. Must contain at least 1 widget. + * `widgets` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widget.t)`, *default:* `nil`) - All the widgets in the section. Must contain at least one widget. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_input.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_input.ex index d632b3ed17..fef8b07b4b 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_input.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_input.ex @@ -17,31 +17,44 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput do @moduledoc """ - A widget that creates a UI item with options for users to select. For example, a dropdown menu or check list. Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). When you need to collect data from users that matches options you set, use a selection input. To collect abstract data from users, use the text input widget instead. Only supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) coming soon. + A widget that creates one or more UI items that users can select. For example, a dropdown menu or checkboxes. You can use this widget to collect data that can be predicted or enumerated. For an example in Google Chat apps, see [Selection input](https://developers.google.com/chat/ui/widgets/selection-input). Chat apps can process the value of items that users select or input. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). To collect undefined or abstract data from users, use the TextInput widget. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `items` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem.t)`, *default:* `nil`) - An array of the selected items. For example, all the selected check boxes. + * `externalDataSource` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - An external data source, such as a relational data base. + * `items` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem.t)`, *default:* `nil`) - An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items. * `label` (*type:* `String.t`, *default:* `nil`) - The text that appears above the selection input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if users are selecting the urgency of a work ticket from a drop-down menu, the label might be "Urgency" or "Select urgency". - * `name` (*type:* `String.t`, *default:* `nil`) - The name by which the selection input is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). - * `onChangeAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button that submits the form. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). - * `type` (*type:* `String.t`, *default:* `nil`) - The way that an option appears to users. Different options support different types of interactions. For example, users can enable multiple check boxes, but can only select one value from a dropdown menu. Each selection input supports one type of selection. Mixing check boxes and switches, for example, is not supported. + * `multiSelectMaxSelectedItems` (*type:* `integer()`, *default:* `nil`) - For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items. + * `multiSelectMinQueryLength` (*type:* `integer()`, *default:* `nil`) - For multiselect menus, the number of text characters that a user inputs before the Chat app queries autocomplete and displays suggested items in the menu. If unspecified, defaults to 0 characters for static data sources and 3 characters for external data sources. + * `name` (*type:* `String.t`, *default:* `nil`) - The name that identifies the selection input in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). + * `onChangeAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button that submits the form. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). + * `platformDataSource` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1PlatformDataSource.t`, *default:* `nil`) - A data source from Google Workspace. + * `type` (*type:* `String.t`, *default:* `nil`) - The type of items that are displayed to users in a `SelectionInput` widget. Selection types support different types of interactions. For example, users can select one or more checkboxes, but they can only select one value from a dropdown menu. """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ + :externalDataSource => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t() | nil, :items => list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem.t()) | nil, :label => String.t() | nil, + :multiSelectMaxSelectedItems => integer() | nil, + :multiSelectMinQueryLength => integer() | nil, :name => String.t() | nil, :onChangeAction => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t() | nil, + :platformDataSource => + GoogleApi.Chat.V1.Model.GoogleAppsCardV1PlatformDataSource.t() | nil, :type => String.t() | nil } + field(:externalDataSource, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action) field(:items, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem, type: :list) field(:label) + field(:multiSelectMaxSelectedItems) + field(:multiSelectMinQueryLength) field(:name) field(:onChangeAction, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action) + field(:platformDataSource, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1PlatformDataSource) field(:type) end diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_item.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_item.ex index c8d281ab15..dd2033e032 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_item.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_selection_item.ex @@ -17,24 +17,30 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem do @moduledoc """ - A selectable item in a selection input, such as a check box or a switch. + An item that users can select in a selection input, such as a checkbox or switch. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `selected` (*type:* `boolean()`, *default:* `nil`) - When `true`, more than one item is selected. If more than one item is selected for radio buttons and dropdown menus, the first selected item is received and the ones after are ignored. - * `text` (*type:* `String.t`, *default:* `nil`) - The text displayed to users. - * `value` (*type:* `String.t`, *default:* `nil`) - The value associated with this item. The client should use this as a form input value. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). + * `bottomText` (*type:* `String.t`, *default:* `nil`) - For multiselect menus, a text description or label that's displayed below the item's `text` field. + * `selected` (*type:* `boolean()`, *default:* `nil`) - Whether the item is selected by default. If the selection input only accepts one value (such as for radio buttons or a dropdown menu), only set this field for one item. + * `startIconUri` (*type:* `String.t`, *default:* `nil`) - For multiselect menus, the URL for the icon displayed next to the item's `text` field. Supports PNG and JPEG files. Must be an `HTTPS` URL. For example, `https://developers.google.com/chat/images/quickstart-app-avatar.png`. + * `text` (*type:* `String.t`, *default:* `nil`) - The text that identifies or describes the item to users. + * `value` (*type:* `String.t`, *default:* `nil`) - The value associated with this item. The client should use this as a form input value. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ + :bottomText => String.t() | nil, :selected => boolean() | nil, + :startIconUri => String.t() | nil, :text => String.t() | nil, :value => String.t() | nil } + field(:bottomText) field(:selected) + field(:startIconUri) field(:text) field(:value) end diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestion_item.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestion_item.ex index 28beb1b004..78bf161d23 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestion_item.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestion_item.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1SuggestionItem do @moduledoc """ - One suggested value that users can enter in a text input field. + One suggested value that users can enter in a text input field. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `text` (*type:* `String.t`, *default:* `nil`) - The value of a suggested input to a text input field. This is equivalent to what users would enter themselves. + * `text` (*type:* `String.t`, *default:* `nil`) - The value of a suggested input to a text input field. This is equivalent to what users enter themselves. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestions.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestions.ex index 28212b6925..afdb580dde 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestions.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_suggestions.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Suggestions do @moduledoc """ - Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed. For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing "Jav", the list of suggestions filters to show just Java and JavaScript. Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter "javascript" and others "java script". Suggesting "JavaScript" can standardize how users interact with your app. When specified, `TextInput.type` is always `SINGLE_LINE`, even if it is set to `MULTIPLE_LINE`. + Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed. For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing `Jav`, the list of suggestions filters to show `Java` and `JavaScript`. Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter `javascript` and others `java script`. Suggesting `JavaScript` can standardize how users interact with your app. When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set to `MULTIPLE_LINE`. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_switch_control.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_switch_control.ex index 581e242c5f..9c773fa07f 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_switch_control.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_switch_control.ex @@ -17,15 +17,15 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1SwitchControl do @moduledoc """ - Either a toggle-style switch or a checkbox inside a `decoratedText` widget. Only supported on the `decoratedText` widget. Currently supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) is coming soon. + Either a toggle-style switch or a checkbox inside a `decoratedText` widget. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): Only supported in the `decoratedText` widget. ## Attributes - * `controlType` (*type:* `String.t`, *default:* `nil`) - How the switch appears in the user interface. - * `name` (*type:* `String.t`, *default:* `nil`) - The name by which the switch widget is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). + * `controlType` (*type:* `String.t`, *default:* `nil`) - How the switch appears in the user interface. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): + * `name` (*type:* `String.t`, *default:* `nil`) - The name by which the switch widget is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). * `onChangeAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - The action to perform when the switch state is changed, such as what function to run. * `selected` (*type:* `boolean()`, *default:* `nil`) - When `true`, the switch is selected. - * `value` (*type:* `String.t`, *default:* `nil`) - The value entered by a user, returned as part of a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). + * `value` (*type:* `String.t`, *default:* `nil`) - The value entered by a user, returned as part of a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_input.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_input.ex index 4a3bd02a66..654fbf1dc0 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_input.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_input.ex @@ -17,18 +17,19 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput do @moduledoc """ - A field in which users can enter text. Supports suggestions and on-change actions. Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). When you need to collect abstract data from users, use a text input. To collect defined data from users, use the selection input widget instead. Only supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) coming soon. + A field in which users can enter text. Supports suggestions and on-change actions. For an example in Google Chat apps, see [Text input](https://developers.google.com/chat/ui/widgets/text-input). Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). When you need to collect undefined or abstract data from users, use a text input. To collect defined or enumerated data from users, use the SelectionInput widget. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes - * `autoCompleteAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - Optional. Specify what action to take when the text input field provides suggestions to users who interact with it. If unspecified, the suggestions are set by `initialSuggestions` and are processed by the client. If specified, the app takes the action specified here, such as running a custom function. Supported by Google Workspace Add-ons, but not Chat apps. Support by Chat apps coming soon. - * `hintText` (*type:* `String.t`, *default:* `nil`) - Text that appears inside the text input field meant to assist users by prompting them to enter a certain value. This text is not visible after users begin typing. Required if `label` is unspecified. Otherwise, optional. - * `initialSuggestions` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Suggestions.t`, *default:* `nil`) - Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed. For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing "Jav", the list of suggestions filters to show just Java and JavaScript. Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter "javascript" and others "java script". Suggesting "JavaScript" can standardize how users interact with your app. When specified, `TextInput.type` is always `SINGLE_LINE`, even if it is set to `MULTIPLE_LINE`. - * `label` (*type:* `String.t`, *default:* `nil`) - The text that appears above the text input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if you are asking someone's name, but specifically need their surname, write "surname" instead of "name". Required if `hintText` is unspecified. Otherwise, optional. - * `name` (*type:* `String.t`, *default:* `nil`) - The name by which the text input is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). - * `onChangeAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - What to do when a change occurs in the text input field. Examples of changes include a user adding to the field, or deleting text. Examples of actions to take include running a custom function or opening a [dialog](https://developers.google.com/chat/how-tos/dialogs) in Google Chat. + * `autoCompleteAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - Optional. Specify what action to take when the text input field provides suggestions to users who interact with it. If unspecified, the suggestions are set by `initialSuggestions` and are processed by the client. If specified, the app takes the action specified here, such as running a custom function. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): + * `hintText` (*type:* `String.t`, *default:* `nil`) - Text that appears below the text input field meant to assist users by prompting them to enter a certain value. This text is always visible. Required if `label` is unspecified. Otherwise, optional. + * `initialSuggestions` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Suggestions.t`, *default:* `nil`) - Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed. For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing `Jav`, the list of suggestions filters to show just `Java` and `JavaScript`. Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter `javascript` and others `java script`. Suggesting `JavaScript` can standardize how users interact with your app. When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set to `MULTIPLE_LINE`. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): + * `label` (*type:* `String.t`, *default:* `nil`) - The text that appears above the text input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if you are asking someone's name, but specifically need their surname, write `surname` instead of `name`. Required if `hintText` is unspecified. Otherwise, optional. + * `name` (*type:* `String.t`, *default:* `nil`) - The name by which the text input is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). + * `onChangeAction` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t`, *default:* `nil`) - What to do when a change occurs in the text input field. For example, a user adding to the field or deleting text. Examples of actions to take include running a custom function or opening a [dialog](https://developers.google.com/chat/how-tos/dialogs) in Google Chat. + * `placeholderText` (*type:* `String.t`, *default:* `nil`) - Text that appears in the text input field when the field is empty. Use this text to prompt users to enter a value. For example, `Enter a number from 0 to 100`. [Google Chat apps](https://developers.google.com/workspace/chat): * `type` (*type:* `String.t`, *default:* `nil`) - How a text input field appears in the user interface. For example, whether the field is single or multi-line. - * `value` (*type:* `String.t`, *default:* `nil`) - The value entered by a user, returned as part of a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/how-tos/dialogs#receive_form_data_from_dialogs). + * `value` (*type:* `String.t`, *default:* `nil`) - The value entered by a user, returned as part of a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/chat/ui/read-form-data). """ use GoogleApi.Gax.ModelBase @@ -40,6 +41,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput do :label => String.t() | nil, :name => String.t() | nil, :onChangeAction => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action.t() | nil, + :placeholderText => String.t() | nil, :type => String.t() | nil, :value => String.t() | nil } @@ -50,6 +52,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput do field(:label) field(:name) field(:onChangeAction, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Action) + field(:placeholderText) field(:type) field(:value) end diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_paragraph.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_paragraph.ex index dc68a79456..bab11c48e1 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_paragraph.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_text_paragraph.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextParagraph do @moduledoc """ - A paragraph of text that supports formatting. See [Text formatting](https://developers.google.com/workspace/add-ons/concepts/widgets#text_formatting) for details. + A paragraph of text that supports formatting. For an example in Google Chat apps, see [Text paragraph](https://developers.google.com/chat/ui/widgets/text-paragraph). For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widget.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widget.ex index 60b005ccd3..df0bd440ce 100644 --- a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widget.ex +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widget.ex @@ -21,25 +21,29 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widget do ## Attributes - * `buttonList` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList.t`, *default:* `nil`) - A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ "button": { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 } "disabled": true }, "button": { "icon": { "knownIcon": "INVITE" "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } }, ] } ``` - * `dateTimePicker` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker.t`, *default:* `nil`) - Displays a selection/input widget for date, time, or date and time. Not supported by Chat apps. Support by Chat apps is coming soon. For example, the following JSON creates a datetime picker to schedule an appointment: ``` "date_time_picker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DateTimePickerType.DATE_AND_TIME", "valueMsEpoch": "796435200000" } ``` - * `decoratedText` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText.t`, *default:* `nil`) - Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchWidget": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "ControlType.CHECKBOX" } } ``` + * `buttonList` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList.t`, *default:* `nil`) - A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 }, "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ``` + * `columns` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Columns.t`, *default:* `nil`) - Displays up to 2 columns. To include more than 2 columns, or to use rows, use the `Grid` widget. For example, the following JSON creates 2 columns that each contain text paragraphs: ``` "columns": { "columnItems": [ { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "First column text paragraph" } } ] }, { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "Second column text paragraph" } } ] } ] } ``` + * `dateTimePicker` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker.t`, *default:* `nil`) - Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": "796435200000" } ``` + * `decoratedText` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText.t`, *default:* `nil`) - Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchControl": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "CHECKBOX" } } ``` * `divider` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Divider.t`, *default:* `nil`) - Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ``` - * `grid` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Grid.t`, *default:* `nil`) - Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. Currently supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) is coming soon. For example, the following JSON creates a 2 column grid with a single item: ``` "grid": { "title": "A fine collection of items", "numColumns": 2, "borderStyle": { "type": "STROKE", "cornerRadius": 4.0 }, "items": [ "image": { "imageUri": "https://www.example.com/image.png", "cropStyle": { "type": "SQUARE" }, "borderStyle": { "type": "STROKE" } }, "title": "An item", "textAlignment": "CENTER" ], "onClick": { "openLink": { "url":"https://www.example.com" } } } ``` - * `image` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image.t`, *default:* `nil`) - Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png" "altText": "Chat app avatar" } ``` - * `selectionInput` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput.t`, *default:* `nil`) - Displays a selection control that lets users select items. Selection controls can be check boxes, radio buttons, switches, or dropdown menus. Currently supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) is coming soon. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "SelectionType.DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ``` - * `textInput` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput.t`, *default:* `nil`) - Displays a text box that users can type into. Currently supported in [dialogs](https://developers.google.com/chat/how-tos/dialogs). Support for [card messages](https://developers.google.com/chat/api/guides/message-formats/cards) is coming soon. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ``` - * `textParagraph` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextParagraph.t`, *default:* `nil`) - Displays a text paragraph. Supports [simple HTML formatted text](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " *bold text*" } ``` + * `grid` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Grid.t`, *default:* `nil`) - Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): For example, the following JSON creates a 2 column grid with a single item: ``` "grid": { "title": "A fine collection of items", "columnCount": 2, "borderStyle": { "type": "STROKE", "cornerRadius": 4 }, "items": [ { "image": { "imageUri": "https://www.example.com/image.png", "cropStyle": { "type": "SQUARE" }, "borderStyle": { "type": "STROKE" } }, "title": "An item", "textAlignment": "CENTER" } ], "onClick": { "openLink": { "url": "https://www.example.com" } } } ``` + * `horizontalAlignment` (*type:* `String.t`, *default:* `nil`) - Specifies whether widgets align to the left, right, or center of a column. + * `image` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image.t`, *default:* `nil`) - Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png", "altText": "Chat app avatar" } ``` + * `selectionInput` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput.t`, *default:* `nil`) - Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ``` + * `textInput` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput.t`, *default:* `nil`) - Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ``` + * `textParagraph` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextParagraph.t`, *default:* `nil`) - Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " *bold text*" } ``` """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ :buttonList => GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList.t() | nil, + :columns => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Columns.t() | nil, :dateTimePicker => GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker.t() | nil, :decoratedText => GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText.t() | nil, :divider => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Divider.t() | nil, :grid => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Grid.t() | nil, + :horizontalAlignment => String.t() | nil, :image => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image.t() | nil, :selectionInput => GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput.t() | nil, :textInput => GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput.t() | nil, @@ -47,10 +51,12 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widget do } field(:buttonList, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList) + field(:columns, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Columns) field(:dateTimePicker, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker) field(:decoratedText, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText) field(:divider, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Divider) field(:grid, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Grid) + field(:horizontalAlignment) field(:image, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image) field(:selectionInput, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput) field(:textInput, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput) diff --git a/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widgets.ex b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widgets.ex new file mode 100644 index 0000000000..397161a176 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/google_apps_card_v1_widgets.ex @@ -0,0 +1,64 @@ +# 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.Chat.V1.Model.GoogleAppsCardV1Widgets do + @moduledoc """ + The supported widgets that you can include in a column. [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend): Columns for Google Workspace Add-ons are in Developer Preview. + + ## Attributes + + * `buttonList` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList.t`, *default:* `nil`) - ButtonList widget. + * `dateTimePicker` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker.t`, *default:* `nil`) - DateTimePicker widget. + * `decoratedText` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText.t`, *default:* `nil`) - DecoratedText widget. + * `image` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image.t`, *default:* `nil`) - Image widget. + * `selectionInput` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput.t`, *default:* `nil`) - SelectionInput widget. + * `textInput` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput.t`, *default:* `nil`) - TextInput widget. + * `textParagraph` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextParagraph.t`, *default:* `nil`) - TextParagraph widget. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :buttonList => GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList.t() | nil, + :dateTimePicker => GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker.t() | nil, + :decoratedText => GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText.t() | nil, + :image => GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image.t() | nil, + :selectionInput => GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput.t() | nil, + :textInput => GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput.t() | nil, + :textParagraph => GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextParagraph.t() | nil + } + + field(:buttonList, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList) + field(:dateTimePicker, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1DateTimePicker) + field(:decoratedText, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1DecoratedText) + field(:image, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Image) + field(:selectionInput, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionInput) + field(:textInput, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextInput) + field(:textParagraph, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1TextParagraph) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widgets do + def decode(value, options) do + GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widgets.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.GoogleAppsCardV1Widgets do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/group.ex b/clients/chat/lib/google_api/chat/v1/model/group.ex new file mode 100644 index 0000000000..5bd60dfcb7 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/group.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.Group do + @moduledoc """ + A Google Group in Google Chat. + + ## Attributes + + * `name` (*type:* `String.t`, *default:* `nil`) - Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group} + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :name => String.t() | nil + } + + field(:name) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.Group do + def decode(value, options) do + GoogleApi.Chat.V1.Model.Group.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.Group do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/host_app_data_source_markup.ex b/clients/chat/lib/google_api/chat/v1/model/host_app_data_source_markup.ex new file mode 100644 index 0000000000..f339f81e6b --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/host_app_data_source_markup.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.HostAppDataSourceMarkup do + @moduledoc """ + For a `SelectionInput` widget that uses a multiselect menu, a data source from a Google Workspace application. The data source populates selection items for the multiselect menu. [Google Chat apps](https://developers.google.com/workspace/chat): + + ## Attributes + + * `chatDataSource` (*type:* `GoogleApi.Chat.V1.Model.ChatClientDataSourceMarkup.t`, *default:* `nil`) - A data source from Google Chat. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :chatDataSource => GoogleApi.Chat.V1.Model.ChatClientDataSourceMarkup.t() | nil + } + + field(:chatDataSource, as: GoogleApi.Chat.V1.Model.ChatClientDataSourceMarkup) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.HostAppDataSourceMarkup do + def decode(value, options) do + GoogleApi.Chat.V1.Model.HostAppDataSourceMarkup.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.HostAppDataSourceMarkup do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/image.ex b/clients/chat/lib/google_api/chat/v1/model/image.ex index 52969a4ba6..53858b15c9 100644 --- a/clients/chat/lib/google_api/chat/v1/model/image.ex +++ b/clients/chat/lib/google_api/chat/v1/model/image.ex @@ -17,13 +17,13 @@ defmodule GoogleApi.Chat.V1.Model.Image do @moduledoc """ - An image that is specified by a URL and can have an onclick action. + An image that's specified by a URL and can have an `onclick` action. ## Attributes - * `aspectRatio` (*type:* `float()`, *default:* `nil`) - The aspect ratio of this image (width/height). This field allows clients to reserve the right height for the image while waiting for it to load. It's not meant to override the native aspect ratio of the image. If unset, the server fills it by prefetching the image. + * `aspectRatio` (*type:* `float()`, *default:* `nil`) - The aspect ratio of this image (width and height). This field lets you reserve the right height for the image while waiting for it to load. It's not meant to override the built-in aspect ratio of the image. If unset, the server fills it by prefetching the image. * `imageUrl` (*type:* `String.t`, *default:* `nil`) - The URL of the image. - * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The onclick action. + * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The `onclick` action. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/image_button.ex b/clients/chat/lib/google_api/chat/v1/model/image_button.ex index dab0cd0d6d..9edbd4b1ec 100644 --- a/clients/chat/lib/google_api/chat/v1/model/image_button.ex +++ b/clients/chat/lib/google_api/chat/v1/model/image_button.ex @@ -17,14 +17,14 @@ defmodule GoogleApi.Chat.V1.Model.ImageButton do @moduledoc """ - An image button with an onclick action. + An image button with an `onclick` action. ## Attributes - * `icon` (*type:* `String.t`, *default:* `nil`) - The icon specified by an enum that indices to an icon provided by Chat API. + * `icon` (*type:* `String.t`, *default:* `nil`) - The icon specified by an `enum` that indices to an icon provided by Chat API. * `iconUrl` (*type:* `String.t`, *default:* `nil`) - The icon specified by a URL. - * `name` (*type:* `String.t`, *default:* `nil`) - The name of this image_button which will be used for accessibility. Default value will be provided if developers don't specify. - * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The onclick action. + * `name` (*type:* `String.t`, *default:* `nil`) - The name of this `image_button` that's used for accessibility. Default value is provided if this name isn't specified. + * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The `onclick` action. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/inputs.ex b/clients/chat/lib/google_api/chat/v1/model/inputs.ex index 861c4f0a82..8969933191 100644 --- a/clients/chat/lib/google_api/chat/v1/model/inputs.ex +++ b/clients/chat/lib/google_api/chat/v1/model/inputs.ex @@ -17,14 +17,14 @@ defmodule GoogleApi.Chat.V1.Model.Inputs do @moduledoc """ - Types of data inputs for widgets. Users enter data with these inputs. + Types of data that users can [input on cards or dialogs](https://developers.google.com/chat/ui/read-form-data). The input type depends on the type of values that the widget accepts. ## Attributes - * `dateInput` (*type:* `GoogleApi.Chat.V1.Model.DateInput.t`, *default:* `nil`) - Date input values. Not supported by Chat apps. - * `dateTimeInput` (*type:* `GoogleApi.Chat.V1.Model.DateTimeInput.t`, *default:* `nil`) - Date and time input values. Not supported by Chat apps. - * `stringInputs` (*type:* `GoogleApi.Chat.V1.Model.StringInputs.t`, *default:* `nil`) - Input parameter for regular widgets. For single-valued widgets, it is a single value list. For multi-valued widgets, such as checkbox, all the values are presented. - * `timeInput` (*type:* `GoogleApi.Chat.V1.Model.TimeInput.t`, *default:* `nil`) - Time input values. Not supported by Chat apps. + * `dateInput` (*type:* `GoogleApi.Chat.V1.Model.DateInput.t`, *default:* `nil`) - Date input values from a [`DateTimePicker`](https://developers.google.com/chat/api/reference/rest/v1/cards#DateTimePicker) widget that only accepts date values. + * `dateTimeInput` (*type:* `GoogleApi.Chat.V1.Model.DateTimeInput.t`, *default:* `nil`) - Date and time input values from a [`DateTimePicker`](https://developers.google.com/chat/api/reference/rest/v1/cards#DateTimePicker) widget that accepts both a date and time. + * `stringInputs` (*type:* `GoogleApi.Chat.V1.Model.StringInputs.t`, *default:* `nil`) - A list of strings that represent the values that the user inputs in a widget. If the widget only accepts one value, such as a [`TextInput`](https://developers.google.com/chat/api/reference/rest/v1/cards#TextInput) widget, the list contains one string object. If the widget accepts multiple values, such as a [`SelectionInput`](https://developers.google.com/chat/api/reference/rest/v1/cards#selectioninput) widget of checkboxes, the list contains a string object for each value that the user inputs or selects. + * `timeInput` (*type:* `GoogleApi.Chat.V1.Model.TimeInput.t`, *default:* `nil`) - Time input values from a [`DateTimePicker`](https://developers.google.com/chat/api/reference/rest/v1/cards#DateTimePicker) widget that only accepts time values. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/key_value.ex b/clients/chat/lib/google_api/chat/v1/model/key_value.ex index afd39b8b52..25fd7f527f 100644 --- a/clients/chat/lib/google_api/chat/v1/model/key_value.ex +++ b/clients/chat/lib/google_api/chat/v1/model/key_value.ex @@ -17,18 +17,18 @@ defmodule GoogleApi.Chat.V1.Model.KeyValue do @moduledoc """ - A UI element contains a key (label) and a value (content). And this element may also contain some actions such as onclick button. + A UI element contains a key (label) and a value (content). This element can also contain some actions such as `onclick` button. ## Attributes - * `bottomLabel` (*type:* `String.t`, *default:* `nil`) - The text of the bottom label. Formatted text supported. + * `bottomLabel` (*type:* `String.t`, *default:* `nil`) - The text of the bottom label. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). * `button` (*type:* `GoogleApi.Chat.V1.Model.Button.t`, *default:* `nil`) - A button that can be clicked to trigger an action. - * `content` (*type:* `String.t`, *default:* `nil`) - The text of the content. Formatted text supported and always required. + * `content` (*type:* `String.t`, *default:* `nil`) - The text of the content. Formatted text supported and always required. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). * `contentMultiline` (*type:* `boolean()`, *default:* `nil`) - If the content should be multiline. - * `icon` (*type:* `String.t`, *default:* `nil`) - An enum value that will be replaced by the Chat API with the corresponding icon image. + * `icon` (*type:* `String.t`, *default:* `nil`) - An enum value that's replaced by the Chat API with the corresponding icon image. * `iconUrl` (*type:* `String.t`, *default:* `nil`) - The icon specified by a URL. - * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The onclick action. Only the top label, bottom label and content region are clickable. - * `topLabel` (*type:* `String.t`, *default:* `nil`) - The text of the top label. Formatted text supported. + * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The `onclick` action. Only the top label, bottom label, and content region are clickable. + * `topLabel` (*type:* `String.t`, *default:* `nil`) - The text of the top label. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/list_memberships_response.ex b/clients/chat/lib/google_api/chat/v1/model/list_memberships_response.ex index 4f05b8d3e0..0b515717cb 100644 --- a/clients/chat/lib/google_api/chat/v1/model/list_memberships_response.ex +++ b/clients/chat/lib/google_api/chat/v1/model/list_memberships_response.ex @@ -21,8 +21,8 @@ defmodule GoogleApi.Chat.V1.Model.ListMembershipsResponse do ## Attributes - * `memberships` (*type:* `list(GoogleApi.Chat.V1.Model.Membership.t)`, *default:* `nil`) - List of memberships in the requested (or first) page. - * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token that can be sent as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages. + * `memberships` (*type:* `list(GoogleApi.Chat.V1.Model.Membership.t)`, *default:* `nil`) - Unordered list. List of memberships in the requested (or first) page. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token that you can send as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/list_messages_response.ex b/clients/chat/lib/google_api/chat/v1/model/list_messages_response.ex new file mode 100644 index 0000000000..e1c17fe612 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/list_messages_response.ex @@ -0,0 +1,49 @@ +# 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.Chat.V1.Model.ListMessagesResponse do + @moduledoc """ + + + ## Attributes + + * `messages` (*type:* `list(GoogleApi.Chat.V1.Model.Message.t)`, *default:* `nil`) - List of messages. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - You can send a token as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :messages => list(GoogleApi.Chat.V1.Model.Message.t()) | nil, + :nextPageToken => String.t() | nil + } + + field(:messages, as: GoogleApi.Chat.V1.Model.Message, type: :list) + field(:nextPageToken) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.ListMessagesResponse do + def decode(value, options) do + GoogleApi.Chat.V1.Model.ListMessagesResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.ListMessagesResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/list_reactions_response.ex b/clients/chat/lib/google_api/chat/v1/model/list_reactions_response.ex new file mode 100644 index 0000000000..6b59c00f42 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/list_reactions_response.ex @@ -0,0 +1,49 @@ +# 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.Chat.V1.Model.ListReactionsResponse do + @moduledoc """ + + + ## Attributes + + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - Continuation token to retrieve the next page of results. It's empty for the last page of results. + * `reactions` (*type:* `list(GoogleApi.Chat.V1.Model.Reaction.t)`, *default:* `nil`) - List of reactions in the requested (or first) page. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :nextPageToken => String.t() | nil, + :reactions => list(GoogleApi.Chat.V1.Model.Reaction.t()) | nil + } + + field(:nextPageToken) + field(:reactions, as: GoogleApi.Chat.V1.Model.Reaction, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.ListReactionsResponse do + def decode(value, options) do + GoogleApi.Chat.V1.Model.ListReactionsResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.ListReactionsResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/list_spaces_response.ex b/clients/chat/lib/google_api/chat/v1/model/list_spaces_response.ex index 386dac99aa..9642ef74ad 100644 --- a/clients/chat/lib/google_api/chat/v1/model/list_spaces_response.ex +++ b/clients/chat/lib/google_api/chat/v1/model/list_spaces_response.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.ListSpacesResponse do @moduledoc """ - The response corresponding to ListSpacesRequest. + ## Attributes - * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token that can be sent as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages. + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - You can send a token as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages. * `spaces` (*type:* `list(GoogleApi.Chat.V1.Model.Space.t)`, *default:* `nil`) - List of spaces in the requested (or first) page. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/matched_url.ex b/clients/chat/lib/google_api/chat/v1/model/matched_url.ex index df3b173d0e..79ff13fd0c 100644 --- a/clients/chat/lib/google_api/chat/v1/model/matched_url.ex +++ b/clients/chat/lib/google_api/chat/v1/model/matched_url.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.MatchedUrl do @moduledoc """ - A matched url in a Chat message. Chat apps can preview matched URLs. For more information, refer to [Preview links](https://developers.google.com/chat/how-tos/preview-links). + A matched URL in a Chat message. Chat apps can preview matched URLs. For more information, see [Preview links](https://developers.google.com/chat/how-tos/preview-links). ## Attributes - * `url` (*type:* `String.t`, *default:* `nil`) - Output only. The url that was matched. + * `url` (*type:* `String.t`, *default:* `nil`) - Output only. The URL that was matched. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/membership.ex b/clients/chat/lib/google_api/chat/v1/model/membership.ex index 33c11515c4..9173c9d53a 100644 --- a/clients/chat/lib/google_api/chat/v1/model/membership.ex +++ b/clients/chat/lib/google_api/chat/v1/model/membership.ex @@ -21,10 +21,12 @@ defmodule GoogleApi.Chat.V1.Model.Membership do ## Attributes - * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The creation time of the membership, such as when a member joined or was invited to join a space. - * `member` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - A Google Chat user or app. Format: `users/{user}` or `users/app` When `users/{user}`, represents a [person](https://developers.google.com/people/api/rest/v1/people) in the People API or a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. When `users/app`, represents a Chat app creating membership for itself. - * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the membership. Format: spaces/{space}/members/{member} - * `role` (*type:* `String.t`, *default:* `nil`) - Output only. User's role within a Chat space, which determines their permitted actions in the space. + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces. + * `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces. + * `groupMember` (*type:* `GoogleApi.Chat.V1.Model.Group.t`, *default:* `nil`) - The Google Group the membership corresponds to. Only supports read operations. Other operations, like creating or updating a membership, aren't currently supported. + * `member` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - The Google Chat user or app the membership corresponds to. If your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the output populates the [user](https://developers.google.com/chat/api/reference/rest/v1/User) `name` and `type`. + * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}` + * `role` (*type:* `String.t`, *default:* `nil`) - Optional. User's role within a Chat space, which determines their permitted actions in the space. [Developer Preview](https://developers.google.com/workspace/preview): This field can only be used as input in `UpdateMembership`. * `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the membership. """ @@ -32,6 +34,8 @@ defmodule GoogleApi.Chat.V1.Model.Membership do @type t :: %__MODULE__{ :createTime => DateTime.t() | nil, + :deleteTime => DateTime.t() | nil, + :groupMember => GoogleApi.Chat.V1.Model.Group.t() | nil, :member => GoogleApi.Chat.V1.Model.User.t() | nil, :name => String.t() | nil, :role => String.t() | nil, @@ -39,6 +43,8 @@ defmodule GoogleApi.Chat.V1.Model.Membership do } field(:createTime, as: DateTime) + field(:deleteTime, as: DateTime) + field(:groupMember, as: GoogleApi.Chat.V1.Model.Group) field(:member, as: GoogleApi.Chat.V1.Model.User) field(:name) field(:role) diff --git a/clients/chat/lib/google_api/chat/v1/model/message.ex b/clients/chat/lib/google_api/chat/v1/model/message.ex index 3f12bac168..df8b4b49a6 100644 --- a/clients/chat/lib/google_api/chat/v1/model/message.ex +++ b/clients/chat/lib/google_api/chat/v1/model/message.ex @@ -17,27 +17,34 @@ defmodule GoogleApi.Chat.V1.Model.Message do @moduledoc """ - A message in Google Chat. + A message in a Google Chat space. ## Attributes * `actionResponse` (*type:* `GoogleApi.Chat.V1.Model.ActionResponse.t`, *default:* `nil`) - Input only. Parameters that a Chat app can use to configure how its response is posted. - * `annotations` (*type:* `list(GoogleApi.Chat.V1.Model.Annotation.t)`, *default:* `nil`) - Output only. Annotations associated with the text in this message. - * `argumentText` (*type:* `String.t`, *default:* `nil`) - Plain-text body of the message with all Chat app mentions stripped out. - * `attachment` (*type:* `list(GoogleApi.Chat.V1.Model.Attachment.t)`, *default:* `nil`) - User uploaded attachment. - * `cards` (*type:* `list(GoogleApi.Chat.V1.Model.Card.t)`, *default:* `nil`) - Deprecated: Use `cards_v2` instead. Rich, formatted and interactive cards that can be used to display UI elements such as: formatted texts, buttons, clickable images. Cards are normally displayed below the plain-text body of the message. - * `cardsV2` (*type:* `list(GoogleApi.Chat.V1.Model.CardWithId.t)`, *default:* `nil`) - Richly formatted and interactive cards that display UI elements and editable widgets, such as: - Formatted text - Buttons - Clickable images - Checkboxes - Radio buttons - Input widgets. Cards are usually displayed below the text-body of a Chat message, but can situationally appear other places, such as [dialogs](https://developers.google.com/chat/how-tos/dialogs). The `cardId` is a unique identifier among cards in the same message and for identifying user input values. Currently supported widgets include: - `TextParagraph` - `DecoratedText` - `Image` - `ButtonList` - `Divider` - * `clientAssignedMessageId` (*type:* `String.t`, *default:* `nil`) - A custom name for a Chat message assigned at creation. Must start with `client-` and contain only lowercase letters, numbers, and hyphens up to 63 characters in length. Specify this field to get, update, or delete the message with the specified value. For example usage, see [Name a created message](https://developers.google.com/chat/api/guides/crudl/messages#name_a_created_message). - * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which the message was created in Google Chat server. - * `fallbackText` (*type:* `String.t`, *default:* `nil`) - A plain-text description of the message's cards, used when the actual cards cannot be displayed (e.g. mobile notifications). + * `annotations` (*type:* `list(GoogleApi.Chat.V1.Model.Annotation.t)`, *default:* `nil`) - Output only. Annotations associated with the `text` in this message. + * `argumentText` (*type:* `String.t`, *default:* `nil`) - Output only. Plain-text body of the message with all Chat app mentions stripped out. + * `attachedGifs` (*type:* `list(GoogleApi.Chat.V1.Model.AttachedGif.t)`, *default:* `nil`) - Output only. GIF images that are attached to the message. + * `attachment` (*type:* `list(GoogleApi.Chat.V1.Model.Attachment.t)`, *default:* `nil`) - User-uploaded attachment. + * `cards` (*type:* `list(GoogleApi.Chat.V1.Model.Card.t)`, *default:* `nil`) - Deprecated: Use `cards_v2` instead. Rich, formatted, and interactive cards that you can use to display UI elements such as: formatted texts, buttons, and clickable images. Cards are normally displayed below the plain-text body of the message. `cards` and `cards_v2` can have a maximum size of 32 KB. + * `cardsV2` (*type:* `list(GoogleApi.Chat.V1.Model.CardWithId.t)`, *default:* `nil`) - An array of [cards](https://developers.google.com/chat/api/reference/rest/v1/cards). Only Chat apps can create cards. If your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the messages can't contain cards. To learn about cards and how to create them, see [Design dynamic, interactive, and consistent UIs with cards](https://developers.google.com/chat/ui). [Card builder](https://addons.gsuite.google.com/uikit/builder) + * `clientAssignedMessageId` (*type:* `String.t`, *default:* `nil`) - Optional. A custom ID for the message. You can use field to identify a message, or to get, delete, or update a message. To set a custom ID, specify the [`messageId`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) field when you create the message. For details, see [Name a message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. Immutable. For spaces created in Chat, the time at which the message was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the message was created in the source in order to preserve the original creation time. + * `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty. + * `deletionMetadata` (*type:* `GoogleApi.Chat.V1.Model.DeletionMetadata.t`, *default:* `nil`) - Output only. Information about a deleted message. A message is deleted when `delete_time` is set. + * `emojiReactionSummaries` (*type:* `list(GoogleApi.Chat.V1.Model.EmojiReactionSummary.t)`, *default:* `nil`) - Output only. The list of emoji reaction summaries on the message. + * `fallbackText` (*type:* `String.t`, *default:* `nil`) - A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications. + * `formattedText` (*type:* `String.t`, *default:* `nil`) - Output only. Contains the message `text` with markups added to communicate formatting. This field might not capture all formatting visible in the UI, but includes the following: * [Markup syntax](https://developers.google.com/chat/format-messages) for bold, italic, strikethrough, monospace, monospace block, and bulleted list. * [User mentions](https://developers.google.com/chat/format-messages#messages-@mention) using the format ``. * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the first string is the URL and the second is the rendered text—for example, ``. * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`. This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning face emoji. For more information, see [View text formatting sent in a message](https://developers.google.com/chat/format-messages#view_text_formatting_sent_in_a_message) * `lastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which the message was last edited by a user. If the message has never been edited, this field is empty. - * `matchedUrl` (*type:* `GoogleApi.Chat.V1.Model.MatchedUrl.t`, *default:* `nil`) - Output only. A URL in `spaces.messages.text` that matches a link preview pattern. For more information, refer to [Preview links](https://developers.google.com/chat/how-tos/preview-links). - * `name` (*type:* `String.t`, *default:* `nil`) - Resource name in the form `spaces/*/messages/*`. Example: `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB` - * `sender` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - Output only. The user who created the message. + * `matchedUrl` (*type:* `GoogleApi.Chat.V1.Model.MatchedUrl.t`, *default:* `nil`) - Output only. A URL in `spaces.messages.text` that matches a link preview pattern. For more information, see [Preview links](https://developers.google.com/chat/how-tos/preview-links). + * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the message. Format: `spaces/{space}/messages/{message}` Where `{space}` is the ID of the space where the message is posted and `{message}` is a system-assigned ID for the message. For example, `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing `{message}` with the value from the `clientAssignedMessageId` field. For example, `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name a message](https://developers.google.com/chat/api/guides/v1/messages/create#name_a_created_message). + * `privateMessageViewer` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - Immutable. Input for creating a message, otherwise output only. The user that can view the message. When set, the message is private and only visible to the specified user and the Chat app. Link previews and attachments aren't supported for private messages. Only Chat apps can send private messages. If your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users) to send a message, the message can't be private and must omit this field. For details, see [Send private messages to Google Chat users](https://developers.google.com/chat/api/guides/v1/messages/private). + * `quotedMessageMetadata` (*type:* `GoogleApi.Chat.V1.Model.QuotedMessageMetadata.t`, *default:* `nil`) - Output only. Information about a message that's quoted by a Google Chat user in a space. Google Chat users can quote a message to reply to it. + * `sender` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - Output only. The user who created the message. If your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the output populates the [user](https://developers.google.com/chat/api/reference/rest/v1/User) `name` and `type`. * `slashCommand` (*type:* `GoogleApi.Chat.V1.Model.SlashCommand.t`, *default:* `nil`) - Output only. Slash command information, if applicable. - * `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - The space the message belongs to. When accessed with [user authentication](https://developers.google.com/chat/api/guides/auth/users), only the name of the Space is populated. - * `text` (*type:* `String.t`, *default:* `nil`) - Plain-text body of the message. The first link to an image, video, web page, or other preview-able item generates a preview chip. - * `thread` (*type:* `GoogleApi.Chat.V1.Model.Thread.t`, *default:* `nil`) - The thread the message belongs to. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). + * `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - If your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the output populates the [space](https://developers.google.com/chat/api/reference/rest/v1/spaces) `name`. + * `text` (*type:* `String.t`, *default:* `nil`) - Plain-text body of the message. The first link to an image, video, or web page generates a [preview chip](https://developers.google.com/chat/how-tos/preview-links). You can also [@mention a Google Chat user](https://developers.google.com/chat/format-messages#messages-@mention), or everyone in the space. To learn about creating text messages, see [Send a text message](https://developers.google.com/chat/api/guides/v1/messages/create#create-text-messages). + * `thread` (*type:* `GoogleApi.Chat.V1.Model.Thread.t`, *default:* `nil`) - The thread the message belongs to. For example usage, see [Start or reply to a message thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). * `threadReply` (*type:* `boolean()`, *default:* `nil`) - Output only. When `true`, the message is a response in a reply thread. When `false`, the message is visible in the space's top-level conversation as either the first message of a thread or a message with no threaded replies. If the space doesn't support reply in threads, this field is always `false`. """ @@ -47,15 +54,22 @@ defmodule GoogleApi.Chat.V1.Model.Message do :actionResponse => GoogleApi.Chat.V1.Model.ActionResponse.t() | nil, :annotations => list(GoogleApi.Chat.V1.Model.Annotation.t()) | nil, :argumentText => String.t() | nil, + :attachedGifs => list(GoogleApi.Chat.V1.Model.AttachedGif.t()) | nil, :attachment => list(GoogleApi.Chat.V1.Model.Attachment.t()) | nil, :cards => list(GoogleApi.Chat.V1.Model.Card.t()) | nil, :cardsV2 => list(GoogleApi.Chat.V1.Model.CardWithId.t()) | nil, :clientAssignedMessageId => String.t() | nil, :createTime => DateTime.t() | nil, + :deleteTime => DateTime.t() | nil, + :deletionMetadata => GoogleApi.Chat.V1.Model.DeletionMetadata.t() | nil, + :emojiReactionSummaries => list(GoogleApi.Chat.V1.Model.EmojiReactionSummary.t()) | nil, :fallbackText => String.t() | nil, + :formattedText => String.t() | nil, :lastUpdateTime => DateTime.t() | nil, :matchedUrl => GoogleApi.Chat.V1.Model.MatchedUrl.t() | nil, :name => String.t() | nil, + :privateMessageViewer => GoogleApi.Chat.V1.Model.User.t() | nil, + :quotedMessageMetadata => GoogleApi.Chat.V1.Model.QuotedMessageMetadata.t() | nil, :sender => GoogleApi.Chat.V1.Model.User.t() | nil, :slashCommand => GoogleApi.Chat.V1.Model.SlashCommand.t() | nil, :space => GoogleApi.Chat.V1.Model.Space.t() | nil, @@ -67,15 +81,22 @@ defmodule GoogleApi.Chat.V1.Model.Message do field(:actionResponse, as: GoogleApi.Chat.V1.Model.ActionResponse) field(:annotations, as: GoogleApi.Chat.V1.Model.Annotation, type: :list) field(:argumentText) + field(:attachedGifs, as: GoogleApi.Chat.V1.Model.AttachedGif, type: :list) field(:attachment, as: GoogleApi.Chat.V1.Model.Attachment, type: :list) field(:cards, as: GoogleApi.Chat.V1.Model.Card, type: :list) field(:cardsV2, as: GoogleApi.Chat.V1.Model.CardWithId, type: :list) field(:clientAssignedMessageId) field(:createTime, as: DateTime) + field(:deleteTime, as: DateTime) + field(:deletionMetadata, as: GoogleApi.Chat.V1.Model.DeletionMetadata) + field(:emojiReactionSummaries, as: GoogleApi.Chat.V1.Model.EmojiReactionSummary, type: :list) field(:fallbackText) + field(:formattedText) field(:lastUpdateTime, as: DateTime) field(:matchedUrl, as: GoogleApi.Chat.V1.Model.MatchedUrl) field(:name) + field(:privateMessageViewer, as: GoogleApi.Chat.V1.Model.User) + field(:quotedMessageMetadata, as: GoogleApi.Chat.V1.Model.QuotedMessageMetadata) field(:sender, as: GoogleApi.Chat.V1.Model.User) field(:slashCommand, as: GoogleApi.Chat.V1.Model.SlashCommand) field(:space, as: GoogleApi.Chat.V1.Model.Space) diff --git a/clients/chat/lib/google_api/chat/v1/model/on_click.ex b/clients/chat/lib/google_api/chat/v1/model/on_click.ex index decd2e2d6e..8dd26ae994 100644 --- a/clients/chat/lib/google_api/chat/v1/model/on_click.ex +++ b/clients/chat/lib/google_api/chat/v1/model/on_click.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Chat.V1.Model.OnClick do @moduledoc """ - An onclick action (e.g. open a link). + An `onclick` action (for example, open a link). ## Attributes - * `action` (*type:* `GoogleApi.Chat.V1.Model.FormAction.t`, *default:* `nil`) - A form action will be triggered by this onclick if specified. - * `openLink` (*type:* `GoogleApi.Chat.V1.Model.OpenLink.t`, *default:* `nil`) - This onclick triggers an open link action if specified. + * `action` (*type:* `GoogleApi.Chat.V1.Model.FormAction.t`, *default:* `nil`) - A form action is triggered by this `onclick` action if specified. + * `openLink` (*type:* `GoogleApi.Chat.V1.Model.OpenLink.t`, *default:* `nil`) - This `onclick` action triggers an open link action if specified. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/quoted_message_metadata.ex b/clients/chat/lib/google_api/chat/v1/model/quoted_message_metadata.ex new file mode 100644 index 0000000000..c6286c19de --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/quoted_message_metadata.ex @@ -0,0 +1,49 @@ +# 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.Chat.V1.Model.QuotedMessageMetadata do + @moduledoc """ + Information about a quoted message. + + ## Attributes + + * `lastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the quoted message was created or when the quoted message was last updated. + * `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the quoted message. Format: `spaces/{space}/messages/{message}` + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :lastUpdateTime => DateTime.t() | nil, + :name => String.t() | nil + } + + field(:lastUpdateTime, as: DateTime) + field(:name) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.QuotedMessageMetadata do + def decode(value, options) do + GoogleApi.Chat.V1.Model.QuotedMessageMetadata.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.QuotedMessageMetadata do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/reaction.ex b/clients/chat/lib/google_api/chat/v1/model/reaction.ex new file mode 100644 index 0000000000..9199425a51 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/reaction.ex @@ -0,0 +1,52 @@ +# 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.Chat.V1.Model.Reaction do + @moduledoc """ + A reaction to a message. + + ## Attributes + + * `emoji` (*type:* `GoogleApi.Chat.V1.Model.Emoji.t`, *default:* `nil`) - The emoji used in the reaction. + * `name` (*type:* `String.t`, *default:* `nil`) - The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + * `user` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - Output only. The user who created the reaction. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :emoji => GoogleApi.Chat.V1.Model.Emoji.t() | nil, + :name => String.t() | nil, + :user => GoogleApi.Chat.V1.Model.User.t() | nil + } + + field(:emoji, as: GoogleApi.Chat.V1.Model.Emoji) + field(:name) + field(:user, as: GoogleApi.Chat.V1.Model.User) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.Reaction do + def decode(value, options) do + GoogleApi.Chat.V1.Model.Reaction.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.Reaction do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/section.ex b/clients/chat/lib/google_api/chat/v1/model/section.ex index 7d8ff8d4be..41e2428a5a 100644 --- a/clients/chat/lib/google_api/chat/v1/model/section.ex +++ b/clients/chat/lib/google_api/chat/v1/model/section.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Chat.V1.Model.Section do @moduledoc """ - A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there is currently no need for layout properties (e.g. float). + A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there's currently no need for layout properties (for example, float). ## Attributes - * `header` (*type:* `String.t`, *default:* `nil`) - The header of the section, text formatted supported. - * `widgets` (*type:* `list(GoogleApi.Chat.V1.Model.WidgetMarkup.t)`, *default:* `nil`) - A section must contain at least 1 widget. + * `header` (*type:* `String.t`, *default:* `nil`) - The header of the section. Formatted text is supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). + * `widgets` (*type:* `list(GoogleApi.Chat.V1.Model.WidgetMarkup.t)`, *default:* `nil`) - A section must contain at least one widget. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/selection_items.ex b/clients/chat/lib/google_api/chat/v1/model/selection_items.ex new file mode 100644 index 0000000000..c38f765f7c --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/selection_items.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.SelectionItems do + @moduledoc """ + List of widget autocomplete results. + + ## Attributes + + * `items` (*type:* `list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem.t)`, *default:* `nil`) - An array of the SelectionItem objects. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :items => list(GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem.t()) | nil + } + + field(:items, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1SelectionItem, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.SelectionItems do + def decode(value, options) do + GoogleApi.Chat.V1.Model.SelectionItems.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.SelectionItems do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/set_up_space_request.ex b/clients/chat/lib/google_api/chat/v1/model/set_up_space_request.ex new file mode 100644 index 0000000000..82f24377f7 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/set_up_space_request.ex @@ -0,0 +1,52 @@ +# 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.Chat.V1.Model.SetUpSpaceRequest do + @moduledoc """ + + + ## Attributes + + * `memberships` (*type:* `list(GoogleApi.Chat.V1.Model.Membership.t)`, *default:* `nil`) - Optional. The Google Chat users to invite to join the space. Omit the calling user, as they are added automatically. The set currently allows up to 20 memberships (in addition to the caller). The `Membership.member` field must contain a `user` with `name` populated (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only add human users when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user's email as an alias for {user}. For example, the `user.name` can be `users/example@gmail.com`." To invite Gmail users or users from external Google Workspace domains, user's email must be used for `{user}`. Optional when setting `Space.spaceType` to `SPACE`. Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at least two memberships. Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human user, along with exactly one membership. Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). + * `requestId` (*type:* `String.t`, *default:* `nil`) - Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error. + * `space` (*type:* `GoogleApi.Chat.V1.Model.Space.t`, *default:* `nil`) - Required. The `Space.spaceType` field is required. To create a space, set `Space.spaceType` to `SPACE` and set `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. To create a group chat, set `Space.spaceType` to `GROUP_CHAT`. Don't set `Space.displayName`. To create a 1:1 conversation between humans, set `Space.spaceType` to `DIRECT_MESSAGE` and set `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or `Space.spaceDetails`. To create an 1:1 conversation between a human and the calling Chat app, set `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or `Space.spaceDetails`. If a `DIRECT_MESSAGE` space already exists, that space is returned instead of creating a new space. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :memberships => list(GoogleApi.Chat.V1.Model.Membership.t()) | nil, + :requestId => String.t() | nil, + :space => GoogleApi.Chat.V1.Model.Space.t() | nil + } + + field(:memberships, as: GoogleApi.Chat.V1.Model.Membership, type: :list) + field(:requestId) + field(:space, as: GoogleApi.Chat.V1.Model.Space) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.SetUpSpaceRequest do + def decode(value, options) do + GoogleApi.Chat.V1.Model.SetUpSpaceRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.SetUpSpaceRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/slash_command.ex b/clients/chat/lib/google_api/chat/v1/model/slash_command.ex index bffce5fd95..28158316ee 100644 --- a/clients/chat/lib/google_api/chat/v1/model/slash_command.ex +++ b/clients/chat/lib/google_api/chat/v1/model/slash_command.ex @@ -21,7 +21,7 @@ defmodule GoogleApi.Chat.V1.Model.SlashCommand do ## Attributes - * `commandId` (*type:* `String.t`, *default:* `nil`) - The id of the slash command invoked. + * `commandId` (*type:* `String.t`, *default:* `nil`) - The ID of the slash command invoked. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/slash_command_metadata.ex b/clients/chat/lib/google_api/chat/v1/model/slash_command_metadata.ex index 2920171a8a..c8fd071755 100644 --- a/clients/chat/lib/google_api/chat/v1/model/slash_command_metadata.ex +++ b/clients/chat/lib/google_api/chat/v1/model/slash_command_metadata.ex @@ -22,9 +22,9 @@ defmodule GoogleApi.Chat.V1.Model.SlashCommandMetadata do ## Attributes * `bot` (*type:* `GoogleApi.Chat.V1.Model.User.t`, *default:* `nil`) - The Chat app whose command was invoked. - * `commandId` (*type:* `String.t`, *default:* `nil`) - The command id of the invoked slash command. + * `commandId` (*type:* `String.t`, *default:* `nil`) - The command ID of the invoked slash command. * `commandName` (*type:* `String.t`, *default:* `nil`) - The name of the invoked slash command. - * `triggersDialog` (*type:* `boolean()`, *default:* `nil`) - Indicating whether the slash command is for a dialog. + * `triggersDialog` (*type:* `boolean()`, *default:* `nil`) - Indicates whether the slash command is for a dialog. * `type` (*type:* `String.t`, *default:* `nil`) - The type of slash command. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/space.ex b/clients/chat/lib/google_api/chat/v1/model/space.ex index eeb8747fba..59c980c19e 100644 --- a/clients/chat/lib/google_api/chat/v1/model/space.ex +++ b/clients/chat/lib/google_api/chat/v1/model/space.ex @@ -21,32 +21,50 @@ defmodule GoogleApi.Chat.V1.Model.Space do ## Attributes - * `displayName` (*type:* `String.t`, *default:* `nil`) - The space's display name. For direct messages between humans, this field might be empty. - * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the space. Format: spaces/{space} + * `adminInstalled` (*type:* `boolean()`, *default:* `nil`) - Output only. Whether the Chat app was installed by a Google Workspace administrator. Administrators can install a Chat app for their domain, organizational unit, or a group of users. Administrators can only install Chat apps for direct messaging between users and the app. To support admin install, your app must feature direct messaging. + * `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Optional. Immutable. For spaces created in Chat, the time the space was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`. + * `displayName` (*type:* `String.t`, *default:* `nil`) - The space's display name. Required when [creating a space](https://developers.google.com/chat/api/reference/rest/v1/spaces/create). If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters. + * `externalUserAllowed` (*type:* `boolean()`, *default:* `nil`) - Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a Google Account. By default, the space permits any Google Chat user. * The space is used to [import data to Google Chat] (https://developers.google.com/chat/api/guides/import-data-overview). Import mode spaces must only permit members from the same Google Workspace organization. For existing spaces, this field is output only. + * `importMode` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren't visible to users until the import is complete. + * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the space. Format: `spaces/{space}` * `singleUserBotDm` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether the space is a DM between a Chat app and a single human. * `spaceDetails` (*type:* `GoogleApi.Chat.V1.Model.SpaceDetails.t`, *default:* `nil`) - Details about the space including description and rules. + * `spaceHistoryState` (*type:* `String.t`, *default:* `nil`) - The message history state for messages and threads in this space. * `spaceThreadingState` (*type:* `String.t`, *default:* `nil`) - Output only. The threading state in the Chat space. + * `spaceType` (*type:* `String.t`, *default:* `nil`) - The type of space. Required when creating a space or updating the space type of a space. Output only for other usage. * `threaded` (*type:* `boolean()`, *default:* `nil`) - Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space. - * `type` (*type:* `String.t`, *default:* `nil`) - Output only. Deprecated: Use `singleUserBotDm` or `spaceType` (developer preview) instead. The type of a space. + * `type` (*type:* `String.t`, *default:* `nil`) - Output only. Deprecated: Use `space_type` instead. The type of a space. """ use GoogleApi.Gax.ModelBase @type t :: %__MODULE__{ + :adminInstalled => boolean() | nil, + :createTime => DateTime.t() | nil, :displayName => String.t() | nil, + :externalUserAllowed => boolean() | nil, + :importMode => boolean() | nil, :name => String.t() | nil, :singleUserBotDm => boolean() | nil, :spaceDetails => GoogleApi.Chat.V1.Model.SpaceDetails.t() | nil, + :spaceHistoryState => String.t() | nil, :spaceThreadingState => String.t() | nil, + :spaceType => String.t() | nil, :threaded => boolean() | nil, :type => String.t() | nil } + field(:adminInstalled) + field(:createTime, as: DateTime) field(:displayName) + field(:externalUserAllowed) + field(:importMode) field(:name) field(:singleUserBotDm) field(:spaceDetails, as: GoogleApi.Chat.V1.Model.SpaceDetails) + field(:spaceHistoryState) field(:spaceThreadingState) + field(:spaceType) field(:threaded) field(:type) end diff --git a/clients/chat/lib/google_api/chat/v1/model/space_data_source.ex b/clients/chat/lib/google_api/chat/v1/model/space_data_source.ex new file mode 100644 index 0000000000..d5ac6e0695 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/space_data_source.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.SpaceDataSource do + @moduledoc """ + A data source that populates Google Chat spaces as selection items for a multiselect menu. Only populates spaces that the user is a member of. [Google Chat apps](https://developers.google.com/workspace/chat): + + ## Attributes + + * `defaultToCurrentSpace` (*type:* `boolean()`, *default:* `nil`) - If set to `true`, the multiselect menu selects the current Google Chat space as an item by default. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :defaultToCurrentSpace => boolean() | nil + } + + field(:defaultToCurrentSpace) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.SpaceDataSource do + def decode(value, options) do + GoogleApi.Chat.V1.Model.SpaceDataSource.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.SpaceDataSource do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/space_details.ex b/clients/chat/lib/google_api/chat/v1/model/space_details.ex index 9a3581b77c..eb6f3ec422 100644 --- a/clients/chat/lib/google_api/chat/v1/model/space_details.ex +++ b/clients/chat/lib/google_api/chat/v1/model/space_details.ex @@ -21,8 +21,8 @@ defmodule GoogleApi.Chat.V1.Model.SpaceDetails do ## Attributes - * `description` (*type:* `String.t`, *default:* `nil`) - Optional. A description of the space. It could describe the space's discussion topic, functional purpose, or participants. - * `guidelines` (*type:* `String.t`, *default:* `nil`) - Optional. The space's rules, expectations, and etiquette. + * `description` (*type:* `String.t`, *default:* `nil`) - Optional. A description of the space. For example, describe the space's discussion topic, functional purpose, or participants. Supports up to 150 characters. + * `guidelines` (*type:* `String.t`, *default:* `nil`) - Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/string_inputs.ex b/clients/chat/lib/google_api/chat/v1/model/string_inputs.ex index 3d70aea241..7cd5eb5361 100644 --- a/clients/chat/lib/google_api/chat/v1/model/string_inputs.ex +++ b/clients/chat/lib/google_api/chat/v1/model/string_inputs.ex @@ -21,7 +21,7 @@ defmodule GoogleApi.Chat.V1.Model.StringInputs do ## Attributes - * `value` (*type:* `list(String.t)`, *default:* `nil`) - An array of strings entered by the user. + * `value` (*type:* `list(String.t)`, *default:* `nil`) - An list of strings entered by the user. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/text_button.ex b/clients/chat/lib/google_api/chat/v1/model/text_button.ex index 984d687eb1..8bb737b4be 100644 --- a/clients/chat/lib/google_api/chat/v1/model/text_button.ex +++ b/clients/chat/lib/google_api/chat/v1/model/text_button.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.TextButton do @moduledoc """ - A button with text and onclick action. + A button with text and `onclick` action. ## Attributes - * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The onclick action of the button. + * `onClick` (*type:* `GoogleApi.Chat.V1.Model.OnClick.t`, *default:* `nil`) - The `onclick` action of the button. * `text` (*type:* `String.t`, *default:* `nil`) - The text of the button. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/text_paragraph.ex b/clients/chat/lib/google_api/chat/v1/model/text_paragraph.ex index 23862e55ad..73c10b4b02 100644 --- a/clients/chat/lib/google_api/chat/v1/model/text_paragraph.ex +++ b/clients/chat/lib/google_api/chat/v1/model/text_paragraph.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.TextParagraph do @moduledoc """ - A paragraph of text. Formatted text supported. + A paragraph of text. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/thread.ex b/clients/chat/lib/google_api/chat/v1/model/thread.ex index add461f220..c76f0cb7a9 100644 --- a/clients/chat/lib/google_api/chat/v1/model/thread.ex +++ b/clients/chat/lib/google_api/chat/v1/model/thread.ex @@ -17,12 +17,12 @@ defmodule GoogleApi.Chat.V1.Model.Thread do @moduledoc """ - A thread in Google Chat. + A thread in a Google Chat space. For example usage, see [Start or reply to a message thread](https://developers.google.com/chat/api/guides/v1/messages/create#create-message-thread). If you specify a thread when creating a message, you can set the [`messageReplyOption`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption) field to determine what happens if no matching thread is found. ## Attributes - * `name` (*type:* `String.t`, *default:* `nil`) - Resource name of the thread. Example: spaces/{space}/threads/{thread} - * `threadKey` (*type:* `String.t`, *default:* `nil`) - Optional. Opaque thread identifier. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](/chat/api/guides/crudl/messages#start_or_reply_to_a_message_thread). For other requests, this is an output only field. + * `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the thread. Example: `spaces/{space}/threads/{thread}` + * `threadKey` (*type:* `String.t`, *default:* `nil`) - Optional. Input for creating or updating a thread. Otherwise, output only. ID for the thread. Supports up to 4000 characters. This ID is unique to the Chat app that sets it. For example, if multiple Chat apps create a message using the same thread key, the messages are posted in different threads. To reply in a thread created by a person or another Chat app, specify the thread `name` field instead. """ use GoogleApi.Gax.ModelBase diff --git a/clients/chat/lib/google_api/chat/v1/model/time_input.ex b/clients/chat/lib/google_api/chat/v1/model/time_input.ex index 43380c17c5..00fc6c4c4d 100644 --- a/clients/chat/lib/google_api/chat/v1/model/time_input.ex +++ b/clients/chat/lib/google_api/chat/v1/model/time_input.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.TimeInput do @moduledoc """ - Time input values. Not supported by Chat apps. + Time input values. ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/time_zone.ex b/clients/chat/lib/google_api/chat/v1/model/time_zone.ex index a8aa27e4d3..44e94ea923 100644 --- a/clients/chat/lib/google_api/chat/v1/model/time_zone.ex +++ b/clients/chat/lib/google_api/chat/v1/model/time_zone.ex @@ -17,7 +17,7 @@ defmodule GoogleApi.Chat.V1.Model.TimeZone do @moduledoc """ - The timezone ID and offset from Coordinated Universal Time (UTC). Not supported by Chat apps. + The timezone ID and offset from Coordinated Universal Time (UTC). Only supported for the event types [`CARD_CLICKED`](https://developers.google.com/chat/api/reference/rest/v1/EventType#ENUM_VALUES.CARD_CLICKED) and [`SUBMIT_DIALOG`](https://developers.google.com/chat/api/reference/rest/v1/DialogEventType#ENUM_VALUES.SUBMIT_DIALOG). ## Attributes diff --git a/clients/chat/lib/google_api/chat/v1/model/updated_widget.ex b/clients/chat/lib/google_api/chat/v1/model/updated_widget.ex new file mode 100644 index 0000000000..6848a6eaed --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/updated_widget.ex @@ -0,0 +1,49 @@ +# 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.Chat.V1.Model.UpdatedWidget do + @moduledoc """ + The response of the updated widget. Used to provide autocomplete options for a widget. + + ## Attributes + + * `suggestions` (*type:* `GoogleApi.Chat.V1.Model.SelectionItems.t`, *default:* `nil`) - List of widget autocomplete results + * `widget` (*type:* `String.t`, *default:* `nil`) - The ID of the updated widget. The ID must match the one for the widget that triggered the update request. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :suggestions => GoogleApi.Chat.V1.Model.SelectionItems.t() | nil, + :widget => String.t() | nil + } + + field(:suggestions, as: GoogleApi.Chat.V1.Model.SelectionItems) + field(:widget) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.UpdatedWidget do + def decode(value, options) do + GoogleApi.Chat.V1.Model.UpdatedWidget.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.UpdatedWidget do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/upload_attachment_request.ex b/clients/chat/lib/google_api/chat/v1/model/upload_attachment_request.ex new file mode 100644 index 0000000000..636934a5d7 --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/upload_attachment_request.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.UploadAttachmentRequest do + @moduledoc """ + + + ## Attributes + + * `filename` (*type:* `String.t`, *default:* `nil`) - Required. The filename of the attachment, including the file extension. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :filename => String.t() | nil + } + + field(:filename) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.UploadAttachmentRequest do + def decode(value, options) do + GoogleApi.Chat.V1.Model.UploadAttachmentRequest.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.UploadAttachmentRequest do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/upload_attachment_response.ex b/clients/chat/lib/google_api/chat/v1/model/upload_attachment_response.ex new file mode 100644 index 0000000000..1438a4b39b --- /dev/null +++ b/clients/chat/lib/google_api/chat/v1/model/upload_attachment_response.ex @@ -0,0 +1,46 @@ +# 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.Chat.V1.Model.UploadAttachmentResponse do + @moduledoc """ + + + ## Attributes + + * `attachmentDataRef` (*type:* `GoogleApi.Chat.V1.Model.AttachmentDataRef.t`, *default:* `nil`) - Reference to the uploaded attachment. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :attachmentDataRef => GoogleApi.Chat.V1.Model.AttachmentDataRef.t() | nil + } + + field(:attachmentDataRef, as: GoogleApi.Chat.V1.Model.AttachmentDataRef) +end + +defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.UploadAttachmentResponse do + def decode(value, options) do + GoogleApi.Chat.V1.Model.UploadAttachmentResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.UploadAttachmentResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/chat/lib/google_api/chat/v1/model/user.ex b/clients/chat/lib/google_api/chat/v1/model/user.ex index 3f0df229c3..0d7e01e570 100644 --- a/clients/chat/lib/google_api/chat/v1/model/user.ex +++ b/clients/chat/lib/google_api/chat/v1/model/user.ex @@ -17,14 +17,14 @@ defmodule GoogleApi.Chat.V1.Model.User do @moduledoc """ - A user in Google Chat. + A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/chat/api/guides/auth/users), the output for a `User` resource only populates the user's `name` and `type`. ## Attributes * `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. The user's display name. * `domainId` (*type:* `String.t`, *default:* `nil`) - Unique identifier of the user's Google Workspace domain. * `isAnonymous` (*type:* `boolean()`, *default:* `nil`) - Output only. When `true`, the user is deleted or their profile is not visible. - * `name` (*type:* `String.t`, *default:* `nil`) - Resource name for a Google Chat user. For human users, represents a person in the People API or a user in the Admin SDK Directory API. Format: `users/{user}` + * `name` (*type:* `String.t`, *default:* `nil`) - Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API. * `type` (*type:* `String.t`, *default:* `nil`) - User type. """ diff --git a/clients/chat/lib/google_api/chat/v1/model/widget_markup.ex b/clients/chat/lib/google_api/chat/v1/model/widget_markup.ex index 5087b25200..545c5a96a7 100644 --- a/clients/chat/lib/google_api/chat/v1/model/widget_markup.ex +++ b/clients/chat/lib/google_api/chat/v1/model/widget_markup.ex @@ -17,11 +17,11 @@ defmodule GoogleApi.Chat.V1.Model.WidgetMarkup do @moduledoc """ - A widget is a UI element that presents texts, images, etc. + A widget is a UI element that presents text and images. ## Attributes - * `buttons` (*type:* `list(GoogleApi.Chat.V1.Model.Button.t)`, *default:* `nil`) - A list of buttons. Buttons is also oneof data and only one of these fields should be set. + * `buttons` (*type:* `list(GoogleApi.Chat.V1.Model.Button.t)`, *default:* `nil`) - A list of buttons. Buttons is also `oneof data` and only one of these fields should be set. * `image` (*type:* `GoogleApi.Chat.V1.Model.Image.t`, *default:* `nil`) - Display an image in this widget. * `keyValue` (*type:* `GoogleApi.Chat.V1.Model.KeyValue.t`, *default:* `nil`) - Display a key value item in this widget. * `textParagraph` (*type:* `GoogleApi.Chat.V1.Model.TextParagraph.t`, *default:* `nil`) - Display a text paragraph in this widget. diff --git a/clients/chat/mix.exs b/clients/chat/mix.exs index b1897ebf57..7dc3523e75 100644 --- a/clients/chat/mix.exs +++ b/clients/chat/mix.exs @@ -48,7 +48,7 @@ defmodule GoogleApi.Chat.Mixfile do defp description() do """ - Google Chat API client library. Enables apps to fetch information and perform actions in Google Chat. Authentication is a prerequisite for using the Google Chat REST API. + Google Chat API client library. The Google Chat API lets you build Chat apps to integrate your services with Google Chat and manage Chat resources such as spaces, members, and messages. """ end