google-cloud-talent 0.8.3 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -59
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +347 -0
  6. data/README.md +36 -25
  7. data/lib/{google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb → google-cloud-talent.rb} +4 -14
  8. data/lib/google/cloud/talent.rb +203 -453
  9. data/lib/google/cloud/talent/version.rb +6 -2
  10. metadata +75 -110
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/talent/v4beta1.rb +0 -543
  13. data/lib/google/cloud/talent/v4beta1/application_pb.rb +0 -63
  14. data/lib/google/cloud/talent/v4beta1/application_service_client.rb +0 -484
  15. data/lib/google/cloud/talent/v4beta1/application_service_client_config.json +0 -51
  16. data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +0 -55
  17. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +0 -56
  18. data/lib/google/cloud/talent/v4beta1/batch_pb.rb +0 -18
  19. data/lib/google/cloud/talent/v4beta1/common_pb.rb +0 -341
  20. data/lib/google/cloud/talent/v4beta1/company_pb.rb +0 -41
  21. data/lib/google/cloud/talent/v4beta1/company_service_client.rb +0 -529
  22. data/lib/google/cloud/talent/v4beta1/company_service_client_config.json +0 -51
  23. data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +0 -56
  24. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +0 -56
  25. data/lib/google/cloud/talent/v4beta1/completion_client.rb +0 -337
  26. data/lib/google/cloud/talent/v4beta1/completion_client_config.json +0 -31
  27. data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +0 -56
  28. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +0 -48
  29. data/lib/google/cloud/talent/v4beta1/credentials.rb +0 -42
  30. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application.rb +0 -166
  31. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application_service.rb +0 -100
  32. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +0 -1057
  33. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +0 -107
  34. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +0 -116
  35. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +0 -139
  36. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +0 -224
  37. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +0 -36
  38. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +0 -763
  39. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +0 -50
  40. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +0 -331
  41. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +0 -696
  42. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +0 -750
  43. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +0 -410
  44. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +0 -70
  45. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +0 -96
  46. data/lib/google/cloud/talent/v4beta1/doc/google/longrunning/operations.rb +0 -51
  47. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/any.rb +0 -131
  48. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb +0 -91
  49. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb +0 -222
  50. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb +0 -113
  51. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb +0 -34
  52. data/lib/google/cloud/talent/v4beta1/doc/google/rpc/status.rb +0 -39
  53. data/lib/google/cloud/talent/v4beta1/doc/google/type/date.rb +0 -43
  54. data/lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb +0 -31
  55. data/lib/google/cloud/talent/v4beta1/doc/google/type/money.rb +0 -36
  56. data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +0 -128
  57. data/lib/google/cloud/talent/v4beta1/doc/google/type/timeofday.rb +0 -37
  58. data/lib/google/cloud/talent/v4beta1/event_pb.rb +0 -69
  59. data/lib/google/cloud/talent/v4beta1/event_service_client.rb +0 -268
  60. data/lib/google/cloud/talent/v4beta1/event_service_client_config.json +0 -31
  61. data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +0 -27
  62. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +0 -53
  63. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +0 -187
  64. data/lib/google/cloud/talent/v4beta1/helpers.rb +0 -162
  65. data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +0 -27
  66. data/lib/google/cloud/talent/v4beta1/job_pb.rb +0 -72
  67. data/lib/google/cloud/talent/v4beta1/job_service_client.rb +0 -1510
  68. data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +0 -76
  69. data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +0 -166
  70. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +0 -88
  71. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -213
  72. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -811
  73. data/lib/google/cloud/talent/v4beta1/profile_service_client_config.json +0 -56
  74. data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +0 -91
  75. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +0 -65
  76. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -34
  77. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -471
  78. data/lib/google/cloud/talent/v4beta1/tenant_service_client_config.json +0 -51
  79. data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +0 -55
  80. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +0 -55
@@ -1,1510 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/cloud/talent/v4beta1/job_service.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
- require "google/gax/operation"
28
- require "google/longrunning/operations_client"
29
-
30
- require "google/cloud/talent/v4beta1/job_service_pb"
31
- require "google/cloud/talent/v4beta1/credentials"
32
- require "google/cloud/talent/version"
33
-
34
- module Google
35
- module Cloud
36
- module Talent
37
- module V4beta1
38
- # A service handles job management, including job CRUD, enumeration and search.
39
- #
40
- # @!attribute [r] job_service_stub
41
- # @return [Google::Cloud::Talent::V4beta1::JobService::Stub]
42
- class JobServiceClient
43
- # @private
44
- attr_reader :job_service_stub
45
-
46
- # The default address of the service.
47
- SERVICE_ADDRESS = "jobs.googleapis.com".freeze
48
-
49
- # The default port of the service.
50
- DEFAULT_SERVICE_PORT = 443
51
-
52
- # The default set of gRPC interceptors.
53
- GRPC_INTERCEPTORS = []
54
-
55
- DEFAULT_TIMEOUT = 30
56
-
57
- PAGE_DESCRIPTORS = {
58
- "list_jobs" => Google::Gax::PageDescriptor.new(
59
- "page_token",
60
- "next_page_token",
61
- "jobs"),
62
- "search_jobs" => Google::Gax::PageDescriptor.new(
63
- "page_token",
64
- "next_page_token",
65
- "matching_jobs"),
66
- "search_jobs_for_alert" => Google::Gax::PageDescriptor.new(
67
- "page_token",
68
- "next_page_token",
69
- "matching_jobs")
70
- }.freeze
71
-
72
- private_constant :PAGE_DESCRIPTORS
73
-
74
- # The scopes needed to make gRPC calls to all of the methods defined in
75
- # this service.
76
- ALL_SCOPES = [
77
- "https://www.googleapis.com/auth/cloud-platform",
78
- "https://www.googleapis.com/auth/jobs"
79
- ].freeze
80
-
81
- class OperationsClient < Google::Longrunning::OperationsClient
82
- self::SERVICE_ADDRESS = JobServiceClient::SERVICE_ADDRESS
83
- self::GRPC_INTERCEPTORS = JobServiceClient::GRPC_INTERCEPTORS
84
- end
85
-
86
- COMPANY_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
87
- "projects/{project}/tenants/{tenant}/companies/{company}"
88
- )
89
-
90
- private_constant :COMPANY_PATH_TEMPLATE
91
-
92
- COMPANY_WITHOUT_TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
93
- "projects/{project}/companies/{company}"
94
- )
95
-
96
- private_constant :COMPANY_WITHOUT_TENANT_PATH_TEMPLATE
97
-
98
- JOB_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
99
- "projects/{project}/tenants/{tenant}/jobs/{jobs}"
100
- )
101
-
102
- private_constant :JOB_PATH_TEMPLATE
103
-
104
- JOB_WITHOUT_TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
105
- "projects/{project}/jobs/{jobs}"
106
- )
107
-
108
- private_constant :JOB_WITHOUT_TENANT_PATH_TEMPLATE
109
-
110
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
111
- "projects/{project}"
112
- )
113
-
114
- private_constant :PROJECT_PATH_TEMPLATE
115
-
116
- TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
117
- "projects/{project}/tenants/{tenant}"
118
- )
119
-
120
- private_constant :TENANT_PATH_TEMPLATE
121
-
122
- # Returns a fully-qualified company resource name string.
123
- # @param project [String]
124
- # @param tenant [String]
125
- # @param company [String]
126
- # @return [String]
127
- def self.company_path project, tenant, company
128
- COMPANY_PATH_TEMPLATE.render(
129
- :"project" => project,
130
- :"tenant" => tenant,
131
- :"company" => company
132
- )
133
- end
134
-
135
- # Returns a fully-qualified company_without_tenant resource name string.
136
- # @param project [String]
137
- # @param company [String]
138
- # @return [String]
139
- def self.company_without_tenant_path project, company
140
- COMPANY_WITHOUT_TENANT_PATH_TEMPLATE.render(
141
- :"project" => project,
142
- :"company" => company
143
- )
144
- end
145
-
146
- # Returns a fully-qualified job resource name string.
147
- # @param project [String]
148
- # @param tenant [String]
149
- # @param jobs [String]
150
- # @return [String]
151
- def self.job_path project, tenant, jobs
152
- JOB_PATH_TEMPLATE.render(
153
- :"project" => project,
154
- :"tenant" => tenant,
155
- :"jobs" => jobs
156
- )
157
- end
158
-
159
- # Returns a fully-qualified job_without_tenant resource name string.
160
- # @param project [String]
161
- # @param jobs [String]
162
- # @return [String]
163
- def self.job_without_tenant_path project, jobs
164
- JOB_WITHOUT_TENANT_PATH_TEMPLATE.render(
165
- :"project" => project,
166
- :"jobs" => jobs
167
- )
168
- end
169
-
170
- # Returns a fully-qualified project resource name string.
171
- # @param project [String]
172
- # @return [String]
173
- def self.project_path project
174
- PROJECT_PATH_TEMPLATE.render(
175
- :"project" => project
176
- )
177
- end
178
-
179
- # Returns a fully-qualified tenant resource name string.
180
- # @param project [String]
181
- # @param tenant [String]
182
- # @return [String]
183
- def self.tenant_path project, tenant
184
- TENANT_PATH_TEMPLATE.render(
185
- :"project" => project,
186
- :"tenant" => tenant
187
- )
188
- end
189
-
190
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
191
- # Provides the means for authenticating requests made by the client. This parameter can
192
- # be many types.
193
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
194
- # authenticating requests made by this client.
195
- # A `String` will be treated as the path to the keyfile to be used for the construction of
196
- # credentials for this client.
197
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
198
- # credentials for this client.
199
- # A `GRPC::Core::Channel` will be used to make calls through.
200
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
201
- # should already be composed with a `GRPC::Core::CallCredentials` object.
202
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
203
- # metadata for requests, generally, to give OAuth credentials.
204
- # @param scopes [Array<String>]
205
- # The OAuth scopes for this service. This parameter is ignored if
206
- # an updater_proc is supplied.
207
- # @param client_config [Hash]
208
- # A Hash for call options for each method. See
209
- # Google::Gax#construct_settings for the structure of
210
- # this data. Falls back to the default config if not specified
211
- # or the specified config is missing data points.
212
- # @param timeout [Numeric]
213
- # The default timeout, in seconds, for calls made through this client.
214
- # @param metadata [Hash]
215
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
216
- # @param service_address [String]
217
- # Override for the service hostname, or `nil` to leave as the default.
218
- # @param service_port [Integer]
219
- # Override for the service port, or `nil` to leave as the default.
220
- # @param exception_transformer [Proc]
221
- # An optional proc that intercepts any exceptions raised during an API call to inject
222
- # custom error handling.
223
- def initialize \
224
- credentials: nil,
225
- scopes: ALL_SCOPES,
226
- client_config: {},
227
- timeout: DEFAULT_TIMEOUT,
228
- metadata: nil,
229
- service_address: nil,
230
- service_port: nil,
231
- exception_transformer: nil,
232
- lib_name: nil,
233
- lib_version: ""
234
- # These require statements are intentionally placed here to initialize
235
- # the gRPC module only when it's required.
236
- # See https://github.com/googleapis/toolkit/issues/446
237
- require "google/gax/grpc"
238
- require "google/cloud/talent/v4beta1/job_service_services_pb"
239
-
240
- credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
241
-
242
- @operations_client = OperationsClient.new(
243
- credentials: credentials,
244
- scopes: scopes,
245
- client_config: client_config,
246
- timeout: timeout,
247
- lib_name: lib_name,
248
- service_address: service_address,
249
- service_port: service_port,
250
- lib_version: lib_version,
251
- metadata: metadata,
252
- )
253
-
254
- if credentials.is_a?(String) || credentials.is_a?(Hash)
255
- updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
256
- end
257
- if credentials.is_a?(GRPC::Core::Channel)
258
- channel = credentials
259
- end
260
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
261
- chan_creds = credentials
262
- end
263
- if credentials.is_a?(Proc)
264
- updater_proc = credentials
265
- end
266
- if credentials.is_a?(Google::Auth::Credentials)
267
- updater_proc = credentials.updater_proc
268
- end
269
-
270
- package_version = Google::Cloud::Talent::VERSION
271
-
272
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
273
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
274
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
275
- google_api_client << " grpc/#{GRPC::VERSION}"
276
- google_api_client.freeze
277
-
278
- headers = { :"x-goog-api-client" => google_api_client }
279
- headers.merge!(metadata) unless metadata.nil?
280
- client_config_file = Pathname.new(__dir__).join(
281
- "job_service_client_config.json"
282
- )
283
- defaults = client_config_file.open do |f|
284
- Google::Gax.construct_settings(
285
- "google.cloud.talent.v4beta1.JobService",
286
- JSON.parse(f.read),
287
- client_config,
288
- Google::Gax::Grpc::STATUS_CODE_NAMES,
289
- timeout,
290
- page_descriptors: PAGE_DESCRIPTORS,
291
- errors: Google::Gax::Grpc::API_ERRORS,
292
- metadata: headers
293
- )
294
- end
295
-
296
- # Allow overriding the service path/port in subclasses.
297
- service_path = service_address || self.class::SERVICE_ADDRESS
298
- port = service_port || self.class::DEFAULT_SERVICE_PORT
299
- interceptors = self.class::GRPC_INTERCEPTORS
300
- @job_service_stub = Google::Gax::Grpc.create_stub(
301
- service_path,
302
- port,
303
- chan_creds: chan_creds,
304
- channel: channel,
305
- updater_proc: updater_proc,
306
- scopes: scopes,
307
- interceptors: interceptors,
308
- &Google::Cloud::Talent::V4beta1::JobService::Stub.method(:new)
309
- )
310
-
311
- @create_job = Google::Gax.create_api_call(
312
- @job_service_stub.method(:create_job),
313
- defaults["create_job"],
314
- exception_transformer: exception_transformer,
315
- params_extractor: proc do |request|
316
- {'parent' => request.parent}
317
- end
318
- )
319
- @get_job = Google::Gax.create_api_call(
320
- @job_service_stub.method(:get_job),
321
- defaults["get_job"],
322
- exception_transformer: exception_transformer,
323
- params_extractor: proc do |request|
324
- {'name' => request.name}
325
- end
326
- )
327
- @update_job = Google::Gax.create_api_call(
328
- @job_service_stub.method(:update_job),
329
- defaults["update_job"],
330
- exception_transformer: exception_transformer,
331
- params_extractor: proc do |request|
332
- {'job.name' => request.job.name}
333
- end
334
- )
335
- @delete_job = Google::Gax.create_api_call(
336
- @job_service_stub.method(:delete_job),
337
- defaults["delete_job"],
338
- exception_transformer: exception_transformer,
339
- params_extractor: proc do |request|
340
- {'name' => request.name}
341
- end
342
- )
343
- @list_jobs = Google::Gax.create_api_call(
344
- @job_service_stub.method(:list_jobs),
345
- defaults["list_jobs"],
346
- exception_transformer: exception_transformer,
347
- params_extractor: proc do |request|
348
- {'parent' => request.parent}
349
- end
350
- )
351
- @batch_delete_jobs = Google::Gax.create_api_call(
352
- @job_service_stub.method(:batch_delete_jobs),
353
- defaults["batch_delete_jobs"],
354
- exception_transformer: exception_transformer,
355
- params_extractor: proc do |request|
356
- {'parent' => request.parent}
357
- end
358
- )
359
- @search_jobs = Google::Gax.create_api_call(
360
- @job_service_stub.method(:search_jobs),
361
- defaults["search_jobs"],
362
- exception_transformer: exception_transformer,
363
- params_extractor: proc do |request|
364
- {'parent' => request.parent}
365
- end
366
- )
367
- @search_jobs_for_alert = Google::Gax.create_api_call(
368
- @job_service_stub.method(:search_jobs_for_alert),
369
- defaults["search_jobs_for_alert"],
370
- exception_transformer: exception_transformer,
371
- params_extractor: proc do |request|
372
- {'parent' => request.parent}
373
- end
374
- )
375
- @batch_create_jobs = Google::Gax.create_api_call(
376
- @job_service_stub.method(:batch_create_jobs),
377
- defaults["batch_create_jobs"],
378
- exception_transformer: exception_transformer,
379
- params_extractor: proc do |request|
380
- {'parent' => request.parent}
381
- end
382
- )
383
- @batch_update_jobs = Google::Gax.create_api_call(
384
- @job_service_stub.method(:batch_update_jobs),
385
- defaults["batch_update_jobs"],
386
- exception_transformer: exception_transformer,
387
- params_extractor: proc do |request|
388
- {'parent' => request.parent}
389
- end
390
- )
391
- end
392
-
393
- # Service calls
394
-
395
- # Creates a new job.
396
- #
397
- # Typically, the job becomes searchable within 10 seconds, but it may take
398
- # up to 5 minutes.
399
- #
400
- # @param parent [String]
401
- # Required. The resource name of the tenant under which the job is created.
402
- #
403
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
404
- # "projects/foo/tenant/bar". If tenant id is unspecified a default tenant
405
- # is created. For example, "projects/foo".
406
- # @param job [Google::Cloud::Talent::V4beta1::Job | Hash]
407
- # Required. The Job to be created.
408
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job`
409
- # can also be provided.
410
- # @param options [Google::Gax::CallOptions]
411
- # Overrides the default settings for this call, e.g, timeout,
412
- # retries, etc.
413
- # @yield [result, operation] Access the result along with the RPC operation
414
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Job]
415
- # @yieldparam operation [GRPC::ActiveCall::Operation]
416
- # @return [Google::Cloud::Talent::V4beta1::Job]
417
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
418
- # @example
419
- # require "google/cloud/talent"
420
- #
421
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
422
- # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]")
423
- #
424
- # # TODO: Initialize `job`:
425
- # job = {}
426
- # response = job_client.create_job(formatted_parent, job)
427
-
428
- def create_job \
429
- parent,
430
- job,
431
- options: nil,
432
- &block
433
- req = {
434
- parent: parent,
435
- job: job
436
- }.delete_if { |_, v| v.nil? }
437
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateJobRequest)
438
- @create_job.call(req, options, &block)
439
- end
440
-
441
- # Retrieves the specified job, whose status is OPEN or recently EXPIRED
442
- # within the last 90 days.
443
- #
444
- # @param name [String]
445
- # Required. The resource name of the job to retrieve.
446
- #
447
- # The format is
448
- # "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For
449
- # example, "projects/foo/tenants/bar/jobs/baz".
450
- #
451
- # If tenant id is unspecified, the default tenant is used. For
452
- # example, "projects/foo/jobs/bar".
453
- # @param options [Google::Gax::CallOptions]
454
- # Overrides the default settings for this call, e.g, timeout,
455
- # retries, etc.
456
- # @yield [result, operation] Access the result along with the RPC operation
457
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Job]
458
- # @yieldparam operation [GRPC::ActiveCall::Operation]
459
- # @return [Google::Cloud::Talent::V4beta1::Job]
460
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
461
- # @example
462
- # require "google/cloud/talent"
463
- #
464
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
465
- # formatted_name = Google::Cloud::Talent::V4beta1::JobServiceClient.job_path("[PROJECT]", "[TENANT]", "[JOBS]")
466
- # response = job_client.get_job(formatted_name)
467
-
468
- def get_job \
469
- name,
470
- options: nil,
471
- &block
472
- req = {
473
- name: name
474
- }.delete_if { |_, v| v.nil? }
475
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetJobRequest)
476
- @get_job.call(req, options, &block)
477
- end
478
-
479
- # Updates specified job.
480
- #
481
- # Typically, updated contents become visible in search results within 10
482
- # seconds, but it may take up to 5 minutes.
483
- #
484
- # @param job [Google::Cloud::Talent::V4beta1::Job | Hash]
485
- # Required. The Job to be updated.
486
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job`
487
- # can also be provided.
488
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
489
- # Strongly recommended for the best service experience.
490
- #
491
- # If {Google::Cloud::Talent::V4beta1::UpdateJobRequest#update_mask update_mask} is provided, only the specified fields in
492
- # {Google::Cloud::Talent::V4beta1::UpdateJobRequest#job job} are updated. Otherwise all the fields are updated.
493
- #
494
- # A field mask to restrict the fields that are updated. Only
495
- # top level fields of {Google::Cloud::Talent::V4beta1::Job Job} are supported.
496
- # A hash of the same form as `Google::Protobuf::FieldMask`
497
- # can also be provided.
498
- # @param options [Google::Gax::CallOptions]
499
- # Overrides the default settings for this call, e.g, timeout,
500
- # retries, etc.
501
- # @yield [result, operation] Access the result along with the RPC operation
502
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Job]
503
- # @yieldparam operation [GRPC::ActiveCall::Operation]
504
- # @return [Google::Cloud::Talent::V4beta1::Job]
505
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
506
- # @example
507
- # require "google/cloud/talent"
508
- #
509
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
510
- #
511
- # # TODO: Initialize `job`:
512
- # job = {}
513
- # response = job_client.update_job(job)
514
-
515
- def update_job \
516
- job,
517
- update_mask: nil,
518
- options: nil,
519
- &block
520
- req = {
521
- job: job,
522
- update_mask: update_mask
523
- }.delete_if { |_, v| v.nil? }
524
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateJobRequest)
525
- @update_job.call(req, options, &block)
526
- end
527
-
528
- # Deletes the specified job.
529
- #
530
- # Typically, the job becomes unsearchable within 10 seconds, but it may take
531
- # up to 5 minutes.
532
- #
533
- # @param name [String]
534
- # Required. The resource name of the job to be deleted.
535
- #
536
- # The format is
537
- # "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For
538
- # example, "projects/foo/tenants/bar/jobs/baz".
539
- #
540
- # If tenant id is unspecified, the default tenant is used. For
541
- # example, "projects/foo/jobs/bar".
542
- # @param options [Google::Gax::CallOptions]
543
- # Overrides the default settings for this call, e.g, timeout,
544
- # retries, etc.
545
- # @yield [result, operation] Access the result along with the RPC operation
546
- # @yieldparam result []
547
- # @yieldparam operation [GRPC::ActiveCall::Operation]
548
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
549
- # @example
550
- # require "google/cloud/talent"
551
- #
552
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
553
- # formatted_name = Google::Cloud::Talent::V4beta1::JobServiceClient.job_path("[PROJECT]", "[TENANT]", "[JOBS]")
554
- # job_client.delete_job(formatted_name)
555
-
556
- def delete_job \
557
- name,
558
- options: nil,
559
- &block
560
- req = {
561
- name: name
562
- }.delete_if { |_, v| v.nil? }
563
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteJobRequest)
564
- @delete_job.call(req, options, &block)
565
- nil
566
- end
567
-
568
- # Lists jobs by filter.
569
- #
570
- # @param parent [String]
571
- # Required. The resource name of the tenant under which the job is created.
572
- #
573
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
574
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
575
- # is created. For example, "projects/foo".
576
- # @param filter [String]
577
- # Required. The filter string specifies the jobs to be enumerated.
578
- #
579
- # Supported operator: =, AND
580
- #
581
- # The fields eligible for filtering are:
582
- #
583
- # * `companyName` (Required)
584
- # * `requisitionId`
585
- # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to
586
- # OPEN if no value is specified.
587
- #
588
- # Sample Query:
589
- #
590
- # * companyName = "projects/foo/tenants/bar/companies/baz"
591
- # * companyName = "projects/foo/tenants/bar/companies/baz" AND
592
- # requisitionId = "req-1"
593
- # * companyName = "projects/foo/tenants/bar/companies/baz" AND
594
- # status = "EXPIRED"
595
- # @param page_size [Integer]
596
- # The maximum number of resources contained in the underlying API
597
- # response. If page streaming is performed per-resource, this
598
- # parameter does not affect the return value. If page streaming is
599
- # performed per-page, this determines the maximum number of
600
- # resources in a page.
601
- # @param job_view [Google::Cloud::Talent::V4beta1::JobView]
602
- # The desired job attributes returned for jobs in the
603
- # search response. Defaults to {Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_FULL JobView::JOB_VIEW_FULL} if no value is
604
- # specified.
605
- # @param options [Google::Gax::CallOptions]
606
- # Overrides the default settings for this call, e.g, timeout,
607
- # retries, etc.
608
- # @yield [result, operation] Access the result along with the RPC operation
609
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Job>]
610
- # @yieldparam operation [GRPC::ActiveCall::Operation]
611
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Job>]
612
- # An enumerable of Google::Cloud::Talent::V4beta1::Job instances.
613
- # See Google::Gax::PagedEnumerable documentation for other
614
- # operations such as per-page iteration or access to the response
615
- # object.
616
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
617
- # @example
618
- # require "google/cloud/talent"
619
- #
620
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
621
- # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]")
622
- #
623
- # # TODO: Initialize `filter`:
624
- # filter = ''
625
- #
626
- # # Iterate over all results.
627
- # job_client.list_jobs(formatted_parent, filter).each do |element|
628
- # # Process element.
629
- # end
630
- #
631
- # # Or iterate over results one page at a time.
632
- # job_client.list_jobs(formatted_parent, filter).each_page do |page|
633
- # # Process each page at a time.
634
- # page.each do |element|
635
- # # Process element.
636
- # end
637
- # end
638
-
639
- def list_jobs \
640
- parent,
641
- filter,
642
- page_size: nil,
643
- job_view: nil,
644
- options: nil,
645
- &block
646
- req = {
647
- parent: parent,
648
- filter: filter,
649
- page_size: page_size,
650
- job_view: job_view
651
- }.delete_if { |_, v| v.nil? }
652
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListJobsRequest)
653
- @list_jobs.call(req, options, &block)
654
- end
655
-
656
- # Deletes a list of {Google::Cloud::Talent::V4beta1::Job Job}s by filter.
657
- #
658
- # @param parent [String]
659
- # Required. The resource name of the tenant under which the job is created.
660
- #
661
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
662
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
663
- # is created. For example, "projects/foo".
664
- # @param filter [String]
665
- # Required. The filter string specifies the jobs to be deleted.
666
- #
667
- # Supported operator: =, AND
668
- #
669
- # The fields eligible for filtering are:
670
- #
671
- # * `companyName` (Required)
672
- # * `requisitionId` (Required)
673
- #
674
- # Sample Query: companyName = "projects/foo/companies/bar" AND
675
- # requisitionId = "req-1"
676
- # @param options [Google::Gax::CallOptions]
677
- # Overrides the default settings for this call, e.g, timeout,
678
- # retries, etc.
679
- # @yield [result, operation] Access the result along with the RPC operation
680
- # @yieldparam result []
681
- # @yieldparam operation [GRPC::ActiveCall::Operation]
682
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
683
- # @example
684
- # require "google/cloud/talent"
685
- #
686
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
687
- # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]")
688
- #
689
- # # TODO: Initialize `filter`:
690
- # filter = ''
691
- # job_client.batch_delete_jobs(formatted_parent, filter)
692
-
693
- def batch_delete_jobs \
694
- parent,
695
- filter,
696
- options: nil,
697
- &block
698
- req = {
699
- parent: parent,
700
- filter: filter
701
- }.delete_if { |_, v| v.nil? }
702
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest)
703
- @batch_delete_jobs.call(req, options, &block)
704
- nil
705
- end
706
-
707
- # Searches for jobs using the provided {Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}.
708
- #
709
- # This call constrains the {Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs
710
- # present in the database, and only returns jobs that the caller has
711
- # permission to search against.
712
- #
713
- # @param parent [String]
714
- # Required. The resource name of the tenant to search within.
715
- #
716
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
717
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
718
- # is created. For example, "projects/foo".
719
- # @param request_metadata [Google::Cloud::Talent::V4beta1::RequestMetadata | Hash]
720
- # Required. The meta information collected about the job searcher, used to improve the
721
- # search quality of the service. The identifiers (such as `user_id`) are
722
- # provided by users, and must be unique and consistent.
723
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::RequestMetadata`
724
- # can also be provided.
725
- # @param search_mode [Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode]
726
- # Mode of a search.
727
- #
728
- # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode::JOB_SEARCH}.
729
- # @param job_query [Google::Cloud::Talent::V4beta1::JobQuery | Hash]
730
- # Query used to search against jobs, such as keyword, location filters, etc.
731
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::JobQuery`
732
- # can also be provided.
733
- # @param enable_broadening [true, false]
734
- # Controls whether to broaden the search when it produces sparse results.
735
- # Broadened queries append results to the end of the matching results
736
- # list.
737
- #
738
- # Defaults to false.
739
- # @param require_precise_result_size [true, false]
740
- # Controls if the search job request requires the return of a precise
741
- # count of the first 300 results. Setting this to `true` ensures
742
- # consistency in the number of results per page. Best practice is to set this
743
- # value to true if a client allows users to jump directly to a
744
- # non-sequential search results page.
745
- #
746
- # Enabling this flag may adversely impact performance.
747
- #
748
- # Defaults to false.
749
- # @param histogram_queries [Array<Google::Cloud::Talent::V4beta1::HistogramQuery | Hash>]
750
- # An expression specifies a histogram request against matching jobs.
751
- #
752
- # Expression syntax is an aggregation function call with histogram facets and
753
- # other options.
754
- #
755
- # Available aggregation function calls are:
756
- # * `count(string_histogram_facet)`: Count the number of matching entities,
757
- # for each distinct attribute value.
758
- # * `count(numeric_histogram_facet, list of buckets)`: Count the number of
759
- # matching entities within each bucket.
760
- #
761
- # Data types:
762
- #
763
- # * Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+.
764
- # * String: string like "any string with backslash escape for quote(\")."
765
- # * Number: whole number and floating point number like 10, -1 and -0.01.
766
- # * List: list of elements with comma(,) separator surrounded by square
767
- # brackets, for example, [1, 2, 3] and ["one", "two", "three"].
768
- #
769
- # Built-in constants:
770
- #
771
- # * MIN (minimum number similar to java Double.MIN_VALUE)
772
- # * MAX (maximum number similar to java Double.MAX_VALUE)
773
- #
774
- # Built-in functions:
775
- #
776
- # * bucket(start, end[, label]): bucket built-in function creates a bucket
777
- # with range of [start, end). Note that the end is exclusive, for example,
778
- # bucket(1, MAX, "positive number") or bucket(1, 10).
779
- #
780
- # Job histogram facets:
781
- #
782
- # * company_display_name: histogram by {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}.
783
- # * employment_type: histogram by {Google::Cloud::Talent::V4beta1::Job#employment_types Job#employment_types}, for example,
784
- # "FULL_TIME", "PART_TIME".
785
- # * company_size: histogram by {Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, "SMALL",
786
- # "MEDIUM", "BIG".
787
- # * publish_time_in_month: histogram by the {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time}
788
- # in months.
789
- # Must specify list of numeric buckets in spec.
790
- # * publish_time_in_year: histogram by the {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time}
791
- # in years.
792
- # Must specify list of numeric buckets in spec.
793
- # * degree_types: histogram by the {Google::Cloud::Talent::V4beta1::Job#degree_types Job#degree_types}, for example,
794
- # "Bachelors", "Masters".
795
- # * job_level: histogram by the {Google::Cloud::Talent::V4beta1::Job#job_level Job#job_level}, for example, "Entry
796
- # Level".
797
- # * country: histogram by the country code of jobs, for example, "US", "FR".
798
- # * admin1: histogram by the admin1 code of jobs, which is a global
799
- # placeholder referring to the state, province, or the particular term a
800
- # country uses to define the geographic structure below the country level,
801
- # for example, "CA", "IL".
802
- # * city: histogram by a combination of the "city name, admin1 code". For
803
- # example, "Mountain View, CA", "New York, NY".
804
- # * admin1_country: histogram by a combination of the "admin1 code, country",
805
- # for example, "CA, US", "IL, US".
806
- # * city_coordinate: histogram by the city center's GPS coordinates (latitude
807
- # and longitude), for example, 37.4038522,-122.0987765. Since the
808
- # coordinates of a city center can change, customers may need to refresh
809
- # them periodically.
810
- # * locale: histogram by the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, for example, "en-US",
811
- # "fr-FR".
812
- # * language: histogram by the language subtag of the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code},
813
- # for example, "en", "fr".
814
- # * category: histogram by the {Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example,
815
- # "COMPUTER_AND_IT", "HEALTHCARE".
816
- # * base_compensation_unit: histogram by the
817
- # {Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo::CompensationUnit} of base
818
- # salary, for example, "WEEKLY", "MONTHLY".
819
- # * base_compensation: histogram by the base salary. Must specify list of
820
- # numeric buckets to group results by.
821
- # * annualized_base_compensation: histogram by the base annualized salary.
822
- # Must specify list of numeric buckets to group results by.
823
- # * annualized_total_compensation: histogram by the total annualized salary.
824
- # Must specify list of numeric buckets to group results by.
825
- # * string_custom_attribute: histogram by string {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}.
826
- # Values can be accessed via square bracket notations like
827
- # string_custom_attribute["key1"].
828
- # * numeric_custom_attribute: histogram by numeric {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}.
829
- # Values can be accessed via square bracket notations like
830
- # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to
831
- # group results by.
832
- #
833
- # Example expressions:
834
- #
835
- # * `count(admin1)`
836
- # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000),
837
- # bucket(100000, MAX)])`
838
- # * `count(string_custom_attribute["some-string-custom-attribute"])`
839
- # * `count(numeric_custom_attribute["some-numeric-custom-attribute"],
840
- # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"])`
841
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::HistogramQuery`
842
- # can also be provided.
843
- # @param job_view [Google::Cloud::Talent::V4beta1::JobView]
844
- # The desired job attributes returned for jobs in the search response.
845
- # Defaults to {Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView::JOB_VIEW_SMALL} if no value is specified.
846
- # @param offset [Integer]
847
- # An integer that specifies the current offset (that is, starting result
848
- # location, amongst the jobs deemed by the API as relevant) in search
849
- # results. This field is only considered if {Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is unset.
850
- #
851
- # The maximum allowed value is 5000. Otherwise an error is thrown.
852
- #
853
- # The maximum allowed value is 5000. Otherwise an error is thrown.
854
- #
855
- # For example, 0 means to return results starting from the first matching
856
- # job, and 10 means to return from the 11th job. This can be used for
857
- # pagination, (for example, pageSize = 10 and offset = 10 means to return
858
- # from the second page).
859
- # @param page_size [Integer]
860
- # The maximum number of resources contained in the underlying API
861
- # response. If page streaming is performed per-resource, this
862
- # parameter does not affect the return value. If page streaming is
863
- # performed per-page, this determines the maximum number of
864
- # resources in a page.
865
- # @param order_by [String]
866
- # The criteria determining how search results are sorted. Default is
867
- # `"relevance desc"`.
868
- #
869
- # Supported options are:
870
- #
871
- # * `"relevance desc"`: By relevance descending, as determined by the API
872
- # algorithms. Relevance thresholding of query results is only available
873
- # with this ordering.
874
- # * `"posting_publish_time desc"`: By {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time}
875
- # descending.
876
- # * `"posting_update_time desc"`: By {Google::Cloud::Talent::V4beta1::Job#posting_update_time Job#posting_update_time}
877
- # descending.
878
- # * `"title"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} ascending.
879
- # * `"title desc"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} descending.
880
- # * `"annualized_base_compensation"`: By job's
881
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} ascending. Jobs
882
- # whose annualized base compensation is unspecified are put at the end of
883
- # search results.
884
- # * `"annualized_base_compensation desc"`: By job's
885
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} descending. Jobs
886
- # whose annualized base compensation is unspecified are put at the end of
887
- # search results.
888
- # * `"annualized_total_compensation"`: By job's
889
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} ascending. Jobs
890
- # whose annualized base compensation is unspecified are put at the end of
891
- # search results.
892
- # * `"annualized_total_compensation desc"`: By job's
893
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} descending. Jobs
894
- # whose annualized base compensation is unspecified are put at the end of
895
- # search results.
896
- # * `"custom_ranking desc"`: By the relevance score adjusted to the
897
- # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest::CustomRankingInfo#ranking_expression} with weight
898
- # factor assigned by
899
- # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest::CustomRankingInfo#importance_level} in descending
900
- # order.
901
- # * Location sorting: Use the special syntax to order jobs by distance:<br>
902
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.<br>
903
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.<br>
904
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by
905
- # multiple locations. See details below.<br>
906
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by
907
- # multiple locations. See details below.<br>
908
- # The string can have a maximum of 256 characters. When multiple distance
909
- # centers are provided, a job that is close to any of the distance centers
910
- # would have a high rank. When a job has multiple locations, the job
911
- # location closest to one of the distance centers will be used. Jobs that
912
- # don't have locations will be ranked at the bottom. Distance is calculated
913
- # with a precision of 11.3 meters (37.4 feet). Diversification strategy is
914
- # still applied unless explicitly disabled in
915
- # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}.
916
- # @param diversification_level [Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel]
917
- # Controls whether highly similar jobs are returned next to each other in
918
- # the search results. Jobs are identified as highly similar based on
919
- # their titles, job categories, and locations. Highly similar results are
920
- # clustered so that only one representative job of the cluster is
921
- # displayed to the job seeker higher up in the results, with the other jobs
922
- # being displayed lower down in the results.
923
- #
924
- # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel::SIMPLE} if no value
925
- # is specified.
926
- # @param custom_ranking_info [Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo | Hash]
927
- # Controls over how job documents get ranked on top of existing relevance
928
- # score (determined by API algorithm).
929
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo`
930
- # can also be provided.
931
- # @param disable_keyword_match [true, false]
932
- # Controls whether to disable exact keyword match on {Google::Cloud::Talent::V4beta1::Job#title Job#title},
933
- # {Google::Cloud::Talent::V4beta1::Job#description Job#description}, {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}, {Google::Cloud::Talent::V4beta1::Job#addresses Job#addresses},
934
- # {Google::Cloud::Talent::V4beta1::Job#qualifications Job#qualifications}. When disable keyword match is turned off, a
935
- # keyword match returns jobs that do not match given category filters when
936
- # there are matching keywords. For example, for the query "program manager,"
937
- # a result is returned even if the job posting has the title "software
938
- # developer," which doesn't fall into "program manager" ontology, but does
939
- # have "program manager" appearing in its description.
940
- #
941
- # For queries like "cloud" that don't contain title or
942
- # location specific ontology, jobs with "cloud" keyword matches are returned
943
- # regardless of this flag's value.
944
- #
945
- # Use {Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company#keyword_searchable_job_custom_attributes} if
946
- # company-specific globally matched custom field/attribute string values are
947
- # needed. Enabling keyword match improves recall of subsequent search
948
- # requests.
949
- #
950
- # Defaults to false.
951
- # @param options [Google::Gax::CallOptions]
952
- # Overrides the default settings for this call, e.g, timeout,
953
- # retries, etc.
954
- # @yield [result, operation] Access the result along with the RPC operation
955
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob>]
956
- # @yieldparam operation [GRPC::ActiveCall::Operation]
957
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob>]
958
- # An enumerable of Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob instances.
959
- # See Google::Gax::PagedEnumerable documentation for other
960
- # operations such as per-page iteration or access to the response
961
- # object.
962
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
963
- # @example
964
- # require "google/cloud/talent"
965
- #
966
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
967
- # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]")
968
- #
969
- # # TODO: Initialize `request_metadata`:
970
- # request_metadata = {}
971
- #
972
- # # Iterate over all results.
973
- # job_client.search_jobs(formatted_parent, request_metadata).each do |element|
974
- # # Process element.
975
- # end
976
- #
977
- # # Or iterate over results one page at a time.
978
- # job_client.search_jobs(formatted_parent, request_metadata).each_page do |page|
979
- # # Process each page at a time.
980
- # page.each do |element|
981
- # # Process element.
982
- # end
983
- # end
984
-
985
- def search_jobs \
986
- parent,
987
- request_metadata,
988
- search_mode: nil,
989
- job_query: nil,
990
- enable_broadening: nil,
991
- require_precise_result_size: nil,
992
- histogram_queries: nil,
993
- job_view: nil,
994
- offset: nil,
995
- page_size: nil,
996
- order_by: nil,
997
- diversification_level: nil,
998
- custom_ranking_info: nil,
999
- disable_keyword_match: nil,
1000
- options: nil,
1001
- &block
1002
- req = {
1003
- parent: parent,
1004
- request_metadata: request_metadata,
1005
- search_mode: search_mode,
1006
- job_query: job_query,
1007
- enable_broadening: enable_broadening,
1008
- require_precise_result_size: require_precise_result_size,
1009
- histogram_queries: histogram_queries,
1010
- job_view: job_view,
1011
- offset: offset,
1012
- page_size: page_size,
1013
- order_by: order_by,
1014
- diversification_level: diversification_level,
1015
- custom_ranking_info: custom_ranking_info,
1016
- disable_keyword_match: disable_keyword_match
1017
- }.delete_if { |_, v| v.nil? }
1018
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::SearchJobsRequest)
1019
- @search_jobs.call(req, options, &block)
1020
- end
1021
-
1022
- # Searches for jobs using the provided {Google::Cloud::Talent::V4beta1::SearchJobsRequest SearchJobsRequest}.
1023
- #
1024
- # This API call is intended for the use case of targeting passive job
1025
- # seekers (for example, job seekers who have signed up to receive email
1026
- # alerts about potential job opportunities), and has different algorithmic
1027
- # adjustments that are targeted to passive job seekers.
1028
- #
1029
- # This call constrains the {Google::Cloud::Talent::V4beta1::Job#visibility visibility} of jobs
1030
- # present in the database, and only returns jobs the caller has
1031
- # permission to search against.
1032
- #
1033
- # @param parent [String]
1034
- # Required. The resource name of the tenant to search within.
1035
- #
1036
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
1037
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
1038
- # is created. For example, "projects/foo".
1039
- # @param request_metadata [Google::Cloud::Talent::V4beta1::RequestMetadata | Hash]
1040
- # Required. The meta information collected about the job searcher, used to improve the
1041
- # search quality of the service. The identifiers (such as `user_id`) are
1042
- # provided by users, and must be unique and consistent.
1043
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::RequestMetadata`
1044
- # can also be provided.
1045
- # @param search_mode [Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode]
1046
- # Mode of a search.
1047
- #
1048
- # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode::JOB_SEARCH}.
1049
- # @param job_query [Google::Cloud::Talent::V4beta1::JobQuery | Hash]
1050
- # Query used to search against jobs, such as keyword, location filters, etc.
1051
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::JobQuery`
1052
- # can also be provided.
1053
- # @param enable_broadening [true, false]
1054
- # Controls whether to broaden the search when it produces sparse results.
1055
- # Broadened queries append results to the end of the matching results
1056
- # list.
1057
- #
1058
- # Defaults to false.
1059
- # @param require_precise_result_size [true, false]
1060
- # Controls if the search job request requires the return of a precise
1061
- # count of the first 300 results. Setting this to `true` ensures
1062
- # consistency in the number of results per page. Best practice is to set this
1063
- # value to true if a client allows users to jump directly to a
1064
- # non-sequential search results page.
1065
- #
1066
- # Enabling this flag may adversely impact performance.
1067
- #
1068
- # Defaults to false.
1069
- # @param histogram_queries [Array<Google::Cloud::Talent::V4beta1::HistogramQuery | Hash>]
1070
- # An expression specifies a histogram request against matching jobs.
1071
- #
1072
- # Expression syntax is an aggregation function call with histogram facets and
1073
- # other options.
1074
- #
1075
- # Available aggregation function calls are:
1076
- # * `count(string_histogram_facet)`: Count the number of matching entities,
1077
- # for each distinct attribute value.
1078
- # * `count(numeric_histogram_facet, list of buckets)`: Count the number of
1079
- # matching entities within each bucket.
1080
- #
1081
- # Data types:
1082
- #
1083
- # * Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+.
1084
- # * String: string like "any string with backslash escape for quote(\")."
1085
- # * Number: whole number and floating point number like 10, -1 and -0.01.
1086
- # * List: list of elements with comma(,) separator surrounded by square
1087
- # brackets, for example, [1, 2, 3] and ["one", "two", "three"].
1088
- #
1089
- # Built-in constants:
1090
- #
1091
- # * MIN (minimum number similar to java Double.MIN_VALUE)
1092
- # * MAX (maximum number similar to java Double.MAX_VALUE)
1093
- #
1094
- # Built-in functions:
1095
- #
1096
- # * bucket(start, end[, label]): bucket built-in function creates a bucket
1097
- # with range of [start, end). Note that the end is exclusive, for example,
1098
- # bucket(1, MAX, "positive number") or bucket(1, 10).
1099
- #
1100
- # Job histogram facets:
1101
- #
1102
- # * company_display_name: histogram by {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}.
1103
- # * employment_type: histogram by {Google::Cloud::Talent::V4beta1::Job#employment_types Job#employment_types}, for example,
1104
- # "FULL_TIME", "PART_TIME".
1105
- # * company_size: histogram by {Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, "SMALL",
1106
- # "MEDIUM", "BIG".
1107
- # * publish_time_in_month: histogram by the {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time}
1108
- # in months.
1109
- # Must specify list of numeric buckets in spec.
1110
- # * publish_time_in_year: histogram by the {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time}
1111
- # in years.
1112
- # Must specify list of numeric buckets in spec.
1113
- # * degree_types: histogram by the {Google::Cloud::Talent::V4beta1::Job#degree_types Job#degree_types}, for example,
1114
- # "Bachelors", "Masters".
1115
- # * job_level: histogram by the {Google::Cloud::Talent::V4beta1::Job#job_level Job#job_level}, for example, "Entry
1116
- # Level".
1117
- # * country: histogram by the country code of jobs, for example, "US", "FR".
1118
- # * admin1: histogram by the admin1 code of jobs, which is a global
1119
- # placeholder referring to the state, province, or the particular term a
1120
- # country uses to define the geographic structure below the country level,
1121
- # for example, "CA", "IL".
1122
- # * city: histogram by a combination of the "city name, admin1 code". For
1123
- # example, "Mountain View, CA", "New York, NY".
1124
- # * admin1_country: histogram by a combination of the "admin1 code, country",
1125
- # for example, "CA, US", "IL, US".
1126
- # * city_coordinate: histogram by the city center's GPS coordinates (latitude
1127
- # and longitude), for example, 37.4038522,-122.0987765. Since the
1128
- # coordinates of a city center can change, customers may need to refresh
1129
- # them periodically.
1130
- # * locale: histogram by the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code}, for example, "en-US",
1131
- # "fr-FR".
1132
- # * language: histogram by the language subtag of the {Google::Cloud::Talent::V4beta1::Job#language_code Job#language_code},
1133
- # for example, "en", "fr".
1134
- # * category: histogram by the {Google::Cloud::Talent::V4beta1::JobCategory JobCategory}, for example,
1135
- # "COMPUTER_AND_IT", "HEALTHCARE".
1136
- # * base_compensation_unit: histogram by the
1137
- # {Google::Cloud::Talent::V4beta1::CompensationInfo::CompensationUnit CompensationInfo::CompensationUnit} of base
1138
- # salary, for example, "WEEKLY", "MONTHLY".
1139
- # * base_compensation: histogram by the base salary. Must specify list of
1140
- # numeric buckets to group results by.
1141
- # * annualized_base_compensation: histogram by the base annualized salary.
1142
- # Must specify list of numeric buckets to group results by.
1143
- # * annualized_total_compensation: histogram by the total annualized salary.
1144
- # Must specify list of numeric buckets to group results by.
1145
- # * string_custom_attribute: histogram by string {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}.
1146
- # Values can be accessed via square bracket notations like
1147
- # string_custom_attribute["key1"].
1148
- # * numeric_custom_attribute: histogram by numeric {Google::Cloud::Talent::V4beta1::Job#custom_attributes Job#custom_attributes}.
1149
- # Values can be accessed via square bracket notations like
1150
- # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to
1151
- # group results by.
1152
- #
1153
- # Example expressions:
1154
- #
1155
- # * `count(admin1)`
1156
- # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000),
1157
- # bucket(100000, MAX)])`
1158
- # * `count(string_custom_attribute["some-string-custom-attribute"])`
1159
- # * `count(numeric_custom_attribute["some-numeric-custom-attribute"],
1160
- # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"])`
1161
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::HistogramQuery`
1162
- # can also be provided.
1163
- # @param job_view [Google::Cloud::Talent::V4beta1::JobView]
1164
- # The desired job attributes returned for jobs in the search response.
1165
- # Defaults to {Google::Cloud::Talent::V4beta1::JobView::JOB_VIEW_SMALL JobView::JOB_VIEW_SMALL} if no value is specified.
1166
- # @param offset [Integer]
1167
- # An integer that specifies the current offset (that is, starting result
1168
- # location, amongst the jobs deemed by the API as relevant) in search
1169
- # results. This field is only considered if {Google::Cloud::Talent::V4beta1::SearchJobsRequest#page_token page_token} is unset.
1170
- #
1171
- # The maximum allowed value is 5000. Otherwise an error is thrown.
1172
- #
1173
- # The maximum allowed value is 5000. Otherwise an error is thrown.
1174
- #
1175
- # For example, 0 means to return results starting from the first matching
1176
- # job, and 10 means to return from the 11th job. This can be used for
1177
- # pagination, (for example, pageSize = 10 and offset = 10 means to return
1178
- # from the second page).
1179
- # @param page_size [Integer]
1180
- # The maximum number of resources contained in the underlying API
1181
- # response. If page streaming is performed per-resource, this
1182
- # parameter does not affect the return value. If page streaming is
1183
- # performed per-page, this determines the maximum number of
1184
- # resources in a page.
1185
- # @param order_by [String]
1186
- # The criteria determining how search results are sorted. Default is
1187
- # `"relevance desc"`.
1188
- #
1189
- # Supported options are:
1190
- #
1191
- # * `"relevance desc"`: By relevance descending, as determined by the API
1192
- # algorithms. Relevance thresholding of query results is only available
1193
- # with this ordering.
1194
- # * `"posting_publish_time desc"`: By {Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job#posting_publish_time}
1195
- # descending.
1196
- # * `"posting_update_time desc"`: By {Google::Cloud::Talent::V4beta1::Job#posting_update_time Job#posting_update_time}
1197
- # descending.
1198
- # * `"title"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} ascending.
1199
- # * `"title desc"`: By {Google::Cloud::Talent::V4beta1::Job#title Job#title} descending.
1200
- # * `"annualized_base_compensation"`: By job's
1201
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} ascending. Jobs
1202
- # whose annualized base compensation is unspecified are put at the end of
1203
- # search results.
1204
- # * `"annualized_base_compensation desc"`: By job's
1205
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_base_compensation_range CompensationInfo#annualized_base_compensation_range} descending. Jobs
1206
- # whose annualized base compensation is unspecified are put at the end of
1207
- # search results.
1208
- # * `"annualized_total_compensation"`: By job's
1209
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} ascending. Jobs
1210
- # whose annualized base compensation is unspecified are put at the end of
1211
- # search results.
1212
- # * `"annualized_total_compensation desc"`: By job's
1213
- # {Google::Cloud::Talent::V4beta1::CompensationInfo#annualized_total_compensation_range CompensationInfo#annualized_total_compensation_range} descending. Jobs
1214
- # whose annualized base compensation is unspecified are put at the end of
1215
- # search results.
1216
- # * `"custom_ranking desc"`: By the relevance score adjusted to the
1217
- # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest::CustomRankingInfo#ranking_expression} with weight
1218
- # factor assigned by
1219
- # {Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest::CustomRankingInfo#importance_level} in descending
1220
- # order.
1221
- # * Location sorting: Use the special syntax to order jobs by distance:<br>
1222
- # `"distance_from('Hawaii')"`: Order by distance from Hawaii.<br>
1223
- # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.<br>
1224
- # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by
1225
- # multiple locations. See details below.<br>
1226
- # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by
1227
- # multiple locations. See details below.<br>
1228
- # The string can have a maximum of 256 characters. When multiple distance
1229
- # centers are provided, a job that is close to any of the distance centers
1230
- # would have a high rank. When a job has multiple locations, the job
1231
- # location closest to one of the distance centers will be used. Jobs that
1232
- # don't have locations will be ranked at the bottom. Distance is calculated
1233
- # with a precision of 11.3 meters (37.4 feet). Diversification strategy is
1234
- # still applied unless explicitly disabled in
1235
- # {Google::Cloud::Talent::V4beta1::SearchJobsRequest#diversification_level diversification_level}.
1236
- # @param diversification_level [Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel]
1237
- # Controls whether highly similar jobs are returned next to each other in
1238
- # the search results. Jobs are identified as highly similar based on
1239
- # their titles, job categories, and locations. Highly similar results are
1240
- # clustered so that only one representative job of the cluster is
1241
- # displayed to the job seeker higher up in the results, with the other jobs
1242
- # being displayed lower down in the results.
1243
- #
1244
- # Defaults to {Google::Cloud::Talent::V4beta1::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel::SIMPLE} if no value
1245
- # is specified.
1246
- # @param custom_ranking_info [Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo | Hash]
1247
- # Controls over how job documents get ranked on top of existing relevance
1248
- # score (determined by API algorithm).
1249
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::SearchJobsRequest::CustomRankingInfo`
1250
- # can also be provided.
1251
- # @param disable_keyword_match [true, false]
1252
- # Controls whether to disable exact keyword match on {Google::Cloud::Talent::V4beta1::Job#title Job#title},
1253
- # {Google::Cloud::Talent::V4beta1::Job#description Job#description}, {Google::Cloud::Talent::V4beta1::Job#company_display_name Job#company_display_name}, {Google::Cloud::Talent::V4beta1::Job#addresses Job#addresses},
1254
- # {Google::Cloud::Talent::V4beta1::Job#qualifications Job#qualifications}. When disable keyword match is turned off, a
1255
- # keyword match returns jobs that do not match given category filters when
1256
- # there are matching keywords. For example, for the query "program manager,"
1257
- # a result is returned even if the job posting has the title "software
1258
- # developer," which doesn't fall into "program manager" ontology, but does
1259
- # have "program manager" appearing in its description.
1260
- #
1261
- # For queries like "cloud" that don't contain title or
1262
- # location specific ontology, jobs with "cloud" keyword matches are returned
1263
- # regardless of this flag's value.
1264
- #
1265
- # Use {Google::Cloud::Talent::V4beta1::Company#keyword_searchable_job_custom_attributes Company#keyword_searchable_job_custom_attributes} if
1266
- # company-specific globally matched custom field/attribute string values are
1267
- # needed. Enabling keyword match improves recall of subsequent search
1268
- # requests.
1269
- #
1270
- # Defaults to false.
1271
- # @param options [Google::Gax::CallOptions]
1272
- # Overrides the default settings for this call, e.g, timeout,
1273
- # retries, etc.
1274
- # @yield [result, operation] Access the result along with the RPC operation
1275
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob>]
1276
- # @yieldparam operation [GRPC::ActiveCall::Operation]
1277
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob>]
1278
- # An enumerable of Google::Cloud::Talent::V4beta1::SearchJobsResponse::MatchingJob instances.
1279
- # See Google::Gax::PagedEnumerable documentation for other
1280
- # operations such as per-page iteration or access to the response
1281
- # object.
1282
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1283
- # @example
1284
- # require "google/cloud/talent"
1285
- #
1286
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
1287
- # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]")
1288
- #
1289
- # # TODO: Initialize `request_metadata`:
1290
- # request_metadata = {}
1291
- #
1292
- # # Iterate over all results.
1293
- # job_client.search_jobs_for_alert(formatted_parent, request_metadata).each do |element|
1294
- # # Process element.
1295
- # end
1296
- #
1297
- # # Or iterate over results one page at a time.
1298
- # job_client.search_jobs_for_alert(formatted_parent, request_metadata).each_page do |page|
1299
- # # Process each page at a time.
1300
- # page.each do |element|
1301
- # # Process element.
1302
- # end
1303
- # end
1304
-
1305
- def search_jobs_for_alert \
1306
- parent,
1307
- request_metadata,
1308
- search_mode: nil,
1309
- job_query: nil,
1310
- enable_broadening: nil,
1311
- require_precise_result_size: nil,
1312
- histogram_queries: nil,
1313
- job_view: nil,
1314
- offset: nil,
1315
- page_size: nil,
1316
- order_by: nil,
1317
- diversification_level: nil,
1318
- custom_ranking_info: nil,
1319
- disable_keyword_match: nil,
1320
- options: nil,
1321
- &block
1322
- req = {
1323
- parent: parent,
1324
- request_metadata: request_metadata,
1325
- search_mode: search_mode,
1326
- job_query: job_query,
1327
- enable_broadening: enable_broadening,
1328
- require_precise_result_size: require_precise_result_size,
1329
- histogram_queries: histogram_queries,
1330
- job_view: job_view,
1331
- offset: offset,
1332
- page_size: page_size,
1333
- order_by: order_by,
1334
- diversification_level: diversification_level,
1335
- custom_ranking_info: custom_ranking_info,
1336
- disable_keyword_match: disable_keyword_match
1337
- }.delete_if { |_, v| v.nil? }
1338
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::SearchJobsRequest)
1339
- @search_jobs_for_alert.call(req, options, &block)
1340
- end
1341
-
1342
- # Begins executing a batch create jobs operation.
1343
- #
1344
- # @param parent [String]
1345
- # Required. The resource name of the tenant under which the job is created.
1346
- #
1347
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
1348
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
1349
- # is created. For example, "projects/foo".
1350
- # @param jobs [Array<Google::Cloud::Talent::V4beta1::Job | Hash>]
1351
- # Required. The jobs to be created.
1352
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job`
1353
- # can also be provided.
1354
- # @param options [Google::Gax::CallOptions]
1355
- # Overrides the default settings for this call, e.g, timeout,
1356
- # retries, etc.
1357
- # @return [Google::Gax::Operation]
1358
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1359
- # @example
1360
- # require "google/cloud/talent"
1361
- #
1362
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
1363
- # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]")
1364
- #
1365
- # # TODO: Initialize `jobs`:
1366
- # jobs = []
1367
- #
1368
- # # Register a callback during the method call.
1369
- # operation = job_client.batch_create_jobs(formatted_parent, jobs) do |op|
1370
- # raise op.results.message if op.error?
1371
- # op_results = op.results
1372
- # # Process the results.
1373
- #
1374
- # metadata = op.metadata
1375
- # # Process the metadata.
1376
- # end
1377
- #
1378
- # # Or use the return value to register a callback.
1379
- # operation.on_done do |op|
1380
- # raise op.results.message if op.error?
1381
- # op_results = op.results
1382
- # # Process the results.
1383
- #
1384
- # metadata = op.metadata
1385
- # # Process the metadata.
1386
- # end
1387
- #
1388
- # # Manually reload the operation.
1389
- # operation.reload!
1390
- #
1391
- # # Or block until the operation completes, triggering callbacks on
1392
- # # completion.
1393
- # operation.wait_until_done!
1394
-
1395
- def batch_create_jobs \
1396
- parent,
1397
- jobs,
1398
- options: nil
1399
- req = {
1400
- parent: parent,
1401
- jobs: jobs
1402
- }.delete_if { |_, v| v.nil? }
1403
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest)
1404
- operation = Google::Gax::Operation.new(
1405
- @batch_create_jobs.call(req, options),
1406
- @operations_client,
1407
- Google::Cloud::Talent::V4beta1::JobOperationResult,
1408
- Google::Cloud::Talent::V4beta1::BatchOperationMetadata,
1409
- call_options: options
1410
- )
1411
- operation.on_done { |operation| yield(operation) } if block_given?
1412
- operation
1413
- end
1414
-
1415
- # Begins executing a batch update jobs operation.
1416
- #
1417
- # @param parent [String]
1418
- # Required. The resource name of the tenant under which the job is created.
1419
- #
1420
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
1421
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
1422
- # is created. For example, "projects/foo".
1423
- # @param jobs [Array<Google::Cloud::Talent::V4beta1::Job | Hash>]
1424
- # Required. The jobs to be updated.
1425
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Job`
1426
- # can also be provided.
1427
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
1428
- # Strongly recommended for the best service experience. Be aware that it will
1429
- # also increase latency when checking the status of a batch operation.
1430
- #
1431
- # If {Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} is provided, only the specified fields in
1432
- # {Google::Cloud::Talent::V4beta1::Job Job} are updated. Otherwise all the fields are updated.
1433
- #
1434
- # A field mask to restrict the fields that are updated. Only
1435
- # top level fields of {Google::Cloud::Talent::V4beta1::Job Job} are supported.
1436
- #
1437
- # If {Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest#update_mask update_mask} is provided, The {Google::Cloud::Talent::V4beta1::Job Job} inside
1438
- # {Google::Cloud::Talent::V4beta1::JobOperationResult::JobResult JobResult}
1439
- # will only contains fields that is updated, plus the Id of the Job.
1440
- # Otherwise, {Google::Cloud::Talent::V4beta1::Job Job} will include all fields, which can yield a very
1441
- # large response.
1442
- # A hash of the same form as `Google::Protobuf::FieldMask`
1443
- # can also be provided.
1444
- # @param options [Google::Gax::CallOptions]
1445
- # Overrides the default settings for this call, e.g, timeout,
1446
- # retries, etc.
1447
- # @return [Google::Gax::Operation]
1448
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
1449
- # @example
1450
- # require "google/cloud/talent"
1451
- #
1452
- # job_client = Google::Cloud::Talent::JobService.new(version: :v4beta1)
1453
- # formatted_parent = Google::Cloud::Talent::V4beta1::JobServiceClient.tenant_path("[PROJECT]", "[TENANT]")
1454
- #
1455
- # # TODO: Initialize `jobs`:
1456
- # jobs = []
1457
- #
1458
- # # Register a callback during the method call.
1459
- # operation = job_client.batch_update_jobs(formatted_parent, jobs) do |op|
1460
- # raise op.results.message if op.error?
1461
- # op_results = op.results
1462
- # # Process the results.
1463
- #
1464
- # metadata = op.metadata
1465
- # # Process the metadata.
1466
- # end
1467
- #
1468
- # # Or use the return value to register a callback.
1469
- # operation.on_done do |op|
1470
- # raise op.results.message if op.error?
1471
- # op_results = op.results
1472
- # # Process the results.
1473
- #
1474
- # metadata = op.metadata
1475
- # # Process the metadata.
1476
- # end
1477
- #
1478
- # # Manually reload the operation.
1479
- # operation.reload!
1480
- #
1481
- # # Or block until the operation completes, triggering callbacks on
1482
- # # completion.
1483
- # operation.wait_until_done!
1484
-
1485
- def batch_update_jobs \
1486
- parent,
1487
- jobs,
1488
- update_mask: nil,
1489
- options: nil
1490
- req = {
1491
- parent: parent,
1492
- jobs: jobs,
1493
- update_mask: update_mask
1494
- }.delete_if { |_, v| v.nil? }
1495
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest)
1496
- operation = Google::Gax::Operation.new(
1497
- @batch_update_jobs.call(req, options),
1498
- @operations_client,
1499
- Google::Cloud::Talent::V4beta1::JobOperationResult,
1500
- Google::Cloud::Talent::V4beta1::BatchOperationMetadata,
1501
- call_options: options
1502
- )
1503
- operation.on_done { |operation| yield(operation) } if block_given?
1504
- operation
1505
- end
1506
- end
1507
- end
1508
- end
1509
- end
1510
- end