From 696a64c5d68820510546e8b41ca6170193481144 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:11:49 -0700 Subject: [PATCH] feat: Support `useAdminAccess` for managing chat spaces and organization memberships (#27325) feat: Add `last_active_time` and `membership_count` to the `Space` resource. --- google-apps-chat-v1/.owlbot-manifest.json | 1 + google-apps-chat-v1/gapic_metadata.json | 5 + .../apps/chat/v1/chat_service/client.rb | 335 ++++++++++++++++- .../apps/chat/v1/chat_service/rest/client.rb | 336 +++++++++++++++++- .../chat/v1/chat_service/rest/service_stub.rb | 57 +++ .../lib/google/chat/v1/chat_service_pb.rb | 2 +- .../chat/v1/chat_service_services_pb.rb | 6 + .../lib/google/chat/v1/membership_pb.rb | 2 +- .../lib/google/chat/v1/space_pb.rb | 5 +- .../proto_docs/google/chat/v1/membership.rb | 71 +++- .../proto_docs/google/chat/v1/space.rb | 208 +++++++++++ .../snippets/chat_service/search_spaces.rb | 51 +++ .../snippet_metadata_google.chat.v1.json | 40 +++ .../apps/chat/v1/chat_service_rest_test.rb | 146 +++++--- .../google/apps/chat/v1/chat_service_test.rb | 167 ++++++--- 15 files changed, 1327 insertions(+), 105 deletions(-) create mode 100644 google-apps-chat-v1/snippets/chat_service/search_spaces.rb diff --git a/google-apps-chat-v1/.owlbot-manifest.json b/google-apps-chat-v1/.owlbot-manifest.json index 5ad3f48529e1..0324e0c8816f 100644 --- a/google-apps-chat-v1/.owlbot-manifest.json +++ b/google-apps-chat-v1/.owlbot-manifest.json @@ -102,6 +102,7 @@ "snippets/chat_service/list_reactions.rb", "snippets/chat_service/list_space_events.rb", "snippets/chat_service/list_spaces.rb", + "snippets/chat_service/search_spaces.rb", "snippets/chat_service/set_up_space.rb", "snippets/chat_service/update_membership.rb", "snippets/chat_service/update_message.rb", diff --git a/google-apps-chat-v1/gapic_metadata.json b/google-apps-chat-v1/gapic_metadata.json index ecc8df890052..c6e9e04a82d7 100644 --- a/google-apps-chat-v1/gapic_metadata.json +++ b/google-apps-chat-v1/gapic_metadata.json @@ -60,6 +60,11 @@ "list_spaces" ] }, + "SearchSpaces": { + "methods": [ + "search_spaces" + ] + }, "GetSpace": { "methods": [ "get_space" 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 2eeff5017d84..088b9348c319 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 @@ -121,6 +121,11 @@ def self.configure 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] @@ -635,7 +640,7 @@ def list_messages request, options = nil # @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) + # @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). @@ -672,8 +677,8 @@ def list_messages request, options = nil # # To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. # - # To filter by type, set `member.type` to `HUMAN` or `BOT`. Developer - # Preview: You can also filter for `member.type` using the `!=` operator. + # 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. @@ -717,6 +722,19 @@ def list_messages request, options = nil # # Currently requires [user # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.memberships.readonly` or + # `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Listing app memberships in a space isn't supported when using admin access. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Membership>] @@ -811,7 +829,7 @@ def list_memberships request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload get_membership(name: nil) + # @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). @@ -830,6 +848,19 @@ def list_memberships request, options = nil # you can use the user's email as an alias for `{member}`. For example, # `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the # email of the Google Chat user. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + # [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Getting app memberships in a space isn't supported when using admin access. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Apps::Chat::V1::Membership] @@ -1564,6 +1595,214 @@ def list_spaces request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Returns a list of spaces in a Google Workspace organization based on an + # administrator's search. Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + # In the request, set `use_admin_access` to `true`. + # + # @overload search_spaces(request, options = nil) + # Pass arguments to `search_spaces` via a request object, either of type + # {::Google::Apps::Chat::V1::SearchSpacesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::SearchSpacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_spaces(use_admin_access: nil, page_size: nil, page_token: nil, query: nil, order_by: nil) + # Pass arguments to `search_spaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + # [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # This method currently only supports admin access, thus only `true` is + # accepted for this field. + # @param page_size [::Integer] + # The maximum number of spaces to return. The service may return fewer than + # this value. + # + # If unspecified, at most 100 spaces are returned. + # + # The maximum value is 1000. If you use a value more than 1000, it's + # automatically changed to 1000. + # @param page_token [::String] + # A token, received from the previous search spaces call. Provide this + # parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the page token. Passing different values to the other parameters + # might lead to unexpected results. + # @param query [::String] + # Required. A search query. + # + # You can search by using the following parameters: + # + # - `create_time` + # - `customer` + # - `display_name` + # - `external_user_allowed` + # - `last_active_time` + # - `space_history_state` + # - `space_type` + # + # `create_time` and `last_active_time` accept a timestamp in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + # comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + # + # `customer` is required and is used to indicate which customer + # to fetch spaces from. `customers/my_customer` is the only supported value. + # + # `display_name` only accepts the `HAS` (`:`) operator. The text to + # match is first tokenized into tokens and each token is prefix-matched + # case-insensitively and independently as a substring anywhere in the space's + # `display_name`. For example, `Fun Eve` matches `Fun event` or `The + # evening was fun`, but not `notFun event` or `even`. + # + # `external_user_allowed` accepts either `true` or `false`. + # + # `space_history_state` only accepts values from the [`historyState`] + # (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + # field of a `space` resource. + # + # `space_type` is required and the only valid value is `SPACE`. + # + # Across different fields, only `AND` operators are supported. A valid + # example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + # example is `space_type = "SPACE" OR display_name:"Hello"`. + # + # Among the same field, + # `space_type` doesn't support `AND` or `OR` operators. + # `display_name`, 'space_history_state', and 'external_user_allowed' only + # support `OR` operators. + # `last_active_time` and `create_time` support both `AND` and `OR` operators. + # `AND` can only be used to represent an interval, such as `last_active_time + # < "2022-01-01T00:00:00+00:00" AND last_active_time > + # "2023-01-01T00:00:00+00:00"`. + # + # The following example queries are valid: + # + # ``` + # customer = "customers/my_customer" AND space_type = "SPACE" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # display_name:"Hello World" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (display_name:"Hello World" OR display_name:"Fun event") AND + # (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + # "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + # (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + # ``` + # @param order_by [::String] + # Optional. How the list of spaces is ordered. + # + # Supported attributes to order by are: + # + # - `membership_count.joined_direct_human_user_count` — Denotes the count of + # human users that have directly joined a space. + # - `last_active_time` — Denotes the time when last eligible item is added to + # any topic of this space. + # - `create_time` — Denotes the time of the space creation. + # + # Valid ordering operation values are: + # + # - `ASC` for ascending. Default value. + # + # - `DESC` for descending. + # + # The supported syntax are: + # + # - `membership_count.joined_direct_human_user_count DESC` + # - `membership_count.joined_direct_human_user_count ASC` + # - `last_active_time DESC` + # - `last_active_time ASC` + # - `create_time DESC` + # - `create_time ASC` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::SearchSpacesRequest.new + # + # # Call the search_spaces method. + # result = client.search_spaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Space. + # p item + # end + # + def search_spaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SearchSpacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.search_spaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_spaces.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_spaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.call_rpc :search_spaces, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @chat_service_stub, :search_spaces, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Returns details about a space. For an example, see # [Get details about a @@ -1587,7 +1826,7 @@ def list_spaces request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload get_space(name: nil) + # @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). @@ -1596,6 +1835,16 @@ def list_spaces request, options = nil # Required. Resource name of the space, in the form `spaces/{space}`. # # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Apps::Chat::V1::Space] @@ -1974,7 +2223,7 @@ def set_up_space request, options = nil # @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) + # @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). @@ -2035,6 +2284,19 @@ def set_up_space request, options = nil # `permission_settings.reply_messages` # (Warning: mutually exclusive with all other non-permission settings field # paths). `permission_settings` is not supported with admin access. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Some `FieldMask` values are not supported using admin access. For details, + # see the description of `update_mask`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Apps::Chat::V1::Space] @@ -2121,7 +2383,7 @@ def update_space request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload delete_space(name: nil) + # @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). @@ -2130,6 +2392,16 @@ def update_space request, options = nil # Required. Resource name of the space to delete. # # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.delete` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Protobuf::Empty] @@ -2443,7 +2715,7 @@ def find_direct_message request, options = nil # @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) + # @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). @@ -2470,6 +2742,20 @@ def find_direct_message request, options = nil # `users/user@example.com` or `users/123456789`. When a Chat app creates a # membership relation for itself, it must use the `chat.memberships.app` # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Creating app memberships or creating memberships for users outside the + # administrator's Google Workspace organization isn't supported using admin + # access. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Apps::Chat::V1::Membership] @@ -2553,7 +2839,7 @@ def create_membership request, options = nil # @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) + # @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). @@ -2568,6 +2854,16 @@ def create_membership request, options = nil # Currently supported field paths: # # - `role` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Apps::Chat::V1::Membership] @@ -2652,7 +2948,7 @@ def update_membership request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload delete_membership(name: nil) + # @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). @@ -2672,6 +2968,18 @@ def update_membership request, options = nil # and `spaces/{space}/members/app` format. # # Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Deleting app memberships in a space isn't supported using admin access. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Apps::Chat::V1::Membership] @@ -3890,6 +4198,11 @@ class Rpcs # 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] # @@ -4002,6 +4315,8 @@ def initialize parent_rpcs = nil @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 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 74a66d98f35d..ff0b8e8aeaa3 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 @@ -123,6 +123,11 @@ def self.configure 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] @@ -614,7 +619,7 @@ def list_messages request, options = nil # @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) + # @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). @@ -651,8 +656,8 @@ def list_messages request, options = nil # # To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. # - # To filter by type, set `member.type` to `HUMAN` or `BOT`. Developer - # Preview: You can also filter for `member.type` using the `!=` operator. + # 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. @@ -696,6 +701,19 @@ def list_messages request, options = nil # # Currently requires [user # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.memberships.readonly` or + # `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Listing app memberships in a space isn't supported when using admin access. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Membership>] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -783,7 +801,7 @@ def list_memberships request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload get_membership(name: nil) + # @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). @@ -802,6 +820,19 @@ def list_memberships request, options = nil # you can use the user's email as an alias for `{member}`. For example, # `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the # email of the Google Chat user. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + # [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Getting app memberships in a space isn't supported when using admin access. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Apps::Chat::V1::Membership] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -1495,6 +1526,215 @@ def list_spaces request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Returns a list of spaces in a Google Workspace organization based on an + # administrator's search. Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + # In the request, set `use_admin_access` to `true`. + # + # @overload search_spaces(request, options = nil) + # Pass arguments to `search_spaces` via a request object, either of type + # {::Google::Apps::Chat::V1::SearchSpacesRequest} or an equivalent Hash. + # + # @param request [::Google::Apps::Chat::V1::SearchSpacesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_spaces(use_admin_access: nil, page_size: nil, page_token: nil, query: nil, order_by: nil) + # Pass arguments to `search_spaces` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + # [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # This method currently only supports admin access, thus only `true` is + # accepted for this field. + # @param page_size [::Integer] + # The maximum number of spaces to return. The service may return fewer than + # this value. + # + # If unspecified, at most 100 spaces are returned. + # + # The maximum value is 1000. If you use a value more than 1000, it's + # automatically changed to 1000. + # @param page_token [::String] + # A token, received from the previous search spaces call. Provide this + # parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the page token. Passing different values to the other parameters + # might lead to unexpected results. + # @param query [::String] + # Required. A search query. + # + # You can search by using the following parameters: + # + # - `create_time` + # - `customer` + # - `display_name` + # - `external_user_allowed` + # - `last_active_time` + # - `space_history_state` + # - `space_type` + # + # `create_time` and `last_active_time` accept a timestamp in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + # comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + # + # `customer` is required and is used to indicate which customer + # to fetch spaces from. `customers/my_customer` is the only supported value. + # + # `display_name` only accepts the `HAS` (`:`) operator. The text to + # match is first tokenized into tokens and each token is prefix-matched + # case-insensitively and independently as a substring anywhere in the space's + # `display_name`. For example, `Fun Eve` matches `Fun event` or `The + # evening was fun`, but not `notFun event` or `even`. + # + # `external_user_allowed` accepts either `true` or `false`. + # + # `space_history_state` only accepts values from the [`historyState`] + # (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + # field of a `space` resource. + # + # `space_type` is required and the only valid value is `SPACE`. + # + # Across different fields, only `AND` operators are supported. A valid + # example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + # example is `space_type = "SPACE" OR display_name:"Hello"`. + # + # Among the same field, + # `space_type` doesn't support `AND` or `OR` operators. + # `display_name`, 'space_history_state', and 'external_user_allowed' only + # support `OR` operators. + # `last_active_time` and `create_time` support both `AND` and `OR` operators. + # `AND` can only be used to represent an interval, such as `last_active_time + # < "2022-01-01T00:00:00+00:00" AND last_active_time > + # "2023-01-01T00:00:00+00:00"`. + # + # The following example queries are valid: + # + # ``` + # customer = "customers/my_customer" AND space_type = "SPACE" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # display_name:"Hello World" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (display_name:"Hello World" OR display_name:"Fun event") AND + # (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + # "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + # (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + # ``` + # @param order_by [::String] + # Optional. How the list of spaces is ordered. + # + # Supported attributes to order by are: + # + # - `membership_count.joined_direct_human_user_count` — Denotes the count of + # human users that have directly joined a space. + # - `last_active_time` — Denotes the time when last eligible item is added to + # any topic of this space. + # - `create_time` — Denotes the time of the space creation. + # + # Valid ordering operation values are: + # + # - `ASC` for ascending. Default value. + # + # - `DESC` for descending. + # + # The supported syntax are: + # + # - `membership_count.joined_direct_human_user_count DESC` + # - `membership_count.joined_direct_human_user_count ASC` + # - `last_active_time DESC` + # - `last_active_time ASC` + # - `create_time DESC` + # - `create_time ASC` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Apps::Chat::V1::Space>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/apps/chat/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Apps::Chat::V1::ChatService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Apps::Chat::V1::SearchSpacesRequest.new + # + # # Call the search_spaces method. + # result = client.search_spaces request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Apps::Chat::V1::Space. + # p item + # end + # + def search_spaces request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Apps::Chat::V1::SearchSpacesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.search_spaces.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Apps::Chat::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.search_spaces.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_spaces.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @chat_service_stub.search_spaces request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @chat_service_stub, :search_spaces, "spaces", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Returns details about a space. For an example, see # [Get details about a @@ -1518,7 +1758,7 @@ def list_spaces request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload get_space(name: nil) + # @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). @@ -1527,6 +1767,16 @@ def list_spaces request, options = nil # Required. Resource name of the space, in the form `spaces/{space}`. # # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Apps::Chat::V1::Space] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -1900,7 +2150,7 @@ def set_up_space request, options = nil # @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) + # @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). @@ -1961,6 +2211,19 @@ def set_up_space request, options = nil # `permission_settings.reply_messages` # (Warning: mutually exclusive with all other non-permission settings field # paths). `permission_settings` is not supported with admin access. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Some `FieldMask` values are not supported using admin access. For details, + # see the description of `update_mask`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Apps::Chat::V1::Space] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -2040,7 +2303,7 @@ def update_space request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload delete_space(name: nil) + # @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). @@ -2049,6 +2312,16 @@ def update_space request, options = nil # Required. Resource name of the space to delete. # # Format: `spaces/{space}` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.delete` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Protobuf::Empty] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -2349,7 +2622,7 @@ def find_direct_message request, options = nil # @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) + # @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). @@ -2376,6 +2649,20 @@ def find_direct_message request, options = nil # `users/user@example.com` or `users/123456789`. When a Chat app creates a # membership relation for itself, it must use the `chat.memberships.app` # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Creating app memberships or creating memberships for users outside the + # administrator's Google Workspace organization isn't supported using admin + # access. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Apps::Chat::V1::Membership] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -2452,7 +2739,7 @@ def create_membership request, options = nil # @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) + # @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). @@ -2467,6 +2754,16 @@ def create_membership request, options = nil # Currently supported field paths: # # - `role` + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Apps::Chat::V1::Membership] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -2544,7 +2841,7 @@ def update_membership request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload delete_membership(name: nil) + # @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). @@ -2564,6 +2861,18 @@ def update_membership request, options = nil # and `spaces/{space}/members/app` format. # # Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + # @param use_admin_access [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Deleting app memberships in a space isn't supported using admin access. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Apps::Chat::V1::Membership] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -3699,6 +4008,11 @@ class Rpcs # 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] # @@ -3811,6 +4125,8 @@ def initialize parent_rpcs = nil @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 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 e55c62145c30..4f2d05ae2192 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 @@ -441,6 +441,44 @@ def list_spaces request_pb, options = nil result end + ## + # Baseline implementation for the search_spaces REST call + # + # @param request_pb [::Google::Apps::Chat::V1::SearchSpacesRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Apps::Chat::V1::SearchSpacesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Apps::Chat::V1::SearchSpacesResponse] + # A result object deserialized from the server's reply + def search_spaces request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_spaces_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Apps::Chat::V1::SearchSpacesResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + ## # Baseline implementation for the get_space REST call # @@ -1344,6 +1382,25 @@ def self.transcode_list_spaces_request request_pb 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 # 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 3c7569321fba..2c2d798c39ea 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 @@ -18,7 +18,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\x1agoogle/chat/v1/space.proto\x1a google/chat/v1/space_event.proto\x1a%google/chat/v1/space_read_state.proto\x1a google/chat/v1/space_setup.proto\x1a&google/chat/v1/thread_read_state.proto\x1a\x1bgoogle/protobuf/empty.proto2\x9a)\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\x12\x66\n\x08GetSpace\x12\x1f.google.chat.v1.GetSpaceRequest\x1a\x15.google.chat.v1.Space\"\"\xda\x41\x04name\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/{name=spaces/*}\x12k\n\x0b\x43reateSpace\x12\".google.chat.v1.CreateSpaceRequest\x1a\x15.google.chat.v1.Space\"!\xda\x41\x05space\x82\xd3\xe4\x93\x02\x13\"\n/v1/spaces:\x05space\x12\x63\n\nSetUpSpace\x12!.google.chat.v1.SetUpSpaceRequest\x1a\x15.google.chat.v1.Space\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v1/spaces:setup:\x01*\x12\x86\x01\n\x0bUpdateSpace\x12\".google.chat.v1.UpdateSpaceRequest\x1a\x15.google.chat.v1.Space\"<\xda\x41\x11space,update_mask\x82\xd3\xe4\x93\x02\"2\x19/v1/{space.name=spaces/*}:\x05space\x12m\n\x0b\x44\x65leteSpace\x12\".google.chat.v1.DeleteSpaceRequest\x1a\x16.google.protobuf.Empty\"\"\xda\x41\x04name\x82\xd3\xe4\x93\x02\x15*\x13/v1/{name=spaces/*}\x12\x9d\x01\n\x13\x43ompleteImportSpace\x12*.google.chat.v1.CompleteImportSpaceRequest\x1a+.google.chat.v1.CompleteImportSpaceResponse\"-\x82\xd3\xe4\x93\x02\'\"\"/v1/{name=spaces/*}:completeImport:\x01*\x12z\n\x11\x46indDirectMessage\x12(.google.chat.v1.FindDirectMessageRequest\x1a\x15.google.chat.v1.Space\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/spaces:findDirectMessage\x12\x9e\x01\n\x10\x43reateMembership\x12\'.google.chat.v1.CreateMembershipRequest\x1a\x1a.google.chat.v1.Membership\"E\xda\x41\x11parent,membership\x82\xd3\xe4\x93\x02+\"\x1d/v1/{parent=spaces/*}/members:\nmembership\x12\xae\x01\n\x10UpdateMembership\x12\'.google.chat.v1.UpdateMembershipRequest\x1a\x1a.google.chat.v1.Membership\"U\xda\x41\x16membership,update_mask\x82\xd3\xe4\x93\x02\x36\x32(/v1/{membership.name=spaces/*/members/*}:\nmembership\x12\x85\x01\n\x10\x44\x65leteMembership\x12\'.google.chat.v1.DeleteMembershipRequest\x1a\x1a.google.chat.v1.Membership\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=spaces/*/members/*}\x12\xa1\x01\n\x0e\x43reateReaction\x12%.google.chat.v1.CreateReactionRequest\x1a\x18.google.chat.v1.Reaction\"N\xda\x41\x0fparent,reaction\x82\xd3\xe4\x93\x02\x36\"*/v1/{parent=spaces/*/messages/*}/reactions:\x08reaction\x12\x99\x01\n\rListReactions\x12$.google.chat.v1.ListReactionsRequest\x1a%.google.chat.v1.ListReactionsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=spaces/*/messages/*}/reactions\x12\x8a\x01\n\x0e\x44\x65leteReaction\x12%.google.chat.v1.DeleteReactionRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=spaces/*/messages/*/reactions/*}\x12\x98\x01\n\x11GetSpaceReadState\x12(.google.chat.v1.GetSpaceReadStateRequest\x1a\x1e.google.chat.v1.SpaceReadState\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=users/*/spaces/*/spaceReadState}\x12\xd9\x01\n\x14UpdateSpaceReadState\x12+.google.chat.v1.UpdateSpaceReadStateRequest\x1a\x1e.google.chat.v1.SpaceReadState\"t\xda\x41\x1cspace_read_state,update_mask\x82\xd3\xe4\x93\x02O2;/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}:\x10space_read_state\x12\xa6\x01\n\x12GetThreadReadState\x12).google.chat.v1.GetThreadReadStateRequest\x1a\x1f.google.chat.v1.ThreadReadState\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=users/*/spaces/*/threads/*/threadReadState}\x12\x83\x01\n\rGetSpaceEvent\x12$.google.chat.v1.GetSpaceEventRequest\x1a\x1a.google.chat.v1.SpaceEvent\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=spaces/*/spaceEvents/*}\x12\x9d\x01\n\x0fListSpaceEvents\x12&.google.chat.v1.ListSpaceEventsRequest\x1a\'.google.chat.v1.ListSpaceEventsResponse\"9\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=spaces/*}/spaceEvents\x1a\xa9\t\xca\x41\x13\x63hat.googleapis.com\xd2\x41\x8f\thttps://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonlyB\xa9\x01\n\x12\x63om.google.chat.v1B\x10\x43hatServiceProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" +descriptor_data = "\n!google/chat/v1/chat_service.proto\x12\x0egoogle.chat.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/chat/v1/attachment.proto\x1a\x1fgoogle/chat/v1/membership.proto\x1a\x1cgoogle/chat/v1/message.proto\x1a\x1dgoogle/chat/v1/reaction.proto\x1a\x1agoogle/chat/v1/space.proto\x1a google/chat/v1/space_event.proto\x1a%google/chat/v1/space_read_state.proto\x1a google/chat/v1/space_setup.proto\x1a&google/chat/v1/thread_read_state.proto\x1a\x1bgoogle/protobuf/empty.proto2\x93*\n\x0b\x43hatService\x12\x9b\x01\n\rCreateMessage\x12$.google.chat.v1.CreateMessageRequest\x1a\x17.google.chat.v1.Message\"K\xda\x41\x19parent,message,message_id\x82\xd3\xe4\x93\x02)\"\x1e/v1/{parent=spaces/*}/messages:\x07message\x12\x8a\x01\n\x0cListMessages\x12#.google.chat.v1.ListMessagesRequest\x1a$.google.chat.v1.ListMessagesResponse\"/\xda\x41\x06parent\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{parent=spaces/*}/messages\x12\x92\x01\n\x0fListMemberships\x12&.google.chat.v1.ListMembershipsRequest\x1a\'.google.chat.v1.ListMembershipsResponse\".\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{parent=spaces/*}/members\x12\x7f\n\rGetMembership\x12$.google.chat.v1.GetMembershipRequest\x1a\x1a.google.chat.v1.Membership\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v1/{name=spaces/*/members/*}\x12w\n\nGetMessage\x12!.google.chat.v1.GetMessageRequest\x1a\x17.google.chat.v1.Message\"-\xda\x41\x04name\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=spaces/*/messages/*}\x12\xd1\x01\n\rUpdateMessage\x12$.google.chat.v1.UpdateMessageRequest\x1a\x17.google.chat.v1.Message\"\x80\x01\xda\x41\x13message,update_mask\x82\xd3\xe4\x93\x02\x64\x1a&/v1/{message.name=spaces/*/messages/*}:\x07messageZ12&/v1/{message.name=spaces/*/messages/*}:\x07message\x12|\n\rDeleteMessage\x12$.google.chat.v1.DeleteMessageRequest\x1a\x16.google.protobuf.Empty\"-\xda\x41\x04name\x82\xd3\xe4\x93\x02 *\x1e/v1/{name=spaces/*/messages/*}\x12\x8e\x01\n\rGetAttachment\x12$.google.chat.v1.GetAttachmentRequest\x1a\x1a.google.chat.v1.Attachment\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=spaces/*/messages/*/attachments/*}\x12\x9a\x01\n\x10UploadAttachment\x12\'.google.chat.v1.UploadAttachmentRequest\x1a(.google.chat.v1.UploadAttachmentResponse\"3\x82\xd3\xe4\x93\x02-\"(/v1/{parent=spaces/*}/attachments:upload:\x01*\x12j\n\nListSpaces\x12!.google.chat.v1.ListSpacesRequest\x1a\".google.chat.v1.ListSpacesResponse\"\x15\xda\x41\x00\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/spaces\x12w\n\x0cSearchSpaces\x12#.google.chat.v1.SearchSpacesRequest\x1a$.google.chat.v1.SearchSpacesResponse\"\x1c\xda\x41\x00\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/spaces:search\x12\x66\n\x08GetSpace\x12\x1f.google.chat.v1.GetSpaceRequest\x1a\x15.google.chat.v1.Space\"\"\xda\x41\x04name\x82\xd3\xe4\x93\x02\x15\x12\x13/v1/{name=spaces/*}\x12k\n\x0b\x43reateSpace\x12\".google.chat.v1.CreateSpaceRequest\x1a\x15.google.chat.v1.Space\"!\xda\x41\x05space\x82\xd3\xe4\x93\x02\x13\"\n/v1/spaces:\x05space\x12\x63\n\nSetUpSpace\x12!.google.chat.v1.SetUpSpaceRequest\x1a\x15.google.chat.v1.Space\"\x1b\x82\xd3\xe4\x93\x02\x15\"\x10/v1/spaces:setup:\x01*\x12\x86\x01\n\x0bUpdateSpace\x12\".google.chat.v1.UpdateSpaceRequest\x1a\x15.google.chat.v1.Space\"<\xda\x41\x11space,update_mask\x82\xd3\xe4\x93\x02\"2\x19/v1/{space.name=spaces/*}:\x05space\x12m\n\x0b\x44\x65leteSpace\x12\".google.chat.v1.DeleteSpaceRequest\x1a\x16.google.protobuf.Empty\"\"\xda\x41\x04name\x82\xd3\xe4\x93\x02\x15*\x13/v1/{name=spaces/*}\x12\x9d\x01\n\x13\x43ompleteImportSpace\x12*.google.chat.v1.CompleteImportSpaceRequest\x1a+.google.chat.v1.CompleteImportSpaceResponse\"-\x82\xd3\xe4\x93\x02\'\"\"/v1/{name=spaces/*}:completeImport:\x01*\x12z\n\x11\x46indDirectMessage\x12(.google.chat.v1.FindDirectMessageRequest\x1a\x15.google.chat.v1.Space\"$\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/spaces:findDirectMessage\x12\x9e\x01\n\x10\x43reateMembership\x12\'.google.chat.v1.CreateMembershipRequest\x1a\x1a.google.chat.v1.Membership\"E\xda\x41\x11parent,membership\x82\xd3\xe4\x93\x02+\"\x1d/v1/{parent=spaces/*}/members:\nmembership\x12\xae\x01\n\x10UpdateMembership\x12\'.google.chat.v1.UpdateMembershipRequest\x1a\x1a.google.chat.v1.Membership\"U\xda\x41\x16membership,update_mask\x82\xd3\xe4\x93\x02\x36\x32(/v1/{membership.name=spaces/*/members/*}:\nmembership\x12\x85\x01\n\x10\x44\x65leteMembership\x12\'.google.chat.v1.DeleteMembershipRequest\x1a\x1a.google.chat.v1.Membership\",\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=spaces/*/members/*}\x12\xa1\x01\n\x0e\x43reateReaction\x12%.google.chat.v1.CreateReactionRequest\x1a\x18.google.chat.v1.Reaction\"N\xda\x41\x0fparent,reaction\x82\xd3\xe4\x93\x02\x36\"*/v1/{parent=spaces/*/messages/*}/reactions:\x08reaction\x12\x99\x01\n\rListReactions\x12$.google.chat.v1.ListReactionsRequest\x1a%.google.chat.v1.ListReactionsResponse\";\xda\x41\x06parent\x82\xd3\xe4\x93\x02,\x12*/v1/{parent=spaces/*/messages/*}/reactions\x12\x8a\x01\n\x0e\x44\x65leteReaction\x12%.google.chat.v1.DeleteReactionRequest\x1a\x16.google.protobuf.Empty\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,**/v1/{name=spaces/*/messages/*/reactions/*}\x12\x98\x01\n\x11GetSpaceReadState\x12(.google.chat.v1.GetSpaceReadStateRequest\x1a\x1e.google.chat.v1.SpaceReadState\"9\xda\x41\x04name\x82\xd3\xe4\x93\x02,\x12*/v1/{name=users/*/spaces/*/spaceReadState}\x12\xd9\x01\n\x14UpdateSpaceReadState\x12+.google.chat.v1.UpdateSpaceReadStateRequest\x1a\x1e.google.chat.v1.SpaceReadState\"t\xda\x41\x1cspace_read_state,update_mask\x82\xd3\xe4\x93\x02O2;/v1/{space_read_state.name=users/*/spaces/*/spaceReadState}:\x10space_read_state\x12\xa6\x01\n\x12GetThreadReadState\x12).google.chat.v1.GetThreadReadStateRequest\x1a\x1f.google.chat.v1.ThreadReadState\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=users/*/spaces/*/threads/*/threadReadState}\x12\x83\x01\n\rGetSpaceEvent\x12$.google.chat.v1.GetSpaceEventRequest\x1a\x1a.google.chat.v1.SpaceEvent\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v1/{name=spaces/*/spaceEvents/*}\x12\x9d\x01\n\x0fListSpaceEvents\x12&.google.chat.v1.ListSpaceEventsRequest\x1a\'.google.chat.v1.ListSpaceEventsResponse\"9\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=spaces/*}/spaceEvents\x1a\xa9\t\xca\x41\x13\x63hat.googleapis.com\xd2\x41\x8f\thttps://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonlyB\xa9\x01\n\x12\x63om.google.chat.v1B\x10\x43hatServiceProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool 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 852d0554b2e0..6940c0514823 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 @@ -169,6 +169,12 @@ class Service # [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) # method using Workspace administrator privileges instead. rpc :ListSpaces, ::Google::Apps::Chat::V1::ListSpacesRequest, ::Google::Apps::Chat::V1::ListSpacesResponse + # Returns a list of spaces in a Google Workspace organization based on an + # administrator's search. Requires [user + # authentication with administrator + # privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges). + # In the request, set `use_admin_access` to `true`. + rpc :SearchSpaces, ::Google::Apps::Chat::V1::SearchSpacesRequest, ::Google::Apps::Chat::V1::SearchSpacesResponse # Returns details about a space. For an example, see # [Get details about a # space](https://developers.google.com/workspace/chat/get-spaces). diff --git a/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb b/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb index 34c78a4f7627..0c6b6cf1c507 100644 --- a/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb +++ b/google-apps-chat-v1/lib/google/chat/v1/membership_pb.rb @@ -12,7 +12,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n\x1fgoogle/chat/v1/membership.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1agoogle/chat/v1/group.proto\x1a\x19google/chat/v1/user.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\nMembership\x12\x31\n\x04name\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12>\n\x05state\x18\x02 \x01(\x0e\x32*.google.chat.v1.Membership.MembershipStateB\x03\xe0\x41\x03\x12<\n\x04role\x18\x07 \x01(\x0e\x32).google.chat.v1.Membership.MembershipRoleB\x03\xe0\x41\x01\x12&\n\x06member\x18\x03 \x01(\x0b\x32\x14.google.chat.v1.UserH\x00\x12-\n\x0cgroup_member\x18\x05 \x01(\x0b\x32\x15.google.chat.v1.GroupH\x00\x12\x37\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\x12\x37\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\"^\n\x0fMembershipState\x12 \n\x1cMEMBERSHIP_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06JOINED\x10\x01\x12\x0b\n\x07INVITED\x10\x02\x12\x10\n\x0cNOT_A_MEMBER\x10\x03\"T\n\x0eMembershipRole\x12\x1f\n\x1bMEMBERSHIP_ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bROLE_MEMBER\x10\x01\x12\x10\n\x0cROLE_MANAGER\x10\x02:D\xea\x41\x41\n\x1e\x63hat.googleapis.com/Membership\x12\x1fspaces/{space}/members/{member}B\x0c\n\nmemberType\"\x86\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\"\x84\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\"\xcb\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\"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\"L\n\x14GetMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\"O\n\x17\x44\x65leteMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/MembershipB\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" +descriptor_data = "\n\x1fgoogle/chat/v1/membership.proto\x12\x0egoogle.chat.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1agoogle/chat/v1/group.proto\x1a\x19google/chat/v1/user.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\nMembership\x12\x31\n\x04name\x18\x01 \x01(\tB#\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12>\n\x05state\x18\x02 \x01(\x0e\x32*.google.chat.v1.Membership.MembershipStateB\x03\xe0\x41\x03\x12<\n\x04role\x18\x07 \x01(\x0e\x32).google.chat.v1.Membership.MembershipRoleB\x03\xe0\x41\x01\x12&\n\x06member\x18\x03 \x01(\x0b\x32\x14.google.chat.v1.UserH\x00\x12-\n\x0cgroup_member\x18\x05 \x01(\x0b\x32\x15.google.chat.v1.GroupH\x00\x12\x37\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\x12\x37\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\"^\n\x0fMembershipState\x12 \n\x1cMEMBERSHIP_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06JOINED\x10\x01\x12\x0b\n\x07INVITED\x10\x02\x12\x10\n\x0cNOT_A_MEMBER\x10\x03\"T\n\x0eMembershipRole\x12\x1f\n\x1bMEMBERSHIP_ROLE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bROLE_MEMBER\x10\x01\x12\x10\n\x0cROLE_MANAGER\x10\x02:D\xea\x41\x41\n\x1e\x63hat.googleapis.com/Membership\x12\x1fspaces/{space}/members/{member}B\x0c\n\nmemberType\"\xa0\x01\n\x17\x43reateMembershipRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63hat.googleapis.com/Membership\x12\x33\n\nmembership\x18\x02 \x01(\x0b\x32\x1a.google.chat.v1.MembershipB\x03\xe0\x41\x02\x12\x18\n\x10use_admin_access\x18\x05 \x01(\x08\"\x9e\x01\n\x17UpdateMembershipRequest\x12\x33\n\nmembership\x18\x01 \x01(\x0b\x32\x1a.google.chat.v1.MembershipB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x18\n\x10use_admin_access\x18\x03 \x01(\x08\"\xe5\x01\n\x16ListMembershipsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x63hat.googleapis.com/Membership\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bshow_groups\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0cshow_invited\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x10use_admin_access\x18\x08 \x01(\x08\"h\n\x17ListMembershipsResponse\x12\x34\n\x0bmemberships\x18\x01 \x03(\x0b\x32\x1a.google.chat.v1.MembershipB\x03\xe0\x41\x06\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"f\n\x14GetMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x18\n\x10use_admin_access\x18\x03 \x01(\x08\"i\n\x17\x44\x65leteMembershipRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63hat.googleapis.com/Membership\x12\x18\n\x10use_admin_access\x18\x02 \x01(\x08\x42\xa8\x01\n\x12\x63om.google.chat.v1B\x0fMembershipProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool 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 dbda1e089a5f..1d7a38273047 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\"\xba\t\n\x05Space\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1a.google.chat.v1.Space.TypeB\x05\x18\x01\xe0\x41\x03\x12\x33\n\nspace_type\x18\n \x01(\x0e\x32\x1f.google.chat.v1.Space.SpaceType\x12\x1f\n\x12single_user_bot_dm\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x17\n\x08threaded\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\"\n\x15\x65xternal_user_allowed\x18\x08 \x01(\x08\x42\x03\xe0\x41\x05\x12M\n\x15space_threading_state\x18\t \x01(\x0e\x32).google.chat.v1.Space.SpaceThreadingStateB\x03\xe0\x41\x03\x12\x39\n\rspace_details\x18\x0b \x01(\x0b\x32\".google.chat.v1.Space.SpaceDetails\x12\x39\n\x13space_history_state\x18\r \x01(\x0e\x32\x1c.google.chat.v1.HistoryState\x12\x18\n\x0bimport_mode\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n\x0b\x63reate_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\x12\x1c\n\x0f\x61\x64min_installed\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x42\n\x0f\x61\x63\x63\x65ss_settings\x18\x17 \x01(\x0b\x32$.google.chat.v1.Space.AccessSettingsB\x03\xe0\x41\x01\x12\x16\n\tspace_uri\x18\x19 \x01(\tB\x03\xe0\x41\x03\x1a\x37\n\x0cSpaceDetails\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x12\n\nguidelines\x18\x02 \x01(\t\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\".\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:.\xea\x41+\n\x19\x63hat.googleapis.com/Space\x12\x0espaces/{space}\"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\"B\n\x0fGetSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\"-\n\x18\x46indDirectMessageRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"p\n\x12UpdateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"E\n\x12\x44\x65leteSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\"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\"\x92\x0b\n\x05Space\x12\x0c\n\x04name\x18\x01 \x01(\t\x12/\n\x04type\x18\x02 \x01(\x0e\x32\x1a.google.chat.v1.Space.TypeB\x05\x18\x01\xe0\x41\x03\x12\x33\n\nspace_type\x18\n \x01(\x0e\x32\x1f.google.chat.v1.Space.SpaceType\x12\x1f\n\x12single_user_bot_dm\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x17\n\x08threaded\x18\x05 \x01(\x08\x42\x05\x18\x01\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\"\n\x15\x65xternal_user_allowed\x18\x08 \x01(\x08\x42\x03\xe0\x41\x05\x12M\n\x15space_threading_state\x18\t \x01(\x0e\x32).google.chat.v1.Space.SpaceThreadingStateB\x03\xe0\x41\x03\x12\x39\n\rspace_details\x18\x0b \x01(\x0b\x32\".google.chat.v1.Space.SpaceDetails\x12\x39\n\x13space_history_state\x18\r \x01(\x0e\x32\x1c.google.chat.v1.HistoryState\x12\x18\n\x0bimport_mode\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12\x37\n\x0b\x63reate_time\x18\x11 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\xe0\x41\x05\xe0\x41\x01\x12\x39\n\x10last_active_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0f\x61\x64min_installed\x18\x13 \x01(\x08\x42\x03\xe0\x41\x03\x12\x44\n\x10membership_count\x18\x14 \x01(\x0b\x32%.google.chat.v1.Space.MembershipCountB\x03\xe0\x41\x03\x12\x42\n\x0f\x61\x63\x63\x65ss_settings\x18\x17 \x01(\x0b\x32$.google.chat.v1.Space.AccessSettingsB\x03\xe0\x41\x01\x12\x16\n\tspace_uri\x18\x19 \x01(\tB\x03\xe0\x41\x03\x1a\x37\n\x0cSpaceDetails\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x12\n\nguidelines\x18\x02 \x01(\t\x1aU\n\x0fMembershipCount\x12&\n\x1ejoined_direct_human_user_count\x18\x04 \x01(\x05\x12\x1a\n\x12joined_group_count\x18\x05 \x01(\x05\x1a\xc0\x01\n\x0e\x41\x63\x63\x65ssSettings\x12K\n\x0c\x61\x63\x63\x65ss_state\x18\x01 \x01(\x0e\x32\x30.google.chat.v1.Space.AccessSettings.AccessStateB\x03\xe0\x41\x03\x12\x15\n\x08\x61udience\x18\x03 \x01(\tB\x03\xe0\x41\x01\"J\n\x0b\x41\x63\x63\x65ssState\x12\x1c\n\x18\x41\x43\x43\x45SS_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PRIVATE\x10\x01\x12\x10\n\x0c\x44ISCOVERABLE\x10\x02\".\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:.\xea\x41+\n\x19\x63hat.googleapis.com/Space\x12\x0espaces/{space}\"X\n\x12\x43reateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"Y\n\x11ListSpacesRequest\x12\x16\n\tpage_size\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x03 \x01(\tB\x03\xe0\x41\x01\"T\n\x12ListSpacesResponse\x12%\n\x06spaces\x18\x01 \x03(\x0b\x32\x15.google.chat.v1.Space\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\\\n\x0fGetSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x18\n\x10use_admin_access\x18\x02 \x01(\x08\"-\n\x18\x46indDirectMessageRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x8a\x01\n\x12UpdateSpaceRequest\x12)\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x18\n\x10use_admin_access\x18\x03 \x01(\x08\"\x81\x01\n\x13SearchSpacesRequest\x12\x18\n\x10use_admin_access\x18\x01 \x01(\x08\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x12\n\x05query\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"j\n\x14SearchSpacesResponse\x12%\n\x06spaces\x18\x01 \x03(\x0b\x32\x15.google.chat.v1.Space\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"_\n\x12\x44\x65leteSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\x12\x18\n\x10use_admin_access\x18\x02 \x01(\x08\"M\n\x1a\x43ompleteImportSpaceRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x63hat.googleapis.com/Space\"C\n\x1b\x43ompleteImportSpaceResponse\x12$\n\x05space\x18\x01 \x01(\x0b\x32\x15.google.chat.v1.SpaceB\xa3\x01\n\x12\x63om.google.chat.v1B\nSpaceProtoP\x01Z,cloud.google.com/go/chat/apiv1/chatpb;chatpb\xa2\x02\x0b\x44YNAPIProto\xaa\x02\x13Google.Apps.Chat.V1\xca\x02\x13Google\\Apps\\Chat\\V1\xea\x02\x16Google::Apps::Chat::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -45,6 +45,7 @@ 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::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.Space.Type").enummodule @@ -56,6 +57,8 @@ module V1 GetSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.GetSpaceRequest").msgclass FindDirectMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.FindDirectMessageRequest").msgclass UpdateSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.UpdateSpaceRequest").msgclass + SearchSpacesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SearchSpacesRequest").msgclass + SearchSpacesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.SearchSpacesResponse").msgclass DeleteSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.DeleteSpaceRequest").msgclass CompleteImportSpaceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CompleteImportSpaceRequest").msgclass CompleteImportSpaceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.chat.v1.CompleteImportSpaceResponse").msgclass diff --git a/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb b/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb index e6f875b786cd..d10e45931b4d 100644 --- a/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb +++ b/google-apps-chat-v1/proto_docs/google/chat/v1/membership.rb @@ -126,6 +126,21 @@ module MembershipRole # `users/user@example.com` or `users/123456789`. When a Chat app creates a # membership relation for itself, it must use the `chat.memberships.app` # scope, set `user.type` to `BOT`, and set `user.name` to `users/app`. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Creating app memberships or creating memberships for users outside the + # administrator's Google Workspace organization isn't supported using admin + # access. class CreateMembershipRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -144,6 +159,17 @@ class CreateMembershipRequest # Currently supported field paths: # # - `role` + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). class UpdateMembershipRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -186,8 +212,8 @@ class UpdateMembershipRequest # # To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`. # - # To filter by type, set `member.type` to `HUMAN` or `BOT`. Developer - # Preview: You can also filter for `member.type` using the `!=` operator. + # 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. @@ -233,6 +259,20 @@ class UpdateMembershipRequest # # Currently requires [user # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.memberships.readonly` or + # `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Listing app memberships in a space isn't supported when using admin access. class ListMembershipsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -267,6 +307,20 @@ class ListMembershipsResponse # you can use the user's email as an alias for `{member}`. For example, # `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the # email of the Google Chat user. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly` + # [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Getting app memberships in a space isn't supported when using admin access. class GetMembershipRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -289,6 +343,19 @@ class GetMembershipRequest # and `spaces/{space}/members/app` format. # # Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.memberships` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Deleting app memberships in a space isn't supported using admin access. class DeleteMembershipRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods 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 f8adea973efa..1ce7be207d68 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 @@ -102,6 +102,9 @@ module V1 # 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 @@ -110,6 +113,11 @@ module V1 # 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 @@ -139,6 +147,19 @@ class SpaceDetails extend ::Google::Protobuf::MessageExts::ClassMethods end + # Represents the count of memberships of a space, grouped into categories. + # @!attribute [rw] joined_direct_human_user_count + # @return [::Integer] + # Count of human users that have directly joined the space, not counting + # users joined by having membership in a joined group. + # @!attribute [rw] joined_group_count + # @return [::Integer] + # Count of all groups that have directly joined the space. + class MembershipCount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Represents the [access # setting](https://support.google.com/chat/answer/11971020) of the space. # @!attribute [r] access_state @@ -315,6 +336,17 @@ class ListSpacesResponse # Required. Resource name of the space, in the form `spaces/{space}`. # # Format: `spaces/{space}` + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 + # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). class GetSpaceRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -400,17 +432,193 @@ class FindDirectMessageRequest # `permission_settings.reply_messages` # (Warning: mutually exclusive with all other non-permission settings field # paths). `permission_settings` is not supported with admin access. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.spaces` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # Some `FieldMask` values are not supported using admin access. For details, + # see the description of `update_mask`. class UpdateSpaceRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request to search for a list of spaces based on a query. + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces` + # [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). + # + # This method currently only supports admin access, thus only `true` is + # accepted for this field. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of spaces to return. The service may return fewer than + # this value. + # + # If unspecified, at most 100 spaces are returned. + # + # The maximum value is 1000. If you use a value more than 1000, it's + # automatically changed to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A token, received from the previous search spaces call. Provide this + # parameter to retrieve the subsequent page. + # + # When paginating, all other parameters provided should match the call that + # provided the page token. Passing different values to the other parameters + # might lead to unexpected results. + # @!attribute [rw] query + # @return [::String] + # Required. A search query. + # + # You can search by using the following parameters: + # + # - `create_time` + # - `customer` + # - `display_name` + # - `external_user_allowed` + # - `last_active_time` + # - `space_history_state` + # - `space_type` + # + # `create_time` and `last_active_time` accept a timestamp in + # [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported + # comparison operators are: `=`, `<`, `>`, `<=`, `>=`. + # + # `customer` is required and is used to indicate which customer + # to fetch spaces from. `customers/my_customer` is the only supported value. + # + # `display_name` only accepts the `HAS` (`:`) operator. The text to + # match is first tokenized into tokens and each token is prefix-matched + # case-insensitively and independently as a substring anywhere in the space's + # `display_name`. For example, `Fun Eve` matches `Fun event` or `The + # evening was fun`, but not `notFun event` or `even`. + # + # `external_user_allowed` accepts either `true` or `false`. + # + # `space_history_state` only accepts values from the [`historyState`] + # (https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState) + # field of a `space` resource. + # + # `space_type` is required and the only valid value is `SPACE`. + # + # Across different fields, only `AND` operators are supported. A valid + # example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid + # example is `space_type = "SPACE" OR display_name:"Hello"`. + # + # Among the same field, + # `space_type` doesn't support `AND` or `OR` operators. + # `display_name`, 'space_history_state', and 'external_user_allowed' only + # support `OR` operators. + # `last_active_time` and `create_time` support both `AND` and `OR` operators. + # `AND` can only be used to represent an interval, such as `last_active_time + # < "2022-01-01T00:00:00+00:00" AND last_active_time > + # "2023-01-01T00:00:00+00:00"`. + # + # The following example queries are valid: + # + # ``` + # customer = "customers/my_customer" AND space_type = "SPACE" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # display_name:"Hello World" + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time > + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (display_name:"Hello World" OR display_name:"Fun event") AND + # (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time < + # "2022-01-01T00:00:00+00:00") + # + # customer = "customers/my_customer" AND space_type = "SPACE" AND + # (create_time > "2019-01-01T00:00:00+00:00" AND create_time < + # "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND + # (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Optional. How the list of spaces is ordered. + # + # Supported attributes to order by are: + # + # - `membership_count.joined_direct_human_user_count` — Denotes the count of + # human users that have directly joined a space. + # - `last_active_time` — Denotes the time when last eligible item is added to + # any topic of this space. + # - `create_time` — Denotes the time of the space creation. + # + # Valid ordering operation values are: + # + # - `ASC` for ascending. Default value. + # + # - `DESC` for descending. + # + # The supported syntax are: + # + # - `membership_count.joined_direct_human_user_count DESC` + # - `membership_count.joined_direct_human_user_count ASC` + # - `last_active_time DESC` + # - `last_active_time ASC` + # - `create_time DESC` + # - `create_time ASC` + class SearchSpacesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response with a list of spaces corresponding to the search spaces request. + # @!attribute [rw] spaces + # @return [::Array<::Google::Apps::Chat::V1::Space>] + # A page of the requested spaces. + # @!attribute [rw] next_page_token + # @return [::String] + # A token that can be used to retrieve the next page. If this field is empty, + # there are no subsequent pages. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of spaces that match the query, across all pages. If the + # result is over 10,000 spaces, this value is an estimate. + class SearchSpacesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request for deleting a space. # @!attribute [rw] name # @return [::String] # Required. Resource name of the space to delete. # # Format: `spaces/{space}` + # @!attribute [rw] use_admin_access + # @return [::Boolean] + # When `true`, the method runs using the user's Google Workspace + # administrator privileges. + # + # The calling user must be a Google Workspace administrator with the + # [manage chat and spaces conversations + # privilege](https://support.google.com/a/answer/13369245). + # + # Requires the `chat.admin.delete` [OAuth 2.0 + # scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). class DeleteSpaceRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-apps-chat-v1/snippets/chat_service/search_spaces.rb b/google-apps-chat-v1/snippets/chat_service/search_spaces.rb new file mode 100644 index 000000000000..4dba2d7a42ac --- /dev/null +++ b/google-apps-chat-v1/snippets/chat_service/search_spaces.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START chat_v1_generated_ChatService_SearchSpaces_sync] +require "google/apps/chat/v1" + +## +# Snippet for the search_spaces call in the ChatService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Apps::Chat::V1::ChatService::Client#search_spaces. +# +def search_spaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Apps::Chat::V1::ChatService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Apps::Chat::V1::SearchSpacesRequest.new + + # Call the search_spaces method. + result = client.search_spaces request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Apps::Chat::V1::Space. + p item + end +end +# [END chat_v1_generated_ChatService_SearchSpaces_sync] diff --git a/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json b/google-apps-chat-v1/snippets/snippet_metadata_google.chat.v1.json index 0a3a289539d8..87aa207c0560 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 @@ -411,6 +411,46 @@ } ] }, + { + "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", 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 f8ba7a0e1166..c950a5aba793 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 @@ -202,6 +202,7 @@ def test_list_memberships filter = "hello world" show_groups = true show_invited = true + use_admin_access = true list_memberships_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -217,27 +218,27 @@ def test_list_memberships 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 }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 @@ -256,6 +257,7 @@ def test_get_membership # Create request parameters for a unary method. name = "hello world" + use_admin_access = true get_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -271,27 +273,27 @@ def test_get_membership end # Use hash object - client.get_membership({ name: name }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 @@ -631,6 +633,64 @@ def test_list_spaces end end + def test_search_spaces + # Create test objects. + client_result = ::Google::Apps::Chat::V1::SearchSpacesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + use_admin_access = true + page_size = 42 + page_token = "hello world" + query = "hello world" + order_by = "hello world" + + search_spaces_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Apps::Chat::V1::ChatService::Rest::ServiceStub.stub :transcode_search_spaces_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_spaces_client_stub do + # Create client + client = ::Google::Apps::Chat::V1::ChatService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_spaces({ use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_spaces use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_spaces ::Google::Apps::Chat::V1::SearchSpacesRequest.new(use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_spaces({ use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_spaces(::Google::Apps::Chat::V1::SearchSpacesRequest.new(use_admin_access: use_admin_access, page_size: page_size, page_token: page_token, query: query, order_by: order_by), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_spaces_client_stub.call_count + end + end + end + def test_get_space # Create test objects. client_result = ::Google::Apps::Chat::V1::Space.new @@ -640,6 +700,7 @@ def test_get_space # Create request parameters for a unary method. name = "hello world" + use_admin_access = true get_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -655,27 +716,27 @@ def test_get_space end # Use hash object - client.get_space({ name: name }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 @@ -806,6 +867,7 @@ def test_update_space # Create request parameters for a unary method. space = {} update_mask = {} + use_admin_access = true update_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -821,27 +883,27 @@ def test_update_space end # Use hash object - client.update_space({ space: space, update_mask: update_mask }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 @@ -860,6 +922,7 @@ def test_delete_space # Create request parameters for a unary method. name = "hello world" + use_admin_access = true delete_space_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -875,27 +938,27 @@ def test_delete_space end # Use hash object - client.delete_space({ name: name }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 @@ -1023,6 +1086,7 @@ def test_create_membership # Create request parameters for a unary method. parent = "hello world" membership = {} + use_admin_access = true create_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -1038,27 +1102,27 @@ def test_create_membership end # Use hash object - client.create_membership({ parent: parent, membership: membership }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 @@ -1078,6 +1142,7 @@ def test_update_membership # Create request parameters for a unary method. membership = {} update_mask = {} + use_admin_access = true update_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -1093,27 +1158,27 @@ def test_update_membership end # Use hash object - client.update_membership({ membership: membership, update_mask: update_mask }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 @@ -1132,6 +1197,7 @@ def test_delete_membership # Create request parameters for a unary method. name = "hello world" + use_admin_access = true delete_membership_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| assert options.metadata.key? :"x-goog-api-client" @@ -1147,27 +1213,27 @@ def test_delete_membership end # Use hash object - client.delete_membership({ name: name }) do |_result, response| + 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 do |_result, response| + 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) do |_result, response| + 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 }, call_options) do |_result, response| + 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), call_options) do |_result, response| + 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 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 336a73c9d331..dbf0d0e4fa9e 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 @@ -210,6 +210,7 @@ def test_list_memberships 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 @@ -220,6 +221,7 @@ def test_list_memberships 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 @@ -230,35 +232,35 @@ def test_list_memberships 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 }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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 @@ -278,11 +280,13 @@ def test_get_membership # 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 @@ -293,31 +297,31 @@ def test_get_membership end # Use hash object - client.get_membership({ name: name }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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 @@ -692,6 +696,77 @@ def test_list_spaces 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 @@ -701,11 +776,13 @@ def test_get_space # 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 @@ -716,31 +793,31 @@ def test_get_space end # Use hash object - client.get_space({ name: name }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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 @@ -882,12 +959,14 @@ def test_update_space # 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 @@ -898,31 +977,31 @@ def test_update_space end # Use hash object - client.update_space({ space: space, update_mask: update_mask }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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 @@ -941,11 +1020,13 @@ def test_delete_space # 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 @@ -956,31 +1037,31 @@ def test_delete_space end # Use hash object - client.delete_space({ name: name }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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 @@ -1116,12 +1197,14 @@ def test_create_membership # 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 @@ -1132,31 +1215,31 @@ def test_create_membership end # Use hash object - client.create_membership({ parent: parent, membership: membership }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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 @@ -1176,12 +1259,14 @@ def test_update_membership # 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 @@ -1192,31 +1277,31 @@ def test_update_membership end # Use hash object - client.update_membership({ membership: membership, update_mask: update_mask }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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 @@ -1235,11 +1320,13 @@ def test_delete_membership # 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 @@ -1250,31 +1337,31 @@ def test_delete_membership end # Use hash object - client.delete_membership({ name: name }) do |response, operation| + 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 do |response, operation| + 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) do |response, operation| + 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 }, grpc_options) do |response, operation| + 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), grpc_options) do |response, operation| + 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