From f6bf9e8421db795ff5c5e8c6888b97b820842ed0 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 15 Apr 2026 21:02:30 +0000 Subject: [PATCH 1/2] feat: Addition of ChatService.FindGroupChats PiperOrigin-RevId: 900283522 Source-Link: https://github.com/googleapis/googleapis/commit/13ca8dbc797515144104ee799e429f8e29b45c08 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f3836ac185bfa0e18f7a82001ab817315c98000d Copy-Tag: eyJwIjoiZ29vZ2xlLWFwcHMtY2hhdC12MS8uT3dsQm90LnlhbWwiLCJoIjoiZjM4MzZhYzE4NWJmYTBlMThmN2E4MjAwMWFiODE3MzE1Yzk4MDAwZCJ9 --- .../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 | 14 + .../google-apps-chat-v1/LICENSE.md | 201 + owl-bot-staging/google-apps-chat-v1/README.md | 154 + owl-bot-staging/google-apps-chat-v1/Rakefile | 169 + .../google-apps-chat-v1/gapic_metadata.json | 233 + .../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 | 6551 +++++++++++++++++ .../apps/chat/v1/chat_service/credentials.rb | 80 + .../google/apps/chat/v1/chat_service/paths.rb | 289 + .../google/apps/chat/v1/chat_service/rest.rb | 53 + .../apps/chat/v1/chat_service/rest/client.rb | 6271 ++++++++++++++++ .../chat/v1/chat_service/rest/service_stub.rb | 2713 +++++++ .../lib/google/apps/chat/v1/rest.rb | 37 + .../lib/google/apps/chat/v1/version.rb | 28 + .../lib/google/chat/v1/action_status_pb.rb | 23 + .../lib/google/chat/v1/annotation_pb.rb | 41 + .../lib/google/chat/v1/attachment_pb.rb | 30 + .../lib/google/chat/v1/chat_service_pb.rb | 35 + .../chat/v1/chat_service_services_pb.rb | 1036 +++ .../lib/google/chat/v1/contextual_addon_pb.rb | 28 + .../google/chat/v1/deletion_metadata_pb.rb | 22 + .../lib/google/chat/v1/event_payload_pb.rb | 44 + .../lib/google/chat/v1/group_pb.rb | 21 + .../lib/google/chat/v1/history_state_pb.rb | 21 + .../lib/google/chat/v1/matched_url_pb.rb | 23 + .../lib/google/chat/v1/membership_pb.rb | 36 + .../lib/google/chat/v1/message_pb.rb | 58 + .../lib/google/chat/v1/reaction_pb.rb | 39 + .../lib/google/chat/v1/section_pb.rb | 39 + .../lib/google/chat/v1/slash_command_pb.rb | 21 + .../lib/google/chat/v1/space_event_pb.rb | 29 + .../chat/v1/space_notification_setting_pb.rb | 29 + .../lib/google/chat/v1/space_pb.rb | 51 + .../lib/google/chat/v1/space_read_state_pb.rb | 28 + .../lib/google/chat/v1/space_setup_pb.rb | 25 + .../google/chat/v1/thread_read_state_pb.rb | 26 + .../lib/google/chat/v1/user_pb.rb | 24 + .../lib/google/chat/v1/widgets_pb.rb | 32 + .../google-apps-chat-v1/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 ++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../proto_docs/google/apps/card/v1/card.rb | 2627 +++++++ .../google/chat/v1/action_status.rb | 40 + .../proto_docs/google/chat/v1/annotation.rb | 326 + .../proto_docs/google/chat/v1/attachment.rb | 137 + .../google/chat/v1/contextual_addon.rb | 120 + .../google/chat/v1/deletion_metadata.rb | 71 + .../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 | 444 ++ .../proto_docs/google/chat/v1/message.rb | 763 ++ .../proto_docs/google/chat/v1/reaction.rb | 322 + .../proto_docs/google/chat/v1/section.rb | 332 + .../google/chat/v1/slash_command.rb | 37 + .../proto_docs/google/chat/v1/space.rb | 912 +++ .../proto_docs/google/chat/v1/space_event.rb | 323 + .../chat/v1/space_notification_setting.rb | 114 + .../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 | 315 + .../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 | 148 + .../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_custom_emoji.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_section.rb | 47 + .../snippets/chat_service/create_space.rb | 47 + .../chat_service/delete_custom_emoji.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_section.rb | 47 + .../snippets/chat_service/delete_space.rb | 47 + .../chat_service/find_direct_message.rb | 47 + .../snippets/chat_service/find_group_chats.rb | 51 + .../snippets/chat_service/get_attachment.rb | 47 + .../snippets/chat_service/get_custom_emoji.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 + .../get_space_notification_setting.rb | 47 + .../chat_service/get_space_read_state.rb | 47 + .../chat_service/get_thread_read_state.rb | 47 + .../chat_service/list_custom_emojis.rb | 51 + .../snippets/chat_service/list_memberships.rb | 51 + .../snippets/chat_service/list_messages.rb | 51 + .../snippets/chat_service/list_reactions.rb | 51 + .../chat_service/list_section_items.rb | 51 + .../snippets/chat_service/list_sections.rb | 51 + .../chat_service/list_space_events.rb | 51 + .../snippets/chat_service/list_spaces.rb | 51 + .../chat_service/move_section_item.rb | 47 + .../snippets/chat_service/position_section.rb | 47 + .../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_section.rb | 47 + .../snippets/chat_service/update_space.rb | 47 + .../update_space_notification_setting.rb | 47 + .../chat_service/update_space_read_state.rb | 47 + .../chat_service/upload_attachment.rb | 47 + .../snippet_metadata_google.chat.v1.json | 1735 +++++ .../apps/chat/v1/chat_service_paths_test.rb | 223 + .../apps/chat/v1/chat_service_rest_test.rb | 2483 +++++++ .../google/apps/chat/v1/chat_service_test.rb | 2773 +++++++ .../google-apps-chat-v1/test/helper.rb | 26 + 133 files changed, 37914 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/section_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_notification_setting_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/field_info.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/section.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_notification_setting.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_custom_emoji.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_section.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_custom_emoji.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_section.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/find_group_chats.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_custom_emoji.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_notification_setting.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_custom_emojis.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_section_items.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.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/move_section_item.rb create mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.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_section.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_notification_setting.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..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 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..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +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..56d94db2f142 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/README.md @@ -0,0 +1,154 @@ +# 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. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/apps/chat/v1" +require "logger" + +client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.logger = Logger.new "my-app.log" +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 3.0+. + +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..77dcccc3c544 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 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..d87e86a2906f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/gapic_metadata.json @@ -0,0 +1,233 @@ +{ + "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" + ] + }, + "FindGroupChats": { + "methods": [ + "find_group_chats" + ] + }, + "CreateMembership": { + "methods": [ + "create_membership" + ] + }, + "UpdateMembership": { + "methods": [ + "update_membership" + ] + }, + "DeleteMembership": { + "methods": [ + "delete_membership" + ] + }, + "CreateReaction": { + "methods": [ + "create_reaction" + ] + }, + "ListReactions": { + "methods": [ + "list_reactions" + ] + }, + "DeleteReaction": { + "methods": [ + "delete_reaction" + ] + }, + "CreateCustomEmoji": { + "methods": [ + "create_custom_emoji" + ] + }, + "GetCustomEmoji": { + "methods": [ + "get_custom_emoji" + ] + }, + "ListCustomEmojis": { + "methods": [ + "list_custom_emojis" + ] + }, + "DeleteCustomEmoji": { + "methods": [ + "delete_custom_emoji" + ] + }, + "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" + ] + }, + "GetSpaceNotificationSetting": { + "methods": [ + "get_space_notification_setting" + ] + }, + "UpdateSpaceNotificationSetting": { + "methods": [ + "update_space_notification_setting" + ] + }, + "CreateSection": { + "methods": [ + "create_section" + ] + }, + "DeleteSection": { + "methods": [ + "delete_section" + ] + }, + "UpdateSection": { + "methods": [ + "update_section" + ] + }, + "ListSections": { + "methods": [ + "list_sections" + ] + }, + "PositionSection": { + "methods": [ + "position_section" + ] + }, + "ListSectionItems": { + "methods": [ + "list_section_items" + ] + }, + "MoveSectionItem": { + "methods": [ + "move_section_item" + ] + } + } + } + } + } + } +} 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..79a093c4a2a3 --- /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 = ">= 3.2" + + gem.add_dependency "gapic-common", "~> 1.2" + 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..c3af8b700d88 --- /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 2026 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..c17754be5398 --- /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 2026 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..44f628376b77 --- /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 2026 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..f6231a110192 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb @@ -0,0 +1,6551 @@ +# frozen_string_literal: true + +# Copyright 2026 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.find_group_chats.timeout = 30.0 + default_config.rpcs.find_group_chats.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.create_custom_emoji.timeout = 30.0 + default_config.rpcs.create_custom_emoji.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_custom_emoji.timeout = 30.0 + default_config.rpcs.get_custom_emoji.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_custom_emojis.timeout = 30.0 + default_config.rpcs.list_custom_emojis.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_custom_emoji.timeout = 30.0 + default_config.rpcs.delete_custom_emoji.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.rpcs.get_space_notification_setting.timeout = 30.0 + default_config.rpcs.get_space_notification_setting.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_space_notification_setting.timeout = 30.0 + default_config.rpcs.update_space_notification_setting.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_section.timeout = 30.0 + default_config.rpcs.create_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_section.timeout = 30.0 + default_config.rpcs.delete_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_section.timeout = 30.0 + default_config.rpcs.update_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_sections.timeout = 30.0 + default_config.rpcs.list_sections.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.position_section.timeout = 30.0 + default_config.rpcs.position_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_section_items.timeout = 30.0 + default_config.rpcs.list_section_items.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.move_section_item.timeout = 30.0 + default_config.rpcs.move_section_item.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, + logger: @config.logger + ) + + @chat_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @chat_service_stub.logger + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.create` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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. + # + # For + # [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) + # requests, the response doesn't contain the full message. The response only + # populates the `name` and `thread.name` fields in addition to the + # information that was in the request. + # + # @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. + # + # When [responding to user + # interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), + # this field is ignored. For interactions within a thread, the reply is + # created in the same thread. Otherwise, the reply is created as a new + # thread. + # @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? + 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. System messages, like those + # announcing new space members, aren't included. 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When + # using this authentication scope, this method only returns public + # messages in a space. It doesn't include private messages. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # @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] + # Optional. 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. 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] + # Optional. 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. 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] + # Optional. 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? + throw :response, 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.memberships` (requires + # [administrator approval](https://support.google.com/a?p=chat-app-auth)) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # @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] + # Optional. 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? + throw :response, 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.memberships` (requires + # [administrator approval](https://support.google.com/a?p=chat-app-auth)) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # @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` + # + # 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] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot`: When using this + # authorization scope, this method returns details about a message the + # Chat app has access to, like direct messages and [slash + # commands](https://developers.google.com/workspace/chat/slash-commands) + # that invoke the Chat app. + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth). + # When using this authentication scope, + # this method returns details about a public message in a space. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # + # 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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).) + # + # - `quoted_message_metadata` (Only allows removal of the quoted message.) + # @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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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] + # Optional. 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? + 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) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.bot` + # + # @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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.create` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + # + # 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # + # 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? + throw :response, 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. In the request, set `use_admin_access` to `true`. + # For an example, see [Search for and manage + # spaces](https://developers.google.com/workspace/chat/search-manage-admin). + # + # Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) + # and one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # @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? + throw :response, 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # App authentication has the following limitations: + # + # - `space.access_settings` is only populated when using the + # `chat.app.spaces` scope. + # - `space.predefind_permission_settings` and `space.permission_settings` are + # only populated when using the `chat.app.spaces` scope, and only for + # spaces the app created. + # + # @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] + # Optional. 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? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a space. Can be used to create a named space, or a + # group chat in `Import mode`. For an example, see [Create a + # space](https://developers.google.com/workspace/chat/create-spaces). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces.create` + # - `https://www.googleapis.com/auth/chat.app.spaces` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.create` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # When authenticating as an app, the `space.customer` field must be set in + # the request. + # + # When authenticating as an app, the Chat app is added as a member of the + # space. However, unlike human authentication, the Chat app is not added as a + # space manager. By default, the Chat app can be removed from the space by + # all space members. To allow only space managers to remove the app from a + # space, set `space.permission_settings.manage_apps` to `managers_allowed`. + # + # Space membership upon creation depends on whether the space is created in + # `Import mode`: + # + # * **Import mode:** No members are created. + # * **All other modes:** The calling user is added as a member. This is: + # * The app itself when using app authentication. + # * The human user when using user authentication. + # + # 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. + # + # @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` and `SpaceType.GROUP_CHAT` are supported. + # `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. + # + # 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. + # + # + # 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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.spaces.create` + # - `https://www.googleapis.com/auth/chat.spaces` + # + # @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 49 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? + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # App authentication has the following limitations: + # + # - To update either `space.predefined_permission_settings` or + # `space.permission_settings`, the app must be the space creator. + # - Updating the `space.access_settings.audience` is not supported for app + # authentication. + # + # @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 and guidelines. You must + # pass both description and guidelines in the update request as + # {::Google::Apps::Chat::V1::Space::SpaceDetails `SpaceDetails`}. If you only want to + # update one of the fields, pass the existing value for the other field. + # + # `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. + # 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] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) and the + # authorization scope: + # - `https://www.googleapis.com/auth/chat.app.delete` (only in + # spaces the app created) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.delete` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.delete` + # + # @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] + # Optional. 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? + 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 [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # and domain-wide delegation with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.import` + # + # 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? + 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 [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. + # + # 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # + # @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? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all spaces with `spaceType == GROUP_CHAT`, whose + # human memberships contain exactly the calling user, and the users specified + # in `FindGroupChatsRequest.users`. Only members that have joined the + # conversation are supported. For an example, see [Find group + # chats](https://developers.google.com/workspace/chat/find-group-chats). + # + # If the calling user blocks, or is blocked by, some users, and no spaces + # with the entire specified set of users are found, this method returns + # spaces that don't include the blocked or blocking users. + # + # The specified set of users must contain only human (non-app) memberships. + # A request that contains non-human users doesn't return any spaces. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # @overload find_group_chats(request, options = nil) + # Pass arguments to `find_group_chats` via a request object, either of type + # {::Google::Apps::Chat::V1::FindGroupChatsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::FindGroupChatsRequest, ::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_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil) + # Pass arguments to `find_group_chats` 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 users [::Array<::String>] + # Optional. Resource names of all human users in group chat with the calling + # user. Chat apps can't be included in the request. + # + # The maximum number of users that can be specified in a single request is + # `49`. + # + # 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, to find all group chats with the calling + # user and two other users, with People API profile IDs `123456789` and + # `987654321`, you can use `users/123456789` and `users/987654321`. + # You can also 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. + # @param page_size [::Integer] + # Optional. The maximum number of spaces to return. The service might return + # fewer than this value. + # + # If unspecified, at most 10 spaces are returned. + # + # The maximum value is 30. If you use a value more than 30, it's + # automatically changed to 30. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous call to find group chats. + # Provide this parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the token. Passing different values may lead to unexpected + # results. + # @param space_view [::Google::Apps::Chat::V1::SpaceView] + # Requested space view type. If unset, defaults to + # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify + # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, + # for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + # + # @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::FindGroupChatsRequest.new + # + # # Call the find_group_chats method. + # result = client.find_group_chats 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 find_group_chats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindGroupChatsRequest + + # 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_group_chats.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_group_chats.timeout, + metadata: metadata, + retry_policy: @config.rpcs.find_group_chats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :find_group_chats, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :find_group_chats, request, response, operation, options + yield response, operation if block_given? + throw :response, 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.memberships.app` (to add the + # calling app to the space) + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # App authentication is not supported for the following use cases: + # + # - Inviting users external to the Workspace organization that owns the + # space. + # - Adding a Google Group to a space. + # - Adding a Chat app to a space. + # + # 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 + # certain authorization scopes and set specific values for certain fields: + # + # - When [authenticating as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the `chat.memberships` authorization scope is required. + # + # - When [authenticating as an + # app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + # the `chat.app.memberships` authorization scope is required. + # + # - 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`. + # + # Inviting users external to the Workspace organization that owns the space + # requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # When a Chat app creates a membership relation for itself, it must + # [authenticate as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set + # `user.name` to `users/app`. + # @param use_admin_access [::Boolean] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) and the + # authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` (only in + # spaces the app created) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # @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] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.memberships.app` (to remove + # the calling app from the space) + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # App authentication is not supported for the following use cases: + # + # - Removing a Google Group from a space. + # - Removing a Chat app from a space. + # + # To delete memberships for space managers, the requester + # must be a space manager. If you're using [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # the Chat app must be the space creator. + # + # @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 + # with [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # or the `chat.memberships.app` scope with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and the `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] + # Optional. 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? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a reaction and adds it to a message. 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions.create` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + # + # @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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # + # @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 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? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reaction to a message. 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + # + # @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? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a custom emoji. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload create_custom_emoji(request, options = nil) + # Pass arguments to `create_custom_emoji` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateCustomEmojiRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateCustomEmojiRequest, ::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_custom_emoji(custom_emoji: nil) + # Pass arguments to `create_custom_emoji` 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 custom_emoji [::Google::Apps::Chat::V1::CustomEmoji, ::Hash] + # Required. The custom emoji to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::CustomEmoji] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # + # @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::CreateCustomEmojiRequest.new + # + # # Call the create_custom_emoji method. + # result = client.create_custom_emoji request + # + # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. + # p result + # + def create_custom_emoji request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateCustomEmojiRequest + + # 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_custom_emoji.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_custom_emoji.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_custom_emoji.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :create_custom_emoji, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a custom emoji. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis.readonly` + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload get_custom_emoji(request, options = nil) + # Pass arguments to `get_custom_emoji` via a request object, either of type + # {::Google::Apps::Chat::V1::GetCustomEmojiRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetCustomEmojiRequest, ::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_custom_emoji(name: nil) + # Pass arguments to `get_custom_emoji` 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 custom emoji. + # + # Format: `customEmojis/{customEmoji}` + # + # You can use the emoji name as an alias for `{customEmoji}`. For example, + # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name + # for a custom emoji. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::CustomEmoji] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # + # @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::GetCustomEmojiRequest.new + # + # # Call the get_custom_emoji method. + # result = client.get_custom_emoji request + # + # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. + # p result + # + def get_custom_emoji request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetCustomEmojiRequest + + # 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_custom_emoji.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_custom_emoji.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_custom_emoji.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_custom_emoji, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists custom emojis visible to the authenticated user. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis.readonly` + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload list_custom_emojis(request, options = nil) + # Pass arguments to `list_custom_emojis` via a request object, either of type + # {::Google::Apps::Chat::V1::ListCustomEmojisRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListCustomEmojisRequest, ::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_custom_emojis(page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_custom_emojis` 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 custom emojis returned. The service can + # return fewer custom emojis than this value. If unspecified, the default + # value is 25. The maximum value is 200; values above 200 are changed to 200. + # @param page_token [::String] + # Optional. (If resuming from a previous query.) + # + # A page token received from a previous list custom emoji call. Provide this + # to retrieve the subsequent page. + # + # When paginating, the filter value should match the call that provided the + # page token. Passing a different value might lead to unexpected results. + # @param filter [::String] + # Optional. A query filter. + # + # Supports filtering by creator. + # + # To filter by creator, you must specify a valid value. Currently only + # `creator("users/me")` and `NOT creator("users/me")` are accepted to filter + # custom emojis by whether they were created by the calling user or not. + # + # For example, the following query returns custom emojis created by the + # caller: + # ``` + # creator("users/me") + # ``` + # + # Invalid queries are rejected with an `INVALID_ARGUMENT` error. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] + # + # @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::ListCustomEmojisRequest.new + # + # # Call the list_custom_emojis method. + # result = client.list_custom_emojis 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::CustomEmoji. + # p item + # end + # + def list_custom_emojis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListCustomEmojisRequest + + # 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_custom_emojis.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_custom_emojis.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_custom_emojis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_custom_emojis, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_custom_emojis, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a custom emoji. By default, users can only delete custom emoji they + # created. [Emoji managers](https://support.google.com/a/answer/12850085) + # assigned by the administrator can delete any custom emoji in the + # organization. See [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149). + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload delete_custom_emoji(request, options = nil) + # Pass arguments to `delete_custom_emoji` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteCustomEmojiRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, ::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_custom_emoji(name: nil) + # Pass arguments to `delete_custom_emoji` 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 custom emoji to delete. + # + # Format: `customEmojis/{customEmoji}` + # + # You can use the emoji name as an alias for `{customEmoji}`. For example, + # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name + # for a custom emoji. + # + # @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::DeleteCustomEmojiRequest.new + # + # # Call the delete_custom_emoji method. + # result = client.delete_custom_emoji request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_custom_emoji request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest + + # 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_custom_emoji.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_custom_emoji.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_custom_emoji.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :delete_custom_emoji, request, options: options do |response, operation| + yield response, operation if block_given? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + # - `https://www.googleapis.com/auth/chat.users.readstate` + # + # @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? + 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) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate` + # + # @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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + # - `https://www.googleapis.com/auth/chat.users.readstate` + # + # @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? + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + # with an + # [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + # appropriate for reading the requested data: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # - `https://www.googleapis.com/auth/chat.app.memberships` + # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # To get an event, the authenticated caller 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? + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + # with an + # [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + # appropriate for reading the requested data: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # - `https://www.googleapis.com/auth/chat.app.memberships` + # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # To list events, the authenticated caller 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] + # Optional. 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? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the space notification setting. For an example, see [Get the + # caller's space notification + # setting](https://developers.google.com/workspace/chat/get-space-notification-setting). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.spacesettings` + # + # @overload get_space_notification_setting(request, options = nil) + # Pass arguments to `get_space_notification_setting` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, ::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_notification_setting(name: nil) + # Pass arguments to `get_space_notification_setting` 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. Format: users/\\{user}/spaces/\\{space}/spaceNotificationSetting + # + # - `users/me/spaces/{space}/spaceNotificationSetting`, OR + # - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR + # - `users/123456789/spaces/{space}/spaceNotificationSetting`. + # Note: Only the caller's user id or email is allowed in the path. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # + # @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::GetSpaceNotificationSettingRequest.new + # + # # Call the get_space_notification_setting method. + # result = client.get_space_notification_setting request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. + # p result + # + def get_space_notification_setting request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest + + # 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_notification_setting.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_notification_setting.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_space_notification_setting.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :get_space_notification_setting, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the space notification setting. For an example, see [Update + # the caller's space notification + # setting](https://developers.google.com/workspace/chat/update-space-notification-setting). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.spacesettings` + # + # @overload update_space_notification_setting(request, options = nil) + # Pass arguments to `update_space_notification_setting` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, ::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_notification_setting(space_notification_setting: nil, update_mask: nil) + # Pass arguments to `update_space_notification_setting` 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_notification_setting [::Google::Apps::Chat::V1::SpaceNotificationSetting, ::Hash] + # Required. The resource name for the space notification settings must be + # populated in the form of + # `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields + # specified by `update_mask` are updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Supported field paths: + # + # - `notification_setting` + # + # - `mute_setting` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # + # @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::UpdateSpaceNotificationSettingRequest.new + # + # # Call the update_space_notification_setting method. + # result = client.update_space_notification_setting request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. + # p result + # + def update_space_notification_setting request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest + + # 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_notification_setting.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_notification_setting&.name + header_params["space_notification_setting.name"] = request.space_notification_setting.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_notification_setting.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_space_notification_setting.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :update_space_notification_setting, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a section in Google Chat. Sections help users group conversations + # and customize the list of spaces displayed in Chat navigation panel. Only + # sections of type `CUSTOM_SECTION` can be created. For details, see [Create + # and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload create_section(request, options = nil) + # Pass arguments to `create_section` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateSectionRequest, ::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_section(parent: nil, section: nil) + # Pass arguments to `create_section` 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 parent resource name where the section is created. + # + # Format: `users/{user}` + # @param section [::Google::Apps::Chat::V1::Section, ::Hash] + # Required. The section to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Section] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Section] + # + # @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::CreateSectionRequest.new + # + # # Call the create_section method. + # result = client.create_section request + # + # # The returned object is of type Google::Apps::Chat::V1::Section. + # p result + # + def create_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSectionRequest + + # 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_section.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_section.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :create_section, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a section of type `CUSTOM_SECTION`. + # + # If the section contains items, such as spaces, the items are moved to + # Google Chat's default sections and are not deleted. + # + # For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload delete_section(request, options = nil) + # Pass arguments to `delete_section` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteSectionRequest, ::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_section(name: nil) + # Pass arguments to `delete_section` 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 name of the section to delete. + # + # Format: `users/{user}/sections/{section}` + # + # @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::DeleteSectionRequest.new + # + # # Call the delete_section method. + # result = client.delete_section request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSectionRequest + + # 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_section.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_section.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :delete_section, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a section. Only sections of type `CUSTOM_SECTION` can be updated. + # For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload update_section(request, options = nil) + # Pass arguments to `update_section` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSectionRequest, ::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_section(section: nil, update_mask: nil) + # Pass arguments to `update_section` 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 section [::Google::Apps::Chat::V1::Section, ::Hash] + # Required. The section to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to specify which fields to update. + # + # Currently supported field paths: + # + # - `display_name` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::Section] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::Section] + # + # @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::UpdateSectionRequest.new + # + # # Call the update_section method. + # result = client.update_section request + # + # # The returned object is of type Google::Apps::Chat::V1::Section. + # p result + # + def update_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSectionRequest + + # 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_section.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.section&.name + header_params["section.name"] = request.section.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_section.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :update_section, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists sections available to the Chat user. Sections help users group their + # conversations and customize the list of spaces displayed in Chat + # navigation panel. For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # - `https://www.googleapis.com/auth/chat.users.sections.readonly` + # + # @overload list_sections(request, options = nil) + # Pass arguments to `list_sections` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSectionsRequest, ::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_sections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_sections` 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 parent, which is the user resource name that owns this + # collection of sections. Only supports listing sections for the calling + # user. To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me`. + # + # - Their Workspace email address. For example, `users/user@example.com`. + # + # - Their user id. For example, `users/123456789`. + # + # Format: `users/{user}` + # @param page_size [::Integer] + # Optional. The maximum number of sections to return. The service may return + # fewer than this value. + # + # If unspecified, at most 10 sections will be returned. + # + # The maximum value is 100. If you use a value more than 100, it's + # automatically changed to 100. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous list sections call. + # Provide this 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. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Section>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Section>] + # + # @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::ListSectionsRequest.new + # + # # Call the list_sections method. + # result = client.list_sections 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::Section. + # p item + # end + # + def list_sections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionsRequest + + # 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_sections.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_sections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_sections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_sections, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Changes the sort order of a section. For details, see [Create and organize + # sections in Google Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload position_section(request, options = nil) + # Pass arguments to `position_section` via a request object, either of type + # {::Google::Apps::Chat::V1::PositionSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::PositionSectionRequest, ::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 position_section(name: nil, sort_order: nil, relative_position: nil) + # Pass arguments to `position_section` 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 section to position. + # + # Format: `users/{user}/sections/{section}` + # @param sort_order [::Integer] + # Optional. The absolute position of the section in the list of sections. + # The position must be greater than 0. If the position is greater than the + # number of sections, the section will be appended to the end of the list. + # This operation inserts the section at the given position and shifts the + # original section at that position, and those below it, to the next + # position. + # + # Note: The following parameters are mutually exclusive: `sort_order`, `relative_position`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param relative_position [::Google::Apps::Chat::V1::PositionSectionRequest::Position] + # Optional. The relative position of the section in the list of sections. + # + # Note: The following parameters are mutually exclusive: `relative_position`, `sort_order`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::PositionSectionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::PositionSectionResponse] + # + # @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::PositionSectionRequest.new + # + # # Call the position_section method. + # result = client.position_section request + # + # # The returned object is of type Google::Apps::Chat::V1::PositionSectionResponse. + # p result + # + def position_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::PositionSectionRequest + + # 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.position_section.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.position_section.timeout, + metadata: metadata, + retry_policy: @config.rpcs.position_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :position_section, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists items in a section. + # + # Only spaces can be section items. For details, see [Create and organize + # sections in Google Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # - `https://www.googleapis.com/auth/chat.users.sections.readonly` + # + # @overload list_section_items(request, options = nil) + # Pass arguments to `list_section_items` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSectionItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSectionItemsRequest, ::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_section_items(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_section_items` 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 parent, which is the section resource name that owns this + # collection of section items. Only supports listing section items for the + # calling user. + # + # When you're filtering by space, use the wildcard `-` to search across all + # sections. For example, `users/{user}/sections/-`. + # + # Format: `users/{user}/sections/{section}` + # @param page_size [::Integer] + # Optional. The maximum number of section items to return. The service may + # return fewer than this value. + # + # If unspecified, at most 10 section items will be returned. + # + # The maximum value is 100. If you use a value more than 100, it's + # automatically changed to 100. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous list section items call. + # Provide this 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. + # + # Currently only supports filtering by space. + # + # For example, `space = spaces/{space}`. + # + # Invalid queries are rejected with an `INVALID_ARGUMENT` error. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>] + # + # @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::ListSectionItemsRequest.new + # + # # Call the list_section_items method. + # result = client.list_section_items 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::SectionItem. + # p item + # end + # + def list_section_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionItemsRequest + + # 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_section_items.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_section_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_section_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :list_section_items, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_section_items, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Moves an item from one section to another. For example, if a section + # contains spaces, this method can be used to move a space to a different + # section. For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload move_section_item(request, options = nil) + # Pass arguments to `move_section_item` via a request object, either of type + # {::Google::Apps::Chat::V1::MoveSectionItemRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::MoveSectionItemRequest, ::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 move_section_item(name: nil, target_section: nil) + # Pass arguments to `move_section_item` 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 section item to move. + # + # Format: `users/{user}/sections/{section}/items/{item}` + # @param target_section [::String] + # Required. The resource name of the section to move the section item to. + # + # Format: `users/{user}/sections/{section}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Apps::Chat::V1::MoveSectionItemResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Apps::Chat::V1::MoveSectionItemResponse] + # + # @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::MoveSectionItemRequest.new + # + # # Call the move_section_item method. + # result = client.move_section_item request + # + # # The returned object is of type Google::Apps::Chat::V1::MoveSectionItemResponse. + # p result + # + def move_section_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MoveSectionItemRequest + + # 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.move_section_item.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.move_section_item.timeout, + metadata: metadata, + retry_policy: @config.rpcs.move_section_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :move_section_item, request, options: options do |response, operation| + yield response, operation if block_given? + 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: + # * (`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 + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,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, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + 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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 `find_group_chats` + # @return [::Gapic::Config::Method] + # + attr_reader :find_group_chats + ## + # 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 `create_custom_emoji` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_emoji + ## + # RPC-specific configuration for `get_custom_emoji` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_emoji + ## + # RPC-specific configuration for `list_custom_emojis` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_emojis + ## + # RPC-specific configuration for `delete_custom_emoji` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_emoji + ## + # 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 + ## + # RPC-specific configuration for `get_space_notification_setting` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space_notification_setting + ## + # RPC-specific configuration for `update_space_notification_setting` + # @return [::Gapic::Config::Method] + # + attr_reader :update_space_notification_setting + ## + # RPC-specific configuration for `create_section` + # @return [::Gapic::Config::Method] + # + attr_reader :create_section + ## + # RPC-specific configuration for `delete_section` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_section + ## + # RPC-specific configuration for `update_section` + # @return [::Gapic::Config::Method] + # + attr_reader :update_section + ## + # RPC-specific configuration for `list_sections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sections + ## + # RPC-specific configuration for `position_section` + # @return [::Gapic::Config::Method] + # + attr_reader :position_section + ## + # RPC-specific configuration for `list_section_items` + # @return [::Gapic::Config::Method] + # + attr_reader :list_section_items + ## + # RPC-specific configuration for `move_section_item` + # @return [::Gapic::Config::Method] + # + attr_reader :move_section_item + + # @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 + find_group_chats_config = parent_rpcs.find_group_chats if parent_rpcs.respond_to? :find_group_chats + @find_group_chats = ::Gapic::Config::Method.new find_group_chats_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 + create_custom_emoji_config = parent_rpcs.create_custom_emoji if parent_rpcs.respond_to? :create_custom_emoji + @create_custom_emoji = ::Gapic::Config::Method.new create_custom_emoji_config + get_custom_emoji_config = parent_rpcs.get_custom_emoji if parent_rpcs.respond_to? :get_custom_emoji + @get_custom_emoji = ::Gapic::Config::Method.new get_custom_emoji_config + list_custom_emojis_config = parent_rpcs.list_custom_emojis if parent_rpcs.respond_to? :list_custom_emojis + @list_custom_emojis = ::Gapic::Config::Method.new list_custom_emojis_config + delete_custom_emoji_config = parent_rpcs.delete_custom_emoji if parent_rpcs.respond_to? :delete_custom_emoji + @delete_custom_emoji = ::Gapic::Config::Method.new delete_custom_emoji_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 + get_space_notification_setting_config = parent_rpcs.get_space_notification_setting if parent_rpcs.respond_to? :get_space_notification_setting + @get_space_notification_setting = ::Gapic::Config::Method.new get_space_notification_setting_config + update_space_notification_setting_config = parent_rpcs.update_space_notification_setting if parent_rpcs.respond_to? :update_space_notification_setting + @update_space_notification_setting = ::Gapic::Config::Method.new update_space_notification_setting_config + create_section_config = parent_rpcs.create_section if parent_rpcs.respond_to? :create_section + @create_section = ::Gapic::Config::Method.new create_section_config + delete_section_config = parent_rpcs.delete_section if parent_rpcs.respond_to? :delete_section + @delete_section = ::Gapic::Config::Method.new delete_section_config + update_section_config = parent_rpcs.update_section if parent_rpcs.respond_to? :update_section + @update_section = ::Gapic::Config::Method.new update_section_config + list_sections_config = parent_rpcs.list_sections if parent_rpcs.respond_to? :list_sections + @list_sections = ::Gapic::Config::Method.new list_sections_config + position_section_config = parent_rpcs.position_section if parent_rpcs.respond_to? :position_section + @position_section = ::Gapic::Config::Method.new position_section_config + list_section_items_config = parent_rpcs.list_section_items if parent_rpcs.respond_to? :list_section_items + @list_section_items = ::Gapic::Config::Method.new list_section_items_config + move_section_item_config = parent_rpcs.move_section_item if parent_rpcs.respond_to? :move_section_item + @move_section_item = ::Gapic::Config::Method.new move_section_item_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..f04afafd650b --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/credentials.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# Copyright 2026 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.app.delete", + "https://www.googleapis.com/auth/chat.app.memberships", + "https://www.googleapis.com/auth/chat.app.memberships.readonly", + "https://www.googleapis.com/auth/chat.app.messages.readonly", + "https://www.googleapis.com/auth/chat.app.spaces", + "https://www.googleapis.com/auth/chat.app.spaces.create", + "https://www.googleapis.com/auth/chat.app.spaces.readonly", + "https://www.googleapis.com/auth/chat.bot", + "https://www.googleapis.com/auth/chat.customemojis", + "https://www.googleapis.com/auth/chat.customemojis.readonly", + "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", + "https://www.googleapis.com/auth/chat.users.sections", + "https://www.googleapis.com/auth/chat.users.sections.readonly", + "https://www.googleapis.com/auth/chat.users.spacesettings" + ] + 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..876923a4f9cd --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/paths.rb @@ -0,0 +1,289 @@ +# frozen_string_literal: true + +# Copyright 2026 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 CustomEmoji resource string. + # + # The resource will be in the following format: + # + # `customEmojis/{custom_emoji}` + # + # @param custom_emoji [String] + # + # @return [::String] + def custom_emoji_path custom_emoji: + "customEmojis/#{custom_emoji}" + 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 Section resource string. + # + # The resource will be in the following format: + # + # `users/{user}/sections/{section}` + # + # @param user [String] + # @param section [String] + # + # @return [::String] + def section_path user:, section: + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "users/#{user}/sections/#{section}" + end + + ## + # Create a fully-qualified SectionItem resource string. + # + # The resource will be in the following format: + # + # `users/{user}/sections/{section}/items/{item}` + # + # @param user [String] + # @param section [String] + # @param item [String] + # + # @return [::String] + def section_item_path user:, section:, item: + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + raise ::ArgumentError, "section cannot contain /" if section.to_s.include? "/" + + "users/#{user}/sections/#{section}/items/#{item}" + 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 SpaceNotificationSetting resource string. + # + # The resource will be in the following format: + # + # `users/{user}/spaces/{space}/spaceNotificationSetting` + # + # @param user [String] + # @param space [String] + # + # @return [::String] + def space_notification_setting_path user:, space: + raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" + + "users/#{user}/spaces/#{space}/spaceNotificationSetting" + 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 + + ## + # Create a fully-qualified User resource string. + # + # The resource will be in the following format: + # + # `users/{user}` + # + # @param user [String] + # + # @return [::String] + def user_path user: + "users/#{user}" + 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..42875c8b7f5c --- /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 2026 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..e3e72d3038bd --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb @@ -0,0 +1,6271 @@ +# frozen_string_literal: true + +# Copyright 2026 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.find_group_chats.timeout = 30.0 + default_config.rpcs.find_group_chats.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.create_custom_emoji.timeout = 30.0 + default_config.rpcs.create_custom_emoji.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_custom_emoji.timeout = 30.0 + default_config.rpcs.get_custom_emoji.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_custom_emojis.timeout = 30.0 + default_config.rpcs.list_custom_emojis.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_custom_emoji.timeout = 30.0 + default_config.rpcs.delete_custom_emoji.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.rpcs.get_space_notification_setting.timeout = 30.0 + default_config.rpcs.get_space_notification_setting.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_space_notification_setting.timeout = 30.0 + default_config.rpcs.update_space_notification_setting.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_section.timeout = 30.0 + default_config.rpcs.create_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_section.timeout = 30.0 + default_config.rpcs.delete_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_section.timeout = 30.0 + default_config.rpcs.update_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_sections.timeout = 30.0 + default_config.rpcs.list_sections.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.position_section.timeout = 30.0 + default_config.rpcs.position_section.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_section_items.timeout = 30.0 + default_config.rpcs.list_section_items.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.move_section_item.timeout = 30.0 + default_config.rpcs.move_section_item.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, + logger: @config.logger + ) + + @chat_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @chat_service_stub.logger + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.create` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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. + # + # For + # [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) + # requests, the response doesn't contain the full message. The response only + # populates the `name` and `thread.name` fields in addition to the + # information that was in the request. + # + # @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. + # + # When [responding to user + # interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), + # this field is ignored. For interactions within a thread, the reply is + # created in the same thread. Otherwise, the reply is created as a new + # thread. + # @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? + 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. System messages, like those + # announcing new space members, aren't included. 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When + # using this authentication scope, this method only returns public + # messages in a space. It doesn't include private messages. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # @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] + # Optional. 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. 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] + # Optional. 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. 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] + # Optional. 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? + throw :response, 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.memberships` (requires + # [administrator approval](https://support.google.com/a?p=chat-app-auth)) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # @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] + # Optional. 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? + throw :response, 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.memberships` (requires + # [administrator approval](https://support.google.com/a?p=chat-app-auth)) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # @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` + # + # 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] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot`: When using this + # authorization scope, this method returns details about a message the + # Chat app has access to, like direct messages and [slash + # commands](https://developers.google.com/workspace/chat/slash-commands) + # that invoke the Chat app. + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth). + # When using this authentication scope, + # this method returns details about a public message in a space. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # + # 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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).) + # + # - `quoted_message_metadata` (Only allows removal of the quoted message.) + # @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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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] + # Optional. 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? + 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) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.bot` + # + # @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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.create` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + # + # 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # + # 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? + throw :response, 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. In the request, set `use_admin_access` to `true`. + # For an example, see [Search for and manage + # spaces](https://developers.google.com/workspace/chat/search-manage-admin). + # + # Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) + # and one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # @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? + throw :response, 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # App authentication has the following limitations: + # + # - `space.access_settings` is only populated when using the + # `chat.app.spaces` scope. + # - `space.predefind_permission_settings` and `space.permission_settings` are + # only populated when using the `chat.app.spaces` scope, and only for + # spaces the app created. + # + # @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] + # Optional. 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? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a space. Can be used to create a named space, or a + # group chat in `Import mode`. For an example, see [Create a + # space](https://developers.google.com/workspace/chat/create-spaces). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces.create` + # - `https://www.googleapis.com/auth/chat.app.spaces` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.create` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # When authenticating as an app, the `space.customer` field must be set in + # the request. + # + # When authenticating as an app, the Chat app is added as a member of the + # space. However, unlike human authentication, the Chat app is not added as a + # space manager. By default, the Chat app can be removed from the space by + # all space members. To allow only space managers to remove the app from a + # space, set `space.permission_settings.manage_apps` to `managers_allowed`. + # + # Space membership upon creation depends on whether the space is created in + # `Import mode`: + # + # * **Import mode:** No members are created. + # * **All other modes:** The calling user is added as a member. This is: + # * The app itself when using app authentication. + # * The human user when using user authentication. + # + # 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. + # + # @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` and `SpaceType.GROUP_CHAT` are supported. + # `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. + # + # 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. + # + # + # 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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.spaces.create` + # - `https://www.googleapis.com/auth/chat.spaces` + # + # @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 49 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? + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # App authentication has the following limitations: + # + # - To update either `space.predefined_permission_settings` or + # `space.permission_settings`, the app must be the space creator. + # - Updating the `space.access_settings.audience` is not supported for app + # authentication. + # + # @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 and guidelines. You must + # pass both description and guidelines in the update request as + # {::Google::Apps::Chat::V1::Space::SpaceDetails `SpaceDetails`}. If you only want to + # update one of the fields, pass the existing value for the other field. + # + # `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. + # 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] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) and the + # authorization scope: + # - `https://www.googleapis.com/auth/chat.app.delete` (only in + # spaces the app created) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.delete` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.delete` + # + # @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] + # Optional. 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? + 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 [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # and domain-wide delegation with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.import` + # + # 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? + 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 [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. + # + # 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # + # @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? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all spaces with `spaceType == GROUP_CHAT`, whose + # human memberships contain exactly the calling user, and the users specified + # in `FindGroupChatsRequest.users`. Only members that have joined the + # conversation are supported. For an example, see [Find group + # chats](https://developers.google.com/workspace/chat/find-group-chats). + # + # If the calling user blocks, or is blocked by, some users, and no spaces + # with the entire specified set of users are found, this method returns + # spaces that don't include the blocked or blocking users. + # + # The specified set of users must contain only human (non-app) memberships. + # A request that contains non-human users doesn't return any spaces. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # @overload find_group_chats(request, options = nil) + # Pass arguments to `find_group_chats` via a request object, either of type + # {::Google::Apps::Chat::V1::FindGroupChatsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::FindGroupChatsRequest, ::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_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil) + # Pass arguments to `find_group_chats` 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 users [::Array<::String>] + # Optional. Resource names of all human users in group chat with the calling + # user. Chat apps can't be included in the request. + # + # The maximum number of users that can be specified in a single request is + # `49`. + # + # 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, to find all group chats with the calling + # user and two other users, with People API profile IDs `123456789` and + # `987654321`, you can use `users/123456789` and `users/987654321`. + # You can also 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. + # @param page_size [::Integer] + # Optional. The maximum number of spaces to return. The service might return + # fewer than this value. + # + # If unspecified, at most 10 spaces are returned. + # + # The maximum value is 30. If you use a value more than 30, it's + # automatically changed to 30. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous call to find group chats. + # Provide this parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the token. Passing different values may lead to unexpected + # results. + # @param space_view [::Google::Apps::Chat::V1::SpaceView] + # Requested space view type. If unset, defaults to + # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify + # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, + # for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + # @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::FindGroupChatsRequest.new + # + # # Call the find_group_chats method. + # result = client.find_group_chats 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 find_group_chats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindGroupChatsRequest + + # 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_group_chats.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_group_chats.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.find_group_chats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.find_group_chats request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :find_group_chats, "spaces", request, result, options + yield result, operation if block_given? + throw :response, 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.memberships.app` (to add the + # calling app to the space) + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # App authentication is not supported for the following use cases: + # + # - Inviting users external to the Workspace organization that owns the + # space. + # - Adding a Google Group to a space. + # - Adding a Chat app to a space. + # + # 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 + # certain authorization scopes and set specific values for certain fields: + # + # - When [authenticating as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the `chat.memberships` authorization scope is required. + # + # - When [authenticating as an + # app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + # the `chat.app.memberships` authorization scope is required. + # + # - 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`. + # + # Inviting users external to the Workspace organization that owns the space + # requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # When a Chat app creates a membership relation for itself, it must + # [authenticate as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set + # `user.name` to `users/app`. + # @param use_admin_access [::Boolean] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) and the + # authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` (only in + # spaces the app created) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # @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] + # Optional. 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? + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.memberships.app` (to remove + # the calling app from the space) + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # App authentication is not supported for the following use cases: + # + # - Removing a Google Group from a space. + # - Removing a Chat app from a space. + # + # To delete memberships for space managers, the requester + # must be a space manager. If you're using [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # the Chat app must be the space creator. + # + # @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 + # with [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # or the `chat.memberships.app` scope with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and the `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] + # Optional. 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? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a reaction and adds it to a message. 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions.create` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + # + # @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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # + # @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 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? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a reaction to a message. 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + # + # @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? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a custom emoji. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload create_custom_emoji(request, options = nil) + # Pass arguments to `create_custom_emoji` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateCustomEmojiRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateCustomEmojiRequest, ::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_custom_emoji(custom_emoji: nil) + # Pass arguments to `create_custom_emoji` 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 custom_emoji [::Google::Apps::Chat::V1::CustomEmoji, ::Hash] + # Required. The custom emoji to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::CustomEmoji] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # + # @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::CreateCustomEmojiRequest.new + # + # # Call the create_custom_emoji method. + # result = client.create_custom_emoji request + # + # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. + # p result + # + def create_custom_emoji request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateCustomEmojiRequest + + # 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_custom_emoji.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_custom_emoji.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_custom_emoji.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.create_custom_emoji request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns details about a custom emoji. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis.readonly` + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload get_custom_emoji(request, options = nil) + # Pass arguments to `get_custom_emoji` via a request object, either of type + # {::Google::Apps::Chat::V1::GetCustomEmojiRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetCustomEmojiRequest, ::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_custom_emoji(name: nil) + # Pass arguments to `get_custom_emoji` 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 custom emoji. + # + # Format: `customEmojis/{customEmoji}` + # + # You can use the emoji name as an alias for `{customEmoji}`. For example, + # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name + # for a custom emoji. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::CustomEmoji] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # + # @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::GetCustomEmojiRequest.new + # + # # Call the get_custom_emoji method. + # result = client.get_custom_emoji request + # + # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. + # p result + # + def get_custom_emoji request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetCustomEmojiRequest + + # 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_custom_emoji.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_custom_emoji.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_custom_emoji.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_custom_emoji request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists custom emojis visible to the authenticated user. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis.readonly` + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload list_custom_emojis(request, options = nil) + # Pass arguments to `list_custom_emojis` via a request object, either of type + # {::Google::Apps::Chat::V1::ListCustomEmojisRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListCustomEmojisRequest, ::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_custom_emojis(page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_custom_emojis` 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 custom emojis returned. The service can + # return fewer custom emojis than this value. If unspecified, the default + # value is 25. The maximum value is 200; values above 200 are changed to 200. + # @param page_token [::String] + # Optional. (If resuming from a previous query.) + # + # A page token received from a previous list custom emoji call. Provide this + # to retrieve the subsequent page. + # + # When paginating, the filter value should match the call that provided the + # page token. Passing a different value might lead to unexpected results. + # @param filter [::String] + # Optional. A query filter. + # + # Supports filtering by creator. + # + # To filter by creator, you must specify a valid value. Currently only + # `creator("users/me")` and `NOT creator("users/me")` are accepted to filter + # custom emojis by whether they were created by the calling user or not. + # + # For example, the following query returns custom emojis created by the + # caller: + # ``` + # creator("users/me") + # ``` + # + # Invalid queries are rejected with an `INVALID_ARGUMENT` error. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] + # + # @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::ListCustomEmojisRequest.new + # + # # Call the list_custom_emojis method. + # result = client.list_custom_emojis 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::CustomEmoji. + # p item + # end + # + def list_custom_emojis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListCustomEmojisRequest + + # 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_custom_emojis.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_custom_emojis.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_custom_emojis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_custom_emojis request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_custom_emojis, "custom_emojis", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a custom emoji. By default, users can only delete custom emoji they + # created. [Emoji managers](https://support.google.com/a/answer/12850085) + # assigned by the administrator can delete any custom emoji in the + # organization. See [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149). + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis` + # + # @overload delete_custom_emoji(request, options = nil) + # Pass arguments to `delete_custom_emoji` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteCustomEmojiRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, ::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_custom_emoji(name: nil) + # Pass arguments to `delete_custom_emoji` 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 custom emoji to delete. + # + # Format: `customEmojis/{customEmoji}` + # + # You can use the emoji name as an alias for `{customEmoji}`. For example, + # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name + # for a custom emoji. + # @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::DeleteCustomEmojiRequest.new + # + # # Call the delete_custom_emoji method. + # result = client.delete_custom_emoji request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_custom_emoji request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest + + # 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_custom_emoji.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_custom_emoji.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_custom_emoji.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.delete_custom_emoji request, options do |result, operation| + yield result, operation if block_given? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + # - `https://www.googleapis.com/auth/chat.users.readstate` + # + # @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? + 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) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate` + # + # @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? + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + # - `https://www.googleapis.com/auth/chat.users.readstate` + # + # @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? + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + # with an + # [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + # appropriate for reading the requested data: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # - `https://www.googleapis.com/auth/chat.app.memberships` + # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # To get an event, the authenticated caller 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? + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + # with an + # [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + # appropriate for reading the requested data: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # - `https://www.googleapis.com/auth/chat.app.memberships` + # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # To list events, the authenticated caller 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] + # Optional. 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? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the space notification setting. For an example, see [Get the + # caller's space notification + # setting](https://developers.google.com/workspace/chat/get-space-notification-setting). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.spacesettings` + # + # @overload get_space_notification_setting(request, options = nil) + # Pass arguments to `get_space_notification_setting` via a request object, either of type + # {::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, ::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_notification_setting(name: nil) + # Pass arguments to `get_space_notification_setting` 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. Format: users/\\{user}/spaces/\\{space}/spaceNotificationSetting + # + # - `users/me/spaces/{space}/spaceNotificationSetting`, OR + # - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR + # - `users/123456789/spaces/{space}/spaceNotificationSetting`. + # Note: Only the caller's user id or email is allowed in the path. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # + # @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::GetSpaceNotificationSettingRequest.new + # + # # Call the get_space_notification_setting method. + # result = client.get_space_notification_setting request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. + # p result + # + def get_space_notification_setting request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest + + # 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_notification_setting.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_notification_setting.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_space_notification_setting.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.get_space_notification_setting request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the space notification setting. For an example, see [Update + # the caller's space notification + # setting](https://developers.google.com/workspace/chat/update-space-notification-setting). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.spacesettings` + # + # @overload update_space_notification_setting(request, options = nil) + # Pass arguments to `update_space_notification_setting` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, ::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_notification_setting(space_notification_setting: nil, update_mask: nil) + # Pass arguments to `update_space_notification_setting` 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_notification_setting [::Google::Apps::Chat::V1::SpaceNotificationSetting, ::Hash] + # Required. The resource name for the space notification settings must be + # populated in the form of + # `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields + # specified by `update_mask` are updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Supported field paths: + # + # - `notification_setting` + # + # - `mute_setting` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # + # @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::UpdateSpaceNotificationSettingRequest.new + # + # # Call the update_space_notification_setting method. + # result = client.update_space_notification_setting request + # + # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. + # p result + # + def update_space_notification_setting request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest + + # 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_notification_setting.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_notification_setting.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_space_notification_setting.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.update_space_notification_setting request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a section in Google Chat. Sections help users group conversations + # and customize the list of spaces displayed in Chat navigation panel. Only + # sections of type `CUSTOM_SECTION` can be created. For details, see [Create + # and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload create_section(request, options = nil) + # Pass arguments to `create_section` via a request object, either of type + # {::Google::Apps::Chat::V1::CreateSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::CreateSectionRequest, ::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_section(parent: nil, section: nil) + # Pass arguments to `create_section` 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 parent resource name where the section is created. + # + # Format: `users/{user}` + # @param section [::Google::Apps::Chat::V1::Section, ::Hash] + # Required. The section to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Section] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Section] + # + # @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::CreateSectionRequest.new + # + # # Call the create_section method. + # result = client.create_section request + # + # # The returned object is of type Google::Apps::Chat::V1::Section. + # p result + # + def create_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSectionRequest + + # 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_section.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_section.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.create_section request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a section of type `CUSTOM_SECTION`. + # + # If the section contains items, such as spaces, the items are moved to + # Google Chat's default sections and are not deleted. + # + # For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload delete_section(request, options = nil) + # Pass arguments to `delete_section` via a request object, either of type + # {::Google::Apps::Chat::V1::DeleteSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::DeleteSectionRequest, ::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_section(name: nil) + # Pass arguments to `delete_section` 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 name of the section to delete. + # + # Format: `users/{user}/sections/{section}` + # @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::DeleteSectionRequest.new + # + # # Call the delete_section method. + # result = client.delete_section request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSectionRequest + + # 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_section.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_section.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.delete_section request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a section. Only sections of type `CUSTOM_SECTION` can be updated. + # For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload update_section(request, options = nil) + # Pass arguments to `update_section` via a request object, either of type + # {::Google::Apps::Chat::V1::UpdateSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::UpdateSectionRequest, ::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_section(section: nil, update_mask: nil) + # Pass arguments to `update_section` 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 section [::Google::Apps::Chat::V1::Section, ::Hash] + # Required. The section to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The mask to specify which fields to update. + # + # Currently supported field paths: + # + # - `display_name` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::Section] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Section] + # + # @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::UpdateSectionRequest.new + # + # # Call the update_section method. + # result = client.update_section request + # + # # The returned object is of type Google::Apps::Chat::V1::Section. + # p result + # + def update_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSectionRequest + + # 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_section.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_section.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.update_section request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists sections available to the Chat user. Sections help users group their + # conversations and customize the list of spaces displayed in Chat + # navigation panel. For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # - `https://www.googleapis.com/auth/chat.users.sections.readonly` + # + # @overload list_sections(request, options = nil) + # Pass arguments to `list_sections` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSectionsRequest, ::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_sections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_sections` 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 parent, which is the user resource name that owns this + # collection of sections. Only supports listing sections for the calling + # user. To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me`. + # + # - Their Workspace email address. For example, `users/user@example.com`. + # + # - Their user id. For example, `users/123456789`. + # + # Format: `users/{user}` + # @param page_size [::Integer] + # Optional. The maximum number of sections to return. The service may return + # fewer than this value. + # + # If unspecified, at most 10 sections will be returned. + # + # The maximum value is 100. If you use a value more than 100, it's + # automatically changed to 100. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous list sections call. + # Provide this 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. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Section>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Section>] + # + # @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::ListSectionsRequest.new + # + # # Call the list_sections method. + # result = client.list_sections 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::Section. + # p item + # end + # + def list_sections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionsRequest + + # 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_sections.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_sections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_sections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_sections, "sections", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Changes the sort order of a section. For details, see [Create and organize + # sections in Google Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload position_section(request, options = nil) + # Pass arguments to `position_section` via a request object, either of type + # {::Google::Apps::Chat::V1::PositionSectionRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::PositionSectionRequest, ::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 position_section(name: nil, sort_order: nil, relative_position: nil) + # Pass arguments to `position_section` 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 section to position. + # + # Format: `users/{user}/sections/{section}` + # @param sort_order [::Integer] + # Optional. The absolute position of the section in the list of sections. + # The position must be greater than 0. If the position is greater than the + # number of sections, the section will be appended to the end of the list. + # This operation inserts the section at the given position and shifts the + # original section at that position, and those below it, to the next + # position. + # + # Note: The following parameters are mutually exclusive: `sort_order`, `relative_position`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @param relative_position [::Google::Apps::Chat::V1::PositionSectionRequest::Position] + # Optional. The relative position of the section in the list of sections. + # + # Note: The following parameters are mutually exclusive: `relative_position`, `sort_order`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::PositionSectionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::PositionSectionResponse] + # + # @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::PositionSectionRequest.new + # + # # Call the position_section method. + # result = client.position_section request + # + # # The returned object is of type Google::Apps::Chat::V1::PositionSectionResponse. + # p result + # + def position_section request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::PositionSectionRequest + + # 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.position_section.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.position_section.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.position_section.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.position_section request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists items in a section. + # + # Only spaces can be section items. For details, see [Create and organize + # sections in Google Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # - `https://www.googleapis.com/auth/chat.users.sections.readonly` + # + # @overload list_section_items(request, options = nil) + # Pass arguments to `list_section_items` via a request object, either of type + # {::Google::Apps::Chat::V1::ListSectionItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::ListSectionItemsRequest, ::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_section_items(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_section_items` 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 parent, which is the section resource name that owns this + # collection of section items. Only supports listing section items for the + # calling user. + # + # When you're filtering by space, use the wildcard `-` to search across all + # sections. For example, `users/{user}/sections/-`. + # + # Format: `users/{user}/sections/{section}` + # @param page_size [::Integer] + # Optional. The maximum number of section items to return. The service may + # return fewer than this value. + # + # If unspecified, at most 10 section items will be returned. + # + # The maximum value is 100. If you use a value more than 100, it's + # automatically changed to 100. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous list section items call. + # Provide this 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. + # + # Currently only supports filtering by space. + # + # For example, `space = spaces/{space}`. + # + # Invalid queries are rejected 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::SectionItem>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>] + # + # @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::ListSectionItemsRequest.new + # + # # Call the list_section_items method. + # result = client.list_section_items 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::SectionItem. + # p item + # end + # + def list_section_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionItemsRequest + + # 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_section_items.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_section_items.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_section_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.list_section_items request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_section_items, "section_items", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Moves an item from one section to another. For example, if a section + # contains spaces, this method can be used to move a space to a different + # section. For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # + # @overload move_section_item(request, options = nil) + # Pass arguments to `move_section_item` via a request object, either of type + # {::Google::Apps::Chat::V1::MoveSectionItemRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::MoveSectionItemRequest, ::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 move_section_item(name: nil, target_section: nil) + # Pass arguments to `move_section_item` 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 section item to move. + # + # Format: `users/{user}/sections/{section}/items/{item}` + # @param target_section [::String] + # Required. The resource name of the section to move the section item to. + # + # Format: `users/{user}/sections/{section}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::MoveSectionItemResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::MoveSectionItemResponse] + # + # @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::MoveSectionItemRequest.new + # + # # Call the move_section_item method. + # result = client.move_section_item request + # + # # The returned object is of type Google::Apps::Chat::V1::MoveSectionItemResponse. + # p result + # + def move_section_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MoveSectionItemRequest + + # 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.move_section_item.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.move_section_item.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.move_section_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.move_section_item request, options do |result, operation| + yield result, operation if block_given? + 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 + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,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, ::Google::Auth::BaseClient, ::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 + config_attr :logger, :default, ::Logger, nil, :default + + # @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 `find_group_chats` + # @return [::Gapic::Config::Method] + # + attr_reader :find_group_chats + ## + # 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 `create_custom_emoji` + # @return [::Gapic::Config::Method] + # + attr_reader :create_custom_emoji + ## + # RPC-specific configuration for `get_custom_emoji` + # @return [::Gapic::Config::Method] + # + attr_reader :get_custom_emoji + ## + # RPC-specific configuration for `list_custom_emojis` + # @return [::Gapic::Config::Method] + # + attr_reader :list_custom_emojis + ## + # RPC-specific configuration for `delete_custom_emoji` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_custom_emoji + ## + # 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 + ## + # RPC-specific configuration for `get_space_notification_setting` + # @return [::Gapic::Config::Method] + # + attr_reader :get_space_notification_setting + ## + # RPC-specific configuration for `update_space_notification_setting` + # @return [::Gapic::Config::Method] + # + attr_reader :update_space_notification_setting + ## + # RPC-specific configuration for `create_section` + # @return [::Gapic::Config::Method] + # + attr_reader :create_section + ## + # RPC-specific configuration for `delete_section` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_section + ## + # RPC-specific configuration for `update_section` + # @return [::Gapic::Config::Method] + # + attr_reader :update_section + ## + # RPC-specific configuration for `list_sections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sections + ## + # RPC-specific configuration for `position_section` + # @return [::Gapic::Config::Method] + # + attr_reader :position_section + ## + # RPC-specific configuration for `list_section_items` + # @return [::Gapic::Config::Method] + # + attr_reader :list_section_items + ## + # RPC-specific configuration for `move_section_item` + # @return [::Gapic::Config::Method] + # + attr_reader :move_section_item + + # @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 + find_group_chats_config = parent_rpcs.find_group_chats if parent_rpcs.respond_to? :find_group_chats + @find_group_chats = ::Gapic::Config::Method.new find_group_chats_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 + create_custom_emoji_config = parent_rpcs.create_custom_emoji if parent_rpcs.respond_to? :create_custom_emoji + @create_custom_emoji = ::Gapic::Config::Method.new create_custom_emoji_config + get_custom_emoji_config = parent_rpcs.get_custom_emoji if parent_rpcs.respond_to? :get_custom_emoji + @get_custom_emoji = ::Gapic::Config::Method.new get_custom_emoji_config + list_custom_emojis_config = parent_rpcs.list_custom_emojis if parent_rpcs.respond_to? :list_custom_emojis + @list_custom_emojis = ::Gapic::Config::Method.new list_custom_emojis_config + delete_custom_emoji_config = parent_rpcs.delete_custom_emoji if parent_rpcs.respond_to? :delete_custom_emoji + @delete_custom_emoji = ::Gapic::Config::Method.new delete_custom_emoji_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 + get_space_notification_setting_config = parent_rpcs.get_space_notification_setting if parent_rpcs.respond_to? :get_space_notification_setting + @get_space_notification_setting = ::Gapic::Config::Method.new get_space_notification_setting_config + update_space_notification_setting_config = parent_rpcs.update_space_notification_setting if parent_rpcs.respond_to? :update_space_notification_setting + @update_space_notification_setting = ::Gapic::Config::Method.new update_space_notification_setting_config + create_section_config = parent_rpcs.create_section if parent_rpcs.respond_to? :create_section + @create_section = ::Gapic::Config::Method.new create_section_config + delete_section_config = parent_rpcs.delete_section if parent_rpcs.respond_to? :delete_section + @delete_section = ::Gapic::Config::Method.new delete_section_config + update_section_config = parent_rpcs.update_section if parent_rpcs.respond_to? :update_section + @update_section = ::Gapic::Config::Method.new update_section_config + list_sections_config = parent_rpcs.list_sections if parent_rpcs.respond_to? :list_sections + @list_sections = ::Gapic::Config::Method.new list_sections_config + position_section_config = parent_rpcs.position_section if parent_rpcs.respond_to? :position_section + @position_section = ::Gapic::Config::Method.new position_section_config + list_section_items_config = parent_rpcs.list_section_items if parent_rpcs.respond_to? :list_section_items + @list_section_items = ::Gapic::Config::Method.new list_section_items_config + move_section_item_config = parent_rpcs.move_section_item if parent_rpcs.respond_to? :move_section_item + @move_section_item = ::Gapic::Config::Method.new move_section_item_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..fc36cab4d69c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb @@ -0,0 +1,2713 @@ +# frozen_string_literal: true + +# Copyright 2026 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 + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # 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, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + 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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + 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, + method_name: "create_message", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "list_messages", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListMessagesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "list_memberships", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListMembershipsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_membership", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_message", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "update_message", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_message", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_attachment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Attachment.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "upload_attachment", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::UploadAttachmentResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "list_spaces", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListSpacesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "search_spaces", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SearchSpacesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_space", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "create_space", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "set_up_space", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "update_space", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_space", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "complete_import_space", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::CompleteImportSpaceResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "find_direct_message", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the find_group_chats REST call + # + # @param request_pb [::Google::Apps::Chat::V1::FindGroupChatsRequest] + # 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::FindGroupChatsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::FindGroupChatsResponse] + # A result object deserialized from the server's reply + def find_group_chats request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_find_group_chats_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, + method_name: "find_group_chats", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::FindGroupChatsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "create_membership", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "update_membership", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_membership", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "create_reaction", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Reaction.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "list_reactions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListReactionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "delete_reaction", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_custom_emoji REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateCustomEmojiRequest] + # 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::CustomEmoji] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # A result object deserialized from the server's reply + def create_custom_emoji request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_emoji_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, + method_name: "create_custom_emoji", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::CustomEmoji.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_custom_emoji REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetCustomEmojiRequest] + # 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::CustomEmoji] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # A result object deserialized from the server's reply + def get_custom_emoji request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_emoji_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, + method_name: "get_custom_emoji", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::CustomEmoji.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_custom_emojis REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListCustomEmojisRequest] + # 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::ListCustomEmojisResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListCustomEmojisResponse] + # A result object deserialized from the server's reply + def list_custom_emojis request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_emojis_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, + method_name: "list_custom_emojis", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListCustomEmojisResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_custom_emoji REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest] + # 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_custom_emoji request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_emoji_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, + method_name: "delete_custom_emoji", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_space_read_state", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceReadState.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "update_space_read_state", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceReadState.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_thread_read_state", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ThreadReadState.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "get_space_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceEvent.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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, + method_name: "list_space_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListSpaceEventsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_space_notification_setting REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest] + # 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::SpaceNotificationSetting] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # A result object deserialized from the server's reply + def get_space_notification_setting request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_space_notification_setting_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, + method_name: "get_space_notification_setting", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_space_notification_setting REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest] + # 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::SpaceNotificationSetting] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # A result object deserialized from the server's reply + def update_space_notification_setting request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_space_notification_setting_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, + method_name: "update_space_notification_setting", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateSectionRequest] + # 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::Section] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Section] + # A result object deserialized from the server's reply + def create_section request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_section_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, + method_name: "create_section", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Section.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteSectionRequest] + # 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_section request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_section_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, + method_name: "delete_section", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSectionRequest] + # 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::Section] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::Section] + # A result object deserialized from the server's reply + def update_section request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_section_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, + method_name: "update_section", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::Section.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_sections REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSectionsRequest] + # 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::ListSectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListSectionsResponse] + # A result object deserialized from the server's reply + def list_sections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sections_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, + method_name: "list_sections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListSectionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the position_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::PositionSectionRequest] + # 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::PositionSectionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::PositionSectionResponse] + # A result object deserialized from the server's reply + def position_section request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_position_section_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, + method_name: "position_section", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::PositionSectionResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_section_items REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSectionItemsRequest] + # 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::ListSectionItemsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::ListSectionItemsResponse] + # A result object deserialized from the server's reply + def list_section_items request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_section_items_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, + method_name: "list_section_items", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::ListSectionItemsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the move_section_item REST call + # + # @param request_pb [::Google::Apps::Chat::V1::MoveSectionItemRequest] + # 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::MoveSectionItemResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::MoveSectionItemResponse] + # A result object deserialized from the server's reply + def move_section_item request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_move_section_item_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, + method_name: "move_section_item", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::MoveSectionItemResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + 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 find_group_chats REST call + # + # @param request_pb [::Google::Apps::Chat::V1::FindGroupChatsRequest] + # 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_group_chats_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/spaces:findGroupChats", + 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 create_custom_emoji REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateCustomEmojiRequest] + # 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_custom_emoji_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/customEmojis", + body: "custom_emoji", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_custom_emoji REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetCustomEmojiRequest] + # 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_custom_emoji_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^customEmojis/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_custom_emojis REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListCustomEmojisRequest] + # 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_custom_emojis_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/customEmojis", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_custom_emoji REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest] + # 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_custom_emoji_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^customEmojis/[^/]+/?$}, 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 + + ## + # @private + # + # GRPC transcoding helper method for the get_space_notification_setting REST call + # + # @param request_pb [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest] + # 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_notification_setting_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^users/[^/]+/spaces/[^/]+/spaceNotificationSetting/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_space_notification_setting REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest] + # 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_notification_setting_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{space_notification_setting.name}", + body: "space_notification_setting", + matches: [ + ["space_notification_setting.name", %r{^users/[^/]+/spaces/[^/]+/spaceNotificationSetting/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::CreateSectionRequest] + # 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_section_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sections", + body: "section", + matches: [ + ["parent", %r{^users/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::DeleteSectionRequest] + # 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_section_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^users/[^/]+/sections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::UpdateSectionRequest] + # 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_section_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{section.name}", + body: "section", + matches: [ + ["section.name", %r{^users/[^/]+/sections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_sections REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSectionsRequest] + # 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_sections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sections", + matches: [ + ["parent", %r{^users/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the position_section REST call + # + # @param request_pb [::Google::Apps::Chat::V1::PositionSectionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_position_section_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:position", + body: "*", + matches: [ + ["name", %r{^users/[^/]+/sections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_section_items REST call + # + # @param request_pb [::Google::Apps::Chat::V1::ListSectionItemsRequest] + # 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_section_items_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/items", + matches: [ + ["parent", %r{^users/[^/]+/sections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the move_section_item REST call + # + # @param request_pb [::Google::Apps::Chat::V1::MoveSectionItemRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_move_section_item_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:move", + body: "*", + matches: [ + ["name", %r{^users/[^/]+/sections/[^/]+/items/[^/]+/?$}, 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..e3deec0e2410 --- /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 2026 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..b4d215efd2ab --- /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 2026 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..e13370de297c --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/action_status_pb.rb @@ -0,0 +1,23 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..65ce1f494723 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/annotation_pb.rb @@ -0,0 +1,41 @@ +# 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/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/chat/v1/attachment_pb' +require 'google/chat/v1/reaction_pb' +require 'google/chat/v1/user_pb' + + +descriptor_data = "\n\x1fgoogle/chat/v1/annotation.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/chat/v1/attachment.proto\x1a\x1dgoogle/chat/v1/reaction.proto\x1a\x19google/chat/v1/user.proto\"\x82\x03\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\x12\x44\n\x15\x63ustom_emoji_metadata\x18\x07 \x01(\x0b\x32#.google.chat.v1.CustomEmojiMetadataH\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\"\x81\x04\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\x12\x41\n\x14meet_space_link_data\x18\x05 \x01(\x0b\x32!.google.chat.v1.MeetSpaceLinkDataH\x00\x12I\n\x18\x63\x61lendar_event_link_data\x18\x06 \x01(\x0b\x32%.google.chat.v1.CalendarEventLinkDataH\x00\"\x85\x01\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\x12\x11\n\rGMAIL_MESSAGE\x10\x03\x12\x0e\n\nMEET_SPACE\x10\x04\x12\x12\n\x0e\x43\x41LENDAR_EVENT\x10\x05\x42\x06\n\x04\x64\x61ta\"H\n\x13\x43ustomEmojiMetadata\x12\x31\n\x0c\x63ustom_emoji\x18\x01 \x01(\x0b\x32\x1b.google.chat.v1.CustomEmoji\"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\"\xb8\x02\n\x11MeetSpaceLinkData\x12\x14\n\x0cmeeting_code\x18\x01 \x01(\t\x12\x34\n\x04type\x18\x02 \x01(\x0e\x32&.google.chat.v1.MeetSpaceLinkData.Type\x12M\n\rhuddle_status\x18\x03 \x01(\x0e\x32..google.chat.v1.MeetSpaceLinkData.HuddleStatusB\x06\xe0\x41\x01\xe0\x41\x03\"5\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MEETING\x10\x01\x12\n\n\x06HUDDLE\x10\x02\"Q\n\x0cHuddleStatus\x12\x1d\n\x19HUDDLE_STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07STARTED\x10\x01\x12\t\n\x05\x45NDED\x10\x02\x12\n\n\x06MISSED\x10\x03\">\n\x15\x43\x61lendarEventLinkData\x12\x13\n\x0b\x63\x61lendar_id\x18\x01 \x01(\t\x12\x10\n\x08\x65vent_id\x18\x02 \x01(\t*w\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\x12\x10\n\x0c\x43USTOM_EMOJI\x10\x04\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 +pool.add_serialized_file(descriptor_data) + +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 + CustomEmojiMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CustomEmojiMetadata").msgclass + DriveLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DriveLinkData").msgclass + ChatSpaceLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ChatSpaceLinkData").msgclass + MeetSpaceLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MeetSpaceLinkData").msgclass + MeetSpaceLinkData::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MeetSpaceLinkData.Type").enummodule + MeetSpaceLinkData::HuddleStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MeetSpaceLinkData.HuddleStatus").enummodule + CalendarEventLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CalendarEventLinkData").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..36de37f2f088 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/attachment_pb.rb @@ -0,0 +1,30 @@ +# 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\"\xfd\x03\n\nAttachment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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\x45\n\x13\x61ttachment_data_ref\x18\x04 \x01(\x0b\x32!.google.chat.v1.AttachmentDataRefB\x03\xe0\x41\x01H\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\"U\n\x11\x41ttachmentDataRef\x12\x1a\n\rresource_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61ttachment_upload_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"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 +pool.add_serialized_file(descriptor_data) + +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..7670924d5cb7 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb @@ -0,0 +1,35 @@ +# 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/section_pb' +require 'google/chat/v1/space_pb' +require 'google/chat/v1/space_event_pb' +require 'google/chat/v1/space_notification_setting_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\x1cgoogle/chat/v1/section.proto\x1a\x1agoogle/chat/v1/space.proto\x1a google/chat/v1/space_event.proto\x1a/google/chat/v1/space_notification_setting.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\xd1@\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\x82\x01\n\x0e\x46indGroupChats\x12%.google.chat.v1.FindGroupChatsRequest\x1a&.google.chat.v1.FindGroupChatsResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/spaces:findGroupChats\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\x91\x01\n\x11\x43reateCustomEmoji\x12(.google.chat.v1.CreateCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"5\xda\x41\x0c\x63ustom_emoji\x82\xd3\xe4\x93\x02 \"\x10/v1/customEmojis:\x0c\x63ustom_emoji\x12~\n\x0eGetCustomEmoji\x12%.google.chat.v1.GetCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{name=customEmojis/*}\x12\x82\x01\n\x10ListCustomEmojis\x12\'.google.chat.v1.ListCustomEmojisRequest\x1a(.google.chat.v1.ListCustomEmojisResponse\"\x1b\xda\x41\x00\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/customEmojis\x12\x7f\n\x11\x44\x65leteCustomEmoji\x12(.google.chat.v1.DeleteCustomEmojiRequest\x1a\x16.google.protobuf.Empty\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v1/{name=customEmojis/*}\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\x12\xc0\x01\n\x1bGetSpaceNotificationSetting\x12\x32.google.chat.v1.GetSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=users/*/spaces/*/spaceNotificationSetting}\x12\xa0\x02\n\x1eUpdateSpaceNotificationSetting\x12\x35.google.chat.v1.UpdateSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"\x9c\x01\xda\x41&space_notification_setting,update_mask\x82\xd3\xe4\x93\x02m2O/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}:\x1aspace_notification_setting\x12\x8f\x01\n\rCreateSection\x12$.google.chat.v1.CreateSectionRequest\x1a\x17.google.chat.v1.Section\"?\xda\x41\x0eparent,section\x82\xd3\xe4\x93\x02(\"\x1d/v1/{parent=users/*}/sections:\x07section\x12{\n\rDeleteSection\x12$.google.chat.v1.DeleteSectionRequest\x1a\x16.google.protobuf.Empty\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=users/*/sections/*}\x12\x9c\x01\n\rUpdateSection\x12$.google.chat.v1.UpdateSectionRequest\x1a\x17.google.chat.v1.Section\"L\xda\x41\x13section,update_mask\x82\xd3\xe4\x93\x02\x30\x32%/v1/{section.name=users/*/sections/*}:\x07section\x12\x89\x01\n\x0cListSections\x12#.google.chat.v1.ListSectionsRequest\x1a$.google.chat.v1.ListSectionsResponse\".\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{parent=users/*}/sections\x12\x95\x01\n\x0fPositionSection\x12&.google.chat.v1.PositionSectionRequest\x1a\'.google.chat.v1.PositionSectionResponse\"1\x82\xd3\xe4\x93\x02+\"&/v1/{name=users/*/sections/*}:position:\x01*\x12\x9d\x01\n\x10ListSectionItems\x12\'.google.chat.v1.ListSectionItemsRequest\x1a(.google.chat.v1.ListSectionItemsResponse\"6\xda\x41\x06parent\x82\xd3\xe4\x93\x02\'\x12%/v1/{parent=users/*/sections/*}/items\x12\xaf\x01\n\x0fMoveSectionItem\x12&.google.chat.v1.MoveSectionItemRequest\x1a\'.google.chat.v1.MoveSectionItemResponse\"K\xda\x41\x13name,target_section\x82\xd3\xe4\x93\x02/\"*/v1/{name=users/*/sections/*/items/*}:move:\x01*\x1a\xbe\x0e\xca\x41\x13\x63hat.googleapis.com\xd2\x41\xa4\x0ehttps://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.app.delete,https://www.googleapis.com/auth/chat.app.memberships,https://www.googleapis.com/auth/chat.app.memberships.readonly,https://www.googleapis.com/auth/chat.app.messages.readonly,https://www.googleapis.com/auth/chat.app.spaces,https://www.googleapis.com/auth/chat.app.spaces.create,https://www.googleapis.com/auth/chat.app.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.customemojis,https://www.googleapis.com/auth/chat.customemojis.readonly,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,https://www.googleapis.com/auth/chat.users.sections,https://www.googleapis.com/auth/chat.users.sections.readonly,https://www.googleapis.com/auth/chat.users.spacesettingsB\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 +pool.add_serialized_file(descriptor_data) + +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..d58093b9179f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb @@ -0,0 +1,1036 @@ +# 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 2026 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.create` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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. + # + # For + # [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) + # requests, the response doesn't contain the full message. The response only + # populates the `name` and `thread.name` fields in addition to the + # information that was in the request. + 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. System messages, like those + # announcing new space members, aren't included. 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When + # using this authentication scope, this method only returns public + # messages in a space. It doesn't include private messages. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.memberships` (requires + # [administrator approval](https://support.google.com/a?p=chat-app-auth)) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.admin.memberships` + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.memberships` (requires + # [administrator approval](https://support.google.com/a?p=chat-app-auth)) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.admin.memberships` + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot`: When using this + # authorization scope, this method returns details about a message the + # Chat app has access to, like direct messages and [slash + # commands](https://developers.google.com/workspace/chat/slash-commands) + # that invoke the Chat app. + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth). + # When using this authentication scope, + # this method returns details about a public message in a space. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # + # 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # 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) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.bot` + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.create` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + # + # 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # + # 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. In the request, set `use_admin_access` to `true`. + # For an example, see [Search for and manage + # spaces](https://developers.google.com/workspace/chat/search-manage-admin). + # + # Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) + # and one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.admin.spaces` + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.bot` + # - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # one of the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # App authentication has the following limitations: + # + # - `space.access_settings` is only populated when using the + # `chat.app.spaces` scope. + # - `space.predefind_permission_settings` and `space.permission_settings` are + # only populated when using the `chat.app.spaces` scope, and only for + # spaces the app created. + rpc :GetSpace, ::Google::Apps::Chat::V1::GetSpaceRequest, ::Google::Apps::Chat::V1::Space + # Creates a space. Can be used to create a named space, or a + # group chat in `Import mode`. For an example, see [Create a + # space](https://developers.google.com/workspace/chat/create-spaces). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces.create` + # - `https://www.googleapis.com/auth/chat.app.spaces` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.create` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # + # When authenticating as an app, the `space.customer` field must be set in + # the request. + # + # When authenticating as an app, the Chat app is added as a member of the + # space. However, unlike human authentication, the Chat app is not added as a + # space manager. By default, the Chat app can be removed from the space by + # all space members. To allow only space managers to remove the app from a + # space, set `space.permission_settings.manage_apps` to `managers_allowed`. + # + # Space membership upon creation depends on whether the space is created in + # `Import mode`: + # + # * **Import mode:** No members are created. + # * **All other modes:** The calling user is added as a member. This is: + # * The app itself when using app authentication. + # * The human user when using user authentication. + # + # 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. + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.spaces.create` + # - `https://www.googleapis.com/auth/chat.spaces` + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scopes is used: + # - `https://www.googleapis.com/auth/chat.admin.spaces` + # + # App authentication has the following limitations: + # + # - To update either `space.predefined_permission_settings` or + # `space.permission_settings`, the app must be the space creator. + # - Updating the `space.access_settings.audience` is not supported for app + # authentication. + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) and the + # authorization scope: + # - `https://www.googleapis.com/auth/chat.app.delete` (only in + # spaces the app created) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.delete` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.delete` + 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 [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # and domain-wide delegation with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.import` + # + # 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 [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. + # + # 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with the authorization scope: + # - `https://www.googleapis.com/auth/chat.bot` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + rpc :FindDirectMessage, ::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Google::Apps::Chat::V1::Space + # Returns all spaces with `spaceType == GROUP_CHAT`, whose + # human memberships contain exactly the calling user, and the users specified + # in `FindGroupChatsRequest.users`. Only members that have joined the + # conversation are supported. For an example, see [Find group + # chats](https://developers.google.com/workspace/chat/find-group-chats). + # + # If the calling user blocks, or is blocked by, some users, and no spaces + # with the entire specified set of users are found, this method returns + # spaces that don't include the blocked or blocking users. + # + # The specified set of users must contain only human (non-app) memberships. + # A request that contains non-human users doesn't return any spaces. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + rpc :FindGroupChats, ::Google::Apps::Chat::V1::FindGroupChatsRequest, ::Google::Apps::Chat::V1::FindGroupChatsResponse + # 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.memberships.app` (to add the + # calling app to the space) + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # App authentication is not supported for the following use cases: + # + # - Inviting users external to the Workspace organization that owns the + # space. + # - Adding a Google Group to a space. + # - Adding a Chat app to a space. + # + # 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) and the + # authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` (only in + # spaces the app created) + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + 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). + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator approval](https://support.google.com/a?p=chat-app-auth) + # and the authorization scope: + # - `https://www.googleapis.com/auth/chat.app.memberships` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.memberships` + # - `https://www.googleapis.com/auth/chat.memberships.app` (to remove + # the calling app from the space) + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces + # only) + # - User authentication grants administrator privileges when an + # administrator account authenticates, `use_admin_access` is `true`, and + # the following authorization scope is used: + # - `https://www.googleapis.com/auth/chat.admin.memberships` + # + # App authentication is not supported for the following use cases: + # + # - Removing a Google Group from a space. + # - Removing a Chat app from a space. + # + # To delete memberships for space managers, the requester + # must be a space manager. If you're using [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # the Chat app must be the space creator. + rpc :DeleteMembership, ::Google::Apps::Chat::V1::DeleteMembershipRequest, ::Google::Apps::Chat::V1::Membership + # Creates a reaction and adds it to a message. 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions.create` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + rpc :ListReactions, ::Google::Apps::Chat::V1::ListReactionsRequest, ::Google::Apps::Chat::V1::ListReactionsResponse + # Deletes a reaction to a message. 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) + rpc :DeleteReaction, ::Google::Apps::Chat::V1::DeleteReactionRequest, ::Google::Protobuf::Empty + # Creates a custom emoji. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis` + rpc :CreateCustomEmoji, ::Google::Apps::Chat::V1::CreateCustomEmojiRequest, ::Google::Apps::Chat::V1::CustomEmoji + # Returns details about a custom emoji. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis.readonly` + # - `https://www.googleapis.com/auth/chat.customemojis` + rpc :GetCustomEmoji, ::Google::Apps::Chat::V1::GetCustomEmojiRequest, ::Google::Apps::Chat::V1::CustomEmoji + # Lists custom emojis visible to the authenticated user. + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis.readonly` + # - `https://www.googleapis.com/auth/chat.customemojis` + rpc :ListCustomEmojis, ::Google::Apps::Chat::V1::ListCustomEmojisRequest, ::Google::Apps::Chat::V1::ListCustomEmojisResponse + # Deletes a custom emoji. By default, users can only delete custom emoji they + # created. [Emoji managers](https://support.google.com/a/answer/12850085) + # assigned by the administrator can delete any custom emoji in the + # organization. See [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149). + # + # Custom emojis are only available for Google Workspace accounts, and the + # administrator must turn custom emojis on for the organization. For more + # information, see [Learn about custom emojis in Google + # Chat](https://support.google.com/chat/answer/12800149) and + # [Manage custom emoji + # permissions](https://support.google.com/a/answer/12850085). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.customemojis` + rpc :DeleteCustomEmoji, ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, ::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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + # - `https://www.googleapis.com/auth/chat.users.readstate` + 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) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate` + 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) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` + # - `https://www.googleapis.com/auth/chat.users.readstate` + 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + # with an + # [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + # appropriate for reading the requested data: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # - `https://www.googleapis.com/auth/chat.app.memberships` + # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # To get an event, the authenticated caller 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. + # + # Supports the following types of + # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) + # with an + # [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) + # appropriate for reading the requested data: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.app.spaces` + # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.app.messages.readonly` + # - `https://www.googleapis.com/auth/chat.app.memberships` + # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following authorization scopes: + # - `https://www.googleapis.com/auth/chat.spaces.readonly` + # - `https://www.googleapis.com/auth/chat.spaces` + # - `https://www.googleapis.com/auth/chat.messages.readonly` + # - `https://www.googleapis.com/auth/chat.messages` + # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` + # - `https://www.googleapis.com/auth/chat.messages.reactions` + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # To list events, the authenticated caller 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 + # Gets the space notification setting. For an example, see [Get the + # caller's space notification + # setting](https://developers.google.com/workspace/chat/get-space-notification-setting). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.spacesettings` + rpc :GetSpaceNotificationSetting, ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, ::Google::Apps::Chat::V1::SpaceNotificationSetting + # Updates the space notification setting. For an example, see [Update + # the caller's space notification + # setting](https://developers.google.com/workspace/chat/update-space-notification-setting). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.spacesettings` + rpc :UpdateSpaceNotificationSetting, ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, ::Google::Apps::Chat::V1::SpaceNotificationSetting + # Creates a section in Google Chat. Sections help users group conversations + # and customize the list of spaces displayed in Chat navigation panel. Only + # sections of type `CUSTOM_SECTION` can be created. For details, see [Create + # and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + rpc :CreateSection, ::Google::Apps::Chat::V1::CreateSectionRequest, ::Google::Apps::Chat::V1::Section + # Deletes a section of type `CUSTOM_SECTION`. + # + # If the section contains items, such as spaces, the items are moved to + # Google Chat's default sections and are not deleted. + # + # For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + rpc :DeleteSection, ::Google::Apps::Chat::V1::DeleteSectionRequest, ::Google::Protobuf::Empty + # Updates a section. Only sections of type `CUSTOM_SECTION` can be updated. + # For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + rpc :UpdateSection, ::Google::Apps::Chat::V1::UpdateSectionRequest, ::Google::Apps::Chat::V1::Section + # Lists sections available to the Chat user. Sections help users group their + # conversations and customize the list of spaces displayed in Chat + # navigation panel. For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # - `https://www.googleapis.com/auth/chat.users.sections.readonly` + rpc :ListSections, ::Google::Apps::Chat::V1::ListSectionsRequest, ::Google::Apps::Chat::V1::ListSectionsResponse + # Changes the sort order of a section. For details, see [Create and organize + # sections in Google Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + rpc :PositionSection, ::Google::Apps::Chat::V1::PositionSectionRequest, ::Google::Apps::Chat::V1::PositionSectionResponse + # Lists items in a section. + # + # Only spaces can be section items. For details, see [Create and organize + # sections in Google Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + # - `https://www.googleapis.com/auth/chat.users.sections.readonly` + rpc :ListSectionItems, ::Google::Apps::Chat::V1::ListSectionItemsRequest, ::Google::Apps::Chat::V1::ListSectionItemsResponse + # Moves an item from one section to another. For example, if a section + # contains spaces, this method can be used to move a space to a different + # section. For details, see [Create and organize sections in Google + # Chat](https://support.google.com/chat/answer/16059854). + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with the [authorization + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.users.sections` + rpc :MoveSectionItem, ::Google::Apps::Chat::V1::MoveSectionItemRequest, ::Google::Apps::Chat::V1::MoveSectionItemResponse + 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..18ecfad801c4 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/contextual_addon_pb.rb @@ -0,0 +1,28 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..561d1e0c4e40 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/deletion_metadata_pb.rb @@ -0,0 +1,22 @@ +# 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\"\x89\x02\n\x10\x44\x65letionMetadata\x12\x44\n\rdeletion_type\x18\x01 \x01(\x0e\x32-.google.chat.v1.DeletionMetadata.DeletionType\"\xae\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\x12\x10\n\x0cSPACE_MEMBER\x10\x07\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 +pool.add_serialized_file(descriptor_data) + +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..fcc2505fbc20 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/event_payload_pb.rb @@ -0,0 +1,44 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..3d52ee2019d2 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/group_pb.rb @@ -0,0 +1,21 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..4904f27aba95 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/history_state_pb.rb @@ -0,0 +1,21 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..90a907fad1a5 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/matched_url_pb.rb @@ -0,0 +1,23 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..dc6e05bfd065 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb @@ -0,0 +1,36 @@ +# 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\"\x96\x05\n\nMembership\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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.UserB\x03\xe0\x41\x01H\x00\x12\x32\n\x0cgroup_member\x18\x05 \x01(\x0b\x32\x15.google.chat.v1.GroupB\x03\xe0\x41\x01H\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\"p\n\x0eMembershipRole\x12\x1f\n\x1bMEMBERSHIP_ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bROLE_MEMBER\x10\x01\x12\x10\n\x0cROLE_MANAGER\x10\x02\x12\x1a\n\x16ROLE_ASSISTANT_MANAGER\x10\x04:D\xea\x41\x41\n\x1e\x63hat.googleapis.com/Membership\x12\x1fspaces/{space}/members/{member}B\x0c\n\nmemberType\"\xa5\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\x1d\n\x10use_admin_access\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xa3\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\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xea\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\x1d\n\x10use_admin_access\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\"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\"k\n\x14GetMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"n\n\x17\x44\x65leteMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\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 +pool.add_serialized_file(descriptor_data) + +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..8a158f9d942f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/message_pb.rb @@ -0,0 +1,58 @@ +# 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\"\xd4\n\n\x07Message\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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\x11\n\x04text\x18\x04 \x01(\tB\x03\xe0\x41\x01\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\x31\n\x08\x63\x61rds_v2\x18\x16 \x03(\x0b\x32\x1a.google.chat.v1.CardWithIdB\x03\xe0\x41\x01\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.SpaceB\x03\xe0\x41\x03\x12\x1a\n\rfallback_text\x18\r \x01(\tB\x03\xe0\x41\x01\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\x33\n\nattachment\x18\x12 \x03(\x0b\x32\x1a.google.chat.v1.AttachmentB\x03\xe0\x41\x01\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(\tB\x03\xe0\x41\x01\x12K\n\x18\x65moji_reaction_summaries\x18! \x03(\x0b\x32$.google.chat.v1.EmojiReactionSummaryB\x03\xe0\x41\x03\x12<\n\x16private_message_viewer\x18$ \x01(\x0b\x32\x14.google.chat.v1.UserB\x06\xe0\x41\x05\xe0\x41\x01\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\x01\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.AccessoryWidgetB\x03\xe0\x41\x01: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\"\x98\x04\n\x15QuotedMessageMetadata\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\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\x02\x12H\n\nquote_type\x18\x04 \x01(\x0e\x32/.google.chat.v1.QuotedMessageMetadata.QuoteTypeB\x03\xe0\x41\x01\x12K\n\x17quoted_message_snapshot\x18\x05 \x01(\x0b\x32%.google.chat.v1.QuotedMessageSnapshotB\x03\xe0\x41\x03\x12\x42\n\x12\x66orwarded_metadata\x18\x06 \x01(\x0b\x32!.google.chat.v1.ForwardedMetadataB\x03\xe0\x41\x03\"2\n\tQuoteType\x12\x1a\n\x16QUOTE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05REPLY\x10\x01:\x81\x01\xea\x41~\n)chat.googleapis.com/QuotedMessageMetadata\x12Qspaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}\"\xc8\x01\n\x15QuotedMessageSnapshot\x12\x13\n\x06sender\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0e\x66ormatted_text\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32\x1a.google.chat.v1.AnnotationB\x03\xe0\x41\x03\x12\x34\n\x0b\x61ttachments\x18\x05 \x03(\x0b\x32\x1a.google.chat.v1.AttachmentB\x03\xe0\x41\x03\"f\n\x11\x46orwardedMetadata\x12\x30\n\x05space\x18\x01 \x01(\tB!\xe0\x41\x03\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1f\n\x12space_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\"v\n\x06Thread\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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\"]\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\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x97\x01\n\x14UpdateMessageRequest\x12-\n\x07message\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.MessageB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\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\"\xc2\x01\n\x13ListMessagesRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x63hat.googleapis.com/Message\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"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 +pool.add_serialized_file(descriptor_data) + +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 + QuotedMessageMetadata::QuoteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.QuotedMessageMetadata.QuoteType").enummodule + QuotedMessageSnapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.QuotedMessageSnapshot").msgclass + ForwardedMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ForwardedMetadata").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..db8fe04ef61f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/reaction_pb.rb @@ -0,0 +1,39 @@ +# 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/field_info_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\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x19google/chat/v1/user.proto\"\xcc\x01\n\x08Reaction\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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.EmojiB\x03\xe0\x41\x02:Y\xea\x41V\n\x1c\x63hat.googleapis.com/Reaction\x12\x36spaces/{space}/messages/{message}/reactions/{reaction}\"_\n\x05\x45moji\x12\x16\n\x07unicode\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x33\n\x0c\x63ustom_emoji\x18\x02 \x01(\x0b\x32\x1b.google.chat.v1.CustomEmojiH\x00\x42\t\n\x07\x63ontent\"\xed\x02\n\x0b\x43ustomEmoji\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x01 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1a\n\nemoji_name\x18\x03 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12 \n\x13temporary_image_uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12G\n\x07payload\x18\x05 \x01(\x0b\x32..google.chat.v1.CustomEmoji.CustomEmojiPayloadB\x06\xe0\x41\x04\xe0\x41\x01\x1aL\n\x12\x43ustomEmojiPayload\x12\x1c\n\x0c\x66ile_content\x18\x01 \x01(\x0c\x42\x06\xe0\x41\x04\xe0\x41\x02\x12\x18\n\x08\x66ilename\x18\x02 \x01(\tB\x06\xe0\x41\x04\xe0\x41\x02:\\\xea\x41Y\n\x1f\x63hat.googleapis.com/CustomEmoji\x12\x1b\x63ustomEmojis/{custom_emoji}*\x0c\x63ustomEmojis2\x0b\x63ustomEmoji\"v\n\x14\x45mojiReactionSummary\x12)\n\x05\x65moji\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.EmojiB\x03\xe0\x41\x03\x12 \n\x0ereaction_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\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/Reaction\"R\n\x18\x43reateCustomEmojiRequest\x12\x36\n\x0c\x63ustom_emoji\x18\x01 \x01(\x0b\x32\x1b.google.chat.v1.CustomEmojiB\x03\xe0\x41\x02\"N\n\x15GetCustomEmojiRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63hat.googleapis.com/CustomEmoji\"_\n\x17ListCustomEmojisRequest\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\"l\n\x18ListCustomEmojisResponse\x12\x37\n\rcustom_emojis\x18\x01 \x03(\x0b\x32\x1b.google.chat.v1.CustomEmojiB\x03\xe0\x41\x06\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Q\n\x18\x44\x65leteCustomEmojiRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63hat.googleapis.com/CustomEmojiB\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 +pool.add_serialized_file(descriptor_data) + +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 + CustomEmoji::CustomEmojiPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CustomEmoji.CustomEmojiPayload").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 + CreateCustomEmojiRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateCustomEmojiRequest").msgclass + GetCustomEmojiRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetCustomEmojiRequest").msgclass + ListCustomEmojisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListCustomEmojisRequest").msgclass + ListCustomEmojisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListCustomEmojisResponse").msgclass + DeleteCustomEmojiRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteCustomEmojiRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/section_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/section_pb.rb new file mode 100644 index 000000000000..dfb2a11c664a --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/section_pb.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/section.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n\x1cgoogle/chat/v1/section.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xde\x02\n\x07Section\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\nsort_order\x18\x03 \x01(\x05\x12\x36\n\x04type\x18\x04 \x01(\x0e\x32#.google.chat.v1.Section.SectionTypeB\x03\xe0\x41\x02\"\x82\x01\n\x0bSectionType\x12\x1c\n\x18SECTION_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x43USTOM_SECTION\x10\x01\x12\x1b\n\x17\x44\x45\x46\x41ULT_DIRECT_MESSAGES\x10\x02\x12\x12\n\x0e\x44\x45\x46\x41ULT_SPACES\x10\x03\x12\x10\n\x0c\x44\x45\x46\x41ULT_APPS\x10\x06:T\xea\x41Q\n\x1b\x63hat.googleapis.com/Section\x12\x1fusers/{user}/sections/{section}*\x08sections2\x07section\"\xcb\x01\n\x0bSectionItem\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x32\n\x05space\x18\x02 \x01(\tB!\xe0\x41\x01\xfa\x41\x1b\n\x19\x63hat.googleapis.com/SpaceH\x00:m\xea\x41j\n\x1f\x63hat.googleapis.com/SectionItem\x12,users/{user}/sections/{section}/items/{item}*\x0csectionItems2\x0bsectionItemB\x06\n\x04item\"w\n\x14\x43reateSectionRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x63hat.googleapis.com/User\x12-\n\x07section\x18\x02 \x01(\x0b\x32\x17.google.chat.v1.SectionB\x03\xe0\x41\x02\"I\n\x14\x44\x65leteSectionRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\"{\n\x14UpdateSectionRequest\x12-\n\x07section\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.SectionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"x\n\x13ListSectionsRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x63hat.googleapis.com/User\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\"Z\n\x14ListSectionsResponse\x12)\n\x08sections\x18\x01 \x03(\x0b\x32\x17.google.chat.v1.Section\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xff\x01\n\x16PositionSectionRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\x12\x19\n\nsort_order\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x12Q\n\x11relative_position\x18\x03 \x01(\x0e\x32/.google.chat.v1.PositionSectionRequest.PositionB\x03\xe0\x41\x01H\x00\"8\n\x08Position\x12\x18\n\x14POSITION_UNSPECIFIED\x10\x00\x12\t\n\x05START\x10\x01\x12\x07\n\x03\x45ND\x10\x02\x42\n\n\x08position\"C\n\x17PositionSectionResponse\x12(\n\x07section\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.Section\"\x94\x01\n\x17ListSectionItemsRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\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\"g\n\x18ListSectionItemsResponse\x12\x32\n\rsection_items\x18\x01 \x03(\x0b\x32\x1b.google.chat.v1.SectionItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8c\x01\n\x16MoveSectionItemRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63hat.googleapis.com/SectionItem\x12;\n\x0etarget_section\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\"L\n\x17MoveSectionItemResponse\x12\x31\n\x0csection_item\x18\x01 \x01(\x0b\x32\x1b.google.chat.v1.SectionItemB\xd0\x01\n\x12\x63om.google.chat.v1B\x0cSectionProtoP\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::V1\xea\x41(\n\x18\x63hat.googleapis.com/User\x12\x0cusers/{user}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Apps + module Chat + module V1 + Section = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Section").msgclass + Section::SectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Section.SectionType").enummodule + SectionItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SectionItem").msgclass + CreateSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateSectionRequest").msgclass + DeleteSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteSectionRequest").msgclass + UpdateSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateSectionRequest").msgclass + ListSectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionsRequest").msgclass + ListSectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionsResponse").msgclass + PositionSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.PositionSectionRequest").msgclass + PositionSectionRequest::Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.PositionSectionRequest.Position").enummodule + PositionSectionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.PositionSectionResponse").msgclass + ListSectionItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionItemsRequest").msgclass + ListSectionItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionItemsResponse").msgclass + MoveSectionItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MoveSectionItemRequest").msgclass + MoveSectionItemResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MoveSectionItemResponse").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..14ad136a7f94 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/slash_command_pb.rb @@ -0,0 +1,21 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..48c3a5dd1af1 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_event_pb.rb @@ -0,0 +1,29 @@ +# 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\"\x96\x01\n\x16ListSpaceEventsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63hat.googleapis.com/SpaceEvent\x12\x16\n\tpage_size\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x06 \x01(\tB\x03\xe0\x41\x01\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 +pool.add_serialized_file(descriptor_data) + +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_notification_setting_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_notification_setting_pb.rb new file mode 100644 index 000000000000..28aa6087c827 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_notification_setting_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/chat/v1/space_notification_setting.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n/google/chat/v1/space_notification_setting.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xc6\x04\n\x18SpaceNotificationSetting\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12_\n\x14notification_setting\x18\x02 \x01(\x0e\x32<.google.chat.v1.SpaceNotificationSetting.NotificationSettingH\x00\x88\x01\x01\x12O\n\x0cmute_setting\x18\x03 \x01(\x0e\x32\x34.google.chat.v1.SpaceNotificationSetting.MuteSettingH\x01\x88\x01\x01\"r\n\x13NotificationSetting\x12$\n NOTIFICATION_SETTING_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41LL\x10\x01\x12\x16\n\x12MAIN_CONVERSATIONS\x10\x02\x12\x0b\n\x07\x46OR_YOU\x10\x03\x12\x07\n\x03OFF\x10\x04\"C\n\x0bMuteSetting\x12\x1c\n\x18MUTE_SETTING_UNSPECIFIED\x10\x00\x12\x0b\n\x07UNMUTED\x10\x01\x12\t\n\x05MUTED\x10\x02:\x81\x01\xea\x41~\n,chat.googleapis.com/SpaceNotificationSetting\x12\x34users/{user}/spaces/{space}/spaceNotificationSetting2\x18spaceNotificationSettingB\x17\n\x15_notification_settingB\x0f\n\r_mute_setting\"h\n\"GetSpaceNotificationSettingRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,chat.googleapis.com/SpaceNotificationSetting\"\xb0\x01\n%UpdateSpaceNotificationSettingRequest\x12Q\n\x1aspace_notification_setting\x18\x01 \x01(\x0b\x32(.google.chat.v1.SpaceNotificationSettingB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x42\xb6\x01\n\x12\x63om.google.chat.v1B\x1dSpaceNotificationSettingProtoP\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 +pool.add_serialized_file(descriptor_data) + +module Google + module Apps + module Chat + module V1 + SpaceNotificationSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceNotificationSetting").msgclass + SpaceNotificationSetting::NotificationSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceNotificationSetting.NotificationSetting").enummodule + SpaceNotificationSetting::MuteSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceNotificationSetting.MuteSetting").enummodule + GetSpaceNotificationSettingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetSpaceNotificationSettingRequest").msgclass + UpdateSpaceNotificationSettingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateSpaceNotificationSettingRequest").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..7c949866ae56 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb @@ -0,0 +1,51 @@ +# 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\"\xcd\x16\n\x05Space\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1a.google.chat.v1.Space.TypeB\x05\x18\x01\xe0\x41\x03\x12\x38\n\nspace_type\x18\n \x01(\x0e\x32\x1f.google.chat.v1.Space.SpaceTypeB\x03\xe0\x41\x01\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\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12%\n\x15\x65xternal_user_allowed\x18\x08 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x01\x12M\n\x15space_threading_state\x18\t \x01(\x0e\x32).google.chat.v1.Space.SpaceThreadingStateB\x03\xe0\x41\x03\x12>\n\rspace_details\x18\x0b \x01(\x0b\x32\".google.chat.v1.Space.SpaceDetailsB\x03\xe0\x41\x01\x12>\n\x13space_history_state\x18\r \x01(\x0e\x32\x1c.google.chat.v1.HistoryStateB\x03\xe0\x41\x01\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\x1d\n\x08\x63ustomer\x18\x18 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x01H\x01\x88\x01\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\x12@\n\x17import_mode_expire_time\x18\x1c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x41\n\x0cSpaceDetails\x12\x18\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nguidelines\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a_\n\x0fMembershipCount\x12+\n\x1ejoined_direct_human_user_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12joined_group_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\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\xa8\x06\n\x12PermissionSettings\x12T\n\x19manage_members_and_groups\x18\x01 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12O\n\x14modify_space_details\x18\x02 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12I\n\x0etoggle_history\x18\x03 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12M\n\x12use_at_mention_all\x18\x04 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x46\n\x0bmanage_apps\x18\x05 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12J\n\x0fmanage_webhooks\x18\x06 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x12I\n\x0ereply_messages\x18\x08 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x9d\x01\n\x11PermissionSetting\x12\x1d\n\x10managers_allowed\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12,\n\x1a\x61ssistant_managers_allowed\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1c\n\x0fmembers_allowed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1d\n\x1b_assistant_managers_allowed\".\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_settingsB\x0b\n\t_customer\"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\"a\n\x0fGetSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"-\n\x18\x46indDirectMessageRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x8b\x01\n\x15\x46indGroupChatsRequest\x12\x12\n\x05users\x18\x05 \x03(\tB\x03\xe0\x41\x01\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-\n\nspace_view\x18\x04 \x01(\x0e\x32\x19.google.chat.v1.SpaceView\"X\n\x16\x46indGroupChatsResponse\x12%\n\x06spaces\x18\x01 \x03(\x0b\x32\x15.google.chat.v1.Space\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x94\x01\n\x12UpdateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\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\"d\n\x12\x44\x65leteSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"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.Space*c\n\tSpaceView\x12\x1a\n\x16SPACE_VIEW_UNSPECIFIED\x10\x00\x12!\n\x1dSPACE_VIEW_RESOURCE_NAME_ONLY\x10\x03\x12\x17\n\x13SPACE_VIEW_EXPANDED\x10\x04\x42\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 +pool.add_serialized_file(descriptor_data) + +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 + FindGroupChatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindGroupChatsRequest").msgclass + FindGroupChatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindGroupChatsResponse").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 + SpaceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceView").enummodule + 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..6bfeeb683cb1 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_read_state_pb.rb @@ -0,0 +1,28 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..cad576472f32 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_setup_pb.rb @@ -0,0 +1,25 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..d673eb835c39 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/thread_read_state_pb.rb @@ -0,0 +1,26 @@ +# 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 +pool.add_serialized_file(descriptor_data) + +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..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 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. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + 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. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # Example: + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + 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 + 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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 + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # + # Note: This feature should not be used in most cases. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + 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..582be187d115 --- /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 2026 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/field_info.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 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 + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + 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/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..9392a413fb1b --- /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 2026 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..25dec4847ac1 --- /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 2026 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..ae4f0c500d39 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/apps/card/v1/card.rb @@ -0,0 +1,2627 @@ +# frozen_string_literal: true + +# Copyright 2026 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). + # + # Note: You can add up to 100 widgets per card. Any widgets beyond this + # limit are ignored. This limit applies to both card messages and dialogs + # in Google Chat apps, and to cards in Google Workspace add-ons. + # + # **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 the header, sections and footer. + # @!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`. + # @!attribute [rw] collapse_control + # @return [::Google::Apps::Card::V1::CollapseControl] + # Optional. Define the expand and collapse button of the section. + # This button will be shown only if the section is collapsible. + # If this field isn't set, the default button is used. + 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 list of widgets that can be displayed in a containing layout, such + # as a `CarouselCard`. + # [Google Chat apps](https://developers.google.com/workspace/chat): + # @!attribute [rw] text_paragraph + # @return [::Google::Apps::Card::V1::TextParagraph] + # A text paragraph widget. + # + # Note: The following fields are mutually exclusive: `text_paragraph`, `button_list`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] button_list + # @return [::Google::Apps::Card::V1::ButtonList] + # A button list widget. + # + # Note: The following fields are mutually exclusive: `button_list`, `text_paragraph`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image + # @return [::Google::Apps::Card::V1::Image] + # An image widget. + # + # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `button_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class NestedWidget + 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. + SOLID_DIVIDER = 1 + + # If set, no divider is rendered. This style completely removes the divider + # from the layout. The result is equivalent to not adding a divider at all. + 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" + # } + # ``` + # + # Note: The following fields are mutually exclusive: `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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" + # } + # ``` + # + # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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" + # } + # } + # ``` + # + # Note: The following fields are mutually exclusive: `decorated_text`, `text_paragraph`, `image`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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, + # }, + # "disabled": true, + # }, + # { + # "icon": { + # "knownIcon": "INVITE", + # "altText": "check calendar" + # }, + # "onClick": { + # "openLink": { + # "url": "https://example.com/calendar" + # } + # } + # } + # ] + # } + # ``` + # + # Note: The following fields are mutually exclusive: `button_list`, `text_paragraph`, `image`, `decorated_text`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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" + # } + # ] + # } + # } + # ``` + # + # Note: The following fields are mutually exclusive: `text_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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 + # } + # ] + # } + # ``` + # + # Note: The following fields are mutually exclusive: `selection_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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 + # } + # ``` + # + # Note: The following fields are mutually exclusive: `date_time_picker`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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": { + # } + # ``` + # + # Note: The following fields are mutually exclusive: `divider`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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" + # } + # } + # } + # ``` + # + # Note: The following fields are mutually exclusive: `grid`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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" + # } + # } + # ] + # } + # ] + # } + # ``` + # + # Note: The following fields are mutually exclusive: `columns`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] carousel + # @return [::Google::Apps::Card::V1::Carousel] + # A carousel contains a collection of nested widgets. + # For example, this is a JSON representation of a carousel that contains + # two text paragraphs. + # + # ``` + # { + # "widgets": [ + # { + # "textParagraph": { + # "text": "First text paragraph in the carousel." + # } + # }, + # { + # "textParagraph": { + # "text": "Second text paragraph in the carousel." + # } + # } + # ] + # } + # ``` + # + # Note: The following fields are mutually exclusive: `carousel`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] chip_list + # @return [::Google::Apps::Card::V1::ChipList] + # A list of chips. + # + # For example, the following JSON creates two chips. The first + # is a text chip and the second is an icon chip that opens a + # link: + # ``` + # "chipList": { + # "chips": [ + # { + # "text": "Edit", + # "disabled": true, + # }, + # { + # "icon": { + # "knownIcon": "INVITE", + # "altText": "check calendar" + # }, + # "onClick": { + # "openLink": { + # "url": "https://example.com/calendar" + # } + # } + # } + # ] + # } + # ``` + # + # Note: The following fields are mutually exclusive: `chip_list`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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 + + # Represents vertical alignment attribute. + module VerticalAlignment + # Unspecified type. Do not use. + VERTICAL_ALIGNMENT_UNSPECIFIED = 0 + + # Alignment to the top position. + TOP = 1 + + # Alignment to the middle position. + MIDDLE = 2 + + # Alignment to the bottom position. + BOTTOM = 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. + # @!attribute [rw] max_lines + # @return [::Integer] + # The maximum number of lines of text that are displayed in the widget. If + # the text exceeds the specified maximum number of lines, the excess + # content is concealed behind a **show more** button. If the text is equal or + # shorter than the specified maximum number of lines, a **show more** button + # isn't displayed. + # + # The default value is 0, in which case + # all context is displayed. Negative values are ignored. + # @!attribute [rw] text_syntax + # @return [::Google::Apps::Card::V1::TextParagraph::TextSyntax] + # The syntax of the text. If not set, the text is rendered as HTML. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + class TextParagraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Syntax to use for formatting text. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + module TextSyntax + # The text is rendered as HTML if unspecified. + TEXT_SYNTAX_UNSPECIFIED = 0 + + # The text is rendered as HTML. This is the default value. + HTML = 1 + + # The text is rendered as Markdown. + MARKDOWN = 2 + end + 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] start_icon_vertical_alignment + # @return [::Google::Apps::Card::V1::Widget::VerticalAlignment] + # Optional. Vertical alignment of the start icon. If not set, the icon + # will be vertically centered. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + # @!attribute [rw] top_label + # @return [::String] + # The text that appears above `text`. Always truncates. + # @!attribute [rw] top_label_text + # @return [::Google::Apps::Card::V1::TextParagraph] + # `TextParagraph` equivalent of `top_label`. Always truncates. Allows for + # more complex formatting than `top_label`. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + # @!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] content_text + # @return [::Google::Apps::Card::V1::TextParagraph] + # `TextParagraph` equivalent of `text`. Allows for more complex formatting + # than `text`. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + # @!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] bottom_label_text + # @return [::Google::Apps::Card::V1::TextParagraph] + # `TextParagraph` equivalent of `bottom_label`. Always wraps. Allows for + # more complex formatting than `bottom_label`. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + # @!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. + # + # Note: The following fields are mutually exclusive: `button`, `switch_control`, `end_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. + # + # Note: The following fields are mutually exclusive: `switch_control`, `button`, `end_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. + # + # Note: The following fields are mutually exclusive: `end_icon`, `button`, `switch_control`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # Supports form submission validation. When `Action.all_widgets_are_required` + # is set to `true` or this widget is specified in `Action.required_widgets`, + # the submission action is blocked unless a value is entered. 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] validation + # @return [::Google::Apps::Card::V1::Validation] + # Specify the input format validation necessary for this text field. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!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. + # Supports form submission validation for `dropdown` and `multiselect` menus + # only. When `Action.all_widgets_are_required` is set to `true` or this widget + # is specified in `Action.required_widgets`, the submission action is blocked + # unless a value is selected. 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] + # Required. 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 menu returns suggested selection items. + # + # If unset, the multiselect menu uses the following default values: + # + # * If the menu uses a static array of `SelectionInput` items, defaults to + # 0 characters and immediately populates items from the array. + # * If the menu uses a dynamic data source (`multi_select_data_source`), + # defaults to 3 characters before querying the data source to return + # suggested items. + # @!attribute [rw] external_data_source + # @return [::Google::Apps::Card::V1::Action] + # An external data source, such as a relational database. + # + # Note: The following fields are mutually exclusive: `external_data_source`, `platform_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] platform_data_source + # @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource] + # A data source from Google Workspace. + # + # Note: The following fields are mutually exclusive: `platform_data_source`, `external_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. Supports up to 100 items. + # + # [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] + # @!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. + # + # For Google Chat apps, you can populate items using a dynamic data source + # and autosuggest items as users type in the menu. For example, users can + # start typing the name of a Google Chat space and the widget autosuggests + # the space. To dynamically populate items for a dropdown menu, use one of + # the following types of data sources: + # + # * 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 dropdown menus for Chat apps, see + # [Add a dropdown + # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#dropdown-menu) + # and [Dynamically populate drop-down + # menus](https://developers.google.com/workspace/chat/design-interactive-card-dialog#dynamic-dropdown-menu). + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + DROPDOWN = 3 + + # A menu with a text box. Users can type and select one or more items. + # For Google Workspace add-ons, you must populate items using a static + # array of `SelectionItem` objects. + # + # For Google Chat apps, you can also populate items using a dynamic data + # source and autosuggest items as users type in the menu. For example, + # users can start typing the name of a Google Chat space and the widget + # autosuggests the space. To dynamically populate items for a multiselect + # menu, use one of the following types of data sources: + # + # * 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 for Chat apps, 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): + MULTI_SELECT = 4 + end + end + + # Lets users input a date, a time, or both a date and a time. + # Supports form submission validation. When `Action.all_widgets_are_required` + # is set to `true` or this widget is specified in `Action.required_widgets`, + # the submission action is blocked unless a value is selected. 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] + # Optional. 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 widget that presents a pop-up menu with one or more actions that users can + # invoke. For example, showing non-primary actions in a card. You can use this + # widget when actions don't fit in the available space. To use, specify this + # widget in the `OnClick` action of widgets that support it. For example, in a + # `Button`. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] items + # @return [::Array<::Google::Apps::Card::V1::OverflowMenu::OverflowMenuItem>] + # Required. The list of menu options. + class OverflowMenu + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An option that users can invoke in an overflow menu. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] start_icon + # @return [::Google::Apps::Card::V1::Icon] + # The icon displayed in front of the text. + # @!attribute [rw] text + # @return [::String] + # Required. The text that identifies or describes the item to users. + # @!attribute [rw] on_click + # @return [::Google::Apps::Card::V1::OnClick] + # Required. The action invoked when a menu option is selected. + # This `OnClick` cannot contain an `OverflowMenu`, any specified + # `OverflowMenu` is dropped and the menu item disabled. + # @!attribute [rw] disabled + # @return [::Boolean] + # Whether the menu option is disabled. + # Defaults to false. + class OverflowMenuItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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] + # An icon displayed inside the button. If both `icon` and `text` are set, + # then the icon appears before the text. + # @!attribute [rw] color + # @return [::Google::Type::Color] + # Optional. The color of the button. If set, the button `type` is set to + # `FILLED` and the color of `text` and `icon` fields are set to a + # contrasting color for readability. For example, if the button color is + # set to blue, any text or icons in the button are set to white. + # + # To set the button color, specify a value for the `red`, `green`, and `blue` + # fields. + # The value must be a float number between 0 and 1 based on the RGB color + # value, where `0` (0/255) represents the absence of color and `1` (255/255) + # represents the maximum intensity of the color. + # + # For example, the following sets the color to red at its maximum intensity: + # + # ``` + # "color": { + # "red": 1, + # "green": 0, + # "blue": 0, + # } + # ``` + # + # The `alpha` field is unavailable for button color. If specified, this field + # is ignored. + # @!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". + # @!attribute [rw] type + # @return [::Google::Apps::Card::V1::Button::Type] + # Optional. The type of a button. If unset, button type defaults to + # `OUTLINED`. If the `color` field is set, the button type is forced to + # `FILLED` and any value set for this field is ignored. + class Button + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Optional. The + # [type](https://m3.material.io/components/all-buttons#9134ac95-678e-49ae-a50a-e71948011b05) + # of a button. If `color` field is set, the `type` is forced to `FILLED`. + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + module Type + # Don't use. Unspecified. + TYPE_UNSPECIFIED = 0 + + # Outlined buttons are medium-emphasis buttons. They usually contain + # actions that are important, but aren’t the primary action in a Chat app + # or an add-on. + OUTLINED = 1 + + # A filled button has a container with a solid color. It has the most + # visual impact and is recommended for the important and primary action in + # a Chat app or an add-on. + FILLED = 2 + + # A filled tonal button is an alternative middle ground between filled and + # outlined buttons. They’re useful in contexts where a lower-priority + # button requires slightly more emphasis than an outline button would give. + FILLED_TONAL = 3 + + # A button does not have an invisible container in its default state. It is + # often used for the lowest priority actions, especially when presenting + # multiple options. + BORDERLESS = 4 + end + 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). + # + # Note: The following fields are mutually exclusive: `known_icon`, `icon_url`, `material_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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`. + # + # Note: The following fields are mutually exclusive: `icon_url`, `known_icon`, `material_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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): + # + # Note: The following fields are mutually exclusive: `material_icon`, `known_icon`, `icon_url`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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`. + # + # To set the stroke color, specify a value for the `red`, `green`, and `blue` + # fields. + # The value must be a float number between 0 and 1 based on the RGB color + # value, where `0` (0/255) represents the absence of color and `1` (255/255) + # represents the maximum intensity of the color. + # + # For example, the following sets the color to red at its maximum intensity: + # + # ``` + # "color": { + # "red": 1, + # "green": 0, + # "blue": 0, + # } + # ``` + # + # The `alpha` field is unavailable for stroke color. If specified, this field + # is ignored. + # @!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 + + # No border. + NO_BORDER = 1 + + # Default value. 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 two 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): + # The add-on UIs that support columns include: + # + # * The dialog displayed when users open the add-on from an email draft. + # * The dialog displayed when users open the add-on from the + # **Add attachment** menu in a Google Calendar event. + # @!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) + # @!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) + # @!attribute [rw] text_paragraph + # @return [::Google::Apps::Card::V1::TextParagraph] + # {::Google::Apps::Card::V1::TextParagraph TextParagraph} widget. + # + # Note: The following fields are mutually exclusive: `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image + # @return [::Google::Apps::Card::V1::Image] + # {::Google::Apps::Card::V1::Image Image} widget. + # + # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] decorated_text + # @return [::Google::Apps::Card::V1::DecoratedText] + # {::Google::Apps::Card::V1::DecoratedText DecoratedText} widget. + # + # Note: The following fields are mutually exclusive: `decorated_text`, `text_paragraph`, `image`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] button_list + # @return [::Google::Apps::Card::V1::ButtonList] + # {::Google::Apps::Card::V1::ButtonList ButtonList} widget. + # + # Note: The following fields are mutually exclusive: `button_list`, `text_paragraph`, `image`, `decorated_text`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] text_input + # @return [::Google::Apps::Card::V1::TextInput] + # {::Google::Apps::Card::V1::TextInput TextInput} widget. + # + # Note: The following fields are mutually exclusive: `text_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] selection_input + # @return [::Google::Apps::Card::V1::SelectionInput] + # {::Google::Apps::Card::V1::SelectionInput SelectionInput} widget. + # + # Note: The following fields are mutually exclusive: `selection_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] date_time_picker + # @return [::Google::Apps::Card::V1::DateTimePicker] + # {::Google::Apps::Card::V1::DateTimePicker DateTimePicker} widget. + # + # Note: The following fields are mutually exclusive: `date_time_picker`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] chip_list + # @return [::Google::Apps::Card::V1::ChipList] + # {::Google::Apps::Card::V1::ChipList ChipList} widget. + # + # Note: The following fields are mutually exclusive: `chip_list`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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) + 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) + 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 + + # A carousel, also known as a slider, rotates and displays a list of widgets in + # a slideshow format, with buttons navigating to the previous or next widget. + # + # For example, this is a JSON representation of a carousel that contains three + # text paragraph widgets. + # + # ``` + # { + # "carouselCards": [ + # { + # "widgets": [ + # { + # "textParagraph": { + # "text": "First text paragraph in carousel", + # } + # } + # ] + # }, + # { + # "widgets": [ + # { + # "textParagraph": { + # "text": "Second text paragraph in carousel", + # } + # } + # ] + # }, + # { + # "widgets": [ + # { + # "textParagraph": { + # "text": "Third text paragraph in carousel", + # } + # } + # ] + # } + # ] + # } + # ``` + # + # [Google Chat apps](https://developers.google.com/workspace/chat): + # @!attribute [rw] carousel_cards + # @return [::Array<::Google::Apps::Card::V1::Carousel::CarouselCard>] + # A list of cards included in the carousel. + class Carousel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A card that can be displayed as a carousel item. + # [Google Chat apps](https://developers.google.com/workspace/chat): + # @!attribute [rw] widgets + # @return [::Array<::Google::Apps::Card::V1::Card::NestedWidget>] + # A list of widgets displayed in the carousel card. The widgets are + # displayed in the order that they are specified. + # @!attribute [rw] footer_widgets + # @return [::Array<::Google::Apps::Card::V1::Card::NestedWidget>] + # A list of widgets displayed at the bottom of the carousel card. The + # widgets are displayed in the order that they are specified. + class CarouselCard + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Represent an expand and collapse control. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] horizontal_alignment + # @return [::Google::Apps::Card::V1::Widget::HorizontalAlignment] + # The horizontal alignment of the expand and collapse button. + # @!attribute [rw] expand_button + # @return [::Google::Apps::Card::V1::Button] + # Optional. Define a customizable button to expand the section. + # Both expand_button and collapse_button field must be set. Only one + # field set will not take into effect. + # If this field isn't set, the default button is used. + # @!attribute [rw] collapse_button + # @return [::Google::Apps::Card::V1::Button] + # Optional. Define a customizable button to collapse the section. + # Both expand_button and collapse_button field must be set. Only one + # field set will not take into effect. + # If this field isn't set, the default button is used. + class CollapseControl + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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`. + # + # Note: The following fields are mutually exclusive: `action`, `open_link`, `open_dynamic_link_action`, `card`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] open_link + # @return [::Google::Apps::Card::V1::OpenLink] + # If specified, this `onClick` triggers an open link action. + # + # Note: The following fields are mutually exclusive: `open_link`, `action`, `open_dynamic_link_action`, `card`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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): + # + # Note: The following fields are mutually exclusive: `open_dynamic_link_action`, `action`, `open_link`, `card`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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): + # + # Note: The following fields are mutually exclusive: `card`, `action`, `open_link`, `open_dynamic_link_action`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] overflow_menu + # @return [::Google::Apps::Card::V1::OverflowMenu] + # If specified, this `onClick` opens an overflow menu. + # + # Note: The following fields are mutually exclusive: `overflow_menu`, `action`, `open_link`, `open_dynamic_link_action`, `card`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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 otherwise 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): + # @!attribute [rw] required_widgets + # @return [::Array<::String>] + # Optional. Fill this list with the names of widgets that this Action + # needs for a valid submission. + # + # If the widgets listed here don't have a value when this Action is invoked, + # the form submission is aborted. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] all_widgets_are_required + # @return [::Boolean] + # Optional. If this is true, then all widgets are considered required by + # this action. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + 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 + + # Represents the necessary data for validating the widget it's attached to. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] character_limit + # @return [::Integer] + # Specify the character limit for text input widgets. Note that this is + # only used for text input and is ignored for other widgets. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] input_type + # @return [::Google::Apps::Card::V1::Validation::InputType] + # Specify the type of the input widgets. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + class Validation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the input widget. + module InputType + # Unspecified type. Do not use. + INPUT_TYPE_UNSPECIFIED = 0 + + # Regular text that accepts all characters. + TEXT = 1 + + # An integer value. + INTEGER = 2 + + # A float value. + FLOAT = 3 + + # An email address. + EMAIL = 4 + + # A emoji selected from system-provided emoji picker. + EMOJI_PICKER = 5 + end + end + + # A list of chips layed out horizontally, which can either scroll horizontally + # or wrap to the next line. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!attribute [rw] layout + # @return [::Google::Apps::Card::V1::ChipList::Layout] + # Specified chip list layout. + # @!attribute [rw] chips + # @return [::Array<::Google::Apps::Card::V1::Chip>] + # An array of chips. + class ChipList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The chip list layout. + module Layout + # Don't use. Unspecified. + LAYOUT_UNSPECIFIED = 0 + + # Default value. The chip list wraps to the next line if there isn't enough + # horizontal space. + WRAPPED = 1 + + # The chips scroll horizontally if they don't fit in the available space. + HORIZONTAL_SCROLLABLE = 2 + end + end + + # A text, icon, or text and icon chip that users can click. + # + # [Google Workspace add-ons and Chat + # apps](https://developers.google.com/workspace/extend): + # @!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] label + # @return [::String] + # The text displayed inside the chip. + # @!attribute [rw] on_click + # @return [::Google::Apps::Card::V1::OnClick] + # Optional. The action to perform when a user clicks the chip, such as + # opening a hyperlink or running a custom function. + # @!attribute [rw] enabled + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Whether the chip is in an active state and responds to user actions. + # Defaults to `true`. + # Deprecated. Use `disabled` instead. + # @!attribute [rw] disabled + # @return [::Boolean] + # Whether the chip is in an inactive state and ignores user actions. + # Defaults to `false`. + # @!attribute [rw] alt_text + # @return [::String] + # The alternative text that's used for accessibility. + # + # Set descriptive text that lets users know what the chip does. For + # example, if a chip opens a hyperlink, write: "Opens a new + # browser tab and navigates to the Google Chat developer documentation at + # https://developers.google.com/workspace/chat". + class Chip + 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/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..73afb3c5bac3 --- /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 2026 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..d2decee6b393 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/annotation.rb @@ -0,0 +1,326 @@ +# frozen_string_literal: true + +# Copyright 2026 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 can be associated with the plain-text body of the + # message or with chips that link to Google Workspace resources like Google + # Docs or Sheets with `start_index` and `length` of 0. 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. If not present, indicates a length of 0. + # @!attribute [rw] user_mention + # @return [::Google::Apps::Chat::V1::UserMentionMetadata] + # The metadata of user mention. + # + # Note: The following fields are mutually exclusive: `user_mention`, `slash_command`, `rich_link_metadata`, `custom_emoji_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] slash_command + # @return [::Google::Apps::Chat::V1::SlashCommandMetadata] + # The metadata for a slash command. + # + # Note: The following fields are mutually exclusive: `slash_command`, `user_mention`, `rich_link_metadata`, `custom_emoji_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] rich_link_metadata + # @return [::Google::Apps::Chat::V1::RichLinkMetadata] + # The metadata for a rich link. + # + # Note: The following fields are mutually exclusive: `rich_link_metadata`, `user_mention`, `slash_command`, `custom_emoji_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] custom_emoji_metadata + # @return [::Google::Apps::Chat::V1::CustomEmojiMetadata] + # The metadata for a custom emoji. + # + # Note: The following fields are mutually exclusive: `custom_emoji_metadata`, `user_mention`, `slash_command`, `rich_link_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. Rich links can be associated with the plain-text + # body of the message or represent chips that link to Google Workspace + # resources like Google Docs or Sheets with `start_index` and `length` + # of 0. + # @!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. + # + # Note: The following fields are mutually exclusive: `drive_link_data`, `chat_space_link_data`, `meet_space_link_data`, `calendar_event_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] chat_space_link_data + # @return [::Google::Apps::Chat::V1::ChatSpaceLinkData] + # Data for a chat space link. + # + # Note: The following fields are mutually exclusive: `chat_space_link_data`, `drive_link_data`, `meet_space_link_data`, `calendar_event_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] meet_space_link_data + # @return [::Google::Apps::Chat::V1::MeetSpaceLinkData] + # Data for a Meet space link. + # + # Note: The following fields are mutually exclusive: `meet_space_link_data`, `drive_link_data`, `chat_space_link_data`, `calendar_event_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] calendar_event_link_data + # @return [::Google::Apps::Chat::V1::CalendarEventLinkData] + # Data for a Calendar event link. + # + # Note: The following fields are mutually exclusive: `calendar_event_link_data`, `drive_link_data`, `chat_space_link_data`, `meet_space_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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 + + # A Gmail message rich link type. Specifically, a Gmail chip from [Share to + # Chat](https://support.google.com/chat?p=chat_gmail). The API only + # supports reading messages with GMAIL_MESSAGE rich links. + GMAIL_MESSAGE = 3 + + # A Meet message rich link type. For example, a Meet chip. + MEET_SPACE = 4 + + # A Calendar message rich link type. For example, a Calendar chip. + CALENDAR_EVENT = 5 + end + end + + # Annotation metadata for custom emoji. + # @!attribute [rw] custom_emoji + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # The custom emoji. + class CustomEmojiMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + 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 + + # Data for Meet space links. + # @!attribute [rw] meeting_code + # @return [::String] + # Meeting code of the linked Meet space. + # @!attribute [rw] type + # @return [::Google::Apps::Chat::V1::MeetSpaceLinkData::Type] + # Indicates the type of the Meet space. + # @!attribute [r] huddle_status + # @return [::Google::Apps::Chat::V1::MeetSpaceLinkData::HuddleStatus] + # Optional. Output only. If the Meet is a Huddle, indicates the status of the + # huddle. Otherwise, this is unset. + class MeetSpaceLinkData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the Meet space. + module Type + # Default value for the enum. Don't use. + TYPE_UNSPECIFIED = 0 + + # The Meet space is a meeting. + MEETING = 1 + + # The Meet space is a huddle. + HUDDLE = 2 + end + + # The status of the huddle + module HuddleStatus + # Default value for the enum. Don't use. + HUDDLE_STATUS_UNSPECIFIED = 0 + + # The huddle has started. + STARTED = 1 + + # The huddle has ended. In this case the Meet space URI and identifiers + # will no longer be valid. + ENDED = 2 + + # The huddle has been missed. In this case the Meet space URI and + # identifiers will no longer be valid. + MISSED = 3 + end + end + + # Data for Calendar event links. + # @!attribute [rw] calendar_id + # @return [::String] + # The [Calendar + # identifier](https://developers.google.com/workspace/calendar/api/v3/reference/calendars) + # of the linked Calendar. + # @!attribute [rw] event_id + # @return [::String] + # The [Event + # identifier](https://developers.google.com/workspace/calendar/api/v3/reference/events) + # of the linked Calendar event. + class CalendarEventLinkData + 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 + + # A custom emoji annotation. + CUSTOM_EMOJI = 4 + 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..267cc982cbf7 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/attachment.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# Copyright 2026 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] + # Identifier. Resource name of the attachment. + # + # Format: `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] + # Optional. A reference to the attachment data. This field is used to + # create or update messages with attachments, or with the media API to + # download the attachment data. + # + # Note: The following fields are mutually exclusive: `attachment_data_ref`, `drive_data_ref`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. + # + # Note: The following fields are mutually exclusive: `drive_data_ref`, `attachment_data_ref`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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] + # Optional. 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] + # Optional. 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..e232c4df441e --- /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 2026 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..c8d0e9847622 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/deletion_metadata.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 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. More values may be added in + # the future. See [Edit or delete a message in Google + # Chat](https://support.google.com/chat/answer/7653281) for details on when + # messages can be deleted. + module DeletionType + # This value is unused. + DELETION_TYPE_UNSPECIFIED = 0 + + # User deleted their own message. + CREATOR = 1 + + # An owner or manager deleted the message. + SPACE_OWNER = 2 + + # A Google Workspace administrator deleted the message. Administrators can + # delete any message in the space, including messages sent by any space + # member or Chat app. + 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 creator (using user + # authentication). + CREATOR_VIA_APP = 5 + + # A Chat app deleted the message on behalf of a space manager (using user + # authentication). + SPACE_OWNER_VIA_APP = 6 + + # A member of the space deleted the message. Users can delete messages sent + # by apps. + SPACE_MEMBER = 7 + 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..887b054a011b --- /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 2026 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`, 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..331f3a1590be --- /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 2026 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..22153abf2dd9 --- /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 2026 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..5d7a0eb4ab8c --- /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 2026 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..f9b3e38b718f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb @@ -0,0 +1,444 @@ +# frozen_string_literal: true + +# Copyright 2026 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] + # Identifier. 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] + # Optional. 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`. + # + # Note: The following fields are mutually exclusive: `member`, `group_member`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] group_member + # @return [::Google::Apps::Chat::V1::Group] + # Optional. The Google Group the membership corresponds to. + # + # Reading or mutating memberships for Google Groups requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # Note: The following fields are mutually exclusive: `group_member`, `member`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. In the Chat UI, this role is called Member. + # + # The user has basic permissions, like sending + # messages to the space. + # Managers and owners can grant members additional permissions in a space, + # including: + # + # - Add or remove members. + # - Modify space details. + # - Turn history on or off. + # - Mention everyone in the space with `@all`. + # - Manage Chat apps and webhooks installed in the space. + # + # In direct messages and unnamed group conversations, everyone + # has this role. + ROLE_MEMBER = 1 + + # A space owner. In the Chat UI, this role is called Owner. + # + # The user has the complete set of space permissions to manage the space, + # including: + # + # - Change the role of other members in the space to member, manager, or + # owner. + # - Delete the space. + # + # Only supported in + # {::Google::Apps::Chat::V1::Space::SpaceType SpaceType.SPACE} (named spaces). + # + # To learn more, see + # [Learn more about your role as a space + # owner or manager](https://support.google.com/chat/answer/11833441). + ROLE_MANAGER = 2 + + # A space manager. In the Chat UI, this role is called Manager. + # + # The user has all basic permissions of `ROLE_MEMBER`, + # and can be granted a subset of administrative permissions by an owner. + # By default, managers have all the permissions of an owner except for the + # ability to: + # + # - Delete the space. + # - Make another space member an owner. + # - Change an owner's role. + # + # By default, managers permissions include but aren't limited to: + # + # - Make another member a manager. + # - Delete messages in the space. + # - Manage space permissions. + # - Receive notifications for requests to join the space if the manager + # has the "manage members" permission in the space settings. + # - Make a space discoverable. + # + # Only supported in + # {::Google::Apps::Chat::V1::Space::SpaceType SpaceType.SPACE} (named spaces). + # + # To learn more, see + # [Manage space settings](https://support.google.com/chat/answer/13340792). + ROLE_ASSISTANT_MANAGER = 4 + 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 + # certain authorization scopes and set specific values for certain fields: + # + # - When [authenticating as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the `chat.memberships` authorization scope is required. + # + # - When [authenticating as an + # app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), + # the `chat.app.memberships` authorization scope is required. + # + # - 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`. + # + # Inviting users external to the Workspace organization that owns the space + # requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # + # When a Chat app creates a membership relation for itself, it must + # [authenticate as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # and 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] + # Optional. 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] + # Optional. 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] + # Optional. 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` + # + # 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] + # Optional. 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 + # with [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # or the `chat.memberships.app` scope with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and the `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] + # Optional. 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..7106929cb03b --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/message.rb @@ -0,0 +1,763 @@ +# frozen_string_literal: true + +# Copyright 2026 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] + # Identifier. 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] + # Optional. 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. + # + # * Bullet list items using asterisks (`*`)—for example, `* item`. + # + # 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>] + # Optional. 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 can be associated with the plain-text body of the + # message or with chips that link to Google Workspace resources like Google + # Docs or Sheets with `start_index` and `length` of 0. + # @!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 [r] space + # @return [::Google::Apps::Chat::V1::Space] + # Output only. If your Chat app [authenticates as a + # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), + # the output only populates the + # [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + # `name`. + # @!attribute [rw] fallback_text + # @return [::String] + # Optional. 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>] + # Optional. 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] + # Optional. 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) + # + # 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 [rw] quoted_message_metadata + # @return [::Google::Apps::Chat::V1::QuotedMessageMetadata] + # Optional. Information about a message that another message quotes. + # + # When you create a message, you can quote messages within the same + # thread, or quote a root message to create a new root message. + # However, you can't quote a message reply from a different thread. + # + # When you update a message, you can't add or replace the + # `quotedMessageMetadata` field, but you can remove it. + # + # For example usage, see [Quote another + # message](https://developers.google.com/workspace/chat/create-messages#quote-a-message). + # @!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>] + # Optional. 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 message that another message quotes. + # + # When you create a message, you can quote messages within the same + # thread, or quote a root message to create a new root message. + # However, you can't quote a message reply from a different thread. + # + # When you update a message, you can't add or replace the + # `quotedMessageMetadata` field, but you can remove it. + # + # For example usage, see [Quote another + # message](https://developers.google.com/workspace/chat/create-messages#quote-a-message). + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the message that is quoted. + # + # Format: `spaces/{space}/messages/{message}` + # @!attribute [rw] last_update_time + # @return [::Google::Protobuf::Timestamp] + # Required. The timestamp when the quoted message was created or when the + # quoted message was last updated. + # + # If the message was edited, use this field, `last_update_time`. + # If the message was never edited, use `create_time`. + # + # If `last_update_time` doesn't match the latest version of the quoted + # message, the request fails. + # @!attribute [rw] quote_type + # @return [::Google::Apps::Chat::V1::QuotedMessageMetadata::QuoteType] + # Optional. Specifies the quote type. If not set, defaults to REPLY in the + # message read/write path for backward compatibility. + # @!attribute [r] quoted_message_snapshot + # @return [::Google::Apps::Chat::V1::QuotedMessageSnapshot] + # Output only. A snapshot of the quoted message's content. + # @!attribute [r] forwarded_metadata + # @return [::Google::Apps::Chat::V1::ForwardedMetadata] + # Output only. Metadata about the source space of the quoted message. + # Populated only for FORWARD quote type. + class QuotedMessageMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The quote type of the quoted message. + module QuoteType + # Reserved. This value is unused. + QUOTE_TYPE_UNSPECIFIED = 0 + + # If quote_type is `REPLY`, you can do the following: + # + # * If you're replying in a thread, you can quote another message in that + # thread. + # + # * If you're creating a root message, you can quote another root message + # in that space. + # + # You can't quote a message reply from a different thread. + REPLY = 1 + end + end + + # Provides a snapshot of the content of the quoted message at the time of + # quoting or forwarding + # @!attribute [r] sender + # @return [::String] + # Output only. The quoted message's author name. + # Populated for both REPLY & FORWARD quote types. + # @!attribute [r] text + # @return [::String] + # Output only. Snapshot of the quoted message's text content. + # @!attribute [r] formatted_text + # @return [::String] + # Output only. Contains the quoted message `text` with markups added to + # support rich formatting like hyperlinks,custom emojis, markup, etc. + # Populated only for FORWARD quote type. + # @!attribute [r] annotations + # @return [::Array<::Google::Apps::Chat::V1::Annotation>] + # Output only. Annotations parsed from the text body of the quoted message. + # Populated only for FORWARD quote type. + # @!attribute [r] attachments + # @return [::Array<::Google::Apps::Chat::V1::Attachment>] + # Output only. Attachments that were part of the quoted message. These are + # copies of the quoted message's attachment metadata. Populated only for + # FORWARD quote type. + class QuotedMessageSnapshot + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata about the source space from which a message was forwarded. + # @!attribute [r] space + # @return [::String] + # Output only. The resource name of the source space. + # Format: spaces/\\{space} + # @!attribute [r] space_display_name + # @return [::String] + # Output only. The display name of the source space or DM at the time of + # forwarding. For `SPACE`, this is the space name. For `DIRECT_MESSAGE`, this + # is the other participant's name (e.g., "User A"). For `GROUP_CHAT`, this is + # a generated name based on members' first names, limited to 5 including the + # creator (e.g., "User A, User B"). + class ForwardedMetadata + 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] + # Identifier. 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 + + # For `selectionInput` widgets, returns autocomplete suggestions for a + # multiselect menu. + # @!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] + # Optional. 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).) + # + # - `quoted_message_metadata` (Only allows removal of the quoted message.) + # @!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. + # + # When [responding to user + # interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), + # this field is ignored. For interactions within a thread, the reply is + # created in the same thread. Otherwise, the reply is created as a new + # thread. + # @!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] + # Optional. 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. 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] + # Optional. 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. 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] + # Optional. 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..df34012e3f49 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/reaction.rb @@ -0,0 +1,322 @@ +# frozen_string_literal: true + +# Copyright 2026 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] + # Identifier. 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] + # Required. 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] + # Optional. A basic emoji represented by a unicode string. + # + # Note: The following fields are mutually exclusive: `unicode`, `custom_emoji`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] custom_emoji + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # A custom emoji. + # + # Note: The following fields are mutually exclusive: `custom_emoji`, `unicode`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Emoji + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a [custom emoji](https://support.google.com/chat/answer/12800149). + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the custom emoji, assigned by the server. + # + # Format: `customEmojis/{customEmoji}` + # @!attribute [r] uid + # @return [::String] + # Output only. Unique key for the custom emoji resource. + # @!attribute [rw] emoji_name + # @return [::String] + # Optional. Immutable. User-provided name for the custom emoji, which is + # unique within the organization. + # + # Required when the custom emoji is created, output only otherwise. + # + # Emoji names must start and end with colons, must be lowercase and can only + # contain alphanumeric characters, hyphens, and underscores. + # Hyphens and underscores should be used to separate words and cannot be used + # consecutively. + # + # Example: `:valid-emoji-name:` + # @!attribute [r] temporary_image_uri + # @return [::String] + # Output only. A temporary image URL for the custom emoji, valid for at least + # 10 minutes. Note that this is not populated in the response when the custom + # emoji is created. + # @!attribute [rw] payload + # @return [::Google::Apps::Chat::V1::CustomEmoji::CustomEmojiPayload] + # Optional. Input only. Payload data. + # Required when the custom emoji is created. + class CustomEmoji + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Payload data for the custom emoji. + # @!attribute [rw] file_content + # @return [::String] + # Required. Input only. The image used for the custom emoji. + # + # The payload must be under 256 KB and the dimension of + # the image must be square and between 64 and 500 pixels. The + # restrictions are subject to change. + # @!attribute [rw] filename + # @return [::String] + # Required. Input only. The image file name. + # + # Supported file extensions: `.png`, `.jpg`, `.gif`. + class CustomEmojiPayload + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The number of people who reacted to a message with a specific emoji. + # @!attribute [r] emoji + # @return [::Google::Apps::Chat::V1::Emoji] + # Output only. Emoji associated with the reactions. + # @!attribute [r] reaction_count + # @return [::Integer] + # Output only. 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 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 + + # A request to create a custom emoji. + # @!attribute [rw] custom_emoji + # @return [::Google::Apps::Chat::V1::CustomEmoji] + # Required. The custom emoji to create. + class CreateCustomEmojiRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to return a single custom emoji. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the custom emoji. + # + # Format: `customEmojis/{customEmoji}` + # + # You can use the emoji name as an alias for `{customEmoji}`. For example, + # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name + # for a custom emoji. + class GetCustomEmojiRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to return a list of custom emojis. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of custom emojis returned. The service can + # return fewer custom emojis than this value. If unspecified, the default + # value is 25. The maximum value is 200; values above 200 are changed to 200. + # @!attribute [rw] page_token + # @return [::String] + # Optional. (If resuming from a previous query.) + # + # A page token received from a previous list custom emoji call. Provide this + # to retrieve the subsequent page. + # + # When paginating, the filter value should match the call that provided the + # page token. Passing a different value might lead to unexpected results. + # @!attribute [rw] filter + # @return [::String] + # Optional. A query filter. + # + # Supports filtering by creator. + # + # To filter by creator, you must specify a valid value. Currently only + # `creator("users/me")` and `NOT creator("users/me")` are accepted to filter + # custom emojis by whether they were created by the calling user or not. + # + # For example, the following query returns custom emojis created by the + # caller: + # ``` + # creator("users/me") + # ``` + # + # Invalid queries are rejected with an `INVALID_ARGUMENT` error. + class ListCustomEmojisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A response to list custom emojis. + # @!attribute [rw] custom_emojis + # @return [::Array<::Google::Apps::Chat::V1::CustomEmoji>] + # Unordered list. List of custom emojis. + # @!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 ListCustomEmojisResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for deleting a custom emoji. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the custom emoji to delete. + # + # Format: `customEmojis/{customEmoji}` + # + # You can use the emoji name as an alias for `{customEmoji}`. For example, + # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name + # for a custom emoji. + class DeleteCustomEmojiRequest + 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/section.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/section.rb new file mode 100644 index 000000000000..856bb8a1b7f5 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/section.rb @@ -0,0 +1,332 @@ +# frozen_string_literal: true + +# Copyright 2026 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 [section](https://support.google.com/chat/answer/16059854) in + # Google Chat. Sections help users organize their spaces. There are two types + # of sections: + # + # 1. **System Sections:** These are predefined sections managed by Google + # Chat. + # Their resource names are fixed, and they cannot be created, deleted, or + # have their `display_name` modified. Examples include: + # * `users/{user}/sections/default-direct-messages` + # * `users/{user}/sections/default-spaces` + # * `users/{user}/sections/default-apps` + # + # 2. **Custom Sections:** These are sections created and managed by the user. + # Creating a custom section using `CreateSection` **requires** a + # `display_name`. Custom sections can be updated using `UpdateSection` and + # deleted using `DeleteSection`. + # @!attribute [rw] name + # @return [::String] + # Identifier. Resource name of the section. + # + # For system sections, the section ID is a constant string: + # + # - DEFAULT_DIRECT_MESSAGES: `users/{user}/sections/default-direct-messages` + # - DEFAULT_SPACES: `users/{user}/sections/default-spaces` + # - DEFAULT_APPS: `users/{user}/sections/default-apps` + # + # Format: `users/{user}/sections/{section}` + # @!attribute [rw] display_name + # @return [::String] + # Optional. The section's display name. Only populated for sections of type + # `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a + # `CUSTOM_SECTION`. + # @!attribute [rw] sort_order + # @return [::Integer] + # Output only. The order of the section in relation to other sections. + # Sections with a lower `sort_order` value appear before sections with a + # higher value. + # @!attribute [rw] type + # @return [::Google::Apps::Chat::V1::Section::SectionType] + # Required. The type of the section. + class Section + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Section types. + module SectionType + # Unspecified section type. + SECTION_TYPE_UNSPECIFIED = 0 + + # Custom section. + CUSTOM_SECTION = 1 + + # Default section containing + # [DIRECT_MESSAGE](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype) + # between two human users or + # [GROUP_CHAT](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype) + # spaces that don't belong to any custom section. + DEFAULT_DIRECT_MESSAGES = 2 + + # Default spaces that don't belong to any custom section. + DEFAULT_SPACES = 3 + + # Default section containing a user's installed apps. + DEFAULT_APPS = 6 + end + end + + # A user's defined section item. This is used to represent section items, such + # as spaces, grouped under a section. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the section item. + # + # Format: `users/{user}/sections/{section}/items/{item}` + # @!attribute [rw] space + # @return [::String] + # Optional. The space resource name. + # + # Format: `spaces/{space}` + class SectionItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating a section. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name where the section is created. + # + # Format: `users/{user}` + # @!attribute [rw] section + # @return [::Google::Apps::Chat::V1::Section] + # Required. The section to create. + class CreateSectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting a section. + # [Developer Preview](https://developers.google.com/workspace/preview). + # @!attribute [rw] name + # @return [::String] + # Required. The name of the section to delete. + # + # Format: `users/{user}/sections/{section}` + class DeleteSectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a section. + # @!attribute [rw] section + # @return [::Google::Apps::Chat::V1::Section] + # Required. The section to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The mask to specify which fields to update. + # + # Currently supported field paths: + # + # - `display_name` + class UpdateSectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing sections. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which is the user resource name that owns this + # collection of sections. Only supports listing sections for the calling + # user. To refer to the calling user, set one of the following: + # + # - The `me` alias. For example, `users/me`. + # + # - Their Workspace email address. For example, `users/user@example.com`. + # + # - Their user id. For example, `users/123456789`. + # + # Format: `users/{user}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of sections to return. The service may return + # fewer than this value. + # + # If unspecified, at most 10 sections will be returned. + # + # The maximum value is 100. If you use a value more than 100, it's + # automatically changed to 100. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous list sections call. + # Provide this 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. + class ListSectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing sections. + # @!attribute [rw] sections + # @return [::Array<::Google::Apps::Chat::V1::Section>] + # The sections from the specified user. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListSectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for positioning a section. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the section to position. + # + # Format: `users/{user}/sections/{section}` + # @!attribute [rw] sort_order + # @return [::Integer] + # Optional. The absolute position of the section in the list of sections. + # The position must be greater than 0. If the position is greater than the + # number of sections, the section will be appended to the end of the list. + # This operation inserts the section at the given position and shifts the + # original section at that position, and those below it, to the next + # position. + # + # Note: The following fields are mutually exclusive: `sort_order`, `relative_position`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] relative_position + # @return [::Google::Apps::Chat::V1::PositionSectionRequest::Position] + # Optional. The relative position of the section in the list of sections. + # + # Note: The following fields are mutually exclusive: `relative_position`, `sort_order`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class PositionSectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The position of the section. + module Position + # Unspecified position. + POSITION_UNSPECIFIED = 0 + + # Start of the list of sections. + START = 1 + + # End of the list of sections. + Position::END = 2 + end + end + + # Response message for positioning a section. + # @!attribute [rw] section + # @return [::Google::Apps::Chat::V1::Section] + # The updated section. + class PositionSectionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing section items. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which is the section resource name that owns this + # collection of section items. Only supports listing section items for the + # calling user. + # + # When you're filtering by space, use the wildcard `-` to search across all + # sections. For example, `users/{user}/sections/-`. + # + # Format: `users/{user}/sections/{section}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of section items to return. The service may + # return fewer than this value. + # + # If unspecified, at most 10 section items will be returned. + # + # The maximum value is 100. If you use a value more than 100, it's + # automatically changed to 100. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous list section items call. + # Provide this 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. + # + # Currently only supports filtering by space. + # + # For example, `space = spaces/{space}`. + # + # Invalid queries are rejected with an `INVALID_ARGUMENT` error. + class ListSectionItemsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing section items. + # @!attribute [rw] section_items + # @return [::Array<::Google::Apps::Chat::V1::SectionItem>] + # The section items from the specified section. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. If + # this field is omitted, there are no subsequent pages. + class ListSectionItemsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for moving a section item across sections. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the section item to move. + # + # Format: `users/{user}/sections/{section}/items/{item}` + # @!attribute [rw] target_section + # @return [::String] + # Required. The resource name of the section to move the section item to. + # + # Format: `users/{user}/sections/{section}` + class MoveSectionItemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for moving a section item. + # @!attribute [rw] section_item + # @return [::Google::Apps::Chat::V1::SectionItem] + # The updated section item. + class MoveSectionItemResponse + 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..842d5f0743fb --- /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 2026 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 + # Metadata about a [slash + # command](https://developers.google.com/workspace/chat/commands) in + # Google Chat. + # @!attribute [rw] command_id + # @return [::Integer] + # The ID of the slash command. + 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..3ced5251cd86 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb @@ -0,0 +1,912 @@ +# frozen_string_literal: true + +# Copyright 2026 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] + # Identifier. 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] + # Optional. 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] + # Optional. 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] + # Optional. 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] + # Optional. Details about the space including description and rules. + # @!attribute [rw] space_history_state + # @return [::Google::Apps::Chat::V1::HistoryState] + # Optional. 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. + # + # Creating a space in `Import Mode`requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # @!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 [rw] customer + # @return [::String] + # Optional. Immutable. The customer id of the domain of the space. + # Required only when creating a space with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # and `SpaceType` is `SPACE`, otherwise should not be set. + # + # In the format `customers/{customer}`, where `customer` is the `id` from the + # [Admin SDK customer + # resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). + # Private apps can also use the `customers/my_customer` alias to create + # the space in the same Google Workspace organization as the app. + # + # This field isn't populated for direct messages (DMs) or when the space is + # created by non-Google Workspace users. + # @!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. + # + # Setting predefined permission settings supports: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) with the + # `chat.app.spaces` or `chat.app.spaces.create` scopes. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # + # Note: The following fields are mutually exclusive: `predefined_permission_settings`, `permission_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. + # + # Reading and updating permission settings supports: + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) with the + # `chat.app.spaces` scope. Only populated and settable when the Chat app + # created the space. + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # + # Note: The following fields are mutually exclusive: `permission_settings`, `predefined_permission_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] import_mode_expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the space will be automatically deleted by the + # system if it remains in import mode. + # + # Each space created in import mode must exit this mode before this expire + # time using `spaces.completeImport`. + # + # This field is only populated for spaces that were created with import mode. + 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 [r] joined_direct_human_user_count + # @return [::Integer] + # Output only. Count of human users that have directly joined the space, + # not counting users joined by having membership in a joined group. + # @!attribute [r] joined_group_count + # @return [::Integer] + # Output only. 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`. + # + # Reading the target audience supports: + # + # - [User + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # + # - [App + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) + # with [administrator + # approval](https://support.google.com/a?p=chat-app-auth) + # with the `chat.app.spaces` scope. + # + # This field is not populated when using the `chat.bot` scope with [app + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). + # + # Setting the target audience requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + 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). + # + # Creating discoverable spaces requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + 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] + # Optional. Setting for managing members and groups in a space. + # @!attribute [rw] modify_space_details + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Optional. Setting for updating space name, avatar, description and + # guidelines. + # @!attribute [rw] toggle_history + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Optional. Setting for toggling space history on and off. + # @!attribute [rw] use_at_mention_all + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Optional. Setting for using @all in a space. + # @!attribute [rw] manage_apps + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Optional. Setting for managing apps in a space. + # @!attribute [rw] manage_webhooks + # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] + # Optional. 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] + # Optional. 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] + # Optional. Whether space owners + # ({::Google::Apps::Chat::V1::Membership::MembershipRole::ROLE_MANAGER `ROLE_MANAGER`}) + # have this permission. + # @!attribute [rw] assistant_managers_allowed + # @return [::Boolean] + # Optional. Whether space managers + # {::Google::Apps::Chat::V1::Membership::MembershipRole::ROLE_ASSISTANT_MANAGER `ROLE_ASSISTANT_MANAGER`}) + # have this permission. + # @!attribute [rw] members_allowed + # @return [::Boolean] + # Optional. Whether basic space members + # ({::Google::Apps::Chat::V1::Membership::MembershipRole::ROLE_MEMBER `ROLE_MEMBER`}) + # 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` and `SpaceType.GROUP_CHAT` are supported. + # `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. + # + # 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. + # + # + # 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] + # Optional. 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 get group chat spaces based on user resources. + # @!attribute [rw] users + # @return [::Array<::String>] + # Optional. Resource names of all human users in group chat with the calling + # user. Chat apps can't be included in the request. + # + # The maximum number of users that can be specified in a single request is + # `49`. + # + # 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, to find all group chats with the calling + # user and two other users, with People API profile IDs `123456789` and + # `987654321`, you can use `users/123456789` and `users/987654321`. + # You can also 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. + # @!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 10 spaces are returned. + # + # The maximum value is 30. If you use a value more than 30, it's + # automatically changed to 30. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous call to find group chats. + # Provide this parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the token. Passing different values may lead to unexpected + # results. + # @!attribute [rw] space_view + # @return [::Google::Apps::Chat::V1::SpaceView] + # Requested space view type. If unset, defaults to + # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify + # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, + # for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + class FindGroupChatsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A response containing group chat spaces with exactly the calling user and the + # requested users. + # @!attribute [rw] spaces + # @return [::Array<::Google::Apps::Chat::V1::Space>] + # List of spaces 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 FindGroupChatsResponse + 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 and guidelines. You must + # pass both description and guidelines in the update request as + # {::Google::Apps::Chat::V1::Space::SpaceDetails `SpaceDetails`}. If you only want to + # update one of the fields, pass the existing value for the other field. + # + # `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. + # 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] + # Optional. 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] + # Optional. 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 + + # A view that specifies which fields should be populated on the + # [`Space`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + # resource. + # To ensure compatibility with future releases, we recommend that your code + # account for additional values. + module SpaceView + # The default / unset value. + SPACE_VIEW_UNSPECIFIED = 0 + + # Populates only the Space resource name. + SPACE_VIEW_RESOURCE_NAME_ONLY = 3 + + # Populates Space resource fields. Note: the `permissionSettings` field + # will not be populated. + # Requests that specify SPACE_VIEW_EXPANDED must include scopes that allow + # reading space data, for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + SPACE_VIEW_EXPANDED = 4 + 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..ce5ce1520a57 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_event.rb @@ -0,0 +1,323 @@ +# frozen_string_literal: true + +# Copyright 2026 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` + # + # Note: The following fields are mutually exclusive: `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `message_updated_event_data`, `message_created_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `message_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `message_batch_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `message_batch_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `message_batch_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `space_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `space_batch_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `membership_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `membership_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `membership_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `membership_batch_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `membership_batch_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `membership_batch_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `reaction_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `reaction_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `reaction_batch_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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` + # + # Note: The following fields are mutually exclusive: `reaction_batch_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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] + # Optional. 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_notification_setting.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_notification_setting.rb new file mode 100644 index 000000000000..c5fb842c9a5f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_notification_setting.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +# Copyright 2026 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 notification setting of a user in a space. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the space notification setting. + # Format: `users/{user}/spaces/{space}/spaceNotificationSetting`. + # @!attribute [rw] notification_setting + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting::NotificationSetting] + # The notification setting. + # @!attribute [rw] mute_setting + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting::MuteSetting] + # The space notification mute setting. + class SpaceNotificationSetting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The notification setting types. Other types might be supported in the + # future. + module NotificationSetting + # Reserved. + NOTIFICATION_SETTING_UNSPECIFIED = 0 + + # Notifications are triggered by @mentions, followed threads, first + # message of new threads. All new threads are automatically followed, + # unless manually unfollowed by the user. + ALL = 1 + + # The notification is triggered by @mentions, followed threads, first + # message of new threads. Not available for 1:1 direct messages. + MAIN_CONVERSATIONS = 2 + + # The notification is triggered by @mentions, followed threads. Not + # available for 1:1 direct messages. + FOR_YOU = 3 + + # Notification is off. + OFF = 4 + end + + # The space notification mute setting types. + module MuteSetting + # Reserved. + MUTE_SETTING_UNSPECIFIED = 0 + + # The user will receive notifications for the space based on the + # notification setting. + UNMUTED = 1 + + # The user will not receive any notifications for the space, regardless of + # the notification setting. + MUTED = 2 + end + end + + # Request message to get space notification setting. + # Only supports getting notification setting for the calling user. + # @!attribute [rw] name + # @return [::String] + # Required. Format: users/\\{user}/spaces/\\{space}/spaceNotificationSetting + # + # - `users/me/spaces/{space}/spaceNotificationSetting`, OR + # - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR + # - `users/123456789/spaces/{space}/spaceNotificationSetting`. + # Note: Only the caller's user id or email is allowed in the path. + class GetSpaceNotificationSettingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to update the space notification settings. + # Only supports updating notification setting for the calling user. + # @!attribute [rw] space_notification_setting + # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] + # Required. The resource name for the space notification settings must be + # populated in the form of + # `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields + # specified by `update_mask` are updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Supported field paths: + # + # - `notification_setting` + # + # - `mute_setting` + class UpdateSpaceNotificationSettingRequest + 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..8626d571e426 --- /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 2026 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..9d5764f9eb10 --- /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 2026 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 49 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..3fd4f5308d27 --- /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 2026 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..738e2b830dd7 --- /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 2026 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..a060315291e2 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/widgets.rb @@ -0,0 +1,315 @@ +# frozen_string_literal: true + +# Copyright 2026 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. + # + # Note: The following fields are mutually exclusive: `text_paragraph`, `image`, `key_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image + # @return [::Google::Apps::Chat::V1::WidgetMarkup::Image] + # Display an image in this widget. + # + # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `key_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] key_value + # @return [::Google::Apps::Chat::V1::WidgetMarkup::KeyValue] + # Display a key value item in this widget. + # + # Note: The following fields are mutually exclusive: `key_value`, `text_paragraph`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. + # + # Note: The following fields are mutually exclusive: `text_button`, `image_button`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image_button + # @return [::Google::Apps::Chat::V1::WidgetMarkup::ImageButton] + # A button with image and `onclick` action. + # + # Note: The following fields are mutually exclusive: `image_button`, `text_button`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # + # Note: The following fields are mutually exclusive: `icon`, `icon_url`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] icon_url + # @return [::String] + # The icon specified by a URL. + # + # Note: The following fields are mutually exclusive: `icon_url`, `icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. + # + # Note: The following fields are mutually exclusive: `icon`, `icon_url`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] icon_url + # @return [::String] + # The icon specified by a URL. + # + # Note: The following fields are mutually exclusive: `icon_url`, `icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!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. + # + # Note: The following fields are mutually exclusive: `action`, `open_link`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] open_link + # @return [::Google::Apps::Chat::V1::WidgetMarkup::OpenLink] + # This `onclick` action triggers an open link action if specified. + # + # Note: The following fields are mutually exclusive: `open_link`, `action`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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..ea59f1f91daf --- /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 2026 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..83e4481834a6 --- /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 2026 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..7f3ffc78601a --- /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 2026 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..74352be9c58c --- /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 2026 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..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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..8cf36e815510 --- /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 2026 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..5728bc06bc83 --- /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 2026 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 and from color representations in various + # languages over compactness. For example, the fields of this representation + # can be trivially provided to the constructor of `java.awt.Color` in Java; it + # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` + # method in iOS; and, with just a little work, it can be easily formatted into + # a CSS `rgba()` string in JavaScript. + # + # This reference page doesn't have information about the absolute color + # space that should be used to interpret the RGB value—for example, sRGB, + # Adobe RGB, + # DCI-P3, and BT.2020. By default, applications should assume the sRGB color + # space. + # + # When color equality needs to be decided, implementations, unless documented + # otherwise, treat two colors as equal if all their red, green, blue, and alpha + # values each differ by at most `1e-5`. + # + # Example (Java): + # + # import com.google.type.Color; + # + # // ... + # public static java.awt.Color fromProto(Color protocolor) { + # float alpha = protocolor.hasAlpha() + # ? protocolor.getAlpha().getValue() + # : 1.0; + # + # return new java.awt.Color( + # protocolor.getRed(), + # protocolor.getGreen(), + # protocolor.getBlue(), + # alpha); + # } + # + # public static Color toProto(java.awt.Color color) { + # float red = (float) color.getRed(); + # float green = (float) color.getGreen(); + # float blue = (float) color.getBlue(); + # float denominator = 255.0; + # Color.Builder resultBuilder = + # Color + # .newBuilder() + # .setRed(red / denominator) + # .setGreen(green / denominator) + # .setBlue(blue / denominator); + # int alpha = color.getAlpha(); + # if (alpha != 255) { + # result.setAlpha( + # FloatValue + # .newBuilder() + # .setValue(((float) alpha) / denominator) + # .build()); + # } + # return resultBuilder.build(); + # } + # // ... + # + # Example (iOS / Obj-C): + # + # // ... + # static UIColor* fromProto(Color* protocolor) { + # float red = [protocolor red]; + # float green = [protocolor green]; + # float blue = [protocolor blue]; + # FloatValue* alpha_wrapper = [protocolor alpha]; + # float alpha = 1.0; + # if (alpha_wrapper != nil) { + # alpha = [alpha_wrapper value]; + # } + # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; + # } + # + # static Color* toProto(UIColor* color) { + # CGFloat red, green, blue, alpha; + # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { + # return nil; + # } + # Color* result = [[Color alloc] init]; + # [result setRed:red]; + # [result setGreen:green]; + # [result setBlue:blue]; + # if (alpha <= 0.9999) { + # [result setAlpha:floatWrapperWithValue(alpha)]; + # } + # [result autorelease]; + # return result; + # } + # // ... + # + # Example (JavaScript): + # + # // ... + # + # var protoToCssColor = function(rgb_color) { + # var redFrac = rgb_color.red || 0.0; + # var greenFrac = rgb_color.green || 0.0; + # var blueFrac = rgb_color.blue || 0.0; + # var red = Math.floor(redFrac * 255); + # var green = Math.floor(greenFrac * 255); + # var blue = Math.floor(blueFrac * 255); + # + # if (!('alpha' in rgb_color)) { + # return rgbToCssColor(red, green, blue); + # } + # + # var alphaFrac = rgb_color.alpha.value || 0.0; + # var rgbParams = [red, green, blue].join(','); + # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); + # }; + # + # var rgbToCssColor = function(red, green, blue) { + # var rgbNumber = new Number((red << 16) | (green << 8) | blue); + # var hexString = rgbNumber.toString(16); + # var missingZeros = 6 - hexString.length; + # var resultBuilder = ['#']; + # for (var i = 0; i < missingZeros; i++) { + # resultBuilder.push('0'); + # } + # resultBuilder.push(hexString); + # return resultBuilder.join(''); + # }; + # + # // ... + # @!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..bb40ea32bb03 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 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..7780d884f7b9 --- /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 2026 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_custom_emoji.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_custom_emoji.rb new file mode 100644 index 000000000000..c94ea5a3df49 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_custom_emoji.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_CreateCustomEmoji_sync] +require "google/apps/chat/v1" + +## +# Snippet for the create_custom_emoji 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_custom_emoji. +# +def create_custom_emoji + # 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::CreateCustomEmojiRequest.new + + # Call the create_custom_emoji method. + result = client.create_custom_emoji request + + # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. + p result +end +# [END chat_v1_generated_ChatService_CreateCustomEmoji_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..9d98939a2bec --- /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 2026 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..d46bec45fcd0 --- /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 2026 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..e35b50dd340e --- /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 2026 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_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_section.rb new file mode 100644 index 000000000000..3c49151c6fad --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_section.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_CreateSection_sync] +require "google/apps/chat/v1" + +## +# Snippet for the create_section 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_section. +# +def create_section + # 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::CreateSectionRequest.new + + # Call the create_section method. + result = client.create_section request + + # The returned object is of type Google::Apps::Chat::V1::Section. + p result +end +# [END chat_v1_generated_ChatService_CreateSection_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..6288226fb150 --- /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 2026 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_custom_emoji.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_custom_emoji.rb new file mode 100644 index 000000000000..9a243337bab9 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_custom_emoji.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_DeleteCustomEmoji_sync] +require "google/apps/chat/v1" + +## +# Snippet for the delete_custom_emoji 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_custom_emoji. +# +def delete_custom_emoji + # 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::DeleteCustomEmojiRequest.new + + # Call the delete_custom_emoji method. + result = client.delete_custom_emoji request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END chat_v1_generated_ChatService_DeleteCustomEmoji_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..28810050b65b --- /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 2026 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..d370ca3477b9 --- /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 2026 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..d31e218a8a01 --- /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 2026 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_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_section.rb new file mode 100644 index 000000000000..fc431779fe33 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_section.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_DeleteSection_sync] +require "google/apps/chat/v1" + +## +# Snippet for the delete_section 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_section. +# +def delete_section + # 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::DeleteSectionRequest.new + + # Call the delete_section method. + result = client.delete_section request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END chat_v1_generated_ChatService_DeleteSection_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..1e7b0d85a2a1 --- /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 2026 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..d407540c7983 --- /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 2026 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/find_group_chats.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_group_chats.rb new file mode 100644 index 000000000000..1b40d6d14248 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_group_chats.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 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_FindGroupChats_sync] +require "google/apps/chat/v1" + +## +# Snippet for the find_group_chats 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_group_chats. +# +def find_group_chats + # 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::FindGroupChatsRequest.new + + # Call the find_group_chats method. + result = client.find_group_chats 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_FindGroupChats_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..72fc455a360a --- /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 2026 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_custom_emoji.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_custom_emoji.rb new file mode 100644 index 000000000000..ca135422c987 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_custom_emoji.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_GetCustomEmoji_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_custom_emoji 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_custom_emoji. +# +def get_custom_emoji + # 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::GetCustomEmojiRequest.new + + # Call the get_custom_emoji method. + result = client.get_custom_emoji request + + # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. + p result +end +# [END chat_v1_generated_ChatService_GetCustomEmoji_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..2b422bce2544 --- /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 2026 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..b3cfa2bc5c8e --- /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 2026 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..eb64ee2159cd --- /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 2026 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..a6dbd9eda4ce --- /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 2026 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_notification_setting.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_notification_setting.rb new file mode 100644 index 000000000000..9df421fdd49b --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_notification_setting.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_GetSpaceNotificationSetting_sync] +require "google/apps/chat/v1" + +## +# Snippet for the get_space_notification_setting 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_notification_setting. +# +def get_space_notification_setting + # 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::GetSpaceNotificationSettingRequest.new + + # Call the get_space_notification_setting method. + result = client.get_space_notification_setting request + + # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. + p result +end +# [END chat_v1_generated_ChatService_GetSpaceNotificationSetting_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..a032a891bd86 --- /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 2026 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..cd83903b80e2 --- /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 2026 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_custom_emojis.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_custom_emojis.rb new file mode 100644 index 000000000000..645d5eb2f847 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_custom_emojis.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 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_ListCustomEmojis_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_custom_emojis 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_custom_emojis. +# +def list_custom_emojis + # 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::ListCustomEmojisRequest.new + + # Call the list_custom_emojis method. + result = client.list_custom_emojis 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::CustomEmoji. + p item + end +end +# [END chat_v1_generated_ChatService_ListCustomEmojis_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..c5dc0c0fb587 --- /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 2026 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..e31af5526d21 --- /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 2026 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..6029f6e48a71 --- /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 2026 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_section_items.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_section_items.rb new file mode 100644 index 000000000000..f247bd33527e --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_section_items.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 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_ListSectionItems_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_section_items 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_section_items. +# +def list_section_items + # 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::ListSectionItemsRequest.new + + # Call the list_section_items method. + result = client.list_section_items 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::SectionItem. + p item + end +end +# [END chat_v1_generated_ChatService_ListSectionItems_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.rb new file mode 100644 index 000000000000..f4514b222b38 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 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_ListSections_sync] +require "google/apps/chat/v1" + +## +# Snippet for the list_sections 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_sections. +# +def list_sections + # 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::ListSectionsRequest.new + + # Call the list_sections method. + result = client.list_sections 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::Section. + p item + end +end +# [END chat_v1_generated_ChatService_ListSections_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..0b151da84944 --- /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 2026 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..79cfa31798a0 --- /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 2026 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/move_section_item.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/move_section_item.rb new file mode 100644 index 000000000000..7032d907a679 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/move_section_item.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_MoveSectionItem_sync] +require "google/apps/chat/v1" + +## +# Snippet for the move_section_item 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#move_section_item. +# +def move_section_item + # 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::MoveSectionItemRequest.new + + # Call the move_section_item method. + result = client.move_section_item request + + # The returned object is of type Google::Apps::Chat::V1::MoveSectionItemResponse. + p result +end +# [END chat_v1_generated_ChatService_MoveSectionItem_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.rb new file mode 100644 index 000000000000..84852724755b --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_PositionSection_sync] +require "google/apps/chat/v1" + +## +# Snippet for the position_section 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#position_section. +# +def position_section + # 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::PositionSectionRequest.new + + # Call the position_section method. + result = client.position_section request + + # The returned object is of type Google::Apps::Chat::V1::PositionSectionResponse. + p result +end +# [END chat_v1_generated_ChatService_PositionSection_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..2a47c75babb2 --- /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 2026 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..ed89acce80f7 --- /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 2026 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..665335a58419 --- /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 2026 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..78396376a8d4 --- /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 2026 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_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_section.rb new file mode 100644 index 000000000000..ecc5dbf0bce5 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_section.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_UpdateSection_sync] +require "google/apps/chat/v1" + +## +# Snippet for the update_section 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_section. +# +def update_section + # 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::UpdateSectionRequest.new + + # Call the update_section method. + result = client.update_section request + + # The returned object is of type Google::Apps::Chat::V1::Section. + p result +end +# [END chat_v1_generated_ChatService_UpdateSection_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..64a7d389e332 --- /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 2026 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_notification_setting.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_notification_setting.rb new file mode 100644 index 000000000000..64830a0a143f --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_notification_setting.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 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_UpdateSpaceNotificationSetting_sync] +require "google/apps/chat/v1" + +## +# Snippet for the update_space_notification_setting 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_notification_setting. +# +def update_space_notification_setting + # 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::UpdateSpaceNotificationSettingRequest.new + + # Call the update_space_notification_setting method. + result = client.update_space_notification_setting request + + # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. + p result +end +# [END chat_v1_generated_ChatService_UpdateSpaceNotificationSetting_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..f76a93be648d --- /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 2026 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..14809b9b3bf4 --- /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 2026 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..572784a7718d --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json @@ -0,0 +1,1735 @@ +{ + "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_FindGroupChats_sync", + "title": "Snippet for the find_group_chats call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#find_group_chats.", + "file": "chat_service/find_group_chats.rb", + "language": "RUBY", + "client_method": { + "short_name": "find_group_chats", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#find_group_chats", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::FindGroupChatsRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::FindGroupChatsResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "FindGroupChats", + "full_name": "google.chat.v1.ChatService.FindGroupChats", + "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_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_CreateCustomEmoji_sync", + "title": "Snippet for the create_custom_emoji call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_custom_emoji.", + "file": "chat_service/create_custom_emoji.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_custom_emoji", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_custom_emoji", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::CreateCustomEmojiRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::CustomEmoji", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "CreateCustomEmoji", + "full_name": "google.chat.v1.ChatService.CreateCustomEmoji", + "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_GetCustomEmoji_sync", + "title": "Snippet for the get_custom_emoji call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_custom_emoji.", + "file": "chat_service/get_custom_emoji.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_custom_emoji", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_custom_emoji", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetCustomEmojiRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::CustomEmoji", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetCustomEmoji", + "full_name": "google.chat.v1.ChatService.GetCustomEmoji", + "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_ListCustomEmojis_sync", + "title": "Snippet for the list_custom_emojis call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_custom_emojis.", + "file": "chat_service/list_custom_emojis.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_custom_emojis", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_custom_emojis", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListCustomEmojisRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListCustomEmojisResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListCustomEmojis", + "full_name": "google.chat.v1.ChatService.ListCustomEmojis", + "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_DeleteCustomEmoji_sync", + "title": "Snippet for the delete_custom_emoji call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_custom_emoji.", + "file": "chat_service/delete_custom_emoji.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_custom_emoji", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_custom_emoji", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::DeleteCustomEmojiRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "DeleteCustomEmoji", + "full_name": "google.chat.v1.ChatService.DeleteCustomEmoji", + "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" + } + ] + }, + { + "region_tag": "chat_v1_generated_ChatService_GetSpaceNotificationSetting_sync", + "title": "Snippet for the get_space_notification_setting call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_space_notification_setting.", + "file": "chat_service/get_space_notification_setting.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_space_notification_setting", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_space_notification_setting", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::SpaceNotificationSetting", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "GetSpaceNotificationSetting", + "full_name": "google.chat.v1.ChatService.GetSpaceNotificationSetting", + "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_UpdateSpaceNotificationSetting_sync", + "title": "Snippet for the update_space_notification_setting call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_space_notification_setting.", + "file": "chat_service/update_space_notification_setting.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_space_notification_setting", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_space_notification_setting", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::SpaceNotificationSetting", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "UpdateSpaceNotificationSetting", + "full_name": "google.chat.v1.ChatService.UpdateSpaceNotificationSetting", + "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_CreateSection_sync", + "title": "Snippet for the create_section call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_section.", + "file": "chat_service/create_section.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_section", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_section", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::CreateSectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Section", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "CreateSection", + "full_name": "google.chat.v1.ChatService.CreateSection", + "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_DeleteSection_sync", + "title": "Snippet for the delete_section call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_section.", + "file": "chat_service/delete_section.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_section", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_section", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::DeleteSectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "DeleteSection", + "full_name": "google.chat.v1.ChatService.DeleteSection", + "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_UpdateSection_sync", + "title": "Snippet for the update_section call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_section.", + "file": "chat_service/update_section.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_section", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_section", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::UpdateSectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::Section", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "UpdateSection", + "full_name": "google.chat.v1.ChatService.UpdateSection", + "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_ListSections_sync", + "title": "Snippet for the list_sections call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_sections.", + "file": "chat_service/list_sections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sections", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_sections", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListSectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListSectionsResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListSections", + "full_name": "google.chat.v1.ChatService.ListSections", + "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_PositionSection_sync", + "title": "Snippet for the position_section call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#position_section.", + "file": "chat_service/position_section.rb", + "language": "RUBY", + "client_method": { + "short_name": "position_section", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#position_section", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::PositionSectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::PositionSectionResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "PositionSection", + "full_name": "google.chat.v1.ChatService.PositionSection", + "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_ListSectionItems_sync", + "title": "Snippet for the list_section_items call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_section_items.", + "file": "chat_service/list_section_items.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_section_items", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_section_items", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::ListSectionItemsRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::ListSectionItemsResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "ListSectionItems", + "full_name": "google.chat.v1.ChatService.ListSectionItems", + "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_MoveSectionItem_sync", + "title": "Snippet for the move_section_item call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#move_section_item.", + "file": "chat_service/move_section_item.rb", + "language": "RUBY", + "client_method": { + "short_name": "move_section_item", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#move_section_item", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::MoveSectionItemRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::MoveSectionItemResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "MoveSectionItem", + "full_name": "google.chat.v1.ChatService.MoveSectionItem", + "service": { + "short_name": "ChatService", + "full_name": "google.chat.v1.ChatService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "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..20b53a27addf --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_paths_test.rb @@ -0,0 +1,223 @@ +# frozen_string_literal: true + +# Copyright 2026 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 + + def stub_logger + nil + end + + def logger + nil + 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_custom_emoji_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.custom_emoji_path custom_emoji: "value0" + assert_equal "customEmojis/value0", 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_section_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.section_path user: "value0", section: "value1" + assert_equal "users/value0/sections/value1", path + end + end + + def test_section_item_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.section_item_path user: "value0", section: "value1", item: "value2" + assert_equal "users/value0/sections/value1/items/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_notification_setting_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_notification_setting_path user: "value0", space: "value1" + assert_equal "users/value0/spaces/value1/spaceNotificationSetting", 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 + + def test_user_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.user_path user: "value0" + assert_equal "users/value0", 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..79671fd08bd0 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb @@ -0,0 +1,2483 @@ +# frozen_string_literal: true + +# Copyright 2026 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: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + 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 + + def stub_logger + nil + end + + def logger + nil + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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_find_group_chats + # Create test objects. + client_result = ::Google::Apps::Chat::V1::FindGroupChatsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + users = ["hello world"] + page_size = 42 + page_token = "hello world" + space_view = :SPACE_VIEW_UNSPECIFIED + + find_group_chats_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_group_chats_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, find_group_chats_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_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.find_group_chats users: users, page_size: page_size, page_token: page_token, space_view: space_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.find_group_chats ::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.find_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.find_group_chats(::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, find_group_chats_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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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_create_custom_emoji + # Create test objects. + client_result = ::Google::Apps::Chat::V1::CustomEmoji.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + custom_emoji = {} + + create_custom_emoji_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_custom_emoji_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_custom_emoji_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_custom_emoji({ custom_emoji: custom_emoji }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_custom_emoji custom_emoji: custom_emoji do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_custom_emoji ::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_custom_emoji({ custom_emoji: custom_emoji }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_custom_emoji(::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_custom_emoji_client_stub.call_count + end + end + end + + def test_get_custom_emoji + # Create test objects. + client_result = ::Google::Apps::Chat::V1::CustomEmoji.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_custom_emoji_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_custom_emoji_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_custom_emoji_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_custom_emoji({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_custom_emoji name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_custom_emoji ::Google::Apps::Chat::V1::GetCustomEmojiRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_custom_emoji({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_custom_emoji(::Google::Apps::Chat::V1::GetCustomEmojiRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_custom_emoji_client_stub.call_count + end + end + end + + def test_list_custom_emojis + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListCustomEmojisResponse.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_custom_emojis_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_custom_emojis_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_custom_emojis_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_custom_emojis({ 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_custom_emojis 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_custom_emojis ::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis({ 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_custom_emojis(::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis_client_stub.call_count + end + end + end + + def test_delete_custom_emoji + # 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_custom_emoji_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_custom_emoji_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_custom_emoji_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_custom_emoji({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_custom_emoji name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_custom_emoji ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_custom_emoji({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_custom_emoji(::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_custom_emoji_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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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:, method_name:| + 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_get_space_notification_setting + # Create test objects. + client_result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_space_notification_setting_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_notification_setting_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_space_notification_setting_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_notification_setting({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_space_notification_setting name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_space_notification_setting ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_space_notification_setting({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_space_notification_setting(::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_space_notification_setting_client_stub.call_count + end + end + end + + def test_update_space_notification_setting + # Create test objects. + client_result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + space_notification_setting = {} + update_mask = {} + + update_space_notification_setting_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_notification_setting_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_space_notification_setting_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_notification_setting({ space_notification_setting: space_notification_setting, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_space_notification_setting space_notification_setting: space_notification_setting, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_space_notification_setting ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_space_notification_setting({ space_notification_setting: space_notification_setting, 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_notification_setting(::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, 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_notification_setting_client_stub.call_count + end + end + end + + def test_create_section + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Section.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + section = {} + + create_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_section_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_section_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_section({ parent: parent, section: section }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_section parent: parent, section: section do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_section ::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_section({ parent: parent, section: section }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_section(::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_section_client_stub.call_count + end + end + end + + def test_delete_section + # 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_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_section_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_section_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_section({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_section name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_section ::Google::Apps::Chat::V1::DeleteSectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_section({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_section(::Google::Apps::Chat::V1::DeleteSectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_section_client_stub.call_count + end + end + end + + def test_update_section + # Create test objects. + client_result = ::Google::Apps::Chat::V1::Section.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + section = {} + update_mask = {} + + update_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_section_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_section_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_section({ section: section, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_section section: section, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_section ::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_section({ section: section, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_section(::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_section_client_stub.call_count + end + end + end + + def test_list_sections + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListSectionsResponse.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" + + list_sections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_sections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sections_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_sections({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_sections parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_sections ::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_sections({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_sections(::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_sections_client_stub.call_count + end + end + end + + def test_position_section + # Create test objects. + client_result = ::Google::Apps::Chat::V1::PositionSectionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + sort_order = 42 + + position_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_position_section_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, position_section_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.position_section({ name: name, sort_order: sort_order }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.position_section name: name, sort_order: sort_order do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.position_section ::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.position_section({ name: name, sort_order: sort_order }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.position_section(::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, position_section_client_stub.call_count + end + end + end + + def test_list_section_items + # Create test objects. + client_result = ::Google::Apps::Chat::V1::ListSectionItemsResponse.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_section_items_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_section_items_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_section_items_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_section_items({ 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_section_items 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_section_items ::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items({ 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_section_items(::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items_client_stub.call_count + end + end + end + + def test_move_section_item + # Create test objects. + client_result = ::Google::Apps::Chat::V1::MoveSectionItemResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + target_section = "hello world" + + move_section_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_move_section_item_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, move_section_item_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.move_section_item({ name: name, target_section: target_section }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.move_section_item name: name, target_section: target_section do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.move_section_item ::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.move_section_item({ name: name, target_section: target_section }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.move_section_item(::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, move_section_item_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..ea47733f4934 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb @@ -0,0 +1,2773 @@ +# frozen_string_literal: true + +# Copyright 2026 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/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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + 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_find_group_chats + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::FindGroupChatsResponse.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. + users = ["hello world"] + page_size = 42 + page_token = "hello world" + space_view = :SPACE_VIEW_UNSPECIFIED + + find_group_chats_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :find_group_chats, name + assert_kind_of ::Google::Apps::Chat::V1::FindGroupChatsRequest, request + assert_equal ["hello world"], request["users"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :SPACE_VIEW_UNSPECIFIED, request["space_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, find_group_chats_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_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }) 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.find_group_chats users: users, page_size: page_size, page_token: page_token, space_view: space_view 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.find_group_chats ::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view) 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.find_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }, 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.find_group_chats(::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view), 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, find_group_chats_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_create_custom_emoji + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::CustomEmoji.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. + custom_emoji = {} + + create_custom_emoji_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_custom_emoji, name + assert_kind_of ::Google::Apps::Chat::V1::CreateCustomEmojiRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::CustomEmoji), request["custom_emoji"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_custom_emoji_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_custom_emoji({ custom_emoji: custom_emoji }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_custom_emoji custom_emoji: custom_emoji do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_custom_emoji ::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_custom_emoji({ custom_emoji: custom_emoji }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_custom_emoji(::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_custom_emoji_client_stub.call_rpc_count + end + end + + def test_get_custom_emoji + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::CustomEmoji.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_custom_emoji_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_custom_emoji, name + assert_kind_of ::Google::Apps::Chat::V1::GetCustomEmojiRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_custom_emoji_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_custom_emoji({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_custom_emoji name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_custom_emoji ::Google::Apps::Chat::V1::GetCustomEmojiRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_custom_emoji({ 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_custom_emoji(::Google::Apps::Chat::V1::GetCustomEmojiRequest.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_custom_emoji_client_stub.call_rpc_count + end + end + + def test_list_custom_emojis + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListCustomEmojisResponse.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_custom_emojis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_custom_emojis, name + assert_kind_of ::Google::Apps::Chat::V1::ListCustomEmojisRequest, 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_custom_emojis_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_custom_emojis({ 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_custom_emojis 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_custom_emojis ::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis({ 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_custom_emojis(::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis_client_stub.call_rpc_count + end + end + + def test_delete_custom_emoji + # 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_custom_emoji_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_custom_emoji, name + assert_kind_of ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_custom_emoji_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_custom_emoji({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_custom_emoji name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_custom_emoji ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_custom_emoji({ 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_custom_emoji(::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.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_custom_emoji_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_get_space_notification_setting + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::SpaceNotificationSetting.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_notification_setting_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_space_notification_setting, name + assert_kind_of ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_space_notification_setting_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_notification_setting({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_space_notification_setting name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_space_notification_setting ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.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_notification_setting({ 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_notification_setting(::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.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_notification_setting_client_stub.call_rpc_count + end + end + + def test_update_space_notification_setting + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::SpaceNotificationSetting.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_notification_setting = {} + update_mask = {} + + update_space_notification_setting_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_space_notification_setting, name + assert_kind_of ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::SpaceNotificationSetting), request["space_notification_setting"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_space_notification_setting_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_notification_setting({ space_notification_setting: space_notification_setting, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_space_notification_setting space_notification_setting: space_notification_setting, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_space_notification_setting ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, 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_notification_setting({ space_notification_setting: space_notification_setting, 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_notification_setting(::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, 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_notification_setting_client_stub.call_rpc_count + end + end + + def test_create_section + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Section.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" + section = {} + + create_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_section, name + assert_kind_of ::Google::Apps::Chat::V1::CreateSectionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Section), request["section"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_section_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_section({ parent: parent, section: section }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_section parent: parent, section: section do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_section ::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_section({ parent: parent, section: section }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_section(::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_section_client_stub.call_rpc_count + end + end + + def test_delete_section + # 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_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_section, name + assert_kind_of ::Google::Apps::Chat::V1::DeleteSectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_section_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_section({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_section name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_section ::Google::Apps::Chat::V1::DeleteSectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_section({ 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_section(::Google::Apps::Chat::V1::DeleteSectionRequest.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_section_client_stub.call_rpc_count + end + end + + def test_update_section + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::Section.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. + section = {} + update_mask = {} + + update_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_section, name + assert_kind_of ::Google::Apps::Chat::V1::UpdateSectionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Section), request["section"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_section_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_section({ section: section, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_section section: section, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_section ::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, 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_section({ section: section, 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_section(::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, 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_section_client_stub.call_rpc_count + end + end + + def test_list_sections + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListSectionsResponse.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" + + list_sections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sections, name + assert_kind_of ::Google::Apps::Chat::V1::ListSectionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_sections_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_sections({ parent: parent, page_size: page_size, page_token: page_token }) 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_sections parent: parent, page_size: page_size, page_token: page_token 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_sections ::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) 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_sections({ parent: parent, page_size: page_size, page_token: page_token }, 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_sections(::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), 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_sections_client_stub.call_rpc_count + end + end + + def test_position_section + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::PositionSectionResponse.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" + sort_order = 42 + + position_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :position_section, name + assert_kind_of ::Google::Apps::Chat::V1::PositionSectionRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["sort_order"] + assert_equal :sort_order, request.position + refute_nil options + end + + Gapic::ServiceStub.stub :new, position_section_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.position_section({ name: name, sort_order: sort_order }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.position_section name: name, sort_order: sort_order do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.position_section ::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.position_section({ name: name, sort_order: sort_order }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.position_section(::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, position_section_client_stub.call_rpc_count + end + end + + def test_list_section_items + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::ListSectionItemsResponse.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_section_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_section_items, name + assert_kind_of ::Google::Apps::Chat::V1::ListSectionItemsRequest, 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_section_items_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_section_items({ 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_section_items 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_section_items ::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items({ 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_section_items(::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items_client_stub.call_rpc_count + end + end + + def test_move_section_item + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::MoveSectionItemResponse.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" + target_section = "hello world" + + move_section_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :move_section_item, name + assert_kind_of ::Google::Apps::Chat::V1::MoveSectionItemRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["target_section"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, move_section_item_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.move_section_item({ name: name, target_section: target_section }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.move_section_item name: name, target_section: target_section do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.move_section_item ::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.move_section_item({ name: name, target_section: target_section }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.move_section_item(::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, move_section_item_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 + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + 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 = creds + end + assert_kind_of ::Google::Apps::Chat::V1::ChatService::Client, client + assert_equal creds, client.configure.credentials + end + 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..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-apps-chat-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 66addece8121d9fc455da1fc14dbfa7fd73588b7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 15 Apr 2026 21:05:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- google-apps-chat-v1/.owlbot-manifest.json | 1 + google-apps-chat-v1/gapic_metadata.json | 5 + .../apps/chat/v1/chat_service/client.rb | 153 + .../apps/chat/v1/chat_service/rest/client.rb | 154 + .../chat/v1/chat_service/rest/service_stub.rb | 59 + .../lib/google/chat/v1/chat_service_pb.rb | 2 +- .../chat/v1/chat_service_services_pb.rb | 21 + .../lib/google/chat/v1/space_pb.rb | 5 +- .../proto_docs/google/chat/v1/space.rb | 86 + .../snippets/chat_service/find_group_chats.rb | 0 .../snippet_metadata_google.chat.v1.json | 40 + .../apps/chat/v1/chat_service_rest_test.rb | 57 + .../google/apps/chat/v1/chat_service_test.rb | 69 + .../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 | 14 - .../google-apps-chat-v1/LICENSE.md | 201 - owl-bot-staging/google-apps-chat-v1/README.md | 154 - owl-bot-staging/google-apps-chat-v1/Rakefile | 169 - .../google-apps-chat-v1/gapic_metadata.json | 233 - .../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 | 6551 ----------------- .../apps/chat/v1/chat_service/credentials.rb | 80 - .../google/apps/chat/v1/chat_service/paths.rb | 289 - .../google/apps/chat/v1/chat_service/rest.rb | 53 - .../apps/chat/v1/chat_service/rest/client.rb | 6271 ---------------- .../chat/v1/chat_service/rest/service_stub.rb | 2713 ------- .../lib/google/apps/chat/v1/rest.rb | 37 - .../lib/google/apps/chat/v1/version.rb | 28 - .../lib/google/chat/v1/action_status_pb.rb | 23 - .../lib/google/chat/v1/annotation_pb.rb | 41 - .../lib/google/chat/v1/attachment_pb.rb | 30 - .../lib/google/chat/v1/chat_service_pb.rb | 35 - .../chat/v1/chat_service_services_pb.rb | 1036 --- .../lib/google/chat/v1/contextual_addon_pb.rb | 28 - .../google/chat/v1/deletion_metadata_pb.rb | 22 - .../lib/google/chat/v1/event_payload_pb.rb | 44 - .../lib/google/chat/v1/group_pb.rb | 21 - .../lib/google/chat/v1/history_state_pb.rb | 21 - .../lib/google/chat/v1/matched_url_pb.rb | 23 - .../lib/google/chat/v1/membership_pb.rb | 36 - .../lib/google/chat/v1/message_pb.rb | 58 - .../lib/google/chat/v1/reaction_pb.rb | 39 - .../lib/google/chat/v1/section_pb.rb | 39 - .../lib/google/chat/v1/slash_command_pb.rb | 21 - .../lib/google/chat/v1/space_event_pb.rb | 29 - .../chat/v1/space_notification_setting_pb.rb | 29 - .../lib/google/chat/v1/space_pb.rb | 51 - .../lib/google/chat/v1/space_read_state_pb.rb | 28 - .../lib/google/chat/v1/space_setup_pb.rb | 25 - .../google/chat/v1/thread_read_state_pb.rb | 26 - .../lib/google/chat/v1/user_pb.rb | 24 - .../lib/google/chat/v1/widgets_pb.rb | 32 - .../google-apps-chat-v1/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 -- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../proto_docs/google/apps/card/v1/card.rb | 2627 ------- .../google/chat/v1/action_status.rb | 40 - .../proto_docs/google/chat/v1/annotation.rb | 326 - .../proto_docs/google/chat/v1/attachment.rb | 137 - .../google/chat/v1/contextual_addon.rb | 120 - .../google/chat/v1/deletion_metadata.rb | 71 - .../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 | 444 -- .../proto_docs/google/chat/v1/message.rb | 763 -- .../proto_docs/google/chat/v1/reaction.rb | 322 - .../proto_docs/google/chat/v1/section.rb | 332 - .../google/chat/v1/slash_command.rb | 37 - .../proto_docs/google/chat/v1/space.rb | 912 --- .../proto_docs/google/chat/v1/space_event.rb | 323 - .../chat/v1/space_notification_setting.rb | 114 - .../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 | 315 - .../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 | 148 - .../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_custom_emoji.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_section.rb | 47 - .../snippets/chat_service/create_space.rb | 47 - .../chat_service/delete_custom_emoji.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_section.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_custom_emoji.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 - .../get_space_notification_setting.rb | 47 - .../chat_service/get_space_read_state.rb | 47 - .../chat_service/get_thread_read_state.rb | 47 - .../chat_service/list_custom_emojis.rb | 51 - .../snippets/chat_service/list_memberships.rb | 51 - .../snippets/chat_service/list_messages.rb | 51 - .../snippets/chat_service/list_reactions.rb | 51 - .../chat_service/list_section_items.rb | 51 - .../snippets/chat_service/list_sections.rb | 51 - .../chat_service/list_space_events.rb | 51 - .../snippets/chat_service/list_spaces.rb | 51 - .../chat_service/move_section_item.rb | 47 - .../snippets/chat_service/position_section.rb | 47 - .../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_section.rb | 47 - .../snippets/chat_service/update_space.rb | 47 - .../update_space_notification_setting.rb | 47 - .../chat_service/update_space_read_state.rb | 47 - .../chat_service/upload_attachment.rb | 47 - .../snippet_metadata_google.chat.v1.json | 1735 ----- .../apps/chat/v1/chat_service_paths_test.rb | 223 - .../apps/chat/v1/chat_service_rest_test.rb | 2483 ------- .../google/apps/chat/v1/chat_service_test.rb | 2773 ------- .../google-apps-chat-v1/test/helper.rb | 26 - 145 files changed, 650 insertions(+), 37865 deletions(-) rename {owl-bot-staging/google-apps-chat-v1 => google-apps-chat-v1}/snippets/chat_service/find_group_chats.rb (100%) delete mode 100644 owl-bot-staging/google-apps-chat-v1/.gitignore delete mode 100644 owl-bot-staging/google-apps-chat-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-apps-chat-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-apps-chat-v1/.toys.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/.yardopts delete mode 100644 owl-bot-staging/google-apps-chat-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-apps-chat-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-apps-chat-v1/Gemfile delete mode 100644 owl-bot-staging/google-apps-chat-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-apps-chat-v1/README.md delete mode 100644 owl-bot-staging/google-apps-chat-v1/Rakefile delete mode 100644 owl-bot-staging/google-apps-chat-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-chat-v1/google-apps-chat-v1.gemspec delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google-apps-chat-v1.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/credentials.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/paths.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/rest.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/version.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/action_status_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/annotation_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/attachment_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/contextual_addon_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/deletion_metadata_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/event_payload_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/group_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/history_state_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/matched_url_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/message_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/reaction_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/section_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/slash_command_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_event_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_notification_setting_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_read_state_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_setup_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/thread_read_state_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/user_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/widgets_pb.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/apps/card/v1/card.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/action_status.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/annotation.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/attachment.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/contextual_addon.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/deletion_metadata.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/event_payload.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/group.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/history_state.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/matched_url.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/message.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/reaction.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/section.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/slash_command.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_event.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_notification_setting.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_read_state.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_setup.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/thread_read_state.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/user.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/widgets.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/rpc/code.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/proto_docs/google/type/color.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/complete_import_space.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_custom_emoji.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_membership.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_message.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_reaction.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_section.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_space.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_custom_emoji.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_membership.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_message.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_reaction.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_section.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_space.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_direct_message.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_attachment.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_custom_emoji.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_membership.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_message.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_event.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_notification_setting.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_read_state.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_thread_read_state.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_custom_emojis.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_memberships.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_messages.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_reactions.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_section_items.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_space_events.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_spaces.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/move_section_item.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/search_spaces.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/set_up_space.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_membership.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_message.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_section.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_notification_setting.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_read_state.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/chat_service/upload_attachment.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json delete mode 100644 owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_paths_test.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb delete mode 100644 owl-bot-staging/google-apps-chat-v1/test/helper.rb diff --git a/google-apps-chat-v1/.owlbot-manifest.json b/google-apps-chat-v1/.owlbot-manifest.json index e5f7fe1f2d3f..6b749df9be9f 100644 --- a/google-apps-chat-v1/.owlbot-manifest.json +++ b/google-apps-chat-v1/.owlbot-manifest.json @@ -99,6 +99,7 @@ "snippets/chat_service/delete_section.rb", "snippets/chat_service/delete_space.rb", "snippets/chat_service/find_direct_message.rb", + "snippets/chat_service/find_group_chats.rb", "snippets/chat_service/get_attachment.rb", "snippets/chat_service/get_custom_emoji.rb", "snippets/chat_service/get_membership.rb", diff --git a/google-apps-chat-v1/gapic_metadata.json b/google-apps-chat-v1/gapic_metadata.json index 21f5a6233a8b..d87e86a2906f 100644 --- a/google-apps-chat-v1/gapic_metadata.json +++ b/google-apps-chat-v1/gapic_metadata.json @@ -100,6 +100,11 @@ "find_direct_message" ] }, + "FindGroupChats": { + "methods": [ + "find_group_chats" + ] + }, "CreateMembership": { "methods": [ "create_membership" diff --git a/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb b/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb index 54c3d4709ed3..d90d1730e561 100644 --- a/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb +++ b/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb @@ -161,6 +161,11 @@ def self.configure initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } + default_config.rpcs.find_group_chats.timeout = 30.0 + default_config.rpcs.find_group_chats.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] @@ -3011,6 +3016,147 @@ def find_direct_message request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Returns all spaces with `spaceType == GROUP_CHAT`, whose + # human memberships contain exactly the calling user, and the users specified + # in `FindGroupChatsRequest.users`. Only members that have joined the + # conversation are supported. For an example, see [Find group + # chats](https://developers.google.com/workspace/chat/find-group-chats). + # + # If the calling user blocks, or is blocked by, some users, and no spaces + # with the entire specified set of users are found, this method returns + # spaces that don't include the blocked or blocking users. + # + # The specified set of users must contain only human (non-app) memberships. + # A request that contains non-human users doesn't return any spaces. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # @overload find_group_chats(request, options = nil) + # Pass arguments to `find_group_chats` via a request object, either of type + # {::Google::Apps::Chat::V1::FindGroupChatsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::FindGroupChatsRequest, ::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_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil) + # Pass arguments to `find_group_chats` 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 users [::Array<::String>] + # Optional. Resource names of all human users in group chat with the calling + # user. Chat apps can't be included in the request. + # + # The maximum number of users that can be specified in a single request is + # `49`. + # + # 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, to find all group chats with the calling + # user and two other users, with People API profile IDs `123456789` and + # `987654321`, you can use `users/123456789` and `users/987654321`. + # You can also 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. + # @param page_size [::Integer] + # Optional. The maximum number of spaces to return. The service might return + # fewer than this value. + # + # If unspecified, at most 10 spaces are returned. + # + # The maximum value is 30. If you use a value more than 30, it's + # automatically changed to 30. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous call to find group chats. + # Provide this parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the token. Passing different values may lead to unexpected + # results. + # @param space_view [::Google::Apps::Chat::V1::SpaceView] + # Requested space view type. If unset, defaults to + # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify + # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, + # for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + # + # @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::FindGroupChatsRequest.new + # + # # Call the find_group_chats method. + # result = client.find_group_chats 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 find_group_chats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindGroupChatsRequest + + # 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_group_chats.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_group_chats.timeout, + metadata: metadata, + retry_policy: @config.rpcs.find_group_chats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :find_group_chats, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :find_group_chats, request, response, operation, options + yield response, operation if block_given? + throw :response, 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. @@ -6179,6 +6325,11 @@ class Rpcs # attr_reader :find_direct_message ## + # RPC-specific configuration for `find_group_chats` + # @return [::Gapic::Config::Method] + # + attr_reader :find_group_chats + ## # RPC-specific configuration for `create_membership` # @return [::Gapic::Config::Method] # @@ -6337,6 +6488,8 @@ def initialize parent_rpcs = nil @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 + find_group_chats_config = parent_rpcs.find_group_chats if parent_rpcs.respond_to? :find_group_chats + @find_group_chats = ::Gapic::Config::Method.new find_group_chats_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 diff --git a/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb b/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb index 2802f3ed1b52..d5b6c9a5b1c9 100644 --- a/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb +++ b/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb @@ -163,6 +163,11 @@ def self.configure initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } + default_config.rpcs.find_group_chats.timeout = 30.0 + default_config.rpcs.find_group_chats.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] @@ -2918,6 +2923,148 @@ def find_direct_message request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Returns all spaces with `spaceType == GROUP_CHAT`, whose + # human memberships contain exactly the calling user, and the users specified + # in `FindGroupChatsRequest.users`. Only members that have joined the + # conversation are supported. For an example, see [Find group + # chats](https://developers.google.com/workspace/chat/find-group-chats). + # + # If the calling user blocks, or is blocked by, some users, and no spaces + # with the entire specified set of users are found, this method returns + # spaces that don't include the blocked or blocking users. + # + # The specified set of users must contain only human (non-app) memberships. + # A request that contains non-human users doesn't return any spaces. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + # + # @overload find_group_chats(request, options = nil) + # Pass arguments to `find_group_chats` via a request object, either of type + # {::Google::Apps::Chat::V1::FindGroupChatsRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::FindGroupChatsRequest, ::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_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil) + # Pass arguments to `find_group_chats` 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 users [::Array<::String>] + # Optional. Resource names of all human users in group chat with the calling + # user. Chat apps can't be included in the request. + # + # The maximum number of users that can be specified in a single request is + # `49`. + # + # 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, to find all group chats with the calling + # user and two other users, with People API profile IDs `123456789` and + # `987654321`, you can use `users/123456789` and `users/987654321`. + # You can also 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. + # @param page_size [::Integer] + # Optional. The maximum number of spaces to return. The service might return + # fewer than this value. + # + # If unspecified, at most 10 spaces are returned. + # + # The maximum value is 30. If you use a value more than 30, it's + # automatically changed to 30. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @param page_token [::String] + # Optional. A page token, received from a previous call to find group chats. + # Provide this parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the token. Passing different values may lead to unexpected + # results. + # @param space_view [::Google::Apps::Chat::V1::SpaceView] + # Requested space view type. If unset, defaults to + # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify + # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, + # for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + # @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::FindGroupChatsRequest.new + # + # # Call the find_group_chats method. + # result = client.find_group_chats 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 find_group_chats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindGroupChatsRequest + + # 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_group_chats.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_group_chats.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.find_group_chats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.find_group_chats request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :find_group_chats, "spaces", request, result, options + yield result, operation if block_given? + throw :response, 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. @@ -5897,6 +6044,11 @@ class Rpcs # attr_reader :find_direct_message ## + # RPC-specific configuration for `find_group_chats` + # @return [::Gapic::Config::Method] + # + attr_reader :find_group_chats + ## # RPC-specific configuration for `create_membership` # @return [::Gapic::Config::Method] # @@ -6055,6 +6207,8 @@ def initialize parent_rpcs = nil @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 + find_group_chats_config = parent_rpcs.find_group_chats if parent_rpcs.respond_to? :find_group_chats + @find_group_chats = ::Gapic::Config::Method.new find_group_chats_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 diff --git a/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb b/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb index bc9d099604ae..959013011914 100644 --- a/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb +++ b/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb @@ -793,6 +793,46 @@ def find_direct_message request_pb, options = nil end end + ## + # Baseline implementation for the find_group_chats REST call + # + # @param request_pb [::Google::Apps::Chat::V1::FindGroupChatsRequest] + # 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::FindGroupChatsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::FindGroupChatsResponse] + # A result object deserialized from the server's reply + def find_group_chats request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_find_group_chats_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, + method_name: "find_group_chats", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::FindGroupChatsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + ## # Baseline implementation for the create_membership REST call # @@ -2136,6 +2176,25 @@ def self.transcode_find_direct_message_request request_pb transcoder.transcode request_pb end + ## + # @private + # + # GRPC transcoding helper method for the find_group_chats REST call + # + # @param request_pb [::Google::Apps::Chat::V1::FindGroupChatsRequest] + # 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_group_chats_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/spaces:findGroupChats", + matches: [] + ) + transcoder.transcode request_pb + end + ## # @private # diff --git a/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb b/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb index ce9391d040f0..7670924d5cb7 100644 --- a/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb +++ b/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb @@ -20,7 +20,7 @@ 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\x1cgoogle/chat/v1/section.proto\x1a\x1agoogle/chat/v1/space.proto\x1a google/chat/v1/space_event.proto\x1a/google/chat/v1/space_notification_setting.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\xcc?\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\x91\x01\n\x11\x43reateCustomEmoji\x12(.google.chat.v1.CreateCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"5\xda\x41\x0c\x63ustom_emoji\x82\xd3\xe4\x93\x02 \"\x10/v1/customEmojis:\x0c\x63ustom_emoji\x12~\n\x0eGetCustomEmoji\x12%.google.chat.v1.GetCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{name=customEmojis/*}\x12\x82\x01\n\x10ListCustomEmojis\x12\'.google.chat.v1.ListCustomEmojisRequest\x1a(.google.chat.v1.ListCustomEmojisResponse\"\x1b\xda\x41\x00\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/customEmojis\x12\x7f\n\x11\x44\x65leteCustomEmoji\x12(.google.chat.v1.DeleteCustomEmojiRequest\x1a\x16.google.protobuf.Empty\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v1/{name=customEmojis/*}\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\x12\xc0\x01\n\x1bGetSpaceNotificationSetting\x12\x32.google.chat.v1.GetSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=users/*/spaces/*/spaceNotificationSetting}\x12\xa0\x02\n\x1eUpdateSpaceNotificationSetting\x12\x35.google.chat.v1.UpdateSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"\x9c\x01\xda\x41&space_notification_setting,update_mask\x82\xd3\xe4\x93\x02m2O/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}:\x1aspace_notification_setting\x12\x8f\x01\n\rCreateSection\x12$.google.chat.v1.CreateSectionRequest\x1a\x17.google.chat.v1.Section\"?\xda\x41\x0eparent,section\x82\xd3\xe4\x93\x02(\"\x1d/v1/{parent=users/*}/sections:\x07section\x12{\n\rDeleteSection\x12$.google.chat.v1.DeleteSectionRequest\x1a\x16.google.protobuf.Empty\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=users/*/sections/*}\x12\x9c\x01\n\rUpdateSection\x12$.google.chat.v1.UpdateSectionRequest\x1a\x17.google.chat.v1.Section\"L\xda\x41\x13section,update_mask\x82\xd3\xe4\x93\x02\x30\x32%/v1/{section.name=users/*/sections/*}:\x07section\x12\x89\x01\n\x0cListSections\x12#.google.chat.v1.ListSectionsRequest\x1a$.google.chat.v1.ListSectionsResponse\".\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{parent=users/*}/sections\x12\x95\x01\n\x0fPositionSection\x12&.google.chat.v1.PositionSectionRequest\x1a\'.google.chat.v1.PositionSectionResponse\"1\x82\xd3\xe4\x93\x02+\"&/v1/{name=users/*/sections/*}:position:\x01*\x12\x9d\x01\n\x10ListSectionItems\x12\'.google.chat.v1.ListSectionItemsRequest\x1a(.google.chat.v1.ListSectionItemsResponse\"6\xda\x41\x06parent\x82\xd3\xe4\x93\x02\'\x12%/v1/{parent=users/*/sections/*}/items\x12\xaf\x01\n\x0fMoveSectionItem\x12&.google.chat.v1.MoveSectionItemRequest\x1a\'.google.chat.v1.MoveSectionItemResponse\"K\xda\x41\x13name,target_section\x82\xd3\xe4\x93\x02/\"*/v1/{name=users/*/sections/*/items/*}:move:\x01*\x1a\xbe\x0e\xca\x41\x13\x63hat.googleapis.com\xd2\x41\xa4\x0ehttps://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.app.delete,https://www.googleapis.com/auth/chat.app.memberships,https://www.googleapis.com/auth/chat.app.memberships.readonly,https://www.googleapis.com/auth/chat.app.messages.readonly,https://www.googleapis.com/auth/chat.app.spaces,https://www.googleapis.com/auth/chat.app.spaces.create,https://www.googleapis.com/auth/chat.app.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.customemojis,https://www.googleapis.com/auth/chat.customemojis.readonly,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,https://www.googleapis.com/auth/chat.users.sections,https://www.googleapis.com/auth/chat.users.sections.readonly,https://www.googleapis.com/auth/chat.users.spacesettingsB\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" +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\x1cgoogle/chat/v1/section.proto\x1a\x1agoogle/chat/v1/space.proto\x1a google/chat/v1/space_event.proto\x1a/google/chat/v1/space_notification_setting.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\xd1@\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\x82\x01\n\x0e\x46indGroupChats\x12%.google.chat.v1.FindGroupChatsRequest\x1a&.google.chat.v1.FindGroupChatsResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/spaces:findGroupChats\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\x91\x01\n\x11\x43reateCustomEmoji\x12(.google.chat.v1.CreateCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"5\xda\x41\x0c\x63ustom_emoji\x82\xd3\xe4\x93\x02 \"\x10/v1/customEmojis:\x0c\x63ustom_emoji\x12~\n\x0eGetCustomEmoji\x12%.google.chat.v1.GetCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{name=customEmojis/*}\x12\x82\x01\n\x10ListCustomEmojis\x12\'.google.chat.v1.ListCustomEmojisRequest\x1a(.google.chat.v1.ListCustomEmojisResponse\"\x1b\xda\x41\x00\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/customEmojis\x12\x7f\n\x11\x44\x65leteCustomEmoji\x12(.google.chat.v1.DeleteCustomEmojiRequest\x1a\x16.google.protobuf.Empty\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v1/{name=customEmojis/*}\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\x12\xc0\x01\n\x1bGetSpaceNotificationSetting\x12\x32.google.chat.v1.GetSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=users/*/spaces/*/spaceNotificationSetting}\x12\xa0\x02\n\x1eUpdateSpaceNotificationSetting\x12\x35.google.chat.v1.UpdateSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"\x9c\x01\xda\x41&space_notification_setting,update_mask\x82\xd3\xe4\x93\x02m2O/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}:\x1aspace_notification_setting\x12\x8f\x01\n\rCreateSection\x12$.google.chat.v1.CreateSectionRequest\x1a\x17.google.chat.v1.Section\"?\xda\x41\x0eparent,section\x82\xd3\xe4\x93\x02(\"\x1d/v1/{parent=users/*}/sections:\x07section\x12{\n\rDeleteSection\x12$.google.chat.v1.DeleteSectionRequest\x1a\x16.google.protobuf.Empty\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=users/*/sections/*}\x12\x9c\x01\n\rUpdateSection\x12$.google.chat.v1.UpdateSectionRequest\x1a\x17.google.chat.v1.Section\"L\xda\x41\x13section,update_mask\x82\xd3\xe4\x93\x02\x30\x32%/v1/{section.name=users/*/sections/*}:\x07section\x12\x89\x01\n\x0cListSections\x12#.google.chat.v1.ListSectionsRequest\x1a$.google.chat.v1.ListSectionsResponse\".\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{parent=users/*}/sections\x12\x95\x01\n\x0fPositionSection\x12&.google.chat.v1.PositionSectionRequest\x1a\'.google.chat.v1.PositionSectionResponse\"1\x82\xd3\xe4\x93\x02+\"&/v1/{name=users/*/sections/*}:position:\x01*\x12\x9d\x01\n\x10ListSectionItems\x12\'.google.chat.v1.ListSectionItemsRequest\x1a(.google.chat.v1.ListSectionItemsResponse\"6\xda\x41\x06parent\x82\xd3\xe4\x93\x02\'\x12%/v1/{parent=users/*/sections/*}/items\x12\xaf\x01\n\x0fMoveSectionItem\x12&.google.chat.v1.MoveSectionItemRequest\x1a\'.google.chat.v1.MoveSectionItemResponse\"K\xda\x41\x13name,target_section\x82\xd3\xe4\x93\x02/\"*/v1/{name=users/*/sections/*/items/*}:move:\x01*\x1a\xbe\x0e\xca\x41\x13\x63hat.googleapis.com\xd2\x41\xa4\x0ehttps://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.app.delete,https://www.googleapis.com/auth/chat.app.memberships,https://www.googleapis.com/auth/chat.app.memberships.readonly,https://www.googleapis.com/auth/chat.app.messages.readonly,https://www.googleapis.com/auth/chat.app.spaces,https://www.googleapis.com/auth/chat.app.spaces.create,https://www.googleapis.com/auth/chat.app.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.customemojis,https://www.googleapis.com/auth/chat.customemojis.readonly,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,https://www.googleapis.com/auth/chat.users.sections,https://www.googleapis.com/auth/chat.users.sections.readonly,https://www.googleapis.com/auth/chat.users.spacesettingsB\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 pool.add_serialized_file(descriptor_data) diff --git a/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb b/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb index b0e84d461cb6..3615fac13faa 100644 --- a/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb +++ b/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb @@ -553,6 +553,27 @@ class Service # - `https://www.googleapis.com/auth/chat.spaces.readonly` # - `https://www.googleapis.com/auth/chat.spaces` rpc :FindDirectMessage, ::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Google::Apps::Chat::V1::Space + # Returns all spaces with `spaceType == GROUP_CHAT`, whose + # human memberships contain exactly the calling user, and the users specified + # in `FindGroupChatsRequest.users`. Only members that have joined the + # conversation are supported. For an example, see [Find group + # chats](https://developers.google.com/workspace/chat/find-group-chats). + # + # If the calling user blocks, or is blocked by, some users, and no spaces + # with the entire specified set of users are found, this method returns + # spaces that don't include the blocked or blocking users. + # + # The specified set of users must contain only human (non-app) memberships. + # A request that contains non-human users doesn't return any spaces. + # + # Requires [user + # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) + # with one of the following [authorization + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): + # + # - `https://www.googleapis.com/auth/chat.memberships.readonly` + # - `https://www.googleapis.com/auth/chat.memberships` + rpc :FindGroupChats, ::Google::Apps::Chat::V1::FindGroupChatsRequest, ::Google::Apps::Chat::V1::FindGroupChatsResponse # 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 diff --git a/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb b/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb index b367ea8d106a..7c949866ae56 100644 --- a/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb +++ b/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb @@ -11,7 +11,7 @@ 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\"\xcd\x16\n\x05Space\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1a.google.chat.v1.Space.TypeB\x05\x18\x01\xe0\x41\x03\x12\x38\n\nspace_type\x18\n \x01(\x0e\x32\x1f.google.chat.v1.Space.SpaceTypeB\x03\xe0\x41\x01\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\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12%\n\x15\x65xternal_user_allowed\x18\x08 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x01\x12M\n\x15space_threading_state\x18\t \x01(\x0e\x32).google.chat.v1.Space.SpaceThreadingStateB\x03\xe0\x41\x03\x12>\n\rspace_details\x18\x0b \x01(\x0b\x32\".google.chat.v1.Space.SpaceDetailsB\x03\xe0\x41\x01\x12>\n\x13space_history_state\x18\r \x01(\x0e\x32\x1c.google.chat.v1.HistoryStateB\x03\xe0\x41\x01\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\x1d\n\x08\x63ustomer\x18\x18 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x01H\x01\x88\x01\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\x12@\n\x17import_mode_expire_time\x18\x1c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x41\n\x0cSpaceDetails\x12\x18\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nguidelines\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a_\n\x0fMembershipCount\x12+\n\x1ejoined_direct_human_user_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12joined_group_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\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\xa8\x06\n\x12PermissionSettings\x12T\n\x19manage_members_and_groups\x18\x01 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12O\n\x14modify_space_details\x18\x02 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12I\n\x0etoggle_history\x18\x03 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12M\n\x12use_at_mention_all\x18\x04 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x46\n\x0bmanage_apps\x18\x05 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12J\n\x0fmanage_webhooks\x18\x06 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x12I\n\x0ereply_messages\x18\x08 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x9d\x01\n\x11PermissionSetting\x12\x1d\n\x10managers_allowed\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12,\n\x1a\x61ssistant_managers_allowed\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1c\n\x0fmembers_allowed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1d\n\x1b_assistant_managers_allowed\".\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_settingsB\x0b\n\t_customer\"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\"a\n\x0fGetSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"-\n\x18\x46indDirectMessageRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x94\x01\n\x12UpdateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\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\"d\n\x12\x44\x65leteSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"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" +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\"\xcd\x16\n\x05Space\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1a.google.chat.v1.Space.TypeB\x05\x18\x01\xe0\x41\x03\x12\x38\n\nspace_type\x18\n \x01(\x0e\x32\x1f.google.chat.v1.Space.SpaceTypeB\x03\xe0\x41\x01\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\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12%\n\x15\x65xternal_user_allowed\x18\x08 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x01\x12M\n\x15space_threading_state\x18\t \x01(\x0e\x32).google.chat.v1.Space.SpaceThreadingStateB\x03\xe0\x41\x03\x12>\n\rspace_details\x18\x0b \x01(\x0b\x32\".google.chat.v1.Space.SpaceDetailsB\x03\xe0\x41\x01\x12>\n\x13space_history_state\x18\r \x01(\x0e\x32\x1c.google.chat.v1.HistoryStateB\x03\xe0\x41\x01\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\x1d\n\x08\x63ustomer\x18\x18 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x01H\x01\x88\x01\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\x12@\n\x17import_mode_expire_time\x18\x1c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x41\n\x0cSpaceDetails\x12\x18\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nguidelines\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a_\n\x0fMembershipCount\x12+\n\x1ejoined_direct_human_user_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12joined_group_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\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\xa8\x06\n\x12PermissionSettings\x12T\n\x19manage_members_and_groups\x18\x01 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12O\n\x14modify_space_details\x18\x02 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12I\n\x0etoggle_history\x18\x03 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12M\n\x12use_at_mention_all\x18\x04 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x46\n\x0bmanage_apps\x18\x05 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12J\n\x0fmanage_webhooks\x18\x06 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x12I\n\x0ereply_messages\x18\x08 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x9d\x01\n\x11PermissionSetting\x12\x1d\n\x10managers_allowed\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12,\n\x1a\x61ssistant_managers_allowed\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1c\n\x0fmembers_allowed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1d\n\x1b_assistant_managers_allowed\".\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_settingsB\x0b\n\t_customer\"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\"a\n\x0fGetSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"-\n\x18\x46indDirectMessageRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x8b\x01\n\x15\x46indGroupChatsRequest\x12\x12\n\x05users\x18\x05 \x03(\tB\x03\xe0\x41\x01\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-\n\nspace_view\x18\x04 \x01(\x0e\x32\x19.google.chat.v1.SpaceView\"X\n\x16\x46indGroupChatsResponse\x12%\n\x06spaces\x18\x01 \x03(\x0b\x32\x15.google.chat.v1.Space\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x94\x01\n\x12UpdateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\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\"d\n\x12\x44\x65leteSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"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.Space*c\n\tSpaceView\x12\x1a\n\x16SPACE_VIEW_UNSPECIFIED\x10\x00\x12!\n\x1dSPACE_VIEW_RESOURCE_NAME_ONLY\x10\x03\x12\x17\n\x13SPACE_VIEW_EXPANDED\x10\x04\x42\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 pool.add_serialized_file(descriptor_data) @@ -36,12 +36,15 @@ module V1 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 + FindGroupChatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindGroupChatsRequest").msgclass + FindGroupChatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindGroupChatsResponse").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 + SpaceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceView").enummodule end end end diff --git a/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb b/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb index 5def1fdb76ff..07e2237d81eb 100644 --- a/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb +++ b/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb @@ -539,6 +539,71 @@ class FindDirectMessageRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # A request to get group chat spaces based on user resources. + # @!attribute [rw] users + # @return [::Array<::String>] + # Optional. Resource names of all human users in group chat with the calling + # user. Chat apps can't be included in the request. + # + # The maximum number of users that can be specified in a single request is + # `49`. + # + # 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, to find all group chats with the calling + # user and two other users, with People API profile IDs `123456789` and + # `987654321`, you can use `users/123456789` and `users/987654321`. + # You can also 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. + # @!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 10 spaces are returned. + # + # The maximum value is 30. If you use a value more than 30, it's + # automatically changed to 30. + # + # Negative values return an `INVALID_ARGUMENT` error. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous call to find group chats. + # Provide this parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the token. Passing different values may lead to unexpected + # results. + # @!attribute [rw] space_view + # @return [::Google::Apps::Chat::V1::SpaceView] + # Requested space view type. If unset, defaults to + # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify + # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, + # for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + class FindGroupChatsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A response containing group chat spaces with exactly the calling user and the + # requested users. + # @!attribute [rw] spaces + # @return [::Array<::Google::Apps::Chat::V1::Space>] + # List of spaces 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 FindGroupChatsResponse + 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] @@ -820,6 +885,27 @@ class CompleteImportSpaceResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # A view that specifies which fields should be populated on the + # [`Space`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) + # resource. + # To ensure compatibility with future releases, we recommend that your code + # account for additional values. + module SpaceView + # The default / unset value. + SPACE_VIEW_UNSPECIFIED = 0 + + # Populates only the Space resource name. + SPACE_VIEW_RESOURCE_NAME_ONLY = 3 + + # Populates Space resource fields. Note: the `permissionSettings` field + # will not be populated. + # Requests that specify SPACE_VIEW_EXPANDED must include scopes that allow + # reading space data, for example, + # https://www.googleapis.com/auth/chat.spaces or + # https://www.googleapis.com/auth/chat.spaces.readonly. + SPACE_VIEW_EXPANDED = 4 + end end end end diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_group_chats.rb b/google-apps-chat-v1/snippets/chat_service/find_group_chats.rb similarity index 100% rename from owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_group_chats.rb rename to google-apps-chat-v1/snippets/chat_service/find_group_chats.rb diff --git a/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json b/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json index 91600f32c021..006c2156d510 100644 --- a/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json +++ b/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json @@ -731,6 +731,46 @@ } ] }, + { + "region_tag": "chat_v1_generated_ChatService_FindGroupChats_sync", + "title": "Snippet for the find_group_chats call in the ChatService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#find_group_chats.", + "file": "chat_service/find_group_chats.rb", + "language": "RUBY", + "client_method": { + "short_name": "find_group_chats", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client#find_group_chats", + "async": false, + "parameters": [ + { + "type": "::Google::Apps::Chat::V1::FindGroupChatsRequest", + "name": "request" + } + ], + "result_type": "::Google::Apps::Chat::V1::FindGroupChatsResponse", + "client": { + "short_name": "ChatService::Client", + "full_name": "::Google::Apps::Chat::V1::ChatService::Client" + }, + "method": { + "short_name": "FindGroupChats", + "full_name": "google.chat.v1.ChatService.FindGroupChats", + "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_CreateMembership_sync", "title": "Snippet for the create_membership call in the ChatService service", diff --git a/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb b/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb index 9339bb568166..742bdcc9c850 100644 --- a/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb +++ b/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb @@ -1084,6 +1084,63 @@ def test_find_direct_message end end + def test_find_group_chats + # Create test objects. + client_result = ::Google::Apps::Chat::V1::FindGroupChatsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + users = ["hello world"] + page_size = 42 + page_token = "hello world" + space_view = :SPACE_VIEW_UNSPECIFIED + + find_group_chats_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + 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_group_chats_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, find_group_chats_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_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.find_group_chats users: users, page_size: page_size, page_token: page_token, space_view: space_view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.find_group_chats ::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.find_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.find_group_chats(::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, find_group_chats_client_stub.call_count + end + end + end + def test_create_membership # Create test objects. client_result = ::Google::Apps::Chat::V1::Membership.new diff --git a/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb b/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb index 752f2783ef30..203f6aa91edd 100644 --- a/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb +++ b/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb @@ -1195,6 +1195,75 @@ def test_find_direct_message end end + def test_find_group_chats + # Create GRPC objects. + grpc_response = ::Google::Apps::Chat::V1::FindGroupChatsResponse.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. + users = ["hello world"] + page_size = 42 + page_token = "hello world" + space_view = :SPACE_VIEW_UNSPECIFIED + + find_group_chats_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :find_group_chats, name + assert_kind_of ::Google::Apps::Chat::V1::FindGroupChatsRequest, request + assert_equal ["hello world"], request["users"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :SPACE_VIEW_UNSPECIFIED, request["space_view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, find_group_chats_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_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }) 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.find_group_chats users: users, page_size: page_size, page_token: page_token, space_view: space_view 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.find_group_chats ::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view) 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.find_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }, 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.find_group_chats(::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view), 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, find_group_chats_client_stub.call_rpc_count + end + end + def test_create_membership # Create GRPC objects. grpc_response = ::Google::Apps::Chat::V1::Membership.new diff --git a/owl-bot-staging/google-apps-chat-v1/.gitignore b/owl-bot-staging/google-apps-chat-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# 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 deleted file mode 100644 index 8ca7b480bd43..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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 deleted file mode 100644 index 8b1490630576..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -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 deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index a7d36c714d7e..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---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 deleted file mode 100644 index 3ada4e89f790..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# 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 deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-apps-chat-v1/Gemfile b/owl-bot-staging/google-apps-chat-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -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 deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - 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 deleted file mode 100644 index 56d94db2f142..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# 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. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/apps/chat/v1" -require "logger" - -client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| - config.logger = Logger.new "my-app.log" -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 3.0+. - -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 deleted file mode 100644 index 77dcccc3c544..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index d87e86a2906f..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/gapic_metadata.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "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" - ] - }, - "FindGroupChats": { - "methods": [ - "find_group_chats" - ] - }, - "CreateMembership": { - "methods": [ - "create_membership" - ] - }, - "UpdateMembership": { - "methods": [ - "update_membership" - ] - }, - "DeleteMembership": { - "methods": [ - "delete_membership" - ] - }, - "CreateReaction": { - "methods": [ - "create_reaction" - ] - }, - "ListReactions": { - "methods": [ - "list_reactions" - ] - }, - "DeleteReaction": { - "methods": [ - "delete_reaction" - ] - }, - "CreateCustomEmoji": { - "methods": [ - "create_custom_emoji" - ] - }, - "GetCustomEmoji": { - "methods": [ - "get_custom_emoji" - ] - }, - "ListCustomEmojis": { - "methods": [ - "list_custom_emojis" - ] - }, - "DeleteCustomEmoji": { - "methods": [ - "delete_custom_emoji" - ] - }, - "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" - ] - }, - "GetSpaceNotificationSetting": { - "methods": [ - "get_space_notification_setting" - ] - }, - "UpdateSpaceNotificationSetting": { - "methods": [ - "update_space_notification_setting" - ] - }, - "CreateSection": { - "methods": [ - "create_section" - ] - }, - "DeleteSection": { - "methods": [ - "delete_section" - ] - }, - "UpdateSection": { - "methods": [ - "update_section" - ] - }, - "ListSections": { - "methods": [ - "list_sections" - ] - }, - "PositionSection": { - "methods": [ - "position_section" - ] - }, - "ListSectionItems": { - "methods": [ - "list_section_items" - ] - }, - "MoveSectionItem": { - "methods": [ - "move_section_item" - ] - } - } - } - } - } - } -} 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 deleted file mode 100644 index 79a093c4a2a3..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/google-apps-chat-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- 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 = ">= 3.2" - - gem.add_dependency "gapic-common", "~> 1.2" - 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 deleted file mode 100644 index c3af8b700d88..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google-apps-chat-v1.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index c17754be5398..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 44f628376b77..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index f6231a110192..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/client.rb +++ /dev/null @@ -1,6551 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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.find_group_chats.timeout = 30.0 - default_config.rpcs.find_group_chats.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.create_custom_emoji.timeout = 30.0 - default_config.rpcs.create_custom_emoji.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_custom_emoji.timeout = 30.0 - default_config.rpcs.get_custom_emoji.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_custom_emojis.timeout = 30.0 - default_config.rpcs.list_custom_emojis.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_custom_emoji.timeout = 30.0 - default_config.rpcs.delete_custom_emoji.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.rpcs.get_space_notification_setting.timeout = 30.0 - default_config.rpcs.get_space_notification_setting.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_space_notification_setting.timeout = 30.0 - default_config.rpcs.update_space_notification_setting.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_section.timeout = 30.0 - default_config.rpcs.create_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_section.timeout = 30.0 - default_config.rpcs.delete_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_section.timeout = 30.0 - default_config.rpcs.update_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_sections.timeout = 30.0 - default_config.rpcs.list_sections.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.position_section.timeout = 30.0 - default_config.rpcs.position_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_section_items.timeout = 30.0 - default_config.rpcs.list_section_items.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.move_section_item.timeout = 30.0 - default_config.rpcs.move_section_item.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, - logger: @config.logger - ) - - @chat_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @chat_service_stub.logger - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.create` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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. - # - # For - # [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) - # requests, the response doesn't contain the full message. The response only - # populates the `name` and `thread.name` fields in addition to the - # information that was in the request. - # - # @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. - # - # When [responding to user - # interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), - # this field is ignored. For interactions within a thread, the reply is - # created in the same thread. Otherwise, the reply is created as a new - # thread. - # @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? - 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. System messages, like those - # announcing new space members, aren't included. 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When - # using this authentication scope, this method only returns public - # messages in a space. It doesn't include private messages. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # @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] - # Optional. 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. 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] - # Optional. 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. 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] - # Optional. 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? - throw :response, 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.memberships` (requires - # [administrator approval](https://support.google.com/a?p=chat-app-auth)) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # @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] - # Optional. 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? - throw :response, 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.memberships` (requires - # [administrator approval](https://support.google.com/a?p=chat-app-auth)) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # @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` - # - # 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] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot`: When using this - # authorization scope, this method returns details about a message the - # Chat app has access to, like direct messages and [slash - # commands](https://developers.google.com/workspace/chat/slash-commands) - # that invoke the Chat app. - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth). - # When using this authentication scope, - # this method returns details about a public message in a space. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - # 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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).) - # - # - `quoted_message_metadata` (Only allows removal of the quoted message.) - # @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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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] - # Optional. 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? - 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) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.bot` - # - # @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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.create` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - # - # 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - # 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? - throw :response, 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. In the request, set `use_admin_access` to `true`. - # For an example, see [Search for and manage - # spaces](https://developers.google.com/workspace/chat/search-manage-admin). - # - # Requires [user - # authentication with administrator - # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) - # and one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # @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? - throw :response, 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # App authentication has the following limitations: - # - # - `space.access_settings` is only populated when using the - # `chat.app.spaces` scope. - # - `space.predefind_permission_settings` and `space.permission_settings` are - # only populated when using the `chat.app.spaces` scope, and only for - # spaces the app created. - # - # @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] - # Optional. 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? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a space. Can be used to create a named space, or a - # group chat in `Import mode`. For an example, see [Create a - # space](https://developers.google.com/workspace/chat/create-spaces). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces.create` - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.create` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # When authenticating as an app, the `space.customer` field must be set in - # the request. - # - # When authenticating as an app, the Chat app is added as a member of the - # space. However, unlike human authentication, the Chat app is not added as a - # space manager. By default, the Chat app can be removed from the space by - # all space members. To allow only space managers to remove the app from a - # space, set `space.permission_settings.manage_apps` to `managers_allowed`. - # - # Space membership upon creation depends on whether the space is created in - # `Import mode`: - # - # * **Import mode:** No members are created. - # * **All other modes:** The calling user is added as a member. This is: - # * The app itself when using app authentication. - # * The human user when using user authentication. - # - # 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. - # - # @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` and `SpaceType.GROUP_CHAT` are supported. - # `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. - # - # 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. - # - # - # 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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.spaces.create` - # - `https://www.googleapis.com/auth/chat.spaces` - # - # @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 49 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? - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # App authentication has the following limitations: - # - # - To update either `space.predefined_permission_settings` or - # `space.permission_settings`, the app must be the space creator. - # - Updating the `space.access_settings.audience` is not supported for app - # authentication. - # - # @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 and guidelines. You must - # pass both description and guidelines in the update request as - # {::Google::Apps::Chat::V1::Space::SpaceDetails `SpaceDetails`}. If you only want to - # update one of the fields, pass the existing value for the other field. - # - # `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. - # 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] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) and the - # authorization scope: - # - `https://www.googleapis.com/auth/chat.app.delete` (only in - # spaces the app created) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.delete` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.delete` - # - # @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] - # Optional. 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? - 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 [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # and domain-wide delegation with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.import` - # - # 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? - 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 [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. - # - # 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - # @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? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns all spaces with `spaceType == GROUP_CHAT`, whose - # human memberships contain exactly the calling user, and the users specified - # in `FindGroupChatsRequest.users`. Only members that have joined the - # conversation are supported. For an example, see [Find group - # chats](https://developers.google.com/workspace/chat/find-group-chats). - # - # If the calling user blocks, or is blocked by, some users, and no spaces - # with the entire specified set of users are found, this method returns - # spaces that don't include the blocked or blocking users. - # - # The specified set of users must contain only human (non-app) memberships. - # A request that contains non-human users doesn't return any spaces. - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # @overload find_group_chats(request, options = nil) - # Pass arguments to `find_group_chats` via a request object, either of type - # {::Google::Apps::Chat::V1::FindGroupChatsRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::FindGroupChatsRequest, ::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_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil) - # Pass arguments to `find_group_chats` 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 users [::Array<::String>] - # Optional. Resource names of all human users in group chat with the calling - # user. Chat apps can't be included in the request. - # - # The maximum number of users that can be specified in a single request is - # `49`. - # - # 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, to find all group chats with the calling - # user and two other users, with People API profile IDs `123456789` and - # `987654321`, you can use `users/123456789` and `users/987654321`. - # You can also 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. - # @param page_size [::Integer] - # Optional. The maximum number of spaces to return. The service might return - # fewer than this value. - # - # If unspecified, at most 10 spaces are returned. - # - # The maximum value is 30. If you use a value more than 30, it's - # automatically changed to 30. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @param page_token [::String] - # Optional. A page token, received from a previous call to find group chats. - # Provide this parameter to retrieve the subsequent page. - # - # When paginating, all other parameters provided should match the call that - # provided the token. Passing different values may lead to unexpected - # results. - # @param space_view [::Google::Apps::Chat::V1::SpaceView] - # Requested space view type. If unset, defaults to - # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify - # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, - # for example, - # https://www.googleapis.com/auth/chat.spaces or - # https://www.googleapis.com/auth/chat.spaces.readonly. - # - # @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::FindGroupChatsRequest.new - # - # # Call the find_group_chats method. - # result = client.find_group_chats 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 find_group_chats request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindGroupChatsRequest - - # 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_group_chats.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_group_chats.timeout, - metadata: metadata, - retry_policy: @config.rpcs.find_group_chats.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :find_group_chats, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @chat_service_stub, :find_group_chats, request, response, operation, options - yield response, operation if block_given? - throw :response, 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.memberships.app` (to add the - # calling app to the space) - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # App authentication is not supported for the following use cases: - # - # - Inviting users external to the Workspace organization that owns the - # space. - # - Adding a Google Group to a space. - # - Adding a Chat app to a space. - # - # 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 - # certain authorization scopes and set specific values for certain fields: - # - # - When [authenticating as a - # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - # the `chat.memberships` authorization scope is required. - # - # - When [authenticating as an - # app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), - # the `chat.app.memberships` authorization scope is required. - # - # - 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`. - # - # Inviting users external to the Workspace organization that owns the space - # requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - # - # When a Chat app creates a membership relation for itself, it must - # [authenticate as a - # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set - # `user.name` to `users/app`. - # @param use_admin_access [::Boolean] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) and the - # authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` (only in - # spaces the app created) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # @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] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.memberships.app` (to remove - # the calling app from the space) - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # App authentication is not supported for the following use cases: - # - # - Removing a Google Group from a space. - # - Removing a Chat app from a space. - # - # To delete memberships for space managers, the requester - # must be a space manager. If you're using [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # the Chat app must be the space creator. - # - # @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 - # with [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # or the `chat.memberships.app` scope with [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # and the `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] - # Optional. 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? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a reaction and adds it to a message. 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions.create` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - # - # @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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - # @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 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? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a reaction to a message. 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - # - # @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? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a custom emoji. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload create_custom_emoji(request, options = nil) - # Pass arguments to `create_custom_emoji` via a request object, either of type - # {::Google::Apps::Chat::V1::CreateCustomEmojiRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::CreateCustomEmojiRequest, ::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_custom_emoji(custom_emoji: nil) - # Pass arguments to `create_custom_emoji` 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 custom_emoji [::Google::Apps::Chat::V1::CustomEmoji, ::Hash] - # Required. The custom emoji to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::CustomEmoji] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # - # @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::CreateCustomEmojiRequest.new - # - # # Call the create_custom_emoji method. - # result = client.create_custom_emoji request - # - # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. - # p result - # - def create_custom_emoji request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateCustomEmojiRequest - - # 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_custom_emoji.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_custom_emoji.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_custom_emoji.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :create_custom_emoji, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns details about a custom emoji. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis.readonly` - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload get_custom_emoji(request, options = nil) - # Pass arguments to `get_custom_emoji` via a request object, either of type - # {::Google::Apps::Chat::V1::GetCustomEmojiRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::GetCustomEmojiRequest, ::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_custom_emoji(name: nil) - # Pass arguments to `get_custom_emoji` 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 custom emoji. - # - # Format: `customEmojis/{customEmoji}` - # - # You can use the emoji name as an alias for `{customEmoji}`. For example, - # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name - # for a custom emoji. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::CustomEmoji] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # - # @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::GetCustomEmojiRequest.new - # - # # Call the get_custom_emoji method. - # result = client.get_custom_emoji request - # - # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. - # p result - # - def get_custom_emoji request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetCustomEmojiRequest - - # 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_custom_emoji.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_custom_emoji.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_custom_emoji.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :get_custom_emoji, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists custom emojis visible to the authenticated user. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis.readonly` - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload list_custom_emojis(request, options = nil) - # Pass arguments to `list_custom_emojis` via a request object, either of type - # {::Google::Apps::Chat::V1::ListCustomEmojisRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::ListCustomEmojisRequest, ::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_custom_emojis(page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_custom_emojis` 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 custom emojis returned. The service can - # return fewer custom emojis than this value. If unspecified, the default - # value is 25. The maximum value is 200; values above 200 are changed to 200. - # @param page_token [::String] - # Optional. (If resuming from a previous query.) - # - # A page token received from a previous list custom emoji call. Provide this - # to retrieve the subsequent page. - # - # When paginating, the filter value should match the call that provided the - # page token. Passing a different value might lead to unexpected results. - # @param filter [::String] - # Optional. A query filter. - # - # Supports filtering by creator. - # - # To filter by creator, you must specify a valid value. Currently only - # `creator("users/me")` and `NOT creator("users/me")` are accepted to filter - # custom emojis by whether they were created by the calling user or not. - # - # For example, the following query returns custom emojis created by the - # caller: - # ``` - # creator("users/me") - # ``` - # - # Invalid queries are rejected with an `INVALID_ARGUMENT` error. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] - # - # @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::ListCustomEmojisRequest.new - # - # # Call the list_custom_emojis method. - # result = client.list_custom_emojis 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::CustomEmoji. - # p item - # end - # - def list_custom_emojis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListCustomEmojisRequest - - # 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_custom_emojis.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_custom_emojis.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_custom_emojis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :list_custom_emojis, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_custom_emojis, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a custom emoji. By default, users can only delete custom emoji they - # created. [Emoji managers](https://support.google.com/a/answer/12850085) - # assigned by the administrator can delete any custom emoji in the - # organization. See [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149). - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload delete_custom_emoji(request, options = nil) - # Pass arguments to `delete_custom_emoji` via a request object, either of type - # {::Google::Apps::Chat::V1::DeleteCustomEmojiRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, ::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_custom_emoji(name: nil) - # Pass arguments to `delete_custom_emoji` 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 custom emoji to delete. - # - # Format: `customEmojis/{customEmoji}` - # - # You can use the emoji name as an alias for `{customEmoji}`. For example, - # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name - # for a custom emoji. - # - # @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::DeleteCustomEmojiRequest.new - # - # # Call the delete_custom_emoji method. - # result = client.delete_custom_emoji request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_custom_emoji request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest - - # 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_custom_emoji.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_custom_emoji.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_custom_emoji.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :delete_custom_emoji, request, options: options do |response, operation| - yield response, operation if block_given? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - # - `https://www.googleapis.com/auth/chat.users.readstate` - # - # @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? - 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) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate` - # - # @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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - # - `https://www.googleapis.com/auth/chat.users.readstate` - # - # @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? - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - # with an - # [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) - # appropriate for reading the requested data: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # To get an event, the authenticated caller 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? - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - # with an - # [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) - # appropriate for reading the requested data: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # To list events, the authenticated caller 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] - # Optional. 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? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the space notification setting. For an example, see [Get the - # caller's space notification - # setting](https://developers.google.com/workspace/chat/get-space-notification-setting). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.spacesettings` - # - # @overload get_space_notification_setting(request, options = nil) - # Pass arguments to `get_space_notification_setting` via a request object, either of type - # {::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, ::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_notification_setting(name: nil) - # Pass arguments to `get_space_notification_setting` 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. Format: users/\\{user}/spaces/\\{space}/spaceNotificationSetting - # - # - `users/me/spaces/{space}/spaceNotificationSetting`, OR - # - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR - # - `users/123456789/spaces/{space}/spaceNotificationSetting`. - # Note: Only the caller's user id or email is allowed in the path. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # - # @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::GetSpaceNotificationSettingRequest.new - # - # # Call the get_space_notification_setting method. - # result = client.get_space_notification_setting request - # - # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. - # p result - # - def get_space_notification_setting request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest - - # 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_notification_setting.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_notification_setting.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_space_notification_setting.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :get_space_notification_setting, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the space notification setting. For an example, see [Update - # the caller's space notification - # setting](https://developers.google.com/workspace/chat/update-space-notification-setting). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.spacesettings` - # - # @overload update_space_notification_setting(request, options = nil) - # Pass arguments to `update_space_notification_setting` via a request object, either of type - # {::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, ::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_notification_setting(space_notification_setting: nil, update_mask: nil) - # Pass arguments to `update_space_notification_setting` 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_notification_setting [::Google::Apps::Chat::V1::SpaceNotificationSetting, ::Hash] - # Required. The resource name for the space notification settings must be - # populated in the form of - # `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields - # specified by `update_mask` are updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Supported field paths: - # - # - `notification_setting` - # - # - `mute_setting` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # - # @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::UpdateSpaceNotificationSettingRequest.new - # - # # Call the update_space_notification_setting method. - # result = client.update_space_notification_setting request - # - # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. - # p result - # - def update_space_notification_setting request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest - - # 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_notification_setting.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_notification_setting&.name - header_params["space_notification_setting.name"] = request.space_notification_setting.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_notification_setting.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_space_notification_setting.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :update_space_notification_setting, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a section in Google Chat. Sections help users group conversations - # and customize the list of spaces displayed in Chat navigation panel. Only - # sections of type `CUSTOM_SECTION` can be created. For details, see [Create - # and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload create_section(request, options = nil) - # Pass arguments to `create_section` via a request object, either of type - # {::Google::Apps::Chat::V1::CreateSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::CreateSectionRequest, ::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_section(parent: nil, section: nil) - # Pass arguments to `create_section` 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 parent resource name where the section is created. - # - # Format: `users/{user}` - # @param section [::Google::Apps::Chat::V1::Section, ::Hash] - # Required. The section to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::Section] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::Section] - # - # @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::CreateSectionRequest.new - # - # # Call the create_section method. - # result = client.create_section request - # - # # The returned object is of type Google::Apps::Chat::V1::Section. - # p result - # - def create_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSectionRequest - - # 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_section.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_section.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :create_section, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a section of type `CUSTOM_SECTION`. - # - # If the section contains items, such as spaces, the items are moved to - # Google Chat's default sections and are not deleted. - # - # For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload delete_section(request, options = nil) - # Pass arguments to `delete_section` via a request object, either of type - # {::Google::Apps::Chat::V1::DeleteSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::DeleteSectionRequest, ::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_section(name: nil) - # Pass arguments to `delete_section` 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 name of the section to delete. - # - # Format: `users/{user}/sections/{section}` - # - # @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::DeleteSectionRequest.new - # - # # Call the delete_section method. - # result = client.delete_section request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSectionRequest - - # 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_section.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_section.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :delete_section, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a section. Only sections of type `CUSTOM_SECTION` can be updated. - # For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload update_section(request, options = nil) - # Pass arguments to `update_section` via a request object, either of type - # {::Google::Apps::Chat::V1::UpdateSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::UpdateSectionRequest, ::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_section(section: nil, update_mask: nil) - # Pass arguments to `update_section` 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 section [::Google::Apps::Chat::V1::Section, ::Hash] - # Required. The section to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to specify which fields to update. - # - # Currently supported field paths: - # - # - `display_name` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::Section] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::Section] - # - # @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::UpdateSectionRequest.new - # - # # Call the update_section method. - # result = client.update_section request - # - # # The returned object is of type Google::Apps::Chat::V1::Section. - # p result - # - def update_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSectionRequest - - # 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_section.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.section&.name - header_params["section.name"] = request.section.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_section.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :update_section, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists sections available to the Chat user. Sections help users group their - # conversations and customize the list of spaces displayed in Chat - # navigation panel. For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - `https://www.googleapis.com/auth/chat.users.sections.readonly` - # - # @overload list_sections(request, options = nil) - # Pass arguments to `list_sections` via a request object, either of type - # {::Google::Apps::Chat::V1::ListSectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::ListSectionsRequest, ::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_sections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_sections` 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 parent, which is the user resource name that owns this - # collection of sections. Only supports listing sections for the calling - # user. To refer to the calling user, set one of the following: - # - # - The `me` alias. For example, `users/me`. - # - # - Their Workspace email address. For example, `users/user@example.com`. - # - # - Their user id. For example, `users/123456789`. - # - # Format: `users/{user}` - # @param page_size [::Integer] - # Optional. The maximum number of sections to return. The service may return - # fewer than this value. - # - # If unspecified, at most 10 sections will be returned. - # - # The maximum value is 100. If you use a value more than 100, it's - # automatically changed to 100. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @param page_token [::String] - # Optional. A page token, received from a previous list sections call. - # Provide this 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. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Section>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Section>] - # - # @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::ListSectionsRequest.new - # - # # Call the list_sections method. - # result = client.list_sections 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::Section. - # p item - # end - # - def list_sections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionsRequest - - # 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_sections.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_sections.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :list_sections, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_sections, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Changes the sort order of a section. For details, see [Create and organize - # sections in Google Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload position_section(request, options = nil) - # Pass arguments to `position_section` via a request object, either of type - # {::Google::Apps::Chat::V1::PositionSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::PositionSectionRequest, ::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 position_section(name: nil, sort_order: nil, relative_position: nil) - # Pass arguments to `position_section` 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 section to position. - # - # Format: `users/{user}/sections/{section}` - # @param sort_order [::Integer] - # Optional. The absolute position of the section in the list of sections. - # The position must be greater than 0. If the position is greater than the - # number of sections, the section will be appended to the end of the list. - # This operation inserts the section at the given position and shifts the - # original section at that position, and those below it, to the next - # position. - # - # Note: The following parameters are mutually exclusive: `sort_order`, `relative_position`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param relative_position [::Google::Apps::Chat::V1::PositionSectionRequest::Position] - # Optional. The relative position of the section in the list of sections. - # - # Note: The following parameters are mutually exclusive: `relative_position`, `sort_order`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::PositionSectionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::PositionSectionResponse] - # - # @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::PositionSectionRequest.new - # - # # Call the position_section method. - # result = client.position_section request - # - # # The returned object is of type Google::Apps::Chat::V1::PositionSectionResponse. - # p result - # - def position_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::PositionSectionRequest - - # 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.position_section.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.position_section.timeout, - metadata: metadata, - retry_policy: @config.rpcs.position_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :position_section, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists items in a section. - # - # Only spaces can be section items. For details, see [Create and organize - # sections in Google Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - `https://www.googleapis.com/auth/chat.users.sections.readonly` - # - # @overload list_section_items(request, options = nil) - # Pass arguments to `list_section_items` via a request object, either of type - # {::Google::Apps::Chat::V1::ListSectionItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::ListSectionItemsRequest, ::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_section_items(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_section_items` 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 parent, which is the section resource name that owns this - # collection of section items. Only supports listing section items for the - # calling user. - # - # When you're filtering by space, use the wildcard `-` to search across all - # sections. For example, `users/{user}/sections/-`. - # - # Format: `users/{user}/sections/{section}` - # @param page_size [::Integer] - # Optional. The maximum number of section items to return. The service may - # return fewer than this value. - # - # If unspecified, at most 10 section items will be returned. - # - # The maximum value is 100. If you use a value more than 100, it's - # automatically changed to 100. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @param page_token [::String] - # Optional. A page token, received from a previous list section items call. - # Provide this 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. - # - # Currently only supports filtering by space. - # - # For example, `space = spaces/{space}`. - # - # Invalid queries are rejected with an `INVALID_ARGUMENT` error. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>] - # - # @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::ListSectionItemsRequest.new - # - # # Call the list_section_items method. - # result = client.list_section_items 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::SectionItem. - # p item - # end - # - def list_section_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionItemsRequest - - # 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_section_items.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_section_items.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_section_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :list_section_items, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @chat_service_stub, :list_section_items, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Moves an item from one section to another. For example, if a section - # contains spaces, this method can be used to move a space to a different - # section. For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload move_section_item(request, options = nil) - # Pass arguments to `move_section_item` via a request object, either of type - # {::Google::Apps::Chat::V1::MoveSectionItemRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::MoveSectionItemRequest, ::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 move_section_item(name: nil, target_section: nil) - # Pass arguments to `move_section_item` 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 section item to move. - # - # Format: `users/{user}/sections/{section}/items/{item}` - # @param target_section [::String] - # Required. The resource name of the section to move the section item to. - # - # Format: `users/{user}/sections/{section}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Apps::Chat::V1::MoveSectionItemResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Apps::Chat::V1::MoveSectionItemResponse] - # - # @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::MoveSectionItemRequest.new - # - # # Call the move_section_item method. - # result = client.move_section_item request - # - # # The returned object is of type Google::Apps::Chat::V1::MoveSectionItemResponse. - # p result - # - def move_section_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MoveSectionItemRequest - - # 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.move_section_item.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.move_section_item.timeout, - metadata: metadata, - retry_policy: @config.rpcs.move_section_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.call_rpc :move_section_item, request, options: options do |response, operation| - yield response, operation if block_given? - 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: - # * (`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 - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,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, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - 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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 `find_group_chats` - # @return [::Gapic::Config::Method] - # - attr_reader :find_group_chats - ## - # 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 `create_custom_emoji` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_emoji - ## - # RPC-specific configuration for `get_custom_emoji` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_emoji - ## - # RPC-specific configuration for `list_custom_emojis` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_emojis - ## - # RPC-specific configuration for `delete_custom_emoji` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_emoji - ## - # 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 - ## - # RPC-specific configuration for `get_space_notification_setting` - # @return [::Gapic::Config::Method] - # - attr_reader :get_space_notification_setting - ## - # RPC-specific configuration for `update_space_notification_setting` - # @return [::Gapic::Config::Method] - # - attr_reader :update_space_notification_setting - ## - # RPC-specific configuration for `create_section` - # @return [::Gapic::Config::Method] - # - attr_reader :create_section - ## - # RPC-specific configuration for `delete_section` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_section - ## - # RPC-specific configuration for `update_section` - # @return [::Gapic::Config::Method] - # - attr_reader :update_section - ## - # RPC-specific configuration for `list_sections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sections - ## - # RPC-specific configuration for `position_section` - # @return [::Gapic::Config::Method] - # - attr_reader :position_section - ## - # RPC-specific configuration for `list_section_items` - # @return [::Gapic::Config::Method] - # - attr_reader :list_section_items - ## - # RPC-specific configuration for `move_section_item` - # @return [::Gapic::Config::Method] - # - attr_reader :move_section_item - - # @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 - find_group_chats_config = parent_rpcs.find_group_chats if parent_rpcs.respond_to? :find_group_chats - @find_group_chats = ::Gapic::Config::Method.new find_group_chats_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 - create_custom_emoji_config = parent_rpcs.create_custom_emoji if parent_rpcs.respond_to? :create_custom_emoji - @create_custom_emoji = ::Gapic::Config::Method.new create_custom_emoji_config - get_custom_emoji_config = parent_rpcs.get_custom_emoji if parent_rpcs.respond_to? :get_custom_emoji - @get_custom_emoji = ::Gapic::Config::Method.new get_custom_emoji_config - list_custom_emojis_config = parent_rpcs.list_custom_emojis if parent_rpcs.respond_to? :list_custom_emojis - @list_custom_emojis = ::Gapic::Config::Method.new list_custom_emojis_config - delete_custom_emoji_config = parent_rpcs.delete_custom_emoji if parent_rpcs.respond_to? :delete_custom_emoji - @delete_custom_emoji = ::Gapic::Config::Method.new delete_custom_emoji_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 - get_space_notification_setting_config = parent_rpcs.get_space_notification_setting if parent_rpcs.respond_to? :get_space_notification_setting - @get_space_notification_setting = ::Gapic::Config::Method.new get_space_notification_setting_config - update_space_notification_setting_config = parent_rpcs.update_space_notification_setting if parent_rpcs.respond_to? :update_space_notification_setting - @update_space_notification_setting = ::Gapic::Config::Method.new update_space_notification_setting_config - create_section_config = parent_rpcs.create_section if parent_rpcs.respond_to? :create_section - @create_section = ::Gapic::Config::Method.new create_section_config - delete_section_config = parent_rpcs.delete_section if parent_rpcs.respond_to? :delete_section - @delete_section = ::Gapic::Config::Method.new delete_section_config - update_section_config = parent_rpcs.update_section if parent_rpcs.respond_to? :update_section - @update_section = ::Gapic::Config::Method.new update_section_config - list_sections_config = parent_rpcs.list_sections if parent_rpcs.respond_to? :list_sections - @list_sections = ::Gapic::Config::Method.new list_sections_config - position_section_config = parent_rpcs.position_section if parent_rpcs.respond_to? :position_section - @position_section = ::Gapic::Config::Method.new position_section_config - list_section_items_config = parent_rpcs.list_section_items if parent_rpcs.respond_to? :list_section_items - @list_section_items = ::Gapic::Config::Method.new list_section_items_config - move_section_item_config = parent_rpcs.move_section_item if parent_rpcs.respond_to? :move_section_item - @move_section_item = ::Gapic::Config::Method.new move_section_item_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 deleted file mode 100644 index f04afafd650b..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/credentials.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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.app.delete", - "https://www.googleapis.com/auth/chat.app.memberships", - "https://www.googleapis.com/auth/chat.app.memberships.readonly", - "https://www.googleapis.com/auth/chat.app.messages.readonly", - "https://www.googleapis.com/auth/chat.app.spaces", - "https://www.googleapis.com/auth/chat.app.spaces.create", - "https://www.googleapis.com/auth/chat.app.spaces.readonly", - "https://www.googleapis.com/auth/chat.bot", - "https://www.googleapis.com/auth/chat.customemojis", - "https://www.googleapis.com/auth/chat.customemojis.readonly", - "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", - "https://www.googleapis.com/auth/chat.users.sections", - "https://www.googleapis.com/auth/chat.users.sections.readonly", - "https://www.googleapis.com/auth/chat.users.spacesettings" - ] - 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 deleted file mode 100644 index 876923a4f9cd..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/paths.rb +++ /dev/null @@ -1,289 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 CustomEmoji resource string. - # - # The resource will be in the following format: - # - # `customEmojis/{custom_emoji}` - # - # @param custom_emoji [String] - # - # @return [::String] - def custom_emoji_path custom_emoji: - "customEmojis/#{custom_emoji}" - 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 Section resource string. - # - # The resource will be in the following format: - # - # `users/{user}/sections/{section}` - # - # @param user [String] - # @param section [String] - # - # @return [::String] - def section_path user:, section: - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "users/#{user}/sections/#{section}" - end - - ## - # Create a fully-qualified SectionItem resource string. - # - # The resource will be in the following format: - # - # `users/{user}/sections/{section}/items/{item}` - # - # @param user [String] - # @param section [String] - # @param item [String] - # - # @return [::String] - def section_item_path user:, section:, item: - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - raise ::ArgumentError, "section cannot contain /" if section.to_s.include? "/" - - "users/#{user}/sections/#{section}/items/#{item}" - 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 SpaceNotificationSetting resource string. - # - # The resource will be in the following format: - # - # `users/{user}/spaces/{space}/spaceNotificationSetting` - # - # @param user [String] - # @param space [String] - # - # @return [::String] - def space_notification_setting_path user:, space: - raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/" - - "users/#{user}/spaces/#{space}/spaceNotificationSetting" - 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 - - ## - # Create a fully-qualified User resource string. - # - # The resource will be in the following format: - # - # `users/{user}` - # - # @param user [String] - # - # @return [::String] - def user_path user: - "users/#{user}" - 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 deleted file mode 100644 index 42875c8b7f5c..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index e3e72d3038bd..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/client.rb +++ /dev/null @@ -1,6271 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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.find_group_chats.timeout = 30.0 - default_config.rpcs.find_group_chats.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.create_custom_emoji.timeout = 30.0 - default_config.rpcs.create_custom_emoji.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_custom_emoji.timeout = 30.0 - default_config.rpcs.get_custom_emoji.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_custom_emojis.timeout = 30.0 - default_config.rpcs.list_custom_emojis.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_custom_emoji.timeout = 30.0 - default_config.rpcs.delete_custom_emoji.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.rpcs.get_space_notification_setting.timeout = 30.0 - default_config.rpcs.get_space_notification_setting.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_space_notification_setting.timeout = 30.0 - default_config.rpcs.update_space_notification_setting.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_section.timeout = 30.0 - default_config.rpcs.create_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_section.timeout = 30.0 - default_config.rpcs.delete_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_section.timeout = 30.0 - default_config.rpcs.update_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_sections.timeout = 30.0 - default_config.rpcs.list_sections.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.position_section.timeout = 30.0 - default_config.rpcs.position_section.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_section_items.timeout = 30.0 - default_config.rpcs.list_section_items.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.move_section_item.timeout = 30.0 - default_config.rpcs.move_section_item.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, - logger: @config.logger - ) - - @chat_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @chat_service_stub.logger - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.create` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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. - # - # For - # [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) - # requests, the response doesn't contain the full message. The response only - # populates the `name` and `thread.name` fields in addition to the - # information that was in the request. - # - # @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. - # - # When [responding to user - # interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), - # this field is ignored. For interactions within a thread, the reply is - # created in the same thread. Otherwise, the reply is created as a new - # thread. - # @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? - 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. System messages, like those - # announcing new space members, aren't included. 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When - # using this authentication scope, this method only returns public - # messages in a space. It doesn't include private messages. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # @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] - # Optional. 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. 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] - # Optional. 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. 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] - # Optional. 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? - throw :response, 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.memberships` (requires - # [administrator approval](https://support.google.com/a?p=chat-app-auth)) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # @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] - # Optional. 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? - throw :response, 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.memberships` (requires - # [administrator approval](https://support.google.com/a?p=chat-app-auth)) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # @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` - # - # 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] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot`: When using this - # authorization scope, this method returns details about a message the - # Chat app has access to, like direct messages and [slash - # commands](https://developers.google.com/workspace/chat/slash-commands) - # that invoke the Chat app. - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth). - # When using this authentication scope, - # this method returns details about a public message in a space. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - # 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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).) - # - # - `quoted_message_metadata` (Only allows removal of the quoted message.) - # @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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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] - # Optional. 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? - 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) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.bot` - # - # @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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.create` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - # - # 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - # 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? - throw :response, 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. In the request, set `use_admin_access` to `true`. - # For an example, see [Search for and manage - # spaces](https://developers.google.com/workspace/chat/search-manage-admin). - # - # Requires [user - # authentication with administrator - # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) - # and one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # @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? - throw :response, 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # App authentication has the following limitations: - # - # - `space.access_settings` is only populated when using the - # `chat.app.spaces` scope. - # - `space.predefind_permission_settings` and `space.permission_settings` are - # only populated when using the `chat.app.spaces` scope, and only for - # spaces the app created. - # - # @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] - # Optional. 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? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a space. Can be used to create a named space, or a - # group chat in `Import mode`. For an example, see [Create a - # space](https://developers.google.com/workspace/chat/create-spaces). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces.create` - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.create` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # When authenticating as an app, the `space.customer` field must be set in - # the request. - # - # When authenticating as an app, the Chat app is added as a member of the - # space. However, unlike human authentication, the Chat app is not added as a - # space manager. By default, the Chat app can be removed from the space by - # all space members. To allow only space managers to remove the app from a - # space, set `space.permission_settings.manage_apps` to `managers_allowed`. - # - # Space membership upon creation depends on whether the space is created in - # `Import mode`: - # - # * **Import mode:** No members are created. - # * **All other modes:** The calling user is added as a member. This is: - # * The app itself when using app authentication. - # * The human user when using user authentication. - # - # 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. - # - # @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` and `SpaceType.GROUP_CHAT` are supported. - # `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. - # - # 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. - # - # - # 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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.spaces.create` - # - `https://www.googleapis.com/auth/chat.spaces` - # - # @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 49 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? - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # App authentication has the following limitations: - # - # - To update either `space.predefined_permission_settings` or - # `space.permission_settings`, the app must be the space creator. - # - Updating the `space.access_settings.audience` is not supported for app - # authentication. - # - # @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 and guidelines. You must - # pass both description and guidelines in the update request as - # {::Google::Apps::Chat::V1::Space::SpaceDetails `SpaceDetails`}. If you only want to - # update one of the fields, pass the existing value for the other field. - # - # `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. - # 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] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) and the - # authorization scope: - # - `https://www.googleapis.com/auth/chat.app.delete` (only in - # spaces the app created) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.delete` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.delete` - # - # @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] - # Optional. 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? - 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 [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # and domain-wide delegation with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.import` - # - # 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? - 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 [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. - # - # 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - # @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? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns all spaces with `spaceType == GROUP_CHAT`, whose - # human memberships contain exactly the calling user, and the users specified - # in `FindGroupChatsRequest.users`. Only members that have joined the - # conversation are supported. For an example, see [Find group - # chats](https://developers.google.com/workspace/chat/find-group-chats). - # - # If the calling user blocks, or is blocked by, some users, and no spaces - # with the entire specified set of users are found, this method returns - # spaces that don't include the blocked or blocking users. - # - # The specified set of users must contain only human (non-app) memberships. - # A request that contains non-human users doesn't return any spaces. - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # @overload find_group_chats(request, options = nil) - # Pass arguments to `find_group_chats` via a request object, either of type - # {::Google::Apps::Chat::V1::FindGroupChatsRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::FindGroupChatsRequest, ::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_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil) - # Pass arguments to `find_group_chats` 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 users [::Array<::String>] - # Optional. Resource names of all human users in group chat with the calling - # user. Chat apps can't be included in the request. - # - # The maximum number of users that can be specified in a single request is - # `49`. - # - # 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, to find all group chats with the calling - # user and two other users, with People API profile IDs `123456789` and - # `987654321`, you can use `users/123456789` and `users/987654321`. - # You can also 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. - # @param page_size [::Integer] - # Optional. The maximum number of spaces to return. The service might return - # fewer than this value. - # - # If unspecified, at most 10 spaces are returned. - # - # The maximum value is 30. If you use a value more than 30, it's - # automatically changed to 30. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @param page_token [::String] - # Optional. A page token, received from a previous call to find group chats. - # Provide this parameter to retrieve the subsequent page. - # - # When paginating, all other parameters provided should match the call that - # provided the token. Passing different values may lead to unexpected - # results. - # @param space_view [::Google::Apps::Chat::V1::SpaceView] - # Requested space view type. If unset, defaults to - # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify - # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, - # for example, - # https://www.googleapis.com/auth/chat.spaces or - # https://www.googleapis.com/auth/chat.spaces.readonly. - # @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::FindGroupChatsRequest.new - # - # # Call the find_group_chats method. - # result = client.find_group_chats 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 find_group_chats request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::FindGroupChatsRequest - - # 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_group_chats.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_group_chats.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.find_group_chats.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.find_group_chats request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :find_group_chats, "spaces", request, result, options - yield result, operation if block_given? - throw :response, 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.memberships.app` (to add the - # calling app to the space) - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # App authentication is not supported for the following use cases: - # - # - Inviting users external to the Workspace organization that owns the - # space. - # - Adding a Google Group to a space. - # - Adding a Chat app to a space. - # - # 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 - # certain authorization scopes and set specific values for certain fields: - # - # - When [authenticating as a - # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - # the `chat.memberships` authorization scope is required. - # - # - When [authenticating as an - # app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), - # the `chat.app.memberships` authorization scope is required. - # - # - 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`. - # - # Inviting users external to the Workspace organization that owns the space - # requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - # - # When a Chat app creates a membership relation for itself, it must - # [authenticate as a - # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set - # `user.name` to `users/app`. - # @param use_admin_access [::Boolean] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) and the - # authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` (only in - # spaces the app created) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # @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] - # Optional. 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? - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.memberships.app` (to remove - # the calling app from the space) - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # App authentication is not supported for the following use cases: - # - # - Removing a Google Group from a space. - # - Removing a Chat app from a space. - # - # To delete memberships for space managers, the requester - # must be a space manager. If you're using [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # the Chat app must be the space creator. - # - # @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 - # with [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # or the `chat.memberships.app` scope with [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # and the `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] - # Optional. 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? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a reaction and adds it to a message. 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions.create` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - # - # @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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - # @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 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? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a reaction to a message. 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - # - # @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? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a custom emoji. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload create_custom_emoji(request, options = nil) - # Pass arguments to `create_custom_emoji` via a request object, either of type - # {::Google::Apps::Chat::V1::CreateCustomEmojiRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::CreateCustomEmojiRequest, ::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_custom_emoji(custom_emoji: nil) - # Pass arguments to `create_custom_emoji` 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 custom_emoji [::Google::Apps::Chat::V1::CustomEmoji, ::Hash] - # Required. The custom emoji to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::CustomEmoji] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # - # @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::CreateCustomEmojiRequest.new - # - # # Call the create_custom_emoji method. - # result = client.create_custom_emoji request - # - # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. - # p result - # - def create_custom_emoji request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateCustomEmojiRequest - - # 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_custom_emoji.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_custom_emoji.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_custom_emoji.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.create_custom_emoji request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns details about a custom emoji. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis.readonly` - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload get_custom_emoji(request, options = nil) - # Pass arguments to `get_custom_emoji` via a request object, either of type - # {::Google::Apps::Chat::V1::GetCustomEmojiRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::GetCustomEmojiRequest, ::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_custom_emoji(name: nil) - # Pass arguments to `get_custom_emoji` 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 custom emoji. - # - # Format: `customEmojis/{customEmoji}` - # - # You can use the emoji name as an alias for `{customEmoji}`. For example, - # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name - # for a custom emoji. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::CustomEmoji] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # - # @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::GetCustomEmojiRequest.new - # - # # Call the get_custom_emoji method. - # result = client.get_custom_emoji request - # - # # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. - # p result - # - def get_custom_emoji request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetCustomEmojiRequest - - # 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_custom_emoji.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_custom_emoji.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_custom_emoji.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.get_custom_emoji request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists custom emojis visible to the authenticated user. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis.readonly` - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload list_custom_emojis(request, options = nil) - # Pass arguments to `list_custom_emojis` via a request object, either of type - # {::Google::Apps::Chat::V1::ListCustomEmojisRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::ListCustomEmojisRequest, ::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_custom_emojis(page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_custom_emojis` 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 custom emojis returned. The service can - # return fewer custom emojis than this value. If unspecified, the default - # value is 25. The maximum value is 200; values above 200 are changed to 200. - # @param page_token [::String] - # Optional. (If resuming from a previous query.) - # - # A page token received from a previous list custom emoji call. Provide this - # to retrieve the subsequent page. - # - # When paginating, the filter value should match the call that provided the - # page token. Passing a different value might lead to unexpected results. - # @param filter [::String] - # Optional. A query filter. - # - # Supports filtering by creator. - # - # To filter by creator, you must specify a valid value. Currently only - # `creator("users/me")` and `NOT creator("users/me")` are accepted to filter - # custom emojis by whether they were created by the calling user or not. - # - # For example, the following query returns custom emojis created by the - # caller: - # ``` - # creator("users/me") - # ``` - # - # Invalid queries are rejected with an `INVALID_ARGUMENT` error. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::CustomEmoji>] - # - # @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::ListCustomEmojisRequest.new - # - # # Call the list_custom_emojis method. - # result = client.list_custom_emojis 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::CustomEmoji. - # p item - # end - # - def list_custom_emojis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListCustomEmojisRequest - - # 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_custom_emojis.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_custom_emojis.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_custom_emojis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.list_custom_emojis request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_custom_emojis, "custom_emojis", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a custom emoji. By default, users can only delete custom emoji they - # created. [Emoji managers](https://support.google.com/a/answer/12850085) - # assigned by the administrator can delete any custom emoji in the - # organization. See [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149). - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis` - # - # @overload delete_custom_emoji(request, options = nil) - # Pass arguments to `delete_custom_emoji` via a request object, either of type - # {::Google::Apps::Chat::V1::DeleteCustomEmojiRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, ::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_custom_emoji(name: nil) - # Pass arguments to `delete_custom_emoji` 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 custom emoji to delete. - # - # Format: `customEmojis/{customEmoji}` - # - # You can use the emoji name as an alias for `{customEmoji}`. For example, - # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name - # for a custom emoji. - # @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::DeleteCustomEmojiRequest.new - # - # # Call the delete_custom_emoji method. - # result = client.delete_custom_emoji request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_custom_emoji request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest - - # 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_custom_emoji.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_custom_emoji.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_custom_emoji.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.delete_custom_emoji request, options do |result, operation| - yield result, operation if block_given? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - # - `https://www.googleapis.com/auth/chat.users.readstate` - # - # @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? - 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) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate` - # - # @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? - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - # - `https://www.googleapis.com/auth/chat.users.readstate` - # - # @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? - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - # with an - # [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) - # appropriate for reading the requested data: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # To get an event, the authenticated caller 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? - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - # with an - # [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) - # appropriate for reading the requested data: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # To list events, the authenticated caller 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] - # Optional. 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? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the space notification setting. For an example, see [Get the - # caller's space notification - # setting](https://developers.google.com/workspace/chat/get-space-notification-setting). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.spacesettings` - # - # @overload get_space_notification_setting(request, options = nil) - # Pass arguments to `get_space_notification_setting` via a request object, either of type - # {::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, ::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_notification_setting(name: nil) - # Pass arguments to `get_space_notification_setting` 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. Format: users/\\{user}/spaces/\\{space}/spaceNotificationSetting - # - # - `users/me/spaces/{space}/spaceNotificationSetting`, OR - # - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR - # - `users/123456789/spaces/{space}/spaceNotificationSetting`. - # Note: Only the caller's user id or email is allowed in the path. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # - # @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::GetSpaceNotificationSettingRequest.new - # - # # Call the get_space_notification_setting method. - # result = client.get_space_notification_setting request - # - # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. - # p result - # - def get_space_notification_setting request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest - - # 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_notification_setting.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_notification_setting.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_space_notification_setting.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.get_space_notification_setting request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the space notification setting. For an example, see [Update - # the caller's space notification - # setting](https://developers.google.com/workspace/chat/update-space-notification-setting). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.spacesettings` - # - # @overload update_space_notification_setting(request, options = nil) - # Pass arguments to `update_space_notification_setting` via a request object, either of type - # {::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, ::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_notification_setting(space_notification_setting: nil, update_mask: nil) - # Pass arguments to `update_space_notification_setting` 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_notification_setting [::Google::Apps::Chat::V1::SpaceNotificationSetting, ::Hash] - # Required. The resource name for the space notification settings must be - # populated in the form of - # `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields - # specified by `update_mask` are updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Supported field paths: - # - # - `notification_setting` - # - # - `mute_setting` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # - # @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::UpdateSpaceNotificationSettingRequest.new - # - # # Call the update_space_notification_setting method. - # result = client.update_space_notification_setting request - # - # # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. - # p result - # - def update_space_notification_setting request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest - - # 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_notification_setting.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_notification_setting.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_space_notification_setting.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.update_space_notification_setting request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a section in Google Chat. Sections help users group conversations - # and customize the list of spaces displayed in Chat navigation panel. Only - # sections of type `CUSTOM_SECTION` can be created. For details, see [Create - # and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload create_section(request, options = nil) - # Pass arguments to `create_section` via a request object, either of type - # {::Google::Apps::Chat::V1::CreateSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::CreateSectionRequest, ::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_section(parent: nil, section: nil) - # Pass arguments to `create_section` 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 parent resource name where the section is created. - # - # Format: `users/{user}` - # @param section [::Google::Apps::Chat::V1::Section, ::Hash] - # Required. The section to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::Section] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::Section] - # - # @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::CreateSectionRequest.new - # - # # Call the create_section method. - # result = client.create_section request - # - # # The returned object is of type Google::Apps::Chat::V1::Section. - # p result - # - def create_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::CreateSectionRequest - - # 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_section.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_section.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.create_section request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a section of type `CUSTOM_SECTION`. - # - # If the section contains items, such as spaces, the items are moved to - # Google Chat's default sections and are not deleted. - # - # For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload delete_section(request, options = nil) - # Pass arguments to `delete_section` via a request object, either of type - # {::Google::Apps::Chat::V1::DeleteSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::DeleteSectionRequest, ::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_section(name: nil) - # Pass arguments to `delete_section` 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 name of the section to delete. - # - # Format: `users/{user}/sections/{section}` - # @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::DeleteSectionRequest.new - # - # # Call the delete_section method. - # result = client.delete_section request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::DeleteSectionRequest - - # 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_section.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_section.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.delete_section request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a section. Only sections of type `CUSTOM_SECTION` can be updated. - # For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload update_section(request, options = nil) - # Pass arguments to `update_section` via a request object, either of type - # {::Google::Apps::Chat::V1::UpdateSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::UpdateSectionRequest, ::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_section(section: nil, update_mask: nil) - # Pass arguments to `update_section` 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 section [::Google::Apps::Chat::V1::Section, ::Hash] - # Required. The section to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The mask to specify which fields to update. - # - # Currently supported field paths: - # - # - `display_name` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::Section] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::Section] - # - # @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::UpdateSectionRequest.new - # - # # Call the update_section method. - # result = client.update_section request - # - # # The returned object is of type Google::Apps::Chat::V1::Section. - # p result - # - def update_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::UpdateSectionRequest - - # 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_section.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_section.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.update_section request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists sections available to the Chat user. Sections help users group their - # conversations and customize the list of spaces displayed in Chat - # navigation panel. For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - `https://www.googleapis.com/auth/chat.users.sections.readonly` - # - # @overload list_sections(request, options = nil) - # Pass arguments to `list_sections` via a request object, either of type - # {::Google::Apps::Chat::V1::ListSectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::ListSectionsRequest, ::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_sections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_sections` 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 parent, which is the user resource name that owns this - # collection of sections. Only supports listing sections for the calling - # user. To refer to the calling user, set one of the following: - # - # - The `me` alias. For example, `users/me`. - # - # - Their Workspace email address. For example, `users/user@example.com`. - # - # - Their user id. For example, `users/123456789`. - # - # Format: `users/{user}` - # @param page_size [::Integer] - # Optional. The maximum number of sections to return. The service may return - # fewer than this value. - # - # If unspecified, at most 10 sections will be returned. - # - # The maximum value is 100. If you use a value more than 100, it's - # automatically changed to 100. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @param page_token [::String] - # Optional. A page token, received from a previous list sections call. - # Provide this 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. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Section>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Section>] - # - # @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::ListSectionsRequest.new - # - # # Call the list_sections method. - # result = client.list_sections 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::Section. - # p item - # end - # - def list_sections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionsRequest - - # 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_sections.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_sections.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.list_sections request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_sections, "sections", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Changes the sort order of a section. For details, see [Create and organize - # sections in Google Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload position_section(request, options = nil) - # Pass arguments to `position_section` via a request object, either of type - # {::Google::Apps::Chat::V1::PositionSectionRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::PositionSectionRequest, ::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 position_section(name: nil, sort_order: nil, relative_position: nil) - # Pass arguments to `position_section` 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 section to position. - # - # Format: `users/{user}/sections/{section}` - # @param sort_order [::Integer] - # Optional. The absolute position of the section in the list of sections. - # The position must be greater than 0. If the position is greater than the - # number of sections, the section will be appended to the end of the list. - # This operation inserts the section at the given position and shifts the - # original section at that position, and those below it, to the next - # position. - # - # Note: The following parameters are mutually exclusive: `sort_order`, `relative_position`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @param relative_position [::Google::Apps::Chat::V1::PositionSectionRequest::Position] - # Optional. The relative position of the section in the list of sections. - # - # Note: The following parameters are mutually exclusive: `relative_position`, `sort_order`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::PositionSectionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::PositionSectionResponse] - # - # @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::PositionSectionRequest.new - # - # # Call the position_section method. - # result = client.position_section request - # - # # The returned object is of type Google::Apps::Chat::V1::PositionSectionResponse. - # p result - # - def position_section request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::PositionSectionRequest - - # 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.position_section.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.position_section.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.position_section.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.position_section request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists items in a section. - # - # Only spaces can be section items. For details, see [Create and organize - # sections in Google Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - `https://www.googleapis.com/auth/chat.users.sections.readonly` - # - # @overload list_section_items(request, options = nil) - # Pass arguments to `list_section_items` via a request object, either of type - # {::Google::Apps::Chat::V1::ListSectionItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::ListSectionItemsRequest, ::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_section_items(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_section_items` 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 parent, which is the section resource name that owns this - # collection of section items. Only supports listing section items for the - # calling user. - # - # When you're filtering by space, use the wildcard `-` to search across all - # sections. For example, `users/{user}/sections/-`. - # - # Format: `users/{user}/sections/{section}` - # @param page_size [::Integer] - # Optional. The maximum number of section items to return. The service may - # return fewer than this value. - # - # If unspecified, at most 10 section items will be returned. - # - # The maximum value is 100. If you use a value more than 100, it's - # automatically changed to 100. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @param page_token [::String] - # Optional. A page token, received from a previous list section items call. - # Provide this 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. - # - # Currently only supports filtering by space. - # - # For example, `space = spaces/{space}`. - # - # Invalid queries are rejected 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::SectionItem>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::SectionItem>] - # - # @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::ListSectionItemsRequest.new - # - # # Call the list_section_items method. - # result = client.list_section_items 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::SectionItem. - # p item - # end - # - def list_section_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::ListSectionItemsRequest - - # 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_section_items.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_section_items.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_section_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.list_section_items request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :list_section_items, "section_items", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Moves an item from one section to another. For example, if a section - # contains spaces, this method can be used to move a space to a different - # section. For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - # @overload move_section_item(request, options = nil) - # Pass arguments to `move_section_item` via a request object, either of type - # {::Google::Apps::Chat::V1::MoveSectionItemRequest} or an equivalent Hash. - # - # @param request [::Google::Apps::Chat::V1::MoveSectionItemRequest, ::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 move_section_item(name: nil, target_section: nil) - # Pass arguments to `move_section_item` 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 section item to move. - # - # Format: `users/{user}/sections/{section}/items/{item}` - # @param target_section [::String] - # Required. The resource name of the section to move the section item to. - # - # Format: `users/{user}/sections/{section}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Apps::Chat::V1::MoveSectionItemResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::MoveSectionItemResponse] - # - # @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::MoveSectionItemRequest.new - # - # # Call the move_section_item method. - # result = client.move_section_item request - # - # # The returned object is of type Google::Apps::Chat::V1::MoveSectionItemResponse. - # p result - # - def move_section_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::MoveSectionItemRequest - - # 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.move_section_item.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.move_section_item.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.move_section_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @chat_service_stub.move_section_item request, options do |result, operation| - yield result, operation if block_given? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-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] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,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, ::Google::Auth::BaseClient, ::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 - config_attr :logger, :default, ::Logger, nil, :default - - # @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 `find_group_chats` - # @return [::Gapic::Config::Method] - # - attr_reader :find_group_chats - ## - # 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 `create_custom_emoji` - # @return [::Gapic::Config::Method] - # - attr_reader :create_custom_emoji - ## - # RPC-specific configuration for `get_custom_emoji` - # @return [::Gapic::Config::Method] - # - attr_reader :get_custom_emoji - ## - # RPC-specific configuration for `list_custom_emojis` - # @return [::Gapic::Config::Method] - # - attr_reader :list_custom_emojis - ## - # RPC-specific configuration for `delete_custom_emoji` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_custom_emoji - ## - # 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 - ## - # RPC-specific configuration for `get_space_notification_setting` - # @return [::Gapic::Config::Method] - # - attr_reader :get_space_notification_setting - ## - # RPC-specific configuration for `update_space_notification_setting` - # @return [::Gapic::Config::Method] - # - attr_reader :update_space_notification_setting - ## - # RPC-specific configuration for `create_section` - # @return [::Gapic::Config::Method] - # - attr_reader :create_section - ## - # RPC-specific configuration for `delete_section` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_section - ## - # RPC-specific configuration for `update_section` - # @return [::Gapic::Config::Method] - # - attr_reader :update_section - ## - # RPC-specific configuration for `list_sections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sections - ## - # RPC-specific configuration for `position_section` - # @return [::Gapic::Config::Method] - # - attr_reader :position_section - ## - # RPC-specific configuration for `list_section_items` - # @return [::Gapic::Config::Method] - # - attr_reader :list_section_items - ## - # RPC-specific configuration for `move_section_item` - # @return [::Gapic::Config::Method] - # - attr_reader :move_section_item - - # @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 - find_group_chats_config = parent_rpcs.find_group_chats if parent_rpcs.respond_to? :find_group_chats - @find_group_chats = ::Gapic::Config::Method.new find_group_chats_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 - create_custom_emoji_config = parent_rpcs.create_custom_emoji if parent_rpcs.respond_to? :create_custom_emoji - @create_custom_emoji = ::Gapic::Config::Method.new create_custom_emoji_config - get_custom_emoji_config = parent_rpcs.get_custom_emoji if parent_rpcs.respond_to? :get_custom_emoji - @get_custom_emoji = ::Gapic::Config::Method.new get_custom_emoji_config - list_custom_emojis_config = parent_rpcs.list_custom_emojis if parent_rpcs.respond_to? :list_custom_emojis - @list_custom_emojis = ::Gapic::Config::Method.new list_custom_emojis_config - delete_custom_emoji_config = parent_rpcs.delete_custom_emoji if parent_rpcs.respond_to? :delete_custom_emoji - @delete_custom_emoji = ::Gapic::Config::Method.new delete_custom_emoji_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 - get_space_notification_setting_config = parent_rpcs.get_space_notification_setting if parent_rpcs.respond_to? :get_space_notification_setting - @get_space_notification_setting = ::Gapic::Config::Method.new get_space_notification_setting_config - update_space_notification_setting_config = parent_rpcs.update_space_notification_setting if parent_rpcs.respond_to? :update_space_notification_setting - @update_space_notification_setting = ::Gapic::Config::Method.new update_space_notification_setting_config - create_section_config = parent_rpcs.create_section if parent_rpcs.respond_to? :create_section - @create_section = ::Gapic::Config::Method.new create_section_config - delete_section_config = parent_rpcs.delete_section if parent_rpcs.respond_to? :delete_section - @delete_section = ::Gapic::Config::Method.new delete_section_config - update_section_config = parent_rpcs.update_section if parent_rpcs.respond_to? :update_section - @update_section = ::Gapic::Config::Method.new update_section_config - list_sections_config = parent_rpcs.list_sections if parent_rpcs.respond_to? :list_sections - @list_sections = ::Gapic::Config::Method.new list_sections_config - position_section_config = parent_rpcs.position_section if parent_rpcs.respond_to? :position_section - @position_section = ::Gapic::Config::Method.new position_section_config - list_section_items_config = parent_rpcs.list_section_items if parent_rpcs.respond_to? :list_section_items - @list_section_items = ::Gapic::Config::Method.new list_section_items_config - move_section_item_config = parent_rpcs.move_section_item if parent_rpcs.respond_to? :move_section_item - @move_section_item = ::Gapic::Config::Method.new move_section_item_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 deleted file mode 100644 index fc36cab4d69c..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/chat_service/rest/service_stub.rb +++ /dev/null @@ -1,2713 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # 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, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - 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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - 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, - method_name: "create_message", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "list_messages", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListMessagesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "list_memberships", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListMembershipsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_membership", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_message", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "update_message", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Message.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_message", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_attachment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Attachment.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "upload_attachment", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::UploadAttachmentResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "list_spaces", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListSpacesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "search_spaces", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::SearchSpacesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_space", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "create_space", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "set_up_space", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "update_space", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_space", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "complete_import_space", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::CompleteImportSpaceResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "find_direct_message", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Space.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the find_group_chats REST call - # - # @param request_pb [::Google::Apps::Chat::V1::FindGroupChatsRequest] - # 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::FindGroupChatsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::FindGroupChatsResponse] - # A result object deserialized from the server's reply - def find_group_chats request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_find_group_chats_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, - method_name: "find_group_chats", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::FindGroupChatsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "create_membership", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "update_membership", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_membership", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Membership.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "create_reaction", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Reaction.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "list_reactions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListReactionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "delete_reaction", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_custom_emoji REST call - # - # @param request_pb [::Google::Apps::Chat::V1::CreateCustomEmojiRequest] - # 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::CustomEmoji] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # A result object deserialized from the server's reply - def create_custom_emoji request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_custom_emoji_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, - method_name: "create_custom_emoji", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::CustomEmoji.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_custom_emoji REST call - # - # @param request_pb [::Google::Apps::Chat::V1::GetCustomEmojiRequest] - # 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::CustomEmoji] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # A result object deserialized from the server's reply - def get_custom_emoji request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_custom_emoji_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, - method_name: "get_custom_emoji", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::CustomEmoji.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_custom_emojis REST call - # - # @param request_pb [::Google::Apps::Chat::V1::ListCustomEmojisRequest] - # 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::ListCustomEmojisResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::ListCustomEmojisResponse] - # A result object deserialized from the server's reply - def list_custom_emojis request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_emojis_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, - method_name: "list_custom_emojis", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListCustomEmojisResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_custom_emoji REST call - # - # @param request_pb [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest] - # 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_custom_emoji request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_custom_emoji_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, - method_name: "delete_custom_emoji", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_space_read_state", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::SpaceReadState.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "update_space_read_state", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::SpaceReadState.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_thread_read_state", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ThreadReadState.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "get_space_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::SpaceEvent.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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, - method_name: "list_space_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListSpaceEventsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_space_notification_setting REST call - # - # @param request_pb [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest] - # 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::SpaceNotificationSetting] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # A result object deserialized from the server's reply - def get_space_notification_setting request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_space_notification_setting_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, - method_name: "get_space_notification_setting", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_space_notification_setting REST call - # - # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest] - # 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::SpaceNotificationSetting] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # A result object deserialized from the server's reply - def update_space_notification_setting request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_space_notification_setting_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, - method_name: "update_space_notification_setting", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::CreateSectionRequest] - # 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::Section] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::Section] - # A result object deserialized from the server's reply - def create_section request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_section_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, - method_name: "create_section", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Section.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::DeleteSectionRequest] - # 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_section request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_section_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, - method_name: "delete_section", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::UpdateSectionRequest] - # 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::Section] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::Section] - # A result object deserialized from the server's reply - def update_section request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_section_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, - method_name: "update_section", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::Section.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_sections REST call - # - # @param request_pb [::Google::Apps::Chat::V1::ListSectionsRequest] - # 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::ListSectionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::ListSectionsResponse] - # A result object deserialized from the server's reply - def list_sections request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sections_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, - method_name: "list_sections", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListSectionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the position_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::PositionSectionRequest] - # 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::PositionSectionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::PositionSectionResponse] - # A result object deserialized from the server's reply - def position_section request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_position_section_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, - method_name: "position_section", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::PositionSectionResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_section_items REST call - # - # @param request_pb [::Google::Apps::Chat::V1::ListSectionItemsRequest] - # 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::ListSectionItemsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::ListSectionItemsResponse] - # A result object deserialized from the server's reply - def list_section_items request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_section_items_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, - method_name: "list_section_items", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::ListSectionItemsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the move_section_item REST call - # - # @param request_pb [::Google::Apps::Chat::V1::MoveSectionItemRequest] - # 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::MoveSectionItemResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Apps::Chat::V1::MoveSectionItemResponse] - # A result object deserialized from the server's reply - def move_section_item request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_move_section_item_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, - method_name: "move_section_item", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Apps::Chat::V1::MoveSectionItemResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - 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 find_group_chats REST call - # - # @param request_pb [::Google::Apps::Chat::V1::FindGroupChatsRequest] - # 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_group_chats_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/spaces:findGroupChats", - 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 create_custom_emoji REST call - # - # @param request_pb [::Google::Apps::Chat::V1::CreateCustomEmojiRequest] - # 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_custom_emoji_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/customEmojis", - body: "custom_emoji", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_custom_emoji REST call - # - # @param request_pb [::Google::Apps::Chat::V1::GetCustomEmojiRequest] - # 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_custom_emoji_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^customEmojis/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_custom_emojis REST call - # - # @param request_pb [::Google::Apps::Chat::V1::ListCustomEmojisRequest] - # 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_custom_emojis_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/customEmojis", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_custom_emoji REST call - # - # @param request_pb [::Google::Apps::Chat::V1::DeleteCustomEmojiRequest] - # 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_custom_emoji_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^customEmojis/[^/]+/?$}, 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 - - ## - # @private - # - # GRPC transcoding helper method for the get_space_notification_setting REST call - # - # @param request_pb [::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest] - # 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_notification_setting_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^users/[^/]+/spaces/[^/]+/spaceNotificationSetting/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_space_notification_setting REST call - # - # @param request_pb [::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest] - # 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_notification_setting_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{space_notification_setting.name}", - body: "space_notification_setting", - matches: [ - ["space_notification_setting.name", %r{^users/[^/]+/spaces/[^/]+/spaceNotificationSetting/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::CreateSectionRequest] - # 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_section_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sections", - body: "section", - matches: [ - ["parent", %r{^users/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::DeleteSectionRequest] - # 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_section_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^users/[^/]+/sections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::UpdateSectionRequest] - # 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_section_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{section.name}", - body: "section", - matches: [ - ["section.name", %r{^users/[^/]+/sections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_sections REST call - # - # @param request_pb [::Google::Apps::Chat::V1::ListSectionsRequest] - # 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_sections_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sections", - matches: [ - ["parent", %r{^users/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the position_section REST call - # - # @param request_pb [::Google::Apps::Chat::V1::PositionSectionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_position_section_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:position", - body: "*", - matches: [ - ["name", %r{^users/[^/]+/sections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_section_items REST call - # - # @param request_pb [::Google::Apps::Chat::V1::ListSectionItemsRequest] - # 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_section_items_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/items", - matches: [ - ["parent", %r{^users/[^/]+/sections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the move_section_item REST call - # - # @param request_pb [::Google::Apps::Chat::V1::MoveSectionItemRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_move_section_item_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:move", - body: "*", - matches: [ - ["name", %r{^users/[^/]+/sections/[^/]+/items/[^/]+/?$}, 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 deleted file mode 100644 index e3deec0e2410..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/rest.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index b4d215efd2ab..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/apps/chat/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index e13370de297c..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/action_status_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 65ce1f494723..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/annotation_pb.rb +++ /dev/null @@ -1,41 +0,0 @@ -# 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/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/chat/v1/attachment_pb' -require 'google/chat/v1/reaction_pb' -require 'google/chat/v1/user_pb' - - -descriptor_data = "\n\x1fgoogle/chat/v1/annotation.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/chat/v1/attachment.proto\x1a\x1dgoogle/chat/v1/reaction.proto\x1a\x19google/chat/v1/user.proto\"\x82\x03\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\x12\x44\n\x15\x63ustom_emoji_metadata\x18\x07 \x01(\x0b\x32#.google.chat.v1.CustomEmojiMetadataH\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\"\x81\x04\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\x12\x41\n\x14meet_space_link_data\x18\x05 \x01(\x0b\x32!.google.chat.v1.MeetSpaceLinkDataH\x00\x12I\n\x18\x63\x61lendar_event_link_data\x18\x06 \x01(\x0b\x32%.google.chat.v1.CalendarEventLinkDataH\x00\"\x85\x01\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\x12\x11\n\rGMAIL_MESSAGE\x10\x03\x12\x0e\n\nMEET_SPACE\x10\x04\x12\x12\n\x0e\x43\x41LENDAR_EVENT\x10\x05\x42\x06\n\x04\x64\x61ta\"H\n\x13\x43ustomEmojiMetadata\x12\x31\n\x0c\x63ustom_emoji\x18\x01 \x01(\x0b\x32\x1b.google.chat.v1.CustomEmoji\"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\"\xb8\x02\n\x11MeetSpaceLinkData\x12\x14\n\x0cmeeting_code\x18\x01 \x01(\t\x12\x34\n\x04type\x18\x02 \x01(\x0e\x32&.google.chat.v1.MeetSpaceLinkData.Type\x12M\n\rhuddle_status\x18\x03 \x01(\x0e\x32..google.chat.v1.MeetSpaceLinkData.HuddleStatusB\x06\xe0\x41\x01\xe0\x41\x03\"5\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MEETING\x10\x01\x12\n\n\x06HUDDLE\x10\x02\"Q\n\x0cHuddleStatus\x12\x1d\n\x19HUDDLE_STATUS_UNSPECIFIED\x10\x00\x12\x0b\n\x07STARTED\x10\x01\x12\t\n\x05\x45NDED\x10\x02\x12\n\n\x06MISSED\x10\x03\">\n\x15\x43\x61lendarEventLinkData\x12\x13\n\x0b\x63\x61lendar_id\x18\x01 \x01(\t\x12\x10\n\x08\x65vent_id\x18\x02 \x01(\t*w\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\x12\x10\n\x0c\x43USTOM_EMOJI\x10\x04\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 -pool.add_serialized_file(descriptor_data) - -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 - CustomEmojiMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CustomEmojiMetadata").msgclass - DriveLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DriveLinkData").msgclass - ChatSpaceLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ChatSpaceLinkData").msgclass - MeetSpaceLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MeetSpaceLinkData").msgclass - MeetSpaceLinkData::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MeetSpaceLinkData.Type").enummodule - MeetSpaceLinkData::HuddleStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MeetSpaceLinkData.HuddleStatus").enummodule - CalendarEventLinkData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CalendarEventLinkData").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 deleted file mode 100644 index 36de37f2f088..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/attachment_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# 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\"\xfd\x03\n\nAttachment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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\x45\n\x13\x61ttachment_data_ref\x18\x04 \x01(\x0b\x32!.google.chat.v1.AttachmentDataRefB\x03\xe0\x41\x01H\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\"U\n\x11\x41ttachmentDataRef\x12\x1a\n\rresource_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61ttachment_upload_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 7670924d5cb7..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_pb.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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/section_pb' -require 'google/chat/v1/space_pb' -require 'google/chat/v1/space_event_pb' -require 'google/chat/v1/space_notification_setting_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\x1cgoogle/chat/v1/section.proto\x1a\x1agoogle/chat/v1/space.proto\x1a google/chat/v1/space_event.proto\x1a/google/chat/v1/space_notification_setting.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\xd1@\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\x82\x01\n\x0e\x46indGroupChats\x12%.google.chat.v1.FindGroupChatsRequest\x1a&.google.chat.v1.FindGroupChatsResponse\"!\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/spaces:findGroupChats\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\x91\x01\n\x11\x43reateCustomEmoji\x12(.google.chat.v1.CreateCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"5\xda\x41\x0c\x63ustom_emoji\x82\xd3\xe4\x93\x02 \"\x10/v1/customEmojis:\x0c\x63ustom_emoji\x12~\n\x0eGetCustomEmoji\x12%.google.chat.v1.GetCustomEmojiRequest\x1a\x1b.google.chat.v1.CustomEmoji\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/{name=customEmojis/*}\x12\x82\x01\n\x10ListCustomEmojis\x12\'.google.chat.v1.ListCustomEmojisRequest\x1a(.google.chat.v1.ListCustomEmojisResponse\"\x1b\xda\x41\x00\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/customEmojis\x12\x7f\n\x11\x44\x65leteCustomEmoji\x12(.google.chat.v1.DeleteCustomEmojiRequest\x1a\x16.google.protobuf.Empty\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v1/{name=customEmojis/*}\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\x12\xc0\x01\n\x1bGetSpaceNotificationSetting\x12\x32.google.chat.v1.GetSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=users/*/spaces/*/spaceNotificationSetting}\x12\xa0\x02\n\x1eUpdateSpaceNotificationSetting\x12\x35.google.chat.v1.UpdateSpaceNotificationSettingRequest\x1a(.google.chat.v1.SpaceNotificationSetting\"\x9c\x01\xda\x41&space_notification_setting,update_mask\x82\xd3\xe4\x93\x02m2O/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}:\x1aspace_notification_setting\x12\x8f\x01\n\rCreateSection\x12$.google.chat.v1.CreateSectionRequest\x1a\x17.google.chat.v1.Section\"?\xda\x41\x0eparent,section\x82\xd3\xe4\x93\x02(\"\x1d/v1/{parent=users/*}/sections:\x07section\x12{\n\rDeleteSection\x12$.google.chat.v1.DeleteSectionRequest\x1a\x16.google.protobuf.Empty\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=users/*/sections/*}\x12\x9c\x01\n\rUpdateSection\x12$.google.chat.v1.UpdateSectionRequest\x1a\x17.google.chat.v1.Section\"L\xda\x41\x13section,update_mask\x82\xd3\xe4\x93\x02\x30\x32%/v1/{section.name=users/*/sections/*}:\x07section\x12\x89\x01\n\x0cListSections\x12#.google.chat.v1.ListSectionsRequest\x1a$.google.chat.v1.ListSectionsResponse\".\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{parent=users/*}/sections\x12\x95\x01\n\x0fPositionSection\x12&.google.chat.v1.PositionSectionRequest\x1a\'.google.chat.v1.PositionSectionResponse\"1\x82\xd3\xe4\x93\x02+\"&/v1/{name=users/*/sections/*}:position:\x01*\x12\x9d\x01\n\x10ListSectionItems\x12\'.google.chat.v1.ListSectionItemsRequest\x1a(.google.chat.v1.ListSectionItemsResponse\"6\xda\x41\x06parent\x82\xd3\xe4\x93\x02\'\x12%/v1/{parent=users/*/sections/*}/items\x12\xaf\x01\n\x0fMoveSectionItem\x12&.google.chat.v1.MoveSectionItemRequest\x1a\'.google.chat.v1.MoveSectionItemResponse\"K\xda\x41\x13name,target_section\x82\xd3\xe4\x93\x02/\"*/v1/{name=users/*/sections/*/items/*}:move:\x01*\x1a\xbe\x0e\xca\x41\x13\x63hat.googleapis.com\xd2\x41\xa4\x0ehttps://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.app.delete,https://www.googleapis.com/auth/chat.app.memberships,https://www.googleapis.com/auth/chat.app.memberships.readonly,https://www.googleapis.com/auth/chat.app.messages.readonly,https://www.googleapis.com/auth/chat.app.spaces,https://www.googleapis.com/auth/chat.app.spaces.create,https://www.googleapis.com/auth/chat.app.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.customemojis,https://www.googleapis.com/auth/chat.customemojis.readonly,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,https://www.googleapis.com/auth/chat.users.sections,https://www.googleapis.com/auth/chat.users.sections.readonly,https://www.googleapis.com/auth/chat.users.spacesettingsB\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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index d58093b9179f..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/chat_service_services_pb.rb +++ /dev/null @@ -1,1036 +0,0 @@ -# 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 2026 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.create` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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. - # - # For - # [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) - # requests, the response doesn't contain the full message. The response only - # populates the `name` and `thread.name` fields in addition to the - # information that was in the request. - 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. System messages, like those - # announcing new space members, aren't included. 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When - # using this authentication scope, this method only returns public - # messages in a space. It doesn't include private messages. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.memberships` (requires - # [administrator approval](https://support.google.com/a?p=chat-app-auth)) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.admin.memberships` - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.memberships` (requires - # [administrator approval](https://support.google.com/a?p=chat-app-auth)) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.admin.memberships` - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot`: When using this - # authorization scope, this method returns details about a message the - # Chat app has access to, like direct messages and [slash - # commands](https://developers.google.com/workspace/chat/slash-commands) - # that invoke the Chat app. - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth). - # When using this authentication scope, - # this method returns details about a public message in a space. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - # 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # 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) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.bot` - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.create` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - # - # 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - # 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. In the request, set `use_admin_access` to `true`. - # For an example, see [Search for and manage - # spaces](https://developers.google.com/workspace/chat/search-manage-admin). - # - # Requires [user - # authentication with administrator - # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges) - # and one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.admin.spaces` - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.bot` - # - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # one of the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # App authentication has the following limitations: - # - # - `space.access_settings` is only populated when using the - # `chat.app.spaces` scope. - # - `space.predefind_permission_settings` and `space.permission_settings` are - # only populated when using the `chat.app.spaces` scope, and only for - # spaces the app created. - rpc :GetSpace, ::Google::Apps::Chat::V1::GetSpaceRequest, ::Google::Apps::Chat::V1::Space - # Creates a space. Can be used to create a named space, or a - # group chat in `Import mode`. For an example, see [Create a - # space](https://developers.google.com/workspace/chat/create-spaces). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces.create` - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.create` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - # When authenticating as an app, the `space.customer` field must be set in - # the request. - # - # When authenticating as an app, the Chat app is added as a member of the - # space. However, unlike human authentication, the Chat app is not added as a - # space manager. By default, the Chat app can be removed from the space by - # all space members. To allow only space managers to remove the app from a - # space, set `space.permission_settings.manage_apps` to `managers_allowed`. - # - # Space membership upon creation depends on whether the space is created in - # `Import mode`: - # - # * **Import mode:** No members are created. - # * **All other modes:** The calling user is added as a member. This is: - # * The app itself when using app authentication. - # * The human user when using user authentication. - # - # 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. - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.spaces.create` - # - `https://www.googleapis.com/auth/chat.spaces` - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scopes is used: - # - `https://www.googleapis.com/auth/chat.admin.spaces` - # - # App authentication has the following limitations: - # - # - To update either `space.predefined_permission_settings` or - # `space.permission_settings`, the app must be the space creator. - # - Updating the `space.access_settings.audience` is not supported for app - # authentication. - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) and the - # authorization scope: - # - `https://www.googleapis.com/auth/chat.app.delete` (only in - # spaces the app created) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.delete` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.delete` - 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 [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # and domain-wide delegation with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.import` - # - # 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 [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. - # - # 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with the authorization scope: - # - `https://www.googleapis.com/auth/chat.bot` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - rpc :FindDirectMessage, ::Google::Apps::Chat::V1::FindDirectMessageRequest, ::Google::Apps::Chat::V1::Space - # Returns all spaces with `spaceType == GROUP_CHAT`, whose - # human memberships contain exactly the calling user, and the users specified - # in `FindGroupChatsRequest.users`. Only members that have joined the - # conversation are supported. For an example, see [Find group - # chats](https://developers.google.com/workspace/chat/find-group-chats). - # - # If the calling user blocks, or is blocked by, some users, and no spaces - # with the entire specified set of users are found, this method returns - # spaces that don't include the blocked or blocking users. - # - # The specified set of users must contain only human (non-app) memberships. - # A request that contains non-human users doesn't return any spaces. - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - rpc :FindGroupChats, ::Google::Apps::Chat::V1::FindGroupChatsRequest, ::Google::Apps::Chat::V1::FindGroupChatsResponse - # 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.memberships.app` (to add the - # calling app to the space) - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # App authentication is not supported for the following use cases: - # - # - Inviting users external to the Workspace organization that owns the - # space. - # - Adding a Google Group to a space. - # - Adding a Chat app to a space. - # - # 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) and the - # authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` (only in - # spaces the app created) - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - 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). - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator approval](https://support.google.com/a?p=chat-app-auth) - # and the authorization scope: - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.memberships` - # - `https://www.googleapis.com/auth/chat.memberships.app` (to remove - # the calling app from the space) - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces - # only) - # - User authentication grants administrator privileges when an - # administrator account authenticates, `use_admin_access` is `true`, and - # the following authorization scope is used: - # - `https://www.googleapis.com/auth/chat.admin.memberships` - # - # App authentication is not supported for the following use cases: - # - # - Removing a Google Group from a space. - # - Removing a Chat app from a space. - # - # To delete memberships for space managers, the requester - # must be a space manager. If you're using [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # the Chat app must be the space creator. - rpc :DeleteMembership, ::Google::Apps::Chat::V1::DeleteMembershipRequest, ::Google::Apps::Chat::V1::Membership - # Creates a reaction and adds it to a message. 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions.create` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - rpc :ListReactions, ::Google::Apps::Chat::V1::ListReactionsRequest, ::Google::Apps::Chat::V1::ListReactionsResponse - # Deletes a reaction to a message. 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) - rpc :DeleteReaction, ::Google::Apps::Chat::V1::DeleteReactionRequest, ::Google::Protobuf::Empty - # Creates a custom emoji. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis` - rpc :CreateCustomEmoji, ::Google::Apps::Chat::V1::CreateCustomEmojiRequest, ::Google::Apps::Chat::V1::CustomEmoji - # Returns details about a custom emoji. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis.readonly` - # - `https://www.googleapis.com/auth/chat.customemojis` - rpc :GetCustomEmoji, ::Google::Apps::Chat::V1::GetCustomEmojiRequest, ::Google::Apps::Chat::V1::CustomEmoji - # Lists custom emojis visible to the authenticated user. - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis.readonly` - # - `https://www.googleapis.com/auth/chat.customemojis` - rpc :ListCustomEmojis, ::Google::Apps::Chat::V1::ListCustomEmojisRequest, ::Google::Apps::Chat::V1::ListCustomEmojisResponse - # Deletes a custom emoji. By default, users can only delete custom emoji they - # created. [Emoji managers](https://support.google.com/a/answer/12850085) - # assigned by the administrator can delete any custom emoji in the - # organization. See [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149). - # - # Custom emojis are only available for Google Workspace accounts, and the - # administrator must turn custom emojis on for the organization. For more - # information, see [Learn about custom emojis in Google - # Chat](https://support.google.com/chat/answer/12800149) and - # [Manage custom emoji - # permissions](https://support.google.com/a/answer/12850085). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.customemojis` - rpc :DeleteCustomEmoji, ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, ::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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - # - `https://www.googleapis.com/auth/chat.users.readstate` - 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) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate` - 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) - # with one of the following [authorization - # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - # - `https://www.googleapis.com/auth/chat.users.readstate` - 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - # with an - # [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) - # appropriate for reading the requested data: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # To get an event, the authenticated caller 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. - # - # Supports the following types of - # [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) - # with an - # [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) - # appropriate for reading the requested data: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.app.spaces` - # - `https://www.googleapis.com/auth/chat.app.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.app.messages.readonly` - # - `https://www.googleapis.com/auth/chat.app.memberships` - # - `https://www.googleapis.com/auth/chat.app.memberships.readonly` - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with one of the following authorization scopes: - # - `https://www.googleapis.com/auth/chat.spaces.readonly` - # - `https://www.googleapis.com/auth/chat.spaces` - # - `https://www.googleapis.com/auth/chat.messages.readonly` - # - `https://www.googleapis.com/auth/chat.messages` - # - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - # - `https://www.googleapis.com/auth/chat.messages.reactions` - # - `https://www.googleapis.com/auth/chat.memberships.readonly` - # - `https://www.googleapis.com/auth/chat.memberships` - # - # To list events, the authenticated caller 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 - # Gets the space notification setting. For an example, see [Get the - # caller's space notification - # setting](https://developers.google.com/workspace/chat/get-space-notification-setting). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.spacesettings` - rpc :GetSpaceNotificationSetting, ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, ::Google::Apps::Chat::V1::SpaceNotificationSetting - # Updates the space notification setting. For an example, see [Update - # the caller's space notification - # setting](https://developers.google.com/workspace/chat/update-space-notification-setting). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.spacesettings` - rpc :UpdateSpaceNotificationSetting, ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, ::Google::Apps::Chat::V1::SpaceNotificationSetting - # Creates a section in Google Chat. Sections help users group conversations - # and customize the list of spaces displayed in Chat navigation panel. Only - # sections of type `CUSTOM_SECTION` can be created. For details, see [Create - # and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - rpc :CreateSection, ::Google::Apps::Chat::V1::CreateSectionRequest, ::Google::Apps::Chat::V1::Section - # Deletes a section of type `CUSTOM_SECTION`. - # - # If the section contains items, such as spaces, the items are moved to - # Google Chat's default sections and are not deleted. - # - # For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - rpc :DeleteSection, ::Google::Apps::Chat::V1::DeleteSectionRequest, ::Google::Protobuf::Empty - # Updates a section. Only sections of type `CUSTOM_SECTION` can be updated. - # For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - rpc :UpdateSection, ::Google::Apps::Chat::V1::UpdateSectionRequest, ::Google::Apps::Chat::V1::Section - # Lists sections available to the Chat user. Sections help users group their - # conversations and customize the list of spaces displayed in Chat - # navigation panel. For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - `https://www.googleapis.com/auth/chat.users.sections.readonly` - rpc :ListSections, ::Google::Apps::Chat::V1::ListSectionsRequest, ::Google::Apps::Chat::V1::ListSectionsResponse - # Changes the sort order of a section. For details, see [Create and organize - # sections in Google Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - rpc :PositionSection, ::Google::Apps::Chat::V1::PositionSectionRequest, ::Google::Apps::Chat::V1::PositionSectionResponse - # Lists items in a section. - # - # Only spaces can be section items. For details, see [Create and organize - # sections in Google Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - # - `https://www.googleapis.com/auth/chat.users.sections.readonly` - rpc :ListSectionItems, ::Google::Apps::Chat::V1::ListSectionItemsRequest, ::Google::Apps::Chat::V1::ListSectionItemsResponse - # Moves an item from one section to another. For example, if a section - # contains spaces, this method can be used to move a space to a different - # section. For details, see [Create and organize sections in Google - # Chat](https://support.google.com/chat/answer/16059854). - # - # Requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # with the [authorization - # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - # - # - `https://www.googleapis.com/auth/chat.users.sections` - rpc :MoveSectionItem, ::Google::Apps::Chat::V1::MoveSectionItemRequest, ::Google::Apps::Chat::V1::MoveSectionItemResponse - 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 deleted file mode 100644 index 18ecfad801c4..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/contextual_addon_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 561d1e0c4e40..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/deletion_metadata_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# 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\"\x89\x02\n\x10\x44\x65letionMetadata\x12\x44\n\rdeletion_type\x18\x01 \x01(\x0e\x32-.google.chat.v1.DeletionMetadata.DeletionType\"\xae\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\x12\x10\n\x0cSPACE_MEMBER\x10\x07\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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index fcc2505fbc20..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/event_payload_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 3d52ee2019d2..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/group_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 4904f27aba95..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/history_state_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 90a907fad1a5..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/matched_url_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index dc6e05bfd065..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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\"\x96\x05\n\nMembership\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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.UserB\x03\xe0\x41\x01H\x00\x12\x32\n\x0cgroup_member\x18\x05 \x01(\x0b\x32\x15.google.chat.v1.GroupB\x03\xe0\x41\x01H\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\"p\n\x0eMembershipRole\x12\x1f\n\x1bMEMBERSHIP_ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bROLE_MEMBER\x10\x01\x12\x10\n\x0cROLE_MANAGER\x10\x02\x12\x1a\n\x16ROLE_ASSISTANT_MANAGER\x10\x04:D\xea\x41\x41\n\x1e\x63hat.googleapis.com/Membership\x12\x1fspaces/{space}/members/{member}B\x0c\n\nmemberType\"\xa5\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\x1d\n\x10use_admin_access\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xa3\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\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xea\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\x1d\n\x10use_admin_access\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\"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\"k\n\x14GetMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"n\n\x17\x44\x65leteMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 8a158f9d942f..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/message_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# 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\"\xd4\n\n\x07Message\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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\x11\n\x04text\x18\x04 \x01(\tB\x03\xe0\x41\x01\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\x31\n\x08\x63\x61rds_v2\x18\x16 \x03(\x0b\x32\x1a.google.chat.v1.CardWithIdB\x03\xe0\x41\x01\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.SpaceB\x03\xe0\x41\x03\x12\x1a\n\rfallback_text\x18\r \x01(\tB\x03\xe0\x41\x01\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\x33\n\nattachment\x18\x12 \x03(\x0b\x32\x1a.google.chat.v1.AttachmentB\x03\xe0\x41\x01\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(\tB\x03\xe0\x41\x01\x12K\n\x18\x65moji_reaction_summaries\x18! \x03(\x0b\x32$.google.chat.v1.EmojiReactionSummaryB\x03\xe0\x41\x03\x12<\n\x16private_message_viewer\x18$ \x01(\x0b\x32\x14.google.chat.v1.UserB\x06\xe0\x41\x05\xe0\x41\x01\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\x01\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.AccessoryWidgetB\x03\xe0\x41\x01: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\"\x98\x04\n\x15QuotedMessageMetadata\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\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\x02\x12H\n\nquote_type\x18\x04 \x01(\x0e\x32/.google.chat.v1.QuotedMessageMetadata.QuoteTypeB\x03\xe0\x41\x01\x12K\n\x17quoted_message_snapshot\x18\x05 \x01(\x0b\x32%.google.chat.v1.QuotedMessageSnapshotB\x03\xe0\x41\x03\x12\x42\n\x12\x66orwarded_metadata\x18\x06 \x01(\x0b\x32!.google.chat.v1.ForwardedMetadataB\x03\xe0\x41\x03\"2\n\tQuoteType\x12\x1a\n\x16QUOTE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05REPLY\x10\x01:\x81\x01\xea\x41~\n)chat.googleapis.com/QuotedMessageMetadata\x12Qspaces/{space}/messages/{message}/quotedMessageMetadata/{quoted_message_metadata}\"\xc8\x01\n\x15QuotedMessageSnapshot\x12\x13\n\x06sender\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04text\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0e\x66ormatted_text\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x61nnotations\x18\x04 \x03(\x0b\x32\x1a.google.chat.v1.AnnotationB\x03\xe0\x41\x03\x12\x34\n\x0b\x61ttachments\x18\x05 \x03(\x0b\x32\x1a.google.chat.v1.AttachmentB\x03\xe0\x41\x03\"f\n\x11\x46orwardedMetadata\x12\x30\n\x05space\x18\x01 \x01(\tB!\xe0\x41\x03\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1f\n\x12space_display_name\x18\x02 \x01(\tB\x03\xe0\x41\x03\"v\n\x06Thread\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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\"]\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\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x97\x01\n\x14UpdateMessageRequest\x12-\n\x07message\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.MessageB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\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\"\xc2\x01\n\x13ListMessagesRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1b\x63hat.googleapis.com/Message\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\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cshow_deleted\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\"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 -pool.add_serialized_file(descriptor_data) - -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 - QuotedMessageMetadata::QuoteType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.QuotedMessageMetadata.QuoteType").enummodule - QuotedMessageSnapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.QuotedMessageSnapshot").msgclass - ForwardedMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ForwardedMetadata").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 deleted file mode 100644 index db8fe04ef61f..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/reaction_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# 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/field_info_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\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x19google/chat/v1/user.proto\"\xcc\x01\n\x08Reaction\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\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.EmojiB\x03\xe0\x41\x02:Y\xea\x41V\n\x1c\x63hat.googleapis.com/Reaction\x12\x36spaces/{space}/messages/{message}/reactions/{reaction}\"_\n\x05\x45moji\x12\x16\n\x07unicode\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x12\x33\n\x0c\x63ustom_emoji\x18\x02 \x01(\x0b\x32\x1b.google.chat.v1.CustomEmojiH\x00\x42\t\n\x07\x63ontent\"\xed\x02\n\x0b\x43ustomEmoji\x12\x11\n\x04name\x18\x02 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x01 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x1a\n\nemoji_name\x18\x03 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12 \n\x13temporary_image_uri\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12G\n\x07payload\x18\x05 \x01(\x0b\x32..google.chat.v1.CustomEmoji.CustomEmojiPayloadB\x06\xe0\x41\x04\xe0\x41\x01\x1aL\n\x12\x43ustomEmojiPayload\x12\x1c\n\x0c\x66ile_content\x18\x01 \x01(\x0c\x42\x06\xe0\x41\x04\xe0\x41\x02\x12\x18\n\x08\x66ilename\x18\x02 \x01(\tB\x06\xe0\x41\x04\xe0\x41\x02:\\\xea\x41Y\n\x1f\x63hat.googleapis.com/CustomEmoji\x12\x1b\x63ustomEmojis/{custom_emoji}*\x0c\x63ustomEmojis2\x0b\x63ustomEmoji\"v\n\x14\x45mojiReactionSummary\x12)\n\x05\x65moji\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.EmojiB\x03\xe0\x41\x03\x12 \n\x0ereaction_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03H\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/Reaction\"R\n\x18\x43reateCustomEmojiRequest\x12\x36\n\x0c\x63ustom_emoji\x18\x01 \x01(\x0b\x32\x1b.google.chat.v1.CustomEmojiB\x03\xe0\x41\x02\"N\n\x15GetCustomEmojiRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63hat.googleapis.com/CustomEmoji\"_\n\x17ListCustomEmojisRequest\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\"l\n\x18ListCustomEmojisResponse\x12\x37\n\rcustom_emojis\x18\x01 \x03(\x0b\x32\x1b.google.chat.v1.CustomEmojiB\x03\xe0\x41\x06\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Q\n\x18\x44\x65leteCustomEmojiRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63hat.googleapis.com/CustomEmojiB\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 -pool.add_serialized_file(descriptor_data) - -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 - CustomEmoji::CustomEmojiPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CustomEmoji.CustomEmojiPayload").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 - CreateCustomEmojiRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateCustomEmojiRequest").msgclass - GetCustomEmojiRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetCustomEmojiRequest").msgclass - ListCustomEmojisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListCustomEmojisRequest").msgclass - ListCustomEmojisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListCustomEmojisResponse").msgclass - DeleteCustomEmojiRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteCustomEmojiRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/section_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/section_pb.rb deleted file mode 100644 index dfb2a11c664a..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/section_pb.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/chat/v1/section.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n\x1cgoogle/chat/v1/section.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xde\x02\n\x07Section\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\nsort_order\x18\x03 \x01(\x05\x12\x36\n\x04type\x18\x04 \x01(\x0e\x32#.google.chat.v1.Section.SectionTypeB\x03\xe0\x41\x02\"\x82\x01\n\x0bSectionType\x12\x1c\n\x18SECTION_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x43USTOM_SECTION\x10\x01\x12\x1b\n\x17\x44\x45\x46\x41ULT_DIRECT_MESSAGES\x10\x02\x12\x12\n\x0e\x44\x45\x46\x41ULT_SPACES\x10\x03\x12\x10\n\x0c\x44\x45\x46\x41ULT_APPS\x10\x06:T\xea\x41Q\n\x1b\x63hat.googleapis.com/Section\x12\x1fusers/{user}/sections/{section}*\x08sections2\x07section\"\xcb\x01\n\x0bSectionItem\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x32\n\x05space\x18\x02 \x01(\tB!\xe0\x41\x01\xfa\x41\x1b\n\x19\x63hat.googleapis.com/SpaceH\x00:m\xea\x41j\n\x1f\x63hat.googleapis.com/SectionItem\x12,users/{user}/sections/{section}/items/{item}*\x0csectionItems2\x0bsectionItemB\x06\n\x04item\"w\n\x14\x43reateSectionRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x63hat.googleapis.com/User\x12-\n\x07section\x18\x02 \x01(\x0b\x32\x17.google.chat.v1.SectionB\x03\xe0\x41\x02\"I\n\x14\x44\x65leteSectionRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\"{\n\x14UpdateSectionRequest\x12-\n\x07section\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.SectionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"x\n\x13ListSectionsRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x63hat.googleapis.com/User\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\"Z\n\x14ListSectionsResponse\x12)\n\x08sections\x18\x01 \x03(\x0b\x32\x17.google.chat.v1.Section\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xff\x01\n\x16PositionSectionRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\x12\x19\n\nsort_order\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x12Q\n\x11relative_position\x18\x03 \x01(\x0e\x32/.google.chat.v1.PositionSectionRequest.PositionB\x03\xe0\x41\x01H\x00\"8\n\x08Position\x12\x18\n\x14POSITION_UNSPECIFIED\x10\x00\x12\t\n\x05START\x10\x01\x12\x07\n\x03\x45ND\x10\x02\x42\n\n\x08position\"C\n\x17PositionSectionResponse\x12(\n\x07section\x18\x01 \x01(\x0b\x32\x17.google.chat.v1.Section\"\x94\x01\n\x17ListSectionItemsRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\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\"g\n\x18ListSectionItemsResponse\x12\x32\n\rsection_items\x18\x01 \x03(\x0b\x32\x1b.google.chat.v1.SectionItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8c\x01\n\x16MoveSectionItemRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1f\x63hat.googleapis.com/SectionItem\x12;\n\x0etarget_section\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1b\x63hat.googleapis.com/Section\"L\n\x17MoveSectionItemResponse\x12\x31\n\x0csection_item\x18\x01 \x01(\x0b\x32\x1b.google.chat.v1.SectionItemB\xd0\x01\n\x12\x63om.google.chat.v1B\x0cSectionProtoP\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::V1\xea\x41(\n\x18\x63hat.googleapis.com/User\x12\x0cusers/{user}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Apps - module Chat - module V1 - Section = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Section").msgclass - Section::SectionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Section.SectionType").enummodule - SectionItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SectionItem").msgclass - CreateSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CreateSectionRequest").msgclass - DeleteSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteSectionRequest").msgclass - UpdateSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateSectionRequest").msgclass - ListSectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionsRequest").msgclass - ListSectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionsResponse").msgclass - PositionSectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.PositionSectionRequest").msgclass - PositionSectionRequest::Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.PositionSectionRequest.Position").enummodule - PositionSectionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.PositionSectionResponse").msgclass - ListSectionItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionItemsRequest").msgclass - ListSectionItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.ListSectionItemsResponse").msgclass - MoveSectionItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MoveSectionItemRequest").msgclass - MoveSectionItemResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.MoveSectionItemResponse").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 deleted file mode 100644 index 14ad136a7f94..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/slash_command_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index 48c3a5dd1af1..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_event_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# 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\"\x96\x01\n\x16ListSpaceEventsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63hat.googleapis.com/SpaceEvent\x12\x16\n\tpage_size\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x06 \x01(\tB\x03\xe0\x41\x01\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 -pool.add_serialized_file(descriptor_data) - -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_notification_setting_pb.rb b/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_notification_setting_pb.rb deleted file mode 100644 index 28aa6087c827..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_notification_setting_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/chat/v1/space_notification_setting.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n/google/chat/v1/space_notification_setting.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\"\xc6\x04\n\x18SpaceNotificationSetting\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12_\n\x14notification_setting\x18\x02 \x01(\x0e\x32<.google.chat.v1.SpaceNotificationSetting.NotificationSettingH\x00\x88\x01\x01\x12O\n\x0cmute_setting\x18\x03 \x01(\x0e\x32\x34.google.chat.v1.SpaceNotificationSetting.MuteSettingH\x01\x88\x01\x01\"r\n\x13NotificationSetting\x12$\n NOTIFICATION_SETTING_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41LL\x10\x01\x12\x16\n\x12MAIN_CONVERSATIONS\x10\x02\x12\x0b\n\x07\x46OR_YOU\x10\x03\x12\x07\n\x03OFF\x10\x04\"C\n\x0bMuteSetting\x12\x1c\n\x18MUTE_SETTING_UNSPECIFIED\x10\x00\x12\x0b\n\x07UNMUTED\x10\x01\x12\t\n\x05MUTED\x10\x02:\x81\x01\xea\x41~\n,chat.googleapis.com/SpaceNotificationSetting\x12\x34users/{user}/spaces/{space}/spaceNotificationSetting2\x18spaceNotificationSettingB\x17\n\x15_notification_settingB\x0f\n\r_mute_setting\"h\n\"GetSpaceNotificationSettingRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,chat.googleapis.com/SpaceNotificationSetting\"\xb0\x01\n%UpdateSpaceNotificationSettingRequest\x12Q\n\x1aspace_notification_setting\x18\x01 \x01(\x0b\x32(.google.chat.v1.SpaceNotificationSettingB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x42\xb6\x01\n\x12\x63om.google.chat.v1B\x1dSpaceNotificationSettingProtoP\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 -pool.add_serialized_file(descriptor_data) - -module Google - module Apps - module Chat - module V1 - SpaceNotificationSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceNotificationSetting").msgclass - SpaceNotificationSetting::NotificationSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceNotificationSetting.NotificationSetting").enummodule - SpaceNotificationSetting::MuteSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceNotificationSetting.MuteSetting").enummodule - GetSpaceNotificationSettingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetSpaceNotificationSettingRequest").msgclass - UpdateSpaceNotificationSettingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateSpaceNotificationSettingRequest").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 deleted file mode 100644 index 7c949866ae56..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_pb.rb +++ /dev/null @@ -1,51 +0,0 @@ -# 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\"\xcd\x16\n\x05Space\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1a.google.chat.v1.Space.TypeB\x05\x18\x01\xe0\x41\x03\x12\x38\n\nspace_type\x18\n \x01(\x0e\x32\x1f.google.chat.v1.Space.SpaceTypeB\x03\xe0\x41\x01\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\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12%\n\x15\x65xternal_user_allowed\x18\x08 \x01(\x08\x42\x06\xe0\x41\x05\xe0\x41\x01\x12M\n\x15space_threading_state\x18\t \x01(\x0e\x32).google.chat.v1.Space.SpaceThreadingStateB\x03\xe0\x41\x03\x12>\n\rspace_details\x18\x0b \x01(\x0b\x32\".google.chat.v1.Space.SpaceDetailsB\x03\xe0\x41\x01\x12>\n\x13space_history_state\x18\r \x01(\x0e\x32\x1c.google.chat.v1.HistoryStateB\x03\xe0\x41\x01\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\x1d\n\x08\x63ustomer\x18\x18 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x01H\x01\x88\x01\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\x12@\n\x17import_mode_expire_time\x18\x1c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x41\n\x0cSpaceDetails\x12\x18\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nguidelines\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a_\n\x0fMembershipCount\x12+\n\x1ejoined_direct_human_user_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1f\n\x12joined_group_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\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\xa8\x06\n\x12PermissionSettings\x12T\n\x19manage_members_and_groups\x18\x01 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12O\n\x14modify_space_details\x18\x02 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x01\x88\x01\x01\x12I\n\x0etoggle_history\x18\x03 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x02\x88\x01\x01\x12M\n\x12use_at_mention_all\x18\x04 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x46\n\x0bmanage_apps\x18\x05 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\x04\x88\x01\x01\x12J\n\x0fmanage_webhooks\x18\x06 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x12I\n\x0ereply_messages\x18\x08 \x01(\x0b\x32\'.google.chat.v1.Space.PermissionSettingB\x03\xe0\x41\x01H\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\x9d\x01\n\x11PermissionSetting\x12\x1d\n\x10managers_allowed\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12,\n\x1a\x61ssistant_managers_allowed\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x1c\n\x0fmembers_allowed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x42\x1d\n\x1b_assistant_managers_allowed\".\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_settingsB\x0b\n\t_customer\"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\"a\n\x0fGetSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"-\n\x18\x46indDirectMessageRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x8b\x01\n\x15\x46indGroupChatsRequest\x12\x12\n\x05users\x18\x05 \x03(\tB\x03\xe0\x41\x01\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-\n\nspace_view\x18\x04 \x01(\x0e\x32\x19.google.chat.v1.SpaceView\"X\n\x16\x46indGroupChatsResponse\x12%\n\x06spaces\x18\x01 \x03(\x0b\x32\x15.google.chat.v1.Space\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x94\x01\n\x12UpdateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1d\n\x10use_admin_access\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\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\"d\n\x12\x44\x65leteSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x1d\n\x10use_admin_access\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"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.Space*c\n\tSpaceView\x12\x1a\n\x16SPACE_VIEW_UNSPECIFIED\x10\x00\x12!\n\x1dSPACE_VIEW_RESOURCE_NAME_ONLY\x10\x03\x12\x17\n\x13SPACE_VIEW_EXPANDED\x10\x04\x42\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 -pool.add_serialized_file(descriptor_data) - -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 - FindGroupChatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindGroupChatsRequest").msgclass - FindGroupChatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindGroupChatsResponse").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 - SpaceView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SpaceView").enummodule - 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 deleted file mode 100644 index 6bfeeb683cb1..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_read_state_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index cad576472f32..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/space_setup_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index d673eb835c39..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/lib/google/chat/v1/thread_read_state_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# 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 -pool.add_serialized_file(descriptor_data) - -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 deleted file mode 100644 index bd33b9b4ff23..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# 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 deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - 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. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # Example: - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - 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 - 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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 - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # - # Note: This feature should not be used in most cases. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - 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 deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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/field_info.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - 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/api/launch_stage.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index ae4f0c500d39..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/apps/card/v1/card.rb +++ /dev/null @@ -1,2627 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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). - # - # Note: You can add up to 100 widgets per card. Any widgets beyond this - # limit are ignored. This limit applies to both card messages and dialogs - # in Google Chat apps, and to cards in Google Workspace add-ons. - # - # **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 the header, sections and footer. - # @!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`. - # @!attribute [rw] collapse_control - # @return [::Google::Apps::Card::V1::CollapseControl] - # Optional. Define the expand and collapse button of the section. - # This button will be shown only if the section is collapsible. - # If this field isn't set, the default button is used. - 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 list of widgets that can be displayed in a containing layout, such - # as a `CarouselCard`. - # [Google Chat apps](https://developers.google.com/workspace/chat): - # @!attribute [rw] text_paragraph - # @return [::Google::Apps::Card::V1::TextParagraph] - # A text paragraph widget. - # - # Note: The following fields are mutually exclusive: `text_paragraph`, `button_list`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] button_list - # @return [::Google::Apps::Card::V1::ButtonList] - # A button list widget. - # - # Note: The following fields are mutually exclusive: `button_list`, `text_paragraph`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image - # @return [::Google::Apps::Card::V1::Image] - # An image widget. - # - # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `button_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class NestedWidget - 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. - SOLID_DIVIDER = 1 - - # If set, no divider is rendered. This style completely removes the divider - # from the layout. The result is equivalent to not adding a divider at all. - 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" - # } - # ``` - # - # Note: The following fields are mutually exclusive: `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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" - # } - # ``` - # - # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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" - # } - # } - # ``` - # - # Note: The following fields are mutually exclusive: `decorated_text`, `text_paragraph`, `image`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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, - # }, - # "disabled": true, - # }, - # { - # "icon": { - # "knownIcon": "INVITE", - # "altText": "check calendar" - # }, - # "onClick": { - # "openLink": { - # "url": "https://example.com/calendar" - # } - # } - # } - # ] - # } - # ``` - # - # Note: The following fields are mutually exclusive: `button_list`, `text_paragraph`, `image`, `decorated_text`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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" - # } - # ] - # } - # } - # ``` - # - # Note: The following fields are mutually exclusive: `text_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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 - # } - # ] - # } - # ``` - # - # Note: The following fields are mutually exclusive: `selection_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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 - # } - # ``` - # - # Note: The following fields are mutually exclusive: `date_time_picker`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `divider`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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": { - # } - # ``` - # - # Note: The following fields are mutually exclusive: `divider`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `grid`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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" - # } - # } - # } - # ``` - # - # Note: The following fields are mutually exclusive: `grid`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `columns`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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" - # } - # } - # ] - # } - # ] - # } - # ``` - # - # Note: The following fields are mutually exclusive: `columns`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `carousel`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] carousel - # @return [::Google::Apps::Card::V1::Carousel] - # A carousel contains a collection of nested widgets. - # For example, this is a JSON representation of a carousel that contains - # two text paragraphs. - # - # ``` - # { - # "widgets": [ - # { - # "textParagraph": { - # "text": "First text paragraph in the carousel." - # } - # }, - # { - # "textParagraph": { - # "text": "Second text paragraph in the carousel." - # } - # } - # ] - # } - # ``` - # - # Note: The following fields are mutually exclusive: `carousel`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] chip_list - # @return [::Google::Apps::Card::V1::ChipList] - # A list of chips. - # - # For example, the following JSON creates two chips. The first - # is a text chip and the second is an icon chip that opens a - # link: - # ``` - # "chipList": { - # "chips": [ - # { - # "text": "Edit", - # "disabled": true, - # }, - # { - # "icon": { - # "knownIcon": "INVITE", - # "altText": "check calendar" - # }, - # "onClick": { - # "openLink": { - # "url": "https://example.com/calendar" - # } - # } - # } - # ] - # } - # ``` - # - # Note: The following fields are mutually exclusive: `chip_list`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `divider`, `grid`, `columns`, `carousel`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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 - - # Represents vertical alignment attribute. - module VerticalAlignment - # Unspecified type. Do not use. - VERTICAL_ALIGNMENT_UNSPECIFIED = 0 - - # Alignment to the top position. - TOP = 1 - - # Alignment to the middle position. - MIDDLE = 2 - - # Alignment to the bottom position. - BOTTOM = 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. - # @!attribute [rw] max_lines - # @return [::Integer] - # The maximum number of lines of text that are displayed in the widget. If - # the text exceeds the specified maximum number of lines, the excess - # content is concealed behind a **show more** button. If the text is equal or - # shorter than the specified maximum number of lines, a **show more** button - # isn't displayed. - # - # The default value is 0, in which case - # all context is displayed. Negative values are ignored. - # @!attribute [rw] text_syntax - # @return [::Google::Apps::Card::V1::TextParagraph::TextSyntax] - # The syntax of the text. If not set, the text is rendered as HTML. - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - class TextParagraph - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Syntax to use for formatting text. - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - module TextSyntax - # The text is rendered as HTML if unspecified. - TEXT_SYNTAX_UNSPECIFIED = 0 - - # The text is rendered as HTML. This is the default value. - HTML = 1 - - # The text is rendered as Markdown. - MARKDOWN = 2 - end - 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] start_icon_vertical_alignment - # @return [::Google::Apps::Card::V1::Widget::VerticalAlignment] - # Optional. Vertical alignment of the start icon. If not set, the icon - # will be vertically centered. - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - # @!attribute [rw] top_label - # @return [::String] - # The text that appears above `text`. Always truncates. - # @!attribute [rw] top_label_text - # @return [::Google::Apps::Card::V1::TextParagraph] - # `TextParagraph` equivalent of `top_label`. Always truncates. Allows for - # more complex formatting than `top_label`. - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - # @!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] content_text - # @return [::Google::Apps::Card::V1::TextParagraph] - # `TextParagraph` equivalent of `text`. Allows for more complex formatting - # than `text`. - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - # @!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] bottom_label_text - # @return [::Google::Apps::Card::V1::TextParagraph] - # `TextParagraph` equivalent of `bottom_label`. Always wraps. Allows for - # more complex formatting than `bottom_label`. - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - # @!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. - # - # Note: The following fields are mutually exclusive: `button`, `switch_control`, `end_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. - # - # Note: The following fields are mutually exclusive: `switch_control`, `button`, `end_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. - # - # Note: The following fields are mutually exclusive: `end_icon`, `button`, `switch_control`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # Supports form submission validation. When `Action.all_widgets_are_required` - # is set to `true` or this widget is specified in `Action.required_widgets`, - # the submission action is blocked unless a value is entered. 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] validation - # @return [::Google::Apps::Card::V1::Validation] - # Specify the input format validation necessary for this text field. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!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. - # Supports form submission validation for `dropdown` and `multiselect` menus - # only. When `Action.all_widgets_are_required` is set to `true` or this widget - # is specified in `Action.required_widgets`, the submission action is blocked - # unless a value is selected. 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] - # Required. 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 menu returns suggested selection items. - # - # If unset, the multiselect menu uses the following default values: - # - # * If the menu uses a static array of `SelectionInput` items, defaults to - # 0 characters and immediately populates items from the array. - # * If the menu uses a dynamic data source (`multi_select_data_source`), - # defaults to 3 characters before querying the data source to return - # suggested items. - # @!attribute [rw] external_data_source - # @return [::Google::Apps::Card::V1::Action] - # An external data source, such as a relational database. - # - # Note: The following fields are mutually exclusive: `external_data_source`, `platform_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] platform_data_source - # @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource] - # A data source from Google Workspace. - # - # Note: The following fields are mutually exclusive: `platform_data_source`, `external_data_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. Supports up to 100 items. - # - # [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] - # @!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. - # - # For Google Chat apps, you can populate items using a dynamic data source - # and autosuggest items as users type in the menu. For example, users can - # start typing the name of a Google Chat space and the widget autosuggests - # the space. To dynamically populate items for a dropdown menu, use one of - # the following types of data sources: - # - # * 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 dropdown menus for Chat apps, see - # [Add a dropdown - # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#dropdown-menu) - # and [Dynamically populate drop-down - # menus](https://developers.google.com/workspace/chat/design-interactive-card-dialog#dynamic-dropdown-menu). - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - DROPDOWN = 3 - - # A menu with a text box. Users can type and select one or more items. - # For Google Workspace add-ons, you must populate items using a static - # array of `SelectionItem` objects. - # - # For Google Chat apps, you can also populate items using a dynamic data - # source and autosuggest items as users type in the menu. For example, - # users can start typing the name of a Google Chat space and the widget - # autosuggests the space. To dynamically populate items for a multiselect - # menu, use one of the following types of data sources: - # - # * 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 for Chat apps, 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): - MULTI_SELECT = 4 - end - end - - # Lets users input a date, a time, or both a date and a time. - # Supports form submission validation. When `Action.all_widgets_are_required` - # is set to `true` or this widget is specified in `Action.required_widgets`, - # the submission action is blocked unless a value is selected. 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] - # Optional. 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 widget that presents a pop-up menu with one or more actions that users can - # invoke. For example, showing non-primary actions in a card. You can use this - # widget when actions don't fit in the available space. To use, specify this - # widget in the `OnClick` action of widgets that support it. For example, in a - # `Button`. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!attribute [rw] items - # @return [::Array<::Google::Apps::Card::V1::OverflowMenu::OverflowMenuItem>] - # Required. The list of menu options. - class OverflowMenu - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An option that users can invoke in an overflow menu. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!attribute [rw] start_icon - # @return [::Google::Apps::Card::V1::Icon] - # The icon displayed in front of the text. - # @!attribute [rw] text - # @return [::String] - # Required. The text that identifies or describes the item to users. - # @!attribute [rw] on_click - # @return [::Google::Apps::Card::V1::OnClick] - # Required. The action invoked when a menu option is selected. - # This `OnClick` cannot contain an `OverflowMenu`, any specified - # `OverflowMenu` is dropped and the menu item disabled. - # @!attribute [rw] disabled - # @return [::Boolean] - # Whether the menu option is disabled. - # Defaults to false. - class OverflowMenuItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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] - # An icon displayed inside the button. If both `icon` and `text` are set, - # then the icon appears before the text. - # @!attribute [rw] color - # @return [::Google::Type::Color] - # Optional. The color of the button. If set, the button `type` is set to - # `FILLED` and the color of `text` and `icon` fields are set to a - # contrasting color for readability. For example, if the button color is - # set to blue, any text or icons in the button are set to white. - # - # To set the button color, specify a value for the `red`, `green`, and `blue` - # fields. - # The value must be a float number between 0 and 1 based on the RGB color - # value, where `0` (0/255) represents the absence of color and `1` (255/255) - # represents the maximum intensity of the color. - # - # For example, the following sets the color to red at its maximum intensity: - # - # ``` - # "color": { - # "red": 1, - # "green": 0, - # "blue": 0, - # } - # ``` - # - # The `alpha` field is unavailable for button color. If specified, this field - # is ignored. - # @!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". - # @!attribute [rw] type - # @return [::Google::Apps::Card::V1::Button::Type] - # Optional. The type of a button. If unset, button type defaults to - # `OUTLINED`. If the `color` field is set, the button type is forced to - # `FILLED` and any value set for this field is ignored. - class Button - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Optional. The - # [type](https://m3.material.io/components/all-buttons#9134ac95-678e-49ae-a50a-e71948011b05) - # of a button. If `color` field is set, the `type` is forced to `FILLED`. - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - module Type - # Don't use. Unspecified. - TYPE_UNSPECIFIED = 0 - - # Outlined buttons are medium-emphasis buttons. They usually contain - # actions that are important, but aren’t the primary action in a Chat app - # or an add-on. - OUTLINED = 1 - - # A filled button has a container with a solid color. It has the most - # visual impact and is recommended for the important and primary action in - # a Chat app or an add-on. - FILLED = 2 - - # A filled tonal button is an alternative middle ground between filled and - # outlined buttons. They’re useful in contexts where a lower-priority - # button requires slightly more emphasis than an outline button would give. - FILLED_TONAL = 3 - - # A button does not have an invisible container in its default state. It is - # often used for the lowest priority actions, especially when presenting - # multiple options. - BORDERLESS = 4 - end - 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). - # - # Note: The following fields are mutually exclusive: `known_icon`, `icon_url`, `material_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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`. - # - # Note: The following fields are mutually exclusive: `icon_url`, `known_icon`, `material_icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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): - # - # Note: The following fields are mutually exclusive: `material_icon`, `known_icon`, `icon_url`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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`. - # - # To set the stroke color, specify a value for the `red`, `green`, and `blue` - # fields. - # The value must be a float number between 0 and 1 based on the RGB color - # value, where `0` (0/255) represents the absence of color and `1` (255/255) - # represents the maximum intensity of the color. - # - # For example, the following sets the color to red at its maximum intensity: - # - # ``` - # "color": { - # "red": 1, - # "green": 0, - # "blue": 0, - # } - # ``` - # - # The `alpha` field is unavailable for stroke color. If specified, this field - # is ignored. - # @!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 - - # No border. - NO_BORDER = 1 - - # Default value. 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 two 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): - # The add-on UIs that support columns include: - # - # * The dialog displayed when users open the add-on from an email draft. - # * The dialog displayed when users open the add-on from the - # **Add attachment** menu in a Google Calendar event. - # @!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) - # @!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) - # @!attribute [rw] text_paragraph - # @return [::Google::Apps::Card::V1::TextParagraph] - # {::Google::Apps::Card::V1::TextParagraph TextParagraph} widget. - # - # Note: The following fields are mutually exclusive: `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image - # @return [::Google::Apps::Card::V1::Image] - # {::Google::Apps::Card::V1::Image Image} widget. - # - # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] decorated_text - # @return [::Google::Apps::Card::V1::DecoratedText] - # {::Google::Apps::Card::V1::DecoratedText DecoratedText} widget. - # - # Note: The following fields are mutually exclusive: `decorated_text`, `text_paragraph`, `image`, `button_list`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] button_list - # @return [::Google::Apps::Card::V1::ButtonList] - # {::Google::Apps::Card::V1::ButtonList ButtonList} widget. - # - # Note: The following fields are mutually exclusive: `button_list`, `text_paragraph`, `image`, `decorated_text`, `text_input`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_input - # @return [::Google::Apps::Card::V1::TextInput] - # {::Google::Apps::Card::V1::TextInput TextInput} widget. - # - # Note: The following fields are mutually exclusive: `text_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `selection_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] selection_input - # @return [::Google::Apps::Card::V1::SelectionInput] - # {::Google::Apps::Card::V1::SelectionInput SelectionInput} widget. - # - # Note: The following fields are mutually exclusive: `selection_input`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `date_time_picker`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] date_time_picker - # @return [::Google::Apps::Card::V1::DateTimePicker] - # {::Google::Apps::Card::V1::DateTimePicker DateTimePicker} widget. - # - # Note: The following fields are mutually exclusive: `date_time_picker`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `chip_list`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] chip_list - # @return [::Google::Apps::Card::V1::ChipList] - # {::Google::Apps::Card::V1::ChipList ChipList} widget. - # - # Note: The following fields are mutually exclusive: `chip_list`, `text_paragraph`, `image`, `decorated_text`, `button_list`, `text_input`, `selection_input`, `date_time_picker`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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) - 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) - 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 - - # A carousel, also known as a slider, rotates and displays a list of widgets in - # a slideshow format, with buttons navigating to the previous or next widget. - # - # For example, this is a JSON representation of a carousel that contains three - # text paragraph widgets. - # - # ``` - # { - # "carouselCards": [ - # { - # "widgets": [ - # { - # "textParagraph": { - # "text": "First text paragraph in carousel", - # } - # } - # ] - # }, - # { - # "widgets": [ - # { - # "textParagraph": { - # "text": "Second text paragraph in carousel", - # } - # } - # ] - # }, - # { - # "widgets": [ - # { - # "textParagraph": { - # "text": "Third text paragraph in carousel", - # } - # } - # ] - # } - # ] - # } - # ``` - # - # [Google Chat apps](https://developers.google.com/workspace/chat): - # @!attribute [rw] carousel_cards - # @return [::Array<::Google::Apps::Card::V1::Carousel::CarouselCard>] - # A list of cards included in the carousel. - class Carousel - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A card that can be displayed as a carousel item. - # [Google Chat apps](https://developers.google.com/workspace/chat): - # @!attribute [rw] widgets - # @return [::Array<::Google::Apps::Card::V1::Card::NestedWidget>] - # A list of widgets displayed in the carousel card. The widgets are - # displayed in the order that they are specified. - # @!attribute [rw] footer_widgets - # @return [::Array<::Google::Apps::Card::V1::Card::NestedWidget>] - # A list of widgets displayed at the bottom of the carousel card. The - # widgets are displayed in the order that they are specified. - class CarouselCard - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Represent an expand and collapse control. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!attribute [rw] horizontal_alignment - # @return [::Google::Apps::Card::V1::Widget::HorizontalAlignment] - # The horizontal alignment of the expand and collapse button. - # @!attribute [rw] expand_button - # @return [::Google::Apps::Card::V1::Button] - # Optional. Define a customizable button to expand the section. - # Both expand_button and collapse_button field must be set. Only one - # field set will not take into effect. - # If this field isn't set, the default button is used. - # @!attribute [rw] collapse_button - # @return [::Google::Apps::Card::V1::Button] - # Optional. Define a customizable button to collapse the section. - # Both expand_button and collapse_button field must be set. Only one - # field set will not take into effect. - # If this field isn't set, the default button is used. - class CollapseControl - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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`. - # - # Note: The following fields are mutually exclusive: `action`, `open_link`, `open_dynamic_link_action`, `card`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] open_link - # @return [::Google::Apps::Card::V1::OpenLink] - # If specified, this `onClick` triggers an open link action. - # - # Note: The following fields are mutually exclusive: `open_link`, `action`, `open_dynamic_link_action`, `card`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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): - # - # Note: The following fields are mutually exclusive: `open_dynamic_link_action`, `action`, `open_link`, `card`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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): - # - # Note: The following fields are mutually exclusive: `card`, `action`, `open_link`, `open_dynamic_link_action`, `overflow_menu`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] overflow_menu - # @return [::Google::Apps::Card::V1::OverflowMenu] - # If specified, this `onClick` opens an overflow menu. - # - # Note: The following fields are mutually exclusive: `overflow_menu`, `action`, `open_link`, `open_dynamic_link_action`, `card`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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 otherwise 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): - # @!attribute [rw] required_widgets - # @return [::Array<::String>] - # Optional. Fill this list with the names of widgets that this Action - # needs for a valid submission. - # - # If the widgets listed here don't have a value when this Action is invoked, - # the form submission is aborted. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!attribute [rw] all_widgets_are_required - # @return [::Boolean] - # Optional. If this is true, then all widgets are considered required by - # this action. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - 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 - - # Represents the necessary data for validating the widget it's attached to. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!attribute [rw] character_limit - # @return [::Integer] - # Specify the character limit for text input widgets. Note that this is - # only used for text input and is ignored for other widgets. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!attribute [rw] input_type - # @return [::Google::Apps::Card::V1::Validation::InputType] - # Specify the type of the input widgets. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - class Validation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the input widget. - module InputType - # Unspecified type. Do not use. - INPUT_TYPE_UNSPECIFIED = 0 - - # Regular text that accepts all characters. - TEXT = 1 - - # An integer value. - INTEGER = 2 - - # A float value. - FLOAT = 3 - - # An email address. - EMAIL = 4 - - # A emoji selected from system-provided emoji picker. - EMOJI_PICKER = 5 - end - end - - # A list of chips layed out horizontally, which can either scroll horizontally - # or wrap to the next line. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!attribute [rw] layout - # @return [::Google::Apps::Card::V1::ChipList::Layout] - # Specified chip list layout. - # @!attribute [rw] chips - # @return [::Array<::Google::Apps::Card::V1::Chip>] - # An array of chips. - class ChipList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The chip list layout. - module Layout - # Don't use. Unspecified. - LAYOUT_UNSPECIFIED = 0 - - # Default value. The chip list wraps to the next line if there isn't enough - # horizontal space. - WRAPPED = 1 - - # The chips scroll horizontally if they don't fit in the available space. - HORIZONTAL_SCROLLABLE = 2 - end - end - - # A text, icon, or text and icon chip that users can click. - # - # [Google Workspace add-ons and Chat - # apps](https://developers.google.com/workspace/extend): - # @!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] label - # @return [::String] - # The text displayed inside the chip. - # @!attribute [rw] on_click - # @return [::Google::Apps::Card::V1::OnClick] - # Optional. The action to perform when a user clicks the chip, such as - # opening a hyperlink or running a custom function. - # @!attribute [rw] enabled - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Whether the chip is in an active state and responds to user actions. - # Defaults to `true`. - # Deprecated. Use `disabled` instead. - # @!attribute [rw] disabled - # @return [::Boolean] - # Whether the chip is in an inactive state and ignores user actions. - # Defaults to `false`. - # @!attribute [rw] alt_text - # @return [::String] - # The alternative text that's used for accessibility. - # - # Set descriptive text that lets users know what the chip does. For - # example, if a chip opens a hyperlink, write: "Opens a new - # browser tab and navigates to the Google Chat developer documentation at - # https://developers.google.com/workspace/chat". - class Chip - 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/action_status.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/action_status.rb deleted file mode 100644 index 73afb3c5bac3..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/action_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index d2decee6b393..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/annotation.rb +++ /dev/null @@ -1,326 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 can be associated with the plain-text body of the - # message or with chips that link to Google Workspace resources like Google - # Docs or Sheets with `start_index` and `length` of 0. 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. If not present, indicates a length of 0. - # @!attribute [rw] user_mention - # @return [::Google::Apps::Chat::V1::UserMentionMetadata] - # The metadata of user mention. - # - # Note: The following fields are mutually exclusive: `user_mention`, `slash_command`, `rich_link_metadata`, `custom_emoji_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] slash_command - # @return [::Google::Apps::Chat::V1::SlashCommandMetadata] - # The metadata for a slash command. - # - # Note: The following fields are mutually exclusive: `slash_command`, `user_mention`, `rich_link_metadata`, `custom_emoji_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] rich_link_metadata - # @return [::Google::Apps::Chat::V1::RichLinkMetadata] - # The metadata for a rich link. - # - # Note: The following fields are mutually exclusive: `rich_link_metadata`, `user_mention`, `slash_command`, `custom_emoji_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] custom_emoji_metadata - # @return [::Google::Apps::Chat::V1::CustomEmojiMetadata] - # The metadata for a custom emoji. - # - # Note: The following fields are mutually exclusive: `custom_emoji_metadata`, `user_mention`, `slash_command`, `rich_link_metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. Rich links can be associated with the plain-text - # body of the message or represent chips that link to Google Workspace - # resources like Google Docs or Sheets with `start_index` and `length` - # of 0. - # @!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. - # - # Note: The following fields are mutually exclusive: `drive_link_data`, `chat_space_link_data`, `meet_space_link_data`, `calendar_event_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] chat_space_link_data - # @return [::Google::Apps::Chat::V1::ChatSpaceLinkData] - # Data for a chat space link. - # - # Note: The following fields are mutually exclusive: `chat_space_link_data`, `drive_link_data`, `meet_space_link_data`, `calendar_event_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] meet_space_link_data - # @return [::Google::Apps::Chat::V1::MeetSpaceLinkData] - # Data for a Meet space link. - # - # Note: The following fields are mutually exclusive: `meet_space_link_data`, `drive_link_data`, `chat_space_link_data`, `calendar_event_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] calendar_event_link_data - # @return [::Google::Apps::Chat::V1::CalendarEventLinkData] - # Data for a Calendar event link. - # - # Note: The following fields are mutually exclusive: `calendar_event_link_data`, `drive_link_data`, `chat_space_link_data`, `meet_space_link_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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 - - # A Gmail message rich link type. Specifically, a Gmail chip from [Share to - # Chat](https://support.google.com/chat?p=chat_gmail). The API only - # supports reading messages with GMAIL_MESSAGE rich links. - GMAIL_MESSAGE = 3 - - # A Meet message rich link type. For example, a Meet chip. - MEET_SPACE = 4 - - # A Calendar message rich link type. For example, a Calendar chip. - CALENDAR_EVENT = 5 - end - end - - # Annotation metadata for custom emoji. - # @!attribute [rw] custom_emoji - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # The custom emoji. - class CustomEmojiMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - 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 - - # Data for Meet space links. - # @!attribute [rw] meeting_code - # @return [::String] - # Meeting code of the linked Meet space. - # @!attribute [rw] type - # @return [::Google::Apps::Chat::V1::MeetSpaceLinkData::Type] - # Indicates the type of the Meet space. - # @!attribute [r] huddle_status - # @return [::Google::Apps::Chat::V1::MeetSpaceLinkData::HuddleStatus] - # Optional. Output only. If the Meet is a Huddle, indicates the status of the - # huddle. Otherwise, this is unset. - class MeetSpaceLinkData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the Meet space. - module Type - # Default value for the enum. Don't use. - TYPE_UNSPECIFIED = 0 - - # The Meet space is a meeting. - MEETING = 1 - - # The Meet space is a huddle. - HUDDLE = 2 - end - - # The status of the huddle - module HuddleStatus - # Default value for the enum. Don't use. - HUDDLE_STATUS_UNSPECIFIED = 0 - - # The huddle has started. - STARTED = 1 - - # The huddle has ended. In this case the Meet space URI and identifiers - # will no longer be valid. - ENDED = 2 - - # The huddle has been missed. In this case the Meet space URI and - # identifiers will no longer be valid. - MISSED = 3 - end - end - - # Data for Calendar event links. - # @!attribute [rw] calendar_id - # @return [::String] - # The [Calendar - # identifier](https://developers.google.com/workspace/calendar/api/v3/reference/calendars) - # of the linked Calendar. - # @!attribute [rw] event_id - # @return [::String] - # The [Event - # identifier](https://developers.google.com/workspace/calendar/api/v3/reference/events) - # of the linked Calendar event. - class CalendarEventLinkData - 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 - - # A custom emoji annotation. - CUSTOM_EMOJI = 4 - 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 deleted file mode 100644 index 267cc982cbf7..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/attachment.rb +++ /dev/null @@ -1,137 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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] - # Identifier. Resource name of the attachment. - # - # Format: `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] - # Optional. A reference to the attachment data. This field is used to - # create or update messages with attachments, or with the media API to - # download the attachment data. - # - # Note: The following fields are mutually exclusive: `attachment_data_ref`, `drive_data_ref`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. - # - # Note: The following fields are mutually exclusive: `drive_data_ref`, `attachment_data_ref`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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] - # Optional. 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] - # Optional. 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 deleted file mode 100644 index e232c4df441e..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/contextual_addon.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index c8d0e9847622..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/deletion_metadata.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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. More values may be added in - # the future. See [Edit or delete a message in Google - # Chat](https://support.google.com/chat/answer/7653281) for details on when - # messages can be deleted. - module DeletionType - # This value is unused. - DELETION_TYPE_UNSPECIFIED = 0 - - # User deleted their own message. - CREATOR = 1 - - # An owner or manager deleted the message. - SPACE_OWNER = 2 - - # A Google Workspace administrator deleted the message. Administrators can - # delete any message in the space, including messages sent by any space - # member or Chat app. - 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 creator (using user - # authentication). - CREATOR_VIA_APP = 5 - - # A Chat app deleted the message on behalf of a space manager (using user - # authentication). - SPACE_OWNER_VIA_APP = 6 - - # A member of the space deleted the message. Users can delete messages sent - # by apps. - SPACE_MEMBER = 7 - 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 deleted file mode 100644 index 887b054a011b..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/event_payload.rb +++ /dev/null @@ -1,225 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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`, 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 deleted file mode 100644 index 331f3a1590be..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/group.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 22153abf2dd9..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/history_state.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 5d7a0eb4ab8c..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/matched_url.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index f9b3e38b718f..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb +++ /dev/null @@ -1,444 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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] - # Identifier. 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] - # Optional. 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`. - # - # Note: The following fields are mutually exclusive: `member`, `group_member`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] group_member - # @return [::Google::Apps::Chat::V1::Group] - # Optional. The Google Group the membership corresponds to. - # - # Reading or mutating memberships for Google Groups requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - # - # Note: The following fields are mutually exclusive: `group_member`, `member`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. In the Chat UI, this role is called Member. - # - # The user has basic permissions, like sending - # messages to the space. - # Managers and owners can grant members additional permissions in a space, - # including: - # - # - Add or remove members. - # - Modify space details. - # - Turn history on or off. - # - Mention everyone in the space with `@all`. - # - Manage Chat apps and webhooks installed in the space. - # - # In direct messages and unnamed group conversations, everyone - # has this role. - ROLE_MEMBER = 1 - - # A space owner. In the Chat UI, this role is called Owner. - # - # The user has the complete set of space permissions to manage the space, - # including: - # - # - Change the role of other members in the space to member, manager, or - # owner. - # - Delete the space. - # - # Only supported in - # {::Google::Apps::Chat::V1::Space::SpaceType SpaceType.SPACE} (named spaces). - # - # To learn more, see - # [Learn more about your role as a space - # owner or manager](https://support.google.com/chat/answer/11833441). - ROLE_MANAGER = 2 - - # A space manager. In the Chat UI, this role is called Manager. - # - # The user has all basic permissions of `ROLE_MEMBER`, - # and can be granted a subset of administrative permissions by an owner. - # By default, managers have all the permissions of an owner except for the - # ability to: - # - # - Delete the space. - # - Make another space member an owner. - # - Change an owner's role. - # - # By default, managers permissions include but aren't limited to: - # - # - Make another member a manager. - # - Delete messages in the space. - # - Manage space permissions. - # - Receive notifications for requests to join the space if the manager - # has the "manage members" permission in the space settings. - # - Make a space discoverable. - # - # Only supported in - # {::Google::Apps::Chat::V1::Space::SpaceType SpaceType.SPACE} (named spaces). - # - # To learn more, see - # [Manage space settings](https://support.google.com/chat/answer/13340792). - ROLE_ASSISTANT_MANAGER = 4 - 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 - # certain authorization scopes and set specific values for certain fields: - # - # - When [authenticating as a - # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - # the `chat.memberships` authorization scope is required. - # - # - When [authenticating as an - # app](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), - # the `chat.app.memberships` authorization scope is required. - # - # - 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`. - # - # Inviting users external to the Workspace organization that owns the space - # requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - # - # When a Chat app creates a membership relation for itself, it must - # [authenticate as a - # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # and 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] - # Optional. 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] - # Optional. 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] - # Optional. 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` - # - # 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] - # Optional. 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 - # with [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # or the `chat.memberships.app` scope with [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # and the `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] - # Optional. 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 deleted file mode 100644 index 7106929cb03b..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/message.rb +++ /dev/null @@ -1,763 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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] - # Identifier. 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] - # Optional. 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. - # - # * Bullet list items using asterisks (`*`)—for example, `* item`. - # - # 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>] - # Optional. 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 can be associated with the plain-text body of the - # message or with chips that link to Google Workspace resources like Google - # Docs or Sheets with `start_index` and `length` of 0. - # @!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 [r] space - # @return [::Google::Apps::Chat::V1::Space] - # Output only. If your Chat app [authenticates as a - # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), - # the output only populates the - # [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) - # `name`. - # @!attribute [rw] fallback_text - # @return [::String] - # Optional. 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>] - # Optional. 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] - # Optional. 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) - # - # 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 [rw] quoted_message_metadata - # @return [::Google::Apps::Chat::V1::QuotedMessageMetadata] - # Optional. Information about a message that another message quotes. - # - # When you create a message, you can quote messages within the same - # thread, or quote a root message to create a new root message. - # However, you can't quote a message reply from a different thread. - # - # When you update a message, you can't add or replace the - # `quotedMessageMetadata` field, but you can remove it. - # - # For example usage, see [Quote another - # message](https://developers.google.com/workspace/chat/create-messages#quote-a-message). - # @!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>] - # Optional. 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 message that another message quotes. - # - # When you create a message, you can quote messages within the same - # thread, or quote a root message to create a new root message. - # However, you can't quote a message reply from a different thread. - # - # When you update a message, you can't add or replace the - # `quotedMessageMetadata` field, but you can remove it. - # - # For example usage, see [Quote another - # message](https://developers.google.com/workspace/chat/create-messages#quote-a-message). - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the message that is quoted. - # - # Format: `spaces/{space}/messages/{message}` - # @!attribute [rw] last_update_time - # @return [::Google::Protobuf::Timestamp] - # Required. The timestamp when the quoted message was created or when the - # quoted message was last updated. - # - # If the message was edited, use this field, `last_update_time`. - # If the message was never edited, use `create_time`. - # - # If `last_update_time` doesn't match the latest version of the quoted - # message, the request fails. - # @!attribute [rw] quote_type - # @return [::Google::Apps::Chat::V1::QuotedMessageMetadata::QuoteType] - # Optional. Specifies the quote type. If not set, defaults to REPLY in the - # message read/write path for backward compatibility. - # @!attribute [r] quoted_message_snapshot - # @return [::Google::Apps::Chat::V1::QuotedMessageSnapshot] - # Output only. A snapshot of the quoted message's content. - # @!attribute [r] forwarded_metadata - # @return [::Google::Apps::Chat::V1::ForwardedMetadata] - # Output only. Metadata about the source space of the quoted message. - # Populated only for FORWARD quote type. - class QuotedMessageMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The quote type of the quoted message. - module QuoteType - # Reserved. This value is unused. - QUOTE_TYPE_UNSPECIFIED = 0 - - # If quote_type is `REPLY`, you can do the following: - # - # * If you're replying in a thread, you can quote another message in that - # thread. - # - # * If you're creating a root message, you can quote another root message - # in that space. - # - # You can't quote a message reply from a different thread. - REPLY = 1 - end - end - - # Provides a snapshot of the content of the quoted message at the time of - # quoting or forwarding - # @!attribute [r] sender - # @return [::String] - # Output only. The quoted message's author name. - # Populated for both REPLY & FORWARD quote types. - # @!attribute [r] text - # @return [::String] - # Output only. Snapshot of the quoted message's text content. - # @!attribute [r] formatted_text - # @return [::String] - # Output only. Contains the quoted message `text` with markups added to - # support rich formatting like hyperlinks,custom emojis, markup, etc. - # Populated only for FORWARD quote type. - # @!attribute [r] annotations - # @return [::Array<::Google::Apps::Chat::V1::Annotation>] - # Output only. Annotations parsed from the text body of the quoted message. - # Populated only for FORWARD quote type. - # @!attribute [r] attachments - # @return [::Array<::Google::Apps::Chat::V1::Attachment>] - # Output only. Attachments that were part of the quoted message. These are - # copies of the quoted message's attachment metadata. Populated only for - # FORWARD quote type. - class QuotedMessageSnapshot - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata about the source space from which a message was forwarded. - # @!attribute [r] space - # @return [::String] - # Output only. The resource name of the source space. - # Format: spaces/\\{space} - # @!attribute [r] space_display_name - # @return [::String] - # Output only. The display name of the source space or DM at the time of - # forwarding. For `SPACE`, this is the space name. For `DIRECT_MESSAGE`, this - # is the other participant's name (e.g., "User A"). For `GROUP_CHAT`, this is - # a generated name based on members' first names, limited to 5 including the - # creator (e.g., "User A, User B"). - class ForwardedMetadata - 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] - # Identifier. 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 - - # For `selectionInput` widgets, returns autocomplete suggestions for a - # multiselect menu. - # @!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] - # Optional. 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).) - # - # - `quoted_message_metadata` (Only allows removal of the quoted message.) - # @!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. - # - # When [responding to user - # interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), - # this field is ignored. For interactions within a thread, the reply is - # created in the same thread. Otherwise, the reply is created as a new - # thread. - # @!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] - # Optional. 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. 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] - # Optional. 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. 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] - # Optional. 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 deleted file mode 100644 index df34012e3f49..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/reaction.rb +++ /dev/null @@ -1,322 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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] - # Identifier. 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] - # Required. 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] - # Optional. A basic emoji represented by a unicode string. - # - # Note: The following fields are mutually exclusive: `unicode`, `custom_emoji`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] custom_emoji - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # A custom emoji. - # - # Note: The following fields are mutually exclusive: `custom_emoji`, `unicode`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Emoji - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a [custom emoji](https://support.google.com/chat/answer/12800149). - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the custom emoji, assigned by the server. - # - # Format: `customEmojis/{customEmoji}` - # @!attribute [r] uid - # @return [::String] - # Output only. Unique key for the custom emoji resource. - # @!attribute [rw] emoji_name - # @return [::String] - # Optional. Immutable. User-provided name for the custom emoji, which is - # unique within the organization. - # - # Required when the custom emoji is created, output only otherwise. - # - # Emoji names must start and end with colons, must be lowercase and can only - # contain alphanumeric characters, hyphens, and underscores. - # Hyphens and underscores should be used to separate words and cannot be used - # consecutively. - # - # Example: `:valid-emoji-name:` - # @!attribute [r] temporary_image_uri - # @return [::String] - # Output only. A temporary image URL for the custom emoji, valid for at least - # 10 minutes. Note that this is not populated in the response when the custom - # emoji is created. - # @!attribute [rw] payload - # @return [::Google::Apps::Chat::V1::CustomEmoji::CustomEmojiPayload] - # Optional. Input only. Payload data. - # Required when the custom emoji is created. - class CustomEmoji - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Payload data for the custom emoji. - # @!attribute [rw] file_content - # @return [::String] - # Required. Input only. The image used for the custom emoji. - # - # The payload must be under 256 KB and the dimension of - # the image must be square and between 64 and 500 pixels. The - # restrictions are subject to change. - # @!attribute [rw] filename - # @return [::String] - # Required. Input only. The image file name. - # - # Supported file extensions: `.png`, `.jpg`, `.gif`. - class CustomEmojiPayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The number of people who reacted to a message with a specific emoji. - # @!attribute [r] emoji - # @return [::Google::Apps::Chat::V1::Emoji] - # Output only. Emoji associated with the reactions. - # @!attribute [r] reaction_count - # @return [::Integer] - # Output only. 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 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 - - # A request to create a custom emoji. - # @!attribute [rw] custom_emoji - # @return [::Google::Apps::Chat::V1::CustomEmoji] - # Required. The custom emoji to create. - class CreateCustomEmojiRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to return a single custom emoji. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the custom emoji. - # - # Format: `customEmojis/{customEmoji}` - # - # You can use the emoji name as an alias for `{customEmoji}`. For example, - # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name - # for a custom emoji. - class GetCustomEmojiRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to return a list of custom emojis. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of custom emojis returned. The service can - # return fewer custom emojis than this value. If unspecified, the default - # value is 25. The maximum value is 200; values above 200 are changed to 200. - # @!attribute [rw] page_token - # @return [::String] - # Optional. (If resuming from a previous query.) - # - # A page token received from a previous list custom emoji call. Provide this - # to retrieve the subsequent page. - # - # When paginating, the filter value should match the call that provided the - # page token. Passing a different value might lead to unexpected results. - # @!attribute [rw] filter - # @return [::String] - # Optional. A query filter. - # - # Supports filtering by creator. - # - # To filter by creator, you must specify a valid value. Currently only - # `creator("users/me")` and `NOT creator("users/me")` are accepted to filter - # custom emojis by whether they were created by the calling user or not. - # - # For example, the following query returns custom emojis created by the - # caller: - # ``` - # creator("users/me") - # ``` - # - # Invalid queries are rejected with an `INVALID_ARGUMENT` error. - class ListCustomEmojisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A response to list custom emojis. - # @!attribute [rw] custom_emojis - # @return [::Array<::Google::Apps::Chat::V1::CustomEmoji>] - # Unordered list. List of custom emojis. - # @!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 ListCustomEmojisResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for deleting a custom emoji. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the custom emoji to delete. - # - # Format: `customEmojis/{customEmoji}` - # - # You can use the emoji name as an alias for `{customEmoji}`. For example, - # `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name - # for a custom emoji. - class DeleteCustomEmojiRequest - 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/section.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/section.rb deleted file mode 100644 index 856bb8a1b7f5..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/section.rb +++ /dev/null @@ -1,332 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 [section](https://support.google.com/chat/answer/16059854) in - # Google Chat. Sections help users organize their spaces. There are two types - # of sections: - # - # 1. **System Sections:** These are predefined sections managed by Google - # Chat. - # Their resource names are fixed, and they cannot be created, deleted, or - # have their `display_name` modified. Examples include: - # * `users/{user}/sections/default-direct-messages` - # * `users/{user}/sections/default-spaces` - # * `users/{user}/sections/default-apps` - # - # 2. **Custom Sections:** These are sections created and managed by the user. - # Creating a custom section using `CreateSection` **requires** a - # `display_name`. Custom sections can be updated using `UpdateSection` and - # deleted using `DeleteSection`. - # @!attribute [rw] name - # @return [::String] - # Identifier. Resource name of the section. - # - # For system sections, the section ID is a constant string: - # - # - DEFAULT_DIRECT_MESSAGES: `users/{user}/sections/default-direct-messages` - # - DEFAULT_SPACES: `users/{user}/sections/default-spaces` - # - DEFAULT_APPS: `users/{user}/sections/default-apps` - # - # Format: `users/{user}/sections/{section}` - # @!attribute [rw] display_name - # @return [::String] - # Optional. The section's display name. Only populated for sections of type - # `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a - # `CUSTOM_SECTION`. - # @!attribute [rw] sort_order - # @return [::Integer] - # Output only. The order of the section in relation to other sections. - # Sections with a lower `sort_order` value appear before sections with a - # higher value. - # @!attribute [rw] type - # @return [::Google::Apps::Chat::V1::Section::SectionType] - # Required. The type of the section. - class Section - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Section types. - module SectionType - # Unspecified section type. - SECTION_TYPE_UNSPECIFIED = 0 - - # Custom section. - CUSTOM_SECTION = 1 - - # Default section containing - # [DIRECT_MESSAGE](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype) - # between two human users or - # [GROUP_CHAT](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype) - # spaces that don't belong to any custom section. - DEFAULT_DIRECT_MESSAGES = 2 - - # Default spaces that don't belong to any custom section. - DEFAULT_SPACES = 3 - - # Default section containing a user's installed apps. - DEFAULT_APPS = 6 - end - end - - # A user's defined section item. This is used to represent section items, such - # as spaces, grouped under a section. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the section item. - # - # Format: `users/{user}/sections/{section}/items/{item}` - # @!attribute [rw] space - # @return [::String] - # Optional. The space resource name. - # - # Format: `spaces/{space}` - class SectionItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating a section. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name where the section is created. - # - # Format: `users/{user}` - # @!attribute [rw] section - # @return [::Google::Apps::Chat::V1::Section] - # Required. The section to create. - class CreateSectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting a section. - # [Developer Preview](https://developers.google.com/workspace/preview). - # @!attribute [rw] name - # @return [::String] - # Required. The name of the section to delete. - # - # Format: `users/{user}/sections/{section}` - class DeleteSectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating a section. - # @!attribute [rw] section - # @return [::Google::Apps::Chat::V1::Section] - # Required. The section to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The mask to specify which fields to update. - # - # Currently supported field paths: - # - # - `display_name` - class UpdateSectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing sections. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which is the user resource name that owns this - # collection of sections. Only supports listing sections for the calling - # user. To refer to the calling user, set one of the following: - # - # - The `me` alias. For example, `users/me`. - # - # - Their Workspace email address. For example, `users/user@example.com`. - # - # - Their user id. For example, `users/123456789`. - # - # Format: `users/{user}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of sections to return. The service may return - # fewer than this value. - # - # If unspecified, at most 10 sections will be returned. - # - # The maximum value is 100. If you use a value more than 100, it's - # automatically changed to 100. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous list sections call. - # Provide this 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. - class ListSectionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing sections. - # @!attribute [rw] sections - # @return [::Array<::Google::Apps::Chat::V1::Section>] - # The sections from the specified user. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListSectionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for positioning a section. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the section to position. - # - # Format: `users/{user}/sections/{section}` - # @!attribute [rw] sort_order - # @return [::Integer] - # Optional. The absolute position of the section in the list of sections. - # The position must be greater than 0. If the position is greater than the - # number of sections, the section will be appended to the end of the list. - # This operation inserts the section at the given position and shifts the - # original section at that position, and those below it, to the next - # position. - # - # Note: The following fields are mutually exclusive: `sort_order`, `relative_position`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] relative_position - # @return [::Google::Apps::Chat::V1::PositionSectionRequest::Position] - # Optional. The relative position of the section in the list of sections. - # - # Note: The following fields are mutually exclusive: `relative_position`, `sort_order`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class PositionSectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The position of the section. - module Position - # Unspecified position. - POSITION_UNSPECIFIED = 0 - - # Start of the list of sections. - START = 1 - - # End of the list of sections. - Position::END = 2 - end - end - - # Response message for positioning a section. - # @!attribute [rw] section - # @return [::Google::Apps::Chat::V1::Section] - # The updated section. - class PositionSectionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing section items. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which is the section resource name that owns this - # collection of section items. Only supports listing section items for the - # calling user. - # - # When you're filtering by space, use the wildcard `-` to search across all - # sections. For example, `users/{user}/sections/-`. - # - # Format: `users/{user}/sections/{section}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of section items to return. The service may - # return fewer than this value. - # - # If unspecified, at most 10 section items will be returned. - # - # The maximum value is 100. If you use a value more than 100, it's - # automatically changed to 100. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous list section items call. - # Provide this 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. - # - # Currently only supports filtering by space. - # - # For example, `space = spaces/{space}`. - # - # Invalid queries are rejected with an `INVALID_ARGUMENT` error. - class ListSectionItemsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing section items. - # @!attribute [rw] section_items - # @return [::Array<::Google::Apps::Chat::V1::SectionItem>] - # The section items from the specified section. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. If - # this field is omitted, there are no subsequent pages. - class ListSectionItemsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for moving a section item across sections. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the section item to move. - # - # Format: `users/{user}/sections/{section}/items/{item}` - # @!attribute [rw] target_section - # @return [::String] - # Required. The resource name of the section to move the section item to. - # - # Format: `users/{user}/sections/{section}` - class MoveSectionItemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for moving a section item. - # @!attribute [rw] section_item - # @return [::Google::Apps::Chat::V1::SectionItem] - # The updated section item. - class MoveSectionItemResponse - 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 deleted file mode 100644 index 842d5f0743fb..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/slash_command.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 - # Metadata about a [slash - # command](https://developers.google.com/workspace/chat/commands) in - # Google Chat. - # @!attribute [rw] command_id - # @return [::Integer] - # The ID of the slash command. - 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 deleted file mode 100644 index 3ced5251cd86..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space.rb +++ /dev/null @@ -1,912 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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] - # Identifier. 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] - # Optional. 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] - # Optional. 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] - # Optional. 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] - # Optional. Details about the space including description and rules. - # @!attribute [rw] space_history_state - # @return [::Google::Apps::Chat::V1::HistoryState] - # Optional. 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. - # - # Creating a space in `Import Mode`requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - # @!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 [rw] customer - # @return [::String] - # Optional. Immutable. The customer id of the domain of the space. - # Required only when creating a space with [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # and `SpaceType` is `SPACE`, otherwise should not be set. - # - # In the format `customers/{customer}`, where `customer` is the `id` from the - # [Admin SDK customer - # resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). - # Private apps can also use the `customers/my_customer` alias to create - # the space in the same Google Workspace organization as the app. - # - # This field isn't populated for direct messages (DMs) or when the space is - # created by non-Google Workspace users. - # @!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. - # - # Setting predefined permission settings supports: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) with the - # `chat.app.spaces` or `chat.app.spaces.create` scopes. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # - # Note: The following fields are mutually exclusive: `predefined_permission_settings`, `permission_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. - # - # Reading and updating permission settings supports: - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) with the - # `chat.app.spaces` scope. Only populated and settable when the Chat app - # created the space. - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # - # Note: The following fields are mutually exclusive: `permission_settings`, `predefined_permission_settings`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] import_mode_expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the space will be automatically deleted by the - # system if it remains in import mode. - # - # Each space created in import mode must exit this mode before this expire - # time using `spaces.completeImport`. - # - # This field is only populated for spaces that were created with import mode. - 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 [r] joined_direct_human_user_count - # @return [::Integer] - # Output only. Count of human users that have directly joined the space, - # not counting users joined by having membership in a joined group. - # @!attribute [r] joined_group_count - # @return [::Integer] - # Output only. 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`. - # - # Reading the target audience supports: - # - # - [User - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - # - # - [App - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) - # with [administrator - # approval](https://support.google.com/a?p=chat-app-auth) - # with the `chat.app.spaces` scope. - # - # This field is not populated when using the `chat.bot` scope with [app - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). - # - # Setting the target audience requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - 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). - # - # Creating discoverable spaces requires [user - # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). - 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] - # Optional. Setting for managing members and groups in a space. - # @!attribute [rw] modify_space_details - # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] - # Optional. Setting for updating space name, avatar, description and - # guidelines. - # @!attribute [rw] toggle_history - # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] - # Optional. Setting for toggling space history on and off. - # @!attribute [rw] use_at_mention_all - # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] - # Optional. Setting for using @all in a space. - # @!attribute [rw] manage_apps - # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] - # Optional. Setting for managing apps in a space. - # @!attribute [rw] manage_webhooks - # @return [::Google::Apps::Chat::V1::Space::PermissionSetting] - # Optional. 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] - # Optional. 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] - # Optional. Whether space owners - # ({::Google::Apps::Chat::V1::Membership::MembershipRole::ROLE_MANAGER `ROLE_MANAGER`}) - # have this permission. - # @!attribute [rw] assistant_managers_allowed - # @return [::Boolean] - # Optional. Whether space managers - # {::Google::Apps::Chat::V1::Membership::MembershipRole::ROLE_ASSISTANT_MANAGER `ROLE_ASSISTANT_MANAGER`}) - # have this permission. - # @!attribute [rw] members_allowed - # @return [::Boolean] - # Optional. Whether basic space members - # ({::Google::Apps::Chat::V1::Membership::MembershipRole::ROLE_MEMBER `ROLE_MEMBER`}) - # 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` and `SpaceType.GROUP_CHAT` are supported. - # `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true. - # - # 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. - # - # - # 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] - # Optional. 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 get group chat spaces based on user resources. - # @!attribute [rw] users - # @return [::Array<::String>] - # Optional. Resource names of all human users in group chat with the calling - # user. Chat apps can't be included in the request. - # - # The maximum number of users that can be specified in a single request is - # `49`. - # - # 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, to find all group chats with the calling - # user and two other users, with People API profile IDs `123456789` and - # `987654321`, you can use `users/123456789` and `users/987654321`. - # You can also 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. - # @!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 10 spaces are returned. - # - # The maximum value is 30. If you use a value more than 30, it's - # automatically changed to 30. - # - # Negative values return an `INVALID_ARGUMENT` error. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous call to find group chats. - # Provide this parameter to retrieve the subsequent page. - # - # When paginating, all other parameters provided should match the call that - # provided the token. Passing different values may lead to unexpected - # results. - # @!attribute [rw] space_view - # @return [::Google::Apps::Chat::V1::SpaceView] - # Requested space view type. If unset, defaults to - # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify - # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data, - # for example, - # https://www.googleapis.com/auth/chat.spaces or - # https://www.googleapis.com/auth/chat.spaces.readonly. - class FindGroupChatsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A response containing group chat spaces with exactly the calling user and the - # requested users. - # @!attribute [rw] spaces - # @return [::Array<::Google::Apps::Chat::V1::Space>] - # List of spaces 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 FindGroupChatsResponse - 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 and guidelines. You must - # pass both description and guidelines in the update request as - # {::Google::Apps::Chat::V1::Space::SpaceDetails `SpaceDetails`}. If you only want to - # update one of the fields, pass the existing value for the other field. - # - # `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. - # 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] - # Optional. 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] - # Optional. 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 - - # A view that specifies which fields should be populated on the - # [`Space`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) - # resource. - # To ensure compatibility with future releases, we recommend that your code - # account for additional values. - module SpaceView - # The default / unset value. - SPACE_VIEW_UNSPECIFIED = 0 - - # Populates only the Space resource name. - SPACE_VIEW_RESOURCE_NAME_ONLY = 3 - - # Populates Space resource fields. Note: the `permissionSettings` field - # will not be populated. - # Requests that specify SPACE_VIEW_EXPANDED must include scopes that allow - # reading space data, for example, - # https://www.googleapis.com/auth/chat.spaces or - # https://www.googleapis.com/auth/chat.spaces.readonly. - SPACE_VIEW_EXPANDED = 4 - 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 deleted file mode 100644 index ce5ce1520a57..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_event.rb +++ /dev/null @@ -1,323 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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` - # - # Note: The following fields are mutually exclusive: `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `message_updated_event_data`, `message_created_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `message_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `message_batch_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `message_batch_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `message_batch_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `space_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `space_batch_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `membership_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `membership_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `membership_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `membership_batch_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `membership_batch_updated_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `membership_batch_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `reaction_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `reaction_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_batch_created_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `reaction_batch_created_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_deleted_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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` - # - # Note: The following fields are mutually exclusive: `reaction_batch_deleted_event_data`, `message_created_event_data`, `message_updated_event_data`, `message_deleted_event_data`, `message_batch_created_event_data`, `message_batch_updated_event_data`, `message_batch_deleted_event_data`, `space_updated_event_data`, `space_batch_updated_event_data`, `membership_created_event_data`, `membership_updated_event_data`, `membership_deleted_event_data`, `membership_batch_created_event_data`, `membership_batch_updated_event_data`, `membership_batch_deleted_event_data`, `reaction_created_event_data`, `reaction_deleted_event_data`, `reaction_batch_created_event_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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] - # Optional. 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_notification_setting.rb b/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_notification_setting.rb deleted file mode 100644 index c5fb842c9a5f..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_notification_setting.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 notification setting of a user in a space. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the space notification setting. - # Format: `users/{user}/spaces/{space}/spaceNotificationSetting`. - # @!attribute [rw] notification_setting - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting::NotificationSetting] - # The notification setting. - # @!attribute [rw] mute_setting - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting::MuteSetting] - # The space notification mute setting. - class SpaceNotificationSetting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The notification setting types. Other types might be supported in the - # future. - module NotificationSetting - # Reserved. - NOTIFICATION_SETTING_UNSPECIFIED = 0 - - # Notifications are triggered by @mentions, followed threads, first - # message of new threads. All new threads are automatically followed, - # unless manually unfollowed by the user. - ALL = 1 - - # The notification is triggered by @mentions, followed threads, first - # message of new threads. Not available for 1:1 direct messages. - MAIN_CONVERSATIONS = 2 - - # The notification is triggered by @mentions, followed threads. Not - # available for 1:1 direct messages. - FOR_YOU = 3 - - # Notification is off. - OFF = 4 - end - - # The space notification mute setting types. - module MuteSetting - # Reserved. - MUTE_SETTING_UNSPECIFIED = 0 - - # The user will receive notifications for the space based on the - # notification setting. - UNMUTED = 1 - - # The user will not receive any notifications for the space, regardless of - # the notification setting. - MUTED = 2 - end - end - - # Request message to get space notification setting. - # Only supports getting notification setting for the calling user. - # @!attribute [rw] name - # @return [::String] - # Required. Format: users/\\{user}/spaces/\\{space}/spaceNotificationSetting - # - # - `users/me/spaces/{space}/spaceNotificationSetting`, OR - # - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR - # - `users/123456789/spaces/{space}/spaceNotificationSetting`. - # Note: Only the caller's user id or email is allowed in the path. - class GetSpaceNotificationSettingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to update the space notification settings. - # Only supports updating notification setting for the calling user. - # @!attribute [rw] space_notification_setting - # @return [::Google::Apps::Chat::V1::SpaceNotificationSetting] - # Required. The resource name for the space notification settings must be - # populated in the form of - # `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields - # specified by `update_mask` are updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Supported field paths: - # - # - `notification_setting` - # - # - `mute_setting` - class UpdateSpaceNotificationSettingRequest - 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 deleted file mode 100644 index 8626d571e426..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_read_state.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 9d5764f9eb10..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/space_setup.rb +++ /dev/null @@ -1,96 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 49 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 deleted file mode 100644 index 3fd4f5308d27..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/thread_read_state.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 738e2b830dd7..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/user.rb +++ /dev/null @@ -1,84 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index a060315291e2..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/chat/v1/widgets.rb +++ /dev/null @@ -1,315 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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. - # - # Note: The following fields are mutually exclusive: `text_paragraph`, `image`, `key_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image - # @return [::Google::Apps::Chat::V1::WidgetMarkup::Image] - # Display an image in this widget. - # - # Note: The following fields are mutually exclusive: `image`, `text_paragraph`, `key_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] key_value - # @return [::Google::Apps::Chat::V1::WidgetMarkup::KeyValue] - # Display a key value item in this widget. - # - # Note: The following fields are mutually exclusive: `key_value`, `text_paragraph`, `image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. - # - # Note: The following fields are mutually exclusive: `text_button`, `image_button`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_button - # @return [::Google::Apps::Chat::V1::WidgetMarkup::ImageButton] - # A button with image and `onclick` action. - # - # Note: The following fields are mutually exclusive: `image_button`, `text_button`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # - # Note: The following fields are mutually exclusive: `icon`, `icon_url`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] icon_url - # @return [::String] - # The icon specified by a URL. - # - # Note: The following fields are mutually exclusive: `icon_url`, `icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. - # - # Note: The following fields are mutually exclusive: `icon`, `icon_url`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] icon_url - # @return [::String] - # The icon specified by a URL. - # - # Note: The following fields are mutually exclusive: `icon_url`, `icon`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!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. - # - # Note: The following fields are mutually exclusive: `action`, `open_link`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] open_link - # @return [::Google::Apps::Chat::V1::WidgetMarkup::OpenLink] - # This `onclick` action triggers an open link action if specified. - # - # Note: The following fields are mutually exclusive: `open_link`, `action`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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 deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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 deleted file mode 100644 index 8cf36e815510..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/rpc/code.rb +++ /dev/null @@ -1,185 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 5728bc06bc83..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/proto_docs/google/type/color.rb +++ /dev/null @@ -1,173 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 and from color representations in various - # languages over compactness. For example, the fields of this representation - # can be trivially provided to the constructor of `java.awt.Color` in Java; it - # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` - # method in iOS; and, with just a little work, it can be easily formatted into - # a CSS `rgba()` string in JavaScript. - # - # This reference page doesn't have information about the absolute color - # space that should be used to interpret the RGB value—for example, sRGB, - # Adobe RGB, - # DCI-P3, and BT.2020. By default, applications should assume the sRGB color - # space. - # - # When color equality needs to be decided, implementations, unless documented - # otherwise, treat two colors as equal if all their red, green, blue, and alpha - # values each differ by at most `1e-5`. - # - # Example (Java): - # - # import com.google.type.Color; - # - # // ... - # public static java.awt.Color fromProto(Color protocolor) { - # float alpha = protocolor.hasAlpha() - # ? protocolor.getAlpha().getValue() - # : 1.0; - # - # return new java.awt.Color( - # protocolor.getRed(), - # protocolor.getGreen(), - # protocolor.getBlue(), - # alpha); - # } - # - # public static Color toProto(java.awt.Color color) { - # float red = (float) color.getRed(); - # float green = (float) color.getGreen(); - # float blue = (float) color.getBlue(); - # float denominator = 255.0; - # Color.Builder resultBuilder = - # Color - # .newBuilder() - # .setRed(red / denominator) - # .setGreen(green / denominator) - # .setBlue(blue / denominator); - # int alpha = color.getAlpha(); - # if (alpha != 255) { - # result.setAlpha( - # FloatValue - # .newBuilder() - # .setValue(((float) alpha) / denominator) - # .build()); - # } - # return resultBuilder.build(); - # } - # // ... - # - # Example (iOS / Obj-C): - # - # // ... - # static UIColor* fromProto(Color* protocolor) { - # float red = [protocolor red]; - # float green = [protocolor green]; - # float blue = [protocolor blue]; - # FloatValue* alpha_wrapper = [protocolor alpha]; - # float alpha = 1.0; - # if (alpha_wrapper != nil) { - # alpha = [alpha_wrapper value]; - # } - # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; - # } - # - # static Color* toProto(UIColor* color) { - # CGFloat red, green, blue, alpha; - # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - # return nil; - # } - # Color* result = [[Color alloc] init]; - # [result setRed:red]; - # [result setGreen:green]; - # [result setBlue:blue]; - # if (alpha <= 0.9999) { - # [result setAlpha:floatWrapperWithValue(alpha)]; - # } - # [result autorelease]; - # return result; - # } - # // ... - # - # Example (JavaScript): - # - # // ... - # - # var protoToCssColor = function(rgb_color) { - # var redFrac = rgb_color.red || 0.0; - # var greenFrac = rgb_color.green || 0.0; - # var blueFrac = rgb_color.blue || 0.0; - # var red = Math.floor(redFrac * 255); - # var green = Math.floor(greenFrac * 255); - # var blue = Math.floor(blueFrac * 255); - # - # if (!('alpha' in rgb_color)) { - # return rgbToCssColor(red, green, blue); - # } - # - # var alphaFrac = rgb_color.alpha.value || 0.0; - # var rgbParams = [red, green, blue].join(','); - # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); - # }; - # - # var rgbToCssColor = function(red, green, blue) { - # var rgbNumber = new Number((red << 16) | (green << 8) | blue); - # var hexString = rgbNumber.toString(16); - # var missingZeros = 6 - hexString.length; - # var resultBuilder = ['#']; - # for (var i = 0; i < missingZeros; i++) { - # resultBuilder.push('0'); - # } - # resultBuilder.push(hexString); - # return resultBuilder.join(''); - # }; - # - # // ... - # @!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 deleted file mode 100644 index bb40ea32bb03..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 7780d884f7b9..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/complete_import_space.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_custom_emoji.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_custom_emoji.rb deleted file mode 100644 index c94ea5a3df49..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_custom_emoji.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_CreateCustomEmoji_sync] -require "google/apps/chat/v1" - -## -# Snippet for the create_custom_emoji 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_custom_emoji. -# -def create_custom_emoji - # 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::CreateCustomEmojiRequest.new - - # Call the create_custom_emoji method. - result = client.create_custom_emoji request - - # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. - p result -end -# [END chat_v1_generated_ChatService_CreateCustomEmoji_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 deleted file mode 100644 index 9d98939a2bec..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_membership.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index d46bec45fcd0..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_message.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index e35b50dd340e..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_reaction.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_section.rb deleted file mode 100644 index 3c49151c6fad..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_section.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_CreateSection_sync] -require "google/apps/chat/v1" - -## -# Snippet for the create_section 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_section. -# -def create_section - # 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::CreateSectionRequest.new - - # Call the create_section method. - result = client.create_section request - - # The returned object is of type Google::Apps::Chat::V1::Section. - p result -end -# [END chat_v1_generated_ChatService_CreateSection_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 deleted file mode 100644 index 6288226fb150..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/create_space.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_custom_emoji.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_custom_emoji.rb deleted file mode 100644 index 9a243337bab9..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_custom_emoji.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_DeleteCustomEmoji_sync] -require "google/apps/chat/v1" - -## -# Snippet for the delete_custom_emoji 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_custom_emoji. -# -def delete_custom_emoji - # 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::DeleteCustomEmojiRequest.new - - # Call the delete_custom_emoji method. - result = client.delete_custom_emoji request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END chat_v1_generated_ChatService_DeleteCustomEmoji_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 deleted file mode 100644 index 28810050b65b..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_membership.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index d370ca3477b9..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_message.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index d31e218a8a01..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_reaction.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_section.rb deleted file mode 100644 index fc431779fe33..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_section.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_DeleteSection_sync] -require "google/apps/chat/v1" - -## -# Snippet for the delete_section 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_section. -# -def delete_section - # 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::DeleteSectionRequest.new - - # Call the delete_section method. - result = client.delete_section request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END chat_v1_generated_ChatService_DeleteSection_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 deleted file mode 100644 index 1e7b0d85a2a1..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/delete_space.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index d407540c7983..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/find_direct_message.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 72fc455a360a..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_attachment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_custom_emoji.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_custom_emoji.rb deleted file mode 100644 index ca135422c987..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_custom_emoji.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_GetCustomEmoji_sync] -require "google/apps/chat/v1" - -## -# Snippet for the get_custom_emoji 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_custom_emoji. -# -def get_custom_emoji - # 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::GetCustomEmojiRequest.new - - # Call the get_custom_emoji method. - result = client.get_custom_emoji request - - # The returned object is of type Google::Apps::Chat::V1::CustomEmoji. - p result -end -# [END chat_v1_generated_ChatService_GetCustomEmoji_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 deleted file mode 100644 index 2b422bce2544..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_membership.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index b3cfa2bc5c8e..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_message.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index eb64ee2159cd..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index a6dbd9eda4ce..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_event.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_notification_setting.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_notification_setting.rb deleted file mode 100644 index 9df421fdd49b..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_notification_setting.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_GetSpaceNotificationSetting_sync] -require "google/apps/chat/v1" - -## -# Snippet for the get_space_notification_setting 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_notification_setting. -# -def get_space_notification_setting - # 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::GetSpaceNotificationSettingRequest.new - - # Call the get_space_notification_setting method. - result = client.get_space_notification_setting request - - # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. - p result -end -# [END chat_v1_generated_ChatService_GetSpaceNotificationSetting_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 deleted file mode 100644 index a032a891bd86..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_space_read_state.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index cd83903b80e2..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/get_thread_read_state.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_custom_emojis.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_custom_emojis.rb deleted file mode 100644 index 645d5eb2f847..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_custom_emojis.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_ListCustomEmojis_sync] -require "google/apps/chat/v1" - -## -# Snippet for the list_custom_emojis 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_custom_emojis. -# -def list_custom_emojis - # 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::ListCustomEmojisRequest.new - - # Call the list_custom_emojis method. - result = client.list_custom_emojis 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::CustomEmoji. - p item - end -end -# [END chat_v1_generated_ChatService_ListCustomEmojis_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 deleted file mode 100644 index c5dc0c0fb587..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_memberships.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index e31af5526d21..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_messages.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 6029f6e48a71..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_reactions.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_section_items.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_section_items.rb deleted file mode 100644 index f247bd33527e..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_section_items.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_ListSectionItems_sync] -require "google/apps/chat/v1" - -## -# Snippet for the list_section_items 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_section_items. -# -def list_section_items - # 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::ListSectionItemsRequest.new - - # Call the list_section_items method. - result = client.list_section_items 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::SectionItem. - p item - end -end -# [END chat_v1_generated_ChatService_ListSectionItems_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.rb deleted file mode 100644 index f4514b222b38..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_sections.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_ListSections_sync] -require "google/apps/chat/v1" - -## -# Snippet for the list_sections 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_sections. -# -def list_sections - # 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::ListSectionsRequest.new - - # Call the list_sections method. - result = client.list_sections 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::Section. - p item - end -end -# [END chat_v1_generated_ChatService_ListSections_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 deleted file mode 100644 index 0b151da84944..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_space_events.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 79cfa31798a0..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/list_spaces.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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/move_section_item.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/move_section_item.rb deleted file mode 100644 index 7032d907a679..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/move_section_item.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_MoveSectionItem_sync] -require "google/apps/chat/v1" - -## -# Snippet for the move_section_item 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#move_section_item. -# -def move_section_item - # 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::MoveSectionItemRequest.new - - # Call the move_section_item method. - result = client.move_section_item request - - # The returned object is of type Google::Apps::Chat::V1::MoveSectionItemResponse. - p result -end -# [END chat_v1_generated_ChatService_MoveSectionItem_sync] diff --git a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.rb deleted file mode 100644 index 84852724755b..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/position_section.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_PositionSection_sync] -require "google/apps/chat/v1" - -## -# Snippet for the position_section 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#position_section. -# -def position_section - # 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::PositionSectionRequest.new - - # Call the position_section method. - result = client.position_section request - - # The returned object is of type Google::Apps::Chat::V1::PositionSectionResponse. - p result -end -# [END chat_v1_generated_ChatService_PositionSection_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 deleted file mode 100644 index 2a47c75babb2..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/search_spaces.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index ed89acce80f7..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/set_up_space.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 665335a58419..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_membership.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 78396376a8d4..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_message.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_section.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_section.rb deleted file mode 100644 index ecc5dbf0bce5..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_section.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_UpdateSection_sync] -require "google/apps/chat/v1" - -## -# Snippet for the update_section 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_section. -# -def update_section - # 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::UpdateSectionRequest.new - - # Call the update_section method. - result = client.update_section request - - # The returned object is of type Google::Apps::Chat::V1::Section. - p result -end -# [END chat_v1_generated_ChatService_UpdateSection_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 deleted file mode 100644 index 64a7d389e332..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_notification_setting.rb b/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_notification_setting.rb deleted file mode 100644 index 64830a0a143f..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_notification_setting.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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_UpdateSpaceNotificationSetting_sync] -require "google/apps/chat/v1" - -## -# Snippet for the update_space_notification_setting 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_notification_setting. -# -def update_space_notification_setting - # 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::UpdateSpaceNotificationSettingRequest.new - - # Call the update_space_notification_setting method. - result = client.update_space_notification_setting request - - # The returned object is of type Google::Apps::Chat::V1::SpaceNotificationSetting. - p result -end -# [END chat_v1_generated_ChatService_UpdateSpaceNotificationSetting_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 deleted file mode 100644 index f76a93be648d..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/update_space_read_state.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 14809b9b3bf4..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/chat_service/upload_attachment.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 deleted file mode 100644 index 572784a7718d..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json +++ /dev/null @@ -1,1735 +0,0 @@ -{ - "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_FindGroupChats_sync", - "title": "Snippet for the find_group_chats call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#find_group_chats.", - "file": "chat_service/find_group_chats.rb", - "language": "RUBY", - "client_method": { - "short_name": "find_group_chats", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#find_group_chats", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::FindGroupChatsRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::FindGroupChatsResponse", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "FindGroupChats", - "full_name": "google.chat.v1.ChatService.FindGroupChats", - "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_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_CreateCustomEmoji_sync", - "title": "Snippet for the create_custom_emoji call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_custom_emoji.", - "file": "chat_service/create_custom_emoji.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_custom_emoji", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_custom_emoji", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::CreateCustomEmojiRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::CustomEmoji", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "CreateCustomEmoji", - "full_name": "google.chat.v1.ChatService.CreateCustomEmoji", - "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_GetCustomEmoji_sync", - "title": "Snippet for the get_custom_emoji call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_custom_emoji.", - "file": "chat_service/get_custom_emoji.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_custom_emoji", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_custom_emoji", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::GetCustomEmojiRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::CustomEmoji", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "GetCustomEmoji", - "full_name": "google.chat.v1.ChatService.GetCustomEmoji", - "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_ListCustomEmojis_sync", - "title": "Snippet for the list_custom_emojis call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_custom_emojis.", - "file": "chat_service/list_custom_emojis.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_custom_emojis", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_custom_emojis", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::ListCustomEmojisRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::ListCustomEmojisResponse", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "ListCustomEmojis", - "full_name": "google.chat.v1.ChatService.ListCustomEmojis", - "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_DeleteCustomEmoji_sync", - "title": "Snippet for the delete_custom_emoji call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_custom_emoji.", - "file": "chat_service/delete_custom_emoji.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_custom_emoji", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_custom_emoji", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::DeleteCustomEmojiRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "DeleteCustomEmoji", - "full_name": "google.chat.v1.ChatService.DeleteCustomEmoji", - "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" - } - ] - }, - { - "region_tag": "chat_v1_generated_ChatService_GetSpaceNotificationSetting_sync", - "title": "Snippet for the get_space_notification_setting call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#get_space_notification_setting.", - "file": "chat_service/get_space_notification_setting.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_space_notification_setting", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#get_space_notification_setting", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::SpaceNotificationSetting", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "GetSpaceNotificationSetting", - "full_name": "google.chat.v1.ChatService.GetSpaceNotificationSetting", - "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_UpdateSpaceNotificationSetting_sync", - "title": "Snippet for the update_space_notification_setting call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_space_notification_setting.", - "file": "chat_service/update_space_notification_setting.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_space_notification_setting", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_space_notification_setting", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::SpaceNotificationSetting", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "UpdateSpaceNotificationSetting", - "full_name": "google.chat.v1.ChatService.UpdateSpaceNotificationSetting", - "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_CreateSection_sync", - "title": "Snippet for the create_section call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#create_section.", - "file": "chat_service/create_section.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_section", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#create_section", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::CreateSectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::Section", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "CreateSection", - "full_name": "google.chat.v1.ChatService.CreateSection", - "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_DeleteSection_sync", - "title": "Snippet for the delete_section call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#delete_section.", - "file": "chat_service/delete_section.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_section", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#delete_section", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::DeleteSectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "DeleteSection", - "full_name": "google.chat.v1.ChatService.DeleteSection", - "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_UpdateSection_sync", - "title": "Snippet for the update_section call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#update_section.", - "file": "chat_service/update_section.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_section", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#update_section", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::UpdateSectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::Section", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "UpdateSection", - "full_name": "google.chat.v1.ChatService.UpdateSection", - "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_ListSections_sync", - "title": "Snippet for the list_sections call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_sections.", - "file": "chat_service/list_sections.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sections", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_sections", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::ListSectionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::ListSectionsResponse", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "ListSections", - "full_name": "google.chat.v1.ChatService.ListSections", - "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_PositionSection_sync", - "title": "Snippet for the position_section call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#position_section.", - "file": "chat_service/position_section.rb", - "language": "RUBY", - "client_method": { - "short_name": "position_section", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#position_section", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::PositionSectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::PositionSectionResponse", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "PositionSection", - "full_name": "google.chat.v1.ChatService.PositionSection", - "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_ListSectionItems_sync", - "title": "Snippet for the list_section_items call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#list_section_items.", - "file": "chat_service/list_section_items.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_section_items", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#list_section_items", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::ListSectionItemsRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::ListSectionItemsResponse", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "ListSectionItems", - "full_name": "google.chat.v1.ChatService.ListSectionItems", - "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_MoveSectionItem_sync", - "title": "Snippet for the move_section_item call in the ChatService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Apps::Chat::V1::ChatService::Client#move_section_item.", - "file": "chat_service/move_section_item.rb", - "language": "RUBY", - "client_method": { - "short_name": "move_section_item", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client#move_section_item", - "async": false, - "parameters": [ - { - "type": "::Google::Apps::Chat::V1::MoveSectionItemRequest", - "name": "request" - } - ], - "result_type": "::Google::Apps::Chat::V1::MoveSectionItemResponse", - "client": { - "short_name": "ChatService::Client", - "full_name": "::Google::Apps::Chat::V1::ChatService::Client" - }, - "method": { - "short_name": "MoveSectionItem", - "full_name": "google.chat.v1.ChatService.MoveSectionItem", - "service": { - "short_name": "ChatService", - "full_name": "google.chat.v1.ChatService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "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 deleted file mode 100644 index 20b53a27addf..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_paths_test.rb +++ /dev/null @@ -1,223 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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 - - def stub_logger - nil - end - - def logger - nil - 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_custom_emoji_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.custom_emoji_path custom_emoji: "value0" - assert_equal "customEmojis/value0", 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_section_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.section_path user: "value0", section: "value1" - assert_equal "users/value0/sections/value1", path - end - end - - def test_section_item_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.section_item_path user: "value0", section: "value1", item: "value2" - assert_equal "users/value0/sections/value1/items/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_notification_setting_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_notification_setting_path user: "value0", space: "value1" - assert_equal "users/value0/spaces/value1/spaceNotificationSetting", 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 - - def test_user_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.user_path user: "value0" - assert_equal "users/value0", 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 deleted file mode 100644 index 79671fd08bd0..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_rest_test.rb +++ /dev/null @@ -1,2483 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - 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 - - def stub_logger - nil - end - - def logger - nil - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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_find_group_chats - # Create test objects. - client_result = ::Google::Apps::Chat::V1::FindGroupChatsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - users = ["hello world"] - page_size = 42 - page_token = "hello world" - space_view = :SPACE_VIEW_UNSPECIFIED - - find_group_chats_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_group_chats_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, find_group_chats_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_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.find_group_chats users: users, page_size: page_size, page_token: page_token, space_view: space_view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.find_group_chats ::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.find_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.find_group_chats(::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, find_group_chats_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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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_create_custom_emoji - # Create test objects. - client_result = ::Google::Apps::Chat::V1::CustomEmoji.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - custom_emoji = {} - - create_custom_emoji_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_custom_emoji_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_custom_emoji_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_custom_emoji({ custom_emoji: custom_emoji }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_custom_emoji custom_emoji: custom_emoji do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_custom_emoji ::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_custom_emoji({ custom_emoji: custom_emoji }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_custom_emoji(::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_custom_emoji_client_stub.call_count - end - end - end - - def test_get_custom_emoji - # Create test objects. - client_result = ::Google::Apps::Chat::V1::CustomEmoji.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_custom_emoji_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_custom_emoji_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_custom_emoji_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_custom_emoji({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_custom_emoji name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_custom_emoji ::Google::Apps::Chat::V1::GetCustomEmojiRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_custom_emoji({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_custom_emoji(::Google::Apps::Chat::V1::GetCustomEmojiRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_custom_emoji_client_stub.call_count - end - end - end - - def test_list_custom_emojis - # Create test objects. - client_result = ::Google::Apps::Chat::V1::ListCustomEmojisResponse.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_custom_emojis_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_custom_emojis_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_custom_emojis_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_custom_emojis({ 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_custom_emojis 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_custom_emojis ::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis({ 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_custom_emojis(::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis_client_stub.call_count - end - end - end - - def test_delete_custom_emoji - # 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_custom_emoji_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_custom_emoji_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_custom_emoji_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_custom_emoji({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_custom_emoji name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_custom_emoji ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_custom_emoji({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_custom_emoji(::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_custom_emoji_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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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:, method_name:| - 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_get_space_notification_setting - # Create test objects. - client_result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_space_notification_setting_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_notification_setting_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_space_notification_setting_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_notification_setting({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_space_notification_setting name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_space_notification_setting ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_space_notification_setting({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_space_notification_setting(::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_space_notification_setting_client_stub.call_count - end - end - end - - def test_update_space_notification_setting - # Create test objects. - client_result = ::Google::Apps::Chat::V1::SpaceNotificationSetting.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - space_notification_setting = {} - update_mask = {} - - update_space_notification_setting_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_notification_setting_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_space_notification_setting_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_notification_setting({ space_notification_setting: space_notification_setting, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_space_notification_setting space_notification_setting: space_notification_setting, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_space_notification_setting ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_space_notification_setting({ space_notification_setting: space_notification_setting, 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_notification_setting(::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, 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_notification_setting_client_stub.call_count - end - end - end - - def test_create_section - # Create test objects. - client_result = ::Google::Apps::Chat::V1::Section.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - section = {} - - create_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_section_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_section_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_section({ parent: parent, section: section }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_section parent: parent, section: section do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_section ::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_section({ parent: parent, section: section }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_section(::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_section_client_stub.call_count - end - end - end - - def test_delete_section - # 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_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_section_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_section_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_section({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_section name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_section ::Google::Apps::Chat::V1::DeleteSectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_section({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_section(::Google::Apps::Chat::V1::DeleteSectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_section_client_stub.call_count - end - end - end - - def test_update_section - # Create test objects. - client_result = ::Google::Apps::Chat::V1::Section.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - section = {} - update_mask = {} - - update_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_section_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_section_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_section({ section: section, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_section section: section, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_section ::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_section({ section: section, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_section(::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_section_client_stub.call_count - end - end - end - - def test_list_sections - # Create test objects. - client_result = ::Google::Apps::Chat::V1::ListSectionsResponse.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" - - list_sections_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_sections_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sections_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_sections({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_sections parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_sections ::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_sections({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_sections(::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_sections_client_stub.call_count - end - end - end - - def test_position_section - # Create test objects. - client_result = ::Google::Apps::Chat::V1::PositionSectionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - sort_order = 42 - - position_section_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_position_section_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, position_section_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.position_section({ name: name, sort_order: sort_order }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.position_section name: name, sort_order: sort_order do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.position_section ::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.position_section({ name: name, sort_order: sort_order }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.position_section(::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, position_section_client_stub.call_count - end - end - end - - def test_list_section_items - # Create test objects. - client_result = ::Google::Apps::Chat::V1::ListSectionItemsResponse.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_section_items_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_section_items_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_section_items_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_section_items({ 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_section_items 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_section_items ::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items({ 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_section_items(::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items_client_stub.call_count - end - end - end - - def test_move_section_item - # Create test objects. - client_result = ::Google::Apps::Chat::V1::MoveSectionItemResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - target_section = "hello world" - - move_section_item_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - 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_move_section_item_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, move_section_item_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.move_section_item({ name: name, target_section: target_section }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.move_section_item name: name, target_section: target_section do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.move_section_item ::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.move_section_item({ name: name, target_section: target_section }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.move_section_item(::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, move_section_item_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 deleted file mode 100644 index ea47733f4934..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/test/google/apps/chat/v1/chat_service_test.rb +++ /dev/null @@ -1,2773 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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/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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - 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_find_group_chats - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::FindGroupChatsResponse.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. - users = ["hello world"] - page_size = 42 - page_token = "hello world" - space_view = :SPACE_VIEW_UNSPECIFIED - - find_group_chats_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :find_group_chats, name - assert_kind_of ::Google::Apps::Chat::V1::FindGroupChatsRequest, request - assert_equal ["hello world"], request["users"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :SPACE_VIEW_UNSPECIFIED, request["space_view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, find_group_chats_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_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }) 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.find_group_chats users: users, page_size: page_size, page_token: page_token, space_view: space_view 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.find_group_chats ::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view) 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.find_group_chats({ users: users, page_size: page_size, page_token: page_token, space_view: space_view }, 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.find_group_chats(::Google::Apps::Chat::V1::FindGroupChatsRequest.new(users: users, page_size: page_size, page_token: page_token, space_view: space_view), 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, find_group_chats_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_create_custom_emoji - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::CustomEmoji.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. - custom_emoji = {} - - create_custom_emoji_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_custom_emoji, name - assert_kind_of ::Google::Apps::Chat::V1::CreateCustomEmojiRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::CustomEmoji), request["custom_emoji"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_custom_emoji_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_custom_emoji({ custom_emoji: custom_emoji }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_custom_emoji custom_emoji: custom_emoji do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_custom_emoji ::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_custom_emoji({ custom_emoji: custom_emoji }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_custom_emoji(::Google::Apps::Chat::V1::CreateCustomEmojiRequest.new(custom_emoji: custom_emoji), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_custom_emoji_client_stub.call_rpc_count - end - end - - def test_get_custom_emoji - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::CustomEmoji.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_custom_emoji_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_custom_emoji, name - assert_kind_of ::Google::Apps::Chat::V1::GetCustomEmojiRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_custom_emoji_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_custom_emoji({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_custom_emoji name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_custom_emoji ::Google::Apps::Chat::V1::GetCustomEmojiRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_custom_emoji({ 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_custom_emoji(::Google::Apps::Chat::V1::GetCustomEmojiRequest.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_custom_emoji_client_stub.call_rpc_count - end - end - - def test_list_custom_emojis - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::ListCustomEmojisResponse.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_custom_emojis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_custom_emojis, name - assert_kind_of ::Google::Apps::Chat::V1::ListCustomEmojisRequest, 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_custom_emojis_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_custom_emojis({ 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_custom_emojis 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_custom_emojis ::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis({ 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_custom_emojis(::Google::Apps::Chat::V1::ListCustomEmojisRequest.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_custom_emojis_client_stub.call_rpc_count - end - end - - def test_delete_custom_emoji - # 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_custom_emoji_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_custom_emoji, name - assert_kind_of ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_custom_emoji_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_custom_emoji({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_custom_emoji name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_custom_emoji ::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_custom_emoji({ 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_custom_emoji(::Google::Apps::Chat::V1::DeleteCustomEmojiRequest.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_custom_emoji_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_get_space_notification_setting - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::SpaceNotificationSetting.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_notification_setting_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_space_notification_setting, name - assert_kind_of ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_space_notification_setting_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_notification_setting({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_space_notification_setting name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_space_notification_setting ::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.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_notification_setting({ 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_notification_setting(::Google::Apps::Chat::V1::GetSpaceNotificationSettingRequest.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_notification_setting_client_stub.call_rpc_count - end - end - - def test_update_space_notification_setting - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::SpaceNotificationSetting.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_notification_setting = {} - update_mask = {} - - update_space_notification_setting_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_space_notification_setting, name - assert_kind_of ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::SpaceNotificationSetting), request["space_notification_setting"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_space_notification_setting_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_notification_setting({ space_notification_setting: space_notification_setting, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_space_notification_setting space_notification_setting: space_notification_setting, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_space_notification_setting ::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, 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_notification_setting({ space_notification_setting: space_notification_setting, 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_notification_setting(::Google::Apps::Chat::V1::UpdateSpaceNotificationSettingRequest.new(space_notification_setting: space_notification_setting, 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_notification_setting_client_stub.call_rpc_count - end - end - - def test_create_section - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::Section.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" - section = {} - - create_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_section, name - assert_kind_of ::Google::Apps::Chat::V1::CreateSectionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Section), request["section"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_section_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_section({ parent: parent, section: section }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_section parent: parent, section: section do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_section ::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_section({ parent: parent, section: section }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_section(::Google::Apps::Chat::V1::CreateSectionRequest.new(parent: parent, section: section), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_section_client_stub.call_rpc_count - end - end - - def test_delete_section - # 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_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_section, name - assert_kind_of ::Google::Apps::Chat::V1::DeleteSectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_section_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_section({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_section name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_section ::Google::Apps::Chat::V1::DeleteSectionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_section({ 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_section(::Google::Apps::Chat::V1::DeleteSectionRequest.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_section_client_stub.call_rpc_count - end - end - - def test_update_section - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::Section.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. - section = {} - update_mask = {} - - update_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_section, name - assert_kind_of ::Google::Apps::Chat::V1::UpdateSectionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Apps::Chat::V1::Section), request["section"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_section_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_section({ section: section, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_section section: section, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_section ::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, 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_section({ section: section, 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_section(::Google::Apps::Chat::V1::UpdateSectionRequest.new(section: section, 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_section_client_stub.call_rpc_count - end - end - - def test_list_sections - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::ListSectionsResponse.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" - - list_sections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sections, name - assert_kind_of ::Google::Apps::Chat::V1::ListSectionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_sections_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_sections({ parent: parent, page_size: page_size, page_token: page_token }) 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_sections parent: parent, page_size: page_size, page_token: page_token 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_sections ::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token) 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_sections({ parent: parent, page_size: page_size, page_token: page_token }, 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_sections(::Google::Apps::Chat::V1::ListSectionsRequest.new(parent: parent, page_size: page_size, page_token: page_token), 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_sections_client_stub.call_rpc_count - end - end - - def test_position_section - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::PositionSectionResponse.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" - sort_order = 42 - - position_section_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :position_section, name - assert_kind_of ::Google::Apps::Chat::V1::PositionSectionRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["sort_order"] - assert_equal :sort_order, request.position - refute_nil options - end - - Gapic::ServiceStub.stub :new, position_section_client_stub do - # Create client - client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.position_section({ name: name, sort_order: sort_order }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.position_section name: name, sort_order: sort_order do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.position_section ::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.position_section({ name: name, sort_order: sort_order }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.position_section(::Google::Apps::Chat::V1::PositionSectionRequest.new(name: name, sort_order: sort_order), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, position_section_client_stub.call_rpc_count - end - end - - def test_list_section_items - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::ListSectionItemsResponse.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_section_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_section_items, name - assert_kind_of ::Google::Apps::Chat::V1::ListSectionItemsRequest, 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_section_items_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_section_items({ 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_section_items 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_section_items ::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items({ 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_section_items(::Google::Apps::Chat::V1::ListSectionItemsRequest.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_section_items_client_stub.call_rpc_count - end - end - - def test_move_section_item - # Create GRPC objects. - grpc_response = ::Google::Apps::Chat::V1::MoveSectionItemResponse.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" - target_section = "hello world" - - move_section_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :move_section_item, name - assert_kind_of ::Google::Apps::Chat::V1::MoveSectionItemRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["target_section"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, move_section_item_client_stub do - # Create client - client = ::Google::Apps::Chat::V1::ChatService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.move_section_item({ name: name, target_section: target_section }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.move_section_item name: name, target_section: target_section do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.move_section_item ::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.move_section_item({ name: name, target_section: target_section }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.move_section_item(::Google::Apps::Chat::V1::MoveSectionItemRequest.new(name: name, target_section: target_section), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, move_section_item_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 - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - 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 = creds - end - assert_kind_of ::Google::Apps::Chat::V1::ChatService::Client, client - assert_equal creds, client.configure.credentials - end - 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 deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-apps-chat-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct"