google-cloud-talent-v4beta1 0.6.1 → 0.7.0

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