google-cloud-talent-v4beta1 0.6.0 → 0.7.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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +2 -2
- data/lib/google/cloud/talent/v4beta1/company_service/client.rb +16 -12
- data/lib/google/cloud/talent/v4beta1/company_service/rest/client.rb +693 -0
- data/lib/google/cloud/talent/v4beta1/company_service/rest/service_stub.rb +382 -0
- data/lib/google/cloud/talent/v4beta1/company_service/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/company_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/completion/client.rb +4 -2
- data/lib/google/cloud/talent/v4beta1/completion/rest/client.rb +386 -0
- data/lib/google/cloud/talent/v4beta1/completion/rest/service_stub.rb +114 -0
- data/lib/google/cloud/talent/v4beta1/completion/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/completion.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/event_service/client.rb +2 -2
- data/lib/google/cloud/talent/v4beta1/event_service/rest/client.rb +359 -0
- data/lib/google/cloud/talent/v4beta1/event_service/rest/service_stub.rb +116 -0
- data/lib/google/cloud/talent/v4beta1/event_service/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/event_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/job_service/client.rb +250 -161
- data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +12 -14
- data/lib/google/cloud/talent/v4beta1/job_service/rest/client.rb +1712 -0
- data/lib/google/cloud/talent/v4beta1/job_service/rest/operations.rb +793 -0
- data/lib/google/cloud/talent/v4beta1/job_service/rest/service_stub.rb +721 -0
- data/lib/google/cloud/talent/v4beta1/job_service/rest.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/job_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +12 -8
- data/lib/google/cloud/talent/v4beta1/rest.rb +41 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +13 -10
- data/lib/google/cloud/talent/v4beta1/tenant_service/rest/client.rb +672 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/rest/service_stub.rb +345 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/rest.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service.rb +7 -1
- data/lib/google/cloud/talent/v4beta1/version.rb +1 -1
- data/lib/google/cloud/talent/v4beta1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/talent/v4beta1/common.rb +117 -56
- data/proto_docs/google/cloud/talent/v4beta1/company.rb +12 -4
- data/proto_docs/google/cloud/talent/v4beta1/company_service.rb +12 -6
- data/proto_docs/google/cloud/talent/v4beta1/completion_service.rb +21 -10
- data/proto_docs/google/cloud/talent/v4beta1/event.rb +20 -10
- data/proto_docs/google/cloud/talent/v4beta1/event_service.rb +2 -2
- data/proto_docs/google/cloud/talent/v4beta1/filters.rb +62 -38
- data/proto_docs/google/cloud/talent/v4beta1/histogram.rb +8 -3
- data/proto_docs/google/cloud/talent/v4beta1/job.rb +86 -54
- data/proto_docs/google/cloud/talent/v4beta1/job_service.rb +212 -121
- data/proto_docs/google/cloud/talent/v4beta1/tenant.rb +9 -5
- data/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb +9 -4
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +28 -8
@@ -0,0 +1,693 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/talent/v4beta1/company_service_pb"
|
21
|
+
require "google/cloud/talent/v4beta1/company_service/rest/service_stub"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Talent
|
26
|
+
module V4beta1
|
27
|
+
module CompanyService
|
28
|
+
module Rest
|
29
|
+
##
|
30
|
+
# REST client for the CompanyService service.
|
31
|
+
#
|
32
|
+
# A service that handles company management, including CRUD and enumeration.
|
33
|
+
#
|
34
|
+
class Client
|
35
|
+
include Paths
|
36
|
+
|
37
|
+
# @private
|
38
|
+
attr_reader :company_service_stub
|
39
|
+
|
40
|
+
##
|
41
|
+
# Configure the CompanyService Client class.
|
42
|
+
#
|
43
|
+
# See {::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client::Configuration}
|
44
|
+
# for a description of the configuration fields.
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
#
|
48
|
+
# # Modify the configuration for all CompanyService clients
|
49
|
+
# ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.configure do |config|
|
50
|
+
# config.timeout = 10.0
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# @yield [config] Configure the Client client.
|
54
|
+
# @yieldparam config [Client::Configuration]
|
55
|
+
#
|
56
|
+
# @return [Client::Configuration]
|
57
|
+
#
|
58
|
+
def self.configure
|
59
|
+
@configure ||= begin
|
60
|
+
namespace = ["Google", "Cloud", "Talent", "V4beta1"]
|
61
|
+
parent_config = while namespace.any?
|
62
|
+
parent_name = namespace.join "::"
|
63
|
+
parent_const = const_get parent_name
|
64
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
65
|
+
namespace.pop
|
66
|
+
end
|
67
|
+
default_config = Client::Configuration.new parent_config
|
68
|
+
|
69
|
+
default_config.rpcs.create_company.timeout = 30.0
|
70
|
+
|
71
|
+
default_config.rpcs.get_company.timeout = 30.0
|
72
|
+
default_config.rpcs.get_company.retry_policy = {
|
73
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
74
|
+
}
|
75
|
+
|
76
|
+
default_config.rpcs.update_company.timeout = 30.0
|
77
|
+
|
78
|
+
default_config.rpcs.delete_company.timeout = 30.0
|
79
|
+
default_config.rpcs.delete_company.retry_policy = {
|
80
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
81
|
+
}
|
82
|
+
|
83
|
+
default_config.rpcs.list_companies.timeout = 30.0
|
84
|
+
default_config.rpcs.list_companies.retry_policy = {
|
85
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
86
|
+
}
|
87
|
+
|
88
|
+
default_config
|
89
|
+
end
|
90
|
+
yield @configure if block_given?
|
91
|
+
@configure
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Configure the CompanyService Client instance.
|
96
|
+
#
|
97
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
98
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
99
|
+
# should be made on {Client.configure}.
|
100
|
+
#
|
101
|
+
# See {::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client::Configuration}
|
102
|
+
# for a description of the configuration fields.
|
103
|
+
#
|
104
|
+
# @yield [config] Configure the Client client.
|
105
|
+
# @yieldparam config [Client::Configuration]
|
106
|
+
#
|
107
|
+
# @return [Client::Configuration]
|
108
|
+
#
|
109
|
+
def configure
|
110
|
+
yield @config if block_given?
|
111
|
+
@config
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# Create a new CompanyService REST client object.
|
116
|
+
#
|
117
|
+
# @example
|
118
|
+
#
|
119
|
+
# # Create a client using the default configuration
|
120
|
+
# client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new
|
121
|
+
#
|
122
|
+
# # Create a client using a custom configuration
|
123
|
+
# client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config|
|
124
|
+
# config.timeout = 10.0
|
125
|
+
# end
|
126
|
+
#
|
127
|
+
# @yield [config] Configure the CompanyService client.
|
128
|
+
# @yieldparam config [Client::Configuration]
|
129
|
+
#
|
130
|
+
def initialize
|
131
|
+
# Create the configuration object
|
132
|
+
@config = Configuration.new Client.configure
|
133
|
+
|
134
|
+
# Yield the configuration if needed
|
135
|
+
yield @config if block_given?
|
136
|
+
|
137
|
+
# Create credentials
|
138
|
+
credentials = @config.credentials
|
139
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
140
|
+
# but only if the default endpoint does not have a region prefix.
|
141
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
142
|
+
!@config.endpoint.split(".").first.include?("-")
|
143
|
+
credentials ||= Credentials.default scope: @config.scope,
|
144
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
145
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
146
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
147
|
+
end
|
148
|
+
|
149
|
+
@quota_project_id = @config.quota_project
|
150
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
151
|
+
|
152
|
+
@company_service_stub = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
153
|
+
end
|
154
|
+
|
155
|
+
# Service calls
|
156
|
+
|
157
|
+
##
|
158
|
+
# Creates a new company entity.
|
159
|
+
#
|
160
|
+
# @overload create_company(request, options = nil)
|
161
|
+
# Pass arguments to `create_company` via a request object, either of type
|
162
|
+
# {::Google::Cloud::Talent::V4beta1::CreateCompanyRequest} or an equivalent Hash.
|
163
|
+
#
|
164
|
+
# @param request [::Google::Cloud::Talent::V4beta1::CreateCompanyRequest, ::Hash]
|
165
|
+
# A request object representing the call parameters. Required. To specify no
|
166
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
167
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
168
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
169
|
+
#
|
170
|
+
# @overload create_company(parent: nil, company: nil)
|
171
|
+
# Pass arguments to `create_company` via keyword arguments. Note that at
|
172
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
173
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
174
|
+
#
|
175
|
+
# @param parent [::String]
|
176
|
+
# Required. Resource name of the tenant under which the company is created.
|
177
|
+
#
|
178
|
+
# The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
|
179
|
+
# "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
|
180
|
+
# is created, for example, "projects/foo".
|
181
|
+
# @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash]
|
182
|
+
# Required. The company to be created.
|
183
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
184
|
+
# @yieldparam result [::Google::Cloud::Talent::V4beta1::Company]
|
185
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
186
|
+
#
|
187
|
+
# @return [::Google::Cloud::Talent::V4beta1::Company]
|
188
|
+
#
|
189
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
190
|
+
def create_company request, options = nil
|
191
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
192
|
+
|
193
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::CreateCompanyRequest
|
194
|
+
|
195
|
+
# Converts hash and nil to an options object
|
196
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
197
|
+
|
198
|
+
# Customize the options with defaults
|
199
|
+
call_metadata = @config.rpcs.create_company.metadata.to_h
|
200
|
+
|
201
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
202
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
203
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
204
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
|
205
|
+
transports_version_send: [:rest]
|
206
|
+
|
207
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
208
|
+
|
209
|
+
options.apply_defaults timeout: @config.rpcs.create_company.timeout,
|
210
|
+
metadata: call_metadata,
|
211
|
+
retry_policy: @config.rpcs.create_company.retry_policy
|
212
|
+
|
213
|
+
options.apply_defaults timeout: @config.timeout,
|
214
|
+
metadata: @config.metadata,
|
215
|
+
retry_policy: @config.retry_policy
|
216
|
+
|
217
|
+
@company_service_stub.create_company request, options do |result, operation|
|
218
|
+
yield result, operation if block_given?
|
219
|
+
return result
|
220
|
+
end
|
221
|
+
rescue ::Gapic::Rest::Error => e
|
222
|
+
raise ::Google::Cloud::Error.from_error(e)
|
223
|
+
end
|
224
|
+
|
225
|
+
##
|
226
|
+
# Retrieves specified company.
|
227
|
+
#
|
228
|
+
# @overload get_company(request, options = nil)
|
229
|
+
# Pass arguments to `get_company` via a request object, either of type
|
230
|
+
# {::Google::Cloud::Talent::V4beta1::GetCompanyRequest} or an equivalent Hash.
|
231
|
+
#
|
232
|
+
# @param request [::Google::Cloud::Talent::V4beta1::GetCompanyRequest, ::Hash]
|
233
|
+
# A request object representing the call parameters. Required. To specify no
|
234
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
235
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
236
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
237
|
+
#
|
238
|
+
# @overload get_company(name: nil)
|
239
|
+
# Pass arguments to `get_company` via keyword arguments. Note that at
|
240
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
241
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
242
|
+
#
|
243
|
+
# @param name [::String]
|
244
|
+
# Required. The resource name of the company to be retrieved.
|
245
|
+
#
|
246
|
+
# The format is
|
247
|
+
# "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
|
248
|
+
# example, "projects/api-test-project/tenants/foo/companies/bar".
|
249
|
+
#
|
250
|
+
# If tenant id is unspecified, the default tenant is used, for
|
251
|
+
# example, "projects/api-test-project/companies/bar".
|
252
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
253
|
+
# @yieldparam result [::Google::Cloud::Talent::V4beta1::Company]
|
254
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
255
|
+
#
|
256
|
+
# @return [::Google::Cloud::Talent::V4beta1::Company]
|
257
|
+
#
|
258
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
259
|
+
def get_company request, options = nil
|
260
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
261
|
+
|
262
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::GetCompanyRequest
|
263
|
+
|
264
|
+
# Converts hash and nil to an options object
|
265
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
266
|
+
|
267
|
+
# Customize the options with defaults
|
268
|
+
call_metadata = @config.rpcs.get_company.metadata.to_h
|
269
|
+
|
270
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
271
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
272
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
273
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
|
274
|
+
transports_version_send: [:rest]
|
275
|
+
|
276
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
277
|
+
|
278
|
+
options.apply_defaults timeout: @config.rpcs.get_company.timeout,
|
279
|
+
metadata: call_metadata,
|
280
|
+
retry_policy: @config.rpcs.get_company.retry_policy
|
281
|
+
|
282
|
+
options.apply_defaults timeout: @config.timeout,
|
283
|
+
metadata: @config.metadata,
|
284
|
+
retry_policy: @config.retry_policy
|
285
|
+
|
286
|
+
@company_service_stub.get_company request, options do |result, operation|
|
287
|
+
yield result, operation if block_given?
|
288
|
+
return result
|
289
|
+
end
|
290
|
+
rescue ::Gapic::Rest::Error => e
|
291
|
+
raise ::Google::Cloud::Error.from_error(e)
|
292
|
+
end
|
293
|
+
|
294
|
+
##
|
295
|
+
# Updates specified company.
|
296
|
+
#
|
297
|
+
# @overload update_company(request, options = nil)
|
298
|
+
# Pass arguments to `update_company` via a request object, either of type
|
299
|
+
# {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest} or an equivalent Hash.
|
300
|
+
#
|
301
|
+
# @param request [::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, ::Hash]
|
302
|
+
# A request object representing the call parameters. Required. To specify no
|
303
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
304
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
305
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
306
|
+
#
|
307
|
+
# @overload update_company(company: nil, update_mask: nil)
|
308
|
+
# Pass arguments to `update_company` via keyword arguments. Note that at
|
309
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
310
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
311
|
+
#
|
312
|
+
# @param company [::Google::Cloud::Talent::V4beta1::Company, ::Hash]
|
313
|
+
# Required. The company resource to replace the current resource in the
|
314
|
+
# system.
|
315
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
316
|
+
# Strongly recommended for the best service experience.
|
317
|
+
#
|
318
|
+
# If
|
319
|
+
# {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask}
|
320
|
+
# is provided, only the specified fields in
|
321
|
+
# {::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are
|
322
|
+
# updated. Otherwise all the fields are updated.
|
323
|
+
#
|
324
|
+
# A field mask to specify the company fields to be updated. Only
|
325
|
+
# top level fields of {::Google::Cloud::Talent::V4beta1::Company Company} are
|
326
|
+
# supported.
|
327
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
328
|
+
# @yieldparam result [::Google::Cloud::Talent::V4beta1::Company]
|
329
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
330
|
+
#
|
331
|
+
# @return [::Google::Cloud::Talent::V4beta1::Company]
|
332
|
+
#
|
333
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
334
|
+
def update_company request, options = nil
|
335
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
336
|
+
|
337
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::UpdateCompanyRequest
|
338
|
+
|
339
|
+
# Converts hash and nil to an options object
|
340
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
341
|
+
|
342
|
+
# Customize the options with defaults
|
343
|
+
call_metadata = @config.rpcs.update_company.metadata.to_h
|
344
|
+
|
345
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
346
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
347
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
348
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
|
349
|
+
transports_version_send: [:rest]
|
350
|
+
|
351
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
352
|
+
|
353
|
+
options.apply_defaults timeout: @config.rpcs.update_company.timeout,
|
354
|
+
metadata: call_metadata,
|
355
|
+
retry_policy: @config.rpcs.update_company.retry_policy
|
356
|
+
|
357
|
+
options.apply_defaults timeout: @config.timeout,
|
358
|
+
metadata: @config.metadata,
|
359
|
+
retry_policy: @config.retry_policy
|
360
|
+
|
361
|
+
@company_service_stub.update_company request, options do |result, operation|
|
362
|
+
yield result, operation if block_given?
|
363
|
+
return result
|
364
|
+
end
|
365
|
+
rescue ::Gapic::Rest::Error => e
|
366
|
+
raise ::Google::Cloud::Error.from_error(e)
|
367
|
+
end
|
368
|
+
|
369
|
+
##
|
370
|
+
# Deletes specified company.
|
371
|
+
# Prerequisite: The company has no jobs associated with it.
|
372
|
+
#
|
373
|
+
# @overload delete_company(request, options = nil)
|
374
|
+
# Pass arguments to `delete_company` via a request object, either of type
|
375
|
+
# {::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest} or an equivalent Hash.
|
376
|
+
#
|
377
|
+
# @param request [::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, ::Hash]
|
378
|
+
# A request object representing the call parameters. Required. To specify no
|
379
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
380
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
381
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
382
|
+
#
|
383
|
+
# @overload delete_company(name: nil)
|
384
|
+
# Pass arguments to `delete_company` via keyword arguments. Note that at
|
385
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
386
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
387
|
+
#
|
388
|
+
# @param name [::String]
|
389
|
+
# Required. The resource name of the company to be deleted.
|
390
|
+
#
|
391
|
+
# The format is
|
392
|
+
# "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
|
393
|
+
# example, "projects/foo/tenants/bar/companies/baz".
|
394
|
+
#
|
395
|
+
# If tenant id is unspecified, the default tenant is used, for
|
396
|
+
# example, "projects/foo/companies/bar".
|
397
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
398
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
399
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
400
|
+
#
|
401
|
+
# @return [::Google::Protobuf::Empty]
|
402
|
+
#
|
403
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
404
|
+
def delete_company request, options = nil
|
405
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
406
|
+
|
407
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::DeleteCompanyRequest
|
408
|
+
|
409
|
+
# Converts hash and nil to an options object
|
410
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
411
|
+
|
412
|
+
# Customize the options with defaults
|
413
|
+
call_metadata = @config.rpcs.delete_company.metadata.to_h
|
414
|
+
|
415
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
416
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
417
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
418
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
|
419
|
+
transports_version_send: [:rest]
|
420
|
+
|
421
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
422
|
+
|
423
|
+
options.apply_defaults timeout: @config.rpcs.delete_company.timeout,
|
424
|
+
metadata: call_metadata,
|
425
|
+
retry_policy: @config.rpcs.delete_company.retry_policy
|
426
|
+
|
427
|
+
options.apply_defaults timeout: @config.timeout,
|
428
|
+
metadata: @config.metadata,
|
429
|
+
retry_policy: @config.retry_policy
|
430
|
+
|
431
|
+
@company_service_stub.delete_company request, options do |result, operation|
|
432
|
+
yield result, operation if block_given?
|
433
|
+
return result
|
434
|
+
end
|
435
|
+
rescue ::Gapic::Rest::Error => e
|
436
|
+
raise ::Google::Cloud::Error.from_error(e)
|
437
|
+
end
|
438
|
+
|
439
|
+
##
|
440
|
+
# Lists all companies associated with the project.
|
441
|
+
#
|
442
|
+
# @overload list_companies(request, options = nil)
|
443
|
+
# Pass arguments to `list_companies` via a request object, either of type
|
444
|
+
# {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest} or an equivalent Hash.
|
445
|
+
#
|
446
|
+
# @param request [::Google::Cloud::Talent::V4beta1::ListCompaniesRequest, ::Hash]
|
447
|
+
# A request object representing the call parameters. Required. To specify no
|
448
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
449
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
450
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
451
|
+
#
|
452
|
+
# @overload list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil)
|
453
|
+
# Pass arguments to `list_companies` via keyword arguments. Note that at
|
454
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
455
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
456
|
+
#
|
457
|
+
# @param parent [::String]
|
458
|
+
# Required. Resource name of the tenant under which the company is created.
|
459
|
+
#
|
460
|
+
# The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
|
461
|
+
# "projects/foo/tenant/bar".
|
462
|
+
#
|
463
|
+
# If tenant id is unspecified, the default tenant will be used, for
|
464
|
+
# example, "projects/foo".
|
465
|
+
# @param page_token [::String]
|
466
|
+
# The starting indicator from which to return results.
|
467
|
+
# @param page_size [::Integer]
|
468
|
+
# The maximum number of companies to be returned, at most 100.
|
469
|
+
# Default is 100 if a non-positive number is provided.
|
470
|
+
# @param require_open_jobs [::Boolean]
|
471
|
+
# Set to true if the companies requested must have open jobs.
|
472
|
+
#
|
473
|
+
# Defaults to false.
|
474
|
+
#
|
475
|
+
# If true, at most
|
476
|
+
# {::Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of
|
477
|
+
# companies are fetched, among which only those with open jobs are returned.
|
478
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
479
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>]
|
480
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
481
|
+
#
|
482
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Talent::V4beta1::Company>]
|
483
|
+
#
|
484
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
485
|
+
def list_companies request, options = nil
|
486
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
487
|
+
|
488
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4beta1::ListCompaniesRequest
|
489
|
+
|
490
|
+
# Converts hash and nil to an options object
|
491
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
492
|
+
|
493
|
+
# Customize the options with defaults
|
494
|
+
call_metadata = @config.rpcs.list_companies.metadata.to_h
|
495
|
+
|
496
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
497
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
498
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
499
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION,
|
500
|
+
transports_version_send: [:rest]
|
501
|
+
|
502
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
503
|
+
|
504
|
+
options.apply_defaults timeout: @config.rpcs.list_companies.timeout,
|
505
|
+
metadata: call_metadata,
|
506
|
+
retry_policy: @config.rpcs.list_companies.retry_policy
|
507
|
+
|
508
|
+
options.apply_defaults timeout: @config.timeout,
|
509
|
+
metadata: @config.metadata,
|
510
|
+
retry_policy: @config.retry_policy
|
511
|
+
|
512
|
+
@company_service_stub.list_companies request, options do |result, operation|
|
513
|
+
result = ::Gapic::Rest::PagedEnumerable.new @company_service_stub, :list_companies, "companies", request, result, options
|
514
|
+
yield result, operation if block_given?
|
515
|
+
return result
|
516
|
+
end
|
517
|
+
rescue ::Gapic::Rest::Error => e
|
518
|
+
raise ::Google::Cloud::Error.from_error(e)
|
519
|
+
end
|
520
|
+
|
521
|
+
##
|
522
|
+
# Configuration class for the CompanyService REST API.
|
523
|
+
#
|
524
|
+
# This class represents the configuration for CompanyService REST,
|
525
|
+
# providing control over timeouts, retry behavior, logging, transport
|
526
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
527
|
+
# applied individually to specific RPCs. See
|
528
|
+
# {::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client::Configuration::Rpcs}
|
529
|
+
# for a list of RPCs that can be configured independently.
|
530
|
+
#
|
531
|
+
# Configuration can be applied globally to all clients, or to a single client
|
532
|
+
# on construction.
|
533
|
+
#
|
534
|
+
# @example
|
535
|
+
#
|
536
|
+
# # Modify the global config, setting the timeout for
|
537
|
+
# # create_company to 20 seconds,
|
538
|
+
# # and all remaining timeouts to 10 seconds.
|
539
|
+
# ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.configure do |config|
|
540
|
+
# config.timeout = 10.0
|
541
|
+
# config.rpcs.create_company.timeout = 20.0
|
542
|
+
# end
|
543
|
+
#
|
544
|
+
# # Apply the above configuration only to a new client.
|
545
|
+
# client = ::Google::Cloud::Talent::V4beta1::CompanyService::Rest::Client.new do |config|
|
546
|
+
# config.timeout = 10.0
|
547
|
+
# config.rpcs.create_company.timeout = 20.0
|
548
|
+
# end
|
549
|
+
#
|
550
|
+
# @!attribute [rw] endpoint
|
551
|
+
# The hostname or hostname:port of the service endpoint.
|
552
|
+
# Defaults to `"jobs.googleapis.com"`.
|
553
|
+
# @return [::String]
|
554
|
+
# @!attribute [rw] credentials
|
555
|
+
# Credentials to send with calls. You may provide any of the following types:
|
556
|
+
# * (`String`) The path to a service account key file in JSON format
|
557
|
+
# * (`Hash`) A service account key as a Hash
|
558
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
559
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
560
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
561
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
562
|
+
# * (`nil`) indicating no credentials
|
563
|
+
# @return [::Object]
|
564
|
+
# @!attribute [rw] scope
|
565
|
+
# The OAuth scopes
|
566
|
+
# @return [::Array<::String>]
|
567
|
+
# @!attribute [rw] lib_name
|
568
|
+
# The library name as recorded in instrumentation and logging
|
569
|
+
# @return [::String]
|
570
|
+
# @!attribute [rw] lib_version
|
571
|
+
# The library version as recorded in instrumentation and logging
|
572
|
+
# @return [::String]
|
573
|
+
# @!attribute [rw] timeout
|
574
|
+
# The call timeout in seconds.
|
575
|
+
# @return [::Numeric]
|
576
|
+
# @!attribute [rw] metadata
|
577
|
+
# Additional headers to be sent with the call.
|
578
|
+
# @return [::Hash{::Symbol=>::String}]
|
579
|
+
# @!attribute [rw] retry_policy
|
580
|
+
# The retry policy. The value is a hash with the following keys:
|
581
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
582
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
583
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
584
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
585
|
+
# trigger a retry.
|
586
|
+
# @return [::Hash]
|
587
|
+
# @!attribute [rw] quota_project
|
588
|
+
# A separate project against which to charge quota.
|
589
|
+
# @return [::String]
|
590
|
+
#
|
591
|
+
class Configuration
|
592
|
+
extend ::Gapic::Config
|
593
|
+
|
594
|
+
config_attr :endpoint, "jobs.googleapis.com", ::String
|
595
|
+
config_attr :credentials, nil do |value|
|
596
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
597
|
+
allowed.any? { |klass| klass === value }
|
598
|
+
end
|
599
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
600
|
+
config_attr :lib_name, nil, ::String, nil
|
601
|
+
config_attr :lib_version, nil, ::String, nil
|
602
|
+
config_attr :timeout, nil, ::Numeric, nil
|
603
|
+
config_attr :metadata, nil, ::Hash, nil
|
604
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
605
|
+
config_attr :quota_project, nil, ::String, nil
|
606
|
+
|
607
|
+
# @private
|
608
|
+
def initialize parent_config = nil
|
609
|
+
@parent_config = parent_config unless parent_config.nil?
|
610
|
+
|
611
|
+
yield self if block_given?
|
612
|
+
end
|
613
|
+
|
614
|
+
##
|
615
|
+
# Configurations for individual RPCs
|
616
|
+
# @return [Rpcs]
|
617
|
+
#
|
618
|
+
def rpcs
|
619
|
+
@rpcs ||= begin
|
620
|
+
parent_rpcs = nil
|
621
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
622
|
+
Rpcs.new parent_rpcs
|
623
|
+
end
|
624
|
+
end
|
625
|
+
|
626
|
+
##
|
627
|
+
# Configuration RPC class for the CompanyService API.
|
628
|
+
#
|
629
|
+
# Includes fields providing the configuration for each RPC in this service.
|
630
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
631
|
+
# the following configuration fields:
|
632
|
+
#
|
633
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
634
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
635
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
636
|
+
# include the following keys:
|
637
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
638
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
639
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
640
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
641
|
+
# trigger a retry.
|
642
|
+
#
|
643
|
+
class Rpcs
|
644
|
+
##
|
645
|
+
# RPC-specific configuration for `create_company`
|
646
|
+
# @return [::Gapic::Config::Method]
|
647
|
+
#
|
648
|
+
attr_reader :create_company
|
649
|
+
##
|
650
|
+
# RPC-specific configuration for `get_company`
|
651
|
+
# @return [::Gapic::Config::Method]
|
652
|
+
#
|
653
|
+
attr_reader :get_company
|
654
|
+
##
|
655
|
+
# RPC-specific configuration for `update_company`
|
656
|
+
# @return [::Gapic::Config::Method]
|
657
|
+
#
|
658
|
+
attr_reader :update_company
|
659
|
+
##
|
660
|
+
# RPC-specific configuration for `delete_company`
|
661
|
+
# @return [::Gapic::Config::Method]
|
662
|
+
#
|
663
|
+
attr_reader :delete_company
|
664
|
+
##
|
665
|
+
# RPC-specific configuration for `list_companies`
|
666
|
+
# @return [::Gapic::Config::Method]
|
667
|
+
#
|
668
|
+
attr_reader :list_companies
|
669
|
+
|
670
|
+
# @private
|
671
|
+
def initialize parent_rpcs = nil
|
672
|
+
create_company_config = parent_rpcs.create_company if parent_rpcs.respond_to? :create_company
|
673
|
+
@create_company = ::Gapic::Config::Method.new create_company_config
|
674
|
+
get_company_config = parent_rpcs.get_company if parent_rpcs.respond_to? :get_company
|
675
|
+
@get_company = ::Gapic::Config::Method.new get_company_config
|
676
|
+
update_company_config = parent_rpcs.update_company if parent_rpcs.respond_to? :update_company
|
677
|
+
@update_company = ::Gapic::Config::Method.new update_company_config
|
678
|
+
delete_company_config = parent_rpcs.delete_company if parent_rpcs.respond_to? :delete_company
|
679
|
+
@delete_company = ::Gapic::Config::Method.new delete_company_config
|
680
|
+
list_companies_config = parent_rpcs.list_companies if parent_rpcs.respond_to? :list_companies
|
681
|
+
@list_companies = ::Gapic::Config::Method.new list_companies_config
|
682
|
+
|
683
|
+
yield self if block_given?
|
684
|
+
end
|
685
|
+
end
|
686
|
+
end
|
687
|
+
end
|
688
|
+
end
|
689
|
+
end
|
690
|
+
end
|
691
|
+
end
|
692
|
+
end
|
693
|
+
end
|