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,682 @@
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/company_service_pb"
21
+ require "google/cloud/talent/v4/company_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Talent
26
+ module V4
27
+ module CompanyService
28
+ module Rest
29
+ ##
30
+ # REST client for the CompanyService service.
31
+ #
32
+ # A service that handles company management, including CRUD and enumeration.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :company_service_stub
39
+
40
+ ##
41
+ # Configure the CompanyService Client class.
42
+ #
43
+ # See {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all CompanyService clients
49
+ # ::Google::Cloud::Talent::V4::CompanyService::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_company.timeout = 30.0
70
+
71
+ default_config.rpcs.get_company.timeout = 30.0
72
+ default_config.rpcs.get_company.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_company.timeout = 30.0
77
+
78
+ default_config.rpcs.delete_company.timeout = 30.0
79
+ default_config.rpcs.delete_company.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_companies.timeout = 30.0
84
+ default_config.rpcs.list_companies.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 CompanyService 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::CompanyService::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 CompanyService REST client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the CompanyService 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
+ @company_service_stub = ::Google::Cloud::Talent::V4::CompanyService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
153
+ end
154
+
155
+ # Service calls
156
+
157
+ ##
158
+ # Creates a new company entity.
159
+ #
160
+ # @overload create_company(request, options = nil)
161
+ # Pass arguments to `create_company` via a request object, either of type
162
+ # {::Google::Cloud::Talent::V4::CreateCompanyRequest} or an equivalent Hash.
163
+ #
164
+ # @param request [::Google::Cloud::Talent::V4::CreateCompanyRequest, ::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_company(parent: nil, company: nil)
171
+ # Pass arguments to `create_company` 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 tenant under which the company is created.
177
+ #
178
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
179
+ # "projects/foo/tenants/bar".
180
+ # @param company [::Google::Cloud::Talent::V4::Company, ::Hash]
181
+ # Required. The company to be created.
182
+ # @yield [result, operation] Access the result along with the TransportOperation object
183
+ # @yieldparam result [::Google::Cloud::Talent::V4::Company]
184
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
185
+ #
186
+ # @return [::Google::Cloud::Talent::V4::Company]
187
+ #
188
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
189
+ def create_company 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::CreateCompanyRequest
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_company.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_company.timeout,
209
+ metadata: call_metadata,
210
+ retry_policy: @config.rpcs.create_company.retry_policy
211
+
212
+ options.apply_defaults timeout: @config.timeout,
213
+ metadata: @config.metadata,
214
+ retry_policy: @config.retry_policy
215
+
216
+ @company_service_stub.create_company 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 company.
226
+ #
227
+ # @overload get_company(request, options = nil)
228
+ # Pass arguments to `get_company` via a request object, either of type
229
+ # {::Google::Cloud::Talent::V4::GetCompanyRequest} or an equivalent Hash.
230
+ #
231
+ # @param request [::Google::Cloud::Talent::V4::GetCompanyRequest, ::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_company(name: nil)
238
+ # Pass arguments to `get_company` 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 company to be retrieved.
244
+ #
245
+ # The format is
246
+ # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
247
+ # example, "projects/api-test-project/tenants/foo/companies/bar".
248
+ # @yield [result, operation] Access the result along with the TransportOperation object
249
+ # @yieldparam result [::Google::Cloud::Talent::V4::Company]
250
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
251
+ #
252
+ # @return [::Google::Cloud::Talent::V4::Company]
253
+ #
254
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
255
+ def get_company request, options = nil
256
+ raise ::ArgumentError, "request must be provided" if request.nil?
257
+
258
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetCompanyRequest
259
+
260
+ # Converts hash and nil to an options object
261
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
262
+
263
+ # Customize the options with defaults
264
+ call_metadata = @config.rpcs.get_company.metadata.to_h
265
+
266
+ # Set x-goog-api-client and x-goog-user-project headers
267
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
268
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
269
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
270
+ transports_version_send: [:rest]
271
+
272
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
+
274
+ options.apply_defaults timeout: @config.rpcs.get_company.timeout,
275
+ metadata: call_metadata,
276
+ retry_policy: @config.rpcs.get_company.retry_policy
277
+
278
+ options.apply_defaults timeout: @config.timeout,
279
+ metadata: @config.metadata,
280
+ retry_policy: @config.retry_policy
281
+
282
+ @company_service_stub.get_company request, options do |result, operation|
283
+ yield result, operation if block_given?
284
+ return result
285
+ end
286
+ rescue ::Gapic::Rest::Error => e
287
+ raise ::Google::Cloud::Error.from_error(e)
288
+ end
289
+
290
+ ##
291
+ # Updates specified company.
292
+ #
293
+ # @overload update_company(request, options = nil)
294
+ # Pass arguments to `update_company` via a request object, either of type
295
+ # {::Google::Cloud::Talent::V4::UpdateCompanyRequest} or an equivalent Hash.
296
+ #
297
+ # @param request [::Google::Cloud::Talent::V4::UpdateCompanyRequest, ::Hash]
298
+ # A request object representing the call parameters. Required. To specify no
299
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
300
+ # @param options [::Gapic::CallOptions, ::Hash]
301
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
302
+ #
303
+ # @overload update_company(company: nil, update_mask: nil)
304
+ # Pass arguments to `update_company` via keyword arguments. Note that at
305
+ # least one keyword argument is required. To specify no parameters, or to keep all
306
+ # the default parameter values, pass an empty Hash as a request object (see above).
307
+ #
308
+ # @param company [::Google::Cloud::Talent::V4::Company, ::Hash]
309
+ # Required. The company resource to replace the current resource in the
310
+ # system.
311
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
312
+ # Strongly recommended for the best service experience.
313
+ #
314
+ # If {::Google::Cloud::Talent::V4::UpdateCompanyRequest#update_mask update_mask}
315
+ # is provided, only the specified fields in
316
+ # {::Google::Cloud::Talent::V4::UpdateCompanyRequest#company company} are updated.
317
+ # Otherwise all the fields are updated.
318
+ #
319
+ # A field mask to specify the company fields to be updated. Only
320
+ # top level fields of {::Google::Cloud::Talent::V4::Company Company} are
321
+ # supported.
322
+ # @yield [result, operation] Access the result along with the TransportOperation object
323
+ # @yieldparam result [::Google::Cloud::Talent::V4::Company]
324
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
325
+ #
326
+ # @return [::Google::Cloud::Talent::V4::Company]
327
+ #
328
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
329
+ def update_company request, options = nil
330
+ raise ::ArgumentError, "request must be provided" if request.nil?
331
+
332
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateCompanyRequest
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_company.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::V4::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_company.timeout,
349
+ metadata: call_metadata,
350
+ retry_policy: @config.rpcs.update_company.retry_policy
351
+
352
+ options.apply_defaults timeout: @config.timeout,
353
+ metadata: @config.metadata,
354
+ retry_policy: @config.retry_policy
355
+
356
+ @company_service_stub.update_company 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 company.
366
+ # Prerequisite: The company has no jobs associated with it.
367
+ #
368
+ # @overload delete_company(request, options = nil)
369
+ # Pass arguments to `delete_company` via a request object, either of type
370
+ # {::Google::Cloud::Talent::V4::DeleteCompanyRequest} or an equivalent Hash.
371
+ #
372
+ # @param request [::Google::Cloud::Talent::V4::DeleteCompanyRequest, ::Hash]
373
+ # A request object representing the call parameters. Required. To specify no
374
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
375
+ # @param options [::Gapic::CallOptions, ::Hash]
376
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
377
+ #
378
+ # @overload delete_company(name: nil)
379
+ # Pass arguments to `delete_company` via keyword arguments. Note that at
380
+ # least one keyword argument is required. To specify no parameters, or to keep all
381
+ # the default parameter values, pass an empty Hash as a request object (see above).
382
+ #
383
+ # @param name [::String]
384
+ # Required. The resource name of the company to be deleted.
385
+ #
386
+ # The format is
387
+ # "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
388
+ # example, "projects/foo/tenants/bar/companies/baz".
389
+ # @yield [result, operation] Access the result along with the TransportOperation object
390
+ # @yieldparam result [::Google::Protobuf::Empty]
391
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
392
+ #
393
+ # @return [::Google::Protobuf::Empty]
394
+ #
395
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
396
+ def delete_company request, options = nil
397
+ raise ::ArgumentError, "request must be provided" if request.nil?
398
+
399
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteCompanyRequest
400
+
401
+ # Converts hash and nil to an options object
402
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
403
+
404
+ # Customize the options with defaults
405
+ call_metadata = @config.rpcs.delete_company.metadata.to_h
406
+
407
+ # Set x-goog-api-client and x-goog-user-project headers
408
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
409
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
410
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
411
+ transports_version_send: [:rest]
412
+
413
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
414
+
415
+ options.apply_defaults timeout: @config.rpcs.delete_company.timeout,
416
+ metadata: call_metadata,
417
+ retry_policy: @config.rpcs.delete_company.retry_policy
418
+
419
+ options.apply_defaults timeout: @config.timeout,
420
+ metadata: @config.metadata,
421
+ retry_policy: @config.retry_policy
422
+
423
+ @company_service_stub.delete_company request, options do |result, operation|
424
+ yield result, operation if block_given?
425
+ return result
426
+ end
427
+ rescue ::Gapic::Rest::Error => e
428
+ raise ::Google::Cloud::Error.from_error(e)
429
+ end
430
+
431
+ ##
432
+ # Lists all companies associated with the project.
433
+ #
434
+ # @overload list_companies(request, options = nil)
435
+ # Pass arguments to `list_companies` via a request object, either of type
436
+ # {::Google::Cloud::Talent::V4::ListCompaniesRequest} or an equivalent Hash.
437
+ #
438
+ # @param request [::Google::Cloud::Talent::V4::ListCompaniesRequest, ::Hash]
439
+ # A request object representing the call parameters. Required. To specify no
440
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
441
+ # @param options [::Gapic::CallOptions, ::Hash]
442
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
443
+ #
444
+ # @overload list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil)
445
+ # Pass arguments to `list_companies` via keyword arguments. Note that at
446
+ # least one keyword argument is required. To specify no parameters, or to keep all
447
+ # the default parameter values, pass an empty Hash as a request object (see above).
448
+ #
449
+ # @param parent [::String]
450
+ # Required. Resource name of the tenant under which the company is created.
451
+ #
452
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
453
+ # "projects/foo/tenants/bar".
454
+ # @param page_token [::String]
455
+ # The starting indicator from which to return results.
456
+ # @param page_size [::Integer]
457
+ # The maximum number of companies to be returned, at most 100.
458
+ # Default is 100 if a non-positive number is provided.
459
+ # @param require_open_jobs [::Boolean]
460
+ # Set to true if the companies requested must have open jobs.
461
+ #
462
+ # Defaults to false.
463
+ #
464
+ # If true, at most
465
+ # {::Google::Cloud::Talent::V4::ListCompaniesRequest#page_size page_size} of
466
+ # companies are fetched, among which only those with open jobs are returned.
467
+ # @yield [result, operation] Access the result along with the TransportOperation object
468
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>]
469
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
470
+ #
471
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Company>]
472
+ #
473
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
474
+ def list_companies request, options = nil
475
+ raise ::ArgumentError, "request must be provided" if request.nil?
476
+
477
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListCompaniesRequest
478
+
479
+ # Converts hash and nil to an options object
480
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
481
+
482
+ # Customize the options with defaults
483
+ call_metadata = @config.rpcs.list_companies.metadata.to_h
484
+
485
+ # Set x-goog-api-client and x-goog-user-project headers
486
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
487
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
488
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
489
+ transports_version_send: [:rest]
490
+
491
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
492
+
493
+ options.apply_defaults timeout: @config.rpcs.list_companies.timeout,
494
+ metadata: call_metadata,
495
+ retry_policy: @config.rpcs.list_companies.retry_policy
496
+
497
+ options.apply_defaults timeout: @config.timeout,
498
+ metadata: @config.metadata,
499
+ retry_policy: @config.retry_policy
500
+
501
+ @company_service_stub.list_companies request, options do |result, operation|
502
+ result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, options
503
+ yield result, operation if block_given?
504
+ return result
505
+ end
506
+ rescue ::Gapic::Rest::Error => e
507
+ raise ::Google::Cloud::Error.from_error(e)
508
+ end
509
+
510
+ ##
511
+ # Configuration class for the CompanyService REST API.
512
+ #
513
+ # This class represents the configuration for CompanyService REST,
514
+ # providing control over timeouts, retry behavior, logging, transport
515
+ # parameters, and other low-level controls. Certain parameters can also be
516
+ # applied individually to specific RPCs. See
517
+ # {::Google::Cloud::Talent::V4::CompanyService::Rest::Client::Configuration::Rpcs}
518
+ # for a list of RPCs that can be configured independently.
519
+ #
520
+ # Configuration can be applied globally to all clients, or to a single client
521
+ # on construction.
522
+ #
523
+ # @example
524
+ #
525
+ # # Modify the global config, setting the timeout for
526
+ # # create_company to 20 seconds,
527
+ # # and all remaining timeouts to 10 seconds.
528
+ # ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.configure do |config|
529
+ # config.timeout = 10.0
530
+ # config.rpcs.create_company.timeout = 20.0
531
+ # end
532
+ #
533
+ # # Apply the above configuration only to a new client.
534
+ # client = ::Google::Cloud::Talent::V4::CompanyService::Rest::Client.new do |config|
535
+ # config.timeout = 10.0
536
+ # config.rpcs.create_company.timeout = 20.0
537
+ # end
538
+ #
539
+ # @!attribute [rw] endpoint
540
+ # The hostname or hostname:port of the service endpoint.
541
+ # Defaults to `"jobs.googleapis.com"`.
542
+ # @return [::String]
543
+ # @!attribute [rw] credentials
544
+ # Credentials to send with calls. You may provide any of the following types:
545
+ # * (`String`) The path to a service account key file in JSON format
546
+ # * (`Hash`) A service account key as a Hash
547
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
548
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
549
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
550
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
551
+ # * (`nil`) indicating no credentials
552
+ # @return [::Object]
553
+ # @!attribute [rw] scope
554
+ # The OAuth scopes
555
+ # @return [::Array<::String>]
556
+ # @!attribute [rw] lib_name
557
+ # The library name as recorded in instrumentation and logging
558
+ # @return [::String]
559
+ # @!attribute [rw] lib_version
560
+ # The library version as recorded in instrumentation and logging
561
+ # @return [::String]
562
+ # @!attribute [rw] timeout
563
+ # The call timeout in seconds.
564
+ # @return [::Numeric]
565
+ # @!attribute [rw] metadata
566
+ # Additional headers to be sent with the call.
567
+ # @return [::Hash{::Symbol=>::String}]
568
+ # @!attribute [rw] retry_policy
569
+ # The retry policy. The value is a hash with the following keys:
570
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
571
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
572
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
573
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
574
+ # trigger a retry.
575
+ # @return [::Hash]
576
+ # @!attribute [rw] quota_project
577
+ # A separate project against which to charge quota.
578
+ # @return [::String]
579
+ #
580
+ class Configuration
581
+ extend ::Gapic::Config
582
+
583
+ config_attr :endpoint, "jobs.googleapis.com", ::String
584
+ config_attr :credentials, nil do |value|
585
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
586
+ allowed.any? { |klass| klass === value }
587
+ end
588
+ config_attr :scope, nil, ::String, ::Array, nil
589
+ config_attr :lib_name, nil, ::String, nil
590
+ config_attr :lib_version, nil, ::String, nil
591
+ config_attr :timeout, nil, ::Numeric, nil
592
+ config_attr :metadata, nil, ::Hash, nil
593
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
594
+ config_attr :quota_project, nil, ::String, nil
595
+
596
+ # @private
597
+ def initialize parent_config = nil
598
+ @parent_config = parent_config unless parent_config.nil?
599
+
600
+ yield self if block_given?
601
+ end
602
+
603
+ ##
604
+ # Configurations for individual RPCs
605
+ # @return [Rpcs]
606
+ #
607
+ def rpcs
608
+ @rpcs ||= begin
609
+ parent_rpcs = nil
610
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
611
+ Rpcs.new parent_rpcs
612
+ end
613
+ end
614
+
615
+ ##
616
+ # Configuration RPC class for the CompanyService API.
617
+ #
618
+ # Includes fields providing the configuration for each RPC in this service.
619
+ # Each configuration object is of type `Gapic::Config::Method` and includes
620
+ # the following configuration fields:
621
+ #
622
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
623
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
624
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
625
+ # include the following keys:
626
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
627
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
628
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
629
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
630
+ # trigger a retry.
631
+ #
632
+ class Rpcs
633
+ ##
634
+ # RPC-specific configuration for `create_company`
635
+ # @return [::Gapic::Config::Method]
636
+ #
637
+ attr_reader :create_company
638
+ ##
639
+ # RPC-specific configuration for `get_company`
640
+ # @return [::Gapic::Config::Method]
641
+ #
642
+ attr_reader :get_company
643
+ ##
644
+ # RPC-specific configuration for `update_company`
645
+ # @return [::Gapic::Config::Method]
646
+ #
647
+ attr_reader :update_company
648
+ ##
649
+ # RPC-specific configuration for `delete_company`
650
+ # @return [::Gapic::Config::Method]
651
+ #
652
+ attr_reader :delete_company
653
+ ##
654
+ # RPC-specific configuration for `list_companies`
655
+ # @return [::Gapic::Config::Method]
656
+ #
657
+ attr_reader :list_companies
658
+
659
+ # @private
660
+ def initialize parent_rpcs = nil
661
+ create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company
662
+ @create_company = ::Gapic::Config::Method.new create_company_config
663
+ get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company
664
+ @get_company = ::Gapic::Config::Method.new get_company_config
665
+ update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company
666
+ @update_company = ::Gapic::Config::Method.new update_company_config
667
+ delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company
668
+ @delete_company = ::Gapic::Config::Method.new delete_company_config
669
+ list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies
670
+ @list_companies = ::Gapic::Config::Method.new list_companies_config
671
+
672
+ yield self if block_given?
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end
678
+ end
679
+ end
680
+ end
681
+ end
682
+ end