Skip to content

Commit

Permalink
feat: Automated regeneration of Chat client (#11211)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-27 13:09:20 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 27, 2024
1 parent dba1721 commit 2e581ad
Show file tree
Hide file tree
Showing 29 changed files with 1,192 additions and 12 deletions.
2 changes: 1 addition & 1 deletion clients/chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_chat, "~> 0.33"}]
[{:google_api_chat, "~> 0.34"}]
end
```

Expand Down
130 changes: 128 additions & 2 deletions clients/chat/lib/google_api/chat/v1/api/spaces.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do
* `: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).)
* `: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).) - `accessory_widgets` (Requires [app authentication](/chat/api/guides/auth/service-accounts).)
* `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) -
* `opts` (*type:* `keyword()`) - Call options
Expand Down Expand Up @@ -1113,7 +1113,7 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do
* `: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).)
* `: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).) - `accessory_widgets` (Requires [app authentication](/chat/api/guides/auth/service-accounts).)
* `:body` (*type:* `GoogleApi.Chat.V1.Model.Message.t`) -
* `opts` (*type:* `keyword()`) - Call options
Expand Down Expand Up @@ -1416,4 +1416,130 @@ defmodule GoogleApi.Chat.V1.Api.Spaces do
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.Chat.V1.Model.ListReactionsResponse{}])
end

@doc """
Returns a SpaceEvent. You can request events from up to 28 days before the time of the request. The server will return the most recent version of the resource. For example, if a `google.workspace.chat.message.v1.created` event is requested and the message has since been deleted, the returned event will contain the deleted message resource in the payload. 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. The resource name of the event. Format: `spaces/{space}/spaceEvents/{spaceEvent}`
* `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.SpaceEvent{}}` on success
* `{:error, info}` on failure
"""
@spec chat_spaces_space_events_get(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.Chat.V1.Model.SpaceEvent.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def chat_spaces_space_events_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.SpaceEvent{}])
end

@doc """
Lists SpaceEvents in a space that the caller is a member of. You can request events from up to 28 days before the time of the request. The server will return the most recent version of the resources. For example, if a `google.workspace.chat.message.v1.created` event is requested and the message has since been deleted, the returned event will contain the deleted message resource in the payload. 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 from which to list events. 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").
* `:filter` (*type:* `String.t`) - Required. A query filter. This method supports filtering by: `event_types`, `start_time`, and `end_time`. `event_types`: You must specify at least one event type in your query. `event_types` supports the has `:` operator. To filter by multiple event types, use the `OR` operator. To see the list of currently supported event types, see google.chat.v1.SpaceEvent.event_type `start_time`: Exclusive timestamp from which to start listing space events. You can list events that occurred up to 28 days ago. If unspecified, lists space events from the 28 days ago up to end time. `end_time`: Inclusive timestamp up to which space events are listed. Default value is the present. `start_time` and `end_time` accept a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and support the equals `=` comparison operator. To filter by both `start_time` and `end_time`, use the `AND` operator. For example, the following queries are valid: ``` start_time="2023-08-23T19:20:33+00:00" AND end_time="2023-08-23T19:21:54+00:00" ``` ``` start_time="2023-08-23T19:20:33+00:00" AND (event_types:"google.workspace.chat.space.v1.updated" OR event_types:"google.workspace.chat.message.v1.created") ``` The following queries are invalid: ``` start_time="2023-08-23T19:20:33+00:00" OR end_time="2023-08-23T19:21:54+00:00" ``` ``` event_types:"google.workspace.chat.space.v1.updated" AND event_types:"google.workspace.chat.message.v1.created" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.
* `:pageSize` (*type:* `integer()`) - Optional. The maximum number of space events returned. The service may return fewer than this value. Negative values return an `INVALID_ARGUMENT` error.
* `:pageToken` (*type:* `String.t`) - A page token, received from a previous list space events call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to list space events must match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.Chat.V1.Model.ListSpaceEventsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec chat_spaces_space_events_list(Tesla.Env.client(), String.t(), keyword(), keyword()) ::
{:ok, GoogleApi.Chat.V1.Model.ListSpaceEventsResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def chat_spaces_space_events_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}/spaceEvents", %{
"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.ListSpaceEventsResponse{}])
end
end
2 changes: 1 addition & 1 deletion clients/chat/lib/google_api/chat/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Chat.V1 do
API client metadata for GoogleApi.Chat.V1.
"""

@discovery_revision "20240315"
@discovery_revision "20240324"

def discovery_revision(), do: @discovery_revision
end
46 changes: 46 additions & 0 deletions clients/chat/lib/google_api/chat/v1/model/accessory_widget.ex
Original file line number Diff line number Diff line change
@@ -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.AccessoryWidget do
@moduledoc """
One or more interactive widgets that appear at the bottom of a message. For details, see [Add interactive widgets at the bottom of a message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets).
## Attributes
* `buttonList` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList.t`, *default:* `nil`) - A list of buttons.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:buttonList => GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList.t() | nil
}

field(:buttonList, as: GoogleApi.Chat.V1.Model.GoogleAppsCardV1ButtonList)
end

defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.AccessoryWidget do
def decode(value, options) do
GoogleApi.Chat.V1.Model.AccessoryWidget.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.AccessoryWidget do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1Icon do
* `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 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).
* `materialIcon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1MaterialIcon.t`, *default:* `nil`) - Display one of the [Google Material Icons](https://fonts.google.com/icons). For example, to display a [checkbox icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048), use "material_icon": { "name": "check_box" } Available for Chat apps and in [Developer Preview](https://developers.google.com/workspace/preview) for Google Workspace Add-ons.
* `materialIcon` (*type:* `GoogleApi.Chat.V1.Model.GoogleAppsCardV1MaterialIcon.t`, *default:* `nil`) - Display one of the [Google Material Icons](https://fonts.google.com/icons). For example, to display a [checkbox icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048), use ``` "material_icon": { "name": "check_box" } ``` [Google Chat apps](https://developers.google.com/workspace/chat):
"""

use GoogleApi.Gax.ModelBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

defmodule GoogleApi.Chat.V1.Model.GoogleAppsCardV1MaterialIcon do
@moduledoc """
A [Google Material Icon](https://fonts.google.com/icons), which includes over 2500+ options. For example, to display a [checkbox icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048) with customized weight and grade, write { "name": "check_box", "fill": true, "weight": 300, "grade": -25 } Available for Chat apps and in [Developer Preview](https://developers.google.com/workspace/preview) for Google Workspace Add-ons.
A [Google Material Icon](https://fonts.google.com/icons), which includes over 2500+ options. For example, to display a [checkbox icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048) with customized weight and grade, write the following: ``` { "name": "check_box", "fill": true, "weight": 300, "grade": -25 } ``` [Google Chat apps](https://developers.google.com/workspace/chat):
## Attributes
* `fill` (*type:* `boolean()`, *default:* `nil`) - Whether it renders a filled icon. Default value is false. See Customization in [Google Font Icon](https://fonts.google.com/icons) for details.
* `grade` (*type:* `integer()`, *default:* `nil`) - Weight and grade affect a symbol’s thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If any other value is specified, a broken image icon is displayed. See Customization in [Google Font Icon](https://fonts.google.com/icons) for details.
* `name` (*type:* `String.t`, *default:* `nil`) - The icon name defined in the [Google Material Icon Icon](https://fonts.google.com/icons) in snake_case. e.g. "check_box". Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.
* `weight` (*type:* `integer()`, *default:* `nil`) - The stroke weight of the icon. Choose from {100, 200, 300, 400, 500, 600, 700}. If absent, default value is 400. If any other value is specified, a broken image icon is displayed. See Customization in [Google Font Icon](https://fonts.google.com/icons) for details.
* `fill` (*type:* `boolean()`, *default:* `nil`) - Whether the icon renders as filled. Default value is false. To preview different icon settings, go to [Google Font Icons](https://fonts.google.com/icons) and adjust the settings under **Customize**.
* `grade` (*type:* `integer()`, *default:* `nil`) - Weight and grade affect a symbol’s thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If any other value is specified, a broken image icon is displayed. To preview different icon settings, go to [Google Font Icons](https://fonts.google.com/icons) and adjust the settings under **Customize**.
* `name` (*type:* `String.t`, *default:* `nil`) - The icon name defined in the [Google Material Icon](https://fonts.google.com/icons), for example, `check_box`. Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.
* `weight` (*type:* `integer()`, *default:* `nil`) - The stroke weight of the icon. Choose from {100, 200, 300, 400, 500, 600, 700}. If absent, default value is 400. If any other value is specified, a broken image icon is displayed. To preview different icon settings, go to [Google Font Icons](https://fonts.google.com/icons) and adjust the settings under **Customize**.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Loading

0 comments on commit 2e581ad

Please sign in to comment.