google-cloud-talent-v4 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,88 @@
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 JobService
25
+ # Path helper methods for the JobService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Company resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/tenants/{tenant}/companies/{company}`
33
+ #
34
+ # @param project [String]
35
+ # @param tenant [String]
36
+ # @param company [String]
37
+ #
38
+ # @return [::String]
39
+ def company_path project:, tenant:, company:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/"
42
+
43
+ "projects/#{project}/tenants/#{tenant}/companies/#{company}"
44
+ end
45
+
46
+ ##
47
+ # Create a fully-qualified Job resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/tenants/{tenant}/jobs/{job}`
52
+ #
53
+ # @param project [String]
54
+ # @param tenant [String]
55
+ # @param job [String]
56
+ #
57
+ # @return [::String]
58
+ def job_path project:, tenant:, job:
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/"
61
+
62
+ "projects/#{project}/tenants/#{tenant}/jobs/#{job}"
63
+ end
64
+
65
+ ##
66
+ # Create a fully-qualified Tenant resource string.
67
+ #
68
+ # The resource will be in the following format:
69
+ #
70
+ # `projects/{project}/tenants/{tenant}`
71
+ #
72
+ # @param project [String]
73
+ # @param tenant [String]
74
+ #
75
+ # @return [::String]
76
+ def tenant_path project:, tenant:
77
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
78
+
79
+ "projects/#{project}/tenants/#{tenant}"
80
+ end
81
+
82
+ extend self
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,173 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/talent/v4/job_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/common_pb'
11
+ require 'google/cloud/talent/v4/filters_pb'
12
+ require 'google/cloud/talent/v4/histogram_pb'
13
+ require 'google/cloud/talent/v4/job_pb'
14
+ require 'google/longrunning/operations_pb'
15
+ require 'google/protobuf/any_pb'
16
+ require 'google/protobuf/duration_pb'
17
+ require 'google/protobuf/empty_pb'
18
+ require 'google/protobuf/field_mask_pb'
19
+ require 'google/rpc/status_pb'
20
+ Google::Protobuf::DescriptorPool.generated_pool.build do
21
+ add_file("google/cloud/talent/v4/job_service.proto", :syntax => :proto3) do
22
+ add_message "google.cloud.talent.v4.CreateJobRequest" do
23
+ optional :parent, :string, 1
24
+ optional :job, :message, 2, "google.cloud.talent.v4.Job"
25
+ end
26
+ add_message "google.cloud.talent.v4.GetJobRequest" do
27
+ optional :name, :string, 1
28
+ end
29
+ add_message "google.cloud.talent.v4.UpdateJobRequest" do
30
+ optional :job, :message, 1, "google.cloud.talent.v4.Job"
31
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
32
+ end
33
+ add_message "google.cloud.talent.v4.DeleteJobRequest" do
34
+ optional :name, :string, 1
35
+ end
36
+ add_message "google.cloud.talent.v4.ListJobsRequest" do
37
+ optional :parent, :string, 1
38
+ optional :filter, :string, 2
39
+ optional :page_token, :string, 3
40
+ optional :page_size, :int32, 4
41
+ optional :job_view, :enum, 5, "google.cloud.talent.v4.JobView"
42
+ end
43
+ add_message "google.cloud.talent.v4.ListJobsResponse" do
44
+ repeated :jobs, :message, 1, "google.cloud.talent.v4.Job"
45
+ optional :next_page_token, :string, 2
46
+ optional :metadata, :message, 3, "google.cloud.talent.v4.ResponseMetadata"
47
+ end
48
+ add_message "google.cloud.talent.v4.SearchJobsRequest" do
49
+ optional :parent, :string, 1
50
+ optional :search_mode, :enum, 2, "google.cloud.talent.v4.SearchJobsRequest.SearchMode"
51
+ optional :request_metadata, :message, 3, "google.cloud.talent.v4.RequestMetadata"
52
+ optional :job_query, :message, 4, "google.cloud.talent.v4.JobQuery"
53
+ optional :enable_broadening, :bool, 5
54
+ repeated :histogram_queries, :message, 7, "google.cloud.talent.v4.HistogramQuery"
55
+ optional :job_view, :enum, 8, "google.cloud.talent.v4.JobView"
56
+ optional :offset, :int32, 9
57
+ optional :max_page_size, :int32, 10
58
+ optional :page_token, :string, 11
59
+ optional :order_by, :string, 12
60
+ optional :diversification_level, :enum, 13, "google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel"
61
+ optional :custom_ranking_info, :message, 14, "google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo"
62
+ optional :disable_keyword_match, :bool, 16
63
+ end
64
+ add_message "google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo" do
65
+ optional :importance_level, :enum, 1, "google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel"
66
+ optional :ranking_expression, :string, 2
67
+ end
68
+ add_enum "google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel" do
69
+ value :IMPORTANCE_LEVEL_UNSPECIFIED, 0
70
+ value :NONE, 1
71
+ value :LOW, 2
72
+ value :MILD, 3
73
+ value :MEDIUM, 4
74
+ value :HIGH, 5
75
+ value :EXTREME, 6
76
+ end
77
+ add_enum "google.cloud.talent.v4.SearchJobsRequest.SearchMode" do
78
+ value :SEARCH_MODE_UNSPECIFIED, 0
79
+ value :JOB_SEARCH, 1
80
+ value :FEATURED_JOB_SEARCH, 2
81
+ end
82
+ add_enum "google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel" do
83
+ value :DIVERSIFICATION_LEVEL_UNSPECIFIED, 0
84
+ value :DISABLED, 1
85
+ value :SIMPLE, 2
86
+ end
87
+ add_message "google.cloud.talent.v4.SearchJobsResponse" do
88
+ repeated :matching_jobs, :message, 1, "google.cloud.talent.v4.SearchJobsResponse.MatchingJob"
89
+ repeated :histogram_query_results, :message, 2, "google.cloud.talent.v4.HistogramQueryResult"
90
+ optional :next_page_token, :string, 3
91
+ repeated :location_filters, :message, 4, "google.cloud.talent.v4.Location"
92
+ optional :total_size, :int32, 6
93
+ optional :metadata, :message, 7, "google.cloud.talent.v4.ResponseMetadata"
94
+ optional :broadened_query_jobs_count, :int32, 8
95
+ optional :spell_correction, :message, 9, "google.cloud.talent.v4.SpellingCorrection"
96
+ end
97
+ add_message "google.cloud.talent.v4.SearchJobsResponse.MatchingJob" do
98
+ optional :job, :message, 1, "google.cloud.talent.v4.Job"
99
+ optional :job_summary, :string, 2
100
+ optional :job_title_snippet, :string, 3
101
+ optional :search_text_snippet, :string, 4
102
+ optional :commute_info, :message, 5, "google.cloud.talent.v4.SearchJobsResponse.CommuteInfo"
103
+ end
104
+ add_message "google.cloud.talent.v4.SearchJobsResponse.CommuteInfo" do
105
+ optional :job_location, :message, 1, "google.cloud.talent.v4.Location"
106
+ optional :travel_duration, :message, 2, "google.protobuf.Duration"
107
+ end
108
+ add_message "google.cloud.talent.v4.BatchCreateJobsRequest" do
109
+ optional :parent, :string, 1
110
+ repeated :jobs, :message, 2, "google.cloud.talent.v4.Job"
111
+ end
112
+ add_message "google.cloud.talent.v4.BatchUpdateJobsRequest" do
113
+ optional :parent, :string, 1
114
+ repeated :jobs, :message, 2, "google.cloud.talent.v4.Job"
115
+ optional :update_mask, :message, 3, "google.protobuf.FieldMask"
116
+ end
117
+ add_message "google.cloud.talent.v4.BatchDeleteJobsRequest" do
118
+ optional :parent, :string, 1
119
+ repeated :names, :string, 2
120
+ end
121
+ add_message "google.cloud.talent.v4.JobResult" do
122
+ optional :job, :message, 1, "google.cloud.talent.v4.Job"
123
+ optional :status, :message, 2, "google.rpc.Status"
124
+ end
125
+ add_message "google.cloud.talent.v4.BatchCreateJobsResponse" do
126
+ repeated :job_results, :message, 1, "google.cloud.talent.v4.JobResult"
127
+ end
128
+ add_message "google.cloud.talent.v4.BatchUpdateJobsResponse" do
129
+ repeated :job_results, :message, 1, "google.cloud.talent.v4.JobResult"
130
+ end
131
+ add_message "google.cloud.talent.v4.BatchDeleteJobsResponse" do
132
+ repeated :job_results, :message, 1, "google.cloud.talent.v4.JobResult"
133
+ end
134
+ add_enum "google.cloud.talent.v4.JobView" do
135
+ value :JOB_VIEW_UNSPECIFIED, 0
136
+ value :JOB_VIEW_ID_ONLY, 1
137
+ value :JOB_VIEW_MINIMAL, 2
138
+ value :JOB_VIEW_SMALL, 3
139
+ value :JOB_VIEW_FULL, 4
140
+ end
141
+ end
142
+ end
143
+
144
+ module Google
145
+ module Cloud
146
+ module Talent
147
+ module V4
148
+ CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CreateJobRequest").msgclass
149
+ GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.GetJobRequest").msgclass
150
+ UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.UpdateJobRequest").msgclass
151
+ DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.DeleteJobRequest").msgclass
152
+ ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsRequest").msgclass
153
+ ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ListJobsResponse").msgclass
154
+ SearchJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest").msgclass
155
+ SearchJobsRequest::CustomRankingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo").msgclass
156
+ SearchJobsRequest::CustomRankingInfo::ImportanceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.CustomRankingInfo.ImportanceLevel").enummodule
157
+ SearchJobsRequest::SearchMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.SearchMode").enummodule
158
+ SearchJobsRequest::DiversificationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsRequest.DiversificationLevel").enummodule
159
+ SearchJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse").msgclass
160
+ SearchJobsResponse::MatchingJob = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.MatchingJob").msgclass
161
+ SearchJobsResponse::CommuteInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.SearchJobsResponse.CommuteInfo").msgclass
162
+ BatchCreateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsRequest").msgclass
163
+ BatchUpdateJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsRequest").msgclass
164
+ BatchDeleteJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsRequest").msgclass
165
+ JobResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobResult").msgclass
166
+ BatchCreateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchCreateJobsResponse").msgclass
167
+ BatchUpdateJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchUpdateJobsResponse").msgclass
168
+ BatchDeleteJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.BatchDeleteJobsResponse").msgclass
169
+ JobView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobView").enummodule
170
+ end
171
+ end
172
+ end
173
+ end
@@ -0,0 +1,86 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/talent/v4/job_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/job_service_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Talent
25
+ module V4
26
+ module JobService
27
+ # A service handles job management, including job CRUD, enumeration and search.
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.JobService'
35
+
36
+ # Creates a new job.
37
+ #
38
+ # Typically, the job becomes searchable within 10 seconds, but it may take
39
+ # up to 5 minutes.
40
+ rpc :CreateJob, ::Google::Cloud::Talent::V4::CreateJobRequest, ::Google::Cloud::Talent::V4::Job
41
+ # Begins executing a batch create jobs operation.
42
+ rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4::BatchCreateJobsRequest, ::Google::Longrunning::Operation
43
+ # Retrieves the specified job, whose status is OPEN or recently EXPIRED
44
+ # within the last 90 days.
45
+ rpc :GetJob, ::Google::Cloud::Talent::V4::GetJobRequest, ::Google::Cloud::Talent::V4::Job
46
+ # Updates specified job.
47
+ #
48
+ # Typically, updated contents become visible in search results within 10
49
+ # seconds, but it may take up to 5 minutes.
50
+ rpc :UpdateJob, ::Google::Cloud::Talent::V4::UpdateJobRequest, ::Google::Cloud::Talent::V4::Job
51
+ # Begins executing a batch update jobs operation.
52
+ rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4::BatchUpdateJobsRequest, ::Google::Longrunning::Operation
53
+ # Deletes the specified job.
54
+ #
55
+ # Typically, the job becomes unsearchable within 10 seconds, but it may take
56
+ # up to 5 minutes.
57
+ rpc :DeleteJob, ::Google::Cloud::Talent::V4::DeleteJobRequest, ::Google::Protobuf::Empty
58
+ # Begins executing a batch delete jobs operation.
59
+ rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4::BatchDeleteJobsRequest, ::Google::Longrunning::Operation
60
+ # Lists jobs by filter.
61
+ rpc :ListJobs, ::Google::Cloud::Talent::V4::ListJobsRequest, ::Google::Cloud::Talent::V4::ListJobsResponse
62
+ # Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].
63
+ #
64
+ # This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs
65
+ # present in the database, and only returns jobs that the caller has
66
+ # permission to search against.
67
+ rpc :SearchJobs, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse
68
+ # Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4.SearchJobsRequest].
69
+ #
70
+ # This API call is intended for the use case of targeting passive job
71
+ # seekers (for example, job seekers who have signed up to receive email
72
+ # alerts about potential job opportunities), it has different algorithmic
73
+ # adjustments that are designed to specifically target passive job seekers.
74
+ #
75
+ # This call constrains the [visibility][google.cloud.talent.v4.Job.visibility] of jobs
76
+ # present in the database, and only returns jobs the caller has
77
+ # permission to search against.
78
+ rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4::SearchJobsRequest, ::Google::Cloud::Talent::V4::SearchJobsResponse
79
+ end
80
+
81
+ Stub = Service.rpc_stub_class
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,26 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/talent/v4/tenant.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
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_file("google/cloud/talent/v4/tenant.proto", :syntax => :proto3) do
11
+ add_message "google.cloud.talent.v4.Tenant" do
12
+ optional :name, :string, 1
13
+ optional :external_id, :string, 2
14
+ end
15
+ end
16
+ end
17
+
18
+ module Google
19
+ module Cloud
20
+ module Talent
21
+ module V4
22
+ Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.Tenant").msgclass
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,49 @@
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/tenant_service/credentials"
26
+ require "google/cloud/talent/v4/tenant_service/paths"
27
+ require "google/cloud/talent/v4/tenant_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Talent
32
+ module V4
33
+ ##
34
+ # A service that handles tenant management, including CRUD and enumeration.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/talent/v4/tenant_service"
39
+ # client = ::Google::Cloud::Talent::V4::TenantService::Client.new
40
+ #
41
+ module TenantService
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "tenant_service", "helpers.rb"
49
+ require "google/cloud/talent/v4/tenant_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,720 @@
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/tenant_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Talent
25
+ module V4
26
+ module TenantService
27
+ ##
28
+ # Client for the TenantService service.
29
+ #
30
+ # A service that handles tenant management, including CRUD and enumeration.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :tenant_service_stub
37
+
38
+ ##
39
+ # Configure the TenantService Client class.
40
+ #
41
+ # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all TenantService clients:
47
+ #
48
+ # ::Google::Cloud::Talent::V4::TenantService::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_tenant.timeout = 30.0
69
+
70
+ default_config.rpcs.get_tenant.timeout = 30.0
71
+ default_config.rpcs.get_tenant.retry_policy = {
72
+ initial_delay: 0.1,
73
+ max_delay: 60.0,
74
+ multiplier: 1.3,
75
+ retry_codes: [4, 14]
76
+ }
77
+
78
+ default_config.rpcs.update_tenant.timeout = 30.0
79
+
80
+ default_config.rpcs.delete_tenant.timeout = 30.0
81
+ default_config.rpcs.delete_tenant.retry_policy = {
82
+ initial_delay: 0.1,
83
+ max_delay: 60.0,
84
+ multiplier: 1.3,
85
+ retry_codes: [4, 14]
86
+ }
87
+
88
+ default_config.rpcs.list_tenants.timeout = 30.0
89
+ default_config.rpcs.list_tenants.retry_policy = {
90
+ initial_delay: 0.1,
91
+ max_delay: 60.0,
92
+ multiplier: 1.3,
93
+ retry_codes: [4, 14]
94
+ }
95
+
96
+ default_config
97
+ end
98
+ yield @configure if block_given?
99
+ @configure
100
+ end
101
+
102
+ ##
103
+ # Configure the TenantService Client instance.
104
+ #
105
+ # The configuration is set to the derived mode, meaning that values can be changed,
106
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
107
+ # should be made on {Client.configure}.
108
+ #
109
+ # See {::Google::Cloud::Talent::V4::TenantService::Client::Configuration}
110
+ # for a description of the configuration fields.
111
+ #
112
+ # @yield [config] Configure the Client client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ # @return [Client::Configuration]
116
+ #
117
+ def configure
118
+ yield @config if block_given?
119
+ @config
120
+ end
121
+
122
+ ##
123
+ # Create a new TenantService client object.
124
+ #
125
+ # ## Examples
126
+ #
127
+ # To create a new TenantService client with the default
128
+ # configuration:
129
+ #
130
+ # client = ::Google::Cloud::Talent::V4::TenantService::Client.new
131
+ #
132
+ # To create a new TenantService client with a custom
133
+ # configuration:
134
+ #
135
+ # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config|
136
+ # config.timeout = 10.0
137
+ # end
138
+ #
139
+ # @yield [config] Configure the TenantService client.
140
+ # @yieldparam config [Client::Configuration]
141
+ #
142
+ def initialize
143
+ # These require statements are intentionally placed here to initialize
144
+ # the gRPC module only when it's required.
145
+ # See https://github.com/googleapis/toolkit/issues/446
146
+ require "gapic/grpc"
147
+ require "google/cloud/talent/v4/tenant_service_services_pb"
148
+
149
+ # Create the configuration object
150
+ @config = Configuration.new Client.configure
151
+
152
+ # Yield the configuration if needed
153
+ yield @config if block_given?
154
+
155
+ # Create credentials
156
+ credentials = @config.credentials
157
+ credentials ||= Credentials.default scope: @config.scope
158
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
159
+ credentials = Credentials.new credentials, scope: @config.scope
160
+ end
161
+ @quota_project_id = @config.quota_project
162
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
163
+
164
+ @tenant_service_stub = ::Gapic::ServiceStub.new(
165
+ ::Google::Cloud::Talent::V4::TenantService::Stub,
166
+ credentials: credentials,
167
+ endpoint: @config.endpoint,
168
+ channel_args: @config.channel_args,
169
+ interceptors: @config.interceptors
170
+ )
171
+ end
172
+
173
+ # Service calls
174
+
175
+ ##
176
+ # Creates a new tenant entity.
177
+ #
178
+ # @overload create_tenant(request, options = nil)
179
+ # Pass arguments to `create_tenant` via a request object, either of type
180
+ # {::Google::Cloud::Talent::V4::CreateTenantRequest} or an equivalent Hash.
181
+ #
182
+ # @param request [::Google::Cloud::Talent::V4::CreateTenantRequest, ::Hash]
183
+ # A request object representing the call parameters. Required. To specify no
184
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
185
+ # @param options [::Gapic::CallOptions, ::Hash]
186
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
187
+ #
188
+ # @overload create_tenant(parent: nil, tenant: nil)
189
+ # Pass arguments to `create_tenant` via keyword arguments. Note that at
190
+ # least one keyword argument is required. To specify no parameters, or to keep all
191
+ # the default parameter values, pass an empty Hash as a request object (see above).
192
+ #
193
+ # @param parent [::String]
194
+ # Required. Resource name of the project under which the tenant is created.
195
+ #
196
+ # The format is "projects/\\{project_id}", for example,
197
+ # "projects/foo".
198
+ # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash]
199
+ # Required. The tenant to be created.
200
+ #
201
+ # @yield [response, operation] Access the result along with the RPC operation
202
+ # @yieldparam response [::Google::Cloud::Talent::V4::Tenant]
203
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
204
+ #
205
+ # @return [::Google::Cloud::Talent::V4::Tenant]
206
+ #
207
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
208
+ #
209
+ def create_tenant request, options = nil
210
+ raise ::ArgumentError, "request must be provided" if request.nil?
211
+
212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateTenantRequest
213
+
214
+ # Converts hash and nil to an options object
215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
216
+
217
+ # Customize the options with defaults
218
+ metadata = @config.rpcs.create_tenant.metadata.to_h
219
+
220
+ # Set x-goog-api-client and x-goog-user-project headers
221
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
223
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION
224
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
225
+
226
+ header_params = {
227
+ "parent" => request.parent
228
+ }
229
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
230
+ metadata[:"x-goog-request-params"] ||= request_params_header
231
+
232
+ options.apply_defaults timeout: @config.rpcs.create_tenant.timeout,
233
+ metadata: metadata,
234
+ retry_policy: @config.rpcs.create_tenant.retry_policy
235
+ options.apply_defaults metadata: @config.metadata,
236
+ retry_policy: @config.retry_policy
237
+
238
+ @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation|
239
+ yield response, operation if block_given?
240
+ return response
241
+ end
242
+ rescue ::GRPC::BadStatus => e
243
+ raise ::Google::Cloud::Error.from_error(e)
244
+ end
245
+
246
+ ##
247
+ # Retrieves specified tenant.
248
+ #
249
+ # @overload get_tenant(request, options = nil)
250
+ # Pass arguments to `get_tenant` via a request object, either of type
251
+ # {::Google::Cloud::Talent::V4::GetTenantRequest} or an equivalent Hash.
252
+ #
253
+ # @param request [::Google::Cloud::Talent::V4::GetTenantRequest, ::Hash]
254
+ # A request object representing the call parameters. Required. To specify no
255
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
256
+ # @param options [::Gapic::CallOptions, ::Hash]
257
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
258
+ #
259
+ # @overload get_tenant(name: nil)
260
+ # Pass arguments to `get_tenant` via keyword arguments. Note that at
261
+ # least one keyword argument is required. To specify no parameters, or to keep all
262
+ # the default parameter values, pass an empty Hash as a request object (see above).
263
+ #
264
+ # @param name [::String]
265
+ # Required. The resource name of the tenant to be retrieved.
266
+ #
267
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
268
+ # "projects/foo/tenants/bar".
269
+ #
270
+ # @yield [response, operation] Access the result along with the RPC operation
271
+ # @yieldparam response [::Google::Cloud::Talent::V4::Tenant]
272
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
273
+ #
274
+ # @return [::Google::Cloud::Talent::V4::Tenant]
275
+ #
276
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
277
+ #
278
+ def get_tenant request, options = nil
279
+ raise ::ArgumentError, "request must be provided" if request.nil?
280
+
281
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::GetTenantRequest
282
+
283
+ # Converts hash and nil to an options object
284
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
285
+
286
+ # Customize the options with defaults
287
+ metadata = @config.rpcs.get_tenant.metadata.to_h
288
+
289
+ # Set x-goog-api-client and x-goog-user-project headers
290
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
291
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
292
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION
293
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
294
+
295
+ header_params = {
296
+ "name" => request.name
297
+ }
298
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
299
+ metadata[:"x-goog-request-params"] ||= request_params_header
300
+
301
+ options.apply_defaults timeout: @config.rpcs.get_tenant.timeout,
302
+ metadata: metadata,
303
+ retry_policy: @config.rpcs.get_tenant.retry_policy
304
+ options.apply_defaults metadata: @config.metadata,
305
+ retry_policy: @config.retry_policy
306
+
307
+ @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation|
308
+ yield response, operation if block_given?
309
+ return response
310
+ end
311
+ rescue ::GRPC::BadStatus => e
312
+ raise ::Google::Cloud::Error.from_error(e)
313
+ end
314
+
315
+ ##
316
+ # Updates specified tenant.
317
+ #
318
+ # @overload update_tenant(request, options = nil)
319
+ # Pass arguments to `update_tenant` via a request object, either of type
320
+ # {::Google::Cloud::Talent::V4::UpdateTenantRequest} or an equivalent Hash.
321
+ #
322
+ # @param request [::Google::Cloud::Talent::V4::UpdateTenantRequest, ::Hash]
323
+ # A request object representing the call parameters. Required. To specify no
324
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
325
+ # @param options [::Gapic::CallOptions, ::Hash]
326
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
327
+ #
328
+ # @overload update_tenant(tenant: nil, update_mask: nil)
329
+ # Pass arguments to `update_tenant` via keyword arguments. Note that at
330
+ # least one keyword argument is required. To specify no parameters, or to keep all
331
+ # the default parameter values, pass an empty Hash as a request object (see above).
332
+ #
333
+ # @param tenant [::Google::Cloud::Talent::V4::Tenant, ::Hash]
334
+ # Required. The tenant resource to replace the current resource in the
335
+ # system.
336
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
337
+ # Strongly recommended for the best service experience.
338
+ #
339
+ # If {::Google::Cloud::Talent::V4::UpdateTenantRequest#update_mask update_mask} is
340
+ # provided, only the specified fields in
341
+ # {::Google::Cloud::Talent::V4::UpdateTenantRequest#tenant tenant} are updated.
342
+ # Otherwise all the fields are updated.
343
+ #
344
+ # A field mask to specify the tenant fields to be updated. Only
345
+ # top level fields of {::Google::Cloud::Talent::V4::Tenant Tenant} are supported.
346
+ #
347
+ # @yield [response, operation] Access the result along with the RPC operation
348
+ # @yieldparam response [::Google::Cloud::Talent::V4::Tenant]
349
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
350
+ #
351
+ # @return [::Google::Cloud::Talent::V4::Tenant]
352
+ #
353
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
354
+ #
355
+ def update_tenant request, options = nil
356
+ raise ::ArgumentError, "request must be provided" if request.nil?
357
+
358
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::UpdateTenantRequest
359
+
360
+ # Converts hash and nil to an options object
361
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
362
+
363
+ # Customize the options with defaults
364
+ metadata = @config.rpcs.update_tenant.metadata.to_h
365
+
366
+ # Set x-goog-api-client and x-goog-user-project headers
367
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
368
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
369
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION
370
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
371
+
372
+ header_params = {
373
+ "tenant.name" => request.tenant.name
374
+ }
375
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
376
+ metadata[:"x-goog-request-params"] ||= request_params_header
377
+
378
+ options.apply_defaults timeout: @config.rpcs.update_tenant.timeout,
379
+ metadata: metadata,
380
+ retry_policy: @config.rpcs.update_tenant.retry_policy
381
+ options.apply_defaults metadata: @config.metadata,
382
+ retry_policy: @config.retry_policy
383
+
384
+ @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation|
385
+ yield response, operation if block_given?
386
+ return response
387
+ end
388
+ rescue ::GRPC::BadStatus => e
389
+ raise ::Google::Cloud::Error.from_error(e)
390
+ end
391
+
392
+ ##
393
+ # Deletes specified tenant.
394
+ #
395
+ # @overload delete_tenant(request, options = nil)
396
+ # Pass arguments to `delete_tenant` via a request object, either of type
397
+ # {::Google::Cloud::Talent::V4::DeleteTenantRequest} or an equivalent Hash.
398
+ #
399
+ # @param request [::Google::Cloud::Talent::V4::DeleteTenantRequest, ::Hash]
400
+ # A request object representing the call parameters. Required. To specify no
401
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
402
+ # @param options [::Gapic::CallOptions, ::Hash]
403
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
404
+ #
405
+ # @overload delete_tenant(name: nil)
406
+ # Pass arguments to `delete_tenant` via keyword arguments. Note that at
407
+ # least one keyword argument is required. To specify no parameters, or to keep all
408
+ # the default parameter values, pass an empty Hash as a request object (see above).
409
+ #
410
+ # @param name [::String]
411
+ # Required. The resource name of the tenant to be deleted.
412
+ #
413
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
414
+ # "projects/foo/tenants/bar".
415
+ #
416
+ # @yield [response, operation] Access the result along with the RPC operation
417
+ # @yieldparam response [::Google::Protobuf::Empty]
418
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
419
+ #
420
+ # @return [::Google::Protobuf::Empty]
421
+ #
422
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
423
+ #
424
+ def delete_tenant request, options = nil
425
+ raise ::ArgumentError, "request must be provided" if request.nil?
426
+
427
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::DeleteTenantRequest
428
+
429
+ # Converts hash and nil to an options object
430
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
431
+
432
+ # Customize the options with defaults
433
+ metadata = @config.rpcs.delete_tenant.metadata.to_h
434
+
435
+ # Set x-goog-api-client and x-goog-user-project headers
436
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
437
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
438
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION
439
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
440
+
441
+ header_params = {
442
+ "name" => request.name
443
+ }
444
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
445
+ metadata[:"x-goog-request-params"] ||= request_params_header
446
+
447
+ options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout,
448
+ metadata: metadata,
449
+ retry_policy: @config.rpcs.delete_tenant.retry_policy
450
+ options.apply_defaults metadata: @config.metadata,
451
+ retry_policy: @config.retry_policy
452
+
453
+ @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation|
454
+ yield response, operation if block_given?
455
+ return response
456
+ end
457
+ rescue ::GRPC::BadStatus => e
458
+ raise ::Google::Cloud::Error.from_error(e)
459
+ end
460
+
461
+ ##
462
+ # Lists all tenants associated with the project.
463
+ #
464
+ # @overload list_tenants(request, options = nil)
465
+ # Pass arguments to `list_tenants` via a request object, either of type
466
+ # {::Google::Cloud::Talent::V4::ListTenantsRequest} or an equivalent Hash.
467
+ #
468
+ # @param request [::Google::Cloud::Talent::V4::ListTenantsRequest, ::Hash]
469
+ # A request object representing the call parameters. Required. To specify no
470
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
471
+ # @param options [::Gapic::CallOptions, ::Hash]
472
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
473
+ #
474
+ # @overload list_tenants(parent: nil, page_token: nil, page_size: nil)
475
+ # Pass arguments to `list_tenants` via keyword arguments. Note that at
476
+ # least one keyword argument is required. To specify no parameters, or to keep all
477
+ # the default parameter values, pass an empty Hash as a request object (see above).
478
+ #
479
+ # @param parent [::String]
480
+ # Required. Resource name of the project under which the tenant is created.
481
+ #
482
+ # The format is "projects/\\{project_id}", for example,
483
+ # "projects/foo".
484
+ # @param page_token [::String]
485
+ # The starting indicator from which to return results.
486
+ # @param page_size [::Integer]
487
+ # The maximum number of tenants to be returned, at most 100.
488
+ # Default is 100 if a non-positive number is provided.
489
+ #
490
+ # @yield [response, operation] Access the result along with the RPC operation
491
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>]
492
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
493
+ #
494
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Talent::V4::Tenant>]
495
+ #
496
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
497
+ #
498
+ def list_tenants request, options = nil
499
+ raise ::ArgumentError, "request must be provided" if request.nil?
500
+
501
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::ListTenantsRequest
502
+
503
+ # Converts hash and nil to an options object
504
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
505
+
506
+ # Customize the options with defaults
507
+ metadata = @config.rpcs.list_tenants.metadata.to_h
508
+
509
+ # Set x-goog-api-client and x-goog-user-project headers
510
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
511
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
512
+ gapic_version: ::Google::Cloud::Talent::V4::VERSION
513
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
514
+
515
+ header_params = {
516
+ "parent" => request.parent
517
+ }
518
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
519
+ metadata[:"x-goog-request-params"] ||= request_params_header
520
+
521
+ options.apply_defaults timeout: @config.rpcs.list_tenants.timeout,
522
+ metadata: metadata,
523
+ retry_policy: @config.rpcs.list_tenants.retry_policy
524
+ options.apply_defaults metadata: @config.metadata,
525
+ retry_policy: @config.retry_policy
526
+
527
+ @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation|
528
+ response = ::Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options
529
+ yield response, operation if block_given?
530
+ return response
531
+ end
532
+ rescue ::GRPC::BadStatus => e
533
+ raise ::Google::Cloud::Error.from_error(e)
534
+ end
535
+
536
+ ##
537
+ # Configuration class for the TenantService API.
538
+ #
539
+ # This class represents the configuration for TenantService,
540
+ # providing control over timeouts, retry behavior, logging, transport
541
+ # parameters, and other low-level controls. Certain parameters can also be
542
+ # applied individually to specific RPCs. See
543
+ # {::Google::Cloud::Talent::V4::TenantService::Client::Configuration::Rpcs}
544
+ # for a list of RPCs that can be configured independently.
545
+ #
546
+ # Configuration can be applied globally to all clients, or to a single client
547
+ # on construction.
548
+ #
549
+ # # Examples
550
+ #
551
+ # To modify the global config, setting the timeout for create_tenant
552
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
553
+ #
554
+ # ::Google::Cloud::Talent::V4::TenantService::Client.configure do |config|
555
+ # config.timeout = 10.0
556
+ # config.rpcs.create_tenant.timeout = 20.0
557
+ # end
558
+ #
559
+ # To apply the above configuration only to a new client:
560
+ #
561
+ # client = ::Google::Cloud::Talent::V4::TenantService::Client.new do |config|
562
+ # config.timeout = 10.0
563
+ # config.rpcs.create_tenant.timeout = 20.0
564
+ # end
565
+ #
566
+ # @!attribute [rw] endpoint
567
+ # The hostname or hostname:port of the service endpoint.
568
+ # Defaults to `"jobs.googleapis.com"`.
569
+ # @return [::String]
570
+ # @!attribute [rw] credentials
571
+ # Credentials to send with calls. You may provide any of the following types:
572
+ # * (`String`) The path to a service account key file in JSON format
573
+ # * (`Hash`) A service account key as a Hash
574
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
575
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
576
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
577
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
578
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
579
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
580
+ # * (`nil`) indicating no credentials
581
+ # @return [::Object]
582
+ # @!attribute [rw] scope
583
+ # The OAuth scopes
584
+ # @return [::Array<::String>]
585
+ # @!attribute [rw] lib_name
586
+ # The library name as recorded in instrumentation and logging
587
+ # @return [::String]
588
+ # @!attribute [rw] lib_version
589
+ # The library version as recorded in instrumentation and logging
590
+ # @return [::String]
591
+ # @!attribute [rw] channel_args
592
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
593
+ # `GRPC::Core::Channel` object is provided as the credential.
594
+ # @return [::Hash]
595
+ # @!attribute [rw] interceptors
596
+ # An array of interceptors that are run before calls are executed.
597
+ # @return [::Array<::GRPC::ClientInterceptor>]
598
+ # @!attribute [rw] timeout
599
+ # The call timeout in seconds.
600
+ # @return [::Numeric]
601
+ # @!attribute [rw] metadata
602
+ # Additional gRPC headers to be sent with the call.
603
+ # @return [::Hash{::Symbol=>::String}]
604
+ # @!attribute [rw] retry_policy
605
+ # The retry policy. The value is a hash with the following keys:
606
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
607
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
608
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
609
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
610
+ # trigger a retry.
611
+ # @return [::Hash]
612
+ # @!attribute [rw] quota_project
613
+ # A separate project against which to charge quota.
614
+ # @return [::String]
615
+ #
616
+ class Configuration
617
+ extend ::Gapic::Config
618
+
619
+ config_attr :endpoint, "jobs.googleapis.com", ::String
620
+ config_attr :credentials, nil do |value|
621
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
622
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
623
+ allowed.any? { |klass| klass === value }
624
+ end
625
+ config_attr :scope, nil, ::String, ::Array, nil
626
+ config_attr :lib_name, nil, ::String, nil
627
+ config_attr :lib_version, nil, ::String, nil
628
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
629
+ config_attr :interceptors, nil, ::Array, nil
630
+ config_attr :timeout, nil, ::Numeric, nil
631
+ config_attr :metadata, nil, ::Hash, nil
632
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
633
+ config_attr :quota_project, nil, ::String, nil
634
+
635
+ # @private
636
+ def initialize parent_config = nil
637
+ @parent_config = parent_config unless parent_config.nil?
638
+
639
+ yield self if block_given?
640
+ end
641
+
642
+ ##
643
+ # Configurations for individual RPCs
644
+ # @return [Rpcs]
645
+ #
646
+ def rpcs
647
+ @rpcs ||= begin
648
+ parent_rpcs = nil
649
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
650
+ Rpcs.new parent_rpcs
651
+ end
652
+ end
653
+
654
+ ##
655
+ # Configuration RPC class for the TenantService API.
656
+ #
657
+ # Includes fields providing the configuration for each RPC in this service.
658
+ # Each configuration object is of type `Gapic::Config::Method` and includes
659
+ # the following configuration fields:
660
+ #
661
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
662
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
663
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
664
+ # include the following keys:
665
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
666
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
667
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
668
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
669
+ # trigger a retry.
670
+ #
671
+ class Rpcs
672
+ ##
673
+ # RPC-specific configuration for `create_tenant`
674
+ # @return [::Gapic::Config::Method]
675
+ #
676
+ attr_reader :create_tenant
677
+ ##
678
+ # RPC-specific configuration for `get_tenant`
679
+ # @return [::Gapic::Config::Method]
680
+ #
681
+ attr_reader :get_tenant
682
+ ##
683
+ # RPC-specific configuration for `update_tenant`
684
+ # @return [::Gapic::Config::Method]
685
+ #
686
+ attr_reader :update_tenant
687
+ ##
688
+ # RPC-specific configuration for `delete_tenant`
689
+ # @return [::Gapic::Config::Method]
690
+ #
691
+ attr_reader :delete_tenant
692
+ ##
693
+ # RPC-specific configuration for `list_tenants`
694
+ # @return [::Gapic::Config::Method]
695
+ #
696
+ attr_reader :list_tenants
697
+
698
+ # @private
699
+ def initialize parent_rpcs = nil
700
+ create_tenant_config = parent_rpcs&.create_tenant if parent_rpcs&.respond_to? :create_tenant
701
+ @create_tenant = ::Gapic::Config::Method.new create_tenant_config
702
+ get_tenant_config = parent_rpcs&.get_tenant if parent_rpcs&.respond_to? :get_tenant
703
+ @get_tenant = ::Gapic::Config::Method.new get_tenant_config
704
+ update_tenant_config = parent_rpcs&.update_tenant if parent_rpcs&.respond_to? :update_tenant
705
+ @update_tenant = ::Gapic::Config::Method.new update_tenant_config
706
+ delete_tenant_config = parent_rpcs&.delete_tenant if parent_rpcs&.respond_to? :delete_tenant
707
+ @delete_tenant = ::Gapic::Config::Method.new delete_tenant_config
708
+ list_tenants_config = parent_rpcs&.list_tenants if parent_rpcs&.respond_to? :list_tenants
709
+ @list_tenants = ::Gapic::Config::Method.new list_tenants_config
710
+
711
+ yield self if block_given?
712
+ end
713
+ end
714
+ end
715
+ end
716
+ end
717
+ end
718
+ end
719
+ end
720
+ end