google-cloud-discovery_engine-v1 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -4
  3. data/README.md +4 -4
  4. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/client.rb +803 -0
  5. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/credentials.rb +47 -0
  6. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/operations.rb +813 -0
  7. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/paths.rb +135 -0
  8. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/client.rb +749 -0
  9. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/operations.rb +1148 -0
  10. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest/service_stub.rb +341 -0
  11. data/lib/google/cloud/discovery_engine/v1/cmek_config_service/rest.rb +53 -0
  12. data/lib/google/cloud/discovery_engine/v1/cmek_config_service.rb +56 -0
  13. data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +8 -0
  14. data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +53 -0
  15. data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +11 -1
  16. data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +104 -0
  17. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +11 -1
  18. data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +8 -0
  19. data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +8 -0
  20. data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +8 -0
  21. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/client.rb +1160 -0
  22. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/credentials.rb +47 -0
  23. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/operations.rb +813 -0
  24. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/paths.rb +154 -0
  25. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/client.rb +1085 -0
  26. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/operations.rb +1148 -0
  27. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest/service_stub.rb +511 -0
  28. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service/rest.rb +53 -0
  29. data/lib/google/cloud/discovery_engine/v1/identity_mapping_store_service.rb +56 -0
  30. data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +8 -0
  31. data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -1
  32. data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +8 -0
  33. data/lib/google/cloud/discovery_engine/v1/search_tuning_service/rest/operations.rb +8 -0
  34. data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +8 -0
  35. data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +8 -0
  36. data/lib/google/cloud/discovery_engine/v1/user_license_service/client.rb +630 -0
  37. data/lib/google/cloud/discovery_engine/v1/user_license_service/credentials.rb +47 -0
  38. data/lib/google/cloud/discovery_engine/v1/user_license_service/operations.rb +813 -0
  39. data/lib/google/cloud/discovery_engine/v1/user_license_service/paths.rb +71 -0
  40. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/client.rb +590 -0
  41. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/operations.rb +1148 -0
  42. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest/service_stub.rb +204 -0
  43. data/lib/google/cloud/discovery_engine/v1/user_license_service/rest.rb +53 -0
  44. data/lib/google/cloud/discovery_engine/v1/user_license_service.rb +56 -0
  45. data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
  46. data/lib/google/cloud/discovery_engine/v1.rb +5 -2
  47. data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +1 -1
  48. data/lib/google/cloud/discoveryengine/v1/chunk_pb.rb +4 -1
  49. data/lib/google/cloud/discoveryengine/v1/cmek_config_service_pb.rb +61 -0
  50. data/lib/google/cloud/discoveryengine/v1/cmek_config_service_services_pb.rb +55 -0
  51. data/lib/google/cloud/discoveryengine/v1/common_pb.rb +3 -1
  52. data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +1 -1
  53. data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +4 -1
  54. data/lib/google/cloud/discoveryengine/v1/data_store_service_pb.rb +1 -1
  55. data/lib/google/cloud/discoveryengine/v1/document_pb.rb +5 -1
  56. data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +1 -1
  57. data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +7 -1
  58. data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +1 -1
  59. data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +1 -1
  60. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_pb.rb +48 -0
  61. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_pb.rb +68 -0
  62. data/lib/google/cloud/discoveryengine/v1/identity_mapping_store_service_services_pb.rb +58 -0
  63. data/lib/google/cloud/discoveryengine/v1/search_service_pb.rb +1 -1
  64. data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
  65. data/lib/google/cloud/discoveryengine/v1/user_license_pb.rb +48 -0
  66. data/lib/google/cloud/discoveryengine/v1/user_license_service_pb.rb +61 -0
  67. data/lib/google/cloud/discoveryengine/v1/user_license_service_services_pb.rb +48 -0
  68. data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +17 -0
  69. data/proto_docs/google/cloud/discoveryengine/v1/chunk.rb +54 -0
  70. data/proto_docs/google/cloud/discoveryengine/v1/cmek_config_service.rb +222 -0
  71. data/proto_docs/google/cloud/discoveryengine/v1/common.rb +55 -0
  72. data/proto_docs/google/cloud/discoveryengine/v1/control.rb +1 -3
  73. data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +3 -0
  74. data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +43 -1
  75. data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +12 -0
  76. data/proto_docs/google/cloud/discoveryengine/v1/document.rb +99 -4
  77. data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +23 -0
  78. data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +141 -5
  79. data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +8 -0
  80. data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +9 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store.rb +81 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1/identity_mapping_store_service.rb +279 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +6 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +6 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1/user_license.rb +85 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1/user_license_service.rb +153 -0
  87. metadata +42 -2
@@ -0,0 +1,630 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/discoveryengine/v1/user_license_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1
27
+ module UserLicenseService
28
+ ##
29
+ # Client for the UserLicenseService service.
30
+ #
31
+ # Service for managing User Licenses.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :user_license_service_stub
44
+
45
+ ##
46
+ # Configure the UserLicenseService Client class.
47
+ #
48
+ # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all UserLicenseService clients
54
+ # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the UserLicenseService Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @user_license_service_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new UserLicenseService client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the UserLicenseService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/discoveryengine/v1/user_license_service_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+ @quota_project_id = @config.quota_project
151
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
152
+
153
+ @operations_client = Operations.new do |config|
154
+ config.credentials = credentials
155
+ config.quota_project = @quota_project_id
156
+ config.endpoint = @config.endpoint
157
+ config.universe_domain = @config.universe_domain
158
+ end
159
+
160
+ @user_license_service_stub = ::Gapic::ServiceStub.new(
161
+ ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Stub,
162
+ credentials: credentials,
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ channel_args: @config.channel_args,
167
+ interceptors: @config.interceptors,
168
+ channel_pool_config: @config.channel_pool,
169
+ logger: @config.logger
170
+ )
171
+
172
+ @user_license_service_stub.stub_logger&.info do |entry|
173
+ entry.set_system_name
174
+ entry.set_service
175
+ entry.message = "Created client for #{entry.service}"
176
+ entry.set_credentials_fields credentials
177
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
178
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
179
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
180
+ end
181
+
182
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
183
+ config.credentials = credentials
184
+ config.quota_project = @quota_project_id
185
+ config.endpoint = @user_license_service_stub.endpoint
186
+ config.universe_domain = @user_license_service_stub.universe_domain
187
+ config.logger = @user_license_service_stub.logger if config.respond_to? :logger=
188
+ end
189
+ end
190
+
191
+ ##
192
+ # Get the associated client for long-running operations.
193
+ #
194
+ # @return [::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Operations]
195
+ #
196
+ attr_reader :operations_client
197
+
198
+ ##
199
+ # Get the associated client for mix-in of the Locations.
200
+ #
201
+ # @return [Google::Cloud::Location::Locations::Client]
202
+ #
203
+ attr_reader :location_client
204
+
205
+ ##
206
+ # The logger used for request/response debug logging.
207
+ #
208
+ # @return [Logger]
209
+ #
210
+ def logger
211
+ @user_license_service_stub.logger
212
+ end
213
+
214
+ # Service calls
215
+
216
+ ##
217
+ # Lists the User Licenses.
218
+ #
219
+ # @overload list_user_licenses(request, options = nil)
220
+ # Pass arguments to `list_user_licenses` via a request object, either of type
221
+ # {::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest} or an equivalent Hash.
222
+ #
223
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest, ::Hash]
224
+ # A request object representing the call parameters. Required. To specify no
225
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
226
+ # @param options [::Gapic::CallOptions, ::Hash]
227
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
228
+ #
229
+ # @overload list_user_licenses(parent: nil, page_size: nil, page_token: nil, filter: nil)
230
+ # Pass arguments to `list_user_licenses` via keyword arguments. Note that at
231
+ # least one keyword argument is required. To specify no parameters, or to keep all
232
+ # the default parameter values, pass an empty Hash as a request object (see above).
233
+ #
234
+ # @param parent [::String]
235
+ # Required. The parent [UserStore][] resource name, format:
236
+ # `projects/{project}/locations/{location}/userStores/{user_store_id}`.
237
+ # @param page_size [::Integer]
238
+ # Optional. Requested page size. Server may return fewer items than
239
+ # requested. If unspecified, defaults to 10. The maximum value is 50; values
240
+ # above 50 will be coerced to 50.
241
+ #
242
+ # If this field is negative, an INVALID_ARGUMENT error is returned.
243
+ # @param page_token [::String]
244
+ # Optional. A page token, received from a previous `ListUserLicenses` call.
245
+ # Provide this to retrieve the subsequent page.
246
+ #
247
+ # When paginating, all other parameters provided to `ListUserLicenses`
248
+ # must match the call that provided the page token.
249
+ # @param filter [::String]
250
+ # Optional. Filter for the list request.
251
+ #
252
+ # Supported fields:
253
+ #
254
+ # * `license_assignment_state`
255
+ #
256
+ # Examples:
257
+ #
258
+ # * `license_assignment_state = ASSIGNED` to list assigned user licenses.
259
+ # * `license_assignment_state = NO_LICENSE` to list not licensed users.
260
+ # * `license_assignment_state = NO_LICENSE_ATTEMPTED_LOGIN` to list users
261
+ # who attempted login but no license assigned.
262
+ # * `license_assignment_state != NO_LICENSE_ATTEMPTED_LOGIN` to filter
263
+ # out users who attempted login but no license assigned.
264
+ #
265
+ # @yield [response, operation] Access the result along with the RPC operation
266
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>]
267
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
268
+ #
269
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::UserLicense>]
270
+ #
271
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
272
+ #
273
+ # @example Basic example
274
+ # require "google/cloud/discovery_engine/v1"
275
+ #
276
+ # # Create a client object. The client can be reused for multiple calls.
277
+ # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new
278
+ #
279
+ # # Create a request. To set request fields, pass in keyword arguments.
280
+ # request = Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest.new
281
+ #
282
+ # # Call the list_user_licenses method.
283
+ # result = client.list_user_licenses request
284
+ #
285
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
286
+ # # over elements, and API calls will be issued to fetch pages as needed.
287
+ # result.each do |item|
288
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::UserLicense.
289
+ # p item
290
+ # end
291
+ #
292
+ def list_user_licenses request, options = nil
293
+ raise ::ArgumentError, "request must be provided" if request.nil?
294
+
295
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListUserLicensesRequest
296
+
297
+ # Converts hash and nil to an options object
298
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
299
+
300
+ # Customize the options with defaults
301
+ metadata = @config.rpcs.list_user_licenses.metadata.to_h
302
+
303
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
304
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
305
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
306
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
307
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
308
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
309
+
310
+ header_params = {}
311
+ if request.parent
312
+ header_params["parent"] = request.parent
313
+ end
314
+
315
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
316
+ metadata[:"x-goog-request-params"] ||= request_params_header
317
+
318
+ options.apply_defaults timeout: @config.rpcs.list_user_licenses.timeout,
319
+ metadata: metadata,
320
+ retry_policy: @config.rpcs.list_user_licenses.retry_policy
321
+
322
+ options.apply_defaults timeout: @config.timeout,
323
+ metadata: @config.metadata,
324
+ retry_policy: @config.retry_policy
325
+
326
+ @user_license_service_stub.call_rpc :list_user_licenses, request, options: options do |response, operation|
327
+ response = ::Gapic::PagedEnumerable.new @user_license_service_stub, :list_user_licenses, request, response, operation, options
328
+ yield response, operation if block_given?
329
+ throw :response, response
330
+ end
331
+ rescue ::GRPC::BadStatus => e
332
+ raise ::Google::Cloud::Error.from_error(e)
333
+ end
334
+
335
+ ##
336
+ # Updates the User License.
337
+ # This method is used for batch assign/unassign licenses to users.
338
+ #
339
+ # @overload batch_update_user_licenses(request, options = nil)
340
+ # Pass arguments to `batch_update_user_licenses` via a request object, either of type
341
+ # {::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest} or an equivalent Hash.
342
+ #
343
+ # @param request [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest, ::Hash]
344
+ # A request object representing the call parameters. Required. To specify no
345
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
346
+ # @param options [::Gapic::CallOptions, ::Hash]
347
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
348
+ #
349
+ # @overload batch_update_user_licenses(inline_source: nil, parent: nil, delete_unassigned_user_licenses: nil)
350
+ # Pass arguments to `batch_update_user_licenses` via keyword arguments. Note that at
351
+ # least one keyword argument is required. To specify no parameters, or to keep all
352
+ # the default parameter values, pass an empty Hash as a request object (see above).
353
+ #
354
+ # @param inline_source [::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest::InlineSource, ::Hash]
355
+ # The inline source for the input content for document embeddings.
356
+ # @param parent [::String]
357
+ # Required. The parent [UserStore][] resource name, format:
358
+ # `projects/{project}/locations/{location}/userStores/{user_store_id}`.
359
+ # @param delete_unassigned_user_licenses [::Boolean]
360
+ # Optional. If true, if user licenses removed associated license config, the
361
+ # user license will be deleted. By default which is false, the user license
362
+ # will be updated to unassigned state.
363
+ #
364
+ # @yield [response, operation] Access the result along with the RPC operation
365
+ # @yieldparam response [::Gapic::Operation]
366
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
367
+ #
368
+ # @return [::Gapic::Operation]
369
+ #
370
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
371
+ #
372
+ # @example Basic example
373
+ # require "google/cloud/discovery_engine/v1"
374
+ #
375
+ # # Create a client object. The client can be reused for multiple calls.
376
+ # client = Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new
377
+ #
378
+ # # Create a request. To set request fields, pass in keyword arguments.
379
+ # request = Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest.new
380
+ #
381
+ # # Call the batch_update_user_licenses method.
382
+ # result = client.batch_update_user_licenses request
383
+ #
384
+ # # The returned object is of type Gapic::Operation. You can use it to
385
+ # # check the status of an operation, cancel it, or wait for results.
386
+ # # Here is how to wait for a response.
387
+ # result.wait_until_done! timeout: 60
388
+ # if result.response?
389
+ # p result.response
390
+ # else
391
+ # puts "No response received."
392
+ # end
393
+ #
394
+ def batch_update_user_licenses request, options = nil
395
+ raise ::ArgumentError, "request must be provided" if request.nil?
396
+
397
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::BatchUpdateUserLicensesRequest
398
+
399
+ # Converts hash and nil to an options object
400
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
401
+
402
+ # Customize the options with defaults
403
+ metadata = @config.rpcs.batch_update_user_licenses.metadata.to_h
404
+
405
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
406
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
407
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
408
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
409
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
410
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
411
+
412
+ header_params = {}
413
+ if request.parent
414
+ header_params["parent"] = request.parent
415
+ end
416
+
417
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
418
+ metadata[:"x-goog-request-params"] ||= request_params_header
419
+
420
+ options.apply_defaults timeout: @config.rpcs.batch_update_user_licenses.timeout,
421
+ metadata: metadata,
422
+ retry_policy: @config.rpcs.batch_update_user_licenses.retry_policy
423
+
424
+ options.apply_defaults timeout: @config.timeout,
425
+ metadata: @config.metadata,
426
+ retry_policy: @config.retry_policy
427
+
428
+ @user_license_service_stub.call_rpc :batch_update_user_licenses, request, options: options do |response, operation|
429
+ response = ::Gapic::Operation.new response, @operations_client, options: options
430
+ yield response, operation if block_given?
431
+ throw :response, response
432
+ end
433
+ rescue ::GRPC::BadStatus => e
434
+ raise ::Google::Cloud::Error.from_error(e)
435
+ end
436
+
437
+ ##
438
+ # Configuration class for the UserLicenseService API.
439
+ #
440
+ # This class represents the configuration for UserLicenseService,
441
+ # providing control over timeouts, retry behavior, logging, transport
442
+ # parameters, and other low-level controls. Certain parameters can also be
443
+ # applied individually to specific RPCs. See
444
+ # {::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client::Configuration::Rpcs}
445
+ # for a list of RPCs that can be configured independently.
446
+ #
447
+ # Configuration can be applied globally to all clients, or to a single client
448
+ # on construction.
449
+ #
450
+ # @example
451
+ #
452
+ # # Modify the global config, setting the timeout for
453
+ # # list_user_licenses to 20 seconds,
454
+ # # and all remaining timeouts to 10 seconds.
455
+ # ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.configure do |config|
456
+ # config.timeout = 10.0
457
+ # config.rpcs.list_user_licenses.timeout = 20.0
458
+ # end
459
+ #
460
+ # # Apply the above configuration only to a new client.
461
+ # client = ::Google::Cloud::DiscoveryEngine::V1::UserLicenseService::Client.new do |config|
462
+ # config.timeout = 10.0
463
+ # config.rpcs.list_user_licenses.timeout = 20.0
464
+ # end
465
+ #
466
+ # @!attribute [rw] endpoint
467
+ # A custom service endpoint, as a hostname or hostname:port. The default is
468
+ # nil, indicating to use the default endpoint in the current universe domain.
469
+ # @return [::String,nil]
470
+ # @!attribute [rw] credentials
471
+ # Credentials to send with calls. You may provide any of the following types:
472
+ # * (`String`) The path to a service account key file in JSON format
473
+ # * (`Hash`) A service account key as a Hash
474
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
475
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
476
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
477
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
478
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
479
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
480
+ # * (`nil`) indicating no credentials
481
+ #
482
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
483
+ # external source for authentication to Google Cloud, you must validate it before
484
+ # providing it to a Google API client library. Providing an unvalidated credential
485
+ # configuration to Google APIs can compromise the security of your systems and data.
486
+ # For more information, refer to [Validate credential configurations from external
487
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
488
+ # @return [::Object]
489
+ # @!attribute [rw] scope
490
+ # The OAuth scopes
491
+ # @return [::Array<::String>]
492
+ # @!attribute [rw] lib_name
493
+ # The library name as recorded in instrumentation and logging
494
+ # @return [::String]
495
+ # @!attribute [rw] lib_version
496
+ # The library version as recorded in instrumentation and logging
497
+ # @return [::String]
498
+ # @!attribute [rw] channel_args
499
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
500
+ # `GRPC::Core::Channel` object is provided as the credential.
501
+ # @return [::Hash]
502
+ # @!attribute [rw] interceptors
503
+ # An array of interceptors that are run before calls are executed.
504
+ # @return [::Array<::GRPC::ClientInterceptor>]
505
+ # @!attribute [rw] timeout
506
+ # The call timeout in seconds.
507
+ # @return [::Numeric]
508
+ # @!attribute [rw] metadata
509
+ # Additional gRPC headers to be sent with the call.
510
+ # @return [::Hash{::Symbol=>::String}]
511
+ # @!attribute [rw] retry_policy
512
+ # The retry policy. The value is a hash with the following keys:
513
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
514
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
515
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
516
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
517
+ # trigger a retry.
518
+ # @return [::Hash]
519
+ # @!attribute [rw] quota_project
520
+ # A separate project against which to charge quota.
521
+ # @return [::String]
522
+ # @!attribute [rw] universe_domain
523
+ # The universe domain within which to make requests. This determines the
524
+ # default endpoint URL. The default value of nil uses the environment
525
+ # universe (usually the default "googleapis.com" universe).
526
+ # @return [::String,nil]
527
+ # @!attribute [rw] logger
528
+ # A custom logger to use for request/response debug logging, or the value
529
+ # `:default` (the default) to construct a default logger, or `nil` to
530
+ # explicitly disable logging.
531
+ # @return [::Logger,:default,nil]
532
+ #
533
+ class Configuration
534
+ extend ::Gapic::Config
535
+
536
+ # @private
537
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
538
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
539
+
540
+ config_attr :endpoint, nil, ::String, nil
541
+ config_attr :credentials, nil do |value|
542
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
543
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
544
+ allowed.any? { |klass| klass === value }
545
+ end
546
+ config_attr :scope, nil, ::String, ::Array, nil
547
+ config_attr :lib_name, nil, ::String, nil
548
+ config_attr :lib_version, nil, ::String, nil
549
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
550
+ config_attr :interceptors, nil, ::Array, nil
551
+ config_attr :timeout, nil, ::Numeric, nil
552
+ config_attr :metadata, nil, ::Hash, nil
553
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
554
+ config_attr :quota_project, nil, ::String, nil
555
+ config_attr :universe_domain, nil, ::String, nil
556
+ config_attr :logger, :default, ::Logger, nil, :default
557
+
558
+ # @private
559
+ def initialize parent_config = nil
560
+ @parent_config = parent_config unless parent_config.nil?
561
+
562
+ yield self if block_given?
563
+ end
564
+
565
+ ##
566
+ # Configurations for individual RPCs
567
+ # @return [Rpcs]
568
+ #
569
+ def rpcs
570
+ @rpcs ||= begin
571
+ parent_rpcs = nil
572
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
573
+ Rpcs.new parent_rpcs
574
+ end
575
+ end
576
+
577
+ ##
578
+ # Configuration for the channel pool
579
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
580
+ #
581
+ def channel_pool
582
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
583
+ end
584
+
585
+ ##
586
+ # Configuration RPC class for the UserLicenseService API.
587
+ #
588
+ # Includes fields providing the configuration for each RPC in this service.
589
+ # Each configuration object is of type `Gapic::Config::Method` and includes
590
+ # the following configuration fields:
591
+ #
592
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
593
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
594
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
595
+ # include the following keys:
596
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
597
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
598
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
599
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
600
+ # trigger a retry.
601
+ #
602
+ class Rpcs
603
+ ##
604
+ # RPC-specific configuration for `list_user_licenses`
605
+ # @return [::Gapic::Config::Method]
606
+ #
607
+ attr_reader :list_user_licenses
608
+ ##
609
+ # RPC-specific configuration for `batch_update_user_licenses`
610
+ # @return [::Gapic::Config::Method]
611
+ #
612
+ attr_reader :batch_update_user_licenses
613
+
614
+ # @private
615
+ def initialize parent_rpcs = nil
616
+ list_user_licenses_config = parent_rpcs.list_user_licenses if parent_rpcs.respond_to? :list_user_licenses
617
+ @list_user_licenses = ::Gapic::Config::Method.new list_user_licenses_config
618
+ batch_update_user_licenses_config = parent_rpcs.batch_update_user_licenses if parent_rpcs.respond_to? :batch_update_user_licenses
619
+ @batch_update_user_licenses = ::Gapic::Config::Method.new batch_update_user_licenses_config
620
+
621
+ yield self if block_given?
622
+ end
623
+ end
624
+ end
625
+ end
626
+ end
627
+ end
628
+ end
629
+ end
630
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DiscoveryEngine
24
+ module V1
25
+ module UserLicenseService
26
+ # Credentials for the UserLicenseService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end