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,1685 @@
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/job_service_pb"
21
+ require "google/cloud/talent/v4/job_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Talent
26
+ module V4
27
+ module JobService
28
+ module Rest
29
+ ##
30
+ # REST client for the JobService service.
31
+ #
32
+ # A service handles job management, including job CRUD, enumeration and search.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :job_service_stub
39
+
40
+ ##
41
+ # Configure the JobService Client class.
42
+ #
43
+ # See {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all JobService clients
49
+ # ::Google::Cloud::Talent::V4::JobService::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_job.timeout = 30.0
70
+
71
+ default_config.rpcs.batch_create_jobs.timeout = 30.0
72
+
73
+ default_config.rpcs.get_job.timeout = 30.0
74
+ default_config.rpcs.get_job.retry_policy = {
75
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
+ }
77
+
78
+ default_config.rpcs.update_job.timeout = 30.0
79
+
80
+ default_config.rpcs.batch_update_jobs.timeout = 30.0
81
+
82
+ default_config.rpcs.delete_job.timeout = 30.0
83
+ default_config.rpcs.delete_job.retry_policy = {
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
+ }
86
+
87
+ default_config.rpcs.batch_delete_jobs.timeout = 30.0
88
+
89
+ default_config.rpcs.list_jobs.timeout = 30.0
90
+ default_config.rpcs.list_jobs.retry_policy = {
91
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
92
+ }
93
+
94
+ default_config.rpcs.search_jobs.timeout = 30.0
95
+
96
+ default_config.rpcs.search_jobs_for_alert.timeout = 30.0
97
+
98
+ default_config
99
+ end
100
+ yield @configure if block_given?
101
+ @configure
102
+ end
103
+
104
+ ##
105
+ # Configure the JobService Client instance.
106
+ #
107
+ # The configuration is set to the derived mode, meaning that values can be changed,
108
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
109
+ # should be made on {Client.configure}.
110
+ #
111
+ # See {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration}
112
+ # for a description of the configuration fields.
113
+ #
114
+ # @yield [config] Configure the Client client.
115
+ # @yieldparam config [Client::Configuration]
116
+ #
117
+ # @return [Client::Configuration]
118
+ #
119
+ def configure
120
+ yield @config if block_given?
121
+ @config
122
+ end
123
+
124
+ ##
125
+ # Create a new JobService REST client object.
126
+ #
127
+ # @example
128
+ #
129
+ # # Create a client using the default configuration
130
+ # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new
131
+ #
132
+ # # Create a client using a custom configuration
133
+ # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config|
134
+ # config.timeout = 10.0
135
+ # end
136
+ #
137
+ # @yield [config] Configure the JobService client.
138
+ # @yieldparam config [Client::Configuration]
139
+ #
140
+ def initialize
141
+ # Create the configuration object
142
+ @config = Configuration.new Client.configure
143
+
144
+ # Yield the configuration if needed
145
+ yield @config if block_given?
146
+
147
+ # Create credentials
148
+ credentials = @config.credentials
149
+ # Use self-signed JWT if the endpoint is unchanged from default,
150
+ # but only if the default endpoint does not have a region prefix.
151
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
152
+ !@config.endpoint.split(".").first.include?("-")
153
+ credentials ||= Credentials.default scope: @config.scope,
154
+ enable_self_signed_jwt: enable_self_signed_jwt
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
+ credentials = Credentials.new credentials, scope: @config.scope
157
+ end
158
+
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
+
162
+ @operations_client = ::Google::Cloud::Talent::V4::JobService::Rest::Operations.new do |config|
163
+ config.credentials = credentials
164
+ config.quota_project = @quota_project_id
165
+ config.endpoint = @config.endpoint
166
+ end
167
+
168
+ @job_service_stub = ::Google::Cloud::Talent::V4::JobService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
169
+ end
170
+
171
+ ##
172
+ # Get the associated client for long-running operations.
173
+ #
174
+ # @return [::Google::Cloud::Talent::V4::JobService::Rest::Operations]
175
+ #
176
+ attr_reader :operations_client
177
+
178
+ # Service calls
179
+
180
+ ##
181
+ # Creates a new job.
182
+ #
183
+ # Typically, the job becomes searchable within 10 seconds, but it may take
184
+ # up to 5 minutes.
185
+ #
186
+ # @overload create_job(request, options = nil)
187
+ # Pass arguments to `create_job` via a request object, either of type
188
+ # {::Google::Cloud::Talent::V4::CreateJobRequest} or an equivalent Hash.
189
+ #
190
+ # @param request [::Google::Cloud::Talent::V4::CreateJobRequest, ::Hash]
191
+ # A request object representing the call parameters. Required. To specify no
192
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
193
+ # @param options [::Gapic::CallOptions, ::Hash]
194
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
195
+ #
196
+ # @overload create_job(parent: nil, job: nil)
197
+ # Pass arguments to `create_job` via keyword arguments. Note that at
198
+ # least one keyword argument is required. To specify no parameters, or to keep all
199
+ # the default parameter values, pass an empty Hash as a request object (see above).
200
+ #
201
+ # @param parent [::String]
202
+ # Required. The resource name of the tenant under which the job is created.
203
+ #
204
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example,
205
+ # "projects/foo/tenants/bar".
206
+ # @param job [::Google::Cloud::Talent::V4::Job, ::Hash]
207
+ # Required. The Job to be created.
208
+ # @yield [result, operation] Access the result along with the TransportOperation object
209
+ # @yieldparam result [::Google::Cloud::Talent::V4::Job]
210
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
211
+ #
212
+ # @return [::Google::Cloud::Talent::V4::Job]
213
+ #
214
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
215
+ def create_job request, options = nil
216
+ raise ::ArgumentError, "request must be provided" if request.nil?
217
+
218
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateJobRequest
219
+
220
+ # Converts hash and nil to an options object
221
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
222
+
223
+ # Customize the options with defaults
224
+ call_metadata = @config.rpcs.create_job.metadata.to_h
225
+
226
+ # Set x-goog-api-client and x-goog-user-project headers
227
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
228
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
229
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
230
+ transports_version_send: [:rest]
231
+
232
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
233
+
234
+ options.apply_defaults timeout: @config.rpcs.create_job.timeout,
235
+ metadata: call_metadata,
236
+ retry_policy: @config.rpcs.create_job.retry_policy
237
+
238
+ options.apply_defaults timeout: @config.timeout,
239
+ metadata: @config.metadata,
240
+ retry_policy: @config.retry_policy
241
+
242
+ @job_service_stub.create_job request, options do |result, operation|
243
+ yield result, operation if block_given?
244
+ return result
245
+ end
246
+ rescue ::Gapic::Rest::Error => e
247
+ raise ::Google::Cloud::Error.from_error(e)
248
+ end
249
+
250
+ ##
251
+ # Begins executing a batch create jobs operation.
252
+ #
253
+ # @overload batch_create_jobs(request, options = nil)
254
+ # Pass arguments to `batch_create_jobs` via a request object, either of type
255
+ # {::Google::Cloud::Talent::V4::BatchCreateJobsRequest} or an equivalent Hash.
256
+ #
257
+ # @param request [::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Hash]
258
+ # A request object representing the call parameters. Required. To specify no
259
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
260
+ # @param options [::Gapic::CallOptions, ::Hash]
261
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
262
+ #
263
+ # @overload batch_create_jobs(parent: nil, jobs: nil)
264
+ # Pass arguments to `batch_create_jobs` via keyword arguments. Note that at
265
+ # least one keyword argument is required. To specify no parameters, or to keep all
266
+ # the default parameter values, pass an empty Hash as a request object (see above).
267
+ #
268
+ # @param parent [::String]
269
+ # Required. The resource name of the tenant under which the job is created.
270
+ #
271
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example,
272
+ # "projects/foo/tenants/bar".
273
+ # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>]
274
+ # Required. The jobs to be created.
275
+ # A maximum of 200 jobs can be created in a batch.
276
+ # @yield [result, operation] Access the result along with the TransportOperation object
277
+ # @yieldparam result [::Gapic::Operation]
278
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
279
+ #
280
+ # @return [::Gapic::Operation]
281
+ #
282
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
283
+ def batch_create_jobs request, options = nil
284
+ raise ::ArgumentError, "request must be provided" if request.nil?
285
+
286
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchCreateJobsRequest
287
+
288
+ # Converts hash and nil to an options object
289
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
290
+
291
+ # Customize the options with defaults
292
+ call_metadata = @config.rpcs.batch_create_jobs.metadata.to_h
293
+
294
+ # Set x-goog-api-client and x-goog-user-project headers
295
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
296
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
297
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
298
+ transports_version_send: [:rest]
299
+
300
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
301
+
302
+ options.apply_defaults timeout: @config.rpcs.batch_create_jobs.timeout,
303
+ metadata: call_metadata,
304
+ retry_policy: @config.rpcs.batch_create_jobs.retry_policy
305
+
306
+ options.apply_defaults timeout: @config.timeout,
307
+ metadata: @config.metadata,
308
+ retry_policy: @config.retry_policy
309
+
310
+ @job_service_stub.batch_create_jobs request, options do |result, operation|
311
+ result = ::Gapic::Operation.new result, @operations_client, options: options
312
+ yield result, operation if block_given?
313
+ return result
314
+ end
315
+ rescue ::Gapic::Rest::Error => e
316
+ raise ::Google::Cloud::Error.from_error(e)
317
+ end
318
+
319
+ ##
320
+ # Retrieves the specified job, whose status is OPEN or recently EXPIRED
321
+ # within the last 90 days.
322
+ #
323
+ # @overload get_job(request, options = nil)
324
+ # Pass arguments to `get_job` via a request object, either of type
325
+ # {::Google::Cloud::Talent::V4::GetJobRequest} or an equivalent Hash.
326
+ #
327
+ # @param request [::Google::Cloud::Talent::V4::GetJobRequest, ::Hash]
328
+ # A request object representing the call parameters. Required. To specify no
329
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
330
+ # @param options [::Gapic::CallOptions, ::Hash]
331
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
332
+ #
333
+ # @overload get_job(name: nil)
334
+ # Pass arguments to `get_job` via keyword arguments. Note that at
335
+ # least one keyword argument is required. To specify no parameters, or to keep all
336
+ # the default parameter values, pass an empty Hash as a request object (see above).
337
+ #
338
+ # @param name [::String]
339
+ # Required. The resource name of the job to retrieve.
340
+ #
341
+ # The format is
342
+ # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For
343
+ # example, "projects/foo/tenants/bar/jobs/baz".
344
+ # @yield [result, operation] Access the result along with the TransportOperation object
345
+ # @yieldparam result [::Google::Cloud::Talent::V4::Job]
346
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
347
+ #
348
+ # @return [::Google::Cloud::Talent::V4::Job]
349
+ #
350
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
351
+ def get_job request, options = nil
352
+ raise ::ArgumentError, "request must be provided" if request.nil?
353
+
354
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetJobRequest
355
+
356
+ # Converts hash and nil to an options object
357
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
358
+
359
+ # Customize the options with defaults
360
+ call_metadata = @config.rpcs.get_job.metadata.to_h
361
+
362
+ # Set x-goog-api-client and x-goog-user-project headers
363
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
364
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
365
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
366
+ transports_version_send: [:rest]
367
+
368
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
369
+
370
+ options.apply_defaults timeout: @config.rpcs.get_job.timeout,
371
+ metadata: call_metadata,
372
+ retry_policy: @config.rpcs.get_job.retry_policy
373
+
374
+ options.apply_defaults timeout: @config.timeout,
375
+ metadata: @config.metadata,
376
+ retry_policy: @config.retry_policy
377
+
378
+ @job_service_stub.get_job request, options do |result, operation|
379
+ yield result, operation if block_given?
380
+ return result
381
+ end
382
+ rescue ::Gapic::Rest::Error => e
383
+ raise ::Google::Cloud::Error.from_error(e)
384
+ end
385
+
386
+ ##
387
+ # Updates specified job.
388
+ #
389
+ # Typically, updated contents become visible in search results within 10
390
+ # seconds, but it may take up to 5 minutes.
391
+ #
392
+ # @overload update_job(request, options = nil)
393
+ # Pass arguments to `update_job` via a request object, either of type
394
+ # {::Google::Cloud::Talent::V4::UpdateJobRequest} or an equivalent Hash.
395
+ #
396
+ # @param request [::Google::Cloud::Talent::V4::UpdateJobRequest, ::Hash]
397
+ # A request object representing the call parameters. Required. To specify no
398
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
399
+ # @param options [::Gapic::CallOptions, ::Hash]
400
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
401
+ #
402
+ # @overload update_job(job: nil, update_mask: nil)
403
+ # Pass arguments to `update_job` via keyword arguments. Note that at
404
+ # least one keyword argument is required. To specify no parameters, or to keep all
405
+ # the default parameter values, pass an empty Hash as a request object (see above).
406
+ #
407
+ # @param job [::Google::Cloud::Talent::V4::Job, ::Hash]
408
+ # Required. The Job to be updated.
409
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
410
+ # Strongly recommended for the best service experience.
411
+ #
412
+ # If {::Google::Cloud::Talent::V4::UpdateJobRequest#update_mask update_mask} is
413
+ # provided, only the specified fields in
414
+ # {::Google::Cloud::Talent::V4::UpdateJobRequest#job job} are updated. Otherwise
415
+ # all the fields are updated.
416
+ #
417
+ # A field mask to restrict the fields that are updated. Only
418
+ # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported.
419
+ # @yield [result, operation] Access the result along with the TransportOperation object
420
+ # @yieldparam result [::Google::Cloud::Talent::V4::Job]
421
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
422
+ #
423
+ # @return [::Google::Cloud::Talent::V4::Job]
424
+ #
425
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
426
+ def update_job request, options = nil
427
+ raise ::ArgumentError, "request must be provided" if request.nil?
428
+
429
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateJobRequest
430
+
431
+ # Converts hash and nil to an options object
432
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
433
+
434
+ # Customize the options with defaults
435
+ call_metadata = @config.rpcs.update_job.metadata.to_h
436
+
437
+ # Set x-goog-api-client and x-goog-user-project headers
438
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
439
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
440
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
441
+ transports_version_send: [:rest]
442
+
443
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
444
+
445
+ options.apply_defaults timeout: @config.rpcs.update_job.timeout,
446
+ metadata: call_metadata,
447
+ retry_policy: @config.rpcs.update_job.retry_policy
448
+
449
+ options.apply_defaults timeout: @config.timeout,
450
+ metadata: @config.metadata,
451
+ retry_policy: @config.retry_policy
452
+
453
+ @job_service_stub.update_job request, options do |result, operation|
454
+ yield result, operation if block_given?
455
+ return result
456
+ end
457
+ rescue ::Gapic::Rest::Error => e
458
+ raise ::Google::Cloud::Error.from_error(e)
459
+ end
460
+
461
+ ##
462
+ # Begins executing a batch update jobs operation.
463
+ #
464
+ # @overload batch_update_jobs(request, options = nil)
465
+ # Pass arguments to `batch_update_jobs` via a request object, either of type
466
+ # {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest} or an equivalent Hash.
467
+ #
468
+ # @param request [::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Hash]
469
+ # A request object representing the call parameters. Required. To specify no
470
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
471
+ # @param options [::Gapic::CallOptions, ::Hash]
472
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
473
+ #
474
+ # @overload batch_update_jobs(parent: nil, jobs: nil, update_mask: nil)
475
+ # Pass arguments to `batch_update_jobs` via keyword arguments. Note that at
476
+ # least one keyword argument is required. To specify no parameters, or to keep all
477
+ # the default parameter values, pass an empty Hash as a request object (see above).
478
+ #
479
+ # @param parent [::String]
480
+ # Required. The resource name of the tenant under which the job is created.
481
+ #
482
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example,
483
+ # "projects/foo/tenants/bar".
484
+ # @param jobs [::Array<::Google::Cloud::Talent::V4::Job, ::Hash>]
485
+ # Required. The jobs to be updated.
486
+ # A maximum of 200 jobs can be updated in a batch.
487
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
488
+ # Strongly recommended for the best service experience. Be aware that it will
489
+ # also increase latency when checking the status of a batch operation.
490
+ #
491
+ # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask}
492
+ # is provided, only the specified fields in {::Google::Cloud::Talent::V4::Job Job}
493
+ # are updated. Otherwise all the fields are updated.
494
+ #
495
+ # A field mask to restrict the fields that are updated. Only
496
+ # top level fields of {::Google::Cloud::Talent::V4::Job Job} are supported.
497
+ #
498
+ # If {::Google::Cloud::Talent::V4::BatchUpdateJobsRequest#update_mask update_mask}
499
+ # is provided, The {::Google::Cloud::Talent::V4::Job Job} inside
500
+ # [JobResult][JobOperationResult.JobResult]
501
+ # will only contains fields that is updated, plus the Id of the Job.
502
+ # Otherwise, {::Google::Cloud::Talent::V4::Job Job} will include all fields,
503
+ # which can yield a very large response.
504
+ # @yield [result, operation] Access the result along with the TransportOperation object
505
+ # @yieldparam result [::Gapic::Operation]
506
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
507
+ #
508
+ # @return [::Gapic::Operation]
509
+ #
510
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
511
+ def batch_update_jobs request, options = nil
512
+ raise ::ArgumentError, "request must be provided" if request.nil?
513
+
514
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest
515
+
516
+ # Converts hash and nil to an options object
517
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
518
+
519
+ # Customize the options with defaults
520
+ call_metadata = @config.rpcs.batch_update_jobs.metadata.to_h
521
+
522
+ # Set x-goog-api-client and x-goog-user-project headers
523
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
524
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
525
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
526
+ transports_version_send: [:rest]
527
+
528
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
529
+
530
+ options.apply_defaults timeout: @config.rpcs.batch_update_jobs.timeout,
531
+ metadata: call_metadata,
532
+ retry_policy: @config.rpcs.batch_update_jobs.retry_policy
533
+
534
+ options.apply_defaults timeout: @config.timeout,
535
+ metadata: @config.metadata,
536
+ retry_policy: @config.retry_policy
537
+
538
+ @job_service_stub.batch_update_jobs request, options do |result, operation|
539
+ result = ::Gapic::Operation.new result, @operations_client, options: options
540
+ yield result, operation if block_given?
541
+ return result
542
+ end
543
+ rescue ::Gapic::Rest::Error => e
544
+ raise ::Google::Cloud::Error.from_error(e)
545
+ end
546
+
547
+ ##
548
+ # Deletes the specified job.
549
+ #
550
+ # Typically, the job becomes unsearchable within 10 seconds, but it may take
551
+ # up to 5 minutes.
552
+ #
553
+ # @overload delete_job(request, options = nil)
554
+ # Pass arguments to `delete_job` via a request object, either of type
555
+ # {::Google::Cloud::Talent::V4::DeleteJobRequest} or an equivalent Hash.
556
+ #
557
+ # @param request [::Google::Cloud::Talent::V4::DeleteJobRequest, ::Hash]
558
+ # A request object representing the call parameters. Required. To specify no
559
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
560
+ # @param options [::Gapic::CallOptions, ::Hash]
561
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
562
+ #
563
+ # @overload delete_job(name: nil)
564
+ # Pass arguments to `delete_job` via keyword arguments. Note that at
565
+ # least one keyword argument is required. To specify no parameters, or to keep all
566
+ # the default parameter values, pass an empty Hash as a request object (see above).
567
+ #
568
+ # @param name [::String]
569
+ # Required. The resource name of the job to be deleted.
570
+ #
571
+ # The format is
572
+ # "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}". For
573
+ # example, "projects/foo/tenants/bar/jobs/baz".
574
+ # @yield [result, operation] Access the result along with the TransportOperation object
575
+ # @yieldparam result [::Google::Protobuf::Empty]
576
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
577
+ #
578
+ # @return [::Google::Protobuf::Empty]
579
+ #
580
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
581
+ def delete_job request, options = nil
582
+ raise ::ArgumentError, "request must be provided" if request.nil?
583
+
584
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteJobRequest
585
+
586
+ # Converts hash and nil to an options object
587
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
588
+
589
+ # Customize the options with defaults
590
+ call_metadata = @config.rpcs.delete_job.metadata.to_h
591
+
592
+ # Set x-goog-api-client and x-goog-user-project headers
593
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
594
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
595
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
596
+ transports_version_send: [:rest]
597
+
598
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
599
+
600
+ options.apply_defaults timeout: @config.rpcs.delete_job.timeout,
601
+ metadata: call_metadata,
602
+ retry_policy: @config.rpcs.delete_job.retry_policy
603
+
604
+ options.apply_defaults timeout: @config.timeout,
605
+ metadata: @config.metadata,
606
+ retry_policy: @config.retry_policy
607
+
608
+ @job_service_stub.delete_job request, options do |result, operation|
609
+ yield result, operation if block_given?
610
+ return result
611
+ end
612
+ rescue ::Gapic::Rest::Error => e
613
+ raise ::Google::Cloud::Error.from_error(e)
614
+ end
615
+
616
+ ##
617
+ # Begins executing a batch delete jobs operation.
618
+ #
619
+ # @overload batch_delete_jobs(request, options = nil)
620
+ # Pass arguments to `batch_delete_jobs` via a request object, either of type
621
+ # {::Google::Cloud::Talent::V4::BatchDeleteJobsRequest} or an equivalent Hash.
622
+ #
623
+ # @param request [::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Hash]
624
+ # A request object representing the call parameters. Required. To specify no
625
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
626
+ # @param options [::Gapic::CallOptions, ::Hash]
627
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
628
+ #
629
+ # @overload batch_delete_jobs(parent: nil, names: nil)
630
+ # Pass arguments to `batch_delete_jobs` via keyword arguments. Note that at
631
+ # least one keyword argument is required. To specify no parameters, or to keep all
632
+ # the default parameter values, pass an empty Hash as a request object (see above).
633
+ #
634
+ # @param parent [::String]
635
+ # Required. The resource name of the tenant under which the job is created.
636
+ #
637
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example,
638
+ # "projects/foo/tenants/bar".
639
+ #
640
+ # The parent of all of the jobs specified in `names` must match this field.
641
+ # @param names [::Array<::String>]
642
+ # The names of the jobs to delete.
643
+ #
644
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}/jobs/\\{job_id}".
645
+ # For example, "projects/foo/tenants/bar/jobs/baz".
646
+ #
647
+ # A maximum of 200 jobs can be deleted in a batch.
648
+ # @yield [result, operation] Access the result along with the TransportOperation object
649
+ # @yieldparam result [::Gapic::Operation]
650
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
651
+ #
652
+ # @return [::Gapic::Operation]
653
+ #
654
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
655
+ def batch_delete_jobs request, options = nil
656
+ raise ::ArgumentError, "request must be provided" if request.nil?
657
+
658
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest
659
+
660
+ # Converts hash and nil to an options object
661
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
662
+
663
+ # Customize the options with defaults
664
+ call_metadata = @config.rpcs.batch_delete_jobs.metadata.to_h
665
+
666
+ # Set x-goog-api-client and x-goog-user-project headers
667
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
668
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
669
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
670
+ transports_version_send: [:rest]
671
+
672
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
673
+
674
+ options.apply_defaults timeout: @config.rpcs.batch_delete_jobs.timeout,
675
+ metadata: call_metadata,
676
+ retry_policy: @config.rpcs.batch_delete_jobs.retry_policy
677
+
678
+ options.apply_defaults timeout: @config.timeout,
679
+ metadata: @config.metadata,
680
+ retry_policy: @config.retry_policy
681
+
682
+ @job_service_stub.batch_delete_jobs request, options do |result, operation|
683
+ result = ::Gapic::Operation.new result, @operations_client, options: options
684
+ yield result, operation if block_given?
685
+ return result
686
+ end
687
+ rescue ::Gapic::Rest::Error => e
688
+ raise ::Google::Cloud::Error.from_error(e)
689
+ end
690
+
691
+ ##
692
+ # Lists jobs by filter.
693
+ #
694
+ # @overload list_jobs(request, options = nil)
695
+ # Pass arguments to `list_jobs` via a request object, either of type
696
+ # {::Google::Cloud::Talent::V4::ListJobsRequest} or an equivalent Hash.
697
+ #
698
+ # @param request [::Google::Cloud::Talent::V4::ListJobsRequest, ::Hash]
699
+ # A request object representing the call parameters. Required. To specify no
700
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
701
+ # @param options [::Gapic::CallOptions, ::Hash]
702
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
703
+ #
704
+ # @overload list_jobs(parent: nil, filter: nil, page_token: nil, page_size: nil, job_view: nil)
705
+ # Pass arguments to `list_jobs` via keyword arguments. Note that at
706
+ # least one keyword argument is required. To specify no parameters, or to keep all
707
+ # the default parameter values, pass an empty Hash as a request object (see above).
708
+ #
709
+ # @param parent [::String]
710
+ # Required. The resource name of the tenant under which the job is created.
711
+ #
712
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example,
713
+ # "projects/foo/tenants/bar".
714
+ # @param filter [::String]
715
+ # Required. The filter string specifies the jobs to be enumerated.
716
+ #
717
+ # Supported operator: =, AND
718
+ #
719
+ # The fields eligible for filtering are:
720
+ #
721
+ # * `companyName`
722
+ # * `requisitionId`
723
+ # * `status` Available values: OPEN, EXPIRED, ALL. Defaults to
724
+ # OPEN if no value is specified.
725
+ #
726
+ # At least one of `companyName` and `requisitionId` must present or an
727
+ # INVALID_ARGUMENT error is thrown.
728
+ #
729
+ # Sample Query:
730
+ #
731
+ # * companyName = "projects/foo/tenants/bar/companies/baz"
732
+ # * companyName = "projects/foo/tenants/bar/companies/baz" AND
733
+ # requisitionId = "req-1"
734
+ # * companyName = "projects/foo/tenants/bar/companies/baz" AND
735
+ # status = "EXPIRED"
736
+ # * requisitionId = "req-1"
737
+ # * requisitionId = "req-1" AND status = "EXPIRED"
738
+ # @param page_token [::String]
739
+ # The starting point of a query result.
740
+ # @param page_size [::Integer]
741
+ # The maximum number of jobs to be returned per page of results.
742
+ #
743
+ # If {::Google::Cloud::Talent::V4::ListJobsRequest#job_view job_view} is set to
744
+ # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_ID_ONLY JobView.JOB_VIEW_ID_ONLY},
745
+ # the maximum allowed page size is 1000. Otherwise, the maximum allowed page
746
+ # size is 100.
747
+ #
748
+ # Default is 100 if empty or a number < 1 is specified.
749
+ # @param job_view [::Google::Cloud::Talent::V4::JobView]
750
+ # The desired job attributes returned for jobs in the
751
+ # search response. Defaults to
752
+ # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_FULL JobView.JOB_VIEW_FULL} if no
753
+ # value is specified.
754
+ # @yield [result, operation] Access the result along with the TransportOperation object
755
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>]
756
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
757
+ #
758
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4::Job>]
759
+ #
760
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
761
+ def list_jobs request, options = nil
762
+ raise ::ArgumentError, "request must be provided" if request.nil?
763
+
764
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListJobsRequest
765
+
766
+ # Converts hash and nil to an options object
767
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
768
+
769
+ # Customize the options with defaults
770
+ call_metadata = @config.rpcs.list_jobs.metadata.to_h
771
+
772
+ # Set x-goog-api-client and x-goog-user-project headers
773
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
774
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
775
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
776
+ transports_version_send: [:rest]
777
+
778
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
779
+
780
+ options.apply_defaults timeout: @config.rpcs.list_jobs.timeout,
781
+ metadata: call_metadata,
782
+ retry_policy: @config.rpcs.list_jobs.retry_policy
783
+
784
+ options.apply_defaults timeout: @config.timeout,
785
+ metadata: @config.metadata,
786
+ retry_policy: @config.retry_policy
787
+
788
+ @job_service_stub.list_jobs request, options do |result, operation|
789
+ result = ::Gapic::Rest::PagedEnumerable.new @job_service_stub, :list_jobs, "jobs", request, result, options
790
+ yield result, operation if block_given?
791
+ return result
792
+ end
793
+ rescue ::Gapic::Rest::Error => e
794
+ raise ::Google::Cloud::Error.from_error(e)
795
+ end
796
+
797
+ ##
798
+ # Searches for jobs using the provided
799
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}.
800
+ #
801
+ # This call constrains the
802
+ # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the
803
+ # database, and only returns jobs that the caller has permission to search
804
+ # against.
805
+ #
806
+ # @overload search_jobs(request, options = nil)
807
+ # Pass arguments to `search_jobs` via a request object, either of type
808
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash.
809
+ #
810
+ # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash]
811
+ # A request object representing the call parameters. Required. To specify no
812
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
813
+ # @param options [::Gapic::CallOptions, ::Hash]
814
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
815
+ #
816
+ # @overload search_jobs(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil)
817
+ # Pass arguments to `search_jobs` via keyword arguments. Note that at
818
+ # least one keyword argument is required. To specify no parameters, or to keep all
819
+ # the default parameter values, pass an empty Hash as a request object (see above).
820
+ #
821
+ # @param parent [::String]
822
+ # Required. The resource name of the tenant to search within.
823
+ #
824
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example,
825
+ # "projects/foo/tenants/bar".
826
+ # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode]
827
+ # Mode of a search.
828
+ #
829
+ # Defaults to
830
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}.
831
+ # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash]
832
+ # Required. The meta information collected about the job searcher, used to
833
+ # improve the search quality of the service. The identifiers (such as
834
+ # `user_id`) are provided by users, and must be unique and consistent.
835
+ # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash]
836
+ # Query used to search against jobs, such as keyword, location filters, etc.
837
+ # @param enable_broadening [::Boolean]
838
+ # Controls whether to broaden the search when it produces sparse results.
839
+ # Broadened queries append results to the end of the matching results
840
+ # list.
841
+ #
842
+ # Defaults to false.
843
+ # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>]
844
+ # An expression specifies a histogram request against matching jobs.
845
+ #
846
+ # Expression syntax is an aggregation function call with histogram facets and
847
+ # other options.
848
+ #
849
+ # Available aggregation function calls are:
850
+ # * `count(string_histogram_facet)`: Count the number of matching entities,
851
+ # for each distinct attribute value.
852
+ # * `count(numeric_histogram_facet, list of buckets)`: Count the number of
853
+ # matching entities within each bucket.
854
+ #
855
+ # A maximum of 200 histogram buckets are supported.
856
+ #
857
+ # Data types:
858
+ #
859
+ # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`.
860
+ # * String: string like "any string with backslash escape for quote(\")."
861
+ # * Number: whole number and floating point number like 10, -1 and -0.01.
862
+ # * List: list of elements with comma(,) separator surrounded by square
863
+ # brackets, for example, [1, 2, 3] and ["one", "two", "three"].
864
+ #
865
+ # Built-in constants:
866
+ #
867
+ # * MIN (minimum number similar to java Double.MIN_VALUE)
868
+ # * MAX (maximum number similar to java Double.MAX_VALUE)
869
+ #
870
+ # Built-in functions:
871
+ #
872
+ # * bucket(start, end[, label]): bucket built-in function creates a bucket
873
+ # with range of [start, end). Note that the end is exclusive, for example,
874
+ # bucket(1, MAX, "positive number") or bucket(1, 10).
875
+ #
876
+ # Job histogram facets:
877
+ #
878
+ # * company_display_name: histogram by
879
+ # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}.
880
+ # * employment_type: histogram by
881
+ # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for
882
+ # example,
883
+ # "FULL_TIME", "PART_TIME".
884
+ # * company_size (DEPRECATED): histogram by
885
+ # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL",
886
+ # "MEDIUM", "BIG".
887
+ # * publish_time_in_day: histogram by the
888
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
889
+ # in days.
890
+ # Must specify list of numeric buckets in spec.
891
+ # * publish_time_in_month: histogram by the
892
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
893
+ # in months.
894
+ # Must specify list of numeric buckets in spec.
895
+ # * publish_time_in_year: histogram by the
896
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
897
+ # in years.
898
+ # Must specify list of numeric buckets in spec.
899
+ # * degree_types: histogram by the
900
+ # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example,
901
+ # "Bachelors", "Masters".
902
+ # * job_level: histogram by the
903
+ # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry
904
+ # Level".
905
+ # * country: histogram by the country code of jobs, for example, "US", "FR".
906
+ # * admin1: histogram by the admin1 code of jobs, which is a global
907
+ # placeholder referring to the state, province, or the particular term a
908
+ # country uses to define the geographic structure below the country level,
909
+ # for example, "CA", "IL".
910
+ # * city: histogram by a combination of the "city name, admin1 code". For
911
+ # example, "Mountain View, CA", "New York, NY".
912
+ # * admin1_country: histogram by a combination of the "admin1 code, country",
913
+ # for example, "CA, US", "IL, US".
914
+ # * city_coordinate: histogram by the city center's GPS coordinates (latitude
915
+ # and longitude), for example, 37.4038522,-122.0987765. Since the
916
+ # coordinates of a city center can change, customers may need to refresh
917
+ # them periodically.
918
+ # * locale: histogram by the
919
+ # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example,
920
+ # "en-US",
921
+ # "fr-FR".
922
+ # * language: histogram by the language subtag of the
923
+ # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code},
924
+ # for example, "en", "fr".
925
+ # * category: histogram by the
926
+ # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example,
927
+ # "COMPUTER_AND_IT", "HEALTHCARE".
928
+ # * base_compensation_unit: histogram by the
929
+ # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}
930
+ # of base salary, for example, "WEEKLY", "MONTHLY".
931
+ # * base_compensation: histogram by the base salary. Must specify list of
932
+ # numeric buckets to group results by.
933
+ # * annualized_base_compensation: histogram by the base annualized salary.
934
+ # Must specify list of numeric buckets to group results by.
935
+ # * annualized_total_compensation: histogram by the total annualized salary.
936
+ # Must specify list of numeric buckets to group results by.
937
+ # * string_custom_attribute: histogram by string
938
+ # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}.
939
+ # Values can be accessed via square bracket notations like
940
+ # string_custom_attribute["key1"].
941
+ # * numeric_custom_attribute: histogram by numeric
942
+ # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}.
943
+ # Values can be accessed via square bracket notations like
944
+ # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to
945
+ # group results by.
946
+ #
947
+ # Example expressions:
948
+ #
949
+ # * `count(admin1)`
950
+ # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000),
951
+ # bucket(100000, MAX)])`
952
+ # * `count(string_custom_attribute["some-string-custom-attribute"])`
953
+ # * `count(numeric_custom_attribute["some-numeric-custom-attribute"],
954
+ # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])`
955
+ # @param job_view [::Google::Cloud::Talent::V4::JobView]
956
+ # The desired job attributes returned for jobs in the search response.
957
+ # Defaults to
958
+ # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if
959
+ # no value is specified.
960
+ # @param offset [::Integer]
961
+ # An integer that specifies the current offset (that is, starting result
962
+ # location, amongst the jobs deemed by the API as relevant) in search
963
+ # results. This field is only considered if
964
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset.
965
+ #
966
+ # The maximum allowed value is 5000. Otherwise an error is thrown.
967
+ #
968
+ # For example, 0 means to return results starting from the first matching
969
+ # job, and 10 means to return from the 11th job. This can be used for
970
+ # pagination, (for example, pageSize = 10 and offset = 10 means to return
971
+ # from the second page).
972
+ # @param max_page_size [::Integer]
973
+ # A limit on the number of jobs returned in the search results.
974
+ # Increasing this value above the default value of 10 can increase search
975
+ # response time. The value can be between 1 and 100.
976
+ # @param page_token [::String]
977
+ # The token specifying the current offset within
978
+ # search results. See
979
+ # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token}
980
+ # for an explanation of how to obtain the next set of query results.
981
+ # @param order_by [::String]
982
+ # The criteria determining how search results are sorted. Default is
983
+ # `"relevance desc"`.
984
+ #
985
+ # Supported options are:
986
+ #
987
+ # * `"relevance desc"`: By relevance descending, as determined by the API
988
+ # algorithms. Relevance thresholding of query results is only available
989
+ # with this ordering.
990
+ # * `"posting_publish_time desc"`: By
991
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
992
+ # descending.
993
+ # * `"posting_update_time desc"`: By
994
+ # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time}
995
+ # descending.
996
+ # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending.
997
+ # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title}
998
+ # descending.
999
+ # * `"annualized_base_compensation"`: By job's
1000
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range}
1001
+ # ascending. Jobs whose annualized base compensation is unspecified are put
1002
+ # at the end of search results.
1003
+ # * `"annualized_base_compensation desc"`: By job's
1004
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range}
1005
+ # descending. Jobs whose annualized base compensation is unspecified are
1006
+ # put at the end of search results.
1007
+ # * `"annualized_total_compensation"`: By job's
1008
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range}
1009
+ # ascending. Jobs whose annualized base compensation is unspecified are put
1010
+ # at the end of search results.
1011
+ # * `"annualized_total_compensation desc"`: By job's
1012
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range}
1013
+ # descending. Jobs whose annualized base compensation is unspecified are
1014
+ # put at the end of search results.
1015
+ # * `"custom_ranking desc"`: By the relevance score adjusted to the
1016
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression}
1017
+ # with weight factor assigned by
1018
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level}
1019
+ # in descending order.
1020
+ # * Location sorting: Use the special syntax to order jobs by distance:<br>
1021
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.<br>
1022
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.<br>
1023
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by
1024
+ # multiple locations. See details below.<br>
1025
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by
1026
+ # multiple locations. See details below.<br>
1027
+ # The string can have a maximum of 256 characters. When multiple distance
1028
+ # centers are provided, a job that is close to any of the distance centers
1029
+ # would have a high rank. When a job has multiple locations, the job
1030
+ # location closest to one of the distance centers will be used. Jobs that
1031
+ # don't have locations will be ranked at the bottom. Distance is calculated
1032
+ # with a precision of 11.3 meters (37.4 feet). Diversification strategy is
1033
+ # still applied unless explicitly disabled in
1034
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}.
1035
+ # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel]
1036
+ # Controls whether highly similar jobs are returned next to each other in
1037
+ # the search results. Jobs are identified as highly similar based on
1038
+ # their titles, job categories, and locations. Highly similar results are
1039
+ # clustered so that only one representative job of the cluster is
1040
+ # displayed to the job seeker higher up in the results, with the other jobs
1041
+ # being displayed lower down in the results.
1042
+ #
1043
+ # Defaults to
1044
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE}
1045
+ # if no value is specified.
1046
+ # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash]
1047
+ # Controls over how job documents get ranked on top of existing relevance
1048
+ # score (determined by API algorithm).
1049
+ # @param disable_keyword_match [::Boolean]
1050
+ # This field is deprecated. Please use
1051
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode}
1052
+ # going forward.
1053
+ #
1054
+ # To migrate, disable_keyword_match set to false maps to
1055
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL},
1056
+ # and disable_keyword_match set to true maps to
1057
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}.
1058
+ # If
1059
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode}
1060
+ # is set, this field is ignored.
1061
+ #
1062
+ # Controls whether to disable exact keyword match on
1063
+ # {::Google::Cloud::Talent::V4::Job#title Job.title},
1064
+ # {::Google::Cloud::Talent::V4::Job#description Job.description},
1065
+ # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name},
1066
+ # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses},
1067
+ # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When
1068
+ # disable keyword match is turned off, a keyword match returns jobs that do
1069
+ # not match given category filters when there are matching keywords. For
1070
+ # example, for the query "program manager," a result is returned even if the
1071
+ # job posting has the title "software developer," which doesn't fall into
1072
+ # "program manager" ontology, but does have "program manager" appearing in
1073
+ # its description.
1074
+ #
1075
+ # For queries like "cloud" that don't contain title or
1076
+ # location specific ontology, jobs with "cloud" keyword matches are returned
1077
+ # regardless of this flag's value.
1078
+ #
1079
+ # Use
1080
+ # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes}
1081
+ # if company-specific globally matched custom field/attribute string values
1082
+ # are needed. Enabling keyword match improves recall of subsequent search
1083
+ # requests.
1084
+ #
1085
+ # Defaults to false.
1086
+ # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode]
1087
+ # Controls what keyword match options to use. If both keyword_match_mode and
1088
+ # disable_keyword_match are set, keyword_match_mode will take precedence.
1089
+ #
1090
+ # Defaults to
1091
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}
1092
+ # if no value is specified.
1093
+ # @yield [result, operation] Access the result along with the TransportOperation object
1094
+ # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse]
1095
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1096
+ #
1097
+ # @return [::Google::Cloud::Talent::V4::SearchJobsResponse]
1098
+ #
1099
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1100
+ def search_jobs request, options = nil
1101
+ raise ::ArgumentError, "request must be provided" if request.nil?
1102
+
1103
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest
1104
+
1105
+ # Converts hash and nil to an options object
1106
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1107
+
1108
+ # Customize the options with defaults
1109
+ call_metadata = @config.rpcs.search_jobs.metadata.to_h
1110
+
1111
+ # Set x-goog-api-client and x-goog-user-project headers
1112
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1113
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1114
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
1115
+ transports_version_send: [:rest]
1116
+
1117
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1118
+
1119
+ options.apply_defaults timeout: @config.rpcs.search_jobs.timeout,
1120
+ metadata: call_metadata,
1121
+ retry_policy: @config.rpcs.search_jobs.retry_policy
1122
+
1123
+ options.apply_defaults timeout: @config.timeout,
1124
+ metadata: @config.metadata,
1125
+ retry_policy: @config.retry_policy
1126
+
1127
+ @job_service_stub.search_jobs request, options do |result, operation|
1128
+ yield result, operation if block_given?
1129
+ return result
1130
+ end
1131
+ rescue ::Gapic::Rest::Error => e
1132
+ raise ::Google::Cloud::Error.from_error(e)
1133
+ end
1134
+
1135
+ ##
1136
+ # Searches for jobs using the provided
1137
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest SearchJobsRequest}.
1138
+ #
1139
+ # This API call is intended for the use case of targeting passive job
1140
+ # seekers (for example, job seekers who have signed up to receive email
1141
+ # alerts about potential job opportunities), it has different algorithmic
1142
+ # adjustments that are designed to specifically target passive job seekers.
1143
+ #
1144
+ # This call constrains the
1145
+ # {::Google::Cloud::Talent::V4::Job#visibility visibility} of jobs present in the
1146
+ # database, and only returns jobs the caller has permission to search
1147
+ # against.
1148
+ #
1149
+ # @overload search_jobs_for_alert(request, options = nil)
1150
+ # Pass arguments to `search_jobs_for_alert` via a request object, either of type
1151
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest} or an equivalent Hash.
1152
+ #
1153
+ # @param request [::Google::Cloud::Talent::V4::SearchJobsRequest, ::Hash]
1154
+ # A request object representing the call parameters. Required. To specify no
1155
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1156
+ # @param options [::Gapic::CallOptions, ::Hash]
1157
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1158
+ #
1159
+ # @overload search_jobs_for_alert(parent: nil, search_mode: nil, request_metadata: nil, job_query: nil, enable_broadening: nil, histogram_queries: nil, job_view: nil, offset: nil, max_page_size: nil, page_token: nil, order_by: nil, diversification_level: nil, custom_ranking_info: nil, disable_keyword_match: nil, keyword_match_mode: nil)
1160
+ # Pass arguments to `search_jobs_for_alert` via keyword arguments. Note that at
1161
+ # least one keyword argument is required. To specify no parameters, or to keep all
1162
+ # the default parameter values, pass an empty Hash as a request object (see above).
1163
+ #
1164
+ # @param parent [::String]
1165
+ # Required. The resource name of the tenant to search within.
1166
+ #
1167
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}". For example,
1168
+ # "projects/foo/tenants/bar".
1169
+ # @param search_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode]
1170
+ # Mode of a search.
1171
+ #
1172
+ # Defaults to
1173
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::SearchMode::JOB_SEARCH SearchMode.JOB_SEARCH}.
1174
+ # @param request_metadata [::Google::Cloud::Talent::V4::RequestMetadata, ::Hash]
1175
+ # Required. The meta information collected about the job searcher, used to
1176
+ # improve the search quality of the service. The identifiers (such as
1177
+ # `user_id`) are provided by users, and must be unique and consistent.
1178
+ # @param job_query [::Google::Cloud::Talent::V4::JobQuery, ::Hash]
1179
+ # Query used to search against jobs, such as keyword, location filters, etc.
1180
+ # @param enable_broadening [::Boolean]
1181
+ # Controls whether to broaden the search when it produces sparse results.
1182
+ # Broadened queries append results to the end of the matching results
1183
+ # list.
1184
+ #
1185
+ # Defaults to false.
1186
+ # @param histogram_queries [::Array<::Google::Cloud::Talent::V4::HistogramQuery, ::Hash>]
1187
+ # An expression specifies a histogram request against matching jobs.
1188
+ #
1189
+ # Expression syntax is an aggregation function call with histogram facets and
1190
+ # other options.
1191
+ #
1192
+ # Available aggregation function calls are:
1193
+ # * `count(string_histogram_facet)`: Count the number of matching entities,
1194
+ # for each distinct attribute value.
1195
+ # * `count(numeric_histogram_facet, list of buckets)`: Count the number of
1196
+ # matching entities within each bucket.
1197
+ #
1198
+ # A maximum of 200 histogram buckets are supported.
1199
+ #
1200
+ # Data types:
1201
+ #
1202
+ # * Histogram facet: facet names with format `[a-zA-Z][a-zA-Z0-9_]+`.
1203
+ # * String: string like "any string with backslash escape for quote(\")."
1204
+ # * Number: whole number and floating point number like 10, -1 and -0.01.
1205
+ # * List: list of elements with comma(,) separator surrounded by square
1206
+ # brackets, for example, [1, 2, 3] and ["one", "two", "three"].
1207
+ #
1208
+ # Built-in constants:
1209
+ #
1210
+ # * MIN (minimum number similar to java Double.MIN_VALUE)
1211
+ # * MAX (maximum number similar to java Double.MAX_VALUE)
1212
+ #
1213
+ # Built-in functions:
1214
+ #
1215
+ # * bucket(start, end[, label]): bucket built-in function creates a bucket
1216
+ # with range of [start, end). Note that the end is exclusive, for example,
1217
+ # bucket(1, MAX, "positive number") or bucket(1, 10).
1218
+ #
1219
+ # Job histogram facets:
1220
+ #
1221
+ # * company_display_name: histogram by
1222
+ # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}.
1223
+ # * employment_type: histogram by
1224
+ # {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for
1225
+ # example,
1226
+ # "FULL_TIME", "PART_TIME".
1227
+ # * company_size (DEPRECATED): histogram by
1228
+ # {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL",
1229
+ # "MEDIUM", "BIG".
1230
+ # * publish_time_in_day: histogram by the
1231
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
1232
+ # in days.
1233
+ # Must specify list of numeric buckets in spec.
1234
+ # * publish_time_in_month: histogram by the
1235
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
1236
+ # in months.
1237
+ # Must specify list of numeric buckets in spec.
1238
+ # * publish_time_in_year: histogram by the
1239
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
1240
+ # in years.
1241
+ # Must specify list of numeric buckets in spec.
1242
+ # * degree_types: histogram by the
1243
+ # {::Google::Cloud::Talent::V4::Job#degree_types Job.degree_types}, for example,
1244
+ # "Bachelors", "Masters".
1245
+ # * job_level: histogram by the
1246
+ # {::Google::Cloud::Talent::V4::Job#job_level Job.job_level}, for example, "Entry
1247
+ # Level".
1248
+ # * country: histogram by the country code of jobs, for example, "US", "FR".
1249
+ # * admin1: histogram by the admin1 code of jobs, which is a global
1250
+ # placeholder referring to the state, province, or the particular term a
1251
+ # country uses to define the geographic structure below the country level,
1252
+ # for example, "CA", "IL".
1253
+ # * city: histogram by a combination of the "city name, admin1 code". For
1254
+ # example, "Mountain View, CA", "New York, NY".
1255
+ # * admin1_country: histogram by a combination of the "admin1 code, country",
1256
+ # for example, "CA, US", "IL, US".
1257
+ # * city_coordinate: histogram by the city center's GPS coordinates (latitude
1258
+ # and longitude), for example, 37.4038522,-122.0987765. Since the
1259
+ # coordinates of a city center can change, customers may need to refresh
1260
+ # them periodically.
1261
+ # * locale: histogram by the
1262
+ # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code}, for example,
1263
+ # "en-US",
1264
+ # "fr-FR".
1265
+ # * language: histogram by the language subtag of the
1266
+ # {::Google::Cloud::Talent::V4::Job#language_code Job.language_code},
1267
+ # for example, "en", "fr".
1268
+ # * category: histogram by the
1269
+ # {::Google::Cloud::Talent::V4::JobCategory JobCategory}, for example,
1270
+ # "COMPUTER_AND_IT", "HEALTHCARE".
1271
+ # * base_compensation_unit: histogram by the
1272
+ # {::Google::Cloud::Talent::V4::CompensationInfo::CompensationUnit CompensationInfo.CompensationUnit}
1273
+ # of base salary, for example, "WEEKLY", "MONTHLY".
1274
+ # * base_compensation: histogram by the base salary. Must specify list of
1275
+ # numeric buckets to group results by.
1276
+ # * annualized_base_compensation: histogram by the base annualized salary.
1277
+ # Must specify list of numeric buckets to group results by.
1278
+ # * annualized_total_compensation: histogram by the total annualized salary.
1279
+ # Must specify list of numeric buckets to group results by.
1280
+ # * string_custom_attribute: histogram by string
1281
+ # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}.
1282
+ # Values can be accessed via square bracket notations like
1283
+ # string_custom_attribute["key1"].
1284
+ # * numeric_custom_attribute: histogram by numeric
1285
+ # {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}.
1286
+ # Values can be accessed via square bracket notations like
1287
+ # numeric_custom_attribute["key1"]. Must specify list of numeric buckets to
1288
+ # group results by.
1289
+ #
1290
+ # Example expressions:
1291
+ #
1292
+ # * `count(admin1)`
1293
+ # * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000),
1294
+ # bucket(100000, MAX)])`
1295
+ # * `count(string_custom_attribute["some-string-custom-attribute"])`
1296
+ # * `count(numeric_custom_attribute["some-numeric-custom-attribute"],
1297
+ # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])`
1298
+ # @param job_view [::Google::Cloud::Talent::V4::JobView]
1299
+ # The desired job attributes returned for jobs in the search response.
1300
+ # Defaults to
1301
+ # {::Google::Cloud::Talent::V4::JobView::JOB_VIEW_SMALL JobView.JOB_VIEW_SMALL} if
1302
+ # no value is specified.
1303
+ # @param offset [::Integer]
1304
+ # An integer that specifies the current offset (that is, starting result
1305
+ # location, amongst the jobs deemed by the API as relevant) in search
1306
+ # results. This field is only considered if
1307
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#page_token page_token} is unset.
1308
+ #
1309
+ # The maximum allowed value is 5000. Otherwise an error is thrown.
1310
+ #
1311
+ # For example, 0 means to return results starting from the first matching
1312
+ # job, and 10 means to return from the 11th job. This can be used for
1313
+ # pagination, (for example, pageSize = 10 and offset = 10 means to return
1314
+ # from the second page).
1315
+ # @param max_page_size [::Integer]
1316
+ # A limit on the number of jobs returned in the search results.
1317
+ # Increasing this value above the default value of 10 can increase search
1318
+ # response time. The value can be between 1 and 100.
1319
+ # @param page_token [::String]
1320
+ # The token specifying the current offset within
1321
+ # search results. See
1322
+ # {::Google::Cloud::Talent::V4::SearchJobsResponse#next_page_token SearchJobsResponse.next_page_token}
1323
+ # for an explanation of how to obtain the next set of query results.
1324
+ # @param order_by [::String]
1325
+ # The criteria determining how search results are sorted. Default is
1326
+ # `"relevance desc"`.
1327
+ #
1328
+ # Supported options are:
1329
+ #
1330
+ # * `"relevance desc"`: By relevance descending, as determined by the API
1331
+ # algorithms. Relevance thresholding of query results is only available
1332
+ # with this ordering.
1333
+ # * `"posting_publish_time desc"`: By
1334
+ # {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time}
1335
+ # descending.
1336
+ # * `"posting_update_time desc"`: By
1337
+ # {::Google::Cloud::Talent::V4::Job#posting_update_time Job.posting_update_time}
1338
+ # descending.
1339
+ # * `"title"`: By {::Google::Cloud::Talent::V4::Job#title Job.title} ascending.
1340
+ # * `"title desc"`: By {::Google::Cloud::Talent::V4::Job#title Job.title}
1341
+ # descending.
1342
+ # * `"annualized_base_compensation"`: By job's
1343
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range}
1344
+ # ascending. Jobs whose annualized base compensation is unspecified are put
1345
+ # at the end of search results.
1346
+ # * `"annualized_base_compensation desc"`: By job's
1347
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_base_compensation_range CompensationInfo.annualized_base_compensation_range}
1348
+ # descending. Jobs whose annualized base compensation is unspecified are
1349
+ # put at the end of search results.
1350
+ # * `"annualized_total_compensation"`: By job's
1351
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range}
1352
+ # ascending. Jobs whose annualized base compensation is unspecified are put
1353
+ # at the end of search results.
1354
+ # * `"annualized_total_compensation desc"`: By job's
1355
+ # {::Google::Cloud::Talent::V4::CompensationInfo#annualized_total_compensation_range CompensationInfo.annualized_total_compensation_range}
1356
+ # descending. Jobs whose annualized base compensation is unspecified are
1357
+ # put at the end of search results.
1358
+ # * `"custom_ranking desc"`: By the relevance score adjusted to the
1359
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#ranking_expression SearchJobsRequest.CustomRankingInfo.ranking_expression}
1360
+ # with weight factor assigned by
1361
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo#importance_level SearchJobsRequest.CustomRankingInfo.importance_level}
1362
+ # in descending order.
1363
+ # * Location sorting: Use the special syntax to order jobs by distance:<br>
1364
+ # `"distance_from('Hawaii')"`: Order by distance from Hawaii.<br>
1365
+ # `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.<br>
1366
+ # `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by
1367
+ # multiple locations. See details below.<br>
1368
+ # `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by
1369
+ # multiple locations. See details below.<br>
1370
+ # The string can have a maximum of 256 characters. When multiple distance
1371
+ # centers are provided, a job that is close to any of the distance centers
1372
+ # would have a high rank. When a job has multiple locations, the job
1373
+ # location closest to one of the distance centers will be used. Jobs that
1374
+ # don't have locations will be ranked at the bottom. Distance is calculated
1375
+ # with a precision of 11.3 meters (37.4 feet). Diversification strategy is
1376
+ # still applied unless explicitly disabled in
1377
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#diversification_level diversification_level}.
1378
+ # @param diversification_level [::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel]
1379
+ # Controls whether highly similar jobs are returned next to each other in
1380
+ # the search results. Jobs are identified as highly similar based on
1381
+ # their titles, job categories, and locations. Highly similar results are
1382
+ # clustered so that only one representative job of the cluster is
1383
+ # displayed to the job seeker higher up in the results, with the other jobs
1384
+ # being displayed lower down in the results.
1385
+ #
1386
+ # Defaults to
1387
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::DiversificationLevel::SIMPLE DiversificationLevel.SIMPLE}
1388
+ # if no value is specified.
1389
+ # @param custom_ranking_info [::Google::Cloud::Talent::V4::SearchJobsRequest::CustomRankingInfo, ::Hash]
1390
+ # Controls over how job documents get ranked on top of existing relevance
1391
+ # score (determined by API algorithm).
1392
+ # @param disable_keyword_match [::Boolean]
1393
+ # This field is deprecated. Please use
1394
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode}
1395
+ # going forward.
1396
+ #
1397
+ # To migrate, disable_keyword_match set to false maps to
1398
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL},
1399
+ # and disable_keyword_match set to true maps to
1400
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_DISABLED KeywordMatchMode.KEYWORD_MATCH_DISABLED}.
1401
+ # If
1402
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest#keyword_match_mode SearchJobsRequest.keyword_match_mode}
1403
+ # is set, this field is ignored.
1404
+ #
1405
+ # Controls whether to disable exact keyword match on
1406
+ # {::Google::Cloud::Talent::V4::Job#title Job.title},
1407
+ # {::Google::Cloud::Talent::V4::Job#description Job.description},
1408
+ # {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name},
1409
+ # {::Google::Cloud::Talent::V4::Job#addresses Job.addresses},
1410
+ # {::Google::Cloud::Talent::V4::Job#qualifications Job.qualifications}. When
1411
+ # disable keyword match is turned off, a keyword match returns jobs that do
1412
+ # not match given category filters when there are matching keywords. For
1413
+ # example, for the query "program manager," a result is returned even if the
1414
+ # job posting has the title "software developer," which doesn't fall into
1415
+ # "program manager" ontology, but does have "program manager" appearing in
1416
+ # its description.
1417
+ #
1418
+ # For queries like "cloud" that don't contain title or
1419
+ # location specific ontology, jobs with "cloud" keyword matches are returned
1420
+ # regardless of this flag's value.
1421
+ #
1422
+ # Use
1423
+ # {::Google::Cloud::Talent::V4::Company#keyword_searchable_job_custom_attributes Company.keyword_searchable_job_custom_attributes}
1424
+ # if company-specific globally matched custom field/attribute string values
1425
+ # are needed. Enabling keyword match improves recall of subsequent search
1426
+ # requests.
1427
+ #
1428
+ # Defaults to false.
1429
+ # @param keyword_match_mode [::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode]
1430
+ # Controls what keyword match options to use. If both keyword_match_mode and
1431
+ # disable_keyword_match are set, keyword_match_mode will take precedence.
1432
+ #
1433
+ # Defaults to
1434
+ # {::Google::Cloud::Talent::V4::SearchJobsRequest::KeywordMatchMode::KEYWORD_MATCH_ALL KeywordMatchMode.KEYWORD_MATCH_ALL}
1435
+ # if no value is specified.
1436
+ # @yield [result, operation] Access the result along with the TransportOperation object
1437
+ # @yieldparam result [::Google::Cloud::Talent::V4::SearchJobsResponse]
1438
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1439
+ #
1440
+ # @return [::Google::Cloud::Talent::V4::SearchJobsResponse]
1441
+ #
1442
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1443
+ def search_jobs_for_alert request, options = nil
1444
+ raise ::ArgumentError, "request must be provided" if request.nil?
1445
+
1446
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::SearchJobsRequest
1447
+
1448
+ # Converts hash and nil to an options object
1449
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1450
+
1451
+ # Customize the options with defaults
1452
+ call_metadata = @config.rpcs.search_jobs_for_alert.metadata.to_h
1453
+
1454
+ # Set x-goog-api-client and x-goog-user-project headers
1455
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1456
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1457
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION,
1458
+ transports_version_send: [:rest]
1459
+
1460
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1461
+
1462
+ options.apply_defaults timeout: @config.rpcs.search_jobs_for_alert.timeout,
1463
+ metadata: call_metadata,
1464
+ retry_policy: @config.rpcs.search_jobs_for_alert.retry_policy
1465
+
1466
+ options.apply_defaults timeout: @config.timeout,
1467
+ metadata: @config.metadata,
1468
+ retry_policy: @config.retry_policy
1469
+
1470
+ @job_service_stub.search_jobs_for_alert request, options do |result, operation|
1471
+ yield result, operation if block_given?
1472
+ return result
1473
+ end
1474
+ rescue ::Gapic::Rest::Error => e
1475
+ raise ::Google::Cloud::Error.from_error(e)
1476
+ end
1477
+
1478
+ ##
1479
+ # Configuration class for the JobService REST API.
1480
+ #
1481
+ # This class represents the configuration for JobService REST,
1482
+ # providing control over timeouts, retry behavior, logging, transport
1483
+ # parameters, and other low-level controls. Certain parameters can also be
1484
+ # applied individually to specific RPCs. See
1485
+ # {::Google::Cloud::Talent::V4::JobService::Rest::Client::Configuration::Rpcs}
1486
+ # for a list of RPCs that can be configured independently.
1487
+ #
1488
+ # Configuration can be applied globally to all clients, or to a single client
1489
+ # on construction.
1490
+ #
1491
+ # @example
1492
+ #
1493
+ # # Modify the global config, setting the timeout for
1494
+ # # create_job to 20 seconds,
1495
+ # # and all remaining timeouts to 10 seconds.
1496
+ # ::Google::Cloud::Talent::V4::JobService::Rest::Client.configure do |config|
1497
+ # config.timeout = 10.0
1498
+ # config.rpcs.create_job.timeout = 20.0
1499
+ # end
1500
+ #
1501
+ # # Apply the above configuration only to a new client.
1502
+ # client = ::Google::Cloud::Talent::V4::JobService::Rest::Client.new do |config|
1503
+ # config.timeout = 10.0
1504
+ # config.rpcs.create_job.timeout = 20.0
1505
+ # end
1506
+ #
1507
+ # @!attribute [rw] endpoint
1508
+ # The hostname or hostname:port of the service endpoint.
1509
+ # Defaults to `"jobs.googleapis.com"`.
1510
+ # @return [::String]
1511
+ # @!attribute [rw] credentials
1512
+ # Credentials to send with calls. You may provide any of the following types:
1513
+ # * (`String`) The path to a service account key file in JSON format
1514
+ # * (`Hash`) A service account key as a Hash
1515
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1516
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1517
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1518
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1519
+ # * (`nil`) indicating no credentials
1520
+ # @return [::Object]
1521
+ # @!attribute [rw] scope
1522
+ # The OAuth scopes
1523
+ # @return [::Array<::String>]
1524
+ # @!attribute [rw] lib_name
1525
+ # The library name as recorded in instrumentation and logging
1526
+ # @return [::String]
1527
+ # @!attribute [rw] lib_version
1528
+ # The library version as recorded in instrumentation and logging
1529
+ # @return [::String]
1530
+ # @!attribute [rw] timeout
1531
+ # The call timeout in seconds.
1532
+ # @return [::Numeric]
1533
+ # @!attribute [rw] metadata
1534
+ # Additional headers to be sent with the call.
1535
+ # @return [::Hash{::Symbol=>::String}]
1536
+ # @!attribute [rw] retry_policy
1537
+ # The retry policy. The value is a hash with the following keys:
1538
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1539
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1540
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1541
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1542
+ # trigger a retry.
1543
+ # @return [::Hash]
1544
+ # @!attribute [rw] quota_project
1545
+ # A separate project against which to charge quota.
1546
+ # @return [::String]
1547
+ #
1548
+ class Configuration
1549
+ extend ::Gapic::Config
1550
+
1551
+ config_attr :endpoint, "jobs.googleapis.com", ::String
1552
+ config_attr :credentials, nil do |value|
1553
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1554
+ allowed.any? { |klass| klass === value }
1555
+ end
1556
+ config_attr :scope, nil, ::String, ::Array, nil
1557
+ config_attr :lib_name, nil, ::String, nil
1558
+ config_attr :lib_version, nil, ::String, nil
1559
+ config_attr :timeout, nil, ::Numeric, nil
1560
+ config_attr :metadata, nil, ::Hash, nil
1561
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1562
+ config_attr :quota_project, nil, ::String, nil
1563
+
1564
+ # @private
1565
+ def initialize parent_config = nil
1566
+ @parent_config = parent_config unless parent_config.nil?
1567
+
1568
+ yield self if block_given?
1569
+ end
1570
+
1571
+ ##
1572
+ # Configurations for individual RPCs
1573
+ # @return [Rpcs]
1574
+ #
1575
+ def rpcs
1576
+ @rpcs ||= begin
1577
+ parent_rpcs = nil
1578
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1579
+ Rpcs.new parent_rpcs
1580
+ end
1581
+ end
1582
+
1583
+ ##
1584
+ # Configuration RPC class for the JobService API.
1585
+ #
1586
+ # Includes fields providing the configuration for each RPC in this service.
1587
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1588
+ # the following configuration fields:
1589
+ #
1590
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1591
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1592
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1593
+ # include the following keys:
1594
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1595
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1596
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1597
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1598
+ # trigger a retry.
1599
+ #
1600
+ class Rpcs
1601
+ ##
1602
+ # RPC-specific configuration for `create_job`
1603
+ # @return [::Gapic::Config::Method]
1604
+ #
1605
+ attr_reader :create_job
1606
+ ##
1607
+ # RPC-specific configuration for `batch_create_jobs`
1608
+ # @return [::Gapic::Config::Method]
1609
+ #
1610
+ attr_reader :batch_create_jobs
1611
+ ##
1612
+ # RPC-specific configuration for `get_job`
1613
+ # @return [::Gapic::Config::Method]
1614
+ #
1615
+ attr_reader :get_job
1616
+ ##
1617
+ # RPC-specific configuration for `update_job`
1618
+ # @return [::Gapic::Config::Method]
1619
+ #
1620
+ attr_reader :update_job
1621
+ ##
1622
+ # RPC-specific configuration for `batch_update_jobs`
1623
+ # @return [::Gapic::Config::Method]
1624
+ #
1625
+ attr_reader :batch_update_jobs
1626
+ ##
1627
+ # RPC-specific configuration for `delete_job`
1628
+ # @return [::Gapic::Config::Method]
1629
+ #
1630
+ attr_reader :delete_job
1631
+ ##
1632
+ # RPC-specific configuration for `batch_delete_jobs`
1633
+ # @return [::Gapic::Config::Method]
1634
+ #
1635
+ attr_reader :batch_delete_jobs
1636
+ ##
1637
+ # RPC-specific configuration for `list_jobs`
1638
+ # @return [::Gapic::Config::Method]
1639
+ #
1640
+ attr_reader :list_jobs
1641
+ ##
1642
+ # RPC-specific configuration for `search_jobs`
1643
+ # @return [::Gapic::Config::Method]
1644
+ #
1645
+ attr_reader :search_jobs
1646
+ ##
1647
+ # RPC-specific configuration for `search_jobs_for_alert`
1648
+ # @return [::Gapic::Config::Method]
1649
+ #
1650
+ attr_reader :search_jobs_for_alert
1651
+
1652
+ # @private
1653
+ def initialize parent_rpcs = nil
1654
+ create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job
1655
+ @create_job = ::Gapic::Config::Method.new create_job_config
1656
+ batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs
1657
+ @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config
1658
+ get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job
1659
+ @get_job = ::Gapic::Config::Method.new get_job_config
1660
+ update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job
1661
+ @update_job = ::Gapic::Config::Method.new update_job_config
1662
+ batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs
1663
+ @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config
1664
+ delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
1665
+ @delete_job = ::Gapic::Config::Method.new delete_job_config
1666
+ batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs
1667
+ @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config
1668
+ list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
1669
+ @list_jobs = ::Gapic::Config::Method.new list_jobs_config
1670
+ search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs
1671
+ @search_jobs = ::Gapic::Config::Method.new search_jobs_config
1672
+ search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert
1673
+ @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config
1674
+
1675
+ yield self if block_given?
1676
+ end
1677
+ end
1678
+ end
1679
+ end
1680
+ end
1681
+ end
1682
+ end
1683
+ end
1684
+ end
1685
+ end