google-cloud-talent-v4 0.1.0

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