google-cloud-talent-v4beta1 0.6.1 → 0.7.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/v4beta1/company_service/client.rb +16 -12
  4. data/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +693 -0
  5. data/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +382 -0
  6. data/lib/google/cloud/talent/v4beta1/company_service/rest.rb +52 -0
  7. data/lib/google/cloud/talent/v4beta1/company_service.rb +7 -1
  8. data/lib/google/cloud/talent/v4beta1/completion/client.rb +4 -2
  9. data/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +386 -0
  10. data/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +114 -0
  11. data/lib/google/cloud/talent/v4beta1/completion/rest.rb +52 -0
  12. data/lib/google/cloud/talent/v4beta1/completion.rb +7 -1
  13. data/lib/google/cloud/talent/v4beta1/event_service/client.rb +2 -2
  14. data/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +359 -0
  15. data/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +116 -0
  16. data/lib/google/cloud/talent/v4beta1/event_service/rest.rb +52 -0
  17. data/lib/google/cloud/talent/v4beta1/event_service.rb +7 -1
  18. data/lib/google/cloud/talent/v4beta1/job_service/client.rb +248 -159
  19. data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +12 -14
  20. data/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +1712 -0
  21. data/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +793 -0
  22. data/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +721 -0
  23. data/lib/google/cloud/talent/v4beta1/job_service/rest.rb +53 -0
  24. data/lib/google/cloud/talent/v4beta1/job_service.rb +7 -1
  25. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +12 -8
  26. data/lib/google/cloud/talent/v4beta1/rest.rb +41 -0
  27. data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +13 -10
  28. data/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +672 -0
  29. data/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +345 -0
  30. data/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb +52 -0
  31. data/lib/google/cloud/talent/v4beta1/tenant_service.rb +7 -1
  32. data/lib/google/cloud/talent/v4beta1/version.rb +1 -1
  33. data/lib/google/cloud/talent/v4beta1.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/v4beta1/common.rb +117 -56
  37. data/proto_docs/google/cloud/talent/v4beta1/company.rb +10 -5
  38. data/proto_docs/google/cloud/talent/v4beta1/company_service.rb +12 -6
  39. data/proto_docs/google/cloud/talent/v4beta1/completion_service.rb +21 -10
  40. data/proto_docs/google/cloud/talent/v4beta1/event.rb +20 -10
  41. data/proto_docs/google/cloud/talent/v4beta1/event_service.rb +2 -2
  42. data/proto_docs/google/cloud/talent/v4beta1/filters.rb +62 -38
  43. data/proto_docs/google/cloud/talent/v4beta1/histogram.rb +8 -3
  44. data/proto_docs/google/cloud/talent/v4beta1/job.rb +86 -54
  45. data/proto_docs/google/cloud/talent/v4beta1/job_service.rb +211 -120
  46. data/proto_docs/google/cloud/talent/v4beta1/tenant.rb +9 -5
  47. data/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb +9 -4
  48. data/proto_docs/google/rpc/status.rb +4 -2
  49. metadata +28 -8
@@ -0,0 +1,672 @@
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/v4beta1/tenant_service_pb"
21
+ require "google/cloud/talent/v4beta1/tenant_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Talent
26
+ module V4beta1
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::V4beta1::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::V4beta1::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", "V4beta1"]
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::V4beta1::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::V4beta1::TenantService::Rest::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::Talent::V4beta1::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::V4beta1::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::V4beta1::CreateTenantRequest} or an equivalent Hash.
163
+ #
164
+ # @param request [::Google::Cloud::Talent::V4beta1::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::V4beta1::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::V4beta1::Tenant]
184
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
185
+ #
186
+ # @return [::Google::Cloud::Talent::V4beta1::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::V4beta1::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::V4beta1::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::V4beta1::GetTenantRequest} or an equivalent Hash.
230
+ #
231
+ # @param request [::Google::Cloud::Talent::V4beta1::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::V4beta1::Tenant]
249
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
250
+ #
251
+ # @return [::Google::Cloud::Talent::V4beta1::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::V4beta1::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::V4beta1::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::V4beta1::UpdateTenantRequest} or an equivalent Hash.
295
+ #
296
+ # @param request [::Google::Cloud::Talent::V4beta1::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::V4beta1::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
314
+ # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask}
315
+ # is provided, only the specified fields in
316
+ # {::Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are
317
+ # updated. Otherwise all the fields are updated.
318
+ #
319
+ # A field mask to specify the tenant fields to be updated. Only
320
+ # top level fields of {::Google::Cloud::Talent::V4beta1::Tenant Tenant} are
321
+ # supported.
322
+ # @yield [result, operation] Access the result along with the TransportOperation object
323
+ # @yieldparam result [::Google::Cloud::Talent::V4beta1::Tenant]
324
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
325
+ #
326
+ # @return [::Google::Cloud::Talent::V4beta1::Tenant]
327
+ #
328
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
329
+ def update_tenant request, options = nil
330
+ raise ::ArgumentError, "request must be provided" if request.nil?
331
+
332
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateTenantRequest
333
+
334
+ # Converts hash and nil to an options object
335
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
336
+
337
+ # Customize the options with defaults
338
+ call_metadata = @config.rpcs.update_tenant.metadata.to_h
339
+
340
+ # Set x-goog-api-client and x-goog-user-project headers
341
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
342
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
343
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
344
+ transports_version_send: [:rest]
345
+
346
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
347
+
348
+ options.apply_defaults timeout: @config.rpcs.update_tenant.timeout,
349
+ metadata: call_metadata,
350
+ retry_policy: @config.rpcs.update_tenant.retry_policy
351
+
352
+ options.apply_defaults timeout: @config.timeout,
353
+ metadata: @config.metadata,
354
+ retry_policy: @config.retry_policy
355
+
356
+ @tenant_service_stub.update_tenant request, options do |result, operation|
357
+ yield result, operation if block_given?
358
+ return result
359
+ end
360
+ rescue ::Gapic::Rest::Error => e
361
+ raise ::Google::Cloud::Error.from_error(e)
362
+ end
363
+
364
+ ##
365
+ # Deletes specified tenant.
366
+ #
367
+ # @overload delete_tenant(request, options = nil)
368
+ # Pass arguments to `delete_tenant` via a request object, either of type
369
+ # {::Google::Cloud::Talent::V4beta1::DeleteTenantRequest} or an equivalent Hash.
370
+ #
371
+ # @param request [::Google::Cloud::Talent::V4beta1::DeleteTenantRequest, ::Hash]
372
+ # A request object representing the call parameters. Required. To specify no
373
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
374
+ # @param options [::Gapic::CallOptions, ::Hash]
375
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
376
+ #
377
+ # @overload delete_tenant(name: nil)
378
+ # Pass arguments to `delete_tenant` via keyword arguments. Note that at
379
+ # least one keyword argument is required. To specify no parameters, or to keep all
380
+ # the default parameter values, pass an empty Hash as a request object (see above).
381
+ #
382
+ # @param name [::String]
383
+ # Required. The resource name of the tenant to be deleted.
384
+ #
385
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
386
+ # "projects/foo/tenants/bar".
387
+ # @yield [result, operation] Access the result along with the TransportOperation object
388
+ # @yieldparam result [::Google::Protobuf::Empty]
389
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
390
+ #
391
+ # @return [::Google::Protobuf::Empty]
392
+ #
393
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
394
+ def delete_tenant request, options = nil
395
+ raise ::ArgumentError, "request must be provided" if request.nil?
396
+
397
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteTenantRequest
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
+ call_metadata = @config.rpcs.delete_tenant.metadata.to_h
404
+
405
+ # Set x-goog-api-client and x-goog-user-project headers
406
+ call_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::Talent::V4beta1::VERSION,
409
+ transports_version_send: [:rest]
410
+
411
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
412
+
413
+ options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout,
414
+ metadata: call_metadata,
415
+ retry_policy: @config.rpcs.delete_tenant.retry_policy
416
+
417
+ options.apply_defaults timeout: @config.timeout,
418
+ metadata: @config.metadata,
419
+ retry_policy: @config.retry_policy
420
+
421
+ @tenant_service_stub.delete_tenant request, options do |result, operation|
422
+ yield result, operation if block_given?
423
+ return result
424
+ end
425
+ rescue ::Gapic::Rest::Error => e
426
+ raise ::Google::Cloud::Error.from_error(e)
427
+ end
428
+
429
+ ##
430
+ # Lists all tenants associated with the project.
431
+ #
432
+ # @overload list_tenants(request, options = nil)
433
+ # Pass arguments to `list_tenants` via a request object, either of type
434
+ # {::Google::Cloud::Talent::V4beta1::ListTenantsRequest} or an equivalent Hash.
435
+ #
436
+ # @param request [::Google::Cloud::Talent::V4beta1::ListTenantsRequest, ::Hash]
437
+ # A request object representing the call parameters. Required. To specify no
438
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
439
+ # @param options [::Gapic::CallOptions, ::Hash]
440
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
441
+ #
442
+ # @overload list_tenants(parent: nil, page_token: nil, page_size: nil)
443
+ # Pass arguments to `list_tenants` via keyword arguments. Note that at
444
+ # least one keyword argument is required. To specify no parameters, or to keep all
445
+ # the default parameter values, pass an empty Hash as a request object (see above).
446
+ #
447
+ # @param parent [::String]
448
+ # Required. Resource name of the project under which the tenant is created.
449
+ #
450
+ # The format is "projects/\\{project_id}", for example,
451
+ # "projects/foo".
452
+ # @param page_token [::String]
453
+ # The starting indicator from which to return results.
454
+ # @param page_size [::Integer]
455
+ # The maximum number of tenants to be returned, at most 100.
456
+ # Default is 100 if a non-positive number is provided.
457
+ # @yield [result, operation] Access the result along with the TransportOperation object
458
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>]
459
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
460
+ #
461
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Tenant>]
462
+ #
463
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
464
+ def list_tenants request, options = nil
465
+ raise ::ArgumentError, "request must be provided" if request.nil?
466
+
467
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListTenantsRequest
468
+
469
+ # Converts hash and nil to an options object
470
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
471
+
472
+ # Customize the options with defaults
473
+ call_metadata = @config.rpcs.list_tenants.metadata.to_h
474
+
475
+ # Set x-goog-api-client and x-goog-user-project headers
476
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
477
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
478
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
479
+ transports_version_send: [:rest]
480
+
481
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
482
+
483
+ options.apply_defaults timeout: @config.rpcs.list_tenants.timeout,
484
+ metadata: call_metadata,
485
+ retry_policy: @config.rpcs.list_tenants.retry_policy
486
+
487
+ options.apply_defaults timeout: @config.timeout,
488
+ metadata: @config.metadata,
489
+ retry_policy: @config.retry_policy
490
+
491
+ @tenant_service_stub.list_tenants request, options do |result, operation|
492
+ result = ::Gapic::Rest::PagedEnumerable.new @tenant_service_stub, :list_tenants, "tenants", request, result, options
493
+ yield result, operation if block_given?
494
+ return result
495
+ end
496
+ rescue ::Gapic::Rest::Error => e
497
+ raise ::Google::Cloud::Error.from_error(e)
498
+ end
499
+
500
+ ##
501
+ # Configuration class for the TenantService REST API.
502
+ #
503
+ # This class represents the configuration for TenantService REST,
504
+ # providing control over timeouts, retry behavior, logging, transport
505
+ # parameters, and other low-level controls. Certain parameters can also be
506
+ # applied individually to specific RPCs. See
507
+ # {::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client::Configuration::Rpcs}
508
+ # for a list of RPCs that can be configured independently.
509
+ #
510
+ # Configuration can be applied globally to all clients, or to a single client
511
+ # on construction.
512
+ #
513
+ # @example
514
+ #
515
+ # # Modify the global config, setting the timeout for
516
+ # # create_tenant to 20 seconds,
517
+ # # and all remaining timeouts to 10 seconds.
518
+ # ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.configure do |config|
519
+ # config.timeout = 10.0
520
+ # config.rpcs.create_tenant.timeout = 20.0
521
+ # end
522
+ #
523
+ # # Apply the above configuration only to a new client.
524
+ # client = ::Google::Cloud::Talent::V4beta1::TenantService::Rest::Client.new do |config|
525
+ # config.timeout = 10.0
526
+ # config.rpcs.create_tenant.timeout = 20.0
527
+ # end
528
+ #
529
+ # @!attribute [rw] endpoint
530
+ # The hostname or hostname:port of the service endpoint.
531
+ # Defaults to `"jobs.googleapis.com"`.
532
+ # @return [::String]
533
+ # @!attribute [rw] credentials
534
+ # Credentials to send with calls. You may provide any of the following types:
535
+ # * (`String`) The path to a service account key file in JSON format
536
+ # * (`Hash`) A service account key as a Hash
537
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
538
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
539
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
540
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
541
+ # * (`nil`) indicating no credentials
542
+ # @return [::Object]
543
+ # @!attribute [rw] scope
544
+ # The OAuth scopes
545
+ # @return [::Array<::String>]
546
+ # @!attribute [rw] lib_name
547
+ # The library name as recorded in instrumentation and logging
548
+ # @return [::String]
549
+ # @!attribute [rw] lib_version
550
+ # The library version as recorded in instrumentation and logging
551
+ # @return [::String]
552
+ # @!attribute [rw] timeout
553
+ # The call timeout in seconds.
554
+ # @return [::Numeric]
555
+ # @!attribute [rw] metadata
556
+ # Additional headers to be sent with the call.
557
+ # @return [::Hash{::Symbol=>::String}]
558
+ # @!attribute [rw] retry_policy
559
+ # The retry policy. The value is a hash with the following keys:
560
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
561
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
562
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
563
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
564
+ # trigger a retry.
565
+ # @return [::Hash]
566
+ # @!attribute [rw] quota_project
567
+ # A separate project against which to charge quota.
568
+ # @return [::String]
569
+ #
570
+ class Configuration
571
+ extend ::Gapic::Config
572
+
573
+ config_attr :endpoint, "jobs.googleapis.com", ::String
574
+ config_attr :credentials, nil do |value|
575
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
576
+ allowed.any? { |klass| klass === value }
577
+ end
578
+ config_attr :scope, nil, ::String, ::Array, nil
579
+ config_attr :lib_name, nil, ::String, nil
580
+ config_attr :lib_version, nil, ::String, nil
581
+ config_attr :timeout, nil, ::Numeric, nil
582
+ config_attr :metadata, nil, ::Hash, nil
583
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
584
+ config_attr :quota_project, nil, ::String, nil
585
+
586
+ # @private
587
+ def initialize parent_config = nil
588
+ @parent_config = parent_config unless parent_config.nil?
589
+
590
+ yield self if block_given?
591
+ end
592
+
593
+ ##
594
+ # Configurations for individual RPCs
595
+ # @return [Rpcs]
596
+ #
597
+ def rpcs
598
+ @rpcs ||= begin
599
+ parent_rpcs = nil
600
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
601
+ Rpcs.new parent_rpcs
602
+ end
603
+ end
604
+
605
+ ##
606
+ # Configuration RPC class for the TenantService API.
607
+ #
608
+ # Includes fields providing the configuration for each RPC in this service.
609
+ # Each configuration object is of type `Gapic::Config::Method` and includes
610
+ # the following configuration fields:
611
+ #
612
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
613
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
614
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
615
+ # include the following keys:
616
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
617
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
618
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
619
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
620
+ # trigger a retry.
621
+ #
622
+ class Rpcs
623
+ ##
624
+ # RPC-specific configuration for `create_tenant`
625
+ # @return [::Gapic::Config::Method]
626
+ #
627
+ attr_reader :create_tenant
628
+ ##
629
+ # RPC-specific configuration for `get_tenant`
630
+ # @return [::Gapic::Config::Method]
631
+ #
632
+ attr_reader :get_tenant
633
+ ##
634
+ # RPC-specific configuration for `update_tenant`
635
+ # @return [::Gapic::Config::Method]
636
+ #
637
+ attr_reader :update_tenant
638
+ ##
639
+ # RPC-specific configuration for `delete_tenant`
640
+ # @return [::Gapic::Config::Method]
641
+ #
642
+ attr_reader :delete_tenant
643
+ ##
644
+ # RPC-specific configuration for `list_tenants`
645
+ # @return [::Gapic::Config::Method]
646
+ #
647
+ attr_reader :list_tenants
648
+
649
+ # @private
650
+ def initialize parent_rpcs = nil
651
+ create_tenant_config = parent_rpcs.create_tenant if parent_rpcs.respond_to? :create_tenant
652
+ @create_tenant = ::Gapic::Config::Method.new create_tenant_config
653
+ get_tenant_config = parent_rpcs.get_tenant if parent_rpcs.respond_to? :get_tenant
654
+ @get_tenant = ::Gapic::Config::Method.new get_tenant_config
655
+ update_tenant_config = parent_rpcs.update_tenant if parent_rpcs.respond_to? :update_tenant
656
+ @update_tenant = ::Gapic::Config::Method.new update_tenant_config
657
+ delete_tenant_config = parent_rpcs.delete_tenant if parent_rpcs.respond_to? :delete_tenant
658
+ @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config
659
+ list_tenants_config = parent_rpcs.list_tenants if parent_rpcs.respond_to? :list_tenants
660
+ @list_tenants = ::Gapic::Config::Method.new list_tenants_config
661
+
662
+ yield self if block_given?
663
+ end
664
+ end
665
+ end
666
+ end
667
+ end
668
+ end
669
+ end
670
+ end
671
+ end
672
+ end