google-cloud-talent 0.10.0 → 0.20.0

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 +35 -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 +253 -441
  9. data/lib/google/cloud/talent/version.rb +6 -2
  10. metadata +62 -111
  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 -527
  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 -55
  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 -536
  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 -55
  25. data/lib/google/cloud/talent/v4beta1/completion_client.rb +0 -344
  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 -47
  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 -162
  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 -130
  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 -694
  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 -361
  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 -271
  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 -52
  63. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +0 -187
  64. data/lib/google/cloud/talent/v4beta1/helpers.rb +0 -179
  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 -1521
  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 -87
  71. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -213
  72. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -765
  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 -64
  76. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -34
  77. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -474
  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 -54
@@ -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,536 +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
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
98
- # This helper function will be deleted in the next major version.
99
- # @param project [String]
100
- # @param tenant [String]
101
- # @param company [String]
102
- # @return [String]
103
- def self.company_path project, tenant, company
104
- COMPANY_PATH_TEMPLATE.render(
105
- :"project" => project,
106
- :"tenant" => tenant,
107
- :"company" => company
108
- )
109
- end
110
-
111
- # Returns a fully-qualified company_without_tenant resource name string.
112
- # @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
113
- # This helper function will be deleted in the next major version.
114
- # @param project [String]
115
- # @param company [String]
116
- # @return [String]
117
- def self.company_without_tenant_path project, company
118
- COMPANY_WITHOUT_TENANT_PATH_TEMPLATE.render(
119
- :"project" => project,
120
- :"company" => company
121
- )
122
- end
123
-
124
- # Returns a fully-qualified project resource name string.
125
- # @param project [String]
126
- # @return [String]
127
- def self.project_path project
128
- PROJECT_PATH_TEMPLATE.render(
129
- :"project" => project
130
- )
131
- end
132
-
133
- # Returns a fully-qualified tenant resource name string.
134
- # @param project [String]
135
- # @param tenant [String]
136
- # @return [String]
137
- def self.tenant_path project, tenant
138
- TENANT_PATH_TEMPLATE.render(
139
- :"project" => project,
140
- :"tenant" => tenant
141
- )
142
- end
143
-
144
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
145
- # Provides the means for authenticating requests made by the client. This parameter can
146
- # be many types.
147
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
148
- # authenticating requests made by this client.
149
- # A `String` will be treated as the path to the keyfile to be used for the construction of
150
- # credentials for this client.
151
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
152
- # credentials for this client.
153
- # A `GRPC::Core::Channel` will be used to make calls through.
154
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
155
- # should already be composed with a `GRPC::Core::CallCredentials` object.
156
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
157
- # metadata for requests, generally, to give OAuth credentials.
158
- # @param scopes [Array<String>]
159
- # The OAuth scopes for this service. This parameter is ignored if
160
- # an updater_proc is supplied.
161
- # @param client_config [Hash]
162
- # A Hash for call options for each method. See
163
- # Google::Gax#construct_settings for the structure of
164
- # this data. Falls back to the default config if not specified
165
- # or the specified config is missing data points.
166
- # @param timeout [Numeric]
167
- # The default timeout, in seconds, for calls made through this client.
168
- # @param metadata [Hash]
169
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
170
- # @param service_address [String]
171
- # Override for the service hostname, or `nil` to leave as the default.
172
- # @param service_port [Integer]
173
- # Override for the service port, or `nil` to leave as the default.
174
- # @param exception_transformer [Proc]
175
- # An optional proc that intercepts any exceptions raised during an API call to inject
176
- # custom error handling.
177
- def initialize \
178
- credentials: nil,
179
- scopes: ALL_SCOPES,
180
- client_config: {},
181
- timeout: DEFAULT_TIMEOUT,
182
- metadata: nil,
183
- service_address: nil,
184
- service_port: nil,
185
- exception_transformer: nil,
186
- lib_name: nil,
187
- lib_version: ""
188
- # These require statements are intentionally placed here to initialize
189
- # the gRPC module only when it's required.
190
- # See https://github.com/googleapis/toolkit/issues/446
191
- require "google/gax/grpc"
192
- require "google/cloud/talent/v4beta1/company_service_services_pb"
193
-
194
- credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
195
-
196
- if credentials.is_a?(String) || credentials.is_a?(Hash)
197
- updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
198
- end
199
- if credentials.is_a?(GRPC::Core::Channel)
200
- channel = credentials
201
- end
202
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
203
- chan_creds = credentials
204
- end
205
- if credentials.is_a?(Proc)
206
- updater_proc = credentials
207
- end
208
- if credentials.is_a?(Google::Auth::Credentials)
209
- updater_proc = credentials.updater_proc
210
- end
211
-
212
- package_version = Google::Cloud::Talent::VERSION
213
-
214
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
215
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
216
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
217
- google_api_client << " grpc/#{GRPC::VERSION}"
218
- google_api_client.freeze
219
-
220
- headers = { :"x-goog-api-client" => google_api_client }
221
- if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
222
- headers[:"x-goog-user-project"] = credentials.quota_project_id
223
- end
224
- headers.merge!(metadata) unless metadata.nil?
225
- client_config_file = Pathname.new(__dir__).join(
226
- "company_service_client_config.json"
227
- )
228
- defaults = client_config_file.open do |f|
229
- Google::Gax.construct_settings(
230
- "google.cloud.talent.v4beta1.CompanyService",
231
- JSON.parse(f.read),
232
- client_config,
233
- Google::Gax::Grpc::STATUS_CODE_NAMES,
234
- timeout,
235
- page_descriptors: PAGE_DESCRIPTORS,
236
- errors: Google::Gax::Grpc::API_ERRORS,
237
- metadata: headers
238
- )
239
- end
240
-
241
- # Allow overriding the service path/port in subclasses.
242
- service_path = service_address || self.class::SERVICE_ADDRESS
243
- port = service_port || self.class::DEFAULT_SERVICE_PORT
244
- interceptors = self.class::GRPC_INTERCEPTORS
245
- @company_service_stub = Google::Gax::Grpc.create_stub(
246
- service_path,
247
- port,
248
- chan_creds: chan_creds,
249
- channel: channel,
250
- updater_proc: updater_proc,
251
- scopes: scopes,
252
- interceptors: interceptors,
253
- &Google::Cloud::Talent::V4beta1::CompanyService::Stub.method(:new)
254
- )
255
-
256
- @delete_company = Google::Gax.create_api_call(
257
- @company_service_stub.method(:delete_company),
258
- defaults["delete_company"],
259
- exception_transformer: exception_transformer,
260
- params_extractor: proc do |request|
261
- {'name' => request.name}
262
- end
263
- )
264
- @create_company = Google::Gax.create_api_call(
265
- @company_service_stub.method(:create_company),
266
- defaults["create_company"],
267
- exception_transformer: exception_transformer,
268
- params_extractor: proc do |request|
269
- {'parent' => request.parent}
270
- end
271
- )
272
- @get_company = Google::Gax.create_api_call(
273
- @company_service_stub.method(:get_company),
274
- defaults["get_company"],
275
- exception_transformer: exception_transformer,
276
- params_extractor: proc do |request|
277
- {'name' => request.name}
278
- end
279
- )
280
- @update_company = Google::Gax.create_api_call(
281
- @company_service_stub.method(:update_company),
282
- defaults["update_company"],
283
- exception_transformer: exception_transformer,
284
- params_extractor: proc do |request|
285
- {'company.name' => request.company.name}
286
- end
287
- )
288
- @list_companies = Google::Gax.create_api_call(
289
- @company_service_stub.method(:list_companies),
290
- defaults["list_companies"],
291
- exception_transformer: exception_transformer,
292
- params_extractor: proc do |request|
293
- {'parent' => request.parent}
294
- end
295
- )
296
- end
297
-
298
- # Service calls
299
-
300
- # Deletes specified company.
301
- # Prerequisite: The company has no jobs associated with it.
302
- #
303
- # @param name [String]
304
- # Required. The resource name of the company to be deleted.
305
- #
306
- # The format is
307
- # "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
308
- # example, "projects/foo/tenants/bar/companies/baz".
309
- #
310
- # If tenant id is unspecified, the default tenant is used, for
311
- # example, "projects/foo/companies/bar".
312
- # @param options [Google::Gax::CallOptions]
313
- # Overrides the default settings for this call, e.g, timeout,
314
- # retries, etc.
315
- # @yield [result, operation] Access the result along with the RPC operation
316
- # @yieldparam result []
317
- # @yieldparam operation [GRPC::ActiveCall::Operation]
318
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
319
- # @example
320
- # require "google/cloud/talent"
321
- #
322
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
323
- # formatted_name = Google::Cloud::Talent::V4beta1::CompanyServiceClient.company_without_tenant_path("[PROJECT]", "[COMPANY]")
324
- # company_client.delete_company(formatted_name)
325
-
326
- def delete_company \
327
- name,
328
- options: nil,
329
- &block
330
- req = {
331
- name: name
332
- }.delete_if { |_, v| v.nil? }
333
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteCompanyRequest)
334
- @delete_company.call(req, options, &block)
335
- nil
336
- end
337
-
338
- # Creates a new company entity.
339
- #
340
- # @param parent [String]
341
- # Required. Resource name of the tenant under which the company is created.
342
- #
343
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
344
- # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
345
- # is created, for example, "projects/foo".
346
- # @param company [Google::Cloud::Talent::V4beta1::Company | Hash]
347
- # Required. The company to be created.
348
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Company`
349
- # can also be provided.
350
- # @param options [Google::Gax::CallOptions]
351
- # Overrides the default settings for this call, e.g, timeout,
352
- # retries, etc.
353
- # @yield [result, operation] Access the result along with the RPC operation
354
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Company]
355
- # @yieldparam operation [GRPC::ActiveCall::Operation]
356
- # @return [Google::Cloud::Talent::V4beta1::Company]
357
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
358
- # @example
359
- # require "google/cloud/talent"
360
- #
361
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
362
- # formatted_parent = Google::Cloud::Talent::V4beta1::CompanyServiceClient.project_path("[PROJECT]")
363
- #
364
- # # TODO: Initialize `company`:
365
- # company = {}
366
- # response = company_client.create_company(formatted_parent, company)
367
-
368
- def create_company \
369
- parent,
370
- company,
371
- options: nil,
372
- &block
373
- req = {
374
- parent: parent,
375
- company: company
376
- }.delete_if { |_, v| v.nil? }
377
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateCompanyRequest)
378
- @create_company.call(req, options, &block)
379
- end
380
-
381
- # Retrieves specified company.
382
- #
383
- # @param name [String]
384
- # Required. The resource name of the company to be retrieved.
385
- #
386
- # The format is
387
- # "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
388
- # example, "projects/api-test-project/tenants/foo/companies/bar".
389
- #
390
- # If tenant id is unspecified, the default tenant is used, for
391
- # example, "projects/api-test-project/companies/bar".
392
- # @param options [Google::Gax::CallOptions]
393
- # Overrides the default settings for this call, e.g, timeout,
394
- # retries, etc.
395
- # @yield [result, operation] Access the result along with the RPC operation
396
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Company]
397
- # @yieldparam operation [GRPC::ActiveCall::Operation]
398
- # @return [Google::Cloud::Talent::V4beta1::Company]
399
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
400
- # @example
401
- # require "google/cloud/talent"
402
- #
403
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
404
- # formatted_name = Google::Cloud::Talent::V4beta1::CompanyServiceClient.company_without_tenant_path("[PROJECT]", "[COMPANY]")
405
- # response = company_client.get_company(formatted_name)
406
-
407
- def get_company \
408
- name,
409
- options: nil,
410
- &block
411
- req = {
412
- name: name
413
- }.delete_if { |_, v| v.nil? }
414
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetCompanyRequest)
415
- @get_company.call(req, options, &block)
416
- end
417
-
418
- # Updates specified company.
419
- #
420
- # @param company [Google::Cloud::Talent::V4beta1::Company | Hash]
421
- # Required. The company resource to replace the current resource in the system.
422
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Company`
423
- # can also be provided.
424
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
425
- # Strongly recommended for the best service experience.
426
- #
427
- # If {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} is provided, only the specified fields in
428
- # {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are updated. Otherwise all the fields are updated.
429
- #
430
- # A field mask to specify the company fields to be updated. Only
431
- # top level fields of {Google::Cloud::Talent::V4beta1::Company Company} are supported.
432
- # A hash of the same form as `Google::Protobuf::FieldMask`
433
- # can also be provided.
434
- # @param options [Google::Gax::CallOptions]
435
- # Overrides the default settings for this call, e.g, timeout,
436
- # retries, etc.
437
- # @yield [result, operation] Access the result along with the RPC operation
438
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Company]
439
- # @yieldparam operation [GRPC::ActiveCall::Operation]
440
- # @return [Google::Cloud::Talent::V4beta1::Company]
441
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
442
- # @example
443
- # require "google/cloud/talent"
444
- #
445
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
446
- #
447
- # # TODO: Initialize `company`:
448
- # company = {}
449
- # response = company_client.update_company(company)
450
-
451
- def update_company \
452
- company,
453
- update_mask: nil,
454
- options: nil,
455
- &block
456
- req = {
457
- company: company,
458
- update_mask: update_mask
459
- }.delete_if { |_, v| v.nil? }
460
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateCompanyRequest)
461
- @update_company.call(req, options, &block)
462
- end
463
-
464
- # Lists all companies associated with the project.
465
- #
466
- # @param parent [String]
467
- # Required. Resource name of the tenant under which the company is created.
468
- #
469
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
470
- # "projects/foo/tenant/bar".
471
- #
472
- # If tenant id is unspecified, the default tenant will be used, for
473
- # example, "projects/foo".
474
- # @param page_size [Integer]
475
- # The maximum number of resources contained in the underlying API
476
- # response. If page streaming is performed per-resource, this
477
- # parameter does not affect the return value. If page streaming is
478
- # performed per-page, this determines the maximum number of
479
- # resources in a page.
480
- # @param require_open_jobs [true, false]
481
- # Set to true if the companies requested must have open jobs.
482
- #
483
- # Defaults to false.
484
- #
485
- # If true, at most {Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of companies are fetched, among which
486
- # only those with open jobs are returned.
487
- # @param options [Google::Gax::CallOptions]
488
- # Overrides the default settings for this call, e.g, timeout,
489
- # retries, etc.
490
- # @yield [result, operation] Access the result along with the RPC operation
491
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Company>]
492
- # @yieldparam operation [GRPC::ActiveCall::Operation]
493
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Company>]
494
- # An enumerable of Google::Cloud::Talent::V4beta1::Company instances.
495
- # See Google::Gax::PagedEnumerable documentation for other
496
- # operations such as per-page iteration or access to the response
497
- # object.
498
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
499
- # @example
500
- # require "google/cloud/talent"
501
- #
502
- # company_client = Google::Cloud::Talent::CompanyService.new(version: :v4beta1)
503
- # formatted_parent = Google::Cloud::Talent::V4beta1::CompanyServiceClient.project_path("[PROJECT]")
504
- #
505
- # # Iterate over all results.
506
- # company_client.list_companies(formatted_parent).each do |element|
507
- # # Process element.
508
- # end
509
- #
510
- # # Or iterate over results one page at a time.
511
- # company_client.list_companies(formatted_parent).each_page do |page|
512
- # # Process each page at a time.
513
- # page.each do |element|
514
- # # Process element.
515
- # end
516
- # end
517
-
518
- def list_companies \
519
- parent,
520
- page_size: nil,
521
- require_open_jobs: nil,
522
- options: nil,
523
- &block
524
- req = {
525
- parent: parent,
526
- page_size: page_size,
527
- require_open_jobs: require_open_jobs
528
- }.delete_if { |_, v| v.nil? }
529
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListCompaniesRequest)
530
- @list_companies.call(req, options, &block)
531
- end
532
- end
533
- end
534
- end
535
- end
536
- end