From a0e966ed398f29b2e1094de577699aceebb659a8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 2 Oct 2024 20:55:20 +0000 Subject: [PATCH] feat: Add doc for permission settings & announcement space support feat: Add doc for import mode external users support docs: Messages API dev docs improvement docs: Memberships API dev docs improvement docs: Discoverable space docs improvement PiperOrigin-RevId: 681521060 Source-Link: https://github.com/googleapis/googleapis/commit/c472cf7c64e401e8f55353fddab1b5cd81efb607 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a905bb22c968ebdded136b282ef073992fc140c5 Copy-Tag: eyJwIjoiZ29vZ2xlLWFwcHMtY2hhdC12MS8uT3dsQm90LnlhbWwiLCJoIjoiYTkwNWJiMjJjOTY4ZWJkZGVkMTM2YjI4MmVmMDczOTkyZmMxNDBjNSJ9 --- .../google-apps-chat-v1/.gitignore | 22 + .../google-apps-chat-v1/.repo-metadata.json | 17 + .../google-apps-chat-v1/.rubocop.yml | 33 + owl-bot-staging/google-apps-chat-v1/.toys.rb | 28 + owl-bot-staging/google-apps-chat-v1/.yardopts | 12 + .../google-apps-chat-v1/AUTHENTICATION.md | 122 + .../google-apps-chat-v1/CHANGELOG.md | 2 + owl-bot-staging/google-apps-chat-v1/Gemfile | 11 + .../google-apps-chat-v1/LICENSE.md | 201 + owl-bot-staging/google-apps-chat-v1/README.md | 144 + owl-bot-staging/google-apps-chat-v1/Rakefile | 169 + .../google-apps-chat-v1/gapic_metadata.json | 163 + .../google-apps-chat-v1.gemspec | 29 + .../lib/google-apps-chat-v1.rb | 21 + .../lib/google/apps/chat/v1.rb | 45 + .../lib/google/apps/chat/v1/chat_service.rb | 56 + .../apps/chat/v1/chat_service/client.rb | 4389 +++++++++++++++++ .../apps/chat/v1/chat_service/credentials.rb | 68 + .../google/apps/chat/v1/chat_service/paths.rb | 208 + .../google/apps/chat/v1/chat_service/rest.rb | 53 + .../apps/chat/v1/chat_service/rest/client.rb | 4200 ++++++++++++++++ .../chat/v1/chat_service/rest/service_stub.rb | 1789 +++++++ .../lib/google/apps/chat/v1/rest.rb | 37 + .../lib/google/apps/chat/v1/version.rb | 28 + .../lib/google/chat/v1/action_status_pb.rb | 44 + .../lib/google/chat/v1/annotation_pb.rb | 57 + .../lib/google/chat/v1/attachment_pb.rb | 51 + .../lib/google/chat/v1/chat_service_pb.rb | 54 + .../chat/v1/chat_service_services_pb.rb | 438 ++ .../lib/google/chat/v1/contextual_addon_pb.rb | 50 + .../google/chat/v1/deletion_metadata_pb.rb | 43 + .../lib/google/chat/v1/event_payload_pb.rb | 69 + .../lib/google/chat/v1/group_pb.rb | 42 + .../lib/google/chat/v1/history_state_pb.rb | 42 + .../lib/google/chat/v1/matched_url_pb.rb | 44 + .../lib/google/chat/v1/membership_pb.rb | 61 + .../lib/google/chat/v1/message_pb.rb | 89 + .../lib/google/chat/v1/reaction_pb.rb | 54 + .../lib/google/chat/v1/slash_command_pb.rb | 42 + .../lib/google/chat/v1/space_event_pb.rb | 52 + .../lib/google/chat/v1/space_pb.rb | 71 + .../lib/google/chat/v1/space_read_state_pb.rb | 51 + .../lib/google/chat/v1/space_setup_pb.rb | 48 + .../google/chat/v1/thread_read_state_pb.rb | 48 + .../lib/google/chat/v1/user_pb.rb | 46 + .../lib/google/chat/v1/widgets_pb.rb | 53 + .../google-apps-chat-v1/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 420 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/apps/card/v1/card.rb | 2076 ++++++++ .../google/chat/v1/action_status.rb | 40 + .../proto_docs/google/chat/v1/annotation.rb | 213 + .../proto_docs/google/chat/v1/attachment.rb | 131 + .../google/chat/v1/contextual_addon.rb | 120 + .../google/chat/v1/deletion_metadata.rb | 60 + .../google/chat/v1/event_payload.rb | 225 + .../proto_docs/google/chat/v1/group.rb | 41 + .../google/chat/v1/history_state.rb | 42 + .../proto_docs/google/chat/v1/matched_url.rb | 37 + .../proto_docs/google/chat/v1/membership.rb | 366 ++ .../proto_docs/google/chat/v1/message.rb | 658 +++ .../proto_docs/google/chat/v1/reaction.rb | 185 + .../google/chat/v1/slash_command.rb | 37 + .../proto_docs/google/chat/v1/space.rb | 746 +++ .../proto_docs/google/chat/v1/space_event.rb | 287 ++ .../google/chat/v1/space_read_state.rb | 104 + .../proto_docs/google/chat/v1/space_setup.rb | 96 + .../google/chat/v1/thread_read_state.rb | 66 + .../proto_docs/google/chat/v1/user.rb | 84 + .../proto_docs/google/chat/v1/widgets.rb | 293 ++ .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/protobuf/wrappers.rb | 121 + .../proto_docs/google/rpc/code.rb | 185 + .../proto_docs/google/type/color.rb | 173 + .../google-apps-chat-v1/snippets/Gemfile | 32 + .../chat_service/complete_import_space.rb | 47 + .../chat_service/create_membership.rb | 47 + .../snippets/chat_service/create_message.rb | 47 + .../snippets/chat_service/create_reaction.rb | 47 + .../snippets/chat_service/create_space.rb | 47 + .../chat_service/delete_membership.rb | 47 + .../snippets/chat_service/delete_message.rb | 47 + .../snippets/chat_service/delete_reaction.rb | 47 + .../snippets/chat_service/delete_space.rb | 47 + .../chat_service/find_direct_message.rb | 47 + .../snippets/chat_service/get_attachment.rb | 47 + .../snippets/chat_service/get_membership.rb | 47 + .../snippets/chat_service/get_message.rb | 47 + .../snippets/chat_service/get_space.rb | 47 + .../snippets/chat_service/get_space_event.rb | 47 + .../chat_service/get_space_read_state.rb | 47 + .../chat_service/get_thread_read_state.rb | 47 + .../snippets/chat_service/list_memberships.rb | 51 + .../snippets/chat_service/list_messages.rb | 51 + .../snippets/chat_service/list_reactions.rb | 51 + .../chat_service/list_space_events.rb | 51 + .../snippets/chat_service/list_spaces.rb | 51 + .../snippets/chat_service/search_spaces.rb | 51 + .../snippets/chat_service/set_up_space.rb | 47 + .../chat_service/update_membership.rb | 47 + .../snippets/chat_service/update_message.rb | 47 + .../snippets/chat_service/update_space.rb | 47 + .../chat_service/update_space_read_state.rb | 47 + .../chat_service/upload_attachment.rb | 47 + .../snippet_metadata_google.chat.v1.json | 1175 +++++ .../apps/chat/v1/chat_service_paths_test.rb | 155 + .../apps/chat/v1/chat_service_rest_test.rb | 1704 +++++++ .../google/apps/chat/v1/chat_service_test.rb | 1882 +++++++ .../google-apps-chat-v1/test/helper.rb | 25 + 114 files changed, 27437 insertions(+) create mode 100644 owl-bot-staging/google-apps-chat-v1/.gitignore create mode 100644 owl-bot-staging/google-apps-chat-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-apps-chat-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-apps-chat-v1/.toys.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/.yardopts create mode 100644 owl-bot-staging/google-apps-chat-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-apps-chat-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-apps-chat-v1/Gemfile create mode 100644 owl-bot-staging/google-apps-chat-v1/LICENSE.md create mode 100644 owl-bot-staging/google-apps-chat-v1/README.md create mode 100644 owl-bot-staging/google-apps-chat-v1/Rakefile create mode 100644 owl-bot-staging/google-apps-chat-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-chat-v1/google-apps-chat-v1.gemspec create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google-apps-chat-v1.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/credentials.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/paths.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/rest.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/version.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/action_status_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/annotation_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/attachment_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/contextual_addon_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/deletion_metadata_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/event_payload_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/group_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/history_state_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/matched_url_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/message_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/reaction_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/slash_command_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_event_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_read_state_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_setup_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/thread_read_state_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/user_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/widgets_pb.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/apps/card/v1/card.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/action_status.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/annotation.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/attachment.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/contextual_addon.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/deletion_metadata.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/event_payload.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/group.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/history_state.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/matched_url.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/message.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/reaction.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/slash_command.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_event.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_read_state.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_setup.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/thread_read_state.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/user.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/widgets.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/rpc/code.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/type/color.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/complete_import_space.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_membership.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_message.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_reaction.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_space.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_membership.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_message.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_reaction.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_space.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_direct_message.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_attachment.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_membership.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_message.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_event.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_read_state.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_thread_read_state.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_memberships.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_messages.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_reactions.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_space_events.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_spaces.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/search_spaces.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/set_up_space.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_membership.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_message.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_read_state.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/upload_attachment.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json create mode 100644 owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_paths_test.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/test/helper.rb diff --git a/owl-bot-staging/google-apps-chat-v1/.gitignore b/owl-bot-staging/google-apps-chat-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-apps-chat-v1/.repo-metadata.json b/owl-bot-staging/google-apps-chat-v1/.repo-metadata.json new file mode 100644 index 000000000000..8ca7b480bd43 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "chat.googleapis.com", + "api_shortname": "chat", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-apps-chat-v1/latest", + "distribution_name": "google-apps-chat-v1", + "is_cloud": true, + "language": "ruby", + "name": "chat", + "name_pretty": "Google Chat V1 API", + "product_documentation": "https://developers.google.com/chat/concepts", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "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. Note that google-apps-chat-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-apps-chat instead. See the readme for more details.", + "ruby-cloud-product-url": "https://developers.google.com/chat/concepts", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-apps-chat-v1/.rubocop.yml b/owl-bot-staging/google-apps-chat-v1/.rubocop.yml new file mode 100644 index 000000000000..8b1490630576 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-apps-chat-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-apps-chat-v1.rb" diff --git a/owl-bot-staging/google-apps-chat-v1/.toys.rb b/owl-bot-staging/google-apps-chat-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-apps-chat-v1/.yardopts b/owl-bot-staging/google-apps-chat-v1/.yardopts new file mode 100644 index 000000000000..a7d36c714d7e --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Chat V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-apps-chat-v1/AUTHENTICATION.md b/owl-bot-staging/google-apps-chat-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..3ada4e89f790 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-apps-chat-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-apps-chat-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/apps/chat/v1" + +client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/apps/chat/v1" + +::Google::Apps::Chat::V1::ChatService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Apps::Chat::V1::ChatService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-apps-chat-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/apps/chat/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Apps::Chat::V1::ChatService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-apps-chat-v1/CHANGELOG.md b/owl-bot-staging/google-apps-chat-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-apps-chat-v1/Gemfile b/owl-bot-staging/google-apps-chat-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-apps-chat-v1/LICENSE.md b/owl-bot-staging/google-apps-chat-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/owl-bot-staging/google-apps-chat-v1/README.md b/owl-bot-staging/google-apps-chat-v1/README.md new file mode 100644 index 000000000000..3ca6f37b3ff0 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/README.md @@ -0,0 +1,144 @@ +# Ruby Client for the Google Chat V1 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. + +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. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Google Chat V1 API. Most users should consider using +the main client gem, +[google-apps-chat](https://rubygems.org/gems/google-apps-chat). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-apps-chat-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/chat.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/apps/chat/v1" + +client = ::Google::Apps::Chat::V1::ChatService::Client.new +request = ::Google::Apps::Chat::V1::CreateMessageRequest.new # (request fields as keyword arguments...) +response = client.create_message request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-apps-chat-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://developers.google.com/chat/concepts) +for general usage information. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.7+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-apps-chat`, +and lower-level _versioned_ client libraries with names such as +`google-apps-chat-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-apps-chat`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-apps-chat-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-apps-chat-v1/Rakefile b/owl-bot-staging/google-apps-chat-v1/Rakefile new file mode 100644 index 000000000000..a7e1e664b5ae --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-apps-chat-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/apps/chat/v1/chat_service/credentials" + ::Google::Apps::Chat::V1::ChatService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-apps-chat-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-apps-chat-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-apps-chat-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-apps-chat-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-apps-chat-v1" + header "google-apps-chat-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-apps-chat-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-apps-chat-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-apps-chat-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-apps-chat-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-apps-chat-v1/gapic_metadata.json b/owl-bot-staging/google-apps-chat-v1/gapic_metadata.json new file mode 100644 index 000000000000..c6e9e04a82d7 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/gapic_metadata.json @@ -0,0 +1,163 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.chat.v1", + "libraryPackage": "::Google::Apps::Chat::V1", + "services": { + "ChatService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Apps::Chat::V1::ChatService::Client", + "rpcs": { + "CreateMessage": { + "methods": [ + "create_message" + ] + }, + "ListMessages": { + "methods": [ + "list_messages" + ] + }, + "ListMemberships": { + "methods": [ + "list_memberships" + ] + }, + "GetMembership": { + "methods": [ + "get_membership" + ] + }, + "GetMessage": { + "methods": [ + "get_message" + ] + }, + "UpdateMessage": { + "methods": [ + "update_message" + ] + }, + "DeleteMessage": { + "methods": [ + "delete_message" + ] + }, + "GetAttachment": { + "methods": [ + "get_attachment" + ] + }, + "UploadAttachment": { + "methods": [ + "upload_attachment" + ] + }, + "ListSpaces": { + "methods": [ + "list_spaces" + ] + }, + "SearchSpaces": { + "methods": [ + "search_spaces" + ] + }, + "GetSpace": { + "methods": [ + "get_space" + ] + }, + "CreateSpace": { + "methods": [ + "create_space" + ] + }, + "SetUpSpace": { + "methods": [ + "set_up_space" + ] + }, + "UpdateSpace": { + "methods": [ + "update_space" + ] + }, + "DeleteSpace": { + "methods": [ + "delete_space" + ] + }, + "CompleteImportSpace": { + "methods": [ + "complete_import_space" + ] + }, + "FindDirectMessage": { + "methods": [ + "find_direct_message" + ] + }, + "CreateMembership": { + "methods": [ + "create_membership" + ] + }, + "UpdateMembership": { + "methods": [ + "update_membership" + ] + }, + "DeleteMembership": { + "methods": [ + "delete_membership" + ] + }, + "CreateReaction": { + "methods": [ + "create_reaction" + ] + }, + "ListReactions": { + "methods": [ + "list_reactions" + ] + }, + "DeleteReaction": { + "methods": [ + "delete_reaction" + ] + }, + "GetSpaceReadState": { + "methods": [ + "get_space_read_state" + ] + }, + "UpdateSpaceReadState": { + "methods": [ + "update_space_read_state" + ] + }, + "GetThreadReadState": { + "methods": [ + "get_thread_read_state" + ] + }, + "GetSpaceEvent": { + "methods": [ + "get_space_event" + ] + }, + "ListSpaceEvents": { + "methods": [ + "list_space_events" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-apps-chat-v1/google-apps-chat-v1.gemspec b/owl-bot-staging/google-apps-chat-v1/google-apps-chat-v1.gemspec new file mode 100644 index 000000000000..f49c70d16a8e --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/google-apps-chat-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/apps/chat/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-apps-chat-v1" + gem.version = Google::Apps::Chat::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "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. Note that google-apps-chat-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-apps-chat instead. See the readme for more details." + gem.summary = "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." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-apps-card-v1", "> 0.0", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google-apps-chat-v1.rb b/owl-bot-staging/google-apps-chat-v1/lib/google-apps-chat-v1.rb new file mode 100644 index 000000000000..874877ed13ab --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google-apps-chat-v1.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/apps/chat/v1" diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1.rb new file mode 100644 index 000000000000..2766ff3df1da --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/apps/chat/v1/chat_service" +require "google/apps/chat/v1/version" + +module Google + module Apps + module Chat + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/apps/chat/v1" + # client = ::Google::Apps::Chat::V1::ChatService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/apps/chat/v1" + # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/apps/chat/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service.rb new file mode 100644 index 000000000000..59be29298253 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/apps/chat/v1/version" + +require "google/apps/chat/v1/chat_service/credentials" +require "google/apps/chat/v1/chat_service/paths" +require "google/apps/chat/v1/chat_service/client" +require "google/apps/chat/v1/chat_service/rest" + +module Google + module Apps + module Chat + module V1 + ## + # Enables developers to build Chat apps and + # integrations on Google Chat Platform. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/apps/chat/v1/chat_service" + # client = ::Google::Apps::Chat::V1::ChatService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/apps/chat/v1/chat_service/rest" + # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + module ChatService + end + end + end + end +end + +helper_path = ::File.join __dir__, "chat_service", "helpers.rb" +require "google/apps/chat/v1/chat_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb new file mode 100644 index 000000000000..8b5806994c7d --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb @@ -0,0 +1,4389 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/chat/v1/chat_service_pb" + +module Google + module Apps + module Chat + module V1 + module ChatService + ## + # Client for the ChatService service. + # + # Enables developers to build Chat apps and + # integrations on Google Chat Platform. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chat.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :chat_service_stub + + ## + # Configure the ChatService Client class. + # + # See {::Google::Apps::Chat::V1::ChatService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ChatService clients + # ::Google::Apps::Chat::V1::ChatService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Apps", "Chat", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_message.timeout = 30.0 + default_config.rpcs.create_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_messages.timeout = 30.0 + default_config.rpcs.list_messages.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_memberships.timeout = 30.0 + default_config.rpcs.list_memberships.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_membership.timeout = 30.0 + default_config.rpcs.get_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_message.timeout = 30.0 + default_config.rpcs.get_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_message.timeout = 30.0 + default_config.rpcs.update_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_message.timeout = 30.0 + default_config.rpcs.delete_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_attachment.timeout = 30.0 + default_config.rpcs.get_attachment.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.upload_attachment.timeout = 30.0 + default_config.rpcs.upload_attachment.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_spaces.timeout = 30.0 + default_config.rpcs.list_spaces.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_spaces.timeout = 30.0 + default_config.rpcs.search_spaces.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_space.timeout = 30.0 + default_config.rpcs.get_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_space.timeout = 30.0 + default_config.rpcs.create_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_up_space.timeout = 30.0 + default_config.rpcs.set_up_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_space.timeout = 30.0 + default_config.rpcs.update_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_space.timeout = 30.0 + default_config.rpcs.delete_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.complete_import_space.timeout = 30.0 + default_config.rpcs.complete_import_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.find_direct_message.timeout = 30.0 + default_config.rpcs.find_direct_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_membership.timeout = 30.0 + default_config.rpcs.create_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_membership.timeout = 30.0 + default_config.rpcs.update_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_membership.timeout = 30.0 + default_config.rpcs.delete_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_reaction.timeout = 30.0 + default_config.rpcs.create_reaction.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_reactions.timeout = 30.0 + default_config.rpcs.list_reactions.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_reaction.timeout = 30.0 + default_config.rpcs.delete_reaction.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_space_read_state.timeout = 30.0 + default_config.rpcs.get_space_read_state.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_space_read_state.timeout = 30.0 + default_config.rpcs.update_space_read_state.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_thread_read_state.timeout = 30.0 + default_config.rpcs.get_thread_read_state.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_space_event.timeout = 30.0 + default_config.rpcs.get_space_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_space_events.timeout = 30.0 + default_config.rpcs.list_space_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ChatService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Apps::Chat::V1::ChatService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @chat_service_stub.universe_domain + end + + ## + # Create a new ChatService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ChatService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/chat/v1/chat_service_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @chat_service_stub = ::Gapic::ServiceStub.new( + ::Google::Apps::Chat::V1::ChatService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + end + + # Service calls + + ## + # Creates a message in a Google Chat space. For an example, see [Send a + # message](https://developers.google.com/workspace/chat/create-messages). + # + # The `create()` method requires either user or app authentication. Chat + # attributes the message sender differently depending on the type of + # authentication that you use in your request. + # + # The following image shows how Chat attributes a message when you use app + # authentication. Chat displays the Chat app as the message + # sender. The content of the message can contain text (`text`), cards + # (`cardsV2`), and accessory widgets (`accessoryWidgets`). + # + # ![Message sent with app + # authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) + # + # The following image shows how Chat attributes a message when you use user + # authentication. Chat displays the user as the message sender and attributes + # the Chat app to the message by displaying its name. The content of message + # can only contain text (`text`). + # + # ![Message sent with user + # authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) + # + # The maximum message size, including the message contents, is 32,000 bytes. + # + # @overload create_message(request, options = nil) + # Pass arguments to `create_message` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_message(parent: nil, message: nil, thread_key: nil, request_id: nil, message_reply_option: nil, message_id: nil) + # Pass arguments to `create_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space in which to create a message. + # + # Format: `spaces/{space}` + # @param message [::Google::Apps::Chat::V1::Message, ::Hash] + # Required. Message body. + # @param thread_key [::String] + # Optional. Deprecated: Use + # {::Google::Apps::Chat::V1::Thread#thread_key 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 + # {::Google::Apps::Chat::V1::Thread#name thread.name}. For example usage, see [Start or + # reply to a message + # thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + # @param request_id [::String] + # 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. + # @param message_reply_option [::Google::Apps::Chat::V1::CreateMessageRequest::MessageReplyOption] + # Optional. Specifies whether a message starts a thread or replies to one. + # Only supported in named spaces. + # @param message_id [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Message] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateMessageRequest.new + # + # # Call the create_message method. + # result = client.create_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Message. + # p result + # + def create_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_message.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :create_message, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists messages in a space that the caller is a member of, including + # messages from blocked members and spaces. If you list messages from a + # space with no messages, the response is an empty object. When using a + # REST/HTTP interface, the response contains an empty JSON object, `{}`. + # For an example, see + # [List + # messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload list_messages(request, options = nil) + # Pass arguments to `list_messages` via a request object, either of type + # {::Google::Apps::Chat::V1::ListMessagesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListMessagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_messages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) + # Pass arguments to `list_messages` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space to list messages from. + # + # Format: `spaces/{space}` + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # 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. + # @param order_by [::String] + # 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`. + # @param show_deleted [::Boolean] + # Whether to include deleted messages. Deleted messages include deleted time + # and metadata about their deletion, but message content is unavailable. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Message>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Message>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListMessagesRequest.new + # + # # Call the list_messages method. + # result = client.list_messages request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Message. + # p item + # end + # + def list_messages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMessagesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_messages.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_messages.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_messages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_messages, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_messages, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists memberships in a space. For an example, see [List users and Google + # Chat apps in a + # space](https://developers.google.com/workspace/chat/list-members). Listing + # memberships with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # 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/workspace/chat/authenticate-authorize-chat-user) + # lists memberships in spaces that the authenticated user has access to. + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload list_memberships(request, options = nil) + # Pass arguments to `list_memberships` via a request object, either of type + # {::Google::Apps::Chat::V1::ListMembershipsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListMembershipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, show_groups: nil, show_invited: nil, use_admin_access: nil) + # Pass arguments to `list_memberships` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space for which to fetch a membership + # list. + # + # Format: spaces/\\{space} + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Optional. A query filter. + # + # You can filter memberships by a member's role + # ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + # and type + # ([`member.type`](https://developers.google.com/workspace/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`. You can also + # filter for `member.type` using the `!=` operator. + # + # To filter by both role and type, use the `AND` operator. To filter by + # either role or type, use the `OR` operator. + # + # Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + # when `use_admin_access` is set to true. Other member type filters will be + # rejected. + # + # For example, the following queries are valid: + # + # ``` + # role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + # member.type = "HUMAN" AND role = "ROLE_MANAGER" + # + # member.type != "BOT" + # ``` + # + # 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. + # @param show_groups [::Boolean] + # Optional. When `true`, also returns memberships associated with a + # {::Google::Apps::Chat::V1::Membership#group_member Google Group}, in + # addition to other types of memberships. If a + # {::Google::Apps::Chat::V1::ListMembershipsRequest#filter filter} is set, + # {::Google::Apps::Chat::V1::Membership#group_member Google Group} + # memberships that don't match the filter criteria aren't returned. + # @param show_invited [::Boolean] + # Optional. When `true`, also returns memberships associated with + # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} members, in + # addition to other types of memberships. If a + # filter is set, + # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} memberships + # that don't match the filter criteria aren't returned. + # + # Currently requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.memberships.readonly` or + # `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Listing app memberships in a space isn't supported when using admin access. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListMembershipsRequest.new + # + # # Call the list_memberships method. + # result = client.list_memberships request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Membership. + # p item + # end + # + def list_memberships request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMembershipsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_memberships.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_memberships.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_memberships.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_memberships, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_memberships, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a membership. For an example, see + # [Get details about a user's or Google Chat app's + # membership](https://developers.google.com/workspace/chat/get-members). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_membership(request, options = nil) + # Pass arguments to `get_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::GetMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_membership(name: nil, use_admin_access: nil) + # Pass arguments to `get_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the membership to retrieve. + # + # To get the app's own membership [by using user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # 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/workspace/chat/authenticate-authorize-chat-user), + # 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. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + # [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Getting app memberships in a space isn't supported when using admin access. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetMembershipRequest.new + # + # # Call the get_membership method. + # result = client.get_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def get_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_membership.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_membership, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a message. + # For an example, see [Get details about a + # message](https://developers.google.com/workspace/chat/get-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # Note: Might return a message from a blocked member or space. + # + # @overload get_message(request, options = nil) + # Pass arguments to `get_message` via a request object, either of type + # {::Google::Apps::Chat::V1::GetMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_message(name: nil) + # Pass arguments to `get_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Message] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetMessageRequest.new + # + # # Call the get_message method. + # result = client.get_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Message. + # p result + # + def get_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_message.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_message, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/update-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # When using app authentication, requests can only update messages + # created by the calling Chat app. + # + # @overload update_message(request, options = nil) + # Pass arguments to `update_message` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_message(message: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param message [::Google::Apps::Chat::V1::Message, ::Hash] + # Required. Message with fields updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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).) + # @param allow_missing [::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/workspace/chat/create-messages#name_a_created_message) + # or the request fails. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Message] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateMessageRequest.new + # + # # Call the update_message method. + # result = client.update_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Message. + # p result + # + def update_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.message&.name + header_params["message.name"] = request.message.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_message.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :update_message, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a message. + # For an example, see [Delete a + # message](https://developers.google.com/workspace/chat/delete-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # When using app authentication, requests can only delete messages + # created by the calling Chat app. + # + # @overload delete_message(request, options = nil) + # Pass arguments to `delete_message` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_message(name: nil, force: nil) + # Pass arguments to `delete_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # @param force [::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/workspace/chat/authenticate-authorize-chat-user). + # Has no effect when [authenticating as a Chat app] + # (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteMessageRequest.new + # + # # Call the delete_message method. + # result = client.delete_message request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_message.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :delete_message, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the metadata of a message attachment. The attachment data is fetched + # using the [media + # API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). + # For an example, see + # [Get metadata about a message + # attachment](https://developers.google.com/workspace/chat/get-media-attachments). + # Requires [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + # + # @overload get_attachment(request, options = nil) + # Pass arguments to `get_attachment` via a request object, either of type + # {::Google::Apps::Chat::V1::GetAttachmentRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetAttachmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_attachment(name: nil) + # Pass arguments to `get_attachment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the attachment, in the form + # `spaces/{space}/messages/{message}/attachments/{attachment}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Attachment] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Attachment] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetAttachmentRequest.new + # + # # Call the get_attachment method. + # result = client.get_attachment request + # + # # The returned object is of type Google::Apps::Chat::V1::Attachment. + # p result + # + def get_attachment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetAttachmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_attachment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_attachment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_attachment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_attachment, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Uploads an attachment. For an example, see + # [Upload media as a file + # attachment](https://developers.google.com/workspace/chat/upload-media-attachments). + # Requires user + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # 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). + # + # @overload upload_attachment(request, options = nil) + # Pass arguments to `upload_attachment` via a request object, either of type + # {::Google::Apps::Chat::V1::UploadAttachmentRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UploadAttachmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upload_attachment(parent: nil, filename: nil) + # Pass arguments to `upload_attachment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the Chat space in which the attachment is + # uploaded. Format "spaces/\\{space}". + # @param filename [::String] + # Required. The filename of the attachment, including the file extension. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::UploadAttachmentResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::UploadAttachmentResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UploadAttachmentRequest.new + # + # # Call the upload_attachment method. + # result = client.upload_attachment request + # + # # The returned object is of type Google::Apps::Chat::V1::UploadAttachmentResponse. + # p result + # + def upload_attachment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UploadAttachmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.upload_attachment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upload_attachment.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_attachment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :upload_attachment, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/list-spaces). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # Lists spaces visible to the caller or authenticated user. Group chats + # and DMs aren't listed until the first message is sent. + # + # To list all named spaces by Google Workspace organization, use the + # [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) + # method using Workspace administrator privileges instead. + # + # @overload list_spaces(request, options = nil) + # Pass arguments to `list_spaces` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSpacesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSpacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_spaces(page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_spaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Optional. A query filter. + # + # You can filter spaces by the space type + # ([`space_type`](https://developers.google.com/workspace/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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListSpacesRequest.new + # + # # Call the list_spaces method. + # result = client.list_spaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Space. + # p item + # end + # + def list_spaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSpacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_spaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_spaces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_spaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_spaces, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_spaces, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of spaces in a Google Workspace organization based on an + # administrator's search. Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + # In the request, set `use_admin_access` to `true`. + # + # @overload search_spaces(request, options = nil) + # Pass arguments to `search_spaces` via a request object, either of type + # {::Google::Apps::Chat::V1::SearchSpacesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::SearchSpacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_spaces(use_admin_access: nil, page_size: nil, page_token: nil, query: nil, order_by: nil) + # Pass arguments to `search_spaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + # [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # This method currently only supports admin access, thus only `true` is + # accepted for this field. + # @param page_size [::Integer] + # 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. If you use a value more than 1000, it's + # automatically changed to 1000. + # @param page_token [::String] + # A token, received from the previous search spaces 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. + # @param query [::String] + # Required. A search query. + # + # You can search by using the following parameters: + # + # - `create_time` + # - `customer` + # - `display_name` + # - `external_user_allowed` + # - `last_active_time` + # - `space_history_state` + # - `space_type` + # + # `create_time` and `last_active_time` accept a timestamp in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + # comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + # + # `customer` is required and is used to indicate which customer + # to fetch spaces from. `customers/my_customer` is the only supported value. + # + # `display_name` only accepts the `HAS` (`:`) operator. The text to + # match is first tokenized into tokens and each token is prefix-matched + # case-insensitively and independently as a substring anywhere in the space's + # `display_name`. For example, `Fun Eve` matches `Fun event` or `The + # evening was fun`, but not `notFun event` or `even`. + # + # `external_user_allowed` accepts either `true` or `false`. + # + # `space_history_state` only accepts values from the [`historyState`] + # (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + # field of a `space` resource. + # + # `space_type` is required and the only valid value is `SPACE`. + # + # Across different fields, only `AND` operators are supported. A valid + # example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + # example is `space_type = "SPACE" OR display_name:"Hello"`. + # + # Among the same field, + # `space_type` doesn't support `AND` or `OR` operators. + # `display_name`, 'space_history_state', and 'external_user_allowed' only + # support `OR` operators. + # `last_active_time` and `create_time` support both `AND` and `OR` operators. + # `AND` can only be used to represent an interval, such as `last_active_time + # < "2022-01-01T00:00:00+00:00" AND last_active_time > + # "2023-01-01T00:00:00+00:00"`. + # + # The following example queries are valid: + # + # ``` + # customer = "customers/my_customer" AND space_type = "SPACE" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # display_name:"Hello World" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (display_name:"Hello World" OR display_name:"Fun event") AND + # (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + # "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + # (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + # ``` + # @param order_by [::String] + # Optional. How the list of spaces is ordered. + # + # Supported attributes to order by are: + # + # - `membership_count.joined_direct_human_user_count` — Denotes the count of + # human users that have directly joined a space. + # - `last_active_time` — Denotes the time when last eligible item is added to + # any topic of this space. + # - `create_time` — Denotes the time of the space creation. + # + # Valid ordering operation values are: + # + # - `ASC` for ascending. Default value. + # + # - `DESC` for descending. + # + # The supported syntax are: + # + # - `membership_count.joined_direct_human_user_count DESC` + # - `membership_count.joined_direct_human_user_count ASC` + # - `last_active_time DESC` + # - `last_active_time ASC` + # - `create_time DESC` + # - `create_time ASC` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::SearchSpacesRequest.new + # + # # Call the search_spaces method. + # result = client.search_spaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Space. + # p item + # end + # + def search_spaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SearchSpacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search_spaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_spaces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_spaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :search_spaces, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :search_spaces, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a space. For an example, see + # [Get details about a + # space](https://developers.google.com/workspace/chat/get-spaces). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_space(request, options = nil) + # Pass arguments to `get_space` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_space(name: nil, use_admin_access: nil) + # Pass arguments to `get_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the space, in the form `spaces/{space}`. + # + # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetSpaceRequest.new + # + # # Call the get_space method. + # result = client.get_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def get_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_space.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_space, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a space with no members. Can be used to create a named space. + # Spaces grouped by topics aren't supported. For an example, see + # [Create a + # space](https://developers.google.com/workspace/chat/create-spaces). + # + # 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. + # + # If you're a member of the [Developer Preview + # program](https://developers.google.com/workspace/preview), you can create a + # group chat in import mode using `spaceType.GROUP_CHAT`. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload create_space(request, options = nil) + # Pass arguments to `create_space` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_space(space: nil, request_id: nil) + # Pass arguments to `create_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space [::Google::Apps::Chat::V1::Space, ::Hash] + # Required. The `displayName` and `spaceType` fields must be populated. Only + # `SpaceType.SPACE` is supported. + # + # If you receive the error message `ALREADY_EXISTS`, + # try a different `displayName`. An existing space within the Google + # Workspace organization might already use this display name. + # + # If you're a member of the [Developer Preview + # program](https://developers.google.com/workspace/preview), + # `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. + # + # The space `name` is assigned on the server so anything specified in this + # field will be ignored. + # @param request_id [::String] + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateSpaceRequest.new + # + # # Call the create_space method. + # result = client.create_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def create_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_space.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :create_space, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 with initial + # members](https://developers.google.com/workspace/chat/set-up-spaces). + # + # To specify the human members to add, add memberships with the appropriate + # `membership.member.name`. 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`. + # + # To specify the Google groups to add, add memberships with the + # appropriate `membership.group_member.name`. To add or invite a Google + # group, use `groups/{group}`, where `{group}` is the `id` for the group from + # the Cloud Identity Groups API. For example, you can use [Cloud Identity + # Groups lookup + # API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + # to retrieve the ID `123456789` for group email `group@example.com`, then + # you can add the group to the space by setting the + # `membership.group_member.name` to `groups/123456789`. Group email is not + # supported, and Google groups can only be added as members in named spaces. + # + # For a named space or group chat, if the caller blocks, or is blocked + # by some members, or doesn't have permission to add 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 + # [Invite or add a user or app to a + # space](https://developers.google.com/workspace/chat/create-members). + # + # 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/workspace/chat/authenticate-authorize-chat-user). + # + # @overload set_up_space(request, options = nil) + # Pass arguments to `set_up_space` via a request object, either of type + # {::Google::Apps::Chat::V1::SetUpSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::SetUpSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_up_space(space: nil, request_id: nil, memberships: nil) + # Pass arguments to `set_up_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space [::Google::Apps::Chat::V1::Space, ::Hash] + # 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. + # @param request_id [::String] + # 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. + # @param memberships [::Array<::Google::Apps::Chat::V1::Membership, ::Hash>] + # Optional. The Google Chat users or groups 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). + # + # For human membership, 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}`. + # + # For Google group membership, the `Membership.group_member` field must + # contain a `group` with `name` populated (format `groups/{group}`). You + # can only add Google groups when setting `Space.spaceType` to `SPACE`. + # + # 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`). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::SetUpSpaceRequest.new + # + # # Call the set_up_space method. + # result = client.set_up_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def set_up_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SetUpSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_up_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_up_space.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_up_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :set_up_space, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a space. For an example, see + # [Update a + # space](https://developers.google.com/workspace/chat/update-spaces). + # + # 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/workspace/chat/authenticate-authorize-chat-user). + # + # @overload update_space(request, options = nil) + # Pass arguments to `update_space` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_space(space: nil, update_mask: nil, use_admin_access: nil) + # Pass arguments to `update_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space [::Google::Apps::Chat::V1::Space, ::Hash] + # Required. Space with fields to be updated. `Space.name` must be + # populated in the form of `spaces/{space}`. Only fields + # specified by `update_mask` are updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The updated field paths, comma separated if there are + # multiple. + # + # You can update the following fields for a space: + # + # `space_details`: Updates the space's description. Supports up to 150 + # characters. + # + # `display_name`: Only supports updating the display name for spaces where + # `spaceType` field is `SPACE`. + # If you receive the error message `ALREADY_EXISTS`, try a different + # value. 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_type` is not supported with `useAdminAccess`. + # + # `space_history_state`: Updates [space history + # settings](https://support.google.com/chat/answer/7664687) by turning + # history on or off for the space. Only supported if history settings are + # enabled for the Google Workspace organization. To update the + # space history state, you must omit all other field masks in your request. + # `space_history_state` is not supported with `useAdminAccess`. + # + # `access_settings.audience`: Updates the [access + # setting](https://support.google.com/chat/answer/11971020) of who can + # discover the space, join the space, and preview the messages in named space + # where `spaceType` field is `SPACE`. If the existing space has a + # target audience, you can remove the audience and restrict space access by + # omitting a value for this field mask. To update access settings for a + # space, the authenticating user must be a space manager and omit all other + # field masks in your request. You can't update this field if the space is in + # [import + # mode](https://developers.google.com/workspace/chat/import-data-overview). + # To learn more, see [Make a space discoverable to specific + # users](https://developers.google.com/workspace/chat/space-target-audience). + # `access_settings.audience` is not supported with `useAdminAccess`. + # + # `permission_settings`: Supports changing the + # [permission settings](https://support.google.com/chat/answer/13340792) + # of a space. + # When updating permission settings, you can only specify + # `permissionSettings` field masks; you cannot update other field masks + # at the same time. `permissionSettings` is not supported with + # `useAdminAccess`. + # The supported field masks include: + # + # - `permission_settings.manageMembersAndGroups` + # - `permission_settings.modifySpaceDetails` + # - `permission_settings.toggleHistory` + # - `permission_settings.useAtMentionAll` + # - `permission_settings.manageApps` + # - `permission_settings.manageWebhooks` + # - `permission_settings.replyMessages` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Some `FieldMask` values are not supported using admin access. For details, + # see the description of `update_mask`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateSpaceRequest.new + # + # # Call the update_space method. + # result = client.update_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def update_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.space&.name + header_params["space.name"] = request.space.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_space.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :update_space, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/delete-spaces). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # from a user who has permission to delete the space. + # + # @overload delete_space(request, options = nil) + # Pass arguments to `delete_space` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_space(name: nil, use_admin_access: nil) + # Pass arguments to `delete_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the space to delete. + # + # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.delete` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteSpaceRequest.new + # + # # Call the delete_space method. + # result = client.delete_space request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_space.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :delete_space, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Completes the + # [import process](https://developers.google.com/workspace/chat/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/workspace/chat/authorize-import). + # + # @overload complete_import_space(request, options = nil) + # Pass arguments to `complete_import_space` via a request object, either of type + # {::Google::Apps::Chat::V1::CompleteImportSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CompleteImportSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload complete_import_space(name: nil) + # Pass arguments to `complete_import_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the import mode space. + # + # Format: `spaces/{space}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::CompleteImportSpaceResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::CompleteImportSpaceResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CompleteImportSpaceRequest.new + # + # # Call the complete_import_space method. + # result = client.complete_import_space request + # + # # The returned object is of type Google::Apps::Chat::V1::CompleteImportSpaceResponse. + # p result + # + def complete_import_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CompleteImportSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.complete_import_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.complete_import_space.timeout, + metadata: metadata, + retry_policy: @config.rpcs.complete_import_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :complete_import_space, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/authenticate-authorize-chat-user), + # returns the direct message space between the specified user and the + # authenticated user. + # + # With [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + # returns the direct message space between the specified user and the calling + # Chat app. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # or [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + # + # @overload find_direct_message(request, options = nil) + # Pass arguments to `find_direct_message` via a request object, either of type + # {::Google::Apps::Chat::V1::FindDirectMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload find_direct_message(name: nil) + # Pass arguments to `find_direct_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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/workspace/chat/authenticate-authorize-chat-user), + # 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::FindDirectMessageRequest.new + # + # # Call the find_direct_message method. + # result = client.find_direct_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def find_direct_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindDirectMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.find_direct_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.find_direct_message.timeout, + metadata: metadata, + retry_policy: @config.rpcs.find_direct_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :find_direct_message, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a membership for the calling Chat app, a user, or a Google Group. + # Creating memberships for other Chat apps isn't supported. + # 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/workspace/chat/authenticate-authorize-chat-user). + # + # For example usage, see: + # + # - [Invite or add a user to a + # space](https://developers.google.com/workspace/chat/create-members#create-user-membership). + # + # - [Invite or add a Google Group to a + # space](https://developers.google.com/workspace/chat/create-members#create-group-membership). + # + # - [Add the Chat app to a + # space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api). + # + # @overload create_membership(request, options = nil) + # Pass arguments to `create_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_membership(parent: nil, membership: nil, use_admin_access: nil) + # Pass arguments to `create_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space for which to create the + # membership. + # + # Format: spaces/\\{space} + # @param membership [::Google::Apps::Chat::V1::Membership, ::Hash] + # Required. The membership relation to create. + # The `memberType` field must contain a user with the `user.name` and + # `user.type` fields populated. The server will assign a resource name + # and overwrite anything specified. + # When a Chat app creates a membership relation for a human user, it must use + # the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + # `user.name` with format `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` of the + # [person](https://developers.google.com/people/api/rest/v1/people) 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`. When a Chat app creates a + # membership relation for itself, it must use the `chat.memberships.app` + # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Creating app memberships or creating memberships for users outside the + # administrator's Google Workspace organization isn't supported using admin + # access. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateMembershipRequest.new + # + # # Call the create_membership method. + # result = client.create_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def create_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_membership.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :create_membership, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a membership. For an example, see [Update a user's membership in + # a space](https://developers.google.com/workspace/chat/update-members). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload update_membership(request, options = nil) + # Pass arguments to `update_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_membership(membership: nil, update_mask: nil, use_admin_access: nil) + # Pass arguments to `update_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param membership [::Google::Apps::Chat::V1::Membership, ::Hash] + # Required. The membership to update. Only fields specified by `update_mask` + # are updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The field paths to update. Separate multiple values with commas + # or use `*` to update all field paths. + # + # Currently supported field paths: + # + # - `role` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateMembershipRequest.new + # + # # Call the update_membership method. + # result = client.update_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def update_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.membership&.name + header_params["membership.name"] = request.membership.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_membership.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :update_membership, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a membership. For an example, see + # [Remove a user or a Google Chat app from a + # space](https://developers.google.com/workspace/chat/delete-members). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload delete_membership(request, options = nil) + # Pass arguments to `delete_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_membership(name: nil, use_admin_access: nil) + # Pass arguments to `delete_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Deleting app memberships in a space isn't supported using admin access. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteMembershipRequest.new + # + # # Call the delete_membership method. + # result = client.delete_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def delete_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_membership.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :delete_membership, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a reaction and adds it to a message. Only unicode emojis are + # supported. For an example, see + # [Add a reaction to a + # message](https://developers.google.com/workspace/chat/create-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload create_reaction(request, options = nil) + # Pass arguments to `create_reaction` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateReactionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateReactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_reaction(parent: nil, reaction: nil) + # Pass arguments to `create_reaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The message where the reaction is created. + # + # Format: `spaces/{space}/messages/{message}` + # @param reaction [::Google::Apps::Chat::V1::Reaction, ::Hash] + # Required. The reaction to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Reaction] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Reaction] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateReactionRequest.new + # + # # Call the create_reaction method. + # result = client.create_reaction request + # + # # The returned object is of type Google::Apps::Chat::V1::Reaction. + # p result + # + def create_reaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateReactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_reaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_reaction.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_reaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :create_reaction, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists reactions to a message. For an example, see + # [List reactions for a + # message](https://developers.google.com/workspace/chat/list-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload list_reactions(request, options = nil) + # Pass arguments to `list_reactions` via a request object, either of type + # {::Google::Apps::Chat::V1::ListReactionsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListReactionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_reactions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_reactions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The message users reacted to. + # + # Format: `spaces/{space}/messages/{message}` + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Optional. A query filter. + # + # You can filter reactions by + # [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + # (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + # [user](https://developers.google.com/workspace/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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListReactionsRequest.new + # + # # Call the list_reactions method. + # result = client.list_reactions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Reaction. + # p item + # end + # + def list_reactions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListReactionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_reactions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_reactions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reactions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_reactions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_reactions, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reaction to a message. Only unicode emojis are supported. + # For an example, see + # [Delete a + # reaction](https://developers.google.com/workspace/chat/delete-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload delete_reaction(request, options = nil) + # Pass arguments to `delete_reaction` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteReactionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteReactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_reaction(name: nil) + # Pass arguments to `delete_reaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the reaction to delete. + # + # Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteReactionRequest.new + # + # # Call the delete_reaction method. + # result = client.delete_reaction request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteReactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_reaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_reaction.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_reaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :delete_reaction, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a user's read state within a space, used to identify + # read and unread messages. For an example, see [Get details about a user's + # space read + # state](https://developers.google.com/workspace/chat/get-space-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_space_read_state(request, options = nil) + # Pass arguments to `get_space_read_state` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceReadStateRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceReadStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_space_read_state(name: nil) + # Pass arguments to `get_space_read_state` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the space read state to retrieve. + # + # Only supports getting read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/spaceReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/spaceReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/spaceReadState + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::SpaceReadState] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::SpaceReadState] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetSpaceReadStateRequest.new + # + # # Call the get_space_read_state method. + # result = client.get_space_read_state request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. + # p result + # + def get_space_read_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceReadStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_space_read_state.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_space_read_state.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_space_read_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_space_read_state, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a user's read state within a space, used to identify read and + # unread messages. For an example, see [Update a user's space read + # state](https://developers.google.com/workspace/chat/update-space-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload update_space_read_state(request, options = nil) + # Pass arguments to `update_space_read_state` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_space_read_state(space_read_state: nil, update_mask: nil) + # Pass arguments to `update_space_read_state` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space_read_state [::Google::Apps::Chat::V1::SpaceReadState, ::Hash] + # Required. The space read state and fields to update. + # + # Only supports updating read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/spaceReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/spaceReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/spaceReadState + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The field paths to update. Currently supported field paths: + # + # - `last_read_time` + # + # When the `last_read_time` is before the latest message create time, the + # space appears as unread in the UI. + # + # To mark the space as read, set `last_read_time` to any value later (larger) + # than the latest message create time. The `last_read_time` is coerced to + # match the latest message create time. Note that the space read state only + # affects the read state of messages that are visible in the space's + # top-level conversation. Replies in threads are unaffected by this + # timestamp, and instead rely on the thread read state. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::SpaceReadState] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::SpaceReadState] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new + # + # # Call the update_space_read_state method. + # result = client.update_space_read_state request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. + # p result + # + def update_space_read_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_space_read_state.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.space_read_state&.name + header_params["space_read_state.name"] = request.space_read_state.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_space_read_state.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_space_read_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :update_space_read_state, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a user's read state within a thread, used to identify + # read and unread messages. For an example, see [Get details about a user's + # thread read + # state](https://developers.google.com/workspace/chat/get-thread-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_thread_read_state(request, options = nil) + # Pass arguments to `get_thread_read_state` via a request object, either of type + # {::Google::Apps::Chat::V1::GetThreadReadStateRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetThreadReadStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_thread_read_state(name: nil) + # Pass arguments to `get_thread_read_state` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the thread read state to retrieve. + # + # Only supports getting read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, + # `users/me/spaces/{space}/threads/{thread}/threadReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/threads/{thread}/threadReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/threads/\\{thread}/threadReadState + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::ThreadReadState] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::ThreadReadState] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetThreadReadStateRequest.new + # + # # Call the get_thread_read_state method. + # result = client.get_thread_read_state request + # + # # The returned object is of type Google::Apps::Chat::V1::ThreadReadState. + # p result + # + def get_thread_read_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetThreadReadStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_thread_read_state.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_thread_read_state.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_thread_read_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_thread_read_state, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns an event from a Google Chat space. The [event + # payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + # contains the most recent version of the resource that changed. For example, + # if you request an event about a new message but the message was later + # updated, the server returns the updated `Message` resource in the event + # payload. + # + # Note: The `permissionSettings` field is not returned in the Space + # object of the Space event data for this request. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # To get an event, the authenticated user must be a member of the space. + # + # For an example, see [Get details about an + # event from a Google Chat + # space](https://developers.google.com/workspace/chat/get-space-event). + # + # @overload get_space_event(request, options = nil) + # Pass arguments to `get_space_event` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceEventRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_space_event(name: nil) + # Pass arguments to `get_space_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the space event. + # + # Format: `spaces/{space}/spaceEvents/{spaceEvent}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::SpaceEvent] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::SpaceEvent] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetSpaceEventRequest.new + # + # # Call the get_space_event method. + # result = client.get_space_event request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceEvent. + # p result + # + def get_space_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_space_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_space_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_space_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_space_event, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists events from a Google Chat space. For each event, the + # [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + # contains the most recent version of the Chat resource. For example, if you + # list events about new space members, the server returns `Membership` + # resources that contain the latest membership details. If new members were + # removed during the requested period, the event payload contains an empty + # `Membership` resource. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # To list events, the authenticated user must be a member of the space. + # + # For an example, see [List events from a Google Chat + # space](https://developers.google.com/workspace/chat/list-space-events). + # + # @overload list_space_events(request, options = nil) + # Pass arguments to `list_space_events` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSpaceEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSpaceEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_space_events(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_space_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the [Google Chat + # space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + # where the events occurred. + # + # Format: `spaces/{space}`. + # @param page_size [::Integer] + # Optional. The maximum number of space events returned. The service might + # return fewer than this value. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Required. A query filter. + # + # You must specify at least one event type (`event_type`) + # using the has `:` operator. To filter by multiple event types, use the `OR` + # operator. Omit batch event types in your filter. The request automatically + # returns any related batch events. For example, if you filter by new + # reactions + # (`google.workspace.chat.reaction.v1.created`), the server also returns + # batch new reactions events + # (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + # event types, see the [`SpaceEvents` reference + # documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + # + # Optionally, you can also filter by start time (`start_time`) and + # end time (`end_time`): + # + # * `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 past 28 days. + # * `end_time`: Inclusive timestamp until which space events are listed. + # If unspecified, lists events up to the time of the request. + # + # To specify a start or end time, use the equals `=` operator and format in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListSpaceEventsRequest.new + # + # # Call the list_space_events method. + # result = client.list_space_events request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::SpaceEvent. + # p item + # end + # + def list_space_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSpaceEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_space_events.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_space_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_space_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_space_events, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_space_events, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ChatService API. + # + # This class represents the configuration for ChatService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Apps::Chat::V1::ChatService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_message to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Apps::Chat::V1::ChatService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_message.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_message.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chat.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the ChatService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_message` + # @return [::Gapic::Config::Method] + # + attr_reader :create_message + ## + # RPC-specific configuration for `list_messages` + # @return [::Gapic::Config::Method] + # + attr_reader :list_messages + ## + # RPC-specific configuration for `list_memberships` + # @return [::Gapic::Config::Method] + # + attr_reader :list_memberships + ## + # RPC-specific configuration for `get_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :get_membership + ## + # RPC-specific configuration for `get_message` + # @return [::Gapic::Config::Method] + # + attr_reader :get_message + ## + # RPC-specific configuration for `update_message` + # @return [::Gapic::Config::Method] + # + attr_reader :update_message + ## + # RPC-specific configuration for `delete_message` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_message + ## + # RPC-specific configuration for `get_attachment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_attachment + ## + # RPC-specific configuration for `upload_attachment` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_attachment + ## + # RPC-specific configuration for `list_spaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_spaces + ## + # RPC-specific configuration for `search_spaces` + # @return [::Gapic::Config::Method] + # + attr_reader :search_spaces + ## + # RPC-specific configuration for `get_space` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space + ## + # RPC-specific configuration for `create_space` + # @return [::Gapic::Config::Method] + # + attr_reader :create_space + ## + # RPC-specific configuration for `set_up_space` + # @return [::Gapic::Config::Method] + # + attr_reader :set_up_space + ## + # RPC-specific configuration for `update_space` + # @return [::Gapic::Config::Method] + # + attr_reader :update_space + ## + # RPC-specific configuration for `delete_space` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_space + ## + # RPC-specific configuration for `complete_import_space` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_import_space + ## + # RPC-specific configuration for `find_direct_message` + # @return [::Gapic::Config::Method] + # + attr_reader :find_direct_message + ## + # RPC-specific configuration for `create_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :create_membership + ## + # RPC-specific configuration for `update_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :update_membership + ## + # RPC-specific configuration for `delete_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_membership + ## + # RPC-specific configuration for `create_reaction` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reaction + ## + # RPC-specific configuration for `list_reactions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reactions + ## + # RPC-specific configuration for `delete_reaction` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reaction + ## + # RPC-specific configuration for `get_space_read_state` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space_read_state + ## + # RPC-specific configuration for `update_space_read_state` + # @return [::Gapic::Config::Method] + # + attr_reader :update_space_read_state + ## + # RPC-specific configuration for `get_thread_read_state` + # @return [::Gapic::Config::Method] + # + attr_reader :get_thread_read_state + ## + # RPC-specific configuration for `get_space_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space_event + ## + # RPC-specific configuration for `list_space_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_space_events + + # @private + def initialize parent_rpcs = nil + create_message_config = parent_rpcs.create_message if parent_rpcs.respond_to? :create_message + @create_message = ::Gapic::Config::Method.new create_message_config + list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages + @list_messages = ::Gapic::Config::Method.new list_messages_config + list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships + @list_memberships = ::Gapic::Config::Method.new list_memberships_config + get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership + @get_membership = ::Gapic::Config::Method.new get_membership_config + get_message_config = parent_rpcs.get_message if parent_rpcs.respond_to? :get_message + @get_message = ::Gapic::Config::Method.new get_message_config + update_message_config = parent_rpcs.update_message if parent_rpcs.respond_to? :update_message + @update_message = ::Gapic::Config::Method.new update_message_config + delete_message_config = parent_rpcs.delete_message if parent_rpcs.respond_to? :delete_message + @delete_message = ::Gapic::Config::Method.new delete_message_config + get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment + @get_attachment = ::Gapic::Config::Method.new get_attachment_config + upload_attachment_config = parent_rpcs.upload_attachment if parent_rpcs.respond_to? :upload_attachment + @upload_attachment = ::Gapic::Config::Method.new upload_attachment_config + list_spaces_config = parent_rpcs.list_spaces if parent_rpcs.respond_to? :list_spaces + @list_spaces = ::Gapic::Config::Method.new list_spaces_config + search_spaces_config = parent_rpcs.search_spaces if parent_rpcs.respond_to? :search_spaces + @search_spaces = ::Gapic::Config::Method.new search_spaces_config + get_space_config = parent_rpcs.get_space if parent_rpcs.respond_to? :get_space + @get_space = ::Gapic::Config::Method.new get_space_config + create_space_config = parent_rpcs.create_space if parent_rpcs.respond_to? :create_space + @create_space = ::Gapic::Config::Method.new create_space_config + set_up_space_config = parent_rpcs.set_up_space if parent_rpcs.respond_to? :set_up_space + @set_up_space = ::Gapic::Config::Method.new set_up_space_config + update_space_config = parent_rpcs.update_space if parent_rpcs.respond_to? :update_space + @update_space = ::Gapic::Config::Method.new update_space_config + delete_space_config = parent_rpcs.delete_space if parent_rpcs.respond_to? :delete_space + @delete_space = ::Gapic::Config::Method.new delete_space_config + complete_import_space_config = parent_rpcs.complete_import_space if parent_rpcs.respond_to? :complete_import_space + @complete_import_space = ::Gapic::Config::Method.new complete_import_space_config + find_direct_message_config = parent_rpcs.find_direct_message if parent_rpcs.respond_to? :find_direct_message + @find_direct_message = ::Gapic::Config::Method.new find_direct_message_config + create_membership_config = parent_rpcs.create_membership if parent_rpcs.respond_to? :create_membership + @create_membership = ::Gapic::Config::Method.new create_membership_config + update_membership_config = parent_rpcs.update_membership if parent_rpcs.respond_to? :update_membership + @update_membership = ::Gapic::Config::Method.new update_membership_config + delete_membership_config = parent_rpcs.delete_membership if parent_rpcs.respond_to? :delete_membership + @delete_membership = ::Gapic::Config::Method.new delete_membership_config + create_reaction_config = parent_rpcs.create_reaction if parent_rpcs.respond_to? :create_reaction + @create_reaction = ::Gapic::Config::Method.new create_reaction_config + list_reactions_config = parent_rpcs.list_reactions if parent_rpcs.respond_to? :list_reactions + @list_reactions = ::Gapic::Config::Method.new list_reactions_config + delete_reaction_config = parent_rpcs.delete_reaction if parent_rpcs.respond_to? :delete_reaction + @delete_reaction = ::Gapic::Config::Method.new delete_reaction_config + get_space_read_state_config = parent_rpcs.get_space_read_state if parent_rpcs.respond_to? :get_space_read_state + @get_space_read_state = ::Gapic::Config::Method.new get_space_read_state_config + update_space_read_state_config = parent_rpcs.update_space_read_state if parent_rpcs.respond_to? :update_space_read_state + @update_space_read_state = ::Gapic::Config::Method.new update_space_read_state_config + get_thread_read_state_config = parent_rpcs.get_thread_read_state if parent_rpcs.respond_to? :get_thread_read_state + @get_thread_read_state = ::Gapic::Config::Method.new get_thread_read_state_config + get_space_event_config = parent_rpcs.get_space_event if parent_rpcs.respond_to? :get_space_event + @get_space_event = ::Gapic::Config::Method.new get_space_event_config + list_space_events_config = parent_rpcs.list_space_events if parent_rpcs.respond_to? :list_space_events + @list_space_events = ::Gapic::Config::Method.new list_space_events_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/credentials.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/credentials.rb new file mode 100644 index 000000000000..32d9b994475c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/credentials.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Apps + module Chat + module V1 + module ChatService + # Credentials for the ChatService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/chat.admin.delete", + "https://www.googleapis.com/auth/chat.admin.memberships", + "https://www.googleapis.com/auth/chat.admin.memberships.readonly", + "https://www.googleapis.com/auth/chat.admin.spaces", + "https://www.googleapis.com/auth/chat.admin.spaces.readonly", + "https://www.googleapis.com/auth/chat.bot", + "https://www.googleapis.com/auth/chat.delete", + "https://www.googleapis.com/auth/chat.import", + "https://www.googleapis.com/auth/chat.memberships", + "https://www.googleapis.com/auth/chat.memberships.app", + "https://www.googleapis.com/auth/chat.memberships.readonly", + "https://www.googleapis.com/auth/chat.messages", + "https://www.googleapis.com/auth/chat.messages.create", + "https://www.googleapis.com/auth/chat.messages.reactions", + "https://www.googleapis.com/auth/chat.messages.reactions.create", + "https://www.googleapis.com/auth/chat.messages.reactions.readonly", + "https://www.googleapis.com/auth/chat.messages.readonly", + "https://www.googleapis.com/auth/chat.spaces", + "https://www.googleapis.com/auth/chat.spaces.create", + "https://www.googleapis.com/auth/chat.spaces.readonly", + "https://www.googleapis.com/auth/chat.users.readstate", + "https://www.googleapis.com/auth/chat.users.readstate.readonly" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/paths.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/paths.rb new file mode 100644 index 000000000000..2d8915acbdc5 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/paths.rb @@ -0,0 +1,208 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + module ChatService + # Path helper methods for the ChatService API. + module Paths + ## + # Create a fully-qualified Attachment resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}/messages/{message}/attachments/{attachment}` + # + # @param space [String] + # @param message [String] + # @param attachment [String] + # + # @return [::String] + def attachment_path space:, message:, attachment: + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + raise ::ArgumentError, "message cannot contain /" if message.to_s.include? "/" + + "spaces/#{space}/messages/#{message}/attachments/#{attachment}" + end + + ## + # Create a fully-qualified Membership resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}/members/{member}` + # + # @param space [String] + # @param member [String] + # + # @return [::String] + def membership_path space:, member: + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + + "spaces/#{space}/members/#{member}" + end + + ## + # Create a fully-qualified Message resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}/messages/{message}` + # + # @param space [String] + # @param message [String] + # + # @return [::String] + def message_path space:, message: + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + + "spaces/#{space}/messages/#{message}" + end + + ## + # Create a fully-qualified QuotedMessageMetadata resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}` + # + # @param space [String] + # @param message [String] + # @param quoted_message_metadata [String] + # + # @return [::String] + def quoted_message_metadata_path space:, message:, quoted_message_metadata: + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + raise ::ArgumentError, "message cannot contain /" if message.to_s.include? "/" + + "spaces/#{space}/messages/#{message}/quotedMessageMetadata/#{quoted_message_metadata}" + end + + ## + # Create a fully-qualified Reaction resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}/messages/{message}/reactions/{reaction}` + # + # @param space [String] + # @param message [String] + # @param reaction [String] + # + # @return [::String] + def reaction_path space:, message:, reaction: + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + raise ::ArgumentError, "message cannot contain /" if message.to_s.include? "/" + + "spaces/#{space}/messages/#{message}/reactions/#{reaction}" + end + + ## + # Create a fully-qualified Space resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}` + # + # @param space [String] + # + # @return [::String] + def space_path space: + "spaces/#{space}" + end + + ## + # Create a fully-qualified SpaceEvent resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}/spaceEvents/{space_event}` + # + # @param space [String] + # @param space_event [String] + # + # @return [::String] + def space_event_path space:, space_event: + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + + "spaces/#{space}/spaceEvents/#{space_event}" + end + + ## + # Create a fully-qualified SpaceReadState resource string. + # + # The resource will be in the following format: + # + # `users/{user}/spaces/{space}/spaceReadState` + # + # @param user [String] + # @param space [String] + # + # @return [::String] + def space_read_state_path user:, space: + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "users/#{user}/spaces/#{space}/spaceReadState" + end + + ## + # Create a fully-qualified Thread resource string. + # + # The resource will be in the following format: + # + # `spaces/{space}/threads/{thread}` + # + # @param space [String] + # @param thread [String] + # + # @return [::String] + def thread_path space:, thread: + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + + "spaces/#{space}/threads/#{thread}" + end + + ## + # Create a fully-qualified ThreadReadState resource string. + # + # The resource will be in the following format: + # + # `users/{user}/spaces/{space}/threads/{thread}/threadReadState` + # + # @param user [String] + # @param space [String] + # @param thread [String] + # + # @return [::String] + def thread_read_state_path user:, space:, thread: + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "space cannot contain /" if space.to_s.include? "/" + + "users/#{user}/spaces/#{space}/threads/#{thread}/threadReadState" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest.rb new file mode 100644 index 000000000000..dabbbd3b868c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/apps/chat/v1/version" + +require "google/apps/chat/v1/chat_service/credentials" +require "google/apps/chat/v1/chat_service/paths" +require "google/apps/chat/v1/chat_service/rest/client" + +module Google + module Apps + module Chat + module V1 + ## + # Enables developers to build Chat apps and + # integrations on Google Chat Platform. + # + # To load this service and instantiate a REST client: + # + # require "google/apps/chat/v1/chat_service/rest" + # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + module ChatService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/apps/chat/v1/chat_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb new file mode 100644 index 000000000000..fcae956d4bfb --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb @@ -0,0 +1,4200 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/chat/v1/chat_service_pb" +require "google/apps/chat/v1/chat_service/rest/service_stub" + +module Google + module Apps + module Chat + module V1 + module ChatService + module Rest + ## + # REST client for the ChatService service. + # + # Enables developers to build Chat apps and + # integrations on Google Chat Platform. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "chat.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :chat_service_stub + + ## + # Configure the ChatService Client class. + # + # See {::Google::Apps::Chat::V1::ChatService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ChatService clients + # ::Google::Apps::Chat::V1::ChatService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Apps", "Chat", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_message.timeout = 30.0 + default_config.rpcs.create_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_messages.timeout = 30.0 + default_config.rpcs.list_messages.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_memberships.timeout = 30.0 + default_config.rpcs.list_memberships.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_membership.timeout = 30.0 + default_config.rpcs.get_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_message.timeout = 30.0 + default_config.rpcs.get_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_message.timeout = 30.0 + default_config.rpcs.update_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_message.timeout = 30.0 + default_config.rpcs.delete_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_attachment.timeout = 30.0 + default_config.rpcs.get_attachment.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.upload_attachment.timeout = 30.0 + default_config.rpcs.upload_attachment.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_spaces.timeout = 30.0 + default_config.rpcs.list_spaces.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_spaces.timeout = 30.0 + default_config.rpcs.search_spaces.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_space.timeout = 30.0 + default_config.rpcs.get_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_space.timeout = 30.0 + default_config.rpcs.create_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.set_up_space.timeout = 30.0 + default_config.rpcs.set_up_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_space.timeout = 30.0 + default_config.rpcs.update_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_space.timeout = 30.0 + default_config.rpcs.delete_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.complete_import_space.timeout = 30.0 + default_config.rpcs.complete_import_space.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.find_direct_message.timeout = 30.0 + default_config.rpcs.find_direct_message.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_membership.timeout = 30.0 + default_config.rpcs.create_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_membership.timeout = 30.0 + default_config.rpcs.update_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_membership.timeout = 30.0 + default_config.rpcs.delete_membership.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_reaction.timeout = 30.0 + default_config.rpcs.create_reaction.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_reactions.timeout = 30.0 + default_config.rpcs.list_reactions.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_reaction.timeout = 30.0 + default_config.rpcs.delete_reaction.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_space_read_state.timeout = 30.0 + default_config.rpcs.get_space_read_state.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_space_read_state.timeout = 30.0 + default_config.rpcs.update_space_read_state.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_thread_read_state.timeout = 30.0 + default_config.rpcs.get_thread_read_state.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_space_event.timeout = 30.0 + default_config.rpcs.get_space_event.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_space_events.timeout = 30.0 + default_config.rpcs.list_space_events.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ChatService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Apps::Chat::V1::ChatService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @chat_service_stub.universe_domain + end + + ## + # Create a new ChatService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ChatService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @chat_service_stub = ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + end + + # Service calls + + ## + # Creates a message in a Google Chat space. For an example, see [Send a + # message](https://developers.google.com/workspace/chat/create-messages). + # + # The `create()` method requires either user or app authentication. Chat + # attributes the message sender differently depending on the type of + # authentication that you use in your request. + # + # The following image shows how Chat attributes a message when you use app + # authentication. Chat displays the Chat app as the message + # sender. The content of the message can contain text (`text`), cards + # (`cardsV2`), and accessory widgets (`accessoryWidgets`). + # + # ![Message sent with app + # authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) + # + # The following image shows how Chat attributes a message when you use user + # authentication. Chat displays the user as the message sender and attributes + # the Chat app to the message by displaying its name. The content of message + # can only contain text (`text`). + # + # ![Message sent with user + # authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) + # + # The maximum message size, including the message contents, is 32,000 bytes. + # + # @overload create_message(request, options = nil) + # Pass arguments to `create_message` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_message(parent: nil, message: nil, thread_key: nil, request_id: nil, message_reply_option: nil, message_id: nil) + # Pass arguments to `create_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space in which to create a message. + # + # Format: `spaces/{space}` + # @param message [::Google::Apps::Chat::V1::Message, ::Hash] + # Required. Message body. + # @param thread_key [::String] + # Optional. Deprecated: Use + # {::Google::Apps::Chat::V1::Thread#thread_key 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 + # {::Google::Apps::Chat::V1::Thread#name thread.name}. For example usage, see [Start or + # reply to a message + # thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + # @param request_id [::String] + # 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. + # @param message_reply_option [::Google::Apps::Chat::V1::CreateMessageRequest::MessageReplyOption] + # Optional. Specifies whether a message starts a thread or replies to one. + # Only supported in named spaces. + # @param message_id [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Message] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateMessageRequest.new + # + # # Call the create_message method. + # result = client.create_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Message. + # p result + # + def create_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_message.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.create_message request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists messages in a space that the caller is a member of, including + # messages from blocked members and spaces. If you list messages from a + # space with no messages, the response is an empty object. When using a + # REST/HTTP interface, the response contains an empty JSON object, `{}`. + # For an example, see + # [List + # messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload list_messages(request, options = nil) + # Pass arguments to `list_messages` via a request object, either of type + # {::Google::Apps::Chat::V1::ListMessagesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListMessagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_messages(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) + # Pass arguments to `list_messages` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space to list messages from. + # + # Format: `spaces/{space}` + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # 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. + # @param order_by [::String] + # 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`. + # @param show_deleted [::Boolean] + # Whether to include deleted messages. Deleted messages include deleted time + # and metadata about their deletion, but message content is unavailable. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Message>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListMessagesRequest.new + # + # # Call the list_messages method. + # result = client.list_messages request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Message. + # p item + # end + # + def list_messages request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMessagesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_messages.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_messages.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_messages.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_messages request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_messages, "messages", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists memberships in a space. For an example, see [List users and Google + # Chat apps in a + # space](https://developers.google.com/workspace/chat/list-members). Listing + # memberships with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # 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/workspace/chat/authenticate-authorize-chat-user) + # lists memberships in spaces that the authenticated user has access to. + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload list_memberships(request, options = nil) + # Pass arguments to `list_memberships` via a request object, either of type + # {::Google::Apps::Chat::V1::ListMembershipsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListMembershipsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_memberships(parent: nil, page_size: nil, page_token: nil, filter: nil, show_groups: nil, show_invited: nil, use_admin_access: nil) + # Pass arguments to `list_memberships` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space for which to fetch a membership + # list. + # + # Format: spaces/\\{space} + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Optional. A query filter. + # + # You can filter memberships by a member's role + # ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + # and type + # ([`member.type`](https://developers.google.com/workspace/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`. You can also + # filter for `member.type` using the `!=` operator. + # + # To filter by both role and type, use the `AND` operator. To filter by + # either role or type, use the `OR` operator. + # + # Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + # when `use_admin_access` is set to true. Other member type filters will be + # rejected. + # + # For example, the following queries are valid: + # + # ``` + # role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + # member.type = "HUMAN" AND role = "ROLE_MANAGER" + # + # member.type != "BOT" + # ``` + # + # 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. + # @param show_groups [::Boolean] + # Optional. When `true`, also returns memberships associated with a + # {::Google::Apps::Chat::V1::Membership#group_member Google Group}, in + # addition to other types of memberships. If a + # {::Google::Apps::Chat::V1::ListMembershipsRequest#filter filter} is set, + # {::Google::Apps::Chat::V1::Membership#group_member Google Group} + # memberships that don't match the filter criteria aren't returned. + # @param show_invited [::Boolean] + # Optional. When `true`, also returns memberships associated with + # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} members, in + # addition to other types of memberships. If a + # filter is set, + # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} memberships + # that don't match the filter criteria aren't returned. + # + # Currently requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.memberships.readonly` or + # `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Listing app memberships in a space isn't supported when using admin access. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListMembershipsRequest.new + # + # # Call the list_memberships method. + # result = client.list_memberships request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Membership. + # p item + # end + # + def list_memberships request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListMembershipsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_memberships.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_memberships.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_memberships.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_memberships request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_memberships, "memberships", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a membership. For an example, see + # [Get details about a user's or Google Chat app's + # membership](https://developers.google.com/workspace/chat/get-members). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_membership(request, options = nil) + # Pass arguments to `get_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::GetMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_membership(name: nil, use_admin_access: nil) + # Pass arguments to `get_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the membership to retrieve. + # + # To get the app's own membership [by using user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # 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/workspace/chat/authenticate-authorize-chat-user), + # 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. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + # [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Getting app memberships in a space isn't supported when using admin access. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetMembershipRequest.new + # + # # Call the get_membership method. + # result = client.get_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def get_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_membership.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_membership request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a message. + # For an example, see [Get details about a + # message](https://developers.google.com/workspace/chat/get-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # Note: Might return a message from a blocked member or space. + # + # @overload get_message(request, options = nil) + # Pass arguments to `get_message` via a request object, either of type + # {::Google::Apps::Chat::V1::GetMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_message(name: nil) + # Pass arguments to `get_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Message] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetMessageRequest.new + # + # # Call the get_message method. + # result = client.get_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Message. + # p result + # + def get_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_message.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_message request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/update-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # When using app authentication, requests can only update messages + # created by the calling Chat app. + # + # @overload update_message(request, options = nil) + # Pass arguments to `update_message` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_message(message: nil, update_mask: nil, allow_missing: nil) + # Pass arguments to `update_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param message [::Google::Apps::Chat::V1::Message, ::Hash] + # Required. Message with fields updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # 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).) + # @param allow_missing [::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/workspace/chat/create-messages#name_a_created_message) + # or the request fails. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Message] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateMessageRequest.new + # + # # Call the update_message method. + # result = client.update_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Message. + # p result + # + def update_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_message.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.update_message request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a message. + # For an example, see [Delete a + # message](https://developers.google.com/workspace/chat/delete-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # When using app authentication, requests can only delete messages + # created by the calling Chat app. + # + # @overload delete_message(request, options = nil) + # Pass arguments to `delete_message` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_message(name: nil, force: nil) + # Pass arguments to `delete_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # @param force [::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/workspace/chat/authenticate-authorize-chat-user). + # Has no effect when [authenticating as a Chat app] + # (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteMessageRequest.new + # + # # Call the delete_message method. + # result = client.delete_message request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_message.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.delete_message request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the metadata of a message attachment. The attachment data is fetched + # using the [media + # API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). + # For an example, see + # [Get metadata about a message + # attachment](https://developers.google.com/workspace/chat/get-media-attachments). + # Requires [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + # + # @overload get_attachment(request, options = nil) + # Pass arguments to `get_attachment` via a request object, either of type + # {::Google::Apps::Chat::V1::GetAttachmentRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetAttachmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_attachment(name: nil) + # Pass arguments to `get_attachment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the attachment, in the form + # `spaces/{space}/messages/{message}/attachments/{attachment}`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Attachment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Attachment] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetAttachmentRequest.new + # + # # Call the get_attachment method. + # result = client.get_attachment request + # + # # The returned object is of type Google::Apps::Chat::V1::Attachment. + # p result + # + def get_attachment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetAttachmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_attachment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_attachment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_attachment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_attachment request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Uploads an attachment. For an example, see + # [Upload media as a file + # attachment](https://developers.google.com/workspace/chat/upload-media-attachments). + # Requires user + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # 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). + # + # @overload upload_attachment(request, options = nil) + # Pass arguments to `upload_attachment` via a request object, either of type + # {::Google::Apps::Chat::V1::UploadAttachmentRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UploadAttachmentRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload upload_attachment(parent: nil, filename: nil) + # Pass arguments to `upload_attachment` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the Chat space in which the attachment is + # uploaded. Format "spaces/\\{space}". + # @param filename [::String] + # Required. The filename of the attachment, including the file extension. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::UploadAttachmentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::UploadAttachmentResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UploadAttachmentRequest.new + # + # # Call the upload_attachment method. + # result = client.upload_attachment request + # + # # The returned object is of type Google::Apps::Chat::V1::UploadAttachmentResponse. + # p result + # + def upload_attachment request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UploadAttachmentRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.upload_attachment.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.upload_attachment.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upload_attachment.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.upload_attachment request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/list-spaces). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # Lists spaces visible to the caller or authenticated user. Group chats + # and DMs aren't listed until the first message is sent. + # + # To list all named spaces by Google Workspace organization, use the + # [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) + # method using Workspace administrator privileges instead. + # + # @overload list_spaces(request, options = nil) + # Pass arguments to `list_spaces` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSpacesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSpacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_spaces(page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_spaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Optional. A query filter. + # + # You can filter spaces by the space type + # ([`space_type`](https://developers.google.com/workspace/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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListSpacesRequest.new + # + # # Call the list_spaces method. + # result = client.list_spaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Space. + # p item + # end + # + def list_spaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSpacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_spaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_spaces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_spaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_spaces request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_spaces, "spaces", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns a list of spaces in a Google Workspace organization based on an + # administrator's search. Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + # In the request, set `use_admin_access` to `true`. + # + # @overload search_spaces(request, options = nil) + # Pass arguments to `search_spaces` via a request object, either of type + # {::Google::Apps::Chat::V1::SearchSpacesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::SearchSpacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_spaces(use_admin_access: nil, page_size: nil, page_token: nil, query: nil, order_by: nil) + # Pass arguments to `search_spaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + # [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # This method currently only supports admin access, thus only `true` is + # accepted for this field. + # @param page_size [::Integer] + # 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. If you use a value more than 1000, it's + # automatically changed to 1000. + # @param page_token [::String] + # A token, received from the previous search spaces 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. + # @param query [::String] + # Required. A search query. + # + # You can search by using the following parameters: + # + # - `create_time` + # - `customer` + # - `display_name` + # - `external_user_allowed` + # - `last_active_time` + # - `space_history_state` + # - `space_type` + # + # `create_time` and `last_active_time` accept a timestamp in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + # comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + # + # `customer` is required and is used to indicate which customer + # to fetch spaces from. `customers/my_customer` is the only supported value. + # + # `display_name` only accepts the `HAS` (`:`) operator. The text to + # match is first tokenized into tokens and each token is prefix-matched + # case-insensitively and independently as a substring anywhere in the space's + # `display_name`. For example, `Fun Eve` matches `Fun event` or `The + # evening was fun`, but not `notFun event` or `even`. + # + # `external_user_allowed` accepts either `true` or `false`. + # + # `space_history_state` only accepts values from the [`historyState`] + # (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + # field of a `space` resource. + # + # `space_type` is required and the only valid value is `SPACE`. + # + # Across different fields, only `AND` operators are supported. A valid + # example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + # example is `space_type = "SPACE" OR display_name:"Hello"`. + # + # Among the same field, + # `space_type` doesn't support `AND` or `OR` operators. + # `display_name`, 'space_history_state', and 'external_user_allowed' only + # support `OR` operators. + # `last_active_time` and `create_time` support both `AND` and `OR` operators. + # `AND` can only be used to represent an interval, such as `last_active_time + # < "2022-01-01T00:00:00+00:00" AND last_active_time > + # "2023-01-01T00:00:00+00:00"`. + # + # The following example queries are valid: + # + # ``` + # customer = "customers/my_customer" AND space_type = "SPACE" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # display_name:"Hello World" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (display_name:"Hello World" OR display_name:"Fun event") AND + # (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + # "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + # (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + # ``` + # @param order_by [::String] + # Optional. How the list of spaces is ordered. + # + # Supported attributes to order by are: + # + # - `membership_count.joined_direct_human_user_count` — Denotes the count of + # human users that have directly joined a space. + # - `last_active_time` — Denotes the time when last eligible item is added to + # any topic of this space. + # - `create_time` — Denotes the time of the space creation. + # + # Valid ordering operation values are: + # + # - `ASC` for ascending. Default value. + # + # - `DESC` for descending. + # + # The supported syntax are: + # + # - `membership_count.joined_direct_human_user_count DESC` + # - `membership_count.joined_direct_human_user_count ASC` + # - `last_active_time DESC` + # - `last_active_time ASC` + # - `create_time DESC` + # - `create_time ASC` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::SearchSpacesRequest.new + # + # # Call the search_spaces method. + # result = client.search_spaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Space. + # p item + # end + # + def search_spaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SearchSpacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.search_spaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_spaces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_spaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.search_spaces request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :search_spaces, "spaces", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a space. For an example, see + # [Get details about a + # space](https://developers.google.com/workspace/chat/get-spaces). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_space(request, options = nil) + # Pass arguments to `get_space` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_space(name: nil, use_admin_access: nil) + # Pass arguments to `get_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the space, in the form `spaces/{space}`. + # + # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetSpaceRequest.new + # + # # Call the get_space method. + # result = client.get_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def get_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_space.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_space request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a space with no members. Can be used to create a named space. + # Spaces grouped by topics aren't supported. For an example, see + # [Create a + # space](https://developers.google.com/workspace/chat/create-spaces). + # + # 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. + # + # If you're a member of the [Developer Preview + # program](https://developers.google.com/workspace/preview), you can create a + # group chat in import mode using `spaceType.GROUP_CHAT`. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload create_space(request, options = nil) + # Pass arguments to `create_space` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_space(space: nil, request_id: nil) + # Pass arguments to `create_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space [::Google::Apps::Chat::V1::Space, ::Hash] + # Required. The `displayName` and `spaceType` fields must be populated. Only + # `SpaceType.SPACE` is supported. + # + # If you receive the error message `ALREADY_EXISTS`, + # try a different `displayName`. An existing space within the Google + # Workspace organization might already use this display name. + # + # If you're a member of the [Developer Preview + # program](https://developers.google.com/workspace/preview), + # `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. + # + # The space `name` is assigned on the server so anything specified in this + # field will be ignored. + # @param request_id [::String] + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateSpaceRequest.new + # + # # Call the create_space method. + # result = client.create_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def create_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_space.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.create_space request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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 with initial + # members](https://developers.google.com/workspace/chat/set-up-spaces). + # + # To specify the human members to add, add memberships with the appropriate + # `membership.member.name`. 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`. + # + # To specify the Google groups to add, add memberships with the + # appropriate `membership.group_member.name`. To add or invite a Google + # group, use `groups/{group}`, where `{group}` is the `id` for the group from + # the Cloud Identity Groups API. For example, you can use [Cloud Identity + # Groups lookup + # API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + # to retrieve the ID `123456789` for group email `group@example.com`, then + # you can add the group to the space by setting the + # `membership.group_member.name` to `groups/123456789`. Group email is not + # supported, and Google groups can only be added as members in named spaces. + # + # For a named space or group chat, if the caller blocks, or is blocked + # by some members, or doesn't have permission to add 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 + # [Invite or add a user or app to a + # space](https://developers.google.com/workspace/chat/create-members). + # + # 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/workspace/chat/authenticate-authorize-chat-user). + # + # @overload set_up_space(request, options = nil) + # Pass arguments to `set_up_space` via a request object, either of type + # {::Google::Apps::Chat::V1::SetUpSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::SetUpSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_up_space(space: nil, request_id: nil, memberships: nil) + # Pass arguments to `set_up_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space [::Google::Apps::Chat::V1::Space, ::Hash] + # 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. + # @param request_id [::String] + # 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. + # @param memberships [::Array<::Google::Apps::Chat::V1::Membership, ::Hash>] + # Optional. The Google Chat users or groups 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). + # + # For human membership, 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}`. + # + # For Google group membership, the `Membership.group_member` field must + # contain a `group` with `name` populated (format `groups/{group}`). You + # can only add Google groups when setting `Space.spaceType` to `SPACE`. + # + # 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`). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::SetUpSpaceRequest.new + # + # # Call the set_up_space method. + # result = client.set_up_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def set_up_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SetUpSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_up_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_up_space.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_up_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.set_up_space request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a space. For an example, see + # [Update a + # space](https://developers.google.com/workspace/chat/update-spaces). + # + # 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/workspace/chat/authenticate-authorize-chat-user). + # + # @overload update_space(request, options = nil) + # Pass arguments to `update_space` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_space(space: nil, update_mask: nil, use_admin_access: nil) + # Pass arguments to `update_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space [::Google::Apps::Chat::V1::Space, ::Hash] + # Required. Space with fields to be updated. `Space.name` must be + # populated in the form of `spaces/{space}`. Only fields + # specified by `update_mask` are updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The updated field paths, comma separated if there are + # multiple. + # + # You can update the following fields for a space: + # + # `space_details`: Updates the space's description. Supports up to 150 + # characters. + # + # `display_name`: Only supports updating the display name for spaces where + # `spaceType` field is `SPACE`. + # If you receive the error message `ALREADY_EXISTS`, try a different + # value. 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_type` is not supported with `useAdminAccess`. + # + # `space_history_state`: Updates [space history + # settings](https://support.google.com/chat/answer/7664687) by turning + # history on or off for the space. Only supported if history settings are + # enabled for the Google Workspace organization. To update the + # space history state, you must omit all other field masks in your request. + # `space_history_state` is not supported with `useAdminAccess`. + # + # `access_settings.audience`: Updates the [access + # setting](https://support.google.com/chat/answer/11971020) of who can + # discover the space, join the space, and preview the messages in named space + # where `spaceType` field is `SPACE`. If the existing space has a + # target audience, you can remove the audience and restrict space access by + # omitting a value for this field mask. To update access settings for a + # space, the authenticating user must be a space manager and omit all other + # field masks in your request. You can't update this field if the space is in + # [import + # mode](https://developers.google.com/workspace/chat/import-data-overview). + # To learn more, see [Make a space discoverable to specific + # users](https://developers.google.com/workspace/chat/space-target-audience). + # `access_settings.audience` is not supported with `useAdminAccess`. + # + # `permission_settings`: Supports changing the + # [permission settings](https://support.google.com/chat/answer/13340792) + # of a space. + # When updating permission settings, you can only specify + # `permissionSettings` field masks; you cannot update other field masks + # at the same time. `permissionSettings` is not supported with + # `useAdminAccess`. + # The supported field masks include: + # + # - `permission_settings.manageMembersAndGroups` + # - `permission_settings.modifySpaceDetails` + # - `permission_settings.toggleHistory` + # - `permission_settings.useAtMentionAll` + # - `permission_settings.manageApps` + # - `permission_settings.manageWebhooks` + # - `permission_settings.replyMessages` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Some `FieldMask` values are not supported using admin access. For details, + # see the description of `update_mask`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateSpaceRequest.new + # + # # Call the update_space method. + # result = client.update_space request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def update_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_space.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.update_space request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/delete-spaces). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # from a user who has permission to delete the space. + # + # @overload delete_space(request, options = nil) + # Pass arguments to `delete_space` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_space(name: nil, use_admin_access: nil) + # Pass arguments to `delete_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the space to delete. + # + # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.delete` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteSpaceRequest.new + # + # # Call the delete_space method. + # result = client.delete_space request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_space.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.delete_space request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Completes the + # [import process](https://developers.google.com/workspace/chat/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/workspace/chat/authorize-import). + # + # @overload complete_import_space(request, options = nil) + # Pass arguments to `complete_import_space` via a request object, either of type + # {::Google::Apps::Chat::V1::CompleteImportSpaceRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CompleteImportSpaceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload complete_import_space(name: nil) + # Pass arguments to `complete_import_space` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the import mode space. + # + # Format: `spaces/{space}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::CompleteImportSpaceResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::CompleteImportSpaceResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CompleteImportSpaceRequest.new + # + # # Call the complete_import_space method. + # result = client.complete_import_space request + # + # # The returned object is of type Google::Apps::Chat::V1::CompleteImportSpaceResponse. + # p result + # + def complete_import_space request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CompleteImportSpaceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.complete_import_space.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.complete_import_space.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.complete_import_space.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.complete_import_space request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # 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/workspace/chat/authenticate-authorize-chat-user), + # returns the direct message space between the specified user and the + # authenticated user. + # + # With [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + # returns the direct message space between the specified user and the calling + # Chat app. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # or [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + # + # @overload find_direct_message(request, options = nil) + # Pass arguments to `find_direct_message` via a request object, either of type + # {::Google::Apps::Chat::V1::FindDirectMessageRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload find_direct_message(name: nil) + # Pass arguments to `find_direct_message` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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/workspace/chat/authenticate-authorize-chat-user), + # 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::FindDirectMessageRequest.new + # + # # Call the find_direct_message method. + # result = client.find_direct_message request + # + # # The returned object is of type Google::Apps::Chat::V1::Space. + # p result + # + def find_direct_message request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindDirectMessageRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.find_direct_message.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.find_direct_message.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.find_direct_message.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.find_direct_message request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a membership for the calling Chat app, a user, or a Google Group. + # Creating memberships for other Chat apps isn't supported. + # 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/workspace/chat/authenticate-authorize-chat-user). + # + # For example usage, see: + # + # - [Invite or add a user to a + # space](https://developers.google.com/workspace/chat/create-members#create-user-membership). + # + # - [Invite or add a Google Group to a + # space](https://developers.google.com/workspace/chat/create-members#create-group-membership). + # + # - [Add the Chat app to a + # space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api). + # + # @overload create_membership(request, options = nil) + # Pass arguments to `create_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_membership(parent: nil, membership: nil, use_admin_access: nil) + # Pass arguments to `create_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the space for which to create the + # membership. + # + # Format: spaces/\\{space} + # @param membership [::Google::Apps::Chat::V1::Membership, ::Hash] + # Required. The membership relation to create. + # The `memberType` field must contain a user with the `user.name` and + # `user.type` fields populated. The server will assign a resource name + # and overwrite anything specified. + # When a Chat app creates a membership relation for a human user, it must use + # the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + # `user.name` with format `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` of the + # [person](https://developers.google.com/people/api/rest/v1/people) 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`. When a Chat app creates a + # membership relation for itself, it must use the `chat.memberships.app` + # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Creating app memberships or creating memberships for users outside the + # administrator's Google Workspace organization isn't supported using admin + # access. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateMembershipRequest.new + # + # # Call the create_membership method. + # result = client.create_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def create_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_membership.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.create_membership request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a membership. For an example, see [Update a user's membership in + # a space](https://developers.google.com/workspace/chat/update-members). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload update_membership(request, options = nil) + # Pass arguments to `update_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_membership(membership: nil, update_mask: nil, use_admin_access: nil) + # Pass arguments to `update_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param membership [::Google::Apps::Chat::V1::Membership, ::Hash] + # Required. The membership to update. Only fields specified by `update_mask` + # are updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The field paths to update. Separate multiple values with commas + # or use `*` to update all field paths. + # + # Currently supported field paths: + # + # - `role` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateMembershipRequest.new + # + # # Call the update_membership method. + # result = client.update_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def update_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_membership.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.update_membership request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a membership. For an example, see + # [Remove a user or a Google Chat app from a + # space](https://developers.google.com/workspace/chat/delete-members). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload delete_membership(request, options = nil) + # Pass arguments to `delete_membership` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteMembershipRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteMembershipRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_membership(name: nil, use_admin_access: nil) + # Pass arguments to `delete_membership` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # 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`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Deleting app memberships in a space isn't supported using admin access. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteMembershipRequest.new + # + # # Call the delete_membership method. + # result = client.delete_membership request + # + # # The returned object is of type Google::Apps::Chat::V1::Membership. + # p result + # + def delete_membership request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteMembershipRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_membership.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_membership.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_membership.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.delete_membership request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a reaction and adds it to a message. Only unicode emojis are + # supported. For an example, see + # [Add a reaction to a + # message](https://developers.google.com/workspace/chat/create-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload create_reaction(request, options = nil) + # Pass arguments to `create_reaction` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateReactionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateReactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_reaction(parent: nil, reaction: nil) + # Pass arguments to `create_reaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The message where the reaction is created. + # + # Format: `spaces/{space}/messages/{message}` + # @param reaction [::Google::Apps::Chat::V1::Reaction, ::Hash] + # Required. The reaction to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Reaction] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Reaction] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::CreateReactionRequest.new + # + # # Call the create_reaction method. + # result = client.create_reaction request + # + # # The returned object is of type Google::Apps::Chat::V1::Reaction. + # p result + # + def create_reaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateReactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_reaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_reaction.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_reaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.create_reaction request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists reactions to a message. For an example, see + # [List reactions for a + # message](https://developers.google.com/workspace/chat/list-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload list_reactions(request, options = nil) + # Pass arguments to `list_reactions` via a request object, either of type + # {::Google::Apps::Chat::V1::ListReactionsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListReactionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_reactions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_reactions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The message users reacted to. + # + # Format: `spaces/{space}/messages/{message}` + # @param page_size [::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. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Optional. A query filter. + # + # You can filter reactions by + # [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + # (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + # [user](https://developers.google.com/workspace/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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Reaction>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListReactionsRequest.new + # + # # Call the list_reactions method. + # result = client.list_reactions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Reaction. + # p item + # end + # + def list_reactions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListReactionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_reactions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_reactions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reactions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_reactions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_reactions, "reactions", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reaction to a message. Only unicode emojis are supported. + # For an example, see + # [Delete a + # reaction](https://developers.google.com/workspace/chat/delete-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload delete_reaction(request, options = nil) + # Pass arguments to `delete_reaction` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteReactionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteReactionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_reaction(name: nil) + # Pass arguments to `delete_reaction` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the reaction to delete. + # + # Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::DeleteReactionRequest.new + # + # # Call the delete_reaction method. + # result = client.delete_reaction request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reaction request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteReactionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_reaction.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_reaction.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_reaction.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.delete_reaction request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a user's read state within a space, used to identify + # read and unread messages. For an example, see [Get details about a user's + # space read + # state](https://developers.google.com/workspace/chat/get-space-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_space_read_state(request, options = nil) + # Pass arguments to `get_space_read_state` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceReadStateRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceReadStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_space_read_state(name: nil) + # Pass arguments to `get_space_read_state` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the space read state to retrieve. + # + # Only supports getting read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/spaceReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/spaceReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/spaceReadState + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceReadState] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceReadState] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetSpaceReadStateRequest.new + # + # # Call the get_space_read_state method. + # result = client.get_space_read_state request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. + # p result + # + def get_space_read_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceReadStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_space_read_state.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_space_read_state.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_space_read_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_space_read_state request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a user's read state within a space, used to identify read and + # unread messages. For an example, see [Update a user's space read + # state](https://developers.google.com/workspace/chat/update-space-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload update_space_read_state(request, options = nil) + # Pass arguments to `update_space_read_state` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_space_read_state(space_read_state: nil, update_mask: nil) + # Pass arguments to `update_space_read_state` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param space_read_state [::Google::Apps::Chat::V1::SpaceReadState, ::Hash] + # Required. The space read state and fields to update. + # + # Only supports updating read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/spaceReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/spaceReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/spaceReadState + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The field paths to update. Currently supported field paths: + # + # - `last_read_time` + # + # When the `last_read_time` is before the latest message create time, the + # space appears as unread in the UI. + # + # To mark the space as read, set `last_read_time` to any value later (larger) + # than the latest message create time. The `last_read_time` is coerced to + # match the latest message create time. Note that the space read state only + # affects the read state of messages that are visible in the space's + # top-level conversation. Replies in threads are unaffected by this + # timestamp, and instead rely on the thread read state. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceReadState] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceReadState] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new + # + # # Call the update_space_read_state method. + # result = client.update_space_read_state request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. + # p result + # + def update_space_read_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_space_read_state.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_space_read_state.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_space_read_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.update_space_read_state request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a user's read state within a thread, used to identify + # read and unread messages. For an example, see [Get details about a user's + # thread read + # state](https://developers.google.com/workspace/chat/get-thread-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # @overload get_thread_read_state(request, options = nil) + # Pass arguments to `get_thread_read_state` via a request object, either of type + # {::Google::Apps::Chat::V1::GetThreadReadStateRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetThreadReadStateRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_thread_read_state(name: nil) + # Pass arguments to `get_thread_read_state` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Resource name of the thread read state to retrieve. + # + # Only supports getting read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, + # `users/me/spaces/{space}/threads/{thread}/threadReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/threads/{thread}/threadReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/threads/\\{thread}/threadReadState + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::ThreadReadState] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ThreadReadState] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetThreadReadStateRequest.new + # + # # Call the get_thread_read_state method. + # result = client.get_thread_read_state request + # + # # The returned object is of type Google::Apps::Chat::V1::ThreadReadState. + # p result + # + def get_thread_read_state request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetThreadReadStateRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_thread_read_state.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_thread_read_state.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_thread_read_state.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_thread_read_state request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns an event from a Google Chat space. The [event + # payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + # contains the most recent version of the resource that changed. For example, + # if you request an event about a new message but the message was later + # updated, the server returns the updated `Message` resource in the event + # payload. + # + # Note: The `permissionSettings` field is not returned in the Space + # object of the Space event data for this request. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # To get an event, the authenticated user must be a member of the space. + # + # For an example, see [Get details about an + # event from a Google Chat + # space](https://developers.google.com/workspace/chat/get-space-event). + # + # @overload get_space_event(request, options = nil) + # Pass arguments to `get_space_event` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceEventRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_space_event(name: nil) + # Pass arguments to `get_space_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the space event. + # + # Format: `spaces/{space}/spaceEvents/{spaceEvent}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceEvent] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::GetSpaceEventRequest.new + # + # # Call the get_space_event method. + # result = client.get_space_event request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceEvent. + # p result + # + def get_space_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceEventRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_space_event.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_space_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_space_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_space_event request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists events from a Google Chat space. For each event, the + # [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + # contains the most recent version of the Chat resource. For example, if you + # list events about new space members, the server returns `Membership` + # resources that contain the latest membership details. If new members were + # removed during the requested period, the event payload contains an empty + # `Membership` resource. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # To list events, the authenticated user must be a member of the space. + # + # For an example, see [List events from a Google Chat + # space](https://developers.google.com/workspace/chat/list-space-events). + # + # @overload list_space_events(request, options = nil) + # Pass arguments to `list_space_events` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSpaceEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSpaceEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_space_events(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_space_events` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Resource name of the [Google Chat + # space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + # where the events occurred. + # + # Format: `spaces/{space}`. + # @param page_size [::Integer] + # Optional. The maximum number of space events returned. The service might + # return fewer than this value. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # 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. + # @param filter [::String] + # Required. A query filter. + # + # You must specify at least one event type (`event_type`) + # using the has `:` operator. To filter by multiple event types, use the `OR` + # operator. Omit batch event types in your filter. The request automatically + # returns any related batch events. For example, if you filter by new + # reactions + # (`google.workspace.chat.reaction.v1.created`), the server also returns + # batch new reactions events + # (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + # event types, see the [`SpaceEvents` reference + # documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + # + # Optionally, you can also filter by start time (`start_time`) and + # end time (`end_time`): + # + # * `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 past 28 days. + # * `end_time`: Inclusive timestamp until which space events are listed. + # If unspecified, lists events up to the time of the request. + # + # To specify a start or end time, use the equals `=` operator and format in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SpaceEvent>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::ListSpaceEventsRequest.new + # + # # Call the list_space_events method. + # result = client.list_space_events request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::SpaceEvent. + # p item + # end + # + def list_space_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSpaceEventsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_space_events.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_space_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_space_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_space_events request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_space_events, "space_events", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the ChatService REST API. + # + # This class represents the configuration for ChatService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Apps::Chat::V1::ChatService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_message to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Apps::Chat::V1::ChatService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_message.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_message.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "chat.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the ChatService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_message` + # @return [::Gapic::Config::Method] + # + attr_reader :create_message + ## + # RPC-specific configuration for `list_messages` + # @return [::Gapic::Config::Method] + # + attr_reader :list_messages + ## + # RPC-specific configuration for `list_memberships` + # @return [::Gapic::Config::Method] + # + attr_reader :list_memberships + ## + # RPC-specific configuration for `get_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :get_membership + ## + # RPC-specific configuration for `get_message` + # @return [::Gapic::Config::Method] + # + attr_reader :get_message + ## + # RPC-specific configuration for `update_message` + # @return [::Gapic::Config::Method] + # + attr_reader :update_message + ## + # RPC-specific configuration for `delete_message` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_message + ## + # RPC-specific configuration for `get_attachment` + # @return [::Gapic::Config::Method] + # + attr_reader :get_attachment + ## + # RPC-specific configuration for `upload_attachment` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_attachment + ## + # RPC-specific configuration for `list_spaces` + # @return [::Gapic::Config::Method] + # + attr_reader :list_spaces + ## + # RPC-specific configuration for `search_spaces` + # @return [::Gapic::Config::Method] + # + attr_reader :search_spaces + ## + # RPC-specific configuration for `get_space` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space + ## + # RPC-specific configuration for `create_space` + # @return [::Gapic::Config::Method] + # + attr_reader :create_space + ## + # RPC-specific configuration for `set_up_space` + # @return [::Gapic::Config::Method] + # + attr_reader :set_up_space + ## + # RPC-specific configuration for `update_space` + # @return [::Gapic::Config::Method] + # + attr_reader :update_space + ## + # RPC-specific configuration for `delete_space` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_space + ## + # RPC-specific configuration for `complete_import_space` + # @return [::Gapic::Config::Method] + # + attr_reader :complete_import_space + ## + # RPC-specific configuration for `find_direct_message` + # @return [::Gapic::Config::Method] + # + attr_reader :find_direct_message + ## + # RPC-specific configuration for `create_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :create_membership + ## + # RPC-specific configuration for `update_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :update_membership + ## + # RPC-specific configuration for `delete_membership` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_membership + ## + # RPC-specific configuration for `create_reaction` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reaction + ## + # RPC-specific configuration for `list_reactions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reactions + ## + # RPC-specific configuration for `delete_reaction` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reaction + ## + # RPC-specific configuration for `get_space_read_state` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space_read_state + ## + # RPC-specific configuration for `update_space_read_state` + # @return [::Gapic::Config::Method] + # + attr_reader :update_space_read_state + ## + # RPC-specific configuration for `get_thread_read_state` + # @return [::Gapic::Config::Method] + # + attr_reader :get_thread_read_state + ## + # RPC-specific configuration for `get_space_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space_event + ## + # RPC-specific configuration for `list_space_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_space_events + + # @private + def initialize parent_rpcs = nil + create_message_config = parent_rpcs.create_message if parent_rpcs.respond_to? :create_message + @create_message = ::Gapic::Config::Method.new create_message_config + list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages + @list_messages = ::Gapic::Config::Method.new list_messages_config + list_memberships_config = parent_rpcs.list_memberships if parent_rpcs.respond_to? :list_memberships + @list_memberships = ::Gapic::Config::Method.new list_memberships_config + get_membership_config = parent_rpcs.get_membership if parent_rpcs.respond_to? :get_membership + @get_membership = ::Gapic::Config::Method.new get_membership_config + get_message_config = parent_rpcs.get_message if parent_rpcs.respond_to? :get_message + @get_message = ::Gapic::Config::Method.new get_message_config + update_message_config = parent_rpcs.update_message if parent_rpcs.respond_to? :update_message + @update_message = ::Gapic::Config::Method.new update_message_config + delete_message_config = parent_rpcs.delete_message if parent_rpcs.respond_to? :delete_message + @delete_message = ::Gapic::Config::Method.new delete_message_config + get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment + @get_attachment = ::Gapic::Config::Method.new get_attachment_config + upload_attachment_config = parent_rpcs.upload_attachment if parent_rpcs.respond_to? :upload_attachment + @upload_attachment = ::Gapic::Config::Method.new upload_attachment_config + list_spaces_config = parent_rpcs.list_spaces if parent_rpcs.respond_to? :list_spaces + @list_spaces = ::Gapic::Config::Method.new list_spaces_config + search_spaces_config = parent_rpcs.search_spaces if parent_rpcs.respond_to? :search_spaces + @search_spaces = ::Gapic::Config::Method.new search_spaces_config + get_space_config = parent_rpcs.get_space if parent_rpcs.respond_to? :get_space + @get_space = ::Gapic::Config::Method.new get_space_config + create_space_config = parent_rpcs.create_space if parent_rpcs.respond_to? :create_space + @create_space = ::Gapic::Config::Method.new create_space_config + set_up_space_config = parent_rpcs.set_up_space if parent_rpcs.respond_to? :set_up_space + @set_up_space = ::Gapic::Config::Method.new set_up_space_config + update_space_config = parent_rpcs.update_space if parent_rpcs.respond_to? :update_space + @update_space = ::Gapic::Config::Method.new update_space_config + delete_space_config = parent_rpcs.delete_space if parent_rpcs.respond_to? :delete_space + @delete_space = ::Gapic::Config::Method.new delete_space_config + complete_import_space_config = parent_rpcs.complete_import_space if parent_rpcs.respond_to? :complete_import_space + @complete_import_space = ::Gapic::Config::Method.new complete_import_space_config + find_direct_message_config = parent_rpcs.find_direct_message if parent_rpcs.respond_to? :find_direct_message + @find_direct_message = ::Gapic::Config::Method.new find_direct_message_config + create_membership_config = parent_rpcs.create_membership if parent_rpcs.respond_to? :create_membership + @create_membership = ::Gapic::Config::Method.new create_membership_config + update_membership_config = parent_rpcs.update_membership if parent_rpcs.respond_to? :update_membership + @update_membership = ::Gapic::Config::Method.new update_membership_config + delete_membership_config = parent_rpcs.delete_membership if parent_rpcs.respond_to? :delete_membership + @delete_membership = ::Gapic::Config::Method.new delete_membership_config + create_reaction_config = parent_rpcs.create_reaction if parent_rpcs.respond_to? :create_reaction + @create_reaction = ::Gapic::Config::Method.new create_reaction_config + list_reactions_config = parent_rpcs.list_reactions if parent_rpcs.respond_to? :list_reactions + @list_reactions = ::Gapic::Config::Method.new list_reactions_config + delete_reaction_config = parent_rpcs.delete_reaction if parent_rpcs.respond_to? :delete_reaction + @delete_reaction = ::Gapic::Config::Method.new delete_reaction_config + get_space_read_state_config = parent_rpcs.get_space_read_state if parent_rpcs.respond_to? :get_space_read_state + @get_space_read_state = ::Gapic::Config::Method.new get_space_read_state_config + update_space_read_state_config = parent_rpcs.update_space_read_state if parent_rpcs.respond_to? :update_space_read_state + @update_space_read_state = ::Gapic::Config::Method.new update_space_read_state_config + get_thread_read_state_config = parent_rpcs.get_thread_read_state if parent_rpcs.respond_to? :get_thread_read_state + @get_thread_read_state = ::Gapic::Config::Method.new get_thread_read_state_config + get_space_event_config = parent_rpcs.get_space_event if parent_rpcs.respond_to? :get_space_event + @get_space_event = ::Gapic::Config::Method.new get_space_event_config + list_space_events_config = parent_rpcs.list_space_events if parent_rpcs.respond_to? :list_space_events + @list_space_events = ::Gapic::Config::Method.new list_space_events_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb new file mode 100644 index 000000000000..4f2d05ae2192 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb @@ -0,0 +1,1789 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/chat/v1/chat_service_pb" + +module Google + module Apps + module Chat + module V1 + module ChatService + module Rest + ## + # REST service stub for the ChatService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateMessageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Message] + # A result object deserialized from the server's reply + def create_message request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_message_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_messages REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListMessagesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::ListMessagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListMessagesResponse] + # A result object deserialized from the server's reply + def list_messages request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_messages_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListMessagesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_memberships REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListMembershipsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::ListMembershipsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListMembershipsResponse] + # A result object deserialized from the server's reply + def list_memberships request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_memberships_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListMembershipsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetMembershipRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # A result object deserialized from the server's reply + def get_membership request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_membership_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetMessageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Message] + # A result object deserialized from the server's reply + def get_message request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_message_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateMessageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Message] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Message] + # A result object deserialized from the server's reply + def update_message request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_message_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteMessageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_message request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_message_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_attachment REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetAttachmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Attachment] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Attachment] + # A result object deserialized from the server's reply + def get_attachment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_attachment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Attachment.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the upload_attachment REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UploadAttachmentRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::UploadAttachmentResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::UploadAttachmentResponse] + # A result object deserialized from the server's reply + def upload_attachment request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upload_attachment_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::UploadAttachmentResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_spaces REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSpacesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::ListSpacesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListSpacesResponse] + # A result object deserialized from the server's reply + def list_spaces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_spaces_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListSpacesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the search_spaces REST call + # + # @param request_pb [::Google::Apps::Chat::V1::SearchSpacesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SearchSpacesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SearchSpacesResponse] + # A result object deserialized from the server's reply + def search_spaces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_spaces_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SearchSpacesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # A result object deserialized from the server's reply + def get_space request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_space_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the create_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateSpaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # A result object deserialized from the server's reply + def create_space request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_space_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the set_up_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::SetUpSpaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # A result object deserialized from the server's reply + def set_up_space request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_up_space_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # A result object deserialized from the server's reply + def update_space request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_space_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteSpaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_space request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_space_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the complete_import_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CompleteImportSpaceRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::CompleteImportSpaceResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::CompleteImportSpaceResponse] + # A result object deserialized from the server's reply + def complete_import_space request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_complete_import_space_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::CompleteImportSpaceResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the find_direct_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::FindDirectMessageRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Space] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Space] + # A result object deserialized from the server's reply + def find_direct_message request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_find_direct_message_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the create_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateMembershipRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # A result object deserialized from the server's reply + def create_membership request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_membership_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateMembershipRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # A result object deserialized from the server's reply + def update_membership request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_membership_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteMembershipRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Membership] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Membership] + # A result object deserialized from the server's reply + def delete_membership request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_membership_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the create_reaction REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateReactionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Reaction] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Reaction] + # A result object deserialized from the server's reply + def create_reaction request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_reaction_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Reaction.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_reactions REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListReactionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::ListReactionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListReactionsResponse] + # A result object deserialized from the server's reply + def list_reactions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reactions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListReactionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_reaction REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteReactionRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_reaction request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_reaction_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_space_read_state REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceReadStateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceReadState] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceReadState] + # A result object deserialized from the server's reply + def get_space_read_state request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_space_read_state_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceReadState.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the update_space_read_state REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceReadState] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceReadState] + # A result object deserialized from the server's reply + def update_space_read_state request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_space_read_state_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceReadState.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_thread_read_state REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetThreadReadStateRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::ThreadReadState] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ThreadReadState] + # A result object deserialized from the server's reply + def get_thread_read_state request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_thread_read_state_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ThreadReadState.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_space_event REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceEventRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceEvent] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceEvent] + # A result object deserialized from the server's reply + def get_space_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_space_event_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceEvent.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_space_events REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSpaceEventsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::ListSpaceEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListSpaceEventsResponse] + # A result object deserialized from the server's reply + def list_space_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_space_events_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListSpaceEventsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateMessageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_message_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/messages", + body: "message", + matches: [ + ["parent", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_messages REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListMessagesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_messages_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/messages", + matches: [ + ["parent", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_memberships REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListMembershipsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_memberships_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/members", + matches: [ + ["parent", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/members/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetMessageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_message_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/messages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateMessageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_message_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :put, + uri_template: "/v1/{message.name}", + body: "message", + matches: [ + ["message.name", %r{^spaces/[^/]+/messages/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{message.name}", + body: "message", + matches: [ + ["message.name", %r{^spaces/[^/]+/messages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteMessageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_message_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/messages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_attachment REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetAttachmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_attachment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/messages/[^/]+/attachments/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upload_attachment REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UploadAttachmentRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upload_attachment_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/attachments:upload", + body: "*", + matches: [ + ["parent", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_spaces REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSpacesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_spaces_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/spaces", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_spaces REST call + # + # @param request_pb [::Google::Apps::Chat::V1::SearchSpacesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_spaces_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/spaces:search", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_space_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateSpaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_space_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/spaces", + body: "space", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_up_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::SetUpSpaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_up_space_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/spaces:setup", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_space_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{space.name}", + body: "space", + matches: [ + ["space.name", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteSpaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_space_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the complete_import_space REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CompleteImportSpaceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_complete_import_space_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:completeImport", + body: "*", + matches: [ + ["name", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the find_direct_message REST call + # + # @param request_pb [::Google::Apps::Chat::V1::FindDirectMessageRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_find_direct_message_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/spaces:findDirectMessage", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/members", + body: "membership", + matches: [ + ["parent", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{membership.name}", + body: "membership", + matches: [ + ["membership.name", %r{^spaces/[^/]+/members/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_membership REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteMembershipRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_membership_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/members/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_reaction REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateReactionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_reaction_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/reactions", + body: "reaction", + matches: [ + ["parent", %r{^spaces/[^/]+/messages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reactions REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListReactionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_reactions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/reactions", + matches: [ + ["parent", %r{^spaces/[^/]+/messages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_reaction REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteReactionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_reaction_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/messages/[^/]+/reactions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_space_read_state REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceReadStateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_space_read_state_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^users/[^/]+/spaces/[^/]+/spaceReadState/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_space_read_state REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_space_read_state_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{space_read_state.name}", + body: "space_read_state", + matches: [ + ["space_read_state.name", %r{^users/[^/]+/spaces/[^/]+/spaceReadState/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_thread_read_state REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetThreadReadStateRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_thread_read_state_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^users/[^/]+/spaces/[^/]+/threads/[^/]+/threadReadState/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_space_event REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceEventRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_space_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^spaces/[^/]+/spaceEvents/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_space_events REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSpaceEventsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_space_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/spaceEvents", + matches: [ + ["parent", %r{^spaces/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/rest.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/rest.rb new file mode 100644 index 000000000000..88966d36a7bb --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/apps/chat/v1/chat_service/rest" +require "google/apps/chat/v1/version" + +module Google + module Apps + module Chat + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/apps/chat/v1/rest" + # client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/version.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/version.rb new file mode 100644 index 000000000000..45c88c488134 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/action_status_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/action_status_pb.rb new file mode 100644 index 000000000000..007fcbda3d3c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/action_status_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/action_status.proto + +require 'google/protobuf' + +require 'google/rpc/code_pb' + + +descriptor_data = "\n\"google/chat/v1/action_status.proto\x12\x0egoogle.chat.v1\x1a\x15google/rpc/code.proto\"R\n\x0c\x41\x63tionStatus\x12%\n\x0bstatus_code\x18\x01 \x01(\x0e\x32\x10.google.rpc.Code\x12\x1b\n\x13user_facing_message\x18\x02 \x01(\tB\xaa\x01\n\x12\x63om.google.chat.v1B\x11\x41\x63tionStatusProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + ActionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ActionStatus").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/annotation_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/annotation_pb.rb new file mode 100644 index 000000000000..123e01339c3a --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/annotation_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/annotation.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/chat/v1/attachment_pb' +require 'google/chat/v1/user_pb' + + +descriptor_data = "\n\x1fgoogle/chat/v1/annotation.proto\x12\x0egoogle.chat.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/chat/v1/attachment.proto\x1a\x19google/chat/v1/user.proto\"\xbc\x02\n\nAnnotation\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.google.chat.v1.AnnotationType\x12\x18\n\x0bstart_index\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x0e\n\x06length\x18\x03 \x01(\x05\x12;\n\x0cuser_mention\x18\x04 \x01(\x0b\x32#.google.chat.v1.UserMentionMetadataH\x00\x12=\n\rslash_command\x18\x05 \x01(\x0b\x32$.google.chat.v1.SlashCommandMetadataH\x00\x12>\n\x12rich_link_metadata\x18\x06 \x01(\x0b\x32 .google.chat.v1.RichLinkMetadataH\x00\x42\n\n\x08metadataB\x0e\n\x0c_start_index\"\xa5\x01\n\x13UserMentionMetadata\x12\"\n\x04user\x18\x01 \x01(\x0b\x32\x14.google.chat.v1.User\x12\x36\n\x04type\x18\x02 \x01(\x0e\x32(.google.chat.v1.UserMentionMetadata.Type\"2\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\x0b\n\x07MENTION\x10\x02\"\xe8\x01\n\x14SlashCommandMetadata\x12!\n\x03\x62ot\x18\x01 \x01(\x0b\x32\x14.google.chat.v1.User\x12\x37\n\x04type\x18\x02 \x01(\x0e\x32).google.chat.v1.SlashCommandMetadata.Type\x12\x14\n\x0c\x63ommand_name\x18\x03 \x01(\t\x12\x12\n\ncommand_id\x18\x04 \x01(\x03\x12\x17\n\x0ftriggers_dialog\x18\x05 \x01(\x08\"1\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06INVOKE\x10\x02\"\xbb\x02\n\x10RichLinkMetadata\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x45\n\x0erich_link_type\x18\x02 \x01(\x0e\x32-.google.chat.v1.RichLinkMetadata.RichLinkType\x12\x38\n\x0f\x64rive_link_data\x18\x03 \x01(\x0b\x32\x1d.google.chat.v1.DriveLinkDataH\x00\x12\x41\n\x14\x63hat_space_link_data\x18\x04 \x01(\x0b\x32!.google.chat.v1.ChatSpaceLinkDataH\x00\"N\n\x0cRichLinkType\x12\x1e\n\x1aRICH_LINK_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nDRIVE_FILE\x10\x01\x12\x0e\n\nCHAT_SPACE\x10\x02\x42\x06\n\x04\x64\x61ta\"X\n\rDriveLinkData\x12\x34\n\x0e\x64rive_data_ref\x18\x01 \x01(\x0b\x32\x1c.google.chat.v1.DriveDataRef\x12\x11\n\tmime_type\x18\x02 \x01(\t\"\xa6\x01\n\x11\x43hatSpaceLinkData\x12-\n\x05space\x18\x01 \x01(\tB\x1e\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12/\n\x06thread\x18\x02 \x01(\tB\x1f\xfa\x41\x1c\n\x1a\x63hat.googleapis.com/Thread\x12\x31\n\x07message\x18\x03 \x01(\tB \xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Message*e\n\x0e\x41nnotationType\x12\x1f\n\x1b\x41NNOTATION_TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cUSER_MENTION\x10\x01\x12\x11\n\rSLASH_COMMAND\x10\x02\x12\r\n\tRICH_LINK\x10\x03\x42\xa8\x01\n\x12\x63om.google.chat.v1B\x0f\x41nnotationProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.chat.v1.User", "google/chat/v1/user.proto"], + ["google.chat.v1.DriveDataRef", "google/chat/v1/attachment.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Annotation").msgclass + UserMentionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UserMentionMetadata").msgclass + UserMentionMetadata::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UserMentionMetadata.Type").enummodule + SlashCommandMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SlashCommandMetadata").msgclass + SlashCommandMetadata::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SlashCommandMetadata.Type").enummodule + RichLinkMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.RichLinkMetadata").msgclass + RichLinkMetadata::RichLinkType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.RichLinkMetadata.RichLinkType").enummodule + DriveLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DriveLinkData").msgclass + ChatSpaceLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ChatSpaceLinkData").msgclass + AnnotationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.AnnotationType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/attachment_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/attachment_pb.rb new file mode 100644 index 000000000000..7780cb9bf15a --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/attachment_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/attachment.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n\x1fgoogle/chat/v1/attachment.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\"\xf3\x03\n\nAttachment\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x63ontent_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x63ontent_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12@\n\x13\x61ttachment_data_ref\x18\x04 \x01(\x0b\x32!.google.chat.v1.AttachmentDataRefH\x00\x12;\n\x0e\x64rive_data_ref\x18\x07 \x01(\x0b\x32\x1c.google.chat.v1.DriveDataRefB\x03\xe0\x41\x03H\x00\x12\x1a\n\rthumbnail_uri\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64ownload_uri\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x36\n\x06source\x18\t \x01(\x0e\x32!.google.chat.v1.Attachment.SourceB\x03\xe0\x41\x03\"F\n\x06Source\x12\x16\n\x12SOURCE_UNSPECIFIED\x10\x00\x12\x0e\n\nDRIVE_FILE\x10\x01\x12\x14\n\x10UPLOADED_CONTENT\x10\x02:_\xea\x41\\\n\x1e\x63hat.googleapis.com/Attachment\x12:spaces/{space}/messages/{message}/attachments/{attachment}B\n\n\x08\x64\x61ta_ref\"%\n\x0c\x44riveDataRef\x12\x15\n\rdrive_file_id\x18\x02 \x01(\t\"K\n\x11\x41ttachmentDataRef\x12\x15\n\rresource_name\x18\x01 \x01(\t\x12\x1f\n\x17\x61ttachment_upload_token\x18\x02 \x01(\t\"L\n\x14GetAttachmentRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Attachment\"e\n\x17UploadAttachmentRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x63hat.googleapis.com/Message\x12\x15\n\x08\x66ilename\x18\x04 \x01(\tB\x03\xe0\x41\x02\"Z\n\x18UploadAttachmentResponse\x12>\n\x13\x61ttachment_data_ref\x18\x01 \x01(\x0b\x32!.google.chat.v1.AttachmentDataRefB\xa8\x01\n\x12\x63om.google.chat.v1B\x0f\x41ttachmentProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + Attachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Attachment").msgclass + Attachment::Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Attachment.Source").enummodule + DriveDataRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DriveDataRef").msgclass + AttachmentDataRef = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.AttachmentDataRef").msgclass + GetAttachmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetAttachmentRequest").msgclass + UploadAttachmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UploadAttachmentRequest").msgclass + UploadAttachmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UploadAttachmentResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb new file mode 100644 index 000000000000..2c2d798c39ea --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/chat_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/chat/v1/attachment_pb' +require 'google/chat/v1/membership_pb' +require 'google/chat/v1/message_pb' +require 'google/chat/v1/reaction_pb' +require 'google/chat/v1/space_pb' +require 'google/chat/v1/space_event_pb' +require 'google/chat/v1/space_read_state_pb' +require 'google/chat/v1/space_setup_pb' +require 'google/chat/v1/thread_read_state_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n!google/chat/v1/chat_service.proto\x12\x0egoogle.chat.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/chat/v1/attachment.proto\x1a\x1fgoogle/chat/v1/membership.proto\x1a\x1cgoogle/chat/v1/message.proto\x1a\x1dgoogle/chat/v1/reaction.proto\x1a\x1agoogle/chat/v1/space.proto\x1a google/chat/v1/space_event.proto\x1a%google/chat/v1/space_read_state.proto\x1a google/chat/v1/space_setup.proto\x1a&google/chat/v1/thread_read_state.proto\x1a\x1bgoogle/protobuf/empty.proto2\x93*\n\x0b\x43hatService\x12\x9b\x01\n\rCreateMessage\x12$.google.chat.v1.CreateMessageRequest\x1a\x17.google.chat.v1.Message\"K\xda\x41\x19parent,message,message_id\x82\xd3\xe4\x93\x02)\"\x1e/v1/{parent=spaces/*}/messages:\x07message\x12\x8a\x01\n\x0cListMessages\x12#.google.chat.v1.ListMessagesRequest\x1a$.google.chat.v1.ListMessagesResponse\"/\xda\x41\x06parent\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{parent=spaces/*}/messages\x12\x92\x01\n\x0fListMemberships\x12&.google.chat.v1.ListMembershipsRequest\x1a\'.google.chat.v1.ListMembershipsResponse\".\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{parent=spaces/*}/members\x12\x7f\n\rGetMembership\x12$.google.chat.v1.GetMembershipRequest\x1a\x1a.google.chat.v1.Membership\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{name=spaces/*/members/*}\x12w\n\nGetMessage\x12!.google.chat.v1.GetMessageRequest\x1a\x17.google.chat.v1.Message\"-\xda\x41\x04name\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=spaces/*/messages/*}\x12\xd1\x01\n\rUpdateMessage\x12$.google.chat.v1.UpdateMessageRequest\x1a\x17.google.chat.v1.Message\"\x80\x01\xda\x41\x13message,update_mask\x82\xd3\xe4\x93\x02\x64\x1a&/v1/{message.name=spaces/*/messages/*}:\x07messageZ12&/v1/{message.name=spaces/*/messages/*}:\x07message\x12|\n\rDeleteMessage\x12$.google.chat.v1.DeleteMessageRequest\x1a\x16.google.protobuf.Empty\"-\xda\x41\x04name\x82\xd3\xe4\x93\x02 *\x1e/v1/{name=spaces/*/messages/*}\x12\x8e\x01\n\rGetAttachment\x12$.google.chat.v1.GetAttachmentRequest\x1a\x1a.google.chat.v1.Attachment\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=spaces/*/messages/*/attachments/*}\x12\x9a\x01\n\x10UploadAttachment\x12\'.google.chat.v1.UploadAttachmentRequest\x1a(.google.chat.v1.UploadAttachmentResponse\"3\x82\xd3\xe4\x93\x02-\"(/v1/{parent=spaces/*}/attachments:upload:\x01*\x12j\n\nListSpaces\x12!.google.chat.v1.ListSpacesRequest\x1a\".google.chat.v1.ListSpacesResponse\"\x15\xda\x41\x00\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/spaces\x12w\n\x0cSearchSpaces\x12#.google.chat.v1.SearchSpacesRequest\x1a$.google.chat.v1.SearchSpacesResponse\"\x1c\xda\x41\x00\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/spaces:search\x12\x66\n\x08GetSpace\x12\x1f.google.chat.v1.GetSpaceRequest\x1a\x15.google.chat.v1.Space\"\"\xda\x41\x04name\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/{name=spaces/*}\x12k\n\x0b\x43reateSpace\x12\".google.chat.v1.CreateSpaceRequest\x1a\x15.google.chat.v1.Space\"!\xda\x41\x05space\x82\xd3\xe4\x93\x02\x13\"\n/v1/spaces:\x05space\x12\x63\n\nSetUpSpace\x12!.google.chat.v1.SetUpSpaceRequest\x1a\x15.google.chat.v1.Space\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v1/spaces:setup:\x01*\x12\x86\x01\n\x0bUpdateSpace\x12\".google.chat.v1.UpdateSpaceRequest\x1a\x15.google.chat.v1.Space\"<\xda\x41\x11space,update_mask\x82\xd3\xe4\x93\x02\"2\x19/v1/{space.name=spaces/*}:\x05space\x12m\n\x0b\x44\x65leteSpace\x12\".google.chat.v1.DeleteSpaceRequest\x1a\x16.google.protobuf.Empty\"\"\xda\x41\x04name\x82\xd3\xe4\x93\x02\x15*\x13/v1/{name=spaces/*}\x12\x9d\x01\n\x13\x43ompleteImportSpace\x12*.google.chat.v1.CompleteImportSpaceRequest\x1a+.google.chat.v1.CompleteImportSpaceResponse\"-\x82\xd3\xe4\x93\x02\'\"\"/v1/{name=spaces/*}:completeImport:\x01*\x12z\n\x11\x46indDirectMessage\x12(.google.chat.v1.FindDirectMessageRequest\x1a\x15.google.chat.v1.Space\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/spaces:findDirectMessage\x12\x9e\x01\n\x10\x43reateMembership\x12\'.google.chat.v1.CreateMembershipRequest\x1a\x1a.google.chat.v1.Membership\"E\xda\x41\x11parent,membership\x82\xd3\xe4\x93\x02+\"\x1d/v1/{parent=spaces/*}/members:\nmembership\x12\xae\x01\n\x10UpdateMembership\x12\'.google.chat.v1.UpdateMembershipRequest\x1a\x1a.google.chat.v1.Membership\"U\xda\x41\x16membership,update_mask\x82\xd3\xe4\x93\x02\x36\x32(/v1/{membership.name=spaces/*/members/*}:\nmembership\x12\x85\x01\n\x10\x44\x65leteMembership\x12\'.google.chat.v1.DeleteMembershipRequest\x1a\x1a.google.chat.v1.Membership\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=spaces/*/members/*}\x12\xa1\x01\n\x0e\x43reateReaction\x12%.google.chat.v1.CreateReactionRequest\x1a\x18.google.chat.v1.Reaction\"N\xda\x41\x0fparent,reaction\x82\xd3\xe4\x93\x02\x36\"*/v1/{parent=spaces/*/messages/*}/reactions:\x08reaction\x12\x99\x01\n\rListReactions\x12$.google.chat.v1.ListReactionsRequest\x1a%.google.chat.v1.ListReactionsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=spaces/*/messages/*}/reactions\x12\x8a\x01\n\x0e\x44\x65leteReaction\x12%.google.chat.v1.DeleteReactionRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=spaces/*/messages/*/reactions/*}\x12\x98\x01\n\x11GetSpaceReadState\x12(.google.chat.v1.GetSpaceReadStateRequest\x1a\x1e.google.chat.v1.SpaceReadState\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=users/*/spaces/*/spaceReadState}\x12\xd9\x01\n\x14UpdateSpaceReadState\x12+.google.chat.v1.UpdateSpaceReadStateRequest\x1a\x1e.google.chat.v1.SpaceReadState\"t\xda\x41\x1cspace_read_state,update_mask\x82\xd3\xe4\x93\x02O2;/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}:\x10space_read_state\x12\xa6\x01\n\x12GetThreadReadState\x12).google.chat.v1.GetThreadReadStateRequest\x1a\x1f.google.chat.v1.ThreadReadState\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=users/*/spaces/*/threads/*/threadReadState}\x12\x83\x01\n\rGetSpaceEvent\x12$.google.chat.v1.GetSpaceEventRequest\x1a\x1a.google.chat.v1.SpaceEvent\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=spaces/*/spaceEvents/*}\x12\x9d\x01\n\x0fListSpaceEvents\x12&.google.chat.v1.ListSpaceEventsRequest\x1a\'.google.chat.v1.ListSpaceEventsResponse\"9\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=spaces/*}/spaceEvents\x1a\xa9\t\xca\x41\x13\x63hat.googleapis.com\xd2\x41\x8f\thttps://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonlyB\xa9\x01\n\x12\x63om.google.chat.v1B\x10\x43hatServiceProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb new file mode 100644 index 000000000000..809e074cfc97 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb @@ -0,0 +1,438 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/chat/v1/chat_service.proto for package 'Google.Apps.Chat.V1' +# Original file comments: +# Copyright 2024 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. +# + +require 'grpc' +require 'google/chat/v1/chat_service_pb' + +module Google + module Apps + module Chat + module V1 + module ChatService + # Enables developers to build Chat apps and + # integrations on Google Chat Platform. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.chat.v1.ChatService' + + # Creates a message in a Google Chat space. For an example, see [Send a + # message](https://developers.google.com/workspace/chat/create-messages). + # + # The `create()` method requires either user or app authentication. Chat + # attributes the message sender differently depending on the type of + # authentication that you use in your request. + # + # The following image shows how Chat attributes a message when you use app + # authentication. Chat displays the Chat app as the message + # sender. The content of the message can contain text (`text`), cards + # (`cardsV2`), and accessory widgets (`accessoryWidgets`). + # + # ![Message sent with app + # authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) + # + # The following image shows how Chat attributes a message when you use user + # authentication. Chat displays the user as the message sender and attributes + # the Chat app to the message by displaying its name. The content of message + # can only contain text (`text`). + # + # ![Message sent with user + # authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) + # + # The maximum message size, including the message contents, is 32,000 bytes. + rpc :CreateMessage, ::Google::Apps::Chat::V1::CreateMessageRequest, ::Google::Apps::Chat::V1::Message + # Lists messages in a space that the caller is a member of, including + # messages from blocked members and spaces. If you list messages from a + # space with no messages, the response is an empty object. When using a + # REST/HTTP interface, the response contains an empty JSON object, `{}`. + # For an example, see + # [List + # messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :ListMessages, ::Google::Apps::Chat::V1::ListMessagesRequest, ::Google::Apps::Chat::V1::ListMessagesResponse + # Lists memberships in a space. For an example, see [List users and Google + # Chat apps in a + # space](https://developers.google.com/workspace/chat/list-members). Listing + # memberships with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # 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/workspace/chat/authenticate-authorize-chat-user) + # lists memberships in spaces that the authenticated user has access to. + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :ListMemberships, ::Google::Apps::Chat::V1::ListMembershipsRequest, ::Google::Apps::Chat::V1::ListMembershipsResponse + # Returns details about a membership. For an example, see + # [Get details about a user's or Google Chat app's + # membership](https://developers.google.com/workspace/chat/get-members). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :GetMembership, ::Google::Apps::Chat::V1::GetMembershipRequest, ::Google::Apps::Chat::V1::Membership + # Returns details about a message. + # For an example, see [Get details about a + # message](https://developers.google.com/workspace/chat/get-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # Note: Might return a message from a blocked member or space. + rpc :GetMessage, ::Google::Apps::Chat::V1::GetMessageRequest, ::Google::Apps::Chat::V1::Message + # 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/workspace/chat/update-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # When using app authentication, requests can only update messages + # created by the calling Chat app. + rpc :UpdateMessage, ::Google::Apps::Chat::V1::UpdateMessageRequest, ::Google::Apps::Chat::V1::Message + # Deletes a message. + # For an example, see [Delete a + # message](https://developers.google.com/workspace/chat/delete-messages). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # When using app authentication, requests can only delete messages + # created by the calling Chat app. + rpc :DeleteMessage, ::Google::Apps::Chat::V1::DeleteMessageRequest, ::Google::Protobuf::Empty + # Gets the metadata of a message attachment. The attachment data is fetched + # using the [media + # API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download). + # For an example, see + # [Get metadata about a message + # attachment](https://developers.google.com/workspace/chat/get-media-attachments). + # Requires [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + rpc :GetAttachment, ::Google::Apps::Chat::V1::GetAttachmentRequest, ::Google::Apps::Chat::V1::Attachment + # Uploads an attachment. For an example, see + # [Upload media as a file + # attachment](https://developers.google.com/workspace/chat/upload-media-attachments). + # Requires user + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # 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). + rpc :UploadAttachment, ::Google::Apps::Chat::V1::UploadAttachmentRequest, ::Google::Apps::Chat::V1::UploadAttachmentResponse + # 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/workspace/chat/list-spaces). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # Lists spaces visible to the caller or authenticated user. Group chats + # and DMs aren't listed until the first message is sent. + # + # To list all named spaces by Google Workspace organization, use the + # [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) + # method using Workspace administrator privileges instead. + rpc :ListSpaces, ::Google::Apps::Chat::V1::ListSpacesRequest, ::Google::Apps::Chat::V1::ListSpacesResponse + # Returns a list of spaces in a Google Workspace organization based on an + # administrator's search. Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + # In the request, set `use_admin_access` to `true`. + rpc :SearchSpaces, ::Google::Apps::Chat::V1::SearchSpacesRequest, ::Google::Apps::Chat::V1::SearchSpacesResponse + # Returns details about a space. For an example, see + # [Get details about a + # space](https://developers.google.com/workspace/chat/get-spaces). + # + # Requires + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize). + # Supports + # [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :GetSpace, ::Google::Apps::Chat::V1::GetSpaceRequest, ::Google::Apps::Chat::V1::Space + # Creates a space with no members. Can be used to create a named space. + # Spaces grouped by topics aren't supported. For an example, see + # [Create a + # space](https://developers.google.com/workspace/chat/create-spaces). + # + # 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. + # + # If you're a member of the [Developer Preview + # program](https://developers.google.com/workspace/preview), you can create a + # group chat in import mode using `spaceType.GROUP_CHAT`. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :CreateSpace, ::Google::Apps::Chat::V1::CreateSpaceRequest, ::Google::Apps::Chat::V1::Space + # 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 with initial + # members](https://developers.google.com/workspace/chat/set-up-spaces). + # + # To specify the human members to add, add memberships with the appropriate + # `membership.member.name`. 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`. + # + # To specify the Google groups to add, add memberships with the + # appropriate `membership.group_member.name`. To add or invite a Google + # group, use `groups/{group}`, where `{group}` is the `id` for the group from + # the Cloud Identity Groups API. For example, you can use [Cloud Identity + # Groups lookup + # API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) + # to retrieve the ID `123456789` for group email `group@example.com`, then + # you can add the group to the space by setting the + # `membership.group_member.name` to `groups/123456789`. Group email is not + # supported, and Google groups can only be added as members in named spaces. + # + # For a named space or group chat, if the caller blocks, or is blocked + # by some members, or doesn't have permission to add 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 + # [Invite or add a user or app to a + # space](https://developers.google.com/workspace/chat/create-members). + # + # 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/workspace/chat/authenticate-authorize-chat-user). + rpc :SetUpSpace, ::Google::Apps::Chat::V1::SetUpSpaceRequest, ::Google::Apps::Chat::V1::Space + # Updates a space. For an example, see + # [Update a + # space](https://developers.google.com/workspace/chat/update-spaces). + # + # 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/workspace/chat/authenticate-authorize-chat-user). + rpc :UpdateSpace, ::Google::Apps::Chat::V1::UpdateSpaceRequest, ::Google::Apps::Chat::V1::Space + # 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/workspace/chat/delete-spaces). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # from a user who has permission to delete the space. + rpc :DeleteSpace, ::Google::Apps::Chat::V1::DeleteSpaceRequest, ::Google::Protobuf::Empty + # Completes the + # [import process](https://developers.google.com/workspace/chat/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/workspace/chat/authorize-import). + rpc :CompleteImportSpace, ::Google::Apps::Chat::V1::CompleteImportSpaceRequest, ::Google::Apps::Chat::V1::CompleteImportSpaceResponse + # 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/workspace/chat/authenticate-authorize-chat-user), + # returns the direct message space between the specified user and the + # authenticated user. + # + # With [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + # returns the direct message space between the specified user and the calling + # Chat app. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # or [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + rpc :FindDirectMessage, ::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Google::Apps::Chat::V1::Space + # Creates a membership for the calling Chat app, a user, or a Google Group. + # Creating memberships for other Chat apps isn't supported. + # 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/workspace/chat/authenticate-authorize-chat-user). + # + # For example usage, see: + # + # - [Invite or add a user to a + # space](https://developers.google.com/workspace/chat/create-members#create-user-membership). + # + # - [Invite or add a Google Group to a + # space](https://developers.google.com/workspace/chat/create-members#create-group-membership). + # + # - [Add the Chat app to a + # space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api). + rpc :CreateMembership, ::Google::Apps::Chat::V1::CreateMembershipRequest, ::Google::Apps::Chat::V1::Membership + # Updates a membership. For an example, see [Update a user's membership in + # a space](https://developers.google.com/workspace/chat/update-members). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :UpdateMembership, ::Google::Apps::Chat::V1::UpdateMembershipRequest, ::Google::Apps::Chat::V1::Membership + # Deletes a membership. For an example, see + # [Remove a user or a Google Chat app from a + # space](https://developers.google.com/workspace/chat/delete-members). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :DeleteMembership, ::Google::Apps::Chat::V1::DeleteMembershipRequest, ::Google::Apps::Chat::V1::Membership + # Creates a reaction and adds it to a message. Only unicode emojis are + # supported. For an example, see + # [Add a reaction to a + # message](https://developers.google.com/workspace/chat/create-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :CreateReaction, ::Google::Apps::Chat::V1::CreateReactionRequest, ::Google::Apps::Chat::V1::Reaction + # Lists reactions to a message. For an example, see + # [List reactions for a + # message](https://developers.google.com/workspace/chat/list-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :ListReactions, ::Google::Apps::Chat::V1::ListReactionsRequest, ::Google::Apps::Chat::V1::ListReactionsResponse + # Deletes a reaction to a message. Only unicode emojis are supported. + # For an example, see + # [Delete a + # reaction](https://developers.google.com/workspace/chat/delete-reactions). + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :DeleteReaction, ::Google::Apps::Chat::V1::DeleteReactionRequest, ::Google::Protobuf::Empty + # Returns details about a user's read state within a space, used to identify + # read and unread messages. For an example, see [Get details about a user's + # space read + # state](https://developers.google.com/workspace/chat/get-space-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :GetSpaceReadState, ::Google::Apps::Chat::V1::GetSpaceReadStateRequest, ::Google::Apps::Chat::V1::SpaceReadState + # Updates a user's read state within a space, used to identify read and + # unread messages. For an example, see [Update a user's space read + # state](https://developers.google.com/workspace/chat/update-space-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :UpdateSpaceReadState, ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest, ::Google::Apps::Chat::V1::SpaceReadState + # Returns details about a user's read state within a thread, used to identify + # read and unread messages. For an example, see [Get details about a user's + # thread read + # state](https://developers.google.com/workspace/chat/get-thread-read-state). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc :GetThreadReadState, ::Google::Apps::Chat::V1::GetThreadReadStateRequest, ::Google::Apps::Chat::V1::ThreadReadState + # Returns an event from a Google Chat space. The [event + # payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + # contains the most recent version of the resource that changed. For example, + # if you request an event about a new message but the message was later + # updated, the server returns the updated `Message` resource in the event + # payload. + # + # Note: The `permissionSettings` field is not returned in the Space + # object of the Space event data for this request. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # To get an event, the authenticated user must be a member of the space. + # + # For an example, see [Get details about an + # event from a Google Chat + # space](https://developers.google.com/workspace/chat/get-space-event). + rpc :GetSpaceEvent, ::Google::Apps::Chat::V1::GetSpaceEventRequest, ::Google::Apps::Chat::V1::SpaceEvent + # Lists events from a Google Chat space. For each event, the + # [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) + # contains the most recent version of the Chat resource. For example, if you + # list events about new space members, the server returns `Membership` + # resources that contain the latest membership details. If new members were + # removed during the requested period, the event payload contains an empty + # `Membership` resource. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # To list events, the authenticated user must be a member of the space. + # + # For an example, see [List events from a Google Chat + # space](https://developers.google.com/workspace/chat/list-space-events). + rpc :ListSpaceEvents, ::Google::Apps::Chat::V1::ListSpaceEventsRequest, ::Google::Apps::Chat::V1::ListSpaceEventsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/contextual_addon_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/contextual_addon_pb.rb new file mode 100644 index 000000000000..2b3e4dea94bf --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/contextual_addon_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/contextual_addon.proto + +require 'google/protobuf' + +require 'google/chat/v1/widgets_pb' + + +descriptor_data = "\n%google/chat/v1/contextual_addon.proto\x12\x0egoogle.chat.v1\x1a\x1cgoogle/chat/v1/widgets.proto\"\x8a\x05\n\x15\x43ontextualAddOnMarkup\x1a\xf0\x04\n\x04\x43\x61rd\x12\x45\n\x06header\x18\x01 \x01(\x0b\x32\x35.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader\x12\x44\n\x08sections\x18\x02 \x03(\x0b\x32\x32.google.chat.v1.ContextualAddOnMarkup.Card.Section\x12K\n\x0c\x63\x61rd_actions\x18\x03 \x03(\x0b\x32\x35.google.chat.v1.ContextualAddOnMarkup.Card.CardAction\x12\x0c\n\x04name\x18\x04 \x01(\t\x1a\xd9\x01\n\nCardHeader\x12\r\n\x05title\x18\x01 \x01(\t\x12\x10\n\x08subtitle\x18\x02 \x01(\t\x12U\n\x0bimage_style\x18\x03 \x01(\x0e\x32@.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle\x12\x11\n\timage_url\x18\x04 \x01(\t\"@\n\nImageStyle\x12\x1b\n\x17IMAGE_STYLE_UNSPECIFIED\x10\x00\x12\t\n\x05IMAGE\x10\x01\x12\n\n\x06\x41VATAR\x10\x02\x1aH\n\x07Section\x12\x0e\n\x06header\x18\x01 \x01(\t\x12-\n\x07widgets\x18\x02 \x03(\x0b\x32\x1c.google.chat.v1.WidgetMarkup\x1aZ\n\nCardAction\x12\x14\n\x0c\x61\x63tion_label\x18\x01 \x01(\t\x12\x36\n\x08on_click\x18\x02 \x01(\x0b\x32$.google.chat.v1.WidgetMarkup.OnClickB\xad\x01\n\x12\x63om.google.chat.v1B\x14\x43ontextualAddOnProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.chat.v1.WidgetMarkup", "google/chat/v1/widgets.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + ContextualAddOnMarkup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ContextualAddOnMarkup").msgclass + ContextualAddOnMarkup::Card = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ContextualAddOnMarkup.Card").msgclass + ContextualAddOnMarkup::Card::CardHeader = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ContextualAddOnMarkup.Card.CardHeader").msgclass + ContextualAddOnMarkup::Card::CardHeader::ImageStyle = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle").enummodule + ContextualAddOnMarkup::Card::Section = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ContextualAddOnMarkup.Card.Section").msgclass + ContextualAddOnMarkup::Card::CardAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ContextualAddOnMarkup.Card.CardAction").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/deletion_metadata_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/deletion_metadata_pb.rb new file mode 100644 index 000000000000..0427b690e3cf --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/deletion_metadata_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/deletion_metadata.proto + +require 'google/protobuf' + + +descriptor_data = "\n&google/chat/v1/deletion_metadata.proto\x12\x0egoogle.chat.v1\"\xf7\x01\n\x10\x44\x65letionMetadata\x12\x44\n\rdeletion_type\x18\x01 \x01(\x0e\x32-.google.chat.v1.DeletionMetadata.DeletionType\"\x9c\x01\n\x0c\x44\x65letionType\x12\x1d\n\x19\x44\x45LETION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATOR\x10\x01\x12\x0f\n\x0bSPACE_OWNER\x10\x02\x12\t\n\x05\x41\x44MIN\x10\x03\x12\x16\n\x12\x41PP_MESSAGE_EXPIRY\x10\x04\x12\x13\n\x0f\x43REATOR_VIA_APP\x10\x05\x12\x17\n\x13SPACE_OWNER_VIA_APP\x10\x06\x42\xae\x01\n\x12\x63om.google.chat.v1B\x15\x44\x65letionMetadataProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + DeletionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeletionMetadata").msgclass + DeletionMetadata::DeletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeletionMetadata.DeletionType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/event_payload_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/event_payload_pb.rb new file mode 100644 index 000000000000..9b10c0c77b1a --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/event_payload_pb.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/event_payload.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/chat/v1/membership_pb' +require 'google/chat/v1/message_pb' +require 'google/chat/v1/reaction_pb' +require 'google/chat/v1/space_pb' + + +descriptor_data = "\n\"google/chat/v1/event_payload.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/chat/v1/membership.proto\x1a\x1cgoogle/chat/v1/message.proto\x1a\x1dgoogle/chat/v1/reaction.proto\x1a\x1agoogle/chat/v1/space.proto\"L\n\x1aMembershipCreatedEventData\x12.\n\nmembership\x18\x01 \x01(\x0b\x32\x1a.google.chat.v1.Membership\"L\n\x1aMembershipDeletedEventData\x12.\n\nmembership\x18\x01 \x01(\x0b\x32\x1a.google.chat.v1.Membership\"L\n\x1aMembershipUpdatedEventData\x12.\n\nmembership\x18\x01 \x01(\x0b\x32\x1a.google.chat.v1.Membership\"b\n\x1fMembershipBatchCreatedEventData\x12?\n\x0bmemberships\x18\x01 \x03(\x0b\x32*.google.chat.v1.MembershipCreatedEventData\"b\n\x1fMembershipBatchUpdatedEventData\x12?\n\x0bmemberships\x18\x01 \x03(\x0b\x32*.google.chat.v1.MembershipUpdatedEventData\"b\n\x1fMembershipBatchDeletedEventData\x12?\n\x0bmemberships\x18\x01 \x03(\x0b\x32*.google.chat.v1.MembershipDeletedEventData\"C\n\x17MessageCreatedEventData\x12(\n\x07message\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.Message\"C\n\x17MessageUpdatedEventData\x12(\n\x07message\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.Message\"C\n\x17MessageDeletedEventData\x12(\n\x07message\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.Message\"Y\n\x1cMessageBatchCreatedEventData\x12\x39\n\x08messages\x18\x01 \x03(\x0b\x32\'.google.chat.v1.MessageCreatedEventData\"Y\n\x1cMessageBatchUpdatedEventData\x12\x39\n\x08messages\x18\x01 \x03(\x0b\x32\'.google.chat.v1.MessageUpdatedEventData\"Y\n\x1cMessageBatchDeletedEventData\x12\x39\n\x08messages\x18\x01 \x03(\x0b\x32\'.google.chat.v1.MessageDeletedEventData\"=\n\x15SpaceUpdatedEventData\x12$\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.Space\"S\n\x1aSpaceBatchUpdatedEventData\x12\x35\n\x06spaces\x18\x01 \x03(\x0b\x32%.google.chat.v1.SpaceUpdatedEventData\"F\n\x18ReactionCreatedEventData\x12*\n\x08reaction\x18\x01 \x01(\x0b\x32\x18.google.chat.v1.Reaction\"F\n\x18ReactionDeletedEventData\x12*\n\x08reaction\x18\x01 \x01(\x0b\x32\x18.google.chat.v1.Reaction\"\\\n\x1dReactionBatchCreatedEventData\x12;\n\treactions\x18\x01 \x03(\x0b\x32(.google.chat.v1.ReactionCreatedEventData\"\\\n\x1dReactionBatchDeletedEventData\x12;\n\treactions\x18\x01 \x03(\x0b\x32(.google.chat.v1.ReactionDeletedEventDataB\xaa\x01\n\x12\x63om.google.chat.v1B\x11\x45ventPayloadProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.chat.v1.Membership", "google/chat/v1/membership.proto"], + ["google.chat.v1.Message", "google/chat/v1/message.proto"], + ["google.chat.v1.Space", "google/chat/v1/space.proto"], + ["google.chat.v1.Reaction", "google/chat/v1/reaction.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + MembershipCreatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MembershipCreatedEventData").msgclass + MembershipDeletedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MembershipDeletedEventData").msgclass + MembershipUpdatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MembershipUpdatedEventData").msgclass + MembershipBatchCreatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MembershipBatchCreatedEventData").msgclass + MembershipBatchUpdatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MembershipBatchUpdatedEventData").msgclass + MembershipBatchDeletedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MembershipBatchDeletedEventData").msgclass + MessageCreatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MessageCreatedEventData").msgclass + MessageUpdatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MessageUpdatedEventData").msgclass + MessageDeletedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MessageDeletedEventData").msgclass + MessageBatchCreatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MessageBatchCreatedEventData").msgclass + MessageBatchUpdatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MessageBatchUpdatedEventData").msgclass + MessageBatchDeletedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MessageBatchDeletedEventData").msgclass + SpaceUpdatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceUpdatedEventData").msgclass + SpaceBatchUpdatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceBatchUpdatedEventData").msgclass + ReactionCreatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ReactionCreatedEventData").msgclass + ReactionDeletedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ReactionDeletedEventData").msgclass + ReactionBatchCreatedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ReactionBatchCreatedEventData").msgclass + ReactionBatchDeletedEventData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ReactionBatchDeletedEventData").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/group_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/group_pb.rb new file mode 100644 index 000000000000..309990e9037c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/group_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/group.proto + +require 'google/protobuf' + + +descriptor_data = "\n\x1agoogle/chat/v1/group.proto\x12\x0egoogle.chat.v1\"\x15\n\x05Group\x12\x0c\n\x04name\x18\x01 \x01(\tB\xa3\x01\n\x12\x63om.google.chat.v1B\nGroupProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + Group = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Group").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/history_state_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/history_state_pb.rb new file mode 100644 index 000000000000..165c07d73076 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/history_state_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/history_state.proto + +require 'google/protobuf' + + +descriptor_data = "\n\"google/chat/v1/history_state.proto\x12\x0egoogle.chat.v1*N\n\x0cHistoryState\x12\x1d\n\x19HISTORY_STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bHISTORY_OFF\x10\x01\x12\x0e\n\nHISTORY_ON\x10\x02\x42\xaa\x01\n\x12\x63om.google.chat.v1B\x11HistoryStateProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + HistoryState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.HistoryState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/matched_url_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/matched_url_pb.rb new file mode 100644 index 000000000000..9fd0bb8fe7fb --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/matched_url_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/matched_url.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n google/chat/v1/matched_url.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\"\x1e\n\nMatchedUrl\x12\x10\n\x03url\x18\x02 \x01(\tB\x03\xe0\x41\x03\x42\xa8\x01\n\x12\x63om.google.chat.v1B\x0fMatchedUrlProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + MatchedUrl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MatchedUrl").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb new file mode 100644 index 000000000000..0c6b6cf1c507 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/membership.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/chat/v1/group_pb' +require 'google/chat/v1/user_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\x1fgoogle/chat/v1/membership.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1agoogle/chat/v1/group.proto\x1a\x19google/chat/v1/user.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\nMembership\x12\x31\n\x04name\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12>\n\x05state\x18\x02 \x01(\x0e\x32*.google.chat.v1.Membership.MembershipStateB\x03\xe0\x41\x03\x12<\n\x04role\x18\x07 \x01(\x0e\x32).google.chat.v1.Membership.MembershipRoleB\x03\xe0\x41\x01\x12&\n\x06member\x18\x03 \x01(\x0b\x32\x14.google.chat.v1.UserH\x00\x12-\n\x0cgroup_member\x18\x05 \x01(\x0b\x32\x15.google.chat.v1.GroupH\x00\x12\x37\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\x12\x37\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\"^\n\x0fMembershipState\x12 \n\x1cMEMBERSHIP_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06JOINED\x10\x01\x12\x0b\n\x07INVITED\x10\x02\x12\x10\n\x0cNOT_A_MEMBER\x10\x03\"T\n\x0eMembershipRole\x12\x1f\n\x1bMEMBERSHIP_ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bROLE_MEMBER\x10\x01\x12\x10\n\x0cROLE_MANAGER\x10\x02:D\xea\x41\x41\n\x1e\x63hat.googleapis.com/Membership\x12\x1fspaces/{space}/members/{member}B\x0c\n\nmemberType\"\xa0\x01\n\x17\x43reateMembershipRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63hat.googleapis.com/Membership\x12\x33\n\nmembership\x18\x02 \x01(\x0b\x32\x1a.google.chat.v1.MembershipB\x03\xe0\x41\x02\x12\x18\n\x10use_admin_access\x18\x05 \x01(\x08\"\x9e\x01\n\x17UpdateMembershipRequest\x12\x33\n\nmembership\x18\x01 \x01(\x0b\x32\x1a.google.chat.v1.MembershipB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x18\n\x10use_admin_access\x18\x03 \x01(\x08\"\xe5\x01\n\x16ListMembershipsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63hat.googleapis.com/Membership\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bshow_groups\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0cshow_invited\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x10use_admin_access\x18\x08 \x01(\x08\"h\n\x17ListMembershipsResponse\x12\x34\n\x0bmemberships\x18\x01 \x03(\x0b\x32\x1a.google.chat.v1.MembershipB\x03\xe0\x41\x06\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"f\n\x14GetMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x18\n\x10use_admin_access\x18\x03 \x01(\x08\"i\n\x17\x44\x65leteMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x18\n\x10use_admin_access\x18\x02 \x01(\x08\x42\xa8\x01\n\x12\x63om.google.chat.v1B\x0fMembershipProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.chat.v1.User", "google/chat/v1/user.proto"], + ["google.chat.v1.Group", "google/chat/v1/group.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + Membership = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Membership").msgclass + Membership::MembershipState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Membership.MembershipState").enummodule + Membership::MembershipRole = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Membership.MembershipRole").enummodule + CreateMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateMembershipRequest").msgclass + UpdateMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateMembershipRequest").msgclass + ListMembershipsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListMembershipsRequest").msgclass + ListMembershipsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListMembershipsResponse").msgclass + GetMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetMembershipRequest").msgclass + DeleteMembershipRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteMembershipRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/message_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/message_pb.rb new file mode 100644 index 000000000000..168ee0aba512 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/message_pb.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/message.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/apps/card/v1/card_pb' +require 'google/chat/v1/action_status_pb' +require 'google/chat/v1/annotation_pb' +require 'google/chat/v1/attachment_pb' +require 'google/chat/v1/contextual_addon_pb' +require 'google/chat/v1/deletion_metadata_pb' +require 'google/chat/v1/matched_url_pb' +require 'google/chat/v1/reaction_pb' +require 'google/chat/v1/slash_command_pb' +require 'google/chat/v1/space_pb' +require 'google/chat/v1/user_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\x1cgoogle/chat/v1/message.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/apps/card/v1/card.proto\x1a\"google/chat/v1/action_status.proto\x1a\x1fgoogle/chat/v1/annotation.proto\x1a\x1fgoogle/chat/v1/attachment.proto\x1a%google/chat/v1/contextual_addon.proto\x1a&google/chat/v1/deletion_metadata.proto\x1a google/chat/v1/matched_url.proto\x1a\x1dgoogle/chat/v1/reaction.proto\x1a\"google/chat/v1/slash_command.proto\x1a\x1agoogle/chat/v1/space.proto\x1a\x19google/chat/v1/user.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\n\n\x07Message\x12\x0c\n\x04name\x18\x01 \x01(\t\x12)\n\x06sender\x18\x02 \x01(\x0b\x32\x14.google.chat.v1.UserB\x03\xe0\x41\x03\x12\x37\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\x12\x39\n\x10last_update_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x0c\n\x04text\x18\x04 \x01(\t\x12\x1b\n\x0e\x66ormatted_text\x18+ \x01(\tB\x03\xe0\x41\x03\x12=\n\x05\x63\x61rds\x18\x05 \x03(\x0b\x32*.google.chat.v1.ContextualAddOnMarkup.CardB\x02\x18\x01\x12,\n\x08\x63\x61rds_v2\x18\x16 \x03(\x0b\x32\x1a.google.chat.v1.CardWithId\x12\x34\n\x0b\x61nnotations\x18\n \x03(\x0b\x32\x1a.google.chat.v1.AnnotationB\x03\xe0\x41\x03\x12&\n\x06thread\x18\x0b \x01(\x0b\x32\x16.google.chat.v1.Thread\x12$\n\x05space\x18\x0c \x01(\x0b\x32\x15.google.chat.v1.Space\x12\x15\n\rfallback_text\x18\r \x01(\t\x12<\n\x0f\x61\x63tion_response\x18\x0e \x01(\x0b\x32\x1e.google.chat.v1.ActionResponseB\x03\xe0\x41\x04\x12\x1a\n\rargument_text\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12\x38\n\rslash_command\x18\x11 \x01(\x0b\x32\x1c.google.chat.v1.SlashCommandB\x03\xe0\x41\x03\x12.\n\nattachment\x18\x12 \x03(\x0b\x32\x1a.google.chat.v1.Attachment\x12\x34\n\x0bmatched_url\x18\x14 \x01(\x0b\x32\x1a.google.chat.v1.MatchedUrlB\x03\xe0\x41\x03\x12\x19\n\x0cthread_reply\x18\x19 \x01(\x08\x42\x03\xe0\x41\x03\x12\"\n\x1a\x63lient_assigned_message_id\x18 \x01(\t\x12K\n\x18\x65moji_reaction_summaries\x18! \x03(\x0b\x32$.google.chat.v1.EmojiReactionSummaryB\x03\xe0\x41\x03\x12\x39\n\x16private_message_viewer\x18$ \x01(\x0b\x32\x14.google.chat.v1.UserB\x03\xe0\x41\x05\x12@\n\x11\x64\x65letion_metadata\x18& \x01(\x0b\x32 .google.chat.v1.DeletionMetadataB\x03\xe0\x41\x03\x12K\n\x17quoted_message_metadata\x18\' \x01(\x0b\x32%.google.chat.v1.QuotedMessageMetadataB\x03\xe0\x41\x03\x12\x37\n\rattached_gifs\x18* \x03(\x0b\x32\x1b.google.chat.v1.AttachedGifB\x03\xe0\x41\x03\x12:\n\x11\x61\x63\x63\x65ssory_widgets\x18, \x03(\x0b\x32\x1f.google.chat.v1.AccessoryWidget:C\xea\x41@\n\x1b\x63hat.googleapis.com/Message\x12!spaces/{space}/messages/{message}\"\x1f\n\x0b\x41ttachedGif\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\x89\x02\n\x15QuotedMessageMetadata\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x03\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Message\x12\x39\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x81\x01\xea\x41~\n)chat.googleapis.com/QuotedMessageMetadata\x12Qspaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}\"q\n\x06Thread\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x17\n\nthread_key\x18\x03 \x01(\tB\x03\xe0\x41\x01:@\xea\x41=\n\x1a\x63hat.googleapis.com/Thread\x12\x1fspaces/{space}/threads/{thread}\"\xd2\x04\n\x0e\x41\x63tionResponse\x12>\n\x04type\x18\x01 \x01(\x0e\x32+.google.chat.v1.ActionResponse.ResponseTypeB\x03\xe0\x41\x04\x12\x10\n\x03url\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x38\n\rdialog_action\x18\x03 \x01(\x0b\x32\x1c.google.chat.v1.DialogActionB\x03\xe0\x41\x04\x12I\n\x0eupdated_widget\x18\x04 \x01(\x0b\x32,.google.chat.v1.ActionResponse.UpdatedWidgetB\x03\xe0\x41\x04\x1aR\n\x0eSelectionItems\x12@\n\x05items\x18\x01 \x03(\x0b\x32\x31.google.apps.card.v1.SelectionInput.SelectionItem\x1aw\n\rUpdatedWidget\x12\x44\n\x0bsuggestions\x18\x01 \x01(\x0b\x32-.google.chat.v1.ActionResponse.SelectionItemsH\x00\x12\x0e\n\x06widget\x18\x02 \x01(\tB\x10\n\x0eupdated_widget\"\x9b\x01\n\x0cResponseType\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNEW_MESSAGE\x10\x01\x12\x12\n\x0eUPDATE_MESSAGE\x10\x02\x12\x1d\n\x19UPDATE_USER_MESSAGE_CARDS\x10\x06\x12\x12\n\x0eREQUEST_CONFIG\x10\x03\x12\n\n\x06\x44IALOG\x10\x04\x12\x11\n\rUPDATE_WIDGET\x10\x07\"S\n\x0f\x41\x63\x63\x65ssoryWidget\x12\x36\n\x0b\x62utton_list\x18\x01 \x01(\x0b\x32\x1f.google.apps.card.v1.ButtonListH\x00\x42\x08\n\x06\x61\x63tion\"F\n\x11GetMessageRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Message\"X\n\x14\x44\x65leteMessageRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Message\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x92\x01\n\x14UpdateMessageRequest\x12-\n\x07message\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.MessageB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xa4\x03\n\x14\x43reateMessageRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x63hat.googleapis.com/Message\x12-\n\x07message\x18\x04 \x01(\x0b\x32\x17.google.chat.v1.MessageB\x03\xe0\x41\x02\x12\x19\n\nthread_key\x18\x06 \x01(\tB\x05\x18\x01\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12Z\n\x14message_reply_option\x18\x08 \x01(\x0e\x32\x37.google.chat.v1.CreateMessageRequest.MessageReplyOptionB\x03\xe0\x41\x01\x12\x17\n\nmessage_id\x18\t \x01(\tB\x03\xe0\x41\x01\"\x7f\n\x12MessageReplyOption\x12$\n MESSAGE_REPLY_OPTION_UNSPECIFIED\x10\x00\x12(\n$REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD\x10\x01\x12\x19\n\x15REPLY_MESSAGE_OR_FAIL\x10\x02\"\xa9\x01\n\x13ListMessagesRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x63hat.googleapis.com/Message\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x06 \x01(\x08\"Z\n\x14ListMessagesResponse\x12)\n\x08messages\x18\x01 \x03(\x0b\x32\x17.google.chat.v1.Message\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x81\x01\n\x0c\x44ialogAction\x12-\n\x06\x64ialog\x18\x01 \x01(\x0b\x32\x16.google.chat.v1.DialogB\x03\xe0\x41\x04H\x00\x12\x38\n\raction_status\x18\x02 \x01(\x0b\x32\x1c.google.chat.v1.ActionStatusB\x03\xe0\x41\x04\x42\x08\n\x06\x61\x63tion\"6\n\x06\x44ialog\x12,\n\x04\x62ody\x18\x01 \x01(\x0b\x32\x19.google.apps.card.v1.CardB\x03\xe0\x41\x04\"F\n\nCardWithId\x12\x0f\n\x07\x63\x61rd_id\x18\x01 \x01(\t\x12\'\n\x04\x63\x61rd\x18\x02 \x01(\x0b\x32\x19.google.apps.card.v1.CardB\xa5\x01\n\x12\x63om.google.chat.v1B\x0cMessageProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.chat.v1.User", "google/chat/v1/user.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.chat.v1.ContextualAddOnMarkup.Card", "google/chat/v1/contextual_addon.proto"], + ["google.chat.v1.Annotation", "google/chat/v1/annotation.proto"], + ["google.chat.v1.Space", "google/chat/v1/space.proto"], + ["google.chat.v1.SlashCommand", "google/chat/v1/slash_command.proto"], + ["google.chat.v1.Attachment", "google/chat/v1/attachment.proto"], + ["google.chat.v1.MatchedUrl", "google/chat/v1/matched_url.proto"], + ["google.chat.v1.EmojiReactionSummary", "google/chat/v1/reaction.proto"], + ["google.chat.v1.DeletionMetadata", "google/chat/v1/deletion_metadata.proto"], + ["google.apps.card.v1.SelectionInput.SelectionItem", "google/apps/card/v1/card.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ["google.chat.v1.ActionStatus", "google/chat/v1/action_status.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Message").msgclass + AttachedGif = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.AttachedGif").msgclass + QuotedMessageMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.QuotedMessageMetadata").msgclass + Thread = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Thread").msgclass + ActionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ActionResponse").msgclass + ActionResponse::SelectionItems = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ActionResponse.SelectionItems").msgclass + ActionResponse::UpdatedWidget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ActionResponse.UpdatedWidget").msgclass + ActionResponse::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ActionResponse.ResponseType").enummodule + AccessoryWidget = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.AccessoryWidget").msgclass + GetMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetMessageRequest").msgclass + DeleteMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteMessageRequest").msgclass + UpdateMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateMessageRequest").msgclass + CreateMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateMessageRequest").msgclass + CreateMessageRequest::MessageReplyOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateMessageRequest.MessageReplyOption").enummodule + ListMessagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListMessagesRequest").msgclass + ListMessagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListMessagesResponse").msgclass + DialogAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DialogAction").msgclass + Dialog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Dialog").msgclass + CardWithId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CardWithId").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/reaction_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/reaction_pb.rb new file mode 100644 index 000000000000..66fae1c381f5 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/reaction_pb.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/reaction.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/chat/v1/user_pb' + + +descriptor_data = "\n\x1dgoogle/chat/v1/reaction.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x19google/chat/v1/user.proto\"\xc2\x01\n\x08Reaction\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\'\n\x04user\x18\x02 \x01(\x0b\x32\x14.google.chat.v1.UserB\x03\xe0\x41\x03\x12$\n\x05\x65moji\x18\x03 \x01(\x0b\x32\x15.google.chat.v1.Emoji:Y\xea\x41V\n\x1c\x63hat.googleapis.com/Reaction\x12\x36spaces/{space}/messages/{message}/reactions/{reaction}\"_\n\x05\x45moji\x12\x11\n\x07unicode\x18\x01 \x01(\tH\x00\x12\x38\n\x0c\x63ustom_emoji\x18\x02 \x01(\x0b\x32\x1b.google.chat.v1.CustomEmojiB\x03\xe0\x41\x03H\x00\x42\t\n\x07\x63ontent\"\x1f\n\x0b\x43ustomEmoji\x12\x10\n\x03uid\x18\x01 \x01(\tB\x03\xe0\x41\x03\"l\n\x14\x45mojiReactionSummary\x12$\n\x05\x65moji\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.Emoji\x12\x1b\n\x0ereaction_count\x18\x02 \x01(\x05H\x00\x88\x01\x01\x42\x11\n\x0f_reaction_count\"~\n\x15\x43reateReactionRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\x12\x1c\x63hat.googleapis.com/Reaction\x12/\n\x08reaction\x18\x02 \x01(\x0b\x32\x18.google.chat.v1.ReactionB\x03\xe0\x41\x02\"\x92\x01\n\x14ListReactionsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\x12\x1c\x63hat.googleapis.com/Reaction\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"]\n\x15ListReactionsResponse\x12+\n\treactions\x18\x01 \x03(\x0b\x32\x18.google.chat.v1.Reaction\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"K\n\x15\x44\x65leteReactionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1c\x63hat.googleapis.com/ReactionB\xa6\x01\n\x12\x63om.google.chat.v1B\rReactionProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.chat.v1.User", "google/chat/v1/user.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + Reaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Reaction").msgclass + Emoji = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Emoji").msgclass + CustomEmoji = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CustomEmoji").msgclass + EmojiReactionSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.EmojiReactionSummary").msgclass + CreateReactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateReactionRequest").msgclass + ListReactionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListReactionsRequest").msgclass + ListReactionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListReactionsResponse").msgclass + DeleteReactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteReactionRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/slash_command_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/slash_command_pb.rb new file mode 100644 index 000000000000..a07ee4780055 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/slash_command_pb.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/slash_command.proto + +require 'google/protobuf' + + +descriptor_data = "\n\"google/chat/v1/slash_command.proto\x12\x0egoogle.chat.v1\"\"\n\x0cSlashCommand\x12\x12\n\ncommand_id\x18\x01 \x01(\x03\x42\xaa\x01\n\x12\x63om.google.chat.v1B\x11SlashCommandProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + SlashCommand = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SlashCommand").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_event_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_event_pb.rb new file mode 100644 index 000000000000..370e78adcbc0 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_event_pb.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/space_event.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/chat/v1/event_payload_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n google/chat/v1/space_event.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/chat/v1/event_payload.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xce\r\n\nSpaceEvent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12.\n\nevent_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\nevent_type\x18\x06 \x01(\t\x12M\n\x1amessage_created_event_data\x18\x0c \x01(\x0b\x32\'.google.chat.v1.MessageCreatedEventDataH\x00\x12M\n\x1amessage_updated_event_data\x18\r \x01(\x0b\x32\'.google.chat.v1.MessageUpdatedEventDataH\x00\x12M\n\x1amessage_deleted_event_data\x18\x0e \x01(\x0b\x32\'.google.chat.v1.MessageDeletedEventDataH\x00\x12X\n message_batch_created_event_data\x18\x1a \x01(\x0b\x32,.google.chat.v1.MessageBatchCreatedEventDataH\x00\x12X\n message_batch_updated_event_data\x18\x1b \x01(\x0b\x32,.google.chat.v1.MessageBatchUpdatedEventDataH\x00\x12X\n message_batch_deleted_event_data\x18\x1c \x01(\x0b\x32,.google.chat.v1.MessageBatchDeletedEventDataH\x00\x12I\n\x18space_updated_event_data\x18\x0f \x01(\x0b\x32%.google.chat.v1.SpaceUpdatedEventDataH\x00\x12T\n\x1espace_batch_updated_event_data\x18\x1d \x01(\x0b\x32*.google.chat.v1.SpaceBatchUpdatedEventDataH\x00\x12S\n\x1dmembership_created_event_data\x18\x11 \x01(\x0b\x32*.google.chat.v1.MembershipCreatedEventDataH\x00\x12S\n\x1dmembership_updated_event_data\x18\x12 \x01(\x0b\x32*.google.chat.v1.MembershipUpdatedEventDataH\x00\x12T\n\x1dmembership_deleted_event_data\x18\xdb\x01 \x01(\x0b\x32*.google.chat.v1.MembershipDeletedEventDataH\x00\x12^\n#membership_batch_created_event_data\x18\x1f \x01(\x0b\x32/.google.chat.v1.MembershipBatchCreatedEventDataH\x00\x12^\n#membership_batch_updated_event_data\x18 \x01(\x0b\x32/.google.chat.v1.MembershipBatchUpdatedEventDataH\x00\x12^\n#membership_batch_deleted_event_data\x18! \x01(\x0b\x32/.google.chat.v1.MembershipBatchDeletedEventDataH\x00\x12O\n\x1breaction_created_event_data\x18\x15 \x01(\x0b\x32(.google.chat.v1.ReactionCreatedEventDataH\x00\x12O\n\x1breaction_deleted_event_data\x18\x16 \x01(\x0b\x32(.google.chat.v1.ReactionDeletedEventDataH\x00\x12Z\n!reaction_batch_created_event_data\x18\" \x01(\x0b\x32-.google.chat.v1.ReactionBatchCreatedEventDataH\x00\x12Z\n!reaction_batch_deleted_event_data\x18# \x01(\x0b\x32-.google.chat.v1.ReactionBatchDeletedEventDataH\x00:M\xea\x41J\n\x1e\x63hat.googleapis.com/SpaceEvent\x12(spaces/{space}/spaceEvents/{space_event}B\t\n\x07payload\"L\n\x14GetSpaceEventRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/SpaceEvent\"\x8c\x01\n\x16ListSpaceEventsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63hat.googleapis.com/SpaceEvent\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\t\x12\x13\n\x06\x66ilter\x18\x08 \x01(\tB\x03\xe0\x41\x02\"d\n\x17ListSpaceEventsResponse\x12\x30\n\x0cspace_events\x18\x01 \x03(\x0b\x32\x1a.google.chat.v1.SpaceEvent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\tB\x9a\x01\n\x12\x63om.google.chat.v1B\x0fSpaceEventProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.chat.v1.MessageCreatedEventData", "google/chat/v1/event_payload.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + SpaceEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceEvent").msgclass + GetSpaceEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetSpaceEventRequest").msgclass + ListSpaceEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSpaceEventsRequest").msgclass + ListSpaceEventsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSpaceEventsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb new file mode 100644 index 000000000000..25efd1bf5831 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/space.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/chat/v1/history_state_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\x1agoogle/chat/v1/space.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/chat/v1/history_state.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb4\x14\n\x05Space\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1a.google.chat.v1.Space.TypeB\x05\x18\x01\xe0\x41\x03\x12\x33\n\nspace_type\x18\n \x01(\x0e\x32\x1f.google.chat.v1.Space.SpaceType\x12\x1f\n\x12single_user_bot_dm\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x17\n\x08threaded\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\"\n\x15\x65xternal_user_allowed\x18\x08 \x01(\x08\x42\x03\xe0\x41\x05\x12M\n\x15space_threading_state\x18\t \x01(\x0e\x32).google.chat.v1.Space.SpaceThreadingStateB\x03\xe0\x41\x03\x12\x39\n\rspace_details\x18\x0b \x01(\x0b\x32\".google.chat.v1.Space.SpaceDetails\x12\x39\n\x13space_history_state\x18\r \x01(\x0e\x32\x1c.google.chat.v1.HistoryState\x12\x18\n\x0bimport_mode\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n\x0b\x63reate_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\x12\x39\n\x10last_active_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0f\x61\x64min_installed\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x44\n\x10membership_count\x18\x14 \x01(\x0b\x32%.google.chat.v1.Space.MembershipCountB\x03\xe0\x41\x03\x12\x42\n\x0f\x61\x63\x63\x65ss_settings\x18\x17 \x01(\x0b\x32$.google.chat.v1.Space.AccessSettingsB\x03\xe0\x41\x01\x12\x16\n\tspace_uri\x18\x19 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x1epredefined_permission_settings\x18\x1a \x01(\x0e\x32\x32.google.chat.v1.Space.PredefinedPermissionSettingsB\x06\xe0\x41\x04\xe0\x41\x01H\x00\x12L\n\x13permission_settings\x18\x1b \x01(\x0b\x32(.google.chat.v1.Space.PermissionSettingsB\x03\xe0\x41\x01H\x00\x1a\x37\n\x0cSpaceDetails\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x12\n\nguidelines\x18\x02 \x01(\t\x1aU\n\x0fMembershipCount\x12&\n\x1ejoined_direct_human_user_count\x18\x04 \x01(\x05\x12\x1a\n\x12joined_group_count\x18\x05 \x01(\x05\x1a\xc0\x01\n\x0e\x41\x63\x63\x65ssSettings\x12K\n\x0c\x61\x63\x63\x65ss_state\x18\x01 \x01(\x0e\x32\x30.google.chat.v1.Space.AccessSettings.AccessStateB\x03\xe0\x41\x03\x12\x15\n\x08\x61udience\x18\x03 \x01(\tB\x03\xe0\x41\x01\"J\n\x0b\x41\x63\x63\x65ssState\x12\x1c\n\x18\x41\x43\x43\x45SS_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIVATE\x10\x01\x12\x10\n\x0c\x44ISCOVERABLE\x10\x02\x1a\x85\x06\n\x12PermissionSettings\x12O\n\x19manage_members_and_groups\x18\x01 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingH\x00\x88\x01\x01\x12J\n\x14modify_space_details\x18\x02 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingH\x01\x88\x01\x01\x12\x44\n\x0etoggle_history\x18\x03 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingH\x02\x88\x01\x01\x12H\n\x12use_at_mention_all\x18\x04 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingH\x03\x88\x01\x01\x12\x41\n\x0bmanage_apps\x18\x05 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingH\x04\x88\x01\x01\x12\x45\n\x0fmanage_webhooks\x18\x06 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingH\x05\x88\x01\x01\x12H\n\rpost_messages\x18\x07 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x03H\x06\x88\x01\x01\x12\x44\n\x0ereply_messages\x18\x08 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingH\x07\x88\x01\x01\x42\x1c\n\x1a_manage_members_and_groupsB\x17\n\x15_modify_space_detailsB\x11\n\x0f_toggle_historyB\x15\n\x13_use_at_mention_allB\x0e\n\x0c_manage_appsB\x12\n\x10_manage_webhooksB\x10\n\x0e_post_messagesB\x11\n\x0f_reply_messages\x1a\x46\n\x11PermissionSetting\x12\x18\n\x10managers_allowed\x18\x01 \x01(\x08\x12\x17\n\x0fmembers_allowed\x18\x02 \x01(\x08\".\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04ROOM\x10\x01\x12\x06\n\x02\x44M\x10\x02\"V\n\tSpaceType\x12\x1a\n\x16SPACE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nGROUP_CHAT\x10\x02\x12\x12\n\x0e\x44IRECT_MESSAGE\x10\x03\"\x82\x01\n\x13SpaceThreadingState\x12%\n!SPACE_THREADING_STATE_UNSPECIFIED\x10\x00\x12\x15\n\x11THREADED_MESSAGES\x10\x02\x12\x14\n\x10GROUPED_MESSAGES\x10\x03\x12\x17\n\x13UNTHREADED_MESSAGES\x10\x04\"\x7f\n\x1cPredefinedPermissionSettings\x12.\n*PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED\x10\x00\x12\x17\n\x13\x43OLLABORATION_SPACE\x10\x01\x12\x16\n\x12\x41NNOUNCEMENT_SPACE\x10\x02:.\xea\x41+\n\x19\x63hat.googleapis.com/Space\x12\x0espaces/{space}B\x1b\n\x19space_permission_settings\"X\n\x12\x43reateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Y\n\x11ListSpacesRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01\"T\n\x12ListSpacesResponse\x12%\n\x06spaces\x18\x01 \x03(\x0b\x32\x15.google.chat.v1.Space\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\\\n\x0fGetSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x18\n\x10use_admin_access\x18\x02 \x01(\x08\"-\n\x18\x46indDirectMessageRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x8a\x01\n\x12UpdateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x18\n\x10use_admin_access\x18\x03 \x01(\x08\"\x81\x01\n\x13SearchSpacesRequest\x12\x18\n\x10use_admin_access\x18\x01 \x01(\x08\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x12\n\x05query\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"j\n\x14SearchSpacesResponse\x12%\n\x06spaces\x18\x01 \x03(\x0b\x32\x15.google.chat.v1.Space\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"_\n\x12\x44\x65leteSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x18\n\x10use_admin_access\x18\x02 \x01(\x08\"M\n\x1a\x43ompleteImportSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\"C\n\x1b\x43ompleteImportSpaceResponse\x12$\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\xa3\x01\n\x12\x63om.google.chat.v1B\nSpaceProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + Space = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space").msgclass + Space::SpaceDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.SpaceDetails").msgclass + Space::MembershipCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.MembershipCount").msgclass + Space::AccessSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.AccessSettings").msgclass + Space::AccessSettings::AccessState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.AccessSettings.AccessState").enummodule + Space::PermissionSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.PermissionSettings").msgclass + Space::PermissionSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.PermissionSetting").msgclass + Space::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.Type").enummodule + Space::SpaceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.SpaceType").enummodule + Space::SpaceThreadingState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.SpaceThreadingState").enummodule + Space::PredefinedPermissionSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.PredefinedPermissionSettings").enummodule + CreateSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateSpaceRequest").msgclass + ListSpacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSpacesRequest").msgclass + ListSpacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSpacesResponse").msgclass + GetSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetSpaceRequest").msgclass + FindDirectMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindDirectMessageRequest").msgclass + UpdateSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateSpaceRequest").msgclass + SearchSpacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SearchSpacesRequest").msgclass + SearchSpacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SearchSpacesResponse").msgclass + DeleteSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteSpaceRequest").msgclass + CompleteImportSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CompleteImportSpaceRequest").msgclass + CompleteImportSpaceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CompleteImportSpaceResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_read_state_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_read_state_pb.rb new file mode 100644 index 000000000000..68a634bbaf0b --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_read_state_pb.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/space_read_state.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n%google/chat/v1/space_read_state.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbc\x01\n\x0eSpaceReadState\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x37\n\x0elast_read_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01:c\xea\x41`\n\"chat.googleapis.com/SpaceReadState\x12*users/{user}/spaces/{space}/spaceReadState2\x0espaceReadState\"T\n\x18GetSpaceReadStateRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"chat.googleapis.com/SpaceReadState\"\x92\x01\n\x1bUpdateSpaceReadStateRequest\x12=\n\x10space_read_state\x18\x01 \x01(\x0b\x32\x1e.google.chat.v1.SpaceReadStateB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x42\xac\x01\n\x12\x63om.google.chat.v1B\x13SpaceReadStateProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + SpaceReadState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceReadState").msgclass + GetSpaceReadStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetSpaceReadStateRequest").msgclass + UpdateSpaceReadStateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateSpaceReadStateRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_setup_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_setup_pb.rb new file mode 100644 index 000000000000..b59facf3c2bc --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_setup_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/space_setup.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/chat/v1/membership_pb' +require 'google/chat/v1/space_pb' + + +descriptor_data = "\n google/chat/v1/space_setup.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/chat/v1/membership.proto\x1a\x1agoogle/chat/v1/space.proto\"\x8d\x01\n\x11SetUpSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0bmemberships\x18\x04 \x03(\x0b\x32\x1a.google.chat.v1.MembershipB\x03\xe0\x41\x01\x42\xa8\x01\n\x12\x63om.google.chat.v1B\x0fSpaceSetupProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.chat.v1.Space", "google/chat/v1/space.proto"], + ["google.chat.v1.Membership", "google/chat/v1/membership.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + SetUpSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SetUpSpaceRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/thread_read_state_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/thread_read_state_pb.rb new file mode 100644 index 000000000000..0944235cf6ea --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/thread_read_state_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/thread_read_state.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n&google/chat/v1/thread_read_state.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xcc\x01\n\x0fThreadReadState\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x0elast_read_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp:w\xea\x41t\n#chat.googleapis.com/ThreadReadState\x12\n\x0btext_button\x18\x01 \x01(\x0b\x32\'.google.chat.v1.WidgetMarkup.TextButtonH\x00\x12@\n\x0cimage_button\x18\x02 \x01(\x0b\x32(.google.chat.v1.WidgetMarkup.ImageButtonH\x00\x42\x06\n\x04type\x1aR\n\nTextButton\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x36\n\x08on_click\x18\x02 \x01(\x0b\x32$.google.chat.v1.WidgetMarkup.OnClick\x1a\xa9\x02\n\x08KeyValue\x12\x31\n\x04icon\x18\x01 \x01(\x0e\x32!.google.chat.v1.WidgetMarkup.IconH\x00\x12\x12\n\x08icon_url\x18\x02 \x01(\tH\x00\x12\x11\n\ttop_label\x18\x03 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x04 \x01(\t\x12\x19\n\x11\x63ontent_multiline\x18\t \x01(\x08\x12\x14\n\x0c\x62ottom_label\x18\x05 \x01(\t\x12\x36\n\x08on_click\x18\x06 \x01(\x0b\x32$.google.chat.v1.WidgetMarkup.OnClick\x12\x35\n\x06\x62utton\x18\x07 \x01(\x0b\x32#.google.chat.v1.WidgetMarkup.ButtonH\x01\x42\x07\n\x05iconsB\t\n\x07\x63ontrol\x1ah\n\x05Image\x12\x11\n\timage_url\x18\x01 \x01(\t\x12\x36\n\x08on_click\x18\x02 \x01(\x0b\x32$.google.chat.v1.WidgetMarkup.OnClick\x12\x14\n\x0c\x61spect_ratio\x18\x03 \x01(\x01\x1a\xa3\x01\n\x0bImageButton\x12\x31\n\x04icon\x18\x01 \x01(\x0e\x32!.google.chat.v1.WidgetMarkup.IconH\x00\x12\x12\n\x08icon_url\x18\x03 \x01(\tH\x00\x12\x36\n\x08on_click\x18\x02 \x01(\x0b\x32$.google.chat.v1.WidgetMarkup.OnClick\x12\x0c\n\x04name\x18\x04 \x01(\tB\x07\n\x05icons\x1a\x88\x01\n\x07OnClick\x12\x39\n\x06\x61\x63tion\x18\x01 \x01(\x0b\x32\'.google.chat.v1.WidgetMarkup.FormActionH\x00\x12:\n\topen_link\x18\x02 \x01(\x0b\x32%.google.chat.v1.WidgetMarkup.OpenLinkH\x00\x42\x06\n\x04\x64\x61ta\x1a\x17\n\x08OpenLink\x12\x0b\n\x03url\x18\x01 \x01(\t\x1a\xa4\x01\n\nFormAction\x12\x1a\n\x12\x61\x63tion_method_name\x18\x01 \x01(\t\x12K\n\nparameters\x18\x02 \x03(\x0b\x32\x37.google.chat.v1.WidgetMarkup.FormAction.ActionParameter\x1a-\n\x0f\x41\x63tionParameter\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xe0\x03\n\x04Icon\x12\x14\n\x10ICON_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x41IRPLANE\x10\x01\x12\x0c\n\x08\x42OOKMARK\x10\x1a\x12\x07\n\x03\x42US\x10\x19\x12\x07\n\x03\x43\x41R\x10\t\x12\t\n\x05\x43LOCK\x10\x02\x12\x1c\n\x18\x43ONFIRMATION_NUMBER_ICON\x10\x0c\x12\n\n\x06\x44OLLAR\x10\x0e\x12\x0f\n\x0b\x44\x45SCRIPTION\x10\x1b\x12\t\n\x05\x45MAIL\x10\n\x12\x13\n\x0f\x45VENT_PERFORMER\x10\x14\x12\x0e\n\nEVENT_SEAT\x10\x15\x12\x12\n\x0e\x46LIGHT_ARRIVAL\x10\x10\x12\x14\n\x10\x46LIGHT_DEPARTURE\x10\x0f\x12\t\n\x05HOTEL\x10\x06\x12\x13\n\x0fHOTEL_ROOM_TYPE\x10\x11\x12\n\n\x06INVITE\x10\x13\x12\x0b\n\x07MAP_PIN\x10\x03\x12\x0e\n\nMEMBERSHIP\x10\x18\x12\x13\n\x0fMULTIPLE_PEOPLE\x10\x12\x12\t\n\x05OFFER\x10\x1e\x12\n\n\x06PERSON\x10\x0b\x12\t\n\x05PHONE\x10\r\x12\x13\n\x0fRESTAURANT_ICON\x10\x07\x12\x11\n\rSHOPPING_CART\x10\x08\x12\x08\n\x04STAR\x10\x05\x12\t\n\x05STORE\x10\x16\x12\n\n\x06TICKET\x10\x04\x12\t\n\x05TRAIN\x10\x17\x12\x10\n\x0cVIDEO_CAMERA\x10\x1c\x12\x0e\n\nVIDEO_PLAY\x10\x1d\x42\x06\n\x04\x64\x61taB\xa5\x01\n\x12\x63om.google.chat.v1B\x0cWidgetsProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Apps + module Chat + module V1 + WidgetMarkup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup").msgclass + WidgetMarkup::TextParagraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.TextParagraph").msgclass + WidgetMarkup::Button = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.Button").msgclass + WidgetMarkup::TextButton = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.TextButton").msgclass + WidgetMarkup::KeyValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.KeyValue").msgclass + WidgetMarkup::Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.Image").msgclass + WidgetMarkup::ImageButton = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.ImageButton").msgclass + WidgetMarkup::OnClick = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.OnClick").msgclass + WidgetMarkup::OpenLink = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.OpenLink").msgclass + WidgetMarkup::FormAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.FormAction").msgclass + WidgetMarkup::FormAction::ActionParameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.FormAction.ActionParameter").msgclass + WidgetMarkup::Icon = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.WidgetMarkup.Icon").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/README.md b/owl-bot-staging/google-apps-chat-v1/proto_docs/README.md new file mode 100644 index 000000000000..bd33b9b4ff23 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Chat V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..2223d8935069 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/client.rb @@ -0,0 +1,420 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..935946d52792 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/apps/card/v1/card.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/apps/card/v1/card.rb new file mode 100644 index 000000000000..83e442d09e40 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/apps/card/v1/card.rb @@ -0,0 +1,2076 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Card + module V1 + # 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 the components of a card or + # dialog](https://developers.google.com/workspace/chat/design-components-card-dialog). + # * 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/workspace/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/workspace/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" + # } + # ] + # } + # } + # } + # ] + # } + # } + # ] + # } + # ] + # } + # } + # ] + # } + # ``` + # @!attribute [rw] header + # @return [::Google::Apps::Card::V1::Card::CardHeader] + # The header of the card. A header usually contains a leading image and a + # title. Headers always appear at the top of a card. + # @!attribute [rw] sections + # @return [::Array<::Google::Apps::Card::V1::Card::Section>] + # 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 [Define a section of a + # card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card). + # @!attribute [rw] section_divider_style + # @return [::Google::Apps::Card::V1::Card::DividerStyle] + # The divider style between sections. + # @!attribute [rw] card_actions + # @return [::Array<::Google::Apps::Card::V1::Card::CardAction>] + # 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" + # } + # } + # } + # ] + # ``` + # @!attribute [rw] name + # @return [::String] + # Name of the card. Used as a card identifier in card navigation. + # + # [Google Workspace + # Add-ons](https://developers.google.com/workspace/add-ons): + # @!attribute [rw] fixed_footer + # @return [::Google::Apps::Card::V1::Card::CardFixedFooter] + # 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/workspace/chat/dialogs), but not + # [card + # messages](https://developers.google.com/workspace/chat/create-messages#create). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] display_style + # @return [::Google::Apps::Card::V1::Card::DisplayStyle] + # In Google Workspace Add-ons, sets the display properties of the + # `peekCardHeader`. + # + # [Google Workspace + # Add-ons](https://developers.google.com/workspace/add-ons): + # @!attribute [rw] peek_card_header + # @return [::Google::Apps::Card::V1::Card::CardHeader] + # 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): + class Card + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a card header. For an example in Google Chat apps, see [Add a + # header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] title + # @return [::String] + # 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. + # @!attribute [rw] subtitle + # @return [::String] + # The subtitle of the card header. If specified, appears on its own line + # below the `title`. + # @!attribute [rw] image_type + # @return [::Google::Apps::Card::V1::Widget::ImageType] + # The shape used to crop the image. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] image_url + # @return [::String] + # The HTTPS URL of the image in the card header. + # @!attribute [rw] image_alt_text + # @return [::String] + # The alternative text of this image that's used for accessibility. + class CardHeader + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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): + # @!attribute [rw] header + # @return [::String] + # 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/workspace/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). + # @!attribute [rw] widgets + # @return [::Array<::Google::Apps::Card::V1::Widget>] + # All the widgets in the section. + # Must contain at least one widget. + # @!attribute [rw] collapsible + # @return [::Boolean] + # 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`. + # @!attribute [rw] uncollapsible_widgets_count + # @return [::Integer] + # 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`. + class Section + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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): + # @!attribute [rw] action_label + # @return [::String] + # The label that displays as the action menu item. + # @!attribute [rw] on_click + # @return [::Google::Apps::Card::V1::OnClick] + # The `onClick` action for this action item. + class CardAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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/workspace/chat/dialogs), but not + # [card + # messages](https://developers.google.com/workspace/chat/create-messages#create). + # For an example in Google Chat apps, see [Add a persistent + # footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] primary_button + # @return [::Google::Apps::Card::V1::Button] + # The primary button of the fixed footer. The button must be a text button + # with text and color set. + # @!attribute [rw] secondary_button + # @return [::Google::Apps::Card::V1::Button] + # 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`. + class CardFixedFooter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The divider style of a card. Currently only used for dividers betweens card + # sections. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + module DividerStyle + # Don't use. Unspecified. + DIVIDER_STYLE_UNSPECIFIED = 0 + + # Default option. Render a solid divider between sections. + SOLID_DIVIDER = 1 + + # If set, no divider is rendered between sections. + NO_DIVIDER = 2 + end + + # In Google Workspace Add-ons, + # determines how a card is displayed. + # + # [Google Workspace + # Add-ons](https://developers.google.com/workspace/add-ons): + module DisplayStyle + # Don't use. Unspecified. + DISPLAY_STYLE_UNSPECIFIED = 0 + + # The header of the card appears at the bottom of the + # sidebar, partially covering the current top card of the stack. Clicking + # the header pops the card into the card stack. If the card has no header, + # a generated header is used instead. + PEEK = 1 + + # Default value. The card is shown by replacing the view of the top card in + # the card stack. + REPLACE = 2 + end + end + + # Each card is made up of widgets. + # + # A widget is a composite object that can represent one of text, images, + # buttons, and other object types. + # @!attribute [rw] text_paragraph + # @return [::Google::Apps::Card::V1::TextParagraph] + # 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/workspace/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" + # } + # ``` + # @!attribute [rw] image + # @return [::Google::Apps::Card::V1::Image] + # Displays an image. + # + # For example, the following JSON creates an image with alternative text: + # ``` + # "image": { + # "imageUrl": + # "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", + # "altText": "Chat app avatar" + # } + # ``` + # @!attribute [rw] decorated_text + # @return [::Google::Apps::Card::V1::DecoratedText] + # 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" + # } + # } + # ``` + # @!attribute [rw] button_list + # @return [::Google::Apps::Card::V1::ButtonList] + # 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" + # } + # } + # } + # ] + # } + # ``` + # @!attribute [rw] text_input + # @return [::Google::Apps::Card::V1::TextInput] + # 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" + # } + # ] + # } + # } + # ``` + # @!attribute [rw] selection_input + # @return [::Google::Apps::Card::V1::SelectionInput] + # 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 + # } + # ] + # } + # ``` + # @!attribute [rw] date_time_picker + # @return [::Google::Apps::Card::V1::DateTimePicker] + # 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" + # } + # ``` + # @!attribute [rw] divider + # @return [::Google::Apps::Card::V1::Divider] + # Displays a horizontal line divider between widgets. + # + # For example, the following JSON creates a divider: + # ``` + # "divider": { + # } + # ``` + # @!attribute [rw] grid + # @return [::Google::Apps::Card::V1::Grid] + # 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" + # } + # } + # } + # ``` + # @!attribute [rw] columns + # @return [::Google::Apps::Card::V1::Columns] + # 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" + # } + # } + # ] + # } + # ] + # } + # ``` + # @!attribute [rw] horizontal_alignment + # @return [::Google::Apps::Card::V1::Widget::HorizontalAlignment] + # Specifies whether widgets align to the left, right, or center of a column. + class Widget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The shape used to crop the image. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + module ImageType + # Default value. Applies a square mask to the image. For example, a 4x3 + # image becomes 3x3. + SQUARE = 0 + + # Applies a circular mask to the image. For example, a 4x3 image becomes a + # circle with a diameter of 3. + CIRCLE = 1 + end + + # Specifies whether widgets align to the left, right, or center of a column. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + module HorizontalAlignment + # Don't use. Unspecified. + HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0 + + # Default value. Aligns widgets to the start position of the column. For + # left-to-right layouts, aligns to the left. For right-to-left layouts, + # aligns to the right. + START = 1 + + # Aligns widgets to the center of the column. + CENTER = 2 + + # Aligns widgets to the end position of the column. For left-to-right + # layouts, aligns widgets to the right. For right-to-left layouts, aligns + # widgets to the left. + HorizontalAlignment::END = 3 + end + end + + # A paragraph of text that supports formatting. For an example in + # Google Chat apps, see [Add a paragraph of formatted + # text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text). + # For more information + # about formatting text, see + # [Formatting text in Google Chat + # apps](https://developers.google.com/workspace/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): + # @!attribute [rw] text + # @return [::String] + # The text that's shown in the widget. + class TextParagraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An image that is specified by a URL and can have an `onClick` action. For an + # example, see [Add an + # image](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_image). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] image_url + # @return [::String] + # The HTTPS URL that hosts the image. + # + # For example: + # + # ``` + # https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png + # ``` + # @!attribute [rw] on_click + # @return [::Google::Apps::Card::V1::OnClick] + # When a user clicks the image, the click triggers this action. + # @!attribute [rw] alt_text + # @return [::String] + # The alternative text of this image that's used for accessibility. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Displays a divider between widgets as a horizontal line. For an example in + # Google Chat apps, see + # [Add a horizontal divider between + # widgets](https://developers.google.com/workspace/chat/format-structure-card-dialog#add_a_horizontal_divider_between_widgets). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # + # For example, the following JSON creates a divider: + # + # ``` + # "divider": {} + # ``` + class Divider + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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 [Display text with decorative + # text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#display_text_with_decorative_elements). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] icon + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Apps::Card::V1::Icon] + # Deprecated in favor of `startIcon`. + # @!attribute [rw] start_icon + # @return [::Google::Apps::Card::V1::Icon] + # The icon displayed in front of the text. + # @!attribute [rw] top_label + # @return [::String] + # The text that appears above `text`. Always truncates. + # @!attribute [rw] text + # @return [::String] + # Required. The primary text. + # + # Supports simple formatting. For more information + # about formatting text, see + # [Formatting text in Google Chat + # apps](https://developers.google.com/workspace/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). + # @!attribute [rw] wrap_text + # @return [::Boolean] + # 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`. + # @!attribute [rw] bottom_label + # @return [::String] + # The text that appears below `text`. Always wraps. + # @!attribute [rw] on_click + # @return [::Google::Apps::Card::V1::OnClick] + # This action is triggered when users click `topLabel` or `bottomLabel`. + # @!attribute [rw] button + # @return [::Google::Apps::Card::V1::Button] + # A button that a user can click to trigger an action. + # @!attribute [rw] switch_control + # @return [::Google::Apps::Card::V1::DecoratedText::SwitchControl] + # A switch widget that a user can click to change its state and trigger an + # action. + # @!attribute [rw] end_icon + # @return [::Google::Apps::Card::V1::Icon] + # An icon displayed after the text. + # + # Supports + # [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) + # and + # [custom](https://developers.google.com/workspace/chat/format-messages#customicons) + # icons. + class DecoratedText + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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. + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] value + # @return [::String] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] selected + # @return [::Boolean] + # When `true`, the switch is selected. + # @!attribute [rw] on_change_action + # @return [::Google::Apps::Card::V1::Action] + # The action to perform when the switch state is changed, such as what + # function to run. + # @!attribute [rw] control_type + # @return [::Google::Apps::Card::V1::DecoratedText::SwitchControl::ControlType] + # How the switch appears in the user interface. + # + # [Google Workspace Add-ons + # and Chat apps](https://developers.google.com/workspace/extend): + class SwitchControl + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # How the switch appears in the user interface. + # + # [Google Workspace Add-ons + # and Chat apps](https://developers.google.com/workspace/extend): + module ControlType + # A toggle-style switch. + SWITCH = 0 + + # Deprecated in favor of `CHECK_BOX`. + CHECKBOX = 1 + + # A checkbox. + CHECK_BOX = 2 + end + end + end + + # A field in which users can enter text. Supports suggestions and on-change + # actions. For an example in Google Chat apps, see [Add a field in which a user + # can enter + # text](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_field_in_which_a_user_can_enter_text). + # + # 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/workspace/chat/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 + # {::Google::Apps::Card::V1::SelectionInput SelectionInput} widget. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] label + # @return [::String] + # 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. + # @!attribute [rw] hint_text + # @return [::String] + # 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. + # @!attribute [rw] value + # @return [::String] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] type + # @return [::Google::Apps::Card::V1::TextInput::Type] + # How a text input field appears in the user interface. + # For example, whether the field is single or multi-line. + # @!attribute [rw] on_change_action + # @return [::Google::Apps::Card::V1::Action] + # 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/workspace/chat/dialogs) + # in Google Chat. + # @!attribute [rw] initial_suggestions + # @return [::Google::Apps::Card::V1::Suggestions] + # 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): + # @!attribute [rw] auto_complete_action + # @return [::Google::Apps::Card::V1::Action] + # 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): + # @!attribute [rw] placeholder_text + # @return [::String] + # 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): + class TextInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # How a text input field appears in the user interface. For example, + # whether it's a single line input field, or a multi-line input. If + # `initialSuggestions` is specified, `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): + module Type + # The text input field has a fixed height of one line. + SINGLE_LINE = 0 + + # The text input field has a fixed height of multiple lines. + MULTIPLE_LINE = 1 + end + end + + # 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): + # @!attribute [rw] items + # @return [::Array<::Google::Apps::Card::V1::Suggestions::SuggestionItem>] + # A list of suggestions used for autocomplete recommendations in text input + # fields. + class Suggestions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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): + # @!attribute [rw] text + # @return [::String] + # The value of a suggested input to a text input field. This is + # equivalent to what users enter themselves. + class SuggestionItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A list of buttons layed out horizontally. For an example in + # Google Chat apps, see + # [Add a + # button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] buttons + # @return [::Array<::Google::Apps::Card::V1::Button>] + # An array of buttons. + class ButtonList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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 [Add selectable UI + # elements](/workspace/chat/design-interactive-card-dialog#add_selectable_ui_elements). + # + # 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/workspace/chat/read-form-data). + # + # To collect undefined or abstract data from users, use + # the {::Google::Apps::Card::V1::TextInput TextInput} widget. + # + # [Google Workspace Add-ons + # and Chat apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] label + # @return [::String] + # 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". + # @!attribute [rw] type + # @return [::Google::Apps::Card::V1::SelectionInput::SelectionType] + # 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. + # @!attribute [rw] items + # @return [::Array<::Google::Apps::Card::V1::SelectionInput::SelectionItem>] + # An array of selectable items. For example, an array of radio buttons or + # checkboxes. Supports up to 100 items. + # @!attribute [rw] on_change_action + # @return [::Google::Apps::Card::V1::Action] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] multi_select_max_selected_items + # @return [::Integer] + # For multiselect menus, the maximum number of items that a user can select. + # Minimum value is 1 item. If unspecified, defaults to 3 items. + # @!attribute [rw] multi_select_min_query_length + # @return [::Integer] + # For multiselect menus, the number of text characters that a user inputs + # before the 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. + # @!attribute [rw] external_data_source + # @return [::Google::Apps::Card::V1::Action] + # An external data source, such as a relational data base. + # @!attribute [rw] platform_data_source + # @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource] + # A data source from Google Workspace. + class SelectionInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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): + # @!attribute [rw] text + # @return [::String] + # The text that identifies or describes the item to users. + # @!attribute [rw] value + # @return [::String] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] selected + # @return [::Boolean] + # 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. + # @!attribute [rw] start_icon_uri + # @return [::String] + # 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/workspace/chat/images/quickstart-app-avatar.png`. + # @!attribute [rw] bottom_text + # @return [::String] + # For multiselect menus, a text description or label that's + # displayed below the item's `text` field. + class SelectionItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # For a + # {::Google::Apps::Card::V1::SelectionInput `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): + # @!attribute [rw] common_data_source + # @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource] + # A data source shared by all Google Workspace applications, such as + # users in a Google Workspace organization. + class PlatformDataSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A data source shared by all [Google Workspace + # applications] + # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp). + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + module CommonDataSource + # Default value. Don't use. + UNKNOWN = 0 + + # Google Workspace users. The user can only view and select users from + # their Google Workspace organization. + USER = 1 + end + end + + # The format for the items that users can select. Different options support + # different types of interactions. For example, users can select multiple + # checkboxes, but can only select one item from a dropdown menu. + # + # Each selection input supports one type of selection. Mixing checkboxes + # and switches, for example, isn't supported. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + module SelectionType + # A set of checkboxes. Users can select one or more checkboxes. + CHECK_BOX = 0 + + # A set of radio buttons. Users can select one radio button. + RADIO_BUTTON = 1 + + # A set of switches. Users can turn on one or more switches. + SWITCH = 2 + + # A dropdown menu. Users can select one item from the menu. + DROPDOWN = 3 + + # A multiselect menu for static or dynamic data. From the menu bar, + # users select one or more items. Users can also input values to populate + # dynamic data. For example, users can start typing the name of a Google + # Chat space and the widget autosuggests the space. + # + # To populate items for a multiselect menu, you can use one of the + # following types of data sources: + # + # * Static data: Items are specified as `SelectionItem` objects in the + # widget. Up to 100 items. + # * Google Workspace data: Items are populated using data from Google + # Workspace, such as Google Workspace users or Google Chat spaces. + # * External data: Items are populated from an external data + # source outside of Google Workspace. + # + # For examples of how to implement multiselect menus, see + # [Add a multiselect + # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # Multiselect for Google Workspace Add-ons are in + # Developer Preview. + MULTI_SELECT = 4 + end + end + + # Lets users input a date, a time, or both a date and a time. For an example in + # Google Chat apps, see [Let a user pick a date and + # time](https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time). + # + # 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): + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/read-form-data). + # @!attribute [rw] label + # @return [::String] + # 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`. + # @!attribute [rw] type + # @return [::Google::Apps::Card::V1::DateTimePicker::DateTimePickerType] + # Whether the widget supports inputting a date, a time, or the date and time. + # @!attribute [rw] value_ms_epoch + # @return [::Integer] + # 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`). + # @!attribute [rw] timezone_offset_date + # @return [::Integer] + # 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. + # @!attribute [rw] on_change_action + # @return [::Google::Apps::Card::V1::Action] + # Triggered when the user clicks **Save** or **Clear** from the + # `DateTimePicker` interface. + class DateTimePicker + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The format for the date and time in the `DateTimePicker` widget. + # Determines whether users can input a date, a time, or both a date and time. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + module DateTimePickerType + # Users input a date and time. + DATE_AND_TIME = 0 + + # Users input a date. + DATE_ONLY = 1 + + # Users input a time. + TIME_ONLY = 2 + end + end + + # A text, icon, or text and icon button that users can click. For an example in + # Google Chat apps, see + # [Add a + # button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). + # + # To make an image a clickable button, specify an + # {::Google::Apps::Card::V1::Image `Image`} (not an + # {::Google::Apps::Card::V1::ImageComponent `ImageComponent`}) and set an + # `onClick` action. + # + # [Google Workspace + # Add-ons and Chat apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] text + # @return [::String] + # The text displayed inside the button. + # @!attribute [rw] icon + # @return [::Google::Apps::Card::V1::Icon] + # The icon image. If both `icon` and `text` are set, then the icon appears + # before the text. + # @!attribute [rw] color + # @return [::Google::Type::Color] + # 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 + # } + # ``` + # @!attribute [rw] on_click + # @return [::Google::Apps::Card::V1::OnClick] + # Required. The action to perform when a user clicks the button, such as + # opening a hyperlink or running a custom function. + # @!attribute [rw] disabled + # @return [::Boolean] + # If `true`, the button is displayed in an inactive state and doesn't respond + # to user actions. + # @!attribute [rw] alt_text + # @return [::String] + # 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/workspace/chat". + class Button + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An icon displayed in a widget on a card. For an example in Google Chat apps, + # see [Add an + # icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). + # + # Supports + # [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) + # and + # [custom](https://developers.google.com/workspace/chat/format-messages#customicons) + # icons. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] known_icon + # @return [::String] + # 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/workspace/chat/format-messages#builtinicons). + # @!attribute [rw] icon_url + # @return [::String] + # Display a custom icon hosted at an HTTPS URL. + # + # For example: + # + # ``` + # "iconUrl": + # "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" + # ``` + # + # Supported file types include `.png` and `.jpg`. + # @!attribute [rw] material_icon + # @return [::Google::Apps::Card::V1::MaterialIcon] + # 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): + # @!attribute [rw] alt_text + # @return [::String] + # 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/workspace/chat`. + # + # If the icon is set in a {::Google::Apps::Card::V1::Button `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. + # @!attribute [rw] image_type + # @return [::Google::Apps::Card::V1::Widget::ImageType] + # 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. + class Icon + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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): + # @!attribute [rw] name + # @return [::String] + # 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. + # @!attribute [rw] fill + # @return [::Boolean] + # 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**. + # @!attribute [rw] weight + # @return [::Integer] + # 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, the default value is used. + # + # To preview different icon settings, go to + # [Google Font Icons](https://fonts.google.com/icons) and adjust the + # settings under **Customize**. + # @!attribute [rw] grade + # @return [::Integer] + # 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, the default value is used. + # + # To preview different icon settings, go to + # [Google Font Icons](https://fonts.google.com/icons) and adjust the + # settings under **Customize**. + class MaterialIcon + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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 + # } + # ``` + # @!attribute [rw] type + # @return [::Google::Apps::Card::V1::ImageCropStyle::ImageCropType] + # The crop type. + # @!attribute [rw] aspect_ratio + # @return [::Float] + # 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 + # } + # ``` + class ImageCropStyle + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the crop style applied to an image. + # + # [Google Workspace Add-ons + # and Chat apps](https://developers.google.com/workspace/extend): + module ImageCropType + # Don't use. Unspecified. + IMAGE_CROP_TYPE_UNSPECIFIED = 0 + + # Default value. Applies a square crop. + SQUARE = 1 + + # Applies a circular crop. + CIRCLE = 2 + + # Applies a rectangular crop with a custom aspect ratio. Set the custom + # aspect ratio with `aspectRatio`. + RECTANGLE_CUSTOM = 3 + + # Applies a rectangular crop with a 4:3 aspect ratio. + RECTANGLE_4_3 = 4 + end + end + + # 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): + # @!attribute [rw] type + # @return [::Google::Apps::Card::V1::BorderStyle::BorderType] + # The border type. + # @!attribute [rw] stroke_color + # @return [::Google::Type::Color] + # The colors to use when the type is `BORDER_TYPE_STROKE`. + # @!attribute [rw] corner_radius + # @return [::Integer] + # The corner radius for the border. + class BorderStyle + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the border types applied to widgets. + # + # [Google Workspace Add-ons + # and Chat apps](https://developers.google.com/workspace/extend): + module BorderType + # Don't use. Unspecified. + BORDER_TYPE_UNSPECIFIED = 0 + + # Default value. No border. + NO_BORDER = 1 + + # Outline. + STROKE = 2 + end + end + + # Represents an image. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] image_uri + # @return [::String] + # The image URL. + # @!attribute [rw] alt_text + # @return [::String] + # The accessibility label for the image. + # @!attribute [rw] crop_style + # @return [::Google::Apps::Card::V1::ImageCropStyle] + # The crop style to apply to the image. + # @!attribute [rw] border_style + # @return [::Google::Apps::Card::V1::BorderStyle] + # The border style to apply to the image. + class ImageComponent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # 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 + # {::Google::Apps::Card::V1::Columns `Columns`}. For an example in Google Chat apps, + # see [Display a Grid with a collection of + # items](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_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. + # + # [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" + # } + # } + # } + # ``` + # @!attribute [rw] title + # @return [::String] + # The text that displays in the grid header. + # @!attribute [rw] items + # @return [::Array<::Google::Apps::Card::V1::Grid::GridItem>] + # The items to display in the grid. + # @!attribute [rw] border_style + # @return [::Google::Apps::Card::V1::BorderStyle] + # The border style to apply to each grid item. + # @!attribute [rw] column_count + # @return [::Integer] + # The number of columns to display in the grid. A default value + # is used if this field isn't specified, and that default value is + # different depending on where the grid is shown (dialog versus companion). + # @!attribute [rw] on_click + # @return [::Google::Apps::Card::V1::OnClick] + # This callback is reused by each individual grid item, but with the + # item's identifier and index in the items list added to the callback's + # parameters. + class Grid + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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): + # @!attribute [rw] id + # @return [::String] + # A user-specified identifier for this grid item. This identifier is + # returned in the parent grid's `onClick` callback parameters. + # @!attribute [rw] image + # @return [::Google::Apps::Card::V1::ImageComponent] + # The image that displays in the grid item. + # @!attribute [rw] title + # @return [::String] + # The grid item's title. + # @!attribute [rw] subtitle + # @return [::String] + # The grid item's subtitle. + # @!attribute [rw] layout + # @return [::Google::Apps::Card::V1::Grid::GridItem::GridItemLayout] + # The layout to use for the grid item. + class GridItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the various layout options available for a grid item. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + module GridItemLayout + # Don't use. Unspecified. + GRID_ITEM_LAYOUT_UNSPECIFIED = 0 + + # The title and subtitle are shown below the grid item's image. + TEXT_BELOW = 1 + + # The title and subtitle are shown above the grid item's image. + TEXT_ABOVE = 2 + end + end + end + + # 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 + # [Display cards and dialogs in + # columns](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_cards_and_dialogs_in_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 + # {::Google::Apps::Card::V1::Grid `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. + # @!attribute [rw] column_items + # @return [::Array<::Google::Apps::Card::V1::Columns::Column>] + # An array of columns. You can include up to 2 columns in a card or dialog. + class Columns + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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. + # @!attribute [rw] horizontal_size_style + # @return [::Google::Apps::Card::V1::Columns::Column::HorizontalSizeStyle] + # Specifies how a column fills the width of the card. + # @!attribute [rw] horizontal_alignment + # @return [::Google::Apps::Card::V1::Widget::HorizontalAlignment] + # Specifies whether widgets align to the left, right, or center of a + # column. + # @!attribute [rw] vertical_alignment + # @return [::Google::Apps::Card::V1::Columns::Column::VerticalAlignment] + # Specifies whether widgets align to the top, bottom, or center of a + # column. + # @!attribute [rw] widgets + # @return [::Array<::Google::Apps::Card::V1::Columns::Column::Widgets>] + # An array of widgets included in a column. Widgets appear in the order + # that they are specified. + class Column + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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. + # @!attribute [rw] text_paragraph + # @return [::Google::Apps::Card::V1::TextParagraph] + # {::Google::Apps::Card::V1::TextParagraph TextParagraph} widget. + # @!attribute [rw] image + # @return [::Google::Apps::Card::V1::Image] + # {::Google::Apps::Card::V1::Image Image} widget. + # @!attribute [rw] decorated_text + # @return [::Google::Apps::Card::V1::DecoratedText] + # {::Google::Apps::Card::V1::DecoratedText DecoratedText} widget. + # @!attribute [rw] button_list + # @return [::Google::Apps::Card::V1::ButtonList] + # {::Google::Apps::Card::V1::ButtonList ButtonList} widget. + # @!attribute [rw] text_input + # @return [::Google::Apps::Card::V1::TextInput] + # {::Google::Apps::Card::V1::TextInput TextInput} widget. + # @!attribute [rw] selection_input + # @return [::Google::Apps::Card::V1::SelectionInput] + # {::Google::Apps::Card::V1::SelectionInput SelectionInput} widget. + # @!attribute [rw] date_time_picker + # @return [::Google::Apps::Card::V1::DateTimePicker] + # {::Google::Apps::Card::V1::DateTimePicker DateTimePicker} widget. + class Widgets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies how a column fills the width of the card. The width of each + # column depends on both the `HorizontalSizeStyle` and the width of the + # widgets within the column. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # Columns for Google Workspace Add-ons are in + # Developer Preview. + module HorizontalSizeStyle + # Don't use. Unspecified. + HORIZONTAL_SIZE_STYLE_UNSPECIFIED = 0 + + # Default value. Column fills the available space, up to 70% of the + # card's width. If both columns are set to `FILL_AVAILABLE_SPACE`, each + # column fills 50% of the space. + FILL_AVAILABLE_SPACE = 1 + + # Column fills the least amount of space possible and no more than 30% of + # the card's width. + FILL_MINIMUM_SPACE = 2 + end + + # Specifies whether widgets align to the top, bottom, or center of 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. + module VerticalAlignment + # Don't use. Unspecified. + VERTICAL_ALIGNMENT_UNSPECIFIED = 0 + + # Default value. Aligns widgets to the center of a column. + CENTER = 1 + + # Aligns widgets to the top of a column. + TOP = 2 + + # Aligns widgets to the bottom of a column. + BOTTOM = 3 + end + end + end + + # 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): + # @!attribute [rw] action + # @return [::Google::Apps::Card::V1::Action] + # If specified, an action is triggered by this `onClick`. + # @!attribute [rw] open_link + # @return [::Google::Apps::Card::V1::OpenLink] + # If specified, this `onClick` triggers an open link action. + # @!attribute [rw] open_dynamic_link_action + # @return [::Google::Apps::Card::V1::Action] + # 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): + # @!attribute [rw] card + # @return [::Google::Apps::Card::V1::Card] + # A new card is pushed to the card stack after clicking if specified. + # + # [Google Workspace + # Add-ons](https://developers.google.com/workspace/add-ons): + class OnClick + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an `onClick` event that opens a hyperlink. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] url + # @return [::String] + # The URL to open. + # @!attribute [rw] open_as + # @return [::Google::Apps::Card::V1::OpenLink::OpenAs] + # How to open a link. + # + # [Google Workspace + # Add-ons](https://developers.google.com/workspace/add-ons): + # @!attribute [rw] on_close + # @return [::Google::Apps::Card::V1::OpenLink::OnClose] + # 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): + class OpenLink + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # When an `OnClick` action opens a link, then the client can either open it + # as a full-size window (if that's the frame used by the client), or an + # overlay (such as a pop-up). The implementation depends on the client + # platform capabilities, and the value selected might be ignored if the + # client doesn't support it. `FULL_SIZE` is supported by all clients. + # + # [Google Workspace + # Add-ons](https://developers.google.com/workspace/add-ons): + module OpenAs + # The link opens as a full-size window (if that's the frame used by the + # client). + FULL_SIZE = 0 + + # The link opens as an overlay, such as a pop-up. + OVERLAY = 1 + end + + # What the client does when a link opened by an `OnClick` action is closed. + # + # Implementation depends on client platform capabilities. For example, a web + # browser might open a link in a pop-up window with an `OnClose` handler. + # + # If both `OnOpen` and `OnClose` handlers are set, and the client platform + # can't support both values, `OnClose` takes precedence. + # + # [Google Workspace + # Add-ons](https://developers.google.com/workspace/add-ons): + module OnClose + # Default value. The card doesn't reload; nothing happens. + NOTHING = 0 + + # Reloads the card after the child window closes. + # + # If used in conjunction with + # [`OpenAs.OVERLAY`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#openas), + # the child window acts as a modal dialog and the parent card is blocked + # until the child window closes. + RELOAD = 1 + end + end + + # 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): + # @!attribute [rw] function + # @return [::String] + # A custom function to invoke when the containing element is + # clicked or othrwise activated. + # + # For example usage, see [Read form + # data](https://developers.google.com/workspace/chat/read-form-data). + # @!attribute [rw] parameters + # @return [::Array<::Google::Apps::Card::V1::Action::ActionParameter>] + # List of action parameters. + # @!attribute [rw] load_indicator + # @return [::Google::Apps::Card::V1::Action::LoadIndicator] + # Specifies the loading indicator that the action displays while + # making the call to the action. + # @!attribute [rw] persist_values + # @return [::Boolean] + # 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/workspace/chat/api/guides/v1/messages/create#create) + # in Chat apps, you must also set the action's + # [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) + # to `UPDATE_MESSAGE` and use the same + # [`card_id`](https://developers.google.com/workspace/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`. + # @!attribute [rw] interaction + # @return [::Google::Apps::Card::V1::Action::Interaction] + # Optional. Required when opening a + # [dialog](https://developers.google.com/workspace/chat/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/workspace/chat/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): + class Action + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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/workspace/chat/api/reference/rest/v1/Event#commoneventobject). + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] key + # @return [::String] + # The name of the parameter for the action script. + # @!attribute [rw] value + # @return [::String] + # The value of the parameter. + class ActionParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the loading indicator that the action displays while + # making the call to the action. + # + # [Google Workspace Add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + module LoadIndicator + # Displays a spinner to indicate that content is loading. + SPINNER = 0 + + # Nothing is displayed. + NONE = 1 + end + + # Optional. Required when opening a + # [dialog](https://developers.google.com/workspace/chat/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/workspace/chat/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): + module Interaction + # Default value. The `action` executes as normal. + INTERACTION_UNSPECIFIED = 0 + + # Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a + # windowed, card-based interface that Chat apps use to interact with users. + # + # Only supported by Chat apps in response to button-clicks on card + # messages. 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): + OPEN_DIALOG = 1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/action_status.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/action_status.rb new file mode 100644 index 000000000000..30bd1ec78a1e --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/action_status.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # Represents the status for a request to either invoke or submit a + # [dialog](https://developers.google.com/workspace/chat/dialogs). + # @!attribute [rw] status_code + # @return [::Google::Rpc::Code] + # The status code. + # @!attribute [rw] user_facing_message + # @return [::String] + # The message to send users about the status of their request. + # If unset, a generic message based on the `status_code` is sent. + class ActionStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/annotation.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/annotation.rb new file mode 100644 index 000000000000..3a3d1f388df6 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/annotation.rb @@ -0,0 +1,213 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # 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/workspace/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" + # } + # }] + # ``` + # @!attribute [rw] type + # @return [::Google::Apps::Chat::V1::AnnotationType] + # The type of this annotation. + # @!attribute [rw] start_index + # @return [::Integer] + # Start index (0-based, inclusive) in the plain-text message body this + # annotation corresponds to. + # @!attribute [rw] length + # @return [::Integer] + # Length of the substring in the plain-text message body this annotation + # corresponds to. + # @!attribute [rw] user_mention + # @return [::Google::Apps::Chat::V1::UserMentionMetadata] + # The metadata of user mention. + # @!attribute [rw] slash_command + # @return [::Google::Apps::Chat::V1::SlashCommandMetadata] + # The metadata for a slash command. + # @!attribute [rw] rich_link_metadata + # @return [::Google::Apps::Chat::V1::RichLinkMetadata] + # The metadata for a rich link. + class Annotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Annotation metadata for user mentions (@). + # @!attribute [rw] user + # @return [::Google::Apps::Chat::V1::User] + # The user mentioned. + # @!attribute [rw] type + # @return [::Google::Apps::Chat::V1::UserMentionMetadata::Type] + # The type of user mention. + class UserMentionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module Type + # Default value for the enum. Don't use. + TYPE_UNSPECIFIED = 0 + + # Add user to space. + ADD = 1 + + # Mention user in space. + MENTION = 2 + end + end + + # Annotation metadata for slash commands (/). + # @!attribute [rw] bot + # @return [::Google::Apps::Chat::V1::User] + # The Chat app whose command was invoked. + # @!attribute [rw] type + # @return [::Google::Apps::Chat::V1::SlashCommandMetadata::Type] + # The type of slash command. + # @!attribute [rw] command_name + # @return [::String] + # The name of the invoked slash command. + # @!attribute [rw] command_id + # @return [::Integer] + # The command ID of the invoked slash command. + # @!attribute [rw] triggers_dialog + # @return [::Boolean] + # Indicates whether the slash command is for a dialog. + class SlashCommandMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module Type + # Default value for the enum. Don't use. + TYPE_UNSPECIFIED = 0 + + # Add Chat app to space. + ADD = 1 + + # Invoke slash command in space. + INVOKE = 2 + end + end + + # A rich link to a resource. + # @!attribute [rw] uri + # @return [::String] + # The URI of this link. + # @!attribute [rw] rich_link_type + # @return [::Google::Apps::Chat::V1::RichLinkMetadata::RichLinkType] + # The rich link type. + # @!attribute [rw] drive_link_data + # @return [::Google::Apps::Chat::V1::DriveLinkData] + # Data for a drive link. + # @!attribute [rw] chat_space_link_data + # @return [::Google::Apps::Chat::V1::ChatSpaceLinkData] + # Data for a chat space link. + class RichLinkMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The rich link type. More types might be added in the future. + module RichLinkType + # Default value for the enum. Don't use. + RICH_LINK_TYPE_UNSPECIFIED = 0 + + # A Google Drive rich link type. + DRIVE_FILE = 1 + + # A Chat space rich link type. For example, a space smart chip. + CHAT_SPACE = 2 + end + end + + # Data for Google Drive links. + # @!attribute [rw] drive_data_ref + # @return [::Google::Apps::Chat::V1::DriveDataRef] + # A + # [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) + # which references a Google Drive file. + # @!attribute [rw] mime_type + # @return [::String] + # The mime type of the linked Google Drive resource. + class DriveLinkData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Data for Chat space links. + # @!attribute [rw] space + # @return [::String] + # The space of the linked Chat space resource. + # + # Format: `spaces/{space}` + # @!attribute [rw] thread + # @return [::String] + # The thread of the linked Chat space resource. + # + # Format: `spaces/{space}/threads/{thread}` + # @!attribute [rw] message + # @return [::String] + # The message of the linked Chat space resource. + # + # Format: `spaces/{space}/messages/{message}` + class ChatSpaceLinkData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Type of the annotation. + module AnnotationType + # Default value for the enum. Don't use. + ANNOTATION_TYPE_UNSPECIFIED = 0 + + # A user is mentioned. + USER_MENTION = 1 + + # A slash command is invoked. + SLASH_COMMAND = 2 + + # A rich link annotation. + RICH_LINK = 3 + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/attachment.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/attachment.rb new file mode 100644 index 000000000000..f525446a432b --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/attachment.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # An attachment in Google Chat. + # @!attribute [rw] name + # @return [::String] + # Resource name of the attachment, in the form + # `spaces/{space}/messages/{message}/attachments/{attachment}`. + # @!attribute [r] content_name + # @return [::String] + # Output only. The original file name for the content, not the full path. + # @!attribute [r] content_type + # @return [::String] + # Output only. The content type (MIME type) of the file. + # @!attribute [rw] attachment_data_ref + # @return [::Google::Apps::Chat::V1::AttachmentDataRef] + # A reference to the attachment data. This field is used with the media API + # to download the attachment data. + # @!attribute [r] drive_data_ref + # @return [::Google::Apps::Chat::V1::DriveDataRef] + # Output only. A reference to the Google Drive attachment. This field is + # used with the Google Drive API. + # @!attribute [r] thumbnail_uri + # @return [::String] + # 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. + # @!attribute [r] download_uri + # @return [::String] + # 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. + # @!attribute [r] source + # @return [::Google::Apps::Chat::V1::Attachment::Source] + # Output only. The source of the attachment. + class Attachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The source of the attachment. + module Source + # Reserved. + SOURCE_UNSPECIFIED = 0 + + # The file is a Google Drive file. + DRIVE_FILE = 1 + + # The file is uploaded to Chat. + UPLOADED_CONTENT = 2 + end + end + + # A reference to the data of a drive attachment. + # @!attribute [rw] drive_file_id + # @return [::String] + # The ID for the drive file. Use with the Drive API. + class DriveDataRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A reference to the attachment data. + # @!attribute [rw] resource_name + # @return [::String] + # The resource name of the attachment data. This field is used with the media + # API to download the attachment data. + # @!attribute [rw] attachment_upload_token + # @return [::String] + # 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. + class AttachmentDataRef + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to get an attachment. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the attachment, in the form + # `spaces/{space}/messages/{message}/attachments/{attachment}`. + class GetAttachmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to upload an attachment. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the Chat space in which the attachment is + # uploaded. Format "spaces/\\{space}". + # @!attribute [rw] filename + # @return [::String] + # Required. The filename of the attachment, including the file extension. + class UploadAttachmentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response of uploading an attachment. + # @!attribute [rw] attachment_data_ref + # @return [::Google::Apps::Chat::V1::AttachmentDataRef] + # Reference to the uploaded attachment. + class UploadAttachmentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/contextual_addon.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/contextual_addon.rb new file mode 100644 index 000000000000..f928b96621d2 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/contextual_addon.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # The markup for developers to specify the contents of a contextual AddOn. + class ContextualAddOnMarkup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A card is a UI element that can contain UI widgets such as text and + # images. + # @!attribute [rw] header + # @return [::Google::Apps::Chat::V1::ContextualAddOnMarkup::Card::CardHeader] + # The header of the card. A header usually contains a title and an image. + # @!attribute [rw] sections + # @return [::Array<::Google::Apps::Chat::V1::ContextualAddOnMarkup::Card::Section>] + # Sections are separated by a line divider. + # @!attribute [rw] card_actions + # @return [::Array<::Google::Apps::Chat::V1::ContextualAddOnMarkup::Card::CardAction>] + # The actions of this card. + # @!attribute [rw] name + # @return [::String] + # Name of the card. + class Card + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] title + # @return [::String] + # 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. + # @!attribute [rw] subtitle + # @return [::String] + # The subtitle of the card header. + # @!attribute [rw] image_style + # @return [::Google::Apps::Chat::V1::ContextualAddOnMarkup::Card::CardHeader::ImageStyle] + # The image's type (for example, square border or circular border). + # @!attribute [rw] image_url + # @return [::String] + # The URL of the image in the card header. + class CardHeader + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module ImageStyle + IMAGE_STYLE_UNSPECIFIED = 0 + + # Square border. + IMAGE = 1 + + # Circular border. + AVATAR = 2 + end + end + + # 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). + # @!attribute [rw] header + # @return [::String] + # 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/workspace/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). + # @!attribute [rw] widgets + # @return [::Array<::Google::Apps::Chat::V1::WidgetMarkup>] + # A section must contain at least one widget. + class Section + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A card action is + # the action associated with the card. For an invoice card, a + # typical action would be: delete invoice, email invoice or open the + # invoice in browser. + # + # Not supported by Google Chat apps. + # @!attribute [rw] action_label + # @return [::String] + # The label used to be displayed in the action menu item. + # @!attribute [rw] on_click + # @return [::Google::Apps::Chat::V1::WidgetMarkup::OnClick] + # The onclick action for this action item. + class CardAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/deletion_metadata.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/deletion_metadata.rb new file mode 100644 index 000000000000..274802f8d145 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/deletion_metadata.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # Information about a deleted message. A message is deleted when `delete_time` + # is set. + # @!attribute [rw] deletion_type + # @return [::Google::Apps::Chat::V1::DeletionMetadata::DeletionType] + # Indicates who deleted the message. + class DeletionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Who deleted the message and how it was deleted. + module DeletionType + # This value is unused. + DELETION_TYPE_UNSPECIFIED = 0 + + # User deleted their own message. + CREATOR = 1 + + # The space owner deleted the message. + SPACE_OWNER = 2 + + # A Google Workspace admin deleted the message. + ADMIN = 3 + + # A Chat app deleted its own message when it expired. + APP_MESSAGE_EXPIRY = 4 + + # A Chat app deleted the message on behalf of the user. + CREATOR_VIA_APP = 5 + + # A Chat app deleted the message on behalf of the space owner. + SPACE_OWNER_VIA_APP = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/event_payload.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/event_payload.rb new file mode 100644 index 000000000000..732a2da374d5 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/event_payload.rb @@ -0,0 +1,225 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # Event payload for a new membership. + # + # Event type: `google.workspace.chat.membership.v1.created`. + # @!attribute [rw] membership + # @return [::Google::Apps::Chat::V1::Membership] + # The new membership. + class MembershipCreatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for a deleted membership. + # + # Event type: `google.workspace.chat.membership.v1.deleted` + # @!attribute [rw] membership + # @return [::Google::Apps::Chat::V1::Membership] + # The deleted membership. Only the `name` and `state` fields are populated. + class MembershipDeletedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for an updated membership. + # + # Event type: `google.workspace.chat.membership.v1.updated` + # @!attribute [rw] membership + # @return [::Google::Apps::Chat::V1::Membership] + # The updated membership. + class MembershipUpdatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple new memberships. + # + # Event type: `google.workspace.chat.membership.v1.batchCreated` + # @!attribute [rw] memberships + # @return [::Array<::Google::Apps::Chat::V1::MembershipCreatedEventData>] + # A list of new memberships. + class MembershipBatchCreatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple updated memberships. + # + # Event type: `google.workspace.chat.membership.v1.batchUpdated` + # @!attribute [rw] memberships + # @return [::Array<::Google::Apps::Chat::V1::MembershipUpdatedEventData>] + # A list of updated memberships. + class MembershipBatchUpdatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple deleted memberships. + # + # Event type: `google.workspace.chat.membership.v1.batchDeleted` + # @!attribute [rw] memberships + # @return [::Array<::Google::Apps::Chat::V1::MembershipDeletedEventData>] + # A list of deleted memberships. + class MembershipBatchDeletedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for a new message. + # + # Event type: `google.workspace.chat.message.v1.created` + # @!attribute [rw] message + # @return [::Google::Apps::Chat::V1::Message] + # The new message. + class MessageCreatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for an updated message. + # + # Event type: `google.workspace.chat.message.v1.updated` + # @!attribute [rw] message + # @return [::Google::Apps::Chat::V1::Message] + # The updated message. + class MessageUpdatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for a deleted message. + # + # Event type: `google.workspace.chat.message.v1.deleted` + # @!attribute [rw] message + # @return [::Google::Apps::Chat::V1::Message] + # The deleted message. Only the `name`, `createTime`, `deleteTime`, and + # `deletionMetadata` fields are populated. + class MessageDeletedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple new messages. + # + # Event type: `google.workspace.chat.message.v1.batchCreated` + # @!attribute [rw] messages + # @return [::Array<::Google::Apps::Chat::V1::MessageCreatedEventData>] + # A list of new messages. + class MessageBatchCreatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple updated messages. + # + # Event type: `google.workspace.chat.message.v1.batchUpdated` + # @!attribute [rw] messages + # @return [::Array<::Google::Apps::Chat::V1::MessageUpdatedEventData>] + # A list of updated messages. + class MessageBatchUpdatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple deleted messages. + # + # Event type: `google.workspace.chat.message.v1.batchDeleted` + # @!attribute [rw] messages + # @return [::Array<::Google::Apps::Chat::V1::MessageDeletedEventData>] + # A list of deleted messages. + class MessageBatchDeletedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for an updated space. + # + # Event type: `google.workspace.chat.space.v1.updated` + # @!attribute [rw] space + # @return [::Google::Apps::Chat::V1::Space] + # The updated space. + class SpaceUpdatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple updates to a space. + # + # Event type: `google.workspace.chat.space.v1.batchUpdated` + # @!attribute [rw] spaces + # @return [::Array<::Google::Apps::Chat::V1::SpaceUpdatedEventData>] + # A list of updated spaces. + class SpaceBatchUpdatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for a new reaction. + # + # Event type: `google.workspace.chat.reaction.v1.created` + # @!attribute [rw] reaction + # @return [::Google::Apps::Chat::V1::Reaction] + # The new reaction. + class ReactionCreatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for a deleted reaction. + # + # Type: `google.workspace.chat.reaction.v1.deleted` + # @!attribute [rw] reaction + # @return [::Google::Apps::Chat::V1::Reaction] + # The deleted reaction. + class ReactionDeletedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple new reactions. + # + # Event type: `google.workspace.chat.reaction.v1.batchCreated` + # @!attribute [rw] reactions + # @return [::Array<::Google::Apps::Chat::V1::ReactionCreatedEventData>] + # A list of new reactions. + class ReactionBatchCreatedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Event payload for multiple deleted reactions. + # + # Event type: `google.workspace.chat.reaction.v1.batchDeleted` + # @!attribute [rw] reactions + # @return [::Array<::Google::Apps::Chat::V1::ReactionDeletedEventData>] + # A list of deleted reactions. + class ReactionBatchDeletedEventData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/group.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/group.rb new file mode 100644 index 000000000000..a415edb0c984 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/group.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A Google Group in Google Chat. + # @!attribute [rw] name + # @return [::String] + # 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} + class Group + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/history_state.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/history_state.rb new file mode 100644 index 000000000000..aa41861f314e --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/history_state.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # The history state for messages and spaces. Specifies how long messages and + # conversation threads are kept after creation. + module HistoryState + # Default value. Do not use. + HISTORY_STATE_UNSPECIFIED = 0 + + # History off. [Messages and threads are kept for 24 + # hours](https://support.google.com/chat/answer/7664687). + HISTORY_OFF = 1 + + # History on. The organization's [Vault retention + # rules](https://support.google.com/vault/answer/7657597) specify for + # how long messages and threads are kept. + HISTORY_ON = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/matched_url.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/matched_url.rb new file mode 100644 index 000000000000..fdbb4da746c4 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/matched_url.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # 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). + # @!attribute [r] url + # @return [::String] + # Output only. The URL that was matched. + class MatchedUrl + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb new file mode 100644 index 000000000000..d10e45931b4d --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb @@ -0,0 +1,366 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # Represents a membership relation in Google Chat, such as whether a user or + # Chat app is invited to, part of, or absent from a space. + # @!attribute [rw] name + # @return [::String] + # Resource name of the membership, assigned by the server. + # + # Format: `spaces/{space}/members/{member}` + # @!attribute [r] state + # @return [::Google::Apps::Chat::V1::Membership::MembershipState] + # Output only. State of the membership. + # @!attribute [rw] role + # @return [::Google::Apps::Chat::V1::Membership::MembershipRole] + # Optional. User's role within a Chat space, which determines their permitted + # actions in the space. + # + # This field can only be used as input in `UpdateMembership`. + # @!attribute [rw] member + # @return [::Google::Apps::Chat::V1::User] + # The Google Chat user or app the membership corresponds to. + # If your Chat app [authenticates as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the output populates the + # [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + # `name` and `type`. + # @!attribute [rw] group_member + # @return [::Google::Apps::Chat::V1::Group] + # The Google Group the membership corresponds to. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # 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. + # @!attribute [rw] delete_time + # @return [::Google::Protobuf::Timestamp] + # 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. + class Membership + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies the member's relationship with a space. Other membership states + # might be supported in the future. + module MembershipState + # Default value. Don't use. + MEMBERSHIP_STATE_UNSPECIFIED = 0 + + # The user is added to the space, and can participate in the space. + JOINED = 1 + + # The user is invited to join the space, but hasn't joined it. + INVITED = 2 + + # The user doesn't belong to the space and doesn't have a pending + # invitation to join the space. + NOT_A_MEMBER = 3 + end + + # Represents a user's permitted actions in a Chat space. More enum values + # might be added in the future. + module MembershipRole + # Default value. For {::Google::Apps::Chat::V1::Membership#member users}: they + # aren't a member of the space, but can be invited. For + # {::Google::Apps::Chat::V1::Membership#group_member Google Groups}: they're always + # assigned this role (other enum values might be used in the future). + MEMBERSHIP_ROLE_UNSPECIFIED = 0 + + # A member of the space. The user has basic permissions, like sending + # messages to the space. In 1:1 and unnamed group conversations, everyone + # has this role. + ROLE_MEMBER = 1 + + # A space manager. The user has all basic permissions plus administrative + # permissions that let them manage the space, like adding or removing + # members. Only supported in + # {::Google::Apps::Chat::V1::Space::SpaceType SpaceType.SPACE}. + ROLE_MANAGER = 2 + end + end + + # Request message for creating a membership. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the space for which to create the + # membership. + # + # Format: spaces/\\{space} + # @!attribute [rw] membership + # @return [::Google::Apps::Chat::V1::Membership] + # Required. The membership relation to create. + # The `memberType` field must contain a user with the `user.name` and + # `user.type` fields populated. The server will assign a resource name + # and overwrite anything specified. + # When a Chat app creates a membership relation for a human user, it must use + # the `chat.memberships` scope, set `user.type` to `HUMAN`, and set + # `user.name` with format `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` of the + # [person](https://developers.google.com/people/api/rest/v1/people) 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`. When a Chat app creates a + # membership relation for itself, it must use the `chat.memberships.app` + # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Creating app memberships or creating memberships for users outside the + # administrator's Google Workspace organization isn't supported using admin + # access. + class CreateMembershipRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a membership. + # @!attribute [rw] membership + # @return [::Google::Apps::Chat::V1::Membership] + # Required. The membership to update. Only fields specified by `update_mask` + # are updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The field paths to update. Separate multiple values with commas + # or use `*` to update all field paths. + # + # Currently supported field paths: + # + # - `role` + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + class UpdateMembershipRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing memberships. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the space for which to fetch a membership + # list. + # + # Format: spaces/\\{space} + # @!attribute [rw] page_size + # @return [::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. + # @!attribute [rw] page_token + # @return [::String] + # 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. + # @!attribute [rw] filter + # @return [::String] + # Optional. A query filter. + # + # You can filter memberships by a member's role + # ([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole)) + # and type + # ([`member.type`](https://developers.google.com/workspace/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`. You can also + # filter for `member.type` using the `!=` operator. + # + # To filter by both role and type, use the `AND` operator. To filter by + # either role or type, use the `OR` operator. + # + # Either `member.type = "HUMAN"` or `member.type != "BOT"` is required + # when `use_admin_access` is set to true. Other member type filters will be + # rejected. + # + # For example, the following queries are valid: + # + # ``` + # role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" + # member.type = "HUMAN" AND role = "ROLE_MANAGER" + # + # member.type != "BOT" + # ``` + # + # 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. + # @!attribute [rw] show_groups + # @return [::Boolean] + # Optional. When `true`, also returns memberships associated with a + # {::Google::Apps::Chat::V1::Membership#group_member Google Group}, in + # addition to other types of memberships. If a + # {::Google::Apps::Chat::V1::ListMembershipsRequest#filter filter} is set, + # {::Google::Apps::Chat::V1::Membership#group_member Google Group} + # memberships that don't match the filter criteria aren't returned. + # @!attribute [rw] show_invited + # @return [::Boolean] + # Optional. When `true`, also returns memberships associated with + # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} members, in + # addition to other types of memberships. If a + # filter is set, + # {::Google::Apps::Chat::V1::Membership::MembershipState::INVITED invited} memberships + # that don't match the filter criteria aren't returned. + # + # Currently requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.memberships.readonly` or + # `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Listing app memberships in a space isn't supported when using admin access. + class ListMembershipsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to list memberships of the space. + # @!attribute [rw] memberships + # @return [::Array<::Google::Apps::Chat::V1::Membership>] + # Unordered list. List of memberships in the requested (or first) page. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that you can send as `pageToken` to retrieve the next page of + # results. If empty, there are no subsequent pages. + class ListMembershipsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to get a membership of a space. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the membership to retrieve. + # + # To get the app's own membership [by using user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # 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/workspace/chat/authenticate-authorize-chat-user), + # 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. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + # [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Getting app memberships in a space isn't supported when using admin access. + class GetMembershipRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a membership in a space. + # @!attribute [rw] name + # @return [::String] + # 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`. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Deleting app memberships in a space isn't supported using admin access. + class DeleteMembershipRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/message.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/message.rb new file mode 100644 index 000000000000..04cb42f917ab --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/message.rb @@ -0,0 +1,658 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A message in a Google Chat space. + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # @!attribute [r] sender + # @return [::Google::Apps::Chat::V1::User] + # Output only. The user who created the message. + # If your Chat app [authenticates as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the output populates the + # [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) + # `name` and `type`. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # 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. + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # 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. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the message was deleted in + # Google Chat. If the message is never deleted, this field is empty. + # @!attribute [rw] text + # @return [::String] + # Plain-text body of the message. The first link to an image, video, or web + # page generates a + # [preview chip](https://developers.google.com/workspace/chat/preview-links). + # You can also [@mention a Google Chat + # user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), + # or everyone in the space. + # + # To learn about creating text messages, see [Send a + # message](https://developers.google.com/workspace/chat/create-messages). + # @!attribute [r] formatted_text + # @return [::String] + # 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/workspace/chat/format-messages) + # for bold, italic, strikethrough, monospace, monospace block, and bulleted + # list. + # + # * [User + # mentions](https://developers.google.com/workspace/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/workspace/chat/format-messages#view_text_formatting_sent_in_a_message) + # @!attribute [rw] cards + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Apps::Chat::V1::ContextualAddOnMarkup::Card>] + # 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. + # @!attribute [rw] cards_v2 + # @return [::Array<::Google::Apps::Chat::V1::CardWithId>] + # An array of + # [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). + # + # Only Chat apps can create cards. If your Chat app [authenticates as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the messages can't contain cards. + # + # To learn how to create a message that contains cards, see [Send a + # message](https://developers.google.com/workspace/chat/create-messages). + # + # [Card builder](https://addons.gsuite.google.com/uikit/builder) + # @!attribute [r] annotations + # @return [::Array<::Google::Apps::Chat::V1::Annotation>] + # Output only. Annotations associated with the `text` in this message. + # @!attribute [rw] thread + # @return [::Google::Apps::Chat::V1::Thread] + # The thread the message belongs to. For example usage, see + # [Start or reply to a message + # thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + # @!attribute [rw] space + # @return [::Google::Apps::Chat::V1::Space] + # If your Chat app [authenticates as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the output populates the + # [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + # `name`. + # @!attribute [rw] fallback_text + # @return [::String] + # A plain-text description of the message's cards, used when the actual cards + # can't be displayed—for example, mobile notifications. + # @!attribute [rw] action_response + # @return [::Google::Apps::Chat::V1::ActionResponse] + # Input only. Parameters that a Chat app can use to configure how its + # response is posted. + # @!attribute [r] argument_text + # @return [::String] + # Output only. Plain-text body of the message with all Chat app mentions + # stripped out. + # @!attribute [r] slash_command + # @return [::Google::Apps::Chat::V1::SlashCommand] + # Output only. Slash command information, if applicable. + # @!attribute [rw] attachment + # @return [::Array<::Google::Apps::Chat::V1::Attachment>] + # User-uploaded attachment. + # @!attribute [r] matched_url + # @return [::Google::Apps::Chat::V1::MatchedUrl] + # Output only. A URL in `spaces.messages.text` that matches a link preview + # pattern. For more information, see [Preview + # links](https://developers.google.com/workspace/chat/preview-links). + # @!attribute [r] thread_reply + # @return [::Boolean] + # 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`. + # @!attribute [rw] client_assigned_message_id + # @return [::String] + # 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/workspace/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/workspace/chat/create-messages#name_a_created_message). + # @!attribute [r] emoji_reaction_summaries + # @return [::Array<::Google::Apps::Chat::V1::EmojiReactionSummary>] + # Output only. The list of emoji reaction summaries on the message. + # @!attribute [rw] private_message_viewer + # @return [::Google::Apps::Chat::V1::User] + # 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. To include this field in + # your request, you must call the Chat API using [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and omit the following: + # + # * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) + # * [Accessory + # widgets](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message.AccessoryWidget) + # + # For details, see [Send a message + # privately](https://developers.google.com/workspace/chat/create-messages#private). + # @!attribute [r] deletion_metadata + # @return [::Google::Apps::Chat::V1::DeletionMetadata] + # Output only. Information about a deleted message. A message is deleted when + # `delete_time` is set. + # @!attribute [r] quoted_message_metadata + # @return [::Google::Apps::Chat::V1::QuotedMessageMetadata] + # 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. + # @!attribute [r] attached_gifs + # @return [::Array<::Google::Apps::Chat::V1::AttachedGif>] + # Output only. GIF images that are attached to the message. + # @!attribute [rw] accessory_widgets + # @return [::Array<::Google::Apps::Chat::V1::AccessoryWidget>] + # One or more interactive widgets that appear at the bottom of a message. + # You can add accessory widgets to messages that contain text, cards, or both + # text and cards. Not supported for messages that contain dialogs. For + # details, see [Add interactive widgets at the bottom of a + # message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). + # + # Creating a message with accessory widgets requires [app + # authentication] + # (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + class Message + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A GIF image that's specified by a URL. + # @!attribute [r] uri + # @return [::String] + # Output only. The URL that hosts the GIF image. + class AttachedGif + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about a quoted message. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the quoted message. + # + # Format: `spaces/{space}/messages/{message}` + # @!attribute [r] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the quoted message was created or when the + # quoted message was last updated. + class QuotedMessageMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A thread in a Google Chat space. For example usage, see + # [Start or reply to a message + # thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + # + # If you specify a thread when creating a message, you can set the + # [`messageReplyOption`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption) + # field to determine what happens if no matching thread is found. + # @!attribute [rw] name + # @return [::String] + # Resource name of the thread. + # + # Example: `spaces/{space}/threads/{thread}` + # @!attribute [rw] thread_key + # @return [::String] + # 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. + class Thread + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters that a Chat app can use to configure how its response is posted. + # @!attribute [rw] type + # @return [::Google::Apps::Chat::V1::ActionResponse::ResponseType] + # Input only. The type of Chat app response. + # @!attribute [rw] url + # @return [::String] + # Input only. URL for users to authenticate or configure. (Only for + # `REQUEST_CONFIG` response types.) + # @!attribute [rw] dialog_action + # @return [::Google::Apps::Chat::V1::DialogAction] + # Input only. A response to an interaction event related to a + # [dialog](https://developers.google.com/workspace/chat/dialogs). Must be + # accompanied by `ResponseType.Dialog`. + # @!attribute [rw] updated_widget + # @return [::Google::Apps::Chat::V1::ActionResponse::UpdatedWidget] + # Input only. The response of the updated widget. + class ActionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # List of widget autocomplete results. + # @!attribute [rw] items + # @return [::Array<::Google::Apps::Card::V1::SelectionInput::SelectionItem>] + # An array of the SelectionItem objects. + class SelectionItems + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response of the updated widget. + # Used to provide autocomplete options for a widget. + # @!attribute [rw] suggestions + # @return [::Google::Apps::Chat::V1::ActionResponse::SelectionItems] + # List of widget autocomplete results + # @!attribute [rw] widget + # @return [::String] + # The ID of the updated widget. The ID must match the one for the + # widget that triggered the update request. + class UpdatedWidget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of Chat app response. + module ResponseType + # Default type that's handled as `NEW_MESSAGE`. + TYPE_UNSPECIFIED = 0 + + # Post as a new message in the topic. + NEW_MESSAGE = 1 + + # Update the Chat app's message. This is only permitted on a `CARD_CLICKED` + # event where the message sender type is `BOT`. + UPDATE_MESSAGE = 2 + + # Update the cards on a user's message. This is only permitted as a + # response to a `MESSAGE` event with a matched url, or a `CARD_CLICKED` + # event where the message sender type is `HUMAN`. Text is ignored. + UPDATE_USER_MESSAGE_CARDS = 6 + + # Privately ask the user for additional authentication or configuration. + REQUEST_CONFIG = 3 + + # Presents a + # [dialog](https://developers.google.com/workspace/chat/dialogs). + DIALOG = 4 + + # Widget text autocomplete options query. + UPDATE_WIDGET = 7 + end + end + + # 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). + # @!attribute [rw] button_list + # @return [::Google::Apps::Card::V1::ButtonList] + # A list of buttons. + class AccessoryWidget + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to get a message. + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + class GetMessageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to delete a message. + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + # @!attribute [rw] force + # @return [::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/workspace/chat/authenticate-authorize-chat-user). + # Has no effect when [authenticating as a Chat app] + # (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + class DeleteMessageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update a message. + # @!attribute [rw] message + # @return [::Google::Apps::Chat::V1::Message] + # Required. Message with fields updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # 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).) + # @!attribute [rw] allow_missing + # @return [::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/workspace/chat/create-messages#name_a_created_message) + # or the request fails. + class UpdateMessageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Creates a message. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the space in which to create a message. + # + # Format: `spaces/{space}` + # @!attribute [rw] message + # @return [::Google::Apps::Chat::V1::Message] + # Required. Message body. + # @!attribute [rw] thread_key + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Optional. Deprecated: Use + # {::Google::Apps::Chat::V1::Thread#thread_key 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 + # {::Google::Apps::Chat::V1::Thread#name thread.name}. For example usage, see [Start or + # reply to a message + # thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). + # @!attribute [rw] request_id + # @return [::String] + # 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. + # @!attribute [rw] message_reply_option + # @return [::Google::Apps::Chat::V1::CreateMessageRequest::MessageReplyOption] + # Optional. Specifies whether a message starts a thread or replies to one. + # Only supported in named spaces. + # @!attribute [rw] message_id + # @return [::String] + # 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/workspace/chat/create-messages#name_a_created_message). + class CreateMessageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Specifies how to reply to a message. + # More states might be added in the future. + module MessageReplyOption + # Default. Starts a new thread. Using this option ignores any [thread + # ID][google.chat.v1.Thread.name] or + # {::Google::Apps::Chat::V1::Thread#thread_key `thread_key`} that's included. + MESSAGE_REPLY_OPTION_UNSPECIFIED = 0 + + # Creates the message as a reply to the thread specified by [thread + # ID][google.chat.v1.Thread.name] or + # {::Google::Apps::Chat::V1::Thread#thread_key `thread_key`}. If it fails, the + # message starts a new thread instead. + REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1 + + # Creates the message as a reply to the thread specified by [thread + # ID][google.chat.v1.Thread.name] or + # {::Google::Apps::Chat::V1::Thread#thread_key `thread_key`}. If a new `thread_key` + # is used, a new thread is created. If the message creation fails, a + # `NOT_FOUND` error is returned instead. + REPLY_MESSAGE_OR_FAIL = 2 + end + end + + # Lists messages in the specified space, that the user is a member of. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the space to list messages from. + # + # Format: `spaces/{space}` + # @!attribute [rw] page_size + # @return [::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. + # @!attribute [rw] page_token + # @return [::String] + # 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. + # @!attribute [rw] filter + # @return [::String] + # 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. + # @!attribute [rw] order_by + # @return [::String] + # 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`. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether to include deleted messages. Deleted messages include deleted time + # and metadata about their deletion, but message content is unavailable. + class ListMessagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing messages. + # @!attribute [rw] messages + # @return [::Array<::Google::Apps::Chat::V1::Message>] + # List of messages. + # @!attribute [rw] next_page_token + # @return [::String] + # You can send a token as `pageToken` to retrieve the next page of + # results. If empty, there are no subsequent pages. + class ListMessagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains a + # [dialog](https://developers.google.com/workspace/chat/dialogs) and request + # status code. + # @!attribute [rw] dialog + # @return [::Google::Apps::Chat::V1::Dialog] + # Input only. + # [Dialog](https://developers.google.com/workspace/chat/dialogs) for the + # request. + # @!attribute [rw] action_status + # @return [::Google::Apps::Chat::V1::ActionStatus] + # Input only. Status for a request to either invoke or submit a + # [dialog](https://developers.google.com/workspace/chat/dialogs). Displays + # a status and message to users, if necessary. + # For example, in case of an error or success. + class DialogAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper around the card body of the dialog. + # @!attribute [rw] body + # @return [::Google::Apps::Card::V1::Card] + # Input only. Body of the dialog, which is rendered in a modal. + # Google Chat apps don't support the following card entities: + # `DateTimePicker`, `OnChangeAction`. + class Dialog + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A + # [card](https://developers.google.com/workspace/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/workspace/chat/authenticate-authorize-chat-user), + # the message can't contain cards. + # + # [Card builder](https://addons.gsuite.google.com/uikit/builder) + # @!attribute [rw] card_id + # @return [::String] + # Required if the message contains multiple cards. A unique identifier for + # a card in a message. + # @!attribute [rw] card + # @return [::Google::Apps::Card::V1::Card] + # A card. Maximum size is 32 KB. + class CardWithId + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/reaction.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/reaction.rb new file mode 100644 index 000000000000..f0eb3d8f2a02 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/reaction.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A reaction to a message. + # @!attribute [rw] name + # @return [::String] + # The resource name of the reaction. + # + # Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + # @!attribute [r] user + # @return [::Google::Apps::Chat::V1::User] + # Output only. The user who created the reaction. + # @!attribute [rw] emoji + # @return [::Google::Apps::Chat::V1::Emoji] + # The emoji used in the reaction. + class Reaction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An emoji that is used as a reaction to a message. + # @!attribute [rw] unicode + # @return [::String] + # A basic emoji represented by a unicode string. + # @!attribute [r] custom_emoji + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # Output only. A custom emoji. + class Emoji + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a custom emoji. + # @!attribute [r] uid + # @return [::String] + # Output only. Unique key for the custom emoji resource. + class CustomEmoji + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The number of people who reacted to a message with a specific emoji. + # @!attribute [rw] emoji + # @return [::Google::Apps::Chat::V1::Emoji] + # Emoji associated with the reactions. + # @!attribute [rw] reaction_count + # @return [::Integer] + # The total number of reactions using the associated emoji. + class EmojiReactionSummary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Creates a reaction to a message. + # @!attribute [rw] parent + # @return [::String] + # Required. The message where the reaction is created. + # + # Format: `spaces/{space}/messages/{message}` + # @!attribute [rw] reaction + # @return [::Google::Apps::Chat::V1::Reaction] + # Required. The reaction to create. + class CreateReactionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Lists reactions to a message. + # @!attribute [rw] parent + # @return [::String] + # Required. The message users reacted to. + # + # Format: `spaces/{space}/messages/{message}` + # @!attribute [rw] page_size + # @return [::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. + # @!attribute [rw] page_token + # @return [::String] + # 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. + # @!attribute [rw] filter + # @return [::String] + # Optional. A query filter. + # + # You can filter reactions by + # [emoji](https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji) + # (either `emoji.unicode` or `emoji.custom_emoji.uid`) and + # [user](https://developers.google.com/workspace/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. + class ListReactionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to a list reactions request. + # @!attribute [rw] reactions + # @return [::Array<::Google::Apps::Chat::V1::Reaction>] + # List of reactions in the requested (or first) page. + # @!attribute [rw] next_page_token + # @return [::String] + # Continuation token to retrieve the next page of results. It's empty + # for the last page of results. + class ListReactionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Deletes a reaction to a message. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the reaction to delete. + # + # Format: `spaces/{space}/messages/{message}/reactions/{reaction}` + class DeleteReactionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/slash_command.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/slash_command.rb new file mode 100644 index 000000000000..04b706668823 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/slash_command.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A [slash + # command](https://developers.google.com/workspace/chat/slash-commands) in + # Google Chat. + # @!attribute [rw] command_id + # @return [::Integer] + # The ID of the slash command invoked. + class SlashCommand + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb new file mode 100644 index 000000000000..1aac451ac380 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb @@ -0,0 +1,746 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A space in Google Chat. Spaces are conversations between two or more users + # or 1:1 messages between a user and a Chat app. + # @!attribute [rw] name + # @return [::String] + # Resource name of the space. + # + # Format: `spaces/{space}` + # + # Where `{space}` represents the system-assigned ID for the space. You can + # obtain the space ID by calling the + # [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) + # method or from the space URL. For example, if the space URL + # is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID + # is `AAAAAAAAA`. + # @!attribute [r] type + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Apps::Chat::V1::Space::Type] + # Output only. Deprecated: Use `space_type` instead. + # The type of a space. + # @!attribute [rw] space_type + # @return [::Google::Apps::Chat::V1::Space::SpaceType] + # The type of space. Required when creating a space or updating the space + # type of a space. Output only for other usage. + # @!attribute [rw] single_user_bot_dm + # @return [::Boolean] + # Optional. Whether the space is a DM between a Chat app and a single + # human. + # @!attribute [r] threaded + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Output only. Deprecated: Use `spaceThreadingState` instead. + # Whether messages are threaded in this space. + # @!attribute [rw] display_name + # @return [::String] + # The space's display name. Required when [creating a + # space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) + # with a `spaceType` of `SPACE`. 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. + # @!attribute [rw] external_user_allowed + # @return [::Boolean] + # 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 consumer account (unmanaged user + # account). By default, a space created by a consumer account permits any + # Google Chat user. + # + # For existing spaces, this field is output only. + # @!attribute [r] space_threading_state + # @return [::Google::Apps::Chat::V1::Space::SpaceThreadingState] + # Output only. The threading state in the Chat space. + # @!attribute [rw] space_details + # @return [::Google::Apps::Chat::V1::Space::SpaceDetails] + # Details about the space including description and rules. + # @!attribute [rw] space_history_state + # @return [::Google::Apps::Chat::V1::HistoryState] + # The message history state for messages and threads in this space. + # @!attribute [rw] import_mode + # @return [::Boolean] + # 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. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # 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`. + # @!attribute [r] last_active_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp of the last message in the space. + # @!attribute [r] admin_installed + # @return [::Boolean] + # Output only. For direct message (DM) spaces with a Chat app, whether the + # space was created by a Google Workspace administrator. Administrators can + # install and set up a direct message with a Chat app on behalf of users in + # their organization. + # + # To support admin install, your Chat app must feature direct messaging. + # @!attribute [r] membership_count + # @return [::Google::Apps::Chat::V1::Space::MembershipCount] + # Output only. The count of joined memberships grouped by member type. + # Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or + # `GROUP_CHAT`. + # @!attribute [rw] access_settings + # @return [::Google::Apps::Chat::V1::Space::AccessSettings] + # Optional. Specifies the [access + # setting](https://support.google.com/chat/answer/11971020) of the space. + # Only populated when the `space_type` is `SPACE`. + # @!attribute [r] space_uri + # @return [::String] + # Output only. The URI for a user to access the space. + # @!attribute [rw] predefined_permission_settings + # @return [::Google::Apps::Chat::V1::Space::PredefinedPermissionSettings] + # Optional. Input only. Predefined space permission settings, input only + # when creating a space. If the field is not set, a collaboration space is + # created. After you create the space, settings are populated in the + # `PermissionSettings` field. + # @!attribute [rw] permission_settings + # @return [::Google::Apps::Chat::V1::Space::PermissionSettings] + # Optional. Space permission settings for existing spaces. Input for + # updating exact space permission settings, where existing permission + # settings are replaced. Output lists current permission settings. + class Space + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Details about the space including description and rules. + # @!attribute [rw] description + # @return [::String] + # Optional. A description of the space. For example, describe the space's + # discussion topic, functional purpose, or participants. + # + # Supports up to 150 characters. + # @!attribute [rw] guidelines + # @return [::String] + # Optional. The space's rules, expectations, and etiquette. + # + # Supports up to 5,000 characters. + class SpaceDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the count of memberships of a space, grouped into categories. + # @!attribute [rw] joined_direct_human_user_count + # @return [::Integer] + # Count of human users that have directly joined the space, not counting + # users joined by having membership in a joined group. + # @!attribute [rw] joined_group_count + # @return [::Integer] + # Count of all groups that have directly joined the space. + class MembershipCount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the [access + # setting](https://support.google.com/chat/answer/11971020) of the space. + # @!attribute [r] access_state + # @return [::Google::Apps::Chat::V1::Space::AccessSettings::AccessState] + # Output only. Indicates the access state of the space. + # @!attribute [rw] audience + # @return [::String] + # Optional. The resource name of the [target + # audience](https://support.google.com/a/answer/9934697) who can discover + # the space, join the space, and preview the messages in the space. If + # unset, only users or Google Groups who have been individually invited or + # added to the space can access it. For details, see [Make a space + # discoverable to a target + # audience](https://developers.google.com/workspace/chat/space-target-audience). + # + # Format: `audiences/{audience}` + # + # To use the default target audience for the Google Workspace organization, + # set to `audiences/default`. + # + # This field is not populated when using the `chat.bot` scope with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + class AccessSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the access state of the space. + module AccessState + # Access state is unknown or not supported in this API. + ACCESS_STATE_UNSPECIFIED = 0 + + # Only users or Google Groups that have been individually added or + # invited by other users or Google Workspace administrators can discover + # and access the space. + PRIVATE = 1 + + # A space manager has granted a target audience access to + # the space. Users or Google Groups that have been individually added or + # invited to the space can also discover and access the space. To learn + # more, see [Make a space discoverable to specific + # users](https://developers.google.com/workspace/chat/space-target-audience). + DISCOVERABLE = 2 + end + end + + # [Permission settings](https://support.google.com/chat/answer/13340792) + # that you can specify when updating an existing named space. + # + # To set permission settings when creating a space, specify the + # `PredefinedPermissionSettings` field in your request. + # @!attribute [rw] manage_members_and_groups + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Setting for managing members and groups in a space. + # @!attribute [rw] modify_space_details + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Setting for updating space name, avatar, description and guidelines. + # @!attribute [rw] toggle_history + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Setting for toggling space history on and off. + # @!attribute [rw] use_at_mention_all + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Setting for using @all in a space. + # @!attribute [rw] manage_apps + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Setting for managing apps in a space. + # @!attribute [rw] manage_webhooks + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Setting for managing webhooks in a space. + # @!attribute [r] post_messages + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Output only. Setting for posting messages in a space. + # @!attribute [rw] reply_messages + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Setting for replying to messages in a space. + class PermissionSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a space permission setting. + # @!attribute [rw] managers_allowed + # @return [::Boolean] + # Whether spaces managers have this permission. + # @!attribute [rw] members_allowed + # @return [::Boolean] + # Whether non-manager members have this permission. + class PermissionSetting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Deprecated: Use `SpaceType` instead. + module Type + # Reserved. + TYPE_UNSPECIFIED = 0 + + # Conversations between two or more humans. + ROOM = 1 + + # 1:1 Direct Message between a human and a Chat app, where all messages are + # flat. Note that this doesn't include direct messages between two humans. + DM = 2 + end + + # The type of space. Required when creating or updating a space. Output only + # for other usage. + module SpaceType + # Reserved. + SPACE_TYPE_UNSPECIFIED = 0 + + # A place where people send messages, share files, and collaborate. + # A `SPACE` can include Chat apps. + SPACE = 1 + + # Group conversations between 3 or more people. + # A `GROUP_CHAT` can include Chat apps. + GROUP_CHAT = 2 + + # 1:1 messages between two humans or a human and a Chat app. + DIRECT_MESSAGE = 3 + end + + # Specifies the type of threading state in the Chat space. + module SpaceThreadingState + # Reserved. + SPACE_THREADING_STATE_UNSPECIFIED = 0 + + # Named spaces that support message threads. When users respond to a + # message, they can reply in-thread, which keeps their response in the + # context of the original message. + THREADED_MESSAGES = 2 + + # Named spaces where the conversation is organized by topic. Topics and + # their replies are grouped together. + GROUPED_MESSAGES = 3 + + # Direct messages (DMs) between two people and group conversations between + # 3 or more people. + UNTHREADED_MESSAGES = 4 + end + + # Predefined permission settings that you can only specify when creating a + # named space. More settings might be added in the future. + # For details about permission settings for named spaces, see [Learn about + # spaces](https://support.google.com/chat/answer/7659784). + module PredefinedPermissionSettings + # Unspecified. Don't use. + PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED = 0 + + # Setting to make the space a collaboration space where all members can + # post messages. + COLLABORATION_SPACE = 1 + + # Setting to make the space an announcement space where only space managers + # can post messages. + ANNOUNCEMENT_SPACE = 2 + end + end + + # A request to create a named space with no members. + # @!attribute [rw] space + # @return [::Google::Apps::Chat::V1::Space] + # Required. The `displayName` and `spaceType` fields must be populated. Only + # `SpaceType.SPACE` is supported. + # + # If you receive the error message `ALREADY_EXISTS`, + # try a different `displayName`. An existing space within the Google + # Workspace organization might already use this display name. + # + # If you're a member of the [Developer Preview + # program](https://developers.google.com/workspace/preview), + # `SpaceType.GROUP_CHAT` can be used if `importMode` is set to true. + # + # The space `name` is assigned on the server so anything specified in this + # field will be ignored. + # @!attribute [rw] request_id + # @return [::String] + # 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. + class CreateSpaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to list the spaces the caller is a member of. + # @!attribute [rw] page_size + # @return [::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. + # @!attribute [rw] page_token + # @return [::String] + # 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. + # @!attribute [rw] filter + # @return [::String] + # Optional. A query filter. + # + # You can filter spaces by the space type + # ([`space_type`](https://developers.google.com/workspace/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. + class ListSpacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for a list spaces request. + # @!attribute [rw] spaces + # @return [::Array<::Google::Apps::Chat::V1::Space>] + # List of spaces in the requested (or first) page. + # Note: The `permissionSettings` field is not returned in the Space + # object for list requests. + # @!attribute [rw] next_page_token + # @return [::String] + # You can send a token as `pageToken` to retrieve the next page of + # results. If empty, there are no subsequent pages. + class ListSpacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to return a single space. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the space, in the form `spaces/{space}`. + # + # Format: `spaces/{space}` + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + class GetSpaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to get direct message space based on the user resource. + # @!attribute [rw] name + # @return [::String] + # 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/workspace/chat/authenticate-authorize-chat-user), + # 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. + class FindDirectMessageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to update a single space. + # @!attribute [rw] space + # @return [::Google::Apps::Chat::V1::Space] + # Required. Space with fields to be updated. `Space.name` must be + # populated in the form of `spaces/{space}`. Only fields + # specified by `update_mask` are updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The updated field paths, comma separated if there are + # multiple. + # + # You can update the following fields for a space: + # + # `space_details`: Updates the space's description. Supports up to 150 + # characters. + # + # `display_name`: Only supports updating the display name for spaces where + # `spaceType` field is `SPACE`. + # If you receive the error message `ALREADY_EXISTS`, try a different + # value. 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_type` is not supported with `useAdminAccess`. + # + # `space_history_state`: Updates [space history + # settings](https://support.google.com/chat/answer/7664687) by turning + # history on or off for the space. Only supported if history settings are + # enabled for the Google Workspace organization. To update the + # space history state, you must omit all other field masks in your request. + # `space_history_state` is not supported with `useAdminAccess`. + # + # `access_settings.audience`: Updates the [access + # setting](https://support.google.com/chat/answer/11971020) of who can + # discover the space, join the space, and preview the messages in named space + # where `spaceType` field is `SPACE`. If the existing space has a + # target audience, you can remove the audience and restrict space access by + # omitting a value for this field mask. To update access settings for a + # space, the authenticating user must be a space manager and omit all other + # field masks in your request. You can't update this field if the space is in + # [import + # mode](https://developers.google.com/workspace/chat/import-data-overview). + # To learn more, see [Make a space discoverable to specific + # users](https://developers.google.com/workspace/chat/space-target-audience). + # `access_settings.audience` is not supported with `useAdminAccess`. + # + # `permission_settings`: Supports changing the + # [permission settings](https://support.google.com/chat/answer/13340792) + # of a space. + # When updating permission settings, you can only specify + # `permissionSettings` field masks; you cannot update other field masks + # at the same time. `permissionSettings` is not supported with + # `useAdminAccess`. + # The supported field masks include: + # + # - `permission_settings.manageMembersAndGroups` + # - `permission_settings.modifySpaceDetails` + # - `permission_settings.toggleHistory` + # - `permission_settings.useAtMentionAll` + # - `permission_settings.manageApps` + # - `permission_settings.manageWebhooks` + # - `permission_settings.replyMessages` + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Some `FieldMask` values are not supported using admin access. For details, + # see the description of `update_mask`. + class UpdateSpaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to search for a list of spaces based on a query. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + # [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # This method currently only supports admin access, thus only `true` is + # accepted for this field. + # @!attribute [rw] page_size + # @return [::Integer] + # 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. If you use a value more than 1000, it's + # automatically changed to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A token, received from the previous search spaces 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. + # @!attribute [rw] query + # @return [::String] + # Required. A search query. + # + # You can search by using the following parameters: + # + # - `create_time` + # - `customer` + # - `display_name` + # - `external_user_allowed` + # - `last_active_time` + # - `space_history_state` + # - `space_type` + # + # `create_time` and `last_active_time` accept a timestamp in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + # comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + # + # `customer` is required and is used to indicate which customer + # to fetch spaces from. `customers/my_customer` is the only supported value. + # + # `display_name` only accepts the `HAS` (`:`) operator. The text to + # match is first tokenized into tokens and each token is prefix-matched + # case-insensitively and independently as a substring anywhere in the space's + # `display_name`. For example, `Fun Eve` matches `Fun event` or `The + # evening was fun`, but not `notFun event` or `even`. + # + # `external_user_allowed` accepts either `true` or `false`. + # + # `space_history_state` only accepts values from the [`historyState`] + # (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + # field of a `space` resource. + # + # `space_type` is required and the only valid value is `SPACE`. + # + # Across different fields, only `AND` operators are supported. A valid + # example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + # example is `space_type = "SPACE" OR display_name:"Hello"`. + # + # Among the same field, + # `space_type` doesn't support `AND` or `OR` operators. + # `display_name`, 'space_history_state', and 'external_user_allowed' only + # support `OR` operators. + # `last_active_time` and `create_time` support both `AND` and `OR` operators. + # `AND` can only be used to represent an interval, such as `last_active_time + # < "2022-01-01T00:00:00+00:00" AND last_active_time > + # "2023-01-01T00:00:00+00:00"`. + # + # The following example queries are valid: + # + # ``` + # customer = "customers/my_customer" AND space_type = "SPACE" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # display_name:"Hello World" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (display_name:"Hello World" OR display_name:"Fun event") AND + # (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + # "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + # (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Optional. How the list of spaces is ordered. + # + # Supported attributes to order by are: + # + # - `membership_count.joined_direct_human_user_count` — Denotes the count of + # human users that have directly joined a space. + # - `last_active_time` — Denotes the time when last eligible item is added to + # any topic of this space. + # - `create_time` — Denotes the time of the space creation. + # + # Valid ordering operation values are: + # + # - `ASC` for ascending. Default value. + # + # - `DESC` for descending. + # + # The supported syntax are: + # + # - `membership_count.joined_direct_human_user_count DESC` + # - `membership_count.joined_direct_human_user_count ASC` + # - `last_active_time DESC` + # - `last_active_time ASC` + # - `create_time DESC` + # - `create_time ASC` + class SearchSpacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response with a list of spaces corresponding to the search spaces request. + # @!attribute [rw] spaces + # @return [::Array<::Google::Apps::Chat::V1::Space>] + # A page of the requested spaces. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be used to retrieve the next page. If this field is empty, + # there are no subsequent pages. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of spaces that match the query, across all pages. If the + # result is over 10,000 spaces, this value is an estimate. + class SearchSpacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for deleting a space. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the space to delete. + # + # Format: `spaces/{space}` + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.delete` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + class DeleteSpaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for completing the import process for a space. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the import mode space. + # + # Format: `spaces/{space}` + class CompleteImportSpaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for completing the import process for a space. + # @!attribute [rw] space + # @return [::Google::Apps::Chat::V1::Space] + # The import mode space. + class CompleteImportSpaceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_event.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_event.rb new file mode 100644 index 000000000000..14acc3350d7c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_event.rb @@ -0,0 +1,287 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # An event that represents a change or activity in a Google Chat space. To + # learn more, see [Work with events from Google + # Chat](https://developers.google.com/workspace/chat/events-overview). + # @!attribute [rw] name + # @return [::String] + # Resource name of the space event. + # + # Format: `spaces/{space}/spaceEvents/{spaceEvent}` + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # Time when the event occurred. + # @!attribute [rw] event_type + # @return [::String] + # Type of space event. Each event type has a batch version, which + # represents multiple instances of the event type that occur in a short + # period of time. For `spaceEvents.list()` requests, omit batch event types + # in your query filter. By default, the server returns both event type and + # its batch version. + # + # Supported event types for + # [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages): + # + # * New message: `google.workspace.chat.message.v1.created` + # * Updated message: `google.workspace.chat.message.v1.updated` + # * Deleted message: `google.workspace.chat.message.v1.deleted` + # * Multiple new messages: `google.workspace.chat.message.v1.batchCreated` + # * Multiple updated messages: + # `google.workspace.chat.message.v1.batchUpdated` + # * Multiple deleted messages: + # `google.workspace.chat.message.v1.batchDeleted` + # + # Supported event types for + # [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members): + # + # * New membership: `google.workspace.chat.membership.v1.created` + # * Updated membership: `google.workspace.chat.membership.v1.updated` + # * Deleted membership: `google.workspace.chat.membership.v1.deleted` + # * Multiple new memberships: + # `google.workspace.chat.membership.v1.batchCreated` + # * Multiple updated memberships: + # `google.workspace.chat.membership.v1.batchUpdated` + # * Multiple deleted memberships: + # `google.workspace.chat.membership.v1.batchDeleted` + # + # Supported event types for + # [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions): + # + # * New reaction: `google.workspace.chat.reaction.v1.created` + # * Deleted reaction: `google.workspace.chat.reaction.v1.deleted` + # * Multiple new reactions: + # `google.workspace.chat.reaction.v1.batchCreated` + # * Multiple deleted reactions: + # `google.workspace.chat.reaction.v1.batchDeleted` + # + # Supported event types about the + # [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces): + # + # * Updated space: `google.workspace.chat.space.v1.updated` + # * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated` + # @!attribute [rw] message_created_event_data + # @return [::Google::Apps::Chat::V1::MessageCreatedEventData] + # Event payload for a new message. + # + # Event type: `google.workspace.chat.message.v1.created` + # @!attribute [rw] message_updated_event_data + # @return [::Google::Apps::Chat::V1::MessageUpdatedEventData] + # Event payload for an updated message. + # + # Event type: `google.workspace.chat.message.v1.updated` + # @!attribute [rw] message_deleted_event_data + # @return [::Google::Apps::Chat::V1::MessageDeletedEventData] + # Event payload for a deleted message. + # + # Event type: `google.workspace.chat.message.v1.deleted` + # @!attribute [rw] message_batch_created_event_data + # @return [::Google::Apps::Chat::V1::MessageBatchCreatedEventData] + # Event payload for multiple new messages. + # + # Event type: `google.workspace.chat.message.v1.batchCreated` + # @!attribute [rw] message_batch_updated_event_data + # @return [::Google::Apps::Chat::V1::MessageBatchUpdatedEventData] + # Event payload for multiple updated messages. + # + # Event type: `google.workspace.chat.message.v1.batchUpdated` + # @!attribute [rw] message_batch_deleted_event_data + # @return [::Google::Apps::Chat::V1::MessageBatchDeletedEventData] + # Event payload for multiple deleted messages. + # + # Event type: `google.workspace.chat.message.v1.batchDeleted` + # @!attribute [rw] space_updated_event_data + # @return [::Google::Apps::Chat::V1::SpaceUpdatedEventData] + # Event payload for a space update. + # + # Event type: `google.workspace.chat.space.v1.updated` + # @!attribute [rw] space_batch_updated_event_data + # @return [::Google::Apps::Chat::V1::SpaceBatchUpdatedEventData] + # Event payload for multiple updates to a space. + # + # Event type: `google.workspace.chat.space.v1.batchUpdated` + # @!attribute [rw] membership_created_event_data + # @return [::Google::Apps::Chat::V1::MembershipCreatedEventData] + # Event payload for a new membership. + # + # Event type: `google.workspace.chat.membership.v1.created` + # @!attribute [rw] membership_updated_event_data + # @return [::Google::Apps::Chat::V1::MembershipUpdatedEventData] + # Event payload for an updated membership. + # + # Event type: `google.workspace.chat.membership.v1.updated` + # @!attribute [rw] membership_deleted_event_data + # @return [::Google::Apps::Chat::V1::MembershipDeletedEventData] + # Event payload for a deleted membership. + # + # Event type: `google.workspace.chat.membership.v1.deleted` + # @!attribute [rw] membership_batch_created_event_data + # @return [::Google::Apps::Chat::V1::MembershipBatchCreatedEventData] + # Event payload for multiple new memberships. + # + # Event type: `google.workspace.chat.membership.v1.batchCreated` + # @!attribute [rw] membership_batch_updated_event_data + # @return [::Google::Apps::Chat::V1::MembershipBatchUpdatedEventData] + # Event payload for multiple updated memberships. + # + # Event type: `google.workspace.chat.membership.v1.batchUpdated` + # @!attribute [rw] membership_batch_deleted_event_data + # @return [::Google::Apps::Chat::V1::MembershipBatchDeletedEventData] + # Event payload for multiple deleted memberships. + # + # Event type: `google.workspace.chat.membership.v1.batchDeleted` + # @!attribute [rw] reaction_created_event_data + # @return [::Google::Apps::Chat::V1::ReactionCreatedEventData] + # Event payload for a new reaction. + # + # Event type: `google.workspace.chat.reaction.v1.created` + # @!attribute [rw] reaction_deleted_event_data + # @return [::Google::Apps::Chat::V1::ReactionDeletedEventData] + # Event payload for a deleted reaction. + # + # Event type: `google.workspace.chat.reaction.v1.deleted` + # @!attribute [rw] reaction_batch_created_event_data + # @return [::Google::Apps::Chat::V1::ReactionBatchCreatedEventData] + # Event payload for multiple new reactions. + # + # Event type: `google.workspace.chat.reaction.v1.batchCreated` + # @!attribute [rw] reaction_batch_deleted_event_data + # @return [::Google::Apps::Chat::V1::ReactionBatchDeletedEventData] + # Event payload for multiple deleted reactions. + # + # Event type: `google.workspace.chat.reaction.v1.batchDeleted` + class SpaceEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting a space event. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the space event. + # + # Format: `spaces/{space}/spaceEvents/{spaceEvent}` + class GetSpaceEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing space events. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the [Google Chat + # space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + # where the events occurred. + # + # Format: `spaces/{space}`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of space events returned. The service might + # return fewer than this value. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @!attribute [rw] page_token + # @return [::String] + # 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. + # @!attribute [rw] filter + # @return [::String] + # Required. A query filter. + # + # You must specify at least one event type (`event_type`) + # using the has `:` operator. To filter by multiple event types, use the `OR` + # operator. Omit batch event types in your filter. The request automatically + # returns any related batch events. For example, if you filter by new + # reactions + # (`google.workspace.chat.reaction.v1.created`), the server also returns + # batch new reactions events + # (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported + # event types, see the [`SpaceEvents` reference + # documentation](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type). + # + # Optionally, you can also filter by start time (`start_time`) and + # end time (`end_time`): + # + # * `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 past 28 days. + # * `end_time`: Inclusive timestamp until which space events are listed. + # If unspecified, lists events up to the time of the request. + # + # To specify a start or end time, use the equals `=` operator and format in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339). 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. + class ListSpaceEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing space events. + # @!attribute [rw] space_events + # @return [::Array<::Google::Apps::Chat::V1::SpaceEvent>] + # Results are returned in chronological order (oldest event first). + # Note: The `permissionSettings` field is not returned in the Space + # object for list requests. + # @!attribute [rw] next_page_token + # @return [::String] + # Continuation token used to fetch more events. + # If this field is omitted, there are no subsequent pages. + class ListSpaceEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_read_state.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_read_state.rb new file mode 100644 index 000000000000..03f90e3f860f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_read_state.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A user's read state within a space, used to identify read and unread + # messages. + # @!attribute [rw] name + # @return [::String] + # Resource name of the space read state. + # + # Format: `users/{user}/spaces/{space}/spaceReadState` + # @!attribute [rw] last_read_time + # @return [::Google::Protobuf::Timestamp] + # Optional. The time when the user's space read state was updated. Usually + # this corresponds with either the timestamp of the last read message, or a + # timestamp specified by the user to mark the last read position in a space. + class SpaceReadState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetSpaceReadState API. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the space read state to retrieve. + # + # Only supports getting read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/spaceReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/spaceReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/spaceReadState + class GetSpaceReadStateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateSpaceReadState API. + # @!attribute [rw] space_read_state + # @return [::Google::Apps::Chat::V1::SpaceReadState] + # Required. The space read state and fields to update. + # + # Only supports updating read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/spaceReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/spaceReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/spaceReadState + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The field paths to update. Currently supported field paths: + # + # - `last_read_time` + # + # When the `last_read_time` is before the latest message create time, the + # space appears as unread in the UI. + # + # To mark the space as read, set `last_read_time` to any value later (larger) + # than the latest message create time. The `last_read_time` is coerced to + # match the latest message create time. Note that the space read state only + # affects the read state of messages that are visible in the space's + # top-level conversation. Replies in threads are unaffected by this + # timestamp, and instead rely on the thread read state. + class UpdateSpaceReadStateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_setup.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_setup.rb new file mode 100644 index 000000000000..1fca1b246cef --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_setup.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # Request to create a space and add specified users to it. + # @!attribute [rw] space + # @return [::Google::Apps::Chat::V1::Space] + # 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. + # @!attribute [rw] request_id + # @return [::String] + # 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. + # @!attribute [rw] memberships + # @return [::Array<::Google::Apps::Chat::V1::Membership>] + # Optional. The Google Chat users or groups 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). + # + # For human membership, 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}`. + # + # For Google group membership, the `Membership.group_member` field must + # contain a `group` with `name` populated (format `groups/{group}`). You + # can only add Google groups when setting `Space.spaceType` to `SPACE`. + # + # 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`). + class SetUpSpaceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/thread_read_state.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/thread_read_state.rb new file mode 100644 index 000000000000..15ac5b21858c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/thread_read_state.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A user's read state within a thread, used to identify read and unread + # messages. + # @!attribute [rw] name + # @return [::String] + # Resource name of the thread read state. + # + # Format: `users/{user}/spaces/{space}/threads/{thread}/threadReadState` + # @!attribute [rw] last_read_time + # @return [::Google::Protobuf::Timestamp] + # The time when the user's thread read state was updated. Usually this + # corresponds with the timestamp of the last read message in a thread. + class ThreadReadState + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetThreadReadStateRequest API. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the thread read state to retrieve. + # + # Only supports getting read state for the calling user. + # + # To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, + # `users/me/spaces/{space}/threads/{thread}/threadReadState`. + # + # - Their Workspace email address. For example, + # `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`. + # + # - Their user id. For example, + # `users/123456789/spaces/{space}/threads/{thread}/threadReadState`. + # + # Format: users/\\{user}/spaces/\\{space}/threads/\\{thread}/threadReadState + class GetThreadReadStateRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/user.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/user.rb new file mode 100644 index 000000000000..681854c1b4c4 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/user.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # 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/workspace/chat/authenticate-authorize-chat-user), + # the output for a `User` resource only populates the user's `name` and `type`. + # @!attribute [rw] name + # @return [::String] + # Resource name for a Google Chat {::Google::Apps::Chat::V1::User user}. + # + # Format: `users/{user}`. `users/app` can be used as an alias for the calling + # app {::Google::Apps::Chat::V1::User::Type::BOT bot} user. + # + # For {::Google::Apps::Chat::V1::User::Type::HUMAN 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. + # @!attribute [r] display_name + # @return [::String] + # Output only. The user's display name. + # @!attribute [rw] domain_id + # @return [::String] + # Unique identifier of the user's Google Workspace domain. + # @!attribute [rw] type + # @return [::Google::Apps::Chat::V1::User::Type] + # User type. + # @!attribute [r] is_anonymous + # @return [::Boolean] + # Output only. When `true`, the user is deleted or their profile is not + # visible. + class User + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module Type + # Default value for the enum. DO NOT USE. + TYPE_UNSPECIFIED = 0 + + # Human user. + HUMAN = 1 + + # Chat app user. + BOT = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/widgets.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/widgets.rb new file mode 100644 index 000000000000..d2e434f10cf8 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/widgets.rb @@ -0,0 +1,293 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Apps + module Chat + module V1 + # A widget is a UI element that presents text and images. + # @!attribute [rw] text_paragraph + # @return [::Google::Apps::Chat::V1::WidgetMarkup::TextParagraph] + # Display a text paragraph in this widget. + # @!attribute [rw] image + # @return [::Google::Apps::Chat::V1::WidgetMarkup::Image] + # Display an image in this widget. + # @!attribute [rw] key_value + # @return [::Google::Apps::Chat::V1::WidgetMarkup::KeyValue] + # Display a key value item in this widget. + # @!attribute [rw] buttons + # @return [::Array<::Google::Apps::Chat::V1::WidgetMarkup::Button>] + # A list of buttons. Buttons is also `oneof data` and only one of these + # fields should be set. + class WidgetMarkup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A paragraph of text. Formatted text supported. For more information + # about formatting text, see + # [Formatting text in Google Chat + # apps](https://developers.google.com/workspace/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). + # @!attribute [rw] text + # @return [::String] + class TextParagraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A button. Can be a text button or an image button. + # @!attribute [rw] text_button + # @return [::Google::Apps::Chat::V1::WidgetMarkup::TextButton] + # A button with text and `onclick` action. + # @!attribute [rw] image_button + # @return [::Google::Apps::Chat::V1::WidgetMarkup::ImageButton] + # A button with image and `onclick` action. + class Button + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A button with text and `onclick` action. + # @!attribute [rw] text + # @return [::String] + # The text of the button. + # @!attribute [rw] on_click + # @return [::Google::Apps::Chat::V1::WidgetMarkup::OnClick] + # The `onclick` action of the button. + class TextButton + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A UI element contains a key (label) and a value (content). This + # element can also contain some actions such as `onclick` button. + # @!attribute [rw] icon + # @return [::Google::Apps::Chat::V1::WidgetMarkup::Icon] + # An enum value that's replaced by the Chat API with the + # corresponding icon image. + # @!attribute [rw] icon_url + # @return [::String] + # The icon specified by a URL. + # @!attribute [rw] top_label + # @return [::String] + # 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/workspace/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). + # @!attribute [rw] content + # @return [::String] + # 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/workspace/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). + # @!attribute [rw] content_multiline + # @return [::Boolean] + # If the content should be multiline. + # @!attribute [rw] bottom_label + # @return [::String] + # 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/workspace/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). + # @!attribute [rw] on_click + # @return [::Google::Apps::Chat::V1::WidgetMarkup::OnClick] + # The `onclick` action. Only the top label, bottom label, and content + # region are clickable. + # @!attribute [rw] button + # @return [::Google::Apps::Chat::V1::WidgetMarkup::Button] + # A button that can be clicked to trigger an action. + class KeyValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An image that's specified by a URL and can have an `onclick` action. + # @!attribute [rw] image_url + # @return [::String] + # The URL of the image. + # @!attribute [rw] on_click + # @return [::Google::Apps::Chat::V1::WidgetMarkup::OnClick] + # The `onclick` action. + # @!attribute [rw] aspect_ratio + # @return [::Float] + # 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. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An image button with an `onclick` action. + # @!attribute [rw] icon + # @return [::Google::Apps::Chat::V1::WidgetMarkup::Icon] + # The icon specified by an `enum` that indices to an icon provided by + # Chat API. + # @!attribute [rw] icon_url + # @return [::String] + # The icon specified by a URL. + # @!attribute [rw] on_click + # @return [::Google::Apps::Chat::V1::WidgetMarkup::OnClick] + # The `onclick` action. + # @!attribute [rw] name + # @return [::String] + # The name of this `image_button` that's used for accessibility. + # Default value is provided if this name isn't specified. + class ImageButton + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An `onclick` action (for example, open a link). + # @!attribute [rw] action + # @return [::Google::Apps::Chat::V1::WidgetMarkup::FormAction] + # A form action is triggered by this `onclick` action if specified. + # @!attribute [rw] open_link + # @return [::Google::Apps::Chat::V1::WidgetMarkup::OpenLink] + # This `onclick` action triggers an open link action if specified. + class OnClick + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A link that opens a new window. + # @!attribute [rw] url + # @return [::String] + # The URL to open. + class OpenLink + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A form action describes the behavior when the form is submitted. + # For example, you can invoke Apps Script to handle the form. + # @!attribute [rw] action_method_name + # @return [::String] + # 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. + # @!attribute [rw] parameters + # @return [::Array<::Google::Apps::Chat::V1::WidgetMarkup::FormAction::ActionParameter>] + # List of action parameters. + class FormAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # 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. + # @!attribute [rw] key + # @return [::String] + # The name of the parameter for the action script. + # @!attribute [rw] value + # @return [::String] + # The value of the parameter. + class ActionParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The set of supported icons. + module Icon + ICON_UNSPECIFIED = 0 + + AIRPLANE = 1 + + BOOKMARK = 26 + + BUS = 25 + + CAR = 9 + + CLOCK = 2 + + CONFIRMATION_NUMBER_ICON = 12 + + DOLLAR = 14 + + DESCRIPTION = 27 + + EMAIL = 10 + + EVENT_PERFORMER = 20 + + EVENT_SEAT = 21 + + FLIGHT_ARRIVAL = 16 + + FLIGHT_DEPARTURE = 15 + + HOTEL = 6 + + HOTEL_ROOM_TYPE = 17 + + INVITE = 19 + + MAP_PIN = 3 + + MEMBERSHIP = 24 + + MULTIPLE_PEOPLE = 18 + + OFFER = 30 + + PERSON = 11 + + PHONE = 13 + + RESTAURANT_ICON = 7 + + SHOPPING_CART = 8 + + STAR = 5 + + STORE = 22 + + TICKET = 4 + + TRAIN = 23 + + VIDEO_CAMERA = 28 + + VIDEO_PLAY = 29 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..8c6b19d52e3d --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..8e7abcf8f052 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..5160138862c2 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # Wrapper message for `double`. + # + # The JSON representation for `DoubleValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The double value. + class DoubleValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `float`. + # + # The JSON representation for `FloatValue` is JSON number. + # @!attribute [rw] value + # @return [::Float] + # The float value. + class FloatValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int64`. + # + # The JSON representation for `Int64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The int64 value. + class Int64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint64`. + # + # The JSON representation for `UInt64Value` is JSON string. + # @!attribute [rw] value + # @return [::Integer] + # The uint64 value. + class UInt64Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `int32`. + # + # The JSON representation for `Int32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The int32 value. + class Int32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `uint32`. + # + # The JSON representation for `UInt32Value` is JSON number. + # @!attribute [rw] value + # @return [::Integer] + # The uint32 value. + class UInt32Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bool`. + # + # The JSON representation for `BoolValue` is JSON `true` and `false`. + # @!attribute [rw] value + # @return [::Boolean] + # The bool value. + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `string`. + # + # The JSON representation for `StringValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The string value. + class StringValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wrapper message for `bytes`. + # + # The JSON representation for `BytesValue` is JSON string. + # @!attribute [rw] value + # @return [::String] + # The bytes value. + class BytesValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/rpc/code.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/rpc/code.rb new file mode 100644 index 000000000000..eeb01d7e37c8 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/rpc/code.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The canonical error codes for gRPC APIs. + # + # + # Sometimes multiple error codes may apply. Services should return + # the most specific error code that applies. For example, prefer + # `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. + # Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. + module Code + # Not an error; returned on success. + # + # HTTP Mapping: 200 OK + OK = 0 + + # The operation was cancelled, typically by the caller. + # + # HTTP Mapping: 499 Client Closed Request + CANCELLED = 1 + + # Unknown error. For example, this error may be returned when + # a `Status` value received from another address space belongs to + # an error space that is not known in this address space. Also + # errors raised by APIs that do not return enough error information + # may be converted to this error. + # + # HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2 + + # The client specified an invalid argument. Note that this differs + # from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + # that are problematic regardless of the state of the system + # (e.g., a malformed file name). + # + # HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3 + + # The deadline expired before the operation could complete. For operations + # that change the state of the system, this error may be returned + # even if the operation has completed successfully. For example, a + # successful response from a server could have been delayed long + # enough for the deadline to expire. + # + # HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4 + + # Some requested entity (e.g., file or directory) was not found. + # + # Note to server developers: if a request is denied for an entire class + # of users, such as gradual feature rollout or undocumented allowlist, + # `NOT_FOUND` may be used. If a request is denied for some users within + # a class of users, such as user-based access control, `PERMISSION_DENIED` + # must be used. + # + # HTTP Mapping: 404 Not Found + NOT_FOUND = 5 + + # The entity that a client attempted to create (e.g., file or directory) + # already exists. + # + # HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6 + + # The caller does not have permission to execute the specified + # operation. `PERMISSION_DENIED` must not be used for rejections + # caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + # instead for those errors). `PERMISSION_DENIED` must not be + # used if the caller can not be identified (use `UNAUTHENTICATED` + # instead for those errors). This error code does not imply the + # request is valid or the requested entity exists or satisfies + # other pre-conditions. + # + # HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7 + + # The request does not have valid authentication credentials for the + # operation. + # + # HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16 + + # Some resource has been exhausted, perhaps a per-user quota, or + # perhaps the entire file system is out of space. + # + # HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8 + + # The operation was rejected because the system is not in a state + # required for the operation's execution. For example, the directory + # to be deleted is non-empty, an rmdir operation is applied to + # a non-directory, etc. + # + # Service implementors can use the following guidelines to decide + # between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + # (a) Use `UNAVAILABLE` if the client can retry just the failing call. + # (b) Use `ABORTED` if the client should retry at a higher level. For + # example, when a client-specified test-and-set fails, indicating the + # client should restart a read-modify-write sequence. + # (c) Use `FAILED_PRECONDITION` if the client should not retry until + # the system state has been explicitly fixed. For example, if an "rmdir" + # fails because the directory is non-empty, `FAILED_PRECONDITION` + # should be returned since the client should not retry unless + # the files are deleted from the directory. + # + # HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9 + + # The operation was aborted, typically due to a concurrency issue such as + # a sequencer check failure or transaction abort. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 409 Conflict + ABORTED = 10 + + # The operation was attempted past the valid range. E.g., seeking or + # reading past end-of-file. + # + # Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + # be fixed if the system state changes. For example, a 32-bit file + # system will generate `INVALID_ARGUMENT` if asked to read at an + # offset that is not in the range [0,2^32-1], but it will generate + # `OUT_OF_RANGE` if asked to read from an offset past the current + # file size. + # + # There is a fair bit of overlap between `FAILED_PRECONDITION` and + # `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + # error) when it applies so that callers who are iterating through + # a space can easily look for an `OUT_OF_RANGE` error to detect when + # they are done. + # + # HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11 + + # The operation is not implemented or is not supported/enabled in this + # service. + # + # HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12 + + # Internal errors. This means that some invariants expected by the + # underlying system have been broken. This error code is reserved + # for serious errors. + # + # HTTP Mapping: 500 Internal Server Error + INTERNAL = 13 + + # The service is currently unavailable. This is most likely a + # transient condition, which can be corrected by retrying with + # a backoff. Note that it is not always safe to retry + # non-idempotent operations. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14 + + # Unrecoverable data loss or corruption. + # + # HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15 + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/type/color.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/type/color.rb new file mode 100644 index 000000000000..0cb4ccd2d45d --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/type/color.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # 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(''); + # }; + # + # // ... + # @!attribute [rw] red + # @return [::Float] + # The amount of red in the color as a value in the interval [0, 1]. + # @!attribute [rw] green + # @return [::Float] + # The amount of green in the color as a value in the interval [0, 1]. + # @!attribute [rw] blue + # @return [::Float] + # The amount of blue in the color as a value in the interval [0, 1]. + # @!attribute [rw] alpha + # @return [::Google::Protobuf::FloatValue] + # The fraction of this color that should be applied to the pixel. That is, + # the final pixel color is defined by the equation: + # + # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + # + # This means that a value of 1.0 corresponds to a solid color, whereas + # a value of 0.0 corresponds to a completely transparent color. This + # uses a wrapper message rather than a simple float scalar so that it is + # possible to distinguish between a default value and the value being unset. + # If omitted, this color object is rendered as a solid color + # (as if the alpha value had been explicitly given a value of 1.0). + class Color + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/Gemfile b/owl-bot-staging/google-apps-chat-v1/snippets/Gemfile new file mode 100644 index 000000000000..b511446de83a --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-apps-chat-v1", path: "../" +else + gem "google-apps-chat-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/complete_import_space.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/complete_import_space.rb new file mode 100644 index 000000000000..6a5cda070acc --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/complete_import_space.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_CompleteImportSpace_sync] +require "google/apps/chat/v1" + +## +# Snippet for the complete_import_space call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#complete_import_space. +# +def complete_import_space + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::CompleteImportSpaceRequest.new + + # Call the complete_import_space method. + result = client.complete_import_space request + + # The returned object is of type Google::Apps::Chat::V1::CompleteImportSpaceResponse. + p result +end +# [END chat_v1_generated_ChatService_CompleteImportSpace_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_membership.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_membership.rb new file mode 100644 index 000000000000..ce632d221a51 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_membership.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_CreateMembership_sync] +require "google/apps/chat/v1" + +## +# Snippet for the create_membership call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#create_membership. +# +def create_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::CreateMembershipRequest.new + + # Call the create_membership method. + result = client.create_membership request + + # The returned object is of type Google::Apps::Chat::V1::Membership. + p result +end +# [END chat_v1_generated_ChatService_CreateMembership_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_message.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_message.rb new file mode 100644 index 000000000000..16d9078f66ba --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_message.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_CreateMessage_sync] +require "google/apps/chat/v1" + +## +# Snippet for the create_message call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#create_message. +# +def create_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::CreateMessageRequest.new + + # Call the create_message method. + result = client.create_message request + + # The returned object is of type Google::Apps::Chat::V1::Message. + p result +end +# [END chat_v1_generated_ChatService_CreateMessage_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_reaction.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_reaction.rb new file mode 100644 index 000000000000..260fef7430d0 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_reaction.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_CreateReaction_sync] +require "google/apps/chat/v1" + +## +# Snippet for the create_reaction call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#create_reaction. +# +def create_reaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::CreateReactionRequest.new + + # Call the create_reaction method. + result = client.create_reaction request + + # The returned object is of type Google::Apps::Chat::V1::Reaction. + p result +end +# [END chat_v1_generated_ChatService_CreateReaction_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_space.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_space.rb new file mode 100644 index 000000000000..72e50657c98c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_space.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_CreateSpace_sync] +require "google/apps/chat/v1" + +## +# Snippet for the create_space call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#create_space. +# +def create_space + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::CreateSpaceRequest.new + + # Call the create_space method. + result = client.create_space request + + # The returned object is of type Google::Apps::Chat::V1::Space. + p result +end +# [END chat_v1_generated_ChatService_CreateSpace_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_membership.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_membership.rb new file mode 100644 index 000000000000..3d906c2b05a1 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_membership.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_DeleteMembership_sync] +require "google/apps/chat/v1" + +## +# Snippet for the delete_membership call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#delete_membership. +# +def delete_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::DeleteMembershipRequest.new + + # Call the delete_membership method. + result = client.delete_membership request + + # The returned object is of type Google::Apps::Chat::V1::Membership. + p result +end +# [END chat_v1_generated_ChatService_DeleteMembership_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_message.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_message.rb new file mode 100644 index 000000000000..e885527ec0a0 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_message.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_DeleteMessage_sync] +require "google/apps/chat/v1" + +## +# Snippet for the delete_message call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#delete_message. +# +def delete_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::DeleteMessageRequest.new + + # Call the delete_message method. + result = client.delete_message request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END chat_v1_generated_ChatService_DeleteMessage_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_reaction.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_reaction.rb new file mode 100644 index 000000000000..5e8e65a44d25 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_reaction.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_DeleteReaction_sync] +require "google/apps/chat/v1" + +## +# Snippet for the delete_reaction call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#delete_reaction. +# +def delete_reaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::DeleteReactionRequest.new + + # Call the delete_reaction method. + result = client.delete_reaction request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END chat_v1_generated_ChatService_DeleteReaction_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_space.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_space.rb new file mode 100644 index 000000000000..1b8535f16b04 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_space.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_DeleteSpace_sync] +require "google/apps/chat/v1" + +## +# Snippet for the delete_space call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#delete_space. +# +def delete_space + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::DeleteSpaceRequest.new + + # Call the delete_space method. + result = client.delete_space request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END chat_v1_generated_ChatService_DeleteSpace_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_direct_message.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_direct_message.rb new file mode 100644 index 000000000000..0cd11f14cd76 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_direct_message.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_FindDirectMessage_sync] +require "google/apps/chat/v1" + +## +# Snippet for the find_direct_message call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#find_direct_message. +# +def find_direct_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::FindDirectMessageRequest.new + + # Call the find_direct_message method. + result = client.find_direct_message request + + # The returned object is of type Google::Apps::Chat::V1::Space. + p result +end +# [END chat_v1_generated_ChatService_FindDirectMessage_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_attachment.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_attachment.rb new file mode 100644 index 000000000000..de56d8aafeb1 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_attachment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_GetAttachment_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_attachment call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#get_attachment. +# +def get_attachment + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::GetAttachmentRequest.new + + # Call the get_attachment method. + result = client.get_attachment request + + # The returned object is of type Google::Apps::Chat::V1::Attachment. + p result +end +# [END chat_v1_generated_ChatService_GetAttachment_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_membership.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_membership.rb new file mode 100644 index 000000000000..b4b1e19ed987 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_membership.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_GetMembership_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_membership call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#get_membership. +# +def get_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::GetMembershipRequest.new + + # Call the get_membership method. + result = client.get_membership request + + # The returned object is of type Google::Apps::Chat::V1::Membership. + p result +end +# [END chat_v1_generated_ChatService_GetMembership_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_message.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_message.rb new file mode 100644 index 000000000000..69bdd68a8801 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_message.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_GetMessage_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_message call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#get_message. +# +def get_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::GetMessageRequest.new + + # Call the get_message method. + result = client.get_message request + + # The returned object is of type Google::Apps::Chat::V1::Message. + p result +end +# [END chat_v1_generated_ChatService_GetMessage_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space.rb new file mode 100644 index 000000000000..c29a7c7e817d --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_GetSpace_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_space call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#get_space. +# +def get_space + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::GetSpaceRequest.new + + # Call the get_space method. + result = client.get_space request + + # The returned object is of type Google::Apps::Chat::V1::Space. + p result +end +# [END chat_v1_generated_ChatService_GetSpace_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_event.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_event.rb new file mode 100644 index 000000000000..10a8f3174816 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_GetSpaceEvent_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_space_event call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#get_space_event. +# +def get_space_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::GetSpaceEventRequest.new + + # Call the get_space_event method. + result = client.get_space_event request + + # The returned object is of type Google::Apps::Chat::V1::SpaceEvent. + p result +end +# [END chat_v1_generated_ChatService_GetSpaceEvent_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_read_state.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_read_state.rb new file mode 100644 index 000000000000..1a9043a6d9c0 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_read_state.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_GetSpaceReadState_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_space_read_state call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#get_space_read_state. +# +def get_space_read_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::GetSpaceReadStateRequest.new + + # Call the get_space_read_state method. + result = client.get_space_read_state request + + # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. + p result +end +# [END chat_v1_generated_ChatService_GetSpaceReadState_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_thread_read_state.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_thread_read_state.rb new file mode 100644 index 000000000000..516205a93f2f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_thread_read_state.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_GetThreadReadState_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_thread_read_state call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#get_thread_read_state. +# +def get_thread_read_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::GetThreadReadStateRequest.new + + # Call the get_thread_read_state method. + result = client.get_thread_read_state request + + # The returned object is of type Google::Apps::Chat::V1::ThreadReadState. + p result +end +# [END chat_v1_generated_ChatService_GetThreadReadState_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_memberships.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_memberships.rb new file mode 100644 index 000000000000..bffbbeb426aa --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_memberships.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_ListMemberships_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_memberships call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#list_memberships. +# +def list_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::ListMembershipsRequest.new + + # Call the list_memberships method. + result = client.list_memberships request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Apps::Chat::V1::Membership. + p item + end +end +# [END chat_v1_generated_ChatService_ListMemberships_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_messages.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_messages.rb new file mode 100644 index 000000000000..52247a364ca7 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_messages.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_ListMessages_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_messages call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#list_messages. +# +def list_messages + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::ListMessagesRequest.new + + # Call the list_messages method. + result = client.list_messages request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Apps::Chat::V1::Message. + p item + end +end +# [END chat_v1_generated_ChatService_ListMessages_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_reactions.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_reactions.rb new file mode 100644 index 000000000000..781a948a1f02 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_reactions.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_ListReactions_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_reactions call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#list_reactions. +# +def list_reactions + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::ListReactionsRequest.new + + # Call the list_reactions method. + result = client.list_reactions request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Apps::Chat::V1::Reaction. + p item + end +end +# [END chat_v1_generated_ChatService_ListReactions_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_space_events.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_space_events.rb new file mode 100644 index 000000000000..cc26a8ee2372 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_space_events.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_ListSpaceEvents_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_space_events call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#list_space_events. +# +def list_space_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::ListSpaceEventsRequest.new + + # Call the list_space_events method. + result = client.list_space_events request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Apps::Chat::V1::SpaceEvent. + p item + end +end +# [END chat_v1_generated_ChatService_ListSpaceEvents_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_spaces.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_spaces.rb new file mode 100644 index 000000000000..b5e7153be574 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_spaces.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_ListSpaces_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_spaces call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#list_spaces. +# +def list_spaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::ListSpacesRequest.new + + # Call the list_spaces method. + result = client.list_spaces request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Apps::Chat::V1::Space. + p item + end +end +# [END chat_v1_generated_ChatService_ListSpaces_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/search_spaces.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/search_spaces.rb new file mode 100644 index 000000000000..4dba2d7a42ac --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/search_spaces.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_SearchSpaces_sync] +require "google/apps/chat/v1" + +## +# Snippet for the search_spaces call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#search_spaces. +# +def search_spaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::SearchSpacesRequest.new + + # Call the search_spaces method. + result = client.search_spaces request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Apps::Chat::V1::Space. + p item + end +end +# [END chat_v1_generated_ChatService_SearchSpaces_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/set_up_space.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/set_up_space.rb new file mode 100644 index 000000000000..ec48aae63ae4 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/set_up_space.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_SetUpSpace_sync] +require "google/apps/chat/v1" + +## +# Snippet for the set_up_space call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#set_up_space. +# +def set_up_space + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::SetUpSpaceRequest.new + + # Call the set_up_space method. + result = client.set_up_space request + + # The returned object is of type Google::Apps::Chat::V1::Space. + p result +end +# [END chat_v1_generated_ChatService_SetUpSpace_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_membership.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_membership.rb new file mode 100644 index 000000000000..197bca387cec --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_membership.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_UpdateMembership_sync] +require "google/apps/chat/v1" + +## +# Snippet for the update_membership call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#update_membership. +# +def update_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::UpdateMembershipRequest.new + + # Call the update_membership method. + result = client.update_membership request + + # The returned object is of type Google::Apps::Chat::V1::Membership. + p result +end +# [END chat_v1_generated_ChatService_UpdateMembership_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_message.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_message.rb new file mode 100644 index 000000000000..94edbaece5ed --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_message.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_UpdateMessage_sync] +require "google/apps/chat/v1" + +## +# Snippet for the update_message call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#update_message. +# +def update_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::UpdateMessageRequest.new + + # Call the update_message method. + result = client.update_message request + + # The returned object is of type Google::Apps::Chat::V1::Message. + p result +end +# [END chat_v1_generated_ChatService_UpdateMessage_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space.rb new file mode 100644 index 000000000000..f38b2a7647b7 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_UpdateSpace_sync] +require "google/apps/chat/v1" + +## +# Snippet for the update_space call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#update_space. +# +def update_space + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::UpdateSpaceRequest.new + + # Call the update_space method. + result = client.update_space request + + # The returned object is of type Google::Apps::Chat::V1::Space. + p result +end +# [END chat_v1_generated_ChatService_UpdateSpace_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_read_state.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_read_state.rb new file mode 100644 index 000000000000..4e5e074035d1 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_read_state.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_UpdateSpaceReadState_sync] +require "google/apps/chat/v1" + +## +# Snippet for the update_space_read_state call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#update_space_read_state. +# +def update_space_read_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new + + # Call the update_space_read_state method. + result = client.update_space_read_state request + + # The returned object is of type Google::Apps::Chat::V1::SpaceReadState. + p result +end +# [END chat_v1_generated_ChatService_UpdateSpaceReadState_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/upload_attachment.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/upload_attachment.rb new file mode 100644 index 000000000000..83a021db5346 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/upload_attachment.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_UploadAttachment_sync] +require "google/apps/chat/v1" + +## +# Snippet for the upload_attachment call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#upload_attachment. +# +def upload_attachment + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::UploadAttachmentRequest.new + + # Call the upload_attachment method. + result = client.upload_attachment request + + # The returned object is of type Google::Apps::Chat::V1::UploadAttachmentResponse. + p result +end +# [END chat_v1_generated_ChatService_UploadAttachment_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json b/owl-bot-staging/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json new file mode 100644 index 000000000000..4db98f133417 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json @@ -0,0 +1,1175 @@ +{ + "client_library": { + "name": "google-apps-chat-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.chat.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "chat_v1_generated_ChatService_CreateMessage_sync", + "title": "Snippet for the create_message call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_message.", + "file": "chat_service/create_message.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_message", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_message", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::CreateMessageRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Message", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "CreateMessage", + "full_name": "google.chat.v1.ChatService.CreateMessage", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_ListMessages_sync", + "title": "Snippet for the list_messages call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_messages.", + "file": "chat_service/list_messages.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_messages", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_messages", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListMessagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListMessagesResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListMessages", + "full_name": "google.chat.v1.ChatService.ListMessages", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_ListMemberships_sync", + "title": "Snippet for the list_memberships call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_memberships.", + "file": "chat_service/list_memberships.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_memberships", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_memberships", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListMembershipsRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListMembershipsResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListMemberships", + "full_name": "google.chat.v1.ChatService.ListMemberships", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetMembership_sync", + "title": "Snippet for the get_membership call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_membership.", + "file": "chat_service/get_membership.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_membership", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_membership", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetMembershipRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Membership", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetMembership", + "full_name": "google.chat.v1.ChatService.GetMembership", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetMessage_sync", + "title": "Snippet for the get_message call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_message.", + "file": "chat_service/get_message.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_message", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_message", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetMessageRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Message", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetMessage", + "full_name": "google.chat.v1.ChatService.GetMessage", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_UpdateMessage_sync", + "title": "Snippet for the update_message call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_message.", + "file": "chat_service/update_message.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_message", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_message", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::UpdateMessageRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Message", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "UpdateMessage", + "full_name": "google.chat.v1.ChatService.UpdateMessage", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_DeleteMessage_sync", + "title": "Snippet for the delete_message call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_message.", + "file": "chat_service/delete_message.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_message", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_message", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::DeleteMessageRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "DeleteMessage", + "full_name": "google.chat.v1.ChatService.DeleteMessage", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetAttachment_sync", + "title": "Snippet for the get_attachment call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_attachment.", + "file": "chat_service/get_attachment.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_attachment", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_attachment", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetAttachmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Attachment", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetAttachment", + "full_name": "google.chat.v1.ChatService.GetAttachment", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_UploadAttachment_sync", + "title": "Snippet for the upload_attachment call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#upload_attachment.", + "file": "chat_service/upload_attachment.rb", + "language": "RUBY", + "client_method": { + "short_name": "upload_attachment", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#upload_attachment", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::UploadAttachmentRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::UploadAttachmentResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "UploadAttachment", + "full_name": "google.chat.v1.ChatService.UploadAttachment", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_ListSpaces_sync", + "title": "Snippet for the list_spaces call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_spaces.", + "file": "chat_service/list_spaces.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_spaces", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_spaces", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListSpacesRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListSpacesResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListSpaces", + "full_name": "google.chat.v1.ChatService.ListSpaces", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_SearchSpaces_sync", + "title": "Snippet for the search_spaces call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#search_spaces.", + "file": "chat_service/search_spaces.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_spaces", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#search_spaces", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::SearchSpacesRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::SearchSpacesResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "SearchSpaces", + "full_name": "google.chat.v1.ChatService.SearchSpaces", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetSpace_sync", + "title": "Snippet for the get_space call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_space.", + "file": "chat_service/get_space.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_space", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_space", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetSpaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Space", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetSpace", + "full_name": "google.chat.v1.ChatService.GetSpace", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_CreateSpace_sync", + "title": "Snippet for the create_space call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_space.", + "file": "chat_service/create_space.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_space", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_space", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::CreateSpaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Space", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "CreateSpace", + "full_name": "google.chat.v1.ChatService.CreateSpace", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_SetUpSpace_sync", + "title": "Snippet for the set_up_space call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#set_up_space.", + "file": "chat_service/set_up_space.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_up_space", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#set_up_space", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::SetUpSpaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Space", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "SetUpSpace", + "full_name": "google.chat.v1.ChatService.SetUpSpace", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_UpdateSpace_sync", + "title": "Snippet for the update_space call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_space.", + "file": "chat_service/update_space.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_space", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_space", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::UpdateSpaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Space", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "UpdateSpace", + "full_name": "google.chat.v1.ChatService.UpdateSpace", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_DeleteSpace_sync", + "title": "Snippet for the delete_space call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_space.", + "file": "chat_service/delete_space.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_space", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_space", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::DeleteSpaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "DeleteSpace", + "full_name": "google.chat.v1.ChatService.DeleteSpace", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_CompleteImportSpace_sync", + "title": "Snippet for the complete_import_space call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#complete_import_space.", + "file": "chat_service/complete_import_space.rb", + "language": "RUBY", + "client_method": { + "short_name": "complete_import_space", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#complete_import_space", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::CompleteImportSpaceRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::CompleteImportSpaceResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "CompleteImportSpace", + "full_name": "google.chat.v1.ChatService.CompleteImportSpace", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_FindDirectMessage_sync", + "title": "Snippet for the find_direct_message call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#find_direct_message.", + "file": "chat_service/find_direct_message.rb", + "language": "RUBY", + "client_method": { + "short_name": "find_direct_message", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#find_direct_message", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::FindDirectMessageRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Space", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "FindDirectMessage", + "full_name": "google.chat.v1.ChatService.FindDirectMessage", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_CreateMembership_sync", + "title": "Snippet for the create_membership call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_membership.", + "file": "chat_service/create_membership.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_membership", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_membership", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::CreateMembershipRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Membership", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "CreateMembership", + "full_name": "google.chat.v1.ChatService.CreateMembership", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_UpdateMembership_sync", + "title": "Snippet for the update_membership call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_membership.", + "file": "chat_service/update_membership.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_membership", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_membership", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::UpdateMembershipRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Membership", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "UpdateMembership", + "full_name": "google.chat.v1.ChatService.UpdateMembership", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_DeleteMembership_sync", + "title": "Snippet for the delete_membership call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_membership.", + "file": "chat_service/delete_membership.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_membership", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_membership", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::DeleteMembershipRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Membership", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "DeleteMembership", + "full_name": "google.chat.v1.ChatService.DeleteMembership", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_CreateReaction_sync", + "title": "Snippet for the create_reaction call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_reaction.", + "file": "chat_service/create_reaction.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_reaction", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_reaction", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::CreateReactionRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Reaction", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "CreateReaction", + "full_name": "google.chat.v1.ChatService.CreateReaction", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_ListReactions_sync", + "title": "Snippet for the list_reactions call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_reactions.", + "file": "chat_service/list_reactions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_reactions", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_reactions", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListReactionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListReactionsResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListReactions", + "full_name": "google.chat.v1.ChatService.ListReactions", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_DeleteReaction_sync", + "title": "Snippet for the delete_reaction call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_reaction.", + "file": "chat_service/delete_reaction.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_reaction", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_reaction", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::DeleteReactionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "DeleteReaction", + "full_name": "google.chat.v1.ChatService.DeleteReaction", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetSpaceReadState_sync", + "title": "Snippet for the get_space_read_state call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_space_read_state.", + "file": "chat_service/get_space_read_state.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_space_read_state", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_space_read_state", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetSpaceReadStateRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::SpaceReadState", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetSpaceReadState", + "full_name": "google.chat.v1.ChatService.GetSpaceReadState", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_UpdateSpaceReadState_sync", + "title": "Snippet for the update_space_read_state call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_space_read_state.", + "file": "chat_service/update_space_read_state.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_space_read_state", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_space_read_state", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::SpaceReadState", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "UpdateSpaceReadState", + "full_name": "google.chat.v1.ChatService.UpdateSpaceReadState", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetThreadReadState_sync", + "title": "Snippet for the get_thread_read_state call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_thread_read_state.", + "file": "chat_service/get_thread_read_state.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_thread_read_state", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_thread_read_state", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetThreadReadStateRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ThreadReadState", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetThreadReadState", + "full_name": "google.chat.v1.ChatService.GetThreadReadState", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetSpaceEvent_sync", + "title": "Snippet for the get_space_event call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_space_event.", + "file": "chat_service/get_space_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_space_event", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_space_event", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetSpaceEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::SpaceEvent", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetSpaceEvent", + "full_name": "google.chat.v1.ChatService.GetSpaceEvent", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_ListSpaceEvents_sync", + "title": "Snippet for the list_space_events call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_space_events.", + "file": "chat_service/list_space_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_space_events", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_space_events", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListSpaceEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListSpaceEventsResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListSpaceEvents", + "full_name": "google.chat.v1.ChatService.ListSpaceEvents", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_paths_test.rb b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_paths_test.rb new file mode 100644 index 000000000000..c2a7740c87ed --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_paths_test.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/apps/chat/v1/chat_service" + +class ::Google::Apps::Chat::V1::ChatService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_attachment_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.attachment_path space: "value0", message: "value1", attachment: "value2" + assert_equal "spaces/value0/messages/value1/attachments/value2", path + end + end + + def test_membership_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.membership_path space: "value0", member: "value1" + assert_equal "spaces/value0/members/value1", path + end + end + + def test_message_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.message_path space: "value0", message: "value1" + assert_equal "spaces/value0/messages/value1", path + end + end + + def test_quoted_message_metadata_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.quoted_message_metadata_path space: "value0", message: "value1", quoted_message_metadata: "value2" + assert_equal "spaces/value0/messages/value1/quotedMessageMetadata/value2", path + end + end + + def test_reaction_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reaction_path space: "value0", message: "value1", reaction: "value2" + assert_equal "spaces/value0/messages/value1/reactions/value2", path + end + end + + def test_space_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.space_path space: "value0" + assert_equal "spaces/value0", path + end + end + + def test_space_event_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.space_event_path space: "value0", space_event: "value1" + assert_equal "spaces/value0/spaceEvents/value1", path + end + end + + def test_space_read_state_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.space_read_state_path user: "value0", space: "value1" + assert_equal "users/value0/spaces/value1/spaceReadState", path + end + end + + def test_thread_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.thread_path space: "value0", thread: "value1" + assert_equal "spaces/value0/threads/value1", path + end + end + + def test_thread_read_state_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.thread_read_state_path user: "value0", space: "value1", thread: "value2" + assert_equal "users/value0/spaces/value1/threads/value2/threadReadState", path + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb new file mode 100644 index 000000000000..c950a5aba793 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb @@ -0,0 +1,1704 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/chat/v1/chat_service_pb" +require "google/apps/chat/v1/chat_service/rest" + + +class ::Google::Apps::Chat::V1::ChatService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_message + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Message.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + message = {} + thread_key = "hello world" + request_id = "hello world" + message_reply_option = :MESSAGE_REPLY_OPTION_UNSPECIFIED + message_id = "hello world" + + create_message_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_create_message_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_message({ parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_message parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_message ::Google::Apps::Chat::V1::CreateMessageRequest.new(parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_message({ parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_message(::Google::Apps::Chat::V1::CreateMessageRequest.new(parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_message_client_stub.call_count + end + end + end + + def test_list_messages + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListMessagesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + show_deleted = true + + list_messages_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_list_messages_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_messages_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_messages({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_messages parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_messages ::Google::Apps::Chat::V1::ListMessagesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_messages({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_messages(::Google::Apps::Chat::V1::ListMessagesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_messages_client_stub.call_count + end + end + end + + def test_list_memberships + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListMembershipsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + show_groups = true + show_invited = true + use_admin_access = true + + list_memberships_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_list_memberships_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_memberships_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_memberships({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_memberships parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_memberships ::Google::Apps::Chat::V1::ListMembershipsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_memberships({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_memberships(::Google::Apps::Chat::V1::ListMembershipsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_memberships_client_stub.call_count + end + end + end + + def test_get_membership + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Membership.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + get_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_get_membership_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_membership({ name: name, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_membership name: name, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_membership ::Google::Apps::Chat::V1::GetMembershipRequest.new(name: name, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_membership({ name: name, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_membership(::Google::Apps::Chat::V1::GetMembershipRequest.new(name: name, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_membership_client_stub.call_count + end + end + end + + def test_get_message + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Message.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_message_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_get_message_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_message({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_message name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_message ::Google::Apps::Chat::V1::GetMessageRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_message({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_message(::Google::Apps::Chat::V1::GetMessageRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_message_client_stub.call_count + end + end + end + + def test_update_message + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Message.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + message = {} + update_mask = {} + allow_missing = true + + update_message_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_update_message_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_message({ message: message, update_mask: update_mask, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_message message: message, update_mask: update_mask, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_message ::Google::Apps::Chat::V1::UpdateMessageRequest.new(message: message, update_mask: update_mask, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_message({ message: message, update_mask: update_mask, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_message(::Google::Apps::Chat::V1::UpdateMessageRequest.new(message: message, update_mask: update_mask, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_message_client_stub.call_count + end + end + end + + def test_delete_message + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + delete_message_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_delete_message_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_message({ name: name, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_message name: name, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_message ::Google::Apps::Chat::V1::DeleteMessageRequest.new(name: name, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_message({ name: name, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_message(::Google::Apps::Chat::V1::DeleteMessageRequest.new(name: name, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_message_client_stub.call_count + end + end + end + + def test_get_attachment + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Attachment.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_attachment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_get_attachment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_attachment_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_attachment({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_attachment name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_attachment ::Google::Apps::Chat::V1::GetAttachmentRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_attachment({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_attachment(::Google::Apps::Chat::V1::GetAttachmentRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_attachment_client_stub.call_count + end + end + end + + def test_upload_attachment + # Create test objects. + client_result = ::Google::Apps::Chat::V1::UploadAttachmentResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filename = "hello world" + + upload_attachment_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_upload_attachment_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, upload_attachment_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.upload_attachment({ parent: parent, filename: filename }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.upload_attachment parent: parent, filename: filename do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.upload_attachment ::Google::Apps::Chat::V1::UploadAttachmentRequest.new(parent: parent, filename: filename) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.upload_attachment({ parent: parent, filename: filename }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.upload_attachment(::Google::Apps::Chat::V1::UploadAttachmentRequest.new(parent: parent, filename: filename), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, upload_attachment_client_stub.call_count + end + end + end + + def test_list_spaces + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListSpacesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_spaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_list_spaces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_spaces_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_spaces({ page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_spaces page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_spaces ::Google::Apps::Chat::V1::ListSpacesRequest.new(page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_spaces({ page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_spaces(::Google::Apps::Chat::V1::ListSpacesRequest.new(page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_spaces_client_stub.call_count + end + end + end + + def test_search_spaces + # Create test objects. + client_result = ::Google::Apps::Chat::V1::SearchSpacesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + use_admin_access = true + page_size = 42 + page_token = "hello world" + query = "hello world" + order_by = "hello world" + + search_spaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_search_spaces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_spaces_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_spaces({ use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_spaces use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_spaces ::Google::Apps::Chat::V1::SearchSpacesRequest.new(use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_spaces({ use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_spaces(::Google::Apps::Chat::V1::SearchSpacesRequest.new(use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_spaces_client_stub.call_count + end + end + end + + def test_get_space + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Space.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + get_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_get_space_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_space({ name: name, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_space name: name, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_space ::Google::Apps::Chat::V1::GetSpaceRequest.new(name: name, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_space({ name: name, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_space(::Google::Apps::Chat::V1::GetSpaceRequest.new(name: name, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_space_client_stub.call_count + end + end + end + + def test_create_space + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Space.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + space = {} + request_id = "hello world" + + create_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_create_space_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_space({ space: space, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_space space: space, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_space ::Google::Apps::Chat::V1::CreateSpaceRequest.new(space: space, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_space({ space: space, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_space(::Google::Apps::Chat::V1::CreateSpaceRequest.new(space: space, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_space_client_stub.call_count + end + end + end + + def test_set_up_space + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Space.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + space = {} + request_id = "hello world" + memberships = [{}] + + set_up_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_set_up_space_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_up_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_up_space({ space: space, request_id: request_id, memberships: memberships }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_up_space space: space, request_id: request_id, memberships: memberships do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_up_space ::Google::Apps::Chat::V1::SetUpSpaceRequest.new(space: space, request_id: request_id, memberships: memberships) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_up_space({ space: space, request_id: request_id, memberships: memberships }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_up_space(::Google::Apps::Chat::V1::SetUpSpaceRequest.new(space: space, request_id: request_id, memberships: memberships), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_up_space_client_stub.call_count + end + end + end + + def test_update_space + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Space.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + space = {} + update_mask = {} + use_admin_access = true + + update_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_update_space_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_space({ space: space, update_mask: update_mask, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_space space: space, update_mask: update_mask, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_space ::Google::Apps::Chat::V1::UpdateSpaceRequest.new(space: space, update_mask: update_mask, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_space({ space: space, update_mask: update_mask, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_space(::Google::Apps::Chat::V1::UpdateSpaceRequest.new(space: space, update_mask: update_mask, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_space_client_stub.call_count + end + end + end + + def test_delete_space + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + delete_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_delete_space_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_space({ name: name, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_space name: name, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_space ::Google::Apps::Chat::V1::DeleteSpaceRequest.new(name: name, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_space({ name: name, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_space(::Google::Apps::Chat::V1::DeleteSpaceRequest.new(name: name, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_space_client_stub.call_count + end + end + end + + def test_complete_import_space + # Create test objects. + client_result = ::Google::Apps::Chat::V1::CompleteImportSpaceResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + complete_import_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_complete_import_space_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, complete_import_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.complete_import_space({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.complete_import_space name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.complete_import_space ::Google::Apps::Chat::V1::CompleteImportSpaceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.complete_import_space({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.complete_import_space(::Google::Apps::Chat::V1::CompleteImportSpaceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, complete_import_space_client_stub.call_count + end + end + end + + def test_find_direct_message + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Space.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + find_direct_message_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_find_direct_message_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, find_direct_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.find_direct_message({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.find_direct_message name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.find_direct_message ::Google::Apps::Chat::V1::FindDirectMessageRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.find_direct_message({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.find_direct_message(::Google::Apps::Chat::V1::FindDirectMessageRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, find_direct_message_client_stub.call_count + end + end + end + + def test_create_membership + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Membership.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + membership = {} + use_admin_access = true + + create_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_create_membership_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_membership({ parent: parent, membership: membership, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_membership parent: parent, membership: membership, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_membership ::Google::Apps::Chat::V1::CreateMembershipRequest.new(parent: parent, membership: membership, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_membership({ parent: parent, membership: membership, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_membership(::Google::Apps::Chat::V1::CreateMembershipRequest.new(parent: parent, membership: membership, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_membership_client_stub.call_count + end + end + end + + def test_update_membership + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Membership.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + membership = {} + update_mask = {} + use_admin_access = true + + update_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_update_membership_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_membership({ membership: membership, update_mask: update_mask, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_membership membership: membership, update_mask: update_mask, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_membership ::Google::Apps::Chat::V1::UpdateMembershipRequest.new(membership: membership, update_mask: update_mask, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_membership({ membership: membership, update_mask: update_mask, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_membership(::Google::Apps::Chat::V1::UpdateMembershipRequest.new(membership: membership, update_mask: update_mask, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_membership_client_stub.call_count + end + end + end + + def test_delete_membership + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Membership.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + delete_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_delete_membership_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_membership({ name: name, use_admin_access: use_admin_access }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_membership name: name, use_admin_access: use_admin_access do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_membership ::Google::Apps::Chat::V1::DeleteMembershipRequest.new(name: name, use_admin_access: use_admin_access) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_membership({ name: name, use_admin_access: use_admin_access }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_membership(::Google::Apps::Chat::V1::DeleteMembershipRequest.new(name: name, use_admin_access: use_admin_access), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_membership_client_stub.call_count + end + end + end + + def test_create_reaction + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Reaction.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reaction = {} + + create_reaction_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_create_reaction_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_reaction_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_reaction({ parent: parent, reaction: reaction }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_reaction parent: parent, reaction: reaction do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_reaction ::Google::Apps::Chat::V1::CreateReactionRequest.new(parent: parent, reaction: reaction) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_reaction({ parent: parent, reaction: reaction }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_reaction(::Google::Apps::Chat::V1::CreateReactionRequest.new(parent: parent, reaction: reaction), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_reaction_client_stub.call_count + end + end + end + + def test_list_reactions + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListReactionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_reactions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_list_reactions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_reactions_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_reactions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_reactions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_reactions ::Google::Apps::Chat::V1::ListReactionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_reactions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_reactions(::Google::Apps::Chat::V1::ListReactionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_reactions_client_stub.call_count + end + end + end + + def test_delete_reaction + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reaction_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_delete_reaction_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_reaction_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_reaction({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_reaction name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_reaction ::Google::Apps::Chat::V1::DeleteReactionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_reaction({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_reaction(::Google::Apps::Chat::V1::DeleteReactionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_reaction_client_stub.call_count + end + end + end + + def test_get_space_read_state + # Create test objects. + client_result = ::Google::Apps::Chat::V1::SpaceReadState.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_space_read_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_get_space_read_state_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_space_read_state_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_space_read_state({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_space_read_state name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_space_read_state ::Google::Apps::Chat::V1::GetSpaceReadStateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_space_read_state({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_space_read_state(::Google::Apps::Chat::V1::GetSpaceReadStateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_space_read_state_client_stub.call_count + end + end + end + + def test_update_space_read_state + # Create test objects. + client_result = ::Google::Apps::Chat::V1::SpaceReadState.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + space_read_state = {} + update_mask = {} + + update_space_read_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_update_space_read_state_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_space_read_state_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_space_read_state({ space_read_state: space_read_state, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_space_read_state space_read_state: space_read_state, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_space_read_state ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new(space_read_state: space_read_state, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_space_read_state({ space_read_state: space_read_state, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_space_read_state(::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new(space_read_state: space_read_state, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_space_read_state_client_stub.call_count + end + end + end + + def test_get_thread_read_state + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ThreadReadState.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_thread_read_state_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_get_thread_read_state_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_thread_read_state_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_thread_read_state({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_thread_read_state name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_thread_read_state ::Google::Apps::Chat::V1::GetThreadReadStateRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_thread_read_state({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_thread_read_state(::Google::Apps::Chat::V1::GetThreadReadStateRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_thread_read_state_client_stub.call_count + end + end + end + + def test_get_space_event + # Create test objects. + client_result = ::Google::Apps::Chat::V1::SpaceEvent.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_space_event_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_get_space_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_space_event_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_space_event({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_space_event name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_space_event ::Google::Apps::Chat::V1::GetSpaceEventRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_space_event({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_space_event(::Google::Apps::Chat::V1::GetSpaceEventRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_space_event_client_stub.call_count + end + end + end + + def test_list_space_events + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListSpaceEventsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_space_events_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_list_space_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_space_events_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_space_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_space_events parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_space_events ::Google::Apps::Chat::V1::ListSpaceEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_space_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_space_events(::Google::Apps::Chat::V1::ListSpaceEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_space_events_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Apps::Chat::V1::ChatService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb new file mode 100644 index 000000000000..dbf0d0e4fa9e --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb @@ -0,0 +1,1882 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/chat/v1/chat_service_pb" +require "google/chat/v1/chat_service_services_pb" +require "google/apps/chat/v1/chat_service" + +class ::Google::Apps::Chat::V1::ChatService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_message + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Message.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + message = {} + thread_key = "hello world" + request_id = "hello world" + message_reply_option = :MESSAGE_REPLY_OPTION_UNSPECIFIED + message_id = "hello world" + + create_message_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_message, name + assert_kind_of ::Google::Apps::Chat::V1::CreateMessageRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Message), request["message"] + assert_equal "hello world", request["thread_key"] + assert_equal "hello world", request["request_id"] + assert_equal :MESSAGE_REPLY_OPTION_UNSPECIFIED, request["message_reply_option"] + assert_equal "hello world", request["message_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_message({ parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_message parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_message ::Google::Apps::Chat::V1::CreateMessageRequest.new(parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_message({ parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_message(::Google::Apps::Chat::V1::CreateMessageRequest.new(parent: parent, message: message, thread_key: thread_key, request_id: request_id, message_reply_option: message_reply_option, message_id: message_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_message_client_stub.call_rpc_count + end + end + + def test_list_messages + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListMessagesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + show_deleted = true + + list_messages_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_messages, name + assert_kind_of ::Google::Apps::Chat::V1::ListMessagesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_messages_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_messages({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_messages parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_messages ::Google::Apps::Chat::V1::ListMessagesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_messages({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_messages(::Google::Apps::Chat::V1::ListMessagesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_messages_client_stub.call_rpc_count + end + end + + def test_list_memberships + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListMembershipsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + show_groups = true + show_invited = true + use_admin_access = true + + list_memberships_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_memberships, name + assert_kind_of ::Google::Apps::Chat::V1::ListMembershipsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal true, request["show_groups"] + assert_equal true, request["show_invited"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_memberships_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_memberships({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_memberships parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_memberships ::Google::Apps::Chat::V1::ListMembershipsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_memberships({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_memberships(::Google::Apps::Chat::V1::ListMembershipsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, show_groups: show_groups, show_invited: show_invited, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_memberships_client_stub.call_rpc_count + end + end + + def test_get_membership + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Membership.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + get_membership_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_membership, name + assert_kind_of ::Google::Apps::Chat::V1::GetMembershipRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_membership({ name: name, use_admin_access: use_admin_access }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_membership name: name, use_admin_access: use_admin_access do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_membership ::Google::Apps::Chat::V1::GetMembershipRequest.new(name: name, use_admin_access: use_admin_access) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_membership({ name: name, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_membership(::Google::Apps::Chat::V1::GetMembershipRequest.new(name: name, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_membership_client_stub.call_rpc_count + end + end + + def test_get_message + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Message.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_message_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_message, name + assert_kind_of ::Google::Apps::Chat::V1::GetMessageRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_message({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_message name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_message ::Google::Apps::Chat::V1::GetMessageRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_message({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_message(::Google::Apps::Chat::V1::GetMessageRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_message_client_stub.call_rpc_count + end + end + + def test_update_message + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Message.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + message = {} + update_mask = {} + allow_missing = true + + update_message_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_message, name + assert_kind_of ::Google::Apps::Chat::V1::UpdateMessageRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Message), request["message"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_message({ message: message, update_mask: update_mask, allow_missing: allow_missing }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_message message: message, update_mask: update_mask, allow_missing: allow_missing do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_message ::Google::Apps::Chat::V1::UpdateMessageRequest.new(message: message, update_mask: update_mask, allow_missing: allow_missing) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_message({ message: message, update_mask: update_mask, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_message(::Google::Apps::Chat::V1::UpdateMessageRequest.new(message: message, update_mask: update_mask, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_message_client_stub.call_rpc_count + end + end + + def test_delete_message + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + force = true + + delete_message_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_message, name + assert_kind_of ::Google::Apps::Chat::V1::DeleteMessageRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_message({ name: name, force: force }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_message name: name, force: force do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_message ::Google::Apps::Chat::V1::DeleteMessageRequest.new(name: name, force: force) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_message({ name: name, force: force }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_message(::Google::Apps::Chat::V1::DeleteMessageRequest.new(name: name, force: force), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_message_client_stub.call_rpc_count + end + end + + def test_get_attachment + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Attachment.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_attachment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_attachment, name + assert_kind_of ::Google::Apps::Chat::V1::GetAttachmentRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_attachment_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_attachment({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_attachment name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_attachment ::Google::Apps::Chat::V1::GetAttachmentRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_attachment({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_attachment(::Google::Apps::Chat::V1::GetAttachmentRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_attachment_client_stub.call_rpc_count + end + end + + def test_upload_attachment + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::UploadAttachmentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filename = "hello world" + + upload_attachment_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upload_attachment, name + assert_kind_of ::Google::Apps::Chat::V1::UploadAttachmentRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filename"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, upload_attachment_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upload_attachment({ parent: parent, filename: filename }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.upload_attachment parent: parent, filename: filename do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.upload_attachment ::Google::Apps::Chat::V1::UploadAttachmentRequest.new(parent: parent, filename: filename) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.upload_attachment({ parent: parent, filename: filename }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.upload_attachment(::Google::Apps::Chat::V1::UploadAttachmentRequest.new(parent: parent, filename: filename), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, upload_attachment_client_stub.call_rpc_count + end + end + + def test_list_spaces + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListSpacesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_spaces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_spaces, name + assert_kind_of ::Google::Apps::Chat::V1::ListSpacesRequest, request + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_spaces_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_spaces({ page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_spaces page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_spaces ::Google::Apps::Chat::V1::ListSpacesRequest.new(page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_spaces({ page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_spaces(::Google::Apps::Chat::V1::ListSpacesRequest.new(page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_spaces_client_stub.call_rpc_count + end + end + + def test_search_spaces + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::SearchSpacesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + use_admin_access = true + page_size = 42 + page_token = "hello world" + query = "hello world" + order_by = "hello world" + + search_spaces_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_spaces, name + assert_kind_of ::Google::Apps::Chat::V1::SearchSpacesRequest, request + assert_equal true, request["use_admin_access"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["query"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_spaces_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_spaces({ use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_spaces use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_spaces ::Google::Apps::Chat::V1::SearchSpacesRequest.new(use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_spaces({ use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_spaces(::Google::Apps::Chat::V1::SearchSpacesRequest.new(use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_spaces_client_stub.call_rpc_count + end + end + + def test_get_space + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Space.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + get_space_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_space, name + assert_kind_of ::Google::Apps::Chat::V1::GetSpaceRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_space({ name: name, use_admin_access: use_admin_access }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_space name: name, use_admin_access: use_admin_access do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_space ::Google::Apps::Chat::V1::GetSpaceRequest.new(name: name, use_admin_access: use_admin_access) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_space({ name: name, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_space(::Google::Apps::Chat::V1::GetSpaceRequest.new(name: name, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_space_client_stub.call_rpc_count + end + end + + def test_create_space + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Space.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + space = {} + request_id = "hello world" + + create_space_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_space, name + assert_kind_of ::Google::Apps::Chat::V1::CreateSpaceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Space), request["space"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_space({ space: space, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_space space: space, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_space ::Google::Apps::Chat::V1::CreateSpaceRequest.new(space: space, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_space({ space: space, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_space(::Google::Apps::Chat::V1::CreateSpaceRequest.new(space: space, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_space_client_stub.call_rpc_count + end + end + + def test_set_up_space + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Space.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + space = {} + request_id = "hello world" + memberships = [{}] + + set_up_space_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_up_space, name + assert_kind_of ::Google::Apps::Chat::V1::SetUpSpaceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Space), request["space"] + assert_equal "hello world", request["request_id"] + assert_kind_of ::Google::Apps::Chat::V1::Membership, request["memberships"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_up_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_up_space({ space: space, request_id: request_id, memberships: memberships }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_up_space space: space, request_id: request_id, memberships: memberships do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_up_space ::Google::Apps::Chat::V1::SetUpSpaceRequest.new(space: space, request_id: request_id, memberships: memberships) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_up_space({ space: space, request_id: request_id, memberships: memberships }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_up_space(::Google::Apps::Chat::V1::SetUpSpaceRequest.new(space: space, request_id: request_id, memberships: memberships), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_up_space_client_stub.call_rpc_count + end + end + + def test_update_space + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Space.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + space = {} + update_mask = {} + use_admin_access = true + + update_space_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_space, name + assert_kind_of ::Google::Apps::Chat::V1::UpdateSpaceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Space), request["space"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_space({ space: space, update_mask: update_mask, use_admin_access: use_admin_access }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_space space: space, update_mask: update_mask, use_admin_access: use_admin_access do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_space ::Google::Apps::Chat::V1::UpdateSpaceRequest.new(space: space, update_mask: update_mask, use_admin_access: use_admin_access) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_space({ space: space, update_mask: update_mask, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_space(::Google::Apps::Chat::V1::UpdateSpaceRequest.new(space: space, update_mask: update_mask, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_space_client_stub.call_rpc_count + end + end + + def test_delete_space + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + delete_space_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_space, name + assert_kind_of ::Google::Apps::Chat::V1::DeleteSpaceRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_space({ name: name, use_admin_access: use_admin_access }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_space name: name, use_admin_access: use_admin_access do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_space ::Google::Apps::Chat::V1::DeleteSpaceRequest.new(name: name, use_admin_access: use_admin_access) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_space({ name: name, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_space(::Google::Apps::Chat::V1::DeleteSpaceRequest.new(name: name, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_space_client_stub.call_rpc_count + end + end + + def test_complete_import_space + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::CompleteImportSpaceResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + complete_import_space_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :complete_import_space, name + assert_kind_of ::Google::Apps::Chat::V1::CompleteImportSpaceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, complete_import_space_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.complete_import_space({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.complete_import_space name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.complete_import_space ::Google::Apps::Chat::V1::CompleteImportSpaceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.complete_import_space({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.complete_import_space(::Google::Apps::Chat::V1::CompleteImportSpaceRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, complete_import_space_client_stub.call_rpc_count + end + end + + def test_find_direct_message + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Space.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + find_direct_message_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :find_direct_message, name + assert_kind_of ::Google::Apps::Chat::V1::FindDirectMessageRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, find_direct_message_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.find_direct_message({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.find_direct_message name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.find_direct_message ::Google::Apps::Chat::V1::FindDirectMessageRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.find_direct_message({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.find_direct_message(::Google::Apps::Chat::V1::FindDirectMessageRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, find_direct_message_client_stub.call_rpc_count + end + end + + def test_create_membership + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Membership.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + membership = {} + use_admin_access = true + + create_membership_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_membership, name + assert_kind_of ::Google::Apps::Chat::V1::CreateMembershipRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Membership), request["membership"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_membership({ parent: parent, membership: membership, use_admin_access: use_admin_access }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_membership parent: parent, membership: membership, use_admin_access: use_admin_access do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_membership ::Google::Apps::Chat::V1::CreateMembershipRequest.new(parent: parent, membership: membership, use_admin_access: use_admin_access) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_membership({ parent: parent, membership: membership, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_membership(::Google::Apps::Chat::V1::CreateMembershipRequest.new(parent: parent, membership: membership, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_membership_client_stub.call_rpc_count + end + end + + def test_update_membership + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Membership.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + membership = {} + update_mask = {} + use_admin_access = true + + update_membership_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_membership, name + assert_kind_of ::Google::Apps::Chat::V1::UpdateMembershipRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Membership), request["membership"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_membership({ membership: membership, update_mask: update_mask, use_admin_access: use_admin_access }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_membership membership: membership, update_mask: update_mask, use_admin_access: use_admin_access do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_membership ::Google::Apps::Chat::V1::UpdateMembershipRequest.new(membership: membership, update_mask: update_mask, use_admin_access: use_admin_access) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_membership({ membership: membership, update_mask: update_mask, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_membership(::Google::Apps::Chat::V1::UpdateMembershipRequest.new(membership: membership, update_mask: update_mask, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_membership_client_stub.call_rpc_count + end + end + + def test_delete_membership + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Membership.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + use_admin_access = true + + delete_membership_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_membership, name + assert_kind_of ::Google::Apps::Chat::V1::DeleteMembershipRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["use_admin_access"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_membership_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_membership({ name: name, use_admin_access: use_admin_access }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_membership name: name, use_admin_access: use_admin_access do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_membership ::Google::Apps::Chat::V1::DeleteMembershipRequest.new(name: name, use_admin_access: use_admin_access) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_membership({ name: name, use_admin_access: use_admin_access }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_membership(::Google::Apps::Chat::V1::DeleteMembershipRequest.new(name: name, use_admin_access: use_admin_access), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_membership_client_stub.call_rpc_count + end + end + + def test_create_reaction + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Reaction.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reaction = {} + + create_reaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_reaction, name + assert_kind_of ::Google::Apps::Chat::V1::CreateReactionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Reaction), request["reaction"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_reaction_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_reaction({ parent: parent, reaction: reaction }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_reaction parent: parent, reaction: reaction do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_reaction ::Google::Apps::Chat::V1::CreateReactionRequest.new(parent: parent, reaction: reaction) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_reaction({ parent: parent, reaction: reaction }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_reaction(::Google::Apps::Chat::V1::CreateReactionRequest.new(parent: parent, reaction: reaction), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_reaction_client_stub.call_rpc_count + end + end + + def test_list_reactions + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListReactionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_reactions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_reactions, name + assert_kind_of ::Google::Apps::Chat::V1::ListReactionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_reactions_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_reactions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_reactions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_reactions ::Google::Apps::Chat::V1::ListReactionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_reactions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_reactions(::Google::Apps::Chat::V1::ListReactionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_reactions_client_stub.call_rpc_count + end + end + + def test_delete_reaction + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_reaction_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_reaction, name + assert_kind_of ::Google::Apps::Chat::V1::DeleteReactionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_reaction_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_reaction({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_reaction name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_reaction ::Google::Apps::Chat::V1::DeleteReactionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_reaction({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_reaction(::Google::Apps::Chat::V1::DeleteReactionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_reaction_client_stub.call_rpc_count + end + end + + def test_get_space_read_state + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::SpaceReadState.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_space_read_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_space_read_state, name + assert_kind_of ::Google::Apps::Chat::V1::GetSpaceReadStateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_space_read_state_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_space_read_state({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_space_read_state name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_space_read_state ::Google::Apps::Chat::V1::GetSpaceReadStateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_space_read_state({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_space_read_state(::Google::Apps::Chat::V1::GetSpaceReadStateRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_space_read_state_client_stub.call_rpc_count + end + end + + def test_update_space_read_state + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::SpaceReadState.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + space_read_state = {} + update_mask = {} + + update_space_read_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_space_read_state, name + assert_kind_of ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::SpaceReadState), request["space_read_state"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_space_read_state_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_space_read_state({ space_read_state: space_read_state, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_space_read_state space_read_state: space_read_state, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_space_read_state ::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new(space_read_state: space_read_state, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_space_read_state({ space_read_state: space_read_state, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_space_read_state(::Google::Apps::Chat::V1::UpdateSpaceReadStateRequest.new(space_read_state: space_read_state, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_space_read_state_client_stub.call_rpc_count + end + end + + def test_get_thread_read_state + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ThreadReadState.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_thread_read_state_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_thread_read_state, name + assert_kind_of ::Google::Apps::Chat::V1::GetThreadReadStateRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_thread_read_state_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_thread_read_state({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_thread_read_state name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_thread_read_state ::Google::Apps::Chat::V1::GetThreadReadStateRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_thread_read_state({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_thread_read_state(::Google::Apps::Chat::V1::GetThreadReadStateRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_thread_read_state_client_stub.call_rpc_count + end + end + + def test_get_space_event + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::SpaceEvent.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_space_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_space_event, name + assert_kind_of ::Google::Apps::Chat::V1::GetSpaceEventRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_space_event_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_space_event({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_space_event name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_space_event ::Google::Apps::Chat::V1::GetSpaceEventRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_space_event({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_space_event(::Google::Apps::Chat::V1::GetSpaceEventRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_space_event_client_stub.call_rpc_count + end + end + + def test_list_space_events + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListSpaceEventsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_space_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_space_events, name + assert_kind_of ::Google::Apps::Chat::V1::ListSpaceEventsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_space_events_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_space_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_space_events parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_space_events ::Google::Apps::Chat::V1::ListSpaceEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_space_events({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_space_events(::Google::Apps::Chat::V1::ListSpaceEventsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_space_events_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Apps::Chat::V1::ChatService::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/test/helper.rb b/owl-bot-staging/google-apps-chat-v1/test/helper.rb new file mode 100644 index 000000000000..48407bca7edb --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 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 +# +# https://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. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct"