google-cloud-talent-v4 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/google/cloud/talent/v4/company_service/client.rb +15 -12
  4. data/lib/google/cloud/talent/v4/company_service/rest/client.rb +682 -0
  5. data/lib/google/cloud/talent/v4/company_service/rest/service_stub.rb +345 -0
  6. data/lib/google/cloud/talent/v4/company_service/rest.rb +52 -0
  7. data/lib/google/cloud/talent/v4/company_service.rb +7 -1
  8. data/lib/google/cloud/talent/v4/completion/client.rb +4 -2
  9. data/lib/google/cloud/talent/v4/completion/rest/client.rb +380 -0
  10. data/lib/google/cloud/talent/v4/completion/rest/service_stub.rb +107 -0
  11. data/lib/google/cloud/talent/v4/completion/rest.rb +52 -0
  12. data/lib/google/cloud/talent/v4/completion.rb +7 -1
  13. data/lib/google/cloud/talent/v4/event_service/client.rb +2 -2
  14. data/lib/google/cloud/talent/v4/event_service/rest/client.rb +358 -0
  15. data/lib/google/cloud/talent/v4/event_service/rest/service_stub.rb +108 -0
  16. data/lib/google/cloud/talent/v4/event_service/rest.rb +52 -0
  17. data/lib/google/cloud/talent/v4/event_service.rb +7 -1
  18. data/lib/google/cloud/talent/v4/job_service/client.rb +240 -163
  19. data/lib/google/cloud/talent/v4/job_service/operations.rb +12 -14
  20. data/lib/google/cloud/talent/v4/job_service/rest/client.rb +1685 -0
  21. data/lib/google/cloud/talent/v4/job_service/rest/operations.rb +793 -0
  22. data/lib/google/cloud/talent/v4/job_service/rest/service_stub.rb +645 -0
  23. data/lib/google/cloud/talent/v4/job_service/rest.rb +53 -0
  24. data/lib/google/cloud/talent/v4/job_service.rb +7 -1
  25. data/lib/google/cloud/talent/v4/job_service_services_pb.rb +12 -8
  26. data/lib/google/cloud/talent/v4/rest.rb +41 -0
  27. data/lib/google/cloud/talent/v4/tenant_service/client.rb +10 -9
  28. data/lib/google/cloud/talent/v4/tenant_service/rest/client.rb +670 -0
  29. data/lib/google/cloud/talent/v4/tenant_service/rest/service_stub.rb +345 -0
  30. data/lib/google/cloud/talent/v4/tenant_service/rest.rb +52 -0
  31. data/lib/google/cloud/talent/v4/tenant_service.rb +7 -1
  32. data/lib/google/cloud/talent/v4/version.rb +1 -1
  33. data/lib/google/cloud/talent/v4.rb +7 -2
  34. data/proto_docs/google/api/client.rb +318 -0
  35. data/proto_docs/google/api/launch_stage.rb +71 -0
  36. data/proto_docs/google/cloud/talent/v4/common.rb +116 -56
  37. data/proto_docs/google/cloud/talent/v4/company.rb +10 -5
  38. data/proto_docs/google/cloud/talent/v4/company_service.rb +11 -6
  39. data/proto_docs/google/cloud/talent/v4/completion_service.rb +21 -10
  40. data/proto_docs/google/cloud/talent/v4/event.rb +17 -9
  41. data/proto_docs/google/cloud/talent/v4/event_service.rb +2 -2
  42. data/proto_docs/google/cloud/talent/v4/filters.rb +55 -37
  43. data/proto_docs/google/cloud/talent/v4/histogram.rb +6 -2
  44. data/proto_docs/google/cloud/talent/v4/job.rb +83 -55
  45. data/proto_docs/google/cloud/talent/v4/job_service.rb +200 -118
  46. data/proto_docs/google/cloud/talent/v4/tenant.rb +2 -1
  47. data/proto_docs/google/cloud/talent/v4/tenant_service.rb +6 -3
  48. data/proto_docs/google/rpc/status.rb +4 -2
  49. metadata +28 -8
@@ -0,0 +1,670 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/talent/v4/tenant_service_pb"
21
+ require "google/cloud/talent/v4/tenant_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Talent
26
+ module V4
27
+ module TenantService
28
+ module Rest
29
+ ##
30
+ # REST client for the TenantService service.
31
+ #
32
+ # A service that handles tenant management, including CRUD and enumeration.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :tenant_service_stub
39
+
40
+ ##
41
+ # Configure the TenantService Client class.
42
+ #
43
+ # See {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all TenantService clients
49
+ # ::Google::Cloud::Talent::V4::TenantService::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "Talent", "V4"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.create_tenant.timeout = 30.0
70
+
71
+ default_config.rpcs.get_tenant.timeout = 30.0
72
+ default_config.rpcs.get_tenant.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
74
+ }
75
+
76
+ default_config.rpcs.update_tenant.timeout = 30.0
77
+
78
+ default_config.rpcs.delete_tenant.timeout = 30.0
79
+ default_config.rpcs.delete_tenant.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
81
+ }
82
+
83
+ default_config.rpcs.list_tenants.timeout = 30.0
84
+ default_config.rpcs.list_tenants.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config
89
+ end
90
+ yield @configure if block_given?
91
+ @configure
92
+ end
93
+
94
+ ##
95
+ # Configure the TenantService Client instance.
96
+ #
97
+ # The configuration is set to the derived mode, meaning that values can be changed,
98
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
99
+ # should be made on {Client.configure}.
100
+ #
101
+ # See {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration}
102
+ # for a description of the configuration fields.
103
+ #
104
+ # @yield [config] Configure the Client client.
105
+ # @yieldparam config [Client::Configuration]
106
+ #
107
+ # @return [Client::Configuration]
108
+ #
109
+ def configure
110
+ yield @config if block_given?
111
+ @config
112
+ end
113
+
114
+ ##
115
+ # Create a new TenantService REST client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the TenantService client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # Create the configuration object
132
+ @config = Configuration.new Client.configure
133
+
134
+ # Yield the configuration if needed
135
+ yield @config if block_given?
136
+
137
+ # Create credentials
138
+ credentials = @config.credentials
139
+ # Use self-signed JWT if the endpoint is unchanged from default,
140
+ # but only if the default endpoint does not have a region prefix.
141
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
142
+ !@config.endpoint.split(".").first.include?("-")
143
+ credentials ||= Credentials.default scope: @config.scope,
144
+ enable_self_signed_jwt: enable_self_signed_jwt
145
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
146
+ credentials = Credentials.new credentials, scope: @config.scope
147
+ end
148
+
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @tenant_service_stub = ::Google::Cloud::Talent::V4::TenantService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
153
+ end
154
+
155
+ # Service calls
156
+
157
+ ##
158
+ # Creates a new tenant entity.
159
+ #
160
+ # @overload create_tenant(request, options = nil)
161
+ # Pass arguments to `create_tenant` via a request object, either of type
162
+ # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash.
163
+ #
164
+ # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash]
165
+ # A request object representing the call parameters. Required. To specify no
166
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
167
+ # @param options [::Gapic::CallOptions, ::Hash]
168
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
169
+ #
170
+ # @overload create_tenant(parent: nil, tenant: nil)
171
+ # Pass arguments to `create_tenant` via keyword arguments. Note that at
172
+ # least one keyword argument is required. To specify no parameters, or to keep all
173
+ # the default parameter values, pass an empty Hash as a request object (see above).
174
+ #
175
+ # @param parent [::String]
176
+ # Required. Resource name of the project under which the tenant is created.
177
+ #
178
+ # The format is "projects/\\{project_id}", for example,
179
+ # "projects/foo".
180
+ # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash]
181
+ # Required. The tenant to be created.
182
+ # @yield [result, operation] Access the result along with the TransportOperation object
183
+ # @yieldparam result [::Google::Cloud::Talent::V4::Tenant]
184
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
185
+ #
186
+ # @return [::Google::Cloud::Talent::V4::Tenant]
187
+ #
188
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
189
+ def create_tenant request, options = nil
190
+ raise ::ArgumentError, "request must be provided" if request.nil?
191
+
192
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest
193
+
194
+ # Converts hash and nil to an options object
195
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
196
+
197
+ # Customize the options with defaults
198
+ call_metadata = @config.rpcs.create_tenant.metadata.to_h
199
+
200
+ # Set x-goog-api-client and x-goog-user-project headers
201
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
203
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
204
+ transports_version_send: [:rest]
205
+
206
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
207
+
208
+ options.apply_defaults timeout: @config.rpcs.create_tenant.timeout,
209
+ metadata: call_metadata,
210
+ retry_policy: @config.rpcs.create_tenant.retry_policy
211
+
212
+ options.apply_defaults timeout: @config.timeout,
213
+ metadata: @config.metadata,
214
+ retry_policy: @config.retry_policy
215
+
216
+ @tenant_service_stub.create_tenant request, options do |result, operation|
217
+ yield result, operation if block_given?
218
+ return result
219
+ end
220
+ rescue ::Gapic::Rest::Error => e
221
+ raise ::Google::Cloud::Error.from_error(e)
222
+ end
223
+
224
+ ##
225
+ # Retrieves specified tenant.
226
+ #
227
+ # @overload get_tenant(request, options = nil)
228
+ # Pass arguments to `get_tenant` via a request object, either of type
229
+ # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash.
230
+ #
231
+ # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash]
232
+ # A request object representing the call parameters. Required. To specify no
233
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
234
+ # @param options [::Gapic::CallOptions, ::Hash]
235
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
236
+ #
237
+ # @overload get_tenant(name: nil)
238
+ # Pass arguments to `get_tenant` via keyword arguments. Note that at
239
+ # least one keyword argument is required. To specify no parameters, or to keep all
240
+ # the default parameter values, pass an empty Hash as a request object (see above).
241
+ #
242
+ # @param name [::String]
243
+ # Required. The resource name of the tenant to be retrieved.
244
+ #
245
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
246
+ # "projects/foo/tenants/bar".
247
+ # @yield [result, operation] Access the result along with the TransportOperation object
248
+ # @yieldparam result [::Google::Cloud::Talent::V4::Tenant]
249
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
250
+ #
251
+ # @return [::Google::Cloud::Talent::V4::Tenant]
252
+ #
253
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
254
+ def get_tenant request, options = nil
255
+ raise ::ArgumentError, "request must be provided" if request.nil?
256
+
257
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest
258
+
259
+ # Converts hash and nil to an options object
260
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
261
+
262
+ # Customize the options with defaults
263
+ call_metadata = @config.rpcs.get_tenant.metadata.to_h
264
+
265
+ # Set x-goog-api-client and x-goog-user-project headers
266
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
267
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
268
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
269
+ transports_version_send: [:rest]
270
+
271
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
272
+
273
+ options.apply_defaults timeout: @config.rpcs.get_tenant.timeout,
274
+ metadata: call_metadata,
275
+ retry_policy: @config.rpcs.get_tenant.retry_policy
276
+
277
+ options.apply_defaults timeout: @config.timeout,
278
+ metadata: @config.metadata,
279
+ retry_policy: @config.retry_policy
280
+
281
+ @tenant_service_stub.get_tenant request, options do |result, operation|
282
+ yield result, operation if block_given?
283
+ return result
284
+ end
285
+ rescue ::Gapic::Rest::Error => e
286
+ raise ::Google::Cloud::Error.from_error(e)
287
+ end
288
+
289
+ ##
290
+ # Updates specified tenant.
291
+ #
292
+ # @overload update_tenant(request, options = nil)
293
+ # Pass arguments to `update_tenant` via a request object, either of type
294
+ # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash.
295
+ #
296
+ # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash]
297
+ # A request object representing the call parameters. Required. To specify no
298
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
299
+ # @param options [::Gapic::CallOptions, ::Hash]
300
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
301
+ #
302
+ # @overload update_tenant(tenant: nil, update_mask: nil)
303
+ # Pass arguments to `update_tenant` via keyword arguments. Note that at
304
+ # least one keyword argument is required. To specify no parameters, or to keep all
305
+ # the default parameter values, pass an empty Hash as a request object (see above).
306
+ #
307
+ # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash]
308
+ # Required. The tenant resource to replace the current resource in the
309
+ # system.
310
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
311
+ # Strongly recommended for the best service experience.
312
+ #
313
+ # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is
314
+ # provided, only the specified fields in
315
+ # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated.
316
+ # Otherwise all the fields are updated.
317
+ #
318
+ # A field mask to specify the tenant fields to be updated. Only
319
+ # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported.
320
+ # @yield [result, operation] Access the result along with the TransportOperation object
321
+ # @yieldparam result [::Google::Cloud::Talent::V4::Tenant]
322
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
323
+ #
324
+ # @return [::Google::Cloud::Talent::V4::Tenant]
325
+ #
326
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
327
+ def update_tenant request, options = nil
328
+ raise ::ArgumentError, "request must be provided" if request.nil?
329
+
330
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest
331
+
332
+ # Converts hash and nil to an options object
333
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
334
+
335
+ # Customize the options with defaults
336
+ call_metadata = @config.rpcs.update_tenant.metadata.to_h
337
+
338
+ # Set x-goog-api-client and x-goog-user-project headers
339
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
340
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
341
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
342
+ transports_version_send: [:rest]
343
+
344
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
345
+
346
+ options.apply_defaults timeout: @config.rpcs.update_tenant.timeout,
347
+ metadata: call_metadata,
348
+ retry_policy: @config.rpcs.update_tenant.retry_policy
349
+
350
+ options.apply_defaults timeout: @config.timeout,
351
+ metadata: @config.metadata,
352
+ retry_policy: @config.retry_policy
353
+
354
+ @tenant_service_stub.update_tenant request, options do |result, operation|
355
+ yield result, operation if block_given?
356
+ return result
357
+ end
358
+ rescue ::Gapic::Rest::Error => e
359
+ raise ::Google::Cloud::Error.from_error(e)
360
+ end
361
+
362
+ ##
363
+ # Deletes specified tenant.
364
+ #
365
+ # @overload delete_tenant(request, options = nil)
366
+ # Pass arguments to `delete_tenant` via a request object, either of type
367
+ # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash.
368
+ #
369
+ # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash]
370
+ # A request object representing the call parameters. Required. To specify no
371
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
372
+ # @param options [::Gapic::CallOptions, ::Hash]
373
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
374
+ #
375
+ # @overload delete_tenant(name: nil)
376
+ # Pass arguments to `delete_tenant` via keyword arguments. Note that at
377
+ # least one keyword argument is required. To specify no parameters, or to keep all
378
+ # the default parameter values, pass an empty Hash as a request object (see above).
379
+ #
380
+ # @param name [::String]
381
+ # Required. The resource name of the tenant to be deleted.
382
+ #
383
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
384
+ # "projects/foo/tenants/bar".
385
+ # @yield [result, operation] Access the result along with the TransportOperation object
386
+ # @yieldparam result [::Google::Protobuf::Empty]
387
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
388
+ #
389
+ # @return [::Google::Protobuf::Empty]
390
+ #
391
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
392
+ def delete_tenant request, options = nil
393
+ raise ::ArgumentError, "request must be provided" if request.nil?
394
+
395
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest
396
+
397
+ # Converts hash and nil to an options object
398
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
399
+
400
+ # Customize the options with defaults
401
+ call_metadata = @config.rpcs.delete_tenant.metadata.to_h
402
+
403
+ # Set x-goog-api-client and x-goog-user-project headers
404
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
405
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
406
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
407
+ transports_version_send: [:rest]
408
+
409
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
410
+
411
+ options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout,
412
+ metadata: call_metadata,
413
+ retry_policy: @config.rpcs.delete_tenant.retry_policy
414
+
415
+ options.apply_defaults timeout: @config.timeout,
416
+ metadata: @config.metadata,
417
+ retry_policy: @config.retry_policy
418
+
419
+ @tenant_service_stub.delete_tenant request, options do |result, operation|
420
+ yield result, operation if block_given?
421
+ return result
422
+ end
423
+ rescue ::Gapic::Rest::Error => e
424
+ raise ::Google::Cloud::Error.from_error(e)
425
+ end
426
+
427
+ ##
428
+ # Lists all tenants associated with the project.
429
+ #
430
+ # @overload list_tenants(request, options = nil)
431
+ # Pass arguments to `list_tenants` via a request object, either of type
432
+ # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash.
433
+ #
434
+ # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash]
435
+ # A request object representing the call parameters. Required. To specify no
436
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
437
+ # @param options [::Gapic::CallOptions, ::Hash]
438
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
439
+ #
440
+ # @overload list_tenants(parent: nil, page_token: nil, page_size: nil)
441
+ # Pass arguments to `list_tenants` via keyword arguments. Note that at
442
+ # least one keyword argument is required. To specify no parameters, or to keep all
443
+ # the default parameter values, pass an empty Hash as a request object (see above).
444
+ #
445
+ # @param parent [::String]
446
+ # Required. Resource name of the project under which the tenant is created.
447
+ #
448
+ # The format is "projects/\\{project_id}", for example,
449
+ # "projects/foo".
450
+ # @param page_token [::String]
451
+ # The starting indicator from which to return results.
452
+ # @param page_size [::Integer]
453
+ # The maximum number of tenants to be returned, at most 100.
454
+ # Default is 100 if a non-positive number is provided.
455
+ # @yield [result, operation] Access the result along with the TransportOperation object
456
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>]
457
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
458
+ #
459
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>]
460
+ #
461
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
462
+ def list_tenants request, options = nil
463
+ raise ::ArgumentError, "request must be provided" if request.nil?
464
+
465
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest
466
+
467
+ # Converts hash and nil to an options object
468
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
469
+
470
+ # Customize the options with defaults
471
+ call_metadata = @config.rpcs.list_tenants.metadata.to_h
472
+
473
+ # Set x-goog-api-client and x-goog-user-project headers
474
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
475
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
476
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
477
+ transports_version_send: [:rest]
478
+
479
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
480
+
481
+ options.apply_defaults timeout: @config.rpcs.list_tenants.timeout,
482
+ metadata: call_metadata,
483
+ retry_policy: @config.rpcs.list_tenants.retry_policy
484
+
485
+ options.apply_defaults timeout: @config.timeout,
486
+ metadata: @config.metadata,
487
+ retry_policy: @config.retry_policy
488
+
489
+ @tenant_service_stub.list_tenants request, options do |result, operation|
490
+ result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options
491
+ yield result, operation if block_given?
492
+ return result
493
+ end
494
+ rescue ::Gapic::Rest::Error => e
495
+ raise ::Google::Cloud::Error.from_error(e)
496
+ end
497
+
498
+ ##
499
+ # Configuration class for the TenantService REST API.
500
+ #
501
+ # This class represents the configuration for TenantService REST,
502
+ # providing control over timeouts, retry behavior, logging, transport
503
+ # parameters, and other low-level controls. Certain parameters can also be
504
+ # applied individually to specific RPCs. See
505
+ # {::Google::Cloud::Talent::V4::TenantService::Rest::Client::Configuration::Rpcs}
506
+ # for a list of RPCs that can be configured independently.
507
+ #
508
+ # Configuration can be applied globally to all clients, or to a single client
509
+ # on construction.
510
+ #
511
+ # @example
512
+ #
513
+ # # Modify the global config, setting the timeout for
514
+ # # create_tenant to 20 seconds,
515
+ # # and all remaining timeouts to 10 seconds.
516
+ # ::Google::Cloud::Talent::V4::TenantService::Rest::Client.configure do |config|
517
+ # config.timeout = 10.0
518
+ # config.rpcs.create_tenant.timeout = 20.0
519
+ # end
520
+ #
521
+ # # Apply the above configuration only to a new client.
522
+ # client = ::Google::Cloud::Talent::V4::TenantService::Rest::Client.new do |config|
523
+ # config.timeout = 10.0
524
+ # config.rpcs.create_tenant.timeout = 20.0
525
+ # end
526
+ #
527
+ # @!attribute [rw] endpoint
528
+ # The hostname or hostname:port of the service endpoint.
529
+ # Defaults to `"jobs.googleapis.com"`.
530
+ # @return [::String]
531
+ # @!attribute [rw] credentials
532
+ # Credentials to send with calls. You may provide any of the following types:
533
+ # * (`String`) The path to a service account key file in JSON format
534
+ # * (`Hash`) A service account key as a Hash
535
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
536
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
537
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
538
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
539
+ # * (`nil`) indicating no credentials
540
+ # @return [::Object]
541
+ # @!attribute [rw] scope
542
+ # The OAuth scopes
543
+ # @return [::Array<::String>]
544
+ # @!attribute [rw] lib_name
545
+ # The library name as recorded in instrumentation and logging
546
+ # @return [::String]
547
+ # @!attribute [rw] lib_version
548
+ # The library version as recorded in instrumentation and logging
549
+ # @return [::String]
550
+ # @!attribute [rw] timeout
551
+ # The call timeout in seconds.
552
+ # @return [::Numeric]
553
+ # @!attribute [rw] metadata
554
+ # Additional headers to be sent with the call.
555
+ # @return [::Hash{::Symbol=>::String}]
556
+ # @!attribute [rw] retry_policy
557
+ # The retry policy. The value is a hash with the following keys:
558
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
559
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
560
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
561
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
562
+ # trigger a retry.
563
+ # @return [::Hash]
564
+ # @!attribute [rw] quota_project
565
+ # A separate project against which to charge quota.
566
+ # @return [::String]
567
+ #
568
+ class Configuration
569
+ extend ::Gapic::Config
570
+
571
+ config_attr :endpoint, "jobs.googleapis.com", ::String
572
+ config_attr :credentials, nil do |value|
573
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
574
+ allowed.any? { |klass| klass === value }
575
+ end
576
+ config_attr :scope, nil, ::String, ::Array, nil
577
+ config_attr :lib_name, nil, ::String, nil
578
+ config_attr :lib_version, nil, ::String, nil
579
+ config_attr :timeout, nil, ::Numeric, nil
580
+ config_attr :metadata, nil, ::Hash, nil
581
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
582
+ config_attr :quota_project, nil, ::String, nil
583
+
584
+ # @private
585
+ def initialize parent_config = nil
586
+ @parent_config = parent_config unless parent_config.nil?
587
+
588
+ yield self if block_given?
589
+ end
590
+
591
+ ##
592
+ # Configurations for individual RPCs
593
+ # @return [Rpcs]
594
+ #
595
+ def rpcs
596
+ @rpcs ||= begin
597
+ parent_rpcs = nil
598
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
599
+ Rpcs.new parent_rpcs
600
+ end
601
+ end
602
+
603
+ ##
604
+ # Configuration RPC class for the TenantService API.
605
+ #
606
+ # Includes fields providing the configuration for each RPC in this service.
607
+ # Each configuration object is of type `Gapic::Config::Method` and includes
608
+ # the following configuration fields:
609
+ #
610
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
611
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
612
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
613
+ # include the following keys:
614
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
615
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
616
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
617
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
618
+ # trigger a retry.
619
+ #
620
+ class Rpcs
621
+ ##
622
+ # RPC-specific configuration for `create_tenant`
623
+ # @return [::Gapic::Config::Method]
624
+ #
625
+ attr_reader :create_tenant
626
+ ##
627
+ # RPC-specific configuration for `get_tenant`
628
+ # @return [::Gapic::Config::Method]
629
+ #
630
+ attr_reader :get_tenant
631
+ ##
632
+ # RPC-specific configuration for `update_tenant`
633
+ # @return [::Gapic::Config::Method]
634
+ #
635
+ attr_reader :update_tenant
636
+ ##
637
+ # RPC-specific configuration for `delete_tenant`
638
+ # @return [::Gapic::Config::Method]
639
+ #
640
+ attr_reader :delete_tenant
641
+ ##
642
+ # RPC-specific configuration for `list_tenants`
643
+ # @return [::Gapic::Config::Method]
644
+ #
645
+ attr_reader :list_tenants
646
+
647
+ # @private
648
+ def initialize parent_rpcs = nil
649
+ create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant
650
+ @create_tenant = ::Gapic::Config::Method.new create_tenant_config
651
+ get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant
652
+ @get_tenant = ::Gapic::Config::Method.new get_tenant_config
653
+ update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant
654
+ @update_tenant = ::Gapic::Config::Method.new update_tenant_config
655
+ delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant
656
+ @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config
657
+ list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants
658
+ @list_tenants = ::Gapic::Config::Method.new list_tenants_config
659
+
660
+ yield self if block_given?
661
+ end
662
+ end
663
+ end
664
+ end
665
+ end
666
+ end
667
+ end
668
+ end
669
+ end
670
+ end