@@ -161,6 +161,11 @@ def self.configure
161161 initial_delay : 1.0 , max_delay : 10.0 , multiplier : 1.3 , retry_codes : [ 14 ]
162162 }
163163
164+ default_config . rpcs . find_group_chats . timeout = 30.0
165+ default_config . rpcs . find_group_chats . retry_policy = {
166+ initial_delay : 1.0 , max_delay : 10.0 , multiplier : 1.3 , retry_codes : [ 14 ]
167+ }
168+
164169 default_config . rpcs . create_membership . timeout = 30.0
165170 default_config . rpcs . create_membership . retry_policy = {
166171 initial_delay : 1.0 , max_delay : 10.0 , multiplier : 1.3 , retry_codes : [ 14 ]
@@ -3011,6 +3016,147 @@ def find_direct_message request, options = nil
30113016 raise ::Google ::Cloud ::Error . from_error ( e )
30123017 end
30133018
3019+ ##
3020+ # Returns all spaces with `spaceType == GROUP_CHAT`, whose
3021+ # human memberships contain exactly the calling user, and the users specified
3022+ # in `FindGroupChatsRequest.users`. Only members that have joined the
3023+ # conversation are supported. For an example, see [Find group
3024+ # chats](https://developers.google.com/workspace/chat/find-group-chats).
3025+ #
3026+ # If the calling user blocks, or is blocked by, some users, and no spaces
3027+ # with the entire specified set of users are found, this method returns
3028+ # spaces that don't include the blocked or blocking users.
3029+ #
3030+ # The specified set of users must contain only human (non-app) memberships.
3031+ # A request that contains non-human users doesn't return any spaces.
3032+ #
3033+ # Requires [user
3034+ # authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
3035+ # with one of the following [authorization
3036+ # scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
3037+ #
3038+ # - `https://www.googleapis.com/auth/chat.memberships.readonly`
3039+ # - `https://www.googleapis.com/auth/chat.memberships`
3040+ #
3041+ # @overload find_group_chats(request, options = nil)
3042+ # Pass arguments to `find_group_chats` via a request object, either of type
3043+ # {::Google::Apps::Chat::V1::FindGroupChatsRequest} or an equivalent Hash.
3044+ #
3045+ # @param request [::Google::Apps::Chat::V1::FindGroupChatsRequest, ::Hash]
3046+ # A request object representing the call parameters. Required. To specify no
3047+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3048+ # @param options [::Gapic::CallOptions, ::Hash]
3049+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3050+ #
3051+ # @overload find_group_chats(users: nil, page_size: nil, page_token: nil, space_view: nil)
3052+ # Pass arguments to `find_group_chats` via keyword arguments. Note that at
3053+ # least one keyword argument is required. To specify no parameters, or to keep all
3054+ # the default parameter values, pass an empty Hash as a request object (see above).
3055+ #
3056+ # @param users [::Array<::String>]
3057+ # Optional. Resource names of all human users in group chat with the calling
3058+ # user. Chat apps can't be included in the request.
3059+ #
3060+ # The maximum number of users that can be specified in a single request is
3061+ # `49`.
3062+ #
3063+ # Format: `users/{user}`, where `{user}` is either the `id` for the
3064+ # [person](https://developers.google.com/people/api/rest/v1/people) from the
3065+ # People API, or the `id` for the
3066+ # [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
3067+ # in the Directory API. For example, to find all group chats with the calling
3068+ # user and two other users, with People API profile IDs `123456789` and
3069+ # `987654321`, you can use `users/123456789` and `users/987654321`.
3070+ # You can also use the email as an alias for `{user}`. For example,
3071+ # `users/example@gmail.com` where `example@gmail.com` is the email of the
3072+ # Google Chat user.
3073+ # @param page_size [::Integer]
3074+ # Optional. The maximum number of spaces to return. The service might return
3075+ # fewer than this value.
3076+ #
3077+ # If unspecified, at most 10 spaces are returned.
3078+ #
3079+ # The maximum value is 30. If you use a value more than 30, it's
3080+ # automatically changed to 30.
3081+ #
3082+ # Negative values return an `INVALID_ARGUMENT` error.
3083+ # @param page_token [::String]
3084+ # Optional. A page token, received from a previous call to find group chats.
3085+ # Provide this parameter to retrieve the subsequent page.
3086+ #
3087+ # When paginating, all other parameters provided should match the call that
3088+ # provided the token. Passing different values may lead to unexpected
3089+ # results.
3090+ # @param space_view [::Google::Apps::Chat::V1::SpaceView]
3091+ # Requested space view type. If unset, defaults to
3092+ # `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify
3093+ # `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data,
3094+ # for example,
3095+ # https://www.googleapis.com/auth/chat.spaces or
3096+ # https://www.googleapis.com/auth/chat.spaces.readonly.
3097+ #
3098+ # @yield [response, operation] Access the result along with the RPC operation
3099+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>]
3100+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3101+ #
3102+ # @return [::Gapic::PagedEnumerable<::Google::Apps::Chat::V1::Space>]
3103+ #
3104+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3105+ #
3106+ # @example Basic example
3107+ # require "google/apps/chat/v1"
3108+ #
3109+ # # Create a client object. The client can be reused for multiple calls.
3110+ # client = Google::Apps::Chat::V1::ChatService::Client.new
3111+ #
3112+ # # Create a request. To set request fields, pass in keyword arguments.
3113+ # request = Google::Apps::Chat::V1::FindGroupChatsRequest.new
3114+ #
3115+ # # Call the find_group_chats method.
3116+ # result = client.find_group_chats request
3117+ #
3118+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3119+ # # over elements, and API calls will be issued to fetch pages as needed.
3120+ # result.each do |item|
3121+ # # Each element is of type ::Google::Apps::Chat::V1::Space.
3122+ # p item
3123+ # end
3124+ #
3125+ def find_group_chats request , options = nil
3126+ raise ::ArgumentError , "request must be provided" if request . nil?
3127+
3128+ request = ::Gapic ::Protobuf . coerce request , to : ::Google ::Apps ::Chat ::V1 ::FindGroupChatsRequest
3129+
3130+ # Converts hash and nil to an options object
3131+ options = ::Gapic ::CallOptions . new ( **options . to_h ) if options . respond_to? :to_h
3132+
3133+ # Customize the options with defaults
3134+ metadata = @config . rpcs . find_group_chats . metadata . to_h
3135+
3136+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3137+ metadata [ :"x-goog-api-client" ] ||= ::Gapic ::Headers . x_goog_api_client \
3138+ lib_name : @config . lib_name , lib_version : @config . lib_version ,
3139+ gapic_version : ::Google ::Apps ::Chat ::V1 ::VERSION
3140+ metadata [ :"x-goog-api-version" ] = API_VERSION unless API_VERSION . empty?
3141+ metadata [ :"x-goog-user-project" ] = @quota_project_id if @quota_project_id
3142+
3143+ options . apply_defaults timeout : @config . rpcs . find_group_chats . timeout ,
3144+ metadata : metadata ,
3145+ retry_policy : @config . rpcs . find_group_chats . retry_policy
3146+
3147+ options . apply_defaults timeout : @config . timeout ,
3148+ metadata : @config . metadata ,
3149+ retry_policy : @config . retry_policy
3150+
3151+ @chat_service_stub . call_rpc :find_group_chats , request , options : options do |response , operation |
3152+ response = ::Gapic ::PagedEnumerable . new @chat_service_stub , :find_group_chats , request , response , operation , options
3153+ yield response , operation if block_given?
3154+ throw :response , response
3155+ end
3156+ rescue ::GRPC ::BadStatus => e
3157+ raise ::Google ::Cloud ::Error . from_error ( e )
3158+ end
3159+
30143160 ##
30153161 # Creates a membership for the calling Chat app, a user, or a Google Group.
30163162 # Creating memberships for other Chat apps isn't supported.
@@ -6179,6 +6325,11 @@ class Rpcs
61796325 #
61806326 attr_reader :find_direct_message
61816327 ##
6328+ # RPC-specific configuration for `find_group_chats`
6329+ # @return [::Gapic::Config::Method]
6330+ #
6331+ attr_reader :find_group_chats
6332+ ##
61826333 # RPC-specific configuration for `create_membership`
61836334 # @return [::Gapic::Config::Method]
61846335 #
@@ -6337,6 +6488,8 @@ def initialize parent_rpcs = nil
63376488 @complete_import_space = ::Gapic ::Config ::Method . new complete_import_space_config
63386489 find_direct_message_config = parent_rpcs . find_direct_message if parent_rpcs . respond_to? :find_direct_message
63396490 @find_direct_message = ::Gapic ::Config ::Method . new find_direct_message_config
6491+ find_group_chats_config = parent_rpcs . find_group_chats if parent_rpcs . respond_to? :find_group_chats
6492+ @find_group_chats = ::Gapic ::Config ::Method . new find_group_chats_config
63406493 create_membership_config = parent_rpcs . create_membership if parent_rpcs . respond_to? :create_membership
63416494 @create_membership = ::Gapic ::Config ::Method . new create_membership_config
63426495 update_membership_config = parent_rpcs . update_membership if parent_rpcs . respond_to? :update_membership
0 commit comments