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,811 +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/profile_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/profile_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 profile management, including profile CRUD,
37
- # enumeration and search.
38
- #
39
- # @!attribute [r] profile_service_stub
40
- # @return [Google::Cloud::Talent::V4beta1::ProfileService::Stub]
41
- class ProfileServiceClient
42
- # @private
43
- attr_reader :profile_service_stub
44
-
45
- # The default address of the service.
46
- SERVICE_ADDRESS = "jobs.googleapis.com".freeze
47
-
48
- # The default port of the service.
49
- DEFAULT_SERVICE_PORT = 443
50
-
51
- # The default set of gRPC interceptors.
52
- GRPC_INTERCEPTORS = []
53
-
54
- DEFAULT_TIMEOUT = 30
55
-
56
- PAGE_DESCRIPTORS = {
57
- "list_profiles" => Google::Gax::PageDescriptor.new(
58
- "page_token",
59
- "next_page_token",
60
- "profiles"),
61
- "search_profiles" => Google::Gax::PageDescriptor.new(
62
- "page_token",
63
- "next_page_token",
64
- "summarized_profiles")
65
- }.freeze
66
-
67
- private_constant :PAGE_DESCRIPTORS
68
-
69
- # The scopes needed to make gRPC calls to all of the methods defined in
70
- # this service.
71
- ALL_SCOPES = [
72
- "https://www.googleapis.com/auth/cloud-platform",
73
- "https://www.googleapis.com/auth/jobs"
74
- ].freeze
75
-
76
-
77
- PROFILE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
78
- "projects/{project}/tenants/{tenant}/profiles/{profile}"
79
- )
80
-
81
- private_constant :PROFILE_PATH_TEMPLATE
82
-
83
- TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
84
- "projects/{project}/tenants/{tenant}"
85
- )
86
-
87
- private_constant :TENANT_PATH_TEMPLATE
88
-
89
- # Returns a fully-qualified profile resource name string.
90
- # @param project [String]
91
- # @param tenant [String]
92
- # @param profile [String]
93
- # @return [String]
94
- def self.profile_path project, tenant, profile
95
- PROFILE_PATH_TEMPLATE.render(
96
- :"project" => project,
97
- :"tenant" => tenant,
98
- :"profile" => profile
99
- )
100
- end
101
-
102
- # Returns a fully-qualified tenant resource name string.
103
- # @param project [String]
104
- # @param tenant [String]
105
- # @return [String]
106
- def self.tenant_path project, tenant
107
- TENANT_PATH_TEMPLATE.render(
108
- :"project" => project,
109
- :"tenant" => tenant
110
- )
111
- end
112
-
113
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
114
- # Provides the means for authenticating requests made by the client. This parameter can
115
- # be many types.
116
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
117
- # authenticating requests made by this client.
118
- # A `String` will be treated as the path to the keyfile to be used for the construction of
119
- # credentials for this client.
120
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
121
- # credentials for this client.
122
- # A `GRPC::Core::Channel` will be used to make calls through.
123
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
124
- # should already be composed with a `GRPC::Core::CallCredentials` object.
125
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
126
- # metadata for requests, generally, to give OAuth credentials.
127
- # @param scopes [Array<String>]
128
- # The OAuth scopes for this service. This parameter is ignored if
129
- # an updater_proc is supplied.
130
- # @param client_config [Hash]
131
- # A Hash for call options for each method. See
132
- # Google::Gax#construct_settings for the structure of
133
- # this data. Falls back to the default config if not specified
134
- # or the specified config is missing data points.
135
- # @param timeout [Numeric]
136
- # The default timeout, in seconds, for calls made through this client.
137
- # @param metadata [Hash]
138
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
139
- # @param service_address [String]
140
- # Override for the service hostname, or `nil` to leave as the default.
141
- # @param service_port [Integer]
142
- # Override for the service port, or `nil` to leave as the default.
143
- # @param exception_transformer [Proc]
144
- # An optional proc that intercepts any exceptions raised during an API call to inject
145
- # custom error handling.
146
- def initialize \
147
- credentials: nil,
148
- scopes: ALL_SCOPES,
149
- client_config: {},
150
- timeout: DEFAULT_TIMEOUT,
151
- metadata: nil,
152
- service_address: nil,
153
- service_port: nil,
154
- exception_transformer: nil,
155
- lib_name: nil,
156
- lib_version: ""
157
- # These require statements are intentionally placed here to initialize
158
- # the gRPC module only when it's required.
159
- # See https://github.com/googleapis/toolkit/issues/446
160
- require "google/gax/grpc"
161
- require "google/cloud/talent/v4beta1/profile_service_services_pb"
162
-
163
- credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
164
-
165
- if credentials.is_a?(String) || credentials.is_a?(Hash)
166
- updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
167
- end
168
- if credentials.is_a?(GRPC::Core::Channel)
169
- channel = credentials
170
- end
171
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
172
- chan_creds = credentials
173
- end
174
- if credentials.is_a?(Proc)
175
- updater_proc = credentials
176
- end
177
- if credentials.is_a?(Google::Auth::Credentials)
178
- updater_proc = credentials.updater_proc
179
- end
180
-
181
- package_version = Google::Cloud::Talent::VERSION
182
-
183
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
184
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
185
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
186
- google_api_client << " grpc/#{GRPC::VERSION}"
187
- google_api_client.freeze
188
-
189
- headers = { :"x-goog-api-client" => google_api_client }
190
- headers.merge!(metadata) unless metadata.nil?
191
- client_config_file = Pathname.new(__dir__).join(
192
- "profile_service_client_config.json"
193
- )
194
- defaults = client_config_file.open do |f|
195
- Google::Gax.construct_settings(
196
- "google.cloud.talent.v4beta1.ProfileService",
197
- JSON.parse(f.read),
198
- client_config,
199
- Google::Gax::Grpc::STATUS_CODE_NAMES,
200
- timeout,
201
- page_descriptors: PAGE_DESCRIPTORS,
202
- errors: Google::Gax::Grpc::API_ERRORS,
203
- metadata: headers
204
- )
205
- end
206
-
207
- # Allow overriding the service path/port in subclasses.
208
- service_path = service_address || self.class::SERVICE_ADDRESS
209
- port = service_port || self.class::DEFAULT_SERVICE_PORT
210
- interceptors = self.class::GRPC_INTERCEPTORS
211
- @profile_service_stub = Google::Gax::Grpc.create_stub(
212
- service_path,
213
- port,
214
- chan_creds: chan_creds,
215
- channel: channel,
216
- updater_proc: updater_proc,
217
- scopes: scopes,
218
- interceptors: interceptors,
219
- &Google::Cloud::Talent::V4beta1::ProfileService::Stub.method(:new)
220
- )
221
-
222
- @list_profiles = Google::Gax.create_api_call(
223
- @profile_service_stub.method(:list_profiles),
224
- defaults["list_profiles"],
225
- exception_transformer: exception_transformer,
226
- params_extractor: proc do |request|
227
- {'parent' => request.parent}
228
- end
229
- )
230
- @create_profile = Google::Gax.create_api_call(
231
- @profile_service_stub.method(:create_profile),
232
- defaults["create_profile"],
233
- exception_transformer: exception_transformer,
234
- params_extractor: proc do |request|
235
- {'parent' => request.parent}
236
- end
237
- )
238
- @get_profile = Google::Gax.create_api_call(
239
- @profile_service_stub.method(:get_profile),
240
- defaults["get_profile"],
241
- exception_transformer: exception_transformer,
242
- params_extractor: proc do |request|
243
- {'name' => request.name}
244
- end
245
- )
246
- @update_profile = Google::Gax.create_api_call(
247
- @profile_service_stub.method(:update_profile),
248
- defaults["update_profile"],
249
- exception_transformer: exception_transformer,
250
- params_extractor: proc do |request|
251
- {'profile.name' => request.profile.name}
252
- end
253
- )
254
- @delete_profile = Google::Gax.create_api_call(
255
- @profile_service_stub.method(:delete_profile),
256
- defaults["delete_profile"],
257
- exception_transformer: exception_transformer,
258
- params_extractor: proc do |request|
259
- {'name' => request.name}
260
- end
261
- )
262
- @search_profiles = Google::Gax.create_api_call(
263
- @profile_service_stub.method(:search_profiles),
264
- defaults["search_profiles"],
265
- exception_transformer: exception_transformer,
266
- params_extractor: proc do |request|
267
- {'parent' => request.parent}
268
- end
269
- )
270
- end
271
-
272
- # Service calls
273
-
274
- # Lists profiles by filter. The order is unspecified.
275
- #
276
- # @param parent [String]
277
- # Required. The resource name of the tenant under which the profile is created.
278
- #
279
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
280
- # "projects/foo/tenants/bar".
281
- # @param filter [String]
282
- # The filter string specifies the profiles to be enumerated.
283
- #
284
- # Supported operator: =, AND
285
- #
286
- # The field(s) eligible for filtering are:
287
- #
288
- # * `externalId`
289
- # * `groupId`
290
- #
291
- # externalId and groupId cannot be specified at the same time. If both
292
- # externalId and groupId are provided, the API will return a bad request
293
- # error.
294
- #
295
- # Sample Query:
296
- #
297
- # * externalId = "externalId-1"
298
- # * groupId = "groupId-1"
299
- # @param page_size [Integer]
300
- # The maximum number of resources contained in the underlying API
301
- # response. If page streaming is performed per-resource, this
302
- # parameter does not affect the return value. If page streaming is
303
- # performed per-page, this determines the maximum number of
304
- # resources in a page.
305
- # @param read_mask [Google::Protobuf::FieldMask | Hash]
306
- # A field mask to specify the profile fields to be listed in response.
307
- # All fields are listed if it is unset.
308
- #
309
- # Valid values are:
310
- #
311
- # * name
312
- # A hash of the same form as `Google::Protobuf::FieldMask`
313
- # can also be provided.
314
- # @param options [Google::Gax::CallOptions]
315
- # Overrides the default settings for this call, e.g, timeout,
316
- # retries, etc.
317
- # @yield [result, operation] Access the result along with the RPC operation
318
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Profile>]
319
- # @yieldparam operation [GRPC::ActiveCall::Operation]
320
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Profile>]
321
- # An enumerable of Google::Cloud::Talent::V4beta1::Profile instances.
322
- # See Google::Gax::PagedEnumerable documentation for other
323
- # operations such as per-page iteration or access to the response
324
- # object.
325
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
326
- # @example
327
- # require "google/cloud/talent"
328
- #
329
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
330
- # formatted_parent = Google::Cloud::Talent::V4beta1::ProfileServiceClient.tenant_path("[PROJECT]", "[TENANT]")
331
- #
332
- # # Iterate over all results.
333
- # profile_client.list_profiles(formatted_parent).each do |element|
334
- # # Process element.
335
- # end
336
- #
337
- # # Or iterate over results one page at a time.
338
- # profile_client.list_profiles(formatted_parent).each_page do |page|
339
- # # Process each page at a time.
340
- # page.each do |element|
341
- # # Process element.
342
- # end
343
- # end
344
-
345
- def list_profiles \
346
- parent,
347
- filter: nil,
348
- page_size: nil,
349
- read_mask: nil,
350
- options: nil,
351
- &block
352
- req = {
353
- parent: parent,
354
- filter: filter,
355
- page_size: page_size,
356
- read_mask: read_mask
357
- }.delete_if { |_, v| v.nil? }
358
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListProfilesRequest)
359
- @list_profiles.call(req, options, &block)
360
- end
361
-
362
- # Creates and returns a new profile.
363
- #
364
- # @param parent [String]
365
- # Required. The name of the tenant this profile belongs to.
366
- #
367
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
368
- # "projects/foo/tenants/bar".
369
- # @param profile [Google::Cloud::Talent::V4beta1::Profile | Hash]
370
- # Required. The profile to be created.
371
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Profile`
372
- # can also be provided.
373
- # @param options [Google::Gax::CallOptions]
374
- # Overrides the default settings for this call, e.g, timeout,
375
- # retries, etc.
376
- # @yield [result, operation] Access the result along with the RPC operation
377
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Profile]
378
- # @yieldparam operation [GRPC::ActiveCall::Operation]
379
- # @return [Google::Cloud::Talent::V4beta1::Profile]
380
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
381
- # @example
382
- # require "google/cloud/talent"
383
- #
384
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
385
- # formatted_parent = Google::Cloud::Talent::V4beta1::ProfileServiceClient.tenant_path("[PROJECT]", "[TENANT]")
386
- #
387
- # # TODO: Initialize `profile`:
388
- # profile = {}
389
- # response = profile_client.create_profile(formatted_parent, profile)
390
-
391
- def create_profile \
392
- parent,
393
- profile,
394
- options: nil,
395
- &block
396
- req = {
397
- parent: parent,
398
- profile: profile
399
- }.delete_if { |_, v| v.nil? }
400
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateProfileRequest)
401
- @create_profile.call(req, options, &block)
402
- end
403
-
404
- # Gets the specified profile.
405
- #
406
- # @param name [String]
407
- # Required. Resource name of the profile to get.
408
- #
409
- # The format is
410
- # "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For
411
- # example, "projects/foo/tenants/bar/profiles/baz".
412
- # @param options [Google::Gax::CallOptions]
413
- # Overrides the default settings for this call, e.g, timeout,
414
- # retries, etc.
415
- # @yield [result, operation] Access the result along with the RPC operation
416
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Profile]
417
- # @yieldparam operation [GRPC::ActiveCall::Operation]
418
- # @return [Google::Cloud::Talent::V4beta1::Profile]
419
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
420
- # @example
421
- # require "google/cloud/talent"
422
- #
423
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
424
- # formatted_name = Google::Cloud::Talent::V4beta1::ProfileServiceClient.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]")
425
- # response = profile_client.get_profile(formatted_name)
426
-
427
- def get_profile \
428
- name,
429
- options: nil,
430
- &block
431
- req = {
432
- name: name
433
- }.delete_if { |_, v| v.nil? }
434
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetProfileRequest)
435
- @get_profile.call(req, options, &block)
436
- end
437
-
438
- # Updates the specified profile and returns the updated result.
439
- #
440
- # @param profile [Google::Cloud::Talent::V4beta1::Profile | Hash]
441
- # Required. Profile to be updated.
442
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Profile`
443
- # can also be provided.
444
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
445
- # A field mask to specify the profile fields to update.
446
- #
447
- # A full update is performed if it is unset.
448
- #
449
- # Valid values are:
450
- #
451
- # * external_id
452
- # * source
453
- # * source_types
454
- # * uri
455
- # * is_hirable
456
- # * create_time
457
- # * update_time
458
- # * candidate_update_time
459
- # * resume_update_time
460
- # * resume
461
- # * person_names
462
- # * addresses
463
- # * email_addresses
464
- # * phone_numbers
465
- # * personal_uris
466
- # * additional_contact_info
467
- # * employment_records
468
- # * education_records
469
- # * skills
470
- # * activities
471
- # * publications
472
- # * patents
473
- # * certifications
474
- # * recruiting_notes
475
- # * custom_attributes
476
- # * group_id
477
- # * external_system
478
- # * source_note
479
- # * primary_responsibilities
480
- # * citizenships
481
- # * work_authorizations
482
- # * employee_types
483
- # * language_code
484
- # * qualification_summary
485
- # * allowed_contact_types
486
- # * preferred_contact_types
487
- # * contact_availability
488
- # * language_fluencies
489
- # * work_preference
490
- # * industry_experiences
491
- # * work_environment_experiences
492
- # * work_availability
493
- # * security_clearances
494
- # * references
495
- # * assessments
496
- # * interviews
497
- # A hash of the same form as `Google::Protobuf::FieldMask`
498
- # can also be provided.
499
- # @param options [Google::Gax::CallOptions]
500
- # Overrides the default settings for this call, e.g, timeout,
501
- # retries, etc.
502
- # @yield [result, operation] Access the result along with the RPC operation
503
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Profile]
504
- # @yieldparam operation [GRPC::ActiveCall::Operation]
505
- # @return [Google::Cloud::Talent::V4beta1::Profile]
506
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
507
- # @example
508
- # require "google/cloud/talent"
509
- #
510
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
511
- #
512
- # # TODO: Initialize `profile`:
513
- # profile = {}
514
- # response = profile_client.update_profile(profile)
515
-
516
- def update_profile \
517
- profile,
518
- update_mask: nil,
519
- options: nil,
520
- &block
521
- req = {
522
- profile: profile,
523
- update_mask: update_mask
524
- }.delete_if { |_, v| v.nil? }
525
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateProfileRequest)
526
- @update_profile.call(req, options, &block)
527
- end
528
-
529
- # Deletes the specified profile.
530
- # Prerequisite: The profile has no associated applications or assignments
531
- # associated.
532
- #
533
- # @param name [String]
534
- # Required. Resource name of the profile to be deleted.
535
- #
536
- # The format is
537
- # "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For
538
- # example, "projects/foo/tenants/bar/profiles/baz".
539
- # @param options [Google::Gax::CallOptions]
540
- # Overrides the default settings for this call, e.g, timeout,
541
- # retries, etc.
542
- # @yield [result, operation] Access the result along with the RPC operation
543
- # @yieldparam result []
544
- # @yieldparam operation [GRPC::ActiveCall::Operation]
545
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
546
- # @example
547
- # require "google/cloud/talent"
548
- #
549
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
550
- # formatted_name = Google::Cloud::Talent::V4beta1::ProfileServiceClient.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]")
551
- # profile_client.delete_profile(formatted_name)
552
-
553
- def delete_profile \
554
- name,
555
- options: nil,
556
- &block
557
- req = {
558
- name: name
559
- }.delete_if { |_, v| v.nil? }
560
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteProfileRequest)
561
- @delete_profile.call(req, options, &block)
562
- nil
563
- end
564
-
565
- # Searches for profiles within a tenant.
566
- #
567
- # For example, search by raw queries "software engineer in Mountain View" or
568
- # search by structured filters (location filter, education filter, etc.).
569
- #
570
- # See {Google::Cloud::Talent::V4beta1::SearchProfilesRequest SearchProfilesRequest} for more information.
571
- #
572
- # @param parent [String]
573
- # Required. The resource name of the tenant to search within.
574
- #
575
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
576
- # "projects/foo/tenants/bar".
577
- # @param request_metadata [Google::Cloud::Talent::V4beta1::RequestMetadata | Hash]
578
- # Required. The meta information collected about the profile search user. This is used
579
- # to improve the search quality of the service. These values are provided by
580
- # users, and must be precise and consistent.
581
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::RequestMetadata`
582
- # can also be provided.
583
- # @param profile_query [Google::Cloud::Talent::V4beta1::ProfileQuery | Hash]
584
- # Search query to execute. See {Google::Cloud::Talent::V4beta1::ProfileQuery ProfileQuery} for more details.
585
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::ProfileQuery`
586
- # can also be provided.
587
- # @param page_size [Integer]
588
- # The maximum number of resources contained in the underlying API
589
- # response. If page streaming is performed per-resource, this
590
- # parameter does not affect the return value. If page streaming is
591
- # performed per-page, this determines the maximum number of
592
- # resources in a page.
593
- # @param offset [Integer]
594
- # An integer that specifies the current offset (that is, starting result) in
595
- # search results. This field is only considered if {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#page_token page_token} is unset.
596
- #
597
- # The maximum allowed value is 5000. Otherwise an error is thrown.
598
- #
599
- # For example, 0 means to search from the first profile, and 10 means to
600
- # search from the 11th profile. This can be used for pagination, for example
601
- # pageSize = 10 and offset = 10 means to search from the second page.
602
- # @param disable_spell_check [true, false]
603
- # This flag controls the spell-check feature. If `false`, the
604
- # service attempts to correct a misspelled query.
605
- #
606
- # For example, "enginee" is corrected to "engineer".
607
- # @param order_by [String]
608
- # The criteria that determines how search results are sorted.
609
- # Defaults is "relevance desc" if no value is specified.
610
- #
611
- # Supported options are:
612
- #
613
- # * "relevance desc": By descending relevance, as determined by the API
614
- # algorithms.
615
- # * "update_date desc": Sort by {Google::Cloud::Talent::V4beta1::Profile#update_time Profile#update_time} in descending order
616
- # (recently updated profiles first).
617
- # * "create_date desc": Sort by {Google::Cloud::Talent::V4beta1::Profile#create_time Profile#create_time} in descending order
618
- # (recently created profiles first).
619
- # * "first_name": Sort by {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#given_name PersonName::PersonStructuredName#given_name} in
620
- # ascending order.
621
- # * "first_name desc": Sort by {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#given_name PersonName::PersonStructuredName#given_name}
622
- # in descending order.
623
- # * "last_name": Sort by {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#family_name PersonName::PersonStructuredName#family_name} in
624
- # ascending order.
625
- # * "last_name desc": Sort by {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#family_name PersonName::PersonStructuredName#family_name}
626
- # in ascending order.
627
- # @param case_sensitive_sort [true, false]
628
- # When sort by field is based on alphabetical order, sort values case
629
- # sensitively (based on ASCII) when the value is set to true. Default value
630
- # is case in-sensitive sort (false).
631
- # @param histogram_queries [Array<Google::Cloud::Talent::V4beta1::HistogramQuery | Hash>]
632
- # A list of expressions specifies histogram requests against matching
633
- # profiles for {Google::Cloud::Talent::V4beta1::SearchProfilesRequest SearchProfilesRequest}.
634
- #
635
- # The expression syntax looks like a function definition with parameters.
636
- #
637
- # Function syntax: function_name(histogram_facet[, list of buckets])
638
- #
639
- # Data types:
640
- #
641
- # * Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+.
642
- # * String: string like "any string with backslash escape for quote(\")."
643
- # * Number: whole number and floating point number like 10, -1 and -0.01.
644
- # * List: list of elements with comma(,) separator surrounded by square
645
- # brackets. For example, [1, 2, 3] and ["one", "two", "three"].
646
- #
647
- # Built-in constants:
648
- #
649
- # * MIN (minimum number similar to java Double.MIN_VALUE)
650
- # * MAX (maximum number similar to java Double.MAX_VALUE)
651
- #
652
- # Built-in functions:
653
- #
654
- # * bucket(start, end[, label])
655
- # Bucket build-in function creates a bucket with range of [start, end). Note
656
- # that the end is exclusive.
657
- # For example, bucket(1, MAX, "positive number") or bucket(1, 10).
658
- #
659
- # Histogram Facets:
660
- #
661
- # * admin1: Admin1 is a global placeholder for referring to state, province,
662
- # or the particular term a country uses to define the geographic structure
663
- # below the country level. Examples include states codes such as "CA", "IL",
664
- # "NY", and provinces, such as "BC".
665
- # * locality: Locality is a global placeholder for referring to city, town,
666
- # or the particular term a country uses to define the geographic structure
667
- # below the admin1 level. Examples include city names such as
668
- # "Mountain View" and "New York".
669
- # * extended_locality: Extended locality is concatenated version of admin1
670
- # and locality with comma separator. For example, "Mountain View, CA" and
671
- # "New York, NY".
672
- # * postal_code: Postal code of profile which follows locale code.
673
- # * country: Country code (ISO-3166-1 alpha-2 code) of profile, such as US,
674
- # JP, GB.
675
- # * job_title: Normalized job titles specified in EmploymentHistory.
676
- # * company_name: Normalized company name of profiles to match on.
677
- # * institution: The school name. For example, "MIT",
678
- # "University of California, Berkeley"
679
- # * degree: Highest education degree in ISCED code. Each value in degree
680
- # covers a specific level of education, without any expansion to upper nor
681
- # lower levels of education degree.
682
- # * experience_in_months: experience in months. 0 means 0 month to 1 month
683
- # (exclusive).
684
- # * application_date: The application date specifies application start dates.
685
- # See {Google::Cloud::Talent::V4beta1::ApplicationDateFilter ApplicationDateFilter} for more details.
686
- # * application_outcome_notes: The application outcome reason specifies the
687
- # reasons behind the outcome of the job application.
688
- # See {Google::Cloud::Talent::V4beta1::ApplicationOutcomeNotesFilter ApplicationOutcomeNotesFilter} for more details.
689
- # * application_job_title: The application job title specifies the job
690
- # applied for in the application.
691
- # See {Google::Cloud::Talent::V4beta1::ApplicationJobFilter ApplicationJobFilter} for more details.
692
- # * hirable_status: Hirable status specifies the profile's hirable status.
693
- # * string_custom_attribute: String custom attributes. Values can be accessed
694
- # via square bracket notation like string_custom_attribute["key1"].
695
- # * numeric_custom_attribute: Numeric custom attributes. Values can be
696
- # accessed via square bracket notation like numeric_custom_attribute["key1"].
697
- #
698
- # Example expressions:
699
- #
700
- # * count(admin1)
701
- # * count(experience_in_months, [bucket(0, 12, "1 year"),
702
- # bucket(12, 36, "1-3 years"), bucket(36, MAX, "3+ years")])
703
- # * count(string_custom_attribute["assigned_recruiter"])
704
- # * count(numeric_custom_attribute["favorite_number"],
705
- # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])
706
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::HistogramQuery`
707
- # can also be provided.
708
- # @param result_set_id [String]
709
- # An id that uniquely identifies the result set of a
710
- # {Google::Cloud::Talent::V4beta1::ProfileService::SearchProfiles SearchProfiles} call. The id should be
711
- # retrieved from the
712
- # {Google::Cloud::Talent::V4beta1::SearchProfilesResponse SearchProfilesResponse} message returned from a previous
713
- # invocation of {Google::Cloud::Talent::V4beta1::ProfileService::SearchProfiles SearchProfiles}.
714
- #
715
- # A result set is an ordered list of search results.
716
- #
717
- # If this field is not set, a new result set is computed based on the
718
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#profile_query profile_query}. A new {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#result_set_id result_set_id} is returned as a handle to
719
- # access this result set.
720
- #
721
- # If this field is set, the service will ignore the resource and
722
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#profile_query profile_query} values, and simply retrieve a page of results from the
723
- # corresponding result set. In this case, one and only one of {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#page_token page_token}
724
- # or {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#offset offset} must be set.
725
- #
726
- # A typical use case is to invoke {Google::Cloud::Talent::V4beta1::SearchProfilesRequest SearchProfilesRequest} without this
727
- # field, then use the resulting {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#result_set_id result_set_id} in
728
- # {Google::Cloud::Talent::V4beta1::SearchProfilesResponse SearchProfilesResponse} to page through the results.
729
- # @param strict_keywords_search [true, false]
730
- # This flag is used to indicate whether the service will attempt to
731
- # understand synonyms and terms related to the search query or treat the
732
- # query "as is" when it generates a set of results. By default this flag is
733
- # set to false, thus allowing expanded results to also be returned. For
734
- # example a search for "software engineer" might also return candidates who
735
- # have experience in jobs similar to software engineer positions. By setting
736
- # this flag to true, the service will only attempt to deliver candidates has
737
- # software engineer in his/her global fields by treating "software engineer"
738
- # as a keyword.
739
- #
740
- # It is recommended to provide a feature in the UI (such as a checkbox) to
741
- # allow recruiters to set this flag to true if they intend to search for
742
- # longer boolean strings.
743
- # @param options [Google::Gax::CallOptions]
744
- # Overrides the default settings for this call, e.g, timeout,
745
- # retries, etc.
746
- # @yield [result, operation] Access the result along with the RPC operation
747
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SummarizedProfile>]
748
- # @yieldparam operation [GRPC::ActiveCall::Operation]
749
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SummarizedProfile>]
750
- # An enumerable of Google::Cloud::Talent::V4beta1::SummarizedProfile instances.
751
- # See Google::Gax::PagedEnumerable documentation for other
752
- # operations such as per-page iteration or access to the response
753
- # object.
754
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
755
- # @example
756
- # require "google/cloud/talent"
757
- #
758
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
759
- # formatted_parent = Google::Cloud::Talent::V4beta1::ProfileServiceClient.tenant_path("[PROJECT]", "[TENANT]")
760
- #
761
- # # TODO: Initialize `request_metadata`:
762
- # request_metadata = {}
763
- #
764
- # # Iterate over all results.
765
- # profile_client.search_profiles(formatted_parent, request_metadata).each do |element|
766
- # # Process element.
767
- # end
768
- #
769
- # # Or iterate over results one page at a time.
770
- # profile_client.search_profiles(formatted_parent, request_metadata).each_page do |page|
771
- # # Process each page at a time.
772
- # page.each do |element|
773
- # # Process element.
774
- # end
775
- # end
776
-
777
- def search_profiles \
778
- parent,
779
- request_metadata,
780
- profile_query: nil,
781
- page_size: nil,
782
- offset: nil,
783
- disable_spell_check: nil,
784
- order_by: nil,
785
- case_sensitive_sort: nil,
786
- histogram_queries: nil,
787
- result_set_id: nil,
788
- strict_keywords_search: nil,
789
- options: nil,
790
- &block
791
- req = {
792
- parent: parent,
793
- request_metadata: request_metadata,
794
- profile_query: profile_query,
795
- page_size: page_size,
796
- offset: offset,
797
- disable_spell_check: disable_spell_check,
798
- order_by: order_by,
799
- case_sensitive_sort: case_sensitive_sort,
800
- histogram_queries: histogram_queries,
801
- result_set_id: result_set_id,
802
- strict_keywords_search: strict_keywords_search
803
- }.delete_if { |_, v| v.nil? }
804
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::SearchProfilesRequest)
805
- @search_profiles.call(req, options, &block)
806
- end
807
- end
808
- end
809
- end
810
- end
811
- end