google-cloud-talent 0.8.3 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -59
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +347 -0
  6. data/README.md +36 -25
  7. data/lib/{google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb → google-cloud-talent.rb} +4 -14
  8. data/lib/google/cloud/talent.rb +203 -453
  9. data/lib/google/cloud/talent/version.rb +6 -2
  10. metadata +75 -110
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/talent/v4beta1.rb +0 -543
  13. data/lib/google/cloud/talent/v4beta1/application_pb.rb +0 -63
  14. data/lib/google/cloud/talent/v4beta1/application_service_client.rb +0 -484
  15. data/lib/google/cloud/talent/v4beta1/application_service_client_config.json +0 -51
  16. data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +0 -55
  17. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +0 -56
  18. data/lib/google/cloud/talent/v4beta1/batch_pb.rb +0 -18
  19. data/lib/google/cloud/talent/v4beta1/common_pb.rb +0 -341
  20. data/lib/google/cloud/talent/v4beta1/company_pb.rb +0 -41
  21. data/lib/google/cloud/talent/v4beta1/company_service_client.rb +0 -529
  22. data/lib/google/cloud/talent/v4beta1/company_service_client_config.json +0 -51
  23. data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +0 -56
  24. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +0 -56
  25. data/lib/google/cloud/talent/v4beta1/completion_client.rb +0 -337
  26. data/lib/google/cloud/talent/v4beta1/completion_client_config.json +0 -31
  27. data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +0 -56
  28. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +0 -48
  29. data/lib/google/cloud/talent/v4beta1/credentials.rb +0 -42
  30. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application.rb +0 -166
  31. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application_service.rb +0 -100
  32. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +0 -1057
  33. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +0 -107
  34. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +0 -116
  35. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +0 -139
  36. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +0 -224
  37. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +0 -36
  38. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +0 -763
  39. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +0 -50
  40. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +0 -331
  41. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +0 -696
  42. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +0 -750
  43. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +0 -410
  44. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +0 -70
  45. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +0 -96
  46. data/lib/google/cloud/talent/v4beta1/doc/google/longrunning/operations.rb +0 -51
  47. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/any.rb +0 -131
  48. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb +0 -91
  49. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb +0 -222
  50. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb +0 -113
  51. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb +0 -34
  52. data/lib/google/cloud/talent/v4beta1/doc/google/rpc/status.rb +0 -39
  53. data/lib/google/cloud/talent/v4beta1/doc/google/type/date.rb +0 -43
  54. data/lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb +0 -31
  55. data/lib/google/cloud/talent/v4beta1/doc/google/type/money.rb +0 -36
  56. data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +0 -128
  57. data/lib/google/cloud/talent/v4beta1/doc/google/type/timeofday.rb +0 -37
  58. data/lib/google/cloud/talent/v4beta1/event_pb.rb +0 -69
  59. data/lib/google/cloud/talent/v4beta1/event_service_client.rb +0 -268
  60. data/lib/google/cloud/talent/v4beta1/event_service_client_config.json +0 -31
  61. data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +0 -27
  62. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +0 -53
  63. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +0 -187
  64. data/lib/google/cloud/talent/v4beta1/helpers.rb +0 -162
  65. data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +0 -27
  66. data/lib/google/cloud/talent/v4beta1/job_pb.rb +0 -72
  67. data/lib/google/cloud/talent/v4beta1/job_service_client.rb +0 -1510
  68. data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +0 -76
  69. data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +0 -166
  70. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +0 -88
  71. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -213
  72. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -811
  73. data/lib/google/cloud/talent/v4beta1/profile_service_client_config.json +0 -56
  74. data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +0 -91
  75. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +0 -65
  76. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -34
  77. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -471
  78. data/lib/google/cloud/talent/v4beta1/tenant_service_client_config.json +0 -51
  79. data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +0 -55
  80. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +0 -55
@@ -1,41 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/talent/v4beta1/company.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/field_behavior_pb'
8
- require 'google/api/resource_pb'
9
- require 'google/cloud/talent/v4beta1/common_pb'
10
- require 'google/api/annotations_pb'
11
- Google::Protobuf::DescriptorPool.generated_pool.build do
12
- add_message "google.cloud.talent.v4beta1.Company" do
13
- optional :name, :string, 1
14
- optional :display_name, :string, 2
15
- optional :external_id, :string, 3
16
- optional :size, :enum, 4, "google.cloud.talent.v4beta1.CompanySize"
17
- optional :headquarters_address, :string, 5
18
- optional :hiring_agency, :bool, 6
19
- optional :eeo_text, :string, 7
20
- optional :website_uri, :string, 8
21
- optional :career_site_uri, :string, 9
22
- optional :image_uri, :string, 10
23
- repeated :keyword_searchable_job_custom_attributes, :string, 11
24
- optional :derived_info, :message, 12, "google.cloud.talent.v4beta1.Company.DerivedInfo"
25
- optional :suspended, :bool, 13
26
- end
27
- add_message "google.cloud.talent.v4beta1.Company.DerivedInfo" do
28
- optional :headquarters_location, :message, 1, "google.cloud.talent.v4beta1.Location"
29
- end
30
- end
31
-
32
- module Google
33
- module Cloud
34
- module Talent
35
- module V4beta1
36
- Company = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company").msgclass
37
- Company::DerivedInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company.DerivedInfo").msgclass
38
- end
39
- end
40
- end
41
- end
@@ -1,529 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- #
15
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/cloud/talent/v4beta1/company_service.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/cloud/talent/v4beta1/company_service_pb"
29
- require "google/cloud/talent/v4beta1/credentials"
30
- require "google/cloud/talent/version"
31
-
32
- module Google
33
- module Cloud
34
- module Talent
35
- module V4beta1
36
- # A service that handles company management, including CRUD and enumeration.
37
- #
38
- # @!attribute [r] company_service_stub
39
- # @return [Google::Cloud::Talent::V4beta1::CompanyService::Stub]
40
- class CompanyServiceClient
41
- # @private
42
- attr_reader :company_service_stub
43
-
44
- # The default address of the service.
45
- SERVICE_ADDRESS = "jobs.googleapis.com".freeze
46
-
47
- # The default port of the service.
48
- DEFAULT_SERVICE_PORT = 443
49
-
50
- # The default set of gRPC interceptors.
51
- GRPC_INTERCEPTORS = []
52
-
53
- DEFAULT_TIMEOUT = 30
54
-
55
- PAGE_DESCRIPTORS = {
56
- "list_companies" => Google::Gax::PageDescriptor.new(
57
- "page_token",
58
- "next_page_token",
59
- "companies")
60
- }.freeze
61
-
62
- private_constant :PAGE_DESCRIPTORS
63
-
64
- # The scopes needed to make gRPC calls to all of the methods defined in
65
- # this service.
66
- ALL_SCOPES = [
67
- "https://www.googleapis.com/auth/cloud-platform",
68
- "https://www.googleapis.com/auth/jobs"
69
- ].freeze
70
-
71
-
72
- COMPANY_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
73
- "projects/{project}/tenants/{tenant}/companies/{company}"
74
- )
75
-
76
- private_constant :COMPANY_PATH_TEMPLATE
77
-
78
- COMPANY_WITHOUT_TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
79
- "projects/{project}/companies/{company}"
80
- )
81
-
82
- private_constant :COMPANY_WITHOUT_TENANT_PATH_TEMPLATE
83
-
84
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
85
- "projects/{project}"
86
- )
87
-
88
- private_constant :PROJECT_PATH_TEMPLATE
89
-
90
- TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
91
- "projects/{project}/tenants/{tenant}"
92
- )
93
-
94
- private_constant :TENANT_PATH_TEMPLATE
95
-
96
- # Returns a fully-qualified company resource name string.
97
- # @param project [String]
98
- # @param tenant [String]
99
- # @param company [String]
100
- # @return [String]
101
- def self.company_path project, tenant, company
102
- COMPANY_PATH_TEMPLATE.render(
103
- :"project" => project,
104
- :"tenant" => tenant,
105
- :"company" => company
106
- )
107
- end
108
-
109
- # Returns a fully-qualified company_without_tenant resource name string.
110
- # @param project [String]
111
- # @param company [String]
112
- # @return [String]
113
- def self.company_without_tenant_path project, company
114
- COMPANY_WITHOUT_TENANT_PATH_TEMPLATE.render(
115
- :"project" => project,
116
- :"company" => company
117
- )
118
- end
119
-
120
- # Returns a fully-qualified project resource name string.
121
- # @param project [String]
122
- # @return [String]
123
- def self.project_path project
124
- PROJECT_PATH_TEMPLATE.render(
125
- :"project" => project
126
- )
127
- end
128
-
129
- # Returns a fully-qualified tenant resource name string.
130
- # @param project [String]
131
- # @param tenant [String]
132
- # @return [String]
133
- def self.tenant_path project, tenant
134
- TENANT_PATH_TEMPLATE.render(
135
- :"project" => project,
136
- :"tenant" => tenant
137
- )
138
- end
139
-
140
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
141
- # Provides the means for authenticating requests made by the client. This parameter can
142
- # be many types.
143
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
144
- # authenticating requests made by this client.
145
- # A `String` will be treated as the path to the keyfile to be used for the construction of
146
- # credentials for this client.
147
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
148
- # credentials for this client.
149
- # A `GRPC::Core::Channel` will be used to make calls through.
150
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
151
- # should already be composed with a `GRPC::Core::CallCredentials` object.
152
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
153
- # metadata for requests, generally, to give OAuth credentials.
154
- # @param scopes [Array<String>]
155
- # The OAuth scopes for this service. This parameter is ignored if
156
- # an updater_proc is supplied.
157
- # @param client_config [Hash]
158
- # A Hash for call options for each method. See
159
- # Google::Gax#construct_settings for the structure of
160
- # this data. Falls back to the default config if not specified
161
- # or the specified config is missing data points.
162
- # @param timeout [Numeric]
163
- # The default timeout, in seconds, for calls made through this client.
164
- # @param metadata [Hash]
165
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
166
- # @param service_address [String]
167
- # Override for the service hostname, or `nil` to leave as the default.
168
- # @param service_port [Integer]
169
- # Override for the service port, or `nil` to leave as the default.
170
- # @param exception_transformer [Proc]
171
- # An optional proc that intercepts any exceptions raised during an API call to inject
172
- # custom error handling.
173
- def initialize \
174
- credentials: nil,
175
- scopes: ALL_SCOPES,
176
- client_config: {},
177
- timeout: DEFAULT_TIMEOUT,
178
- metadata: nil,
179
- service_address: nil,
180
- service_port: nil,
181
- exception_transformer: nil,
182
- lib_name: nil,
183
- lib_version: ""
184
- # These require statements are intentionally placed here to initialize
185
- # the gRPC module only when it's required.
186
- # See https://github.com/googleapis/toolkit/issues/446
187
- require "google/gax/grpc"
188
- require "google/cloud/talent/v4beta1/company_service_services_pb"
189
-
190
- credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
191
-
192
- if credentials.is_a?(String) || credentials.is_a?(Hash)
193
- updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
194
- end
195
- if credentials.is_a?(GRPC::Core::Channel)
196
- channel = credentials
197
- end
198
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
199
- chan_creds = credentials
200
- end
201
- if credentials.is_a?(Proc)
202
- updater_proc = credentials
203
- end
204
- if credentials.is_a?(Google::Auth::Credentials)
205
- updater_proc = credentials.updater_proc
206
- end
207
-
208
- package_version = Google::Cloud::Talent::VERSION
209
-
210
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
211
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
212
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
213
- google_api_client << " grpc/#{GRPC::VERSION}"
214
- google_api_client.freeze
215
-
216
- headers = { :"x-goog-api-client" => google_api_client }
217
- headers.merge!(metadata) unless metadata.nil?
218
- client_config_file = Pathname.new(__dir__).join(
219
- "company_service_client_config.json"
220
- )
221
- defaults = client_config_file.open do |f|
222
- Google::Gax.construct_settings(
223
- "google.cloud.talent.v4beta1.CompanyService",
224
- JSON.parse(f.read),
225
- client_config,
226
- Google::Gax::Grpc::STATUS_CODE_NAMES,
227
- timeout,
228
- page_descriptors: PAGE_DESCRIPTORS,
229
- errors: Google::Gax::Grpc::API_ERRORS,
230
- metadata: headers
231
- )
232
- end
233
-
234
- # Allow overriding the service path/port in subclasses.
235
- service_path = service_address || self.class::SERVICE_ADDRESS
236
- port = service_port || self.class::DEFAULT_SERVICE_PORT
237
- interceptors = self.class::GRPC_INTERCEPTORS
238
- @company_service_stub = Google::Gax::Grpc.create_stub(
239
- service_path,
240
- port,
241
- chan_creds: chan_creds,
242
- channel: channel,
243
- updater_proc: updater_proc,
244
- scopes: scopes,
245
- interceptors: interceptors,
246
- &Google::Cloud::Talent::V4beta1::CompanyService::Stub.method(:new)
247
- )
248
-
249
- @create_company = Google::Gax.create_api_call(
250
- @company_service_stub.method(:create_company),
251
- defaults["create_company"],
252
- exception_transformer: exception_transformer,
253
- params_extractor: proc do |request|
254
- {'parent' => request.parent}
255
- end
256
- )
257
- @get_company = Google::Gax.create_api_call(
258
- @company_service_stub.method(:get_company),
259
- defaults["get_company"],
260
- exception_transformer: exception_transformer,
261
- params_extractor: proc do |request|
262
- {'name' => request.name}
263
- end
264
- )
265
- @update_company = Google::Gax.create_api_call(
266
- @company_service_stub.method(:update_company),
267
- defaults["update_company"],
268
- exception_transformer: exception_transformer,
269
- params_extractor: proc do |request|
270
- {'company.name' => request.company.name}
271
- end
272
- )
273
- @delete_company = Google::Gax.create_api_call(
274
- @company_service_stub.method(:delete_company),
275
- defaults["delete_company"],
276
- exception_transformer: exception_transformer,
277
- params_extractor: proc do |request|
278
- {'name' => request.name}
279
- end
280
- )
281
- @list_companies = Google::Gax.create_api_call(
282
- @company_service_stub.method(:list_companies),
283
- defaults["list_companies"],
284
- exception_transformer: exception_transformer,
285
- params_extractor: proc do |request|
286
- {'parent' => request.parent}
287
- end
288
- )
289
- end
290
-
291
- # Service calls
292
-
293
- # Creates a new company entity.
294
- #
295
- # @param parent [String]
296
- # Required. Resource name of the tenant under which the company is created.
297
- #
298
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
299
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
300
- # is created, for example, "projects/foo".
301
- # @param company [Google::Cloud::Talent::V4beta1::Company | Hash]
302
- # Required. The company to be created.
303
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Company`
304
- # can also be provided.
305
- # @param options [Google::Gax::CallOptions]
306
- # Overrides the default settings for this call, e.g, timeout,
307
- # retries, etc.
308
- # @yield [result, operation] Access the result along with the RPC operation
309
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Company]
310
- # @yieldparam operation [GRPC::ActiveCall::Operation]
311
- # @return [Google::Cloud::Talent::V4beta1::Company]
312
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
313
- # @example
314
- # require "google/cloud/talent"
315
- #
316
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
317
- # formatted_parent = Google::Cloud::Talent::V4beta1::CompanyServiceClient.tenant_path("[PROJECT]", "[TENANT]")
318
- #
319
- # # TODO: Initialize `company`:
320
- # company = {}
321
- # response = company_client.create_company(formatted_parent, company)
322
-
323
- def create_company \
324
- parent,
325
- company,
326
- options: nil,
327
- &block
328
- req = {
329
- parent: parent,
330
- company: company
331
- }.delete_if { |_, v| v.nil? }
332
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateCompanyRequest)
333
- @create_company.call(req, options, &block)
334
- end
335
-
336
- # Retrieves specified company.
337
- #
338
- # @param name [String]
339
- # Required. The resource name of the company to be retrieved.
340
- #
341
- # The format is
342
- # "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
343
- # example, "projects/api-test-project/tenants/foo/companies/bar".
344
- #
345
- # If tenant id is unspecified, the default tenant is used, for
346
- # example, "projects/api-test-project/companies/bar".
347
- # @param options [Google::Gax::CallOptions]
348
- # Overrides the default settings for this call, e.g, timeout,
349
- # retries, etc.
350
- # @yield [result, operation] Access the result along with the RPC operation
351
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Company]
352
- # @yieldparam operation [GRPC::ActiveCall::Operation]
353
- # @return [Google::Cloud::Talent::V4beta1::Company]
354
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
355
- # @example
356
- # require "google/cloud/talent"
357
- #
358
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
359
- # formatted_name = Google::Cloud::Talent::V4beta1::CompanyServiceClient.company_path("[PROJECT]", "[TENANT]", "[COMPANY]")
360
- # response = company_client.get_company(formatted_name)
361
-
362
- def get_company \
363
- name,
364
- options: nil,
365
- &block
366
- req = {
367
- name: name
368
- }.delete_if { |_, v| v.nil? }
369
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetCompanyRequest)
370
- @get_company.call(req, options, &block)
371
- end
372
-
373
- # Updates specified company.
374
- #
375
- # @param company [Google::Cloud::Talent::V4beta1::Company | Hash]
376
- # Required. The company resource to replace the current resource in the system.
377
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Company`
378
- # can also be provided.
379
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
380
- # Strongly recommended for the best service experience.
381
- #
382
- # If {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} is provided, only the specified fields in
383
- # {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are updated. Otherwise all the fields are updated.
384
- #
385
- # A field mask to specify the company fields to be updated. Only
386
- # top level fields of {Google::Cloud::Talent::V4beta1::Company Company} are supported.
387
- # A hash of the same form as `Google::Protobuf::FieldMask`
388
- # can also be provided.
389
- # @param options [Google::Gax::CallOptions]
390
- # Overrides the default settings for this call, e.g, timeout,
391
- # retries, etc.
392
- # @yield [result, operation] Access the result along with the RPC operation
393
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Company]
394
- # @yieldparam operation [GRPC::ActiveCall::Operation]
395
- # @return [Google::Cloud::Talent::V4beta1::Company]
396
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
397
- # @example
398
- # require "google/cloud/talent"
399
- #
400
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
401
- #
402
- # # TODO: Initialize `company`:
403
- # company = {}
404
- # response = company_client.update_company(company)
405
-
406
- def update_company \
407
- company,
408
- update_mask: nil,
409
- options: nil,
410
- &block
411
- req = {
412
- company: company,
413
- update_mask: update_mask
414
- }.delete_if { |_, v| v.nil? }
415
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateCompanyRequest)
416
- @update_company.call(req, options, &block)
417
- end
418
-
419
- # Deletes specified company.
420
- # Prerequisite: The company has no jobs associated with it.
421
- #
422
- # @param name [String]
423
- # Required. The resource name of the company to be deleted.
424
- #
425
- # The format is
426
- # "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
427
- # example, "projects/foo/tenants/bar/companies/baz".
428
- #
429
- # If tenant id is unspecified, the default tenant is used, for
430
- # example, "projects/foo/companies/bar".
431
- # @param options [Google::Gax::CallOptions]
432
- # Overrides the default settings for this call, e.g, timeout,
433
- # retries, etc.
434
- # @yield [result, operation] Access the result along with the RPC operation
435
- # @yieldparam result []
436
- # @yieldparam operation [GRPC::ActiveCall::Operation]
437
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
438
- # @example
439
- # require "google/cloud/talent"
440
- #
441
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
442
- # formatted_name = Google::Cloud::Talent::V4beta1::CompanyServiceClient.company_path("[PROJECT]", "[TENANT]", "[COMPANY]")
443
- # company_client.delete_company(formatted_name)
444
-
445
- def delete_company \
446
- name,
447
- options: nil,
448
- &block
449
- req = {
450
- name: name
451
- }.delete_if { |_, v| v.nil? }
452
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteCompanyRequest)
453
- @delete_company.call(req, options, &block)
454
- nil
455
- end
456
-
457
- # Lists all companies associated with the project.
458
- #
459
- # @param parent [String]
460
- # Required. Resource name of the tenant under which the company is created.
461
- #
462
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
463
- # "projects/foo/tenant/bar".
464
- #
465
- # If tenant id is unspecified, the default tenant will be used, for
466
- # example, "projects/foo".
467
- # @param page_size [Integer]
468
- # The maximum number of resources contained in the underlying API
469
- # response. If page streaming is performed per-resource, this
470
- # parameter does not affect the return value. If page streaming is
471
- # performed per-page, this determines the maximum number of
472
- # resources in a page.
473
- # @param require_open_jobs [true, false]
474
- # Set to true if the companies requested must have open jobs.
475
- #
476
- # Defaults to false.
477
- #
478
- # If true, at most {Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of companies are fetched, among which
479
- # only those with open jobs are returned.
480
- # @param options [Google::Gax::CallOptions]
481
- # Overrides the default settings for this call, e.g, timeout,
482
- # retries, etc.
483
- # @yield [result, operation] Access the result along with the RPC operation
484
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Company>]
485
- # @yieldparam operation [GRPC::ActiveCall::Operation]
486
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Company>]
487
- # An enumerable of Google::Cloud::Talent::V4beta1::Company instances.
488
- # See Google::Gax::PagedEnumerable documentation for other
489
- # operations such as per-page iteration or access to the response
490
- # object.
491
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
492
- # @example
493
- # require "google/cloud/talent"
494
- #
495
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
496
- # formatted_parent = Google::Cloud::Talent::V4beta1::CompanyServiceClient.tenant_path("[PROJECT]", "[TENANT]")
497
- #
498
- # # Iterate over all results.
499
- # company_client.list_companies(formatted_parent).each do |element|
500
- # # Process element.
501
- # end
502
- #
503
- # # Or iterate over results one page at a time.
504
- # company_client.list_companies(formatted_parent).each_page do |page|
505
- # # Process each page at a time.
506
- # page.each do |element|
507
- # # Process element.
508
- # end
509
- # end
510
-
511
- def list_companies \
512
- parent,
513
- page_size: nil,
514
- require_open_jobs: nil,
515
- options: nil,
516
- &block
517
- req = {
518
- parent: parent,
519
- page_size: page_size,
520
- require_open_jobs: require_open_jobs
521
- }.delete_if { |_, v| v.nil? }
522
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListCompaniesRequest)
523
- @list_companies.call(req, options, &block)
524
- end
525
- end
526
- end
527
- end
528
- end
529
- end