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