google-cloud-talent 0.8.1 → 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} +5 -15
  8. data/lib/google/cloud/talent.rb +254 -442
  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 -62
  14. data/lib/google/cloud/talent/v4beta1/application_service_client.rb +0 -491
  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 -54
  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 -40
  21. data/lib/google/cloud/talent/v4beta1/company_service_client.rb +0 -535
  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 -55
  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 -359
  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 -55
  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 -107
  32. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +0 -1147
  33. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +0 -110
  34. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +0 -122
  35. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +0 -141
  36. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +0 -238
  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 -847
  39. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +0 -55
  40. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +0 -363
  41. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +0 -762
  42. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +0 -808
  43. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +0 -446
  44. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +0 -74
  45. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +0 -101
  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 -87
  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 -126
  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 -26
  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 -71
  67. data/lib/google/cloud/talent/v4beta1/job_service_client.rb +0 -1576
  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 -165
  70. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +0 -92
  71. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -212
  72. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -844
  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 -88
  75. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +0 -67
  76. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -33
  77. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -476
  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 -54
  80. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +0 -55
@@ -1,844 +0,0 @@
1
- # Copyright 2019 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
278
- # created.
279
- #
280
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
281
- # "projects/foo/tenants/bar".
282
- # @param filter [String]
283
- # The filter string specifies the profiles to be enumerated.
284
- #
285
- # Supported operator: =, AND
286
- #
287
- # The field(s) eligible for filtering are:
288
- #
289
- # * `externalId`
290
- # * `groupId`
291
- #
292
- # externalId and groupId cannot be specified at the same time. If both
293
- # externalId and groupId are provided, the API will return a bad request
294
- # error.
295
- #
296
- # Sample Query:
297
- #
298
- # * externalId = "externalId-1"
299
- # * groupId = "groupId-1"
300
- # @param page_size [Integer]
301
- # The maximum number of resources contained in the underlying API
302
- # response. If page streaming is performed per-resource, this
303
- # parameter does not affect the return value. If page streaming is
304
- # performed per-page, this determines the maximum number of
305
- # resources in a page.
306
- # @param read_mask [Google::Protobuf::FieldMask | Hash]
307
- # A field mask to specify the profile fields to be listed in response.
308
- # All fields are listed if it is unset.
309
- #
310
- # Valid values are:
311
- #
312
- # * name
313
- # A hash of the same form as `Google::Protobuf::FieldMask`
314
- # can also be provided.
315
- # @param options [Google::Gax::CallOptions]
316
- # Overrides the default settings for this call, e.g, timeout,
317
- # retries, etc.
318
- # @yield [result, operation] Access the result along with the RPC operation
319
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Profile>]
320
- # @yieldparam operation [GRPC::ActiveCall::Operation]
321
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Profile>]
322
- # An enumerable of Google::Cloud::Talent::V4beta1::Profile instances.
323
- # See Google::Gax::PagedEnumerable documentation for other
324
- # operations such as per-page iteration or access to the response
325
- # object.
326
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
327
- # @example
328
- # require "google/cloud/talent"
329
- #
330
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
331
- # formatted_parent = Google::Cloud::Talent::V4beta1::ProfileServiceClient.tenant_path("[PROJECT]", "[TENANT]")
332
- #
333
- # # Iterate over all results.
334
- # profile_client.list_profiles(formatted_parent).each do |element|
335
- # # Process element.
336
- # end
337
- #
338
- # # Or iterate over results one page at a time.
339
- # profile_client.list_profiles(formatted_parent).each_page do |page|
340
- # # Process each page at a time.
341
- # page.each do |element|
342
- # # Process element.
343
- # end
344
- # end
345
-
346
- def list_profiles \
347
- parent,
348
- filter: nil,
349
- page_size: nil,
350
- read_mask: nil,
351
- options: nil,
352
- &block
353
- req = {
354
- parent: parent,
355
- filter: filter,
356
- page_size: page_size,
357
- read_mask: read_mask
358
- }.delete_if { |_, v| v.nil? }
359
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListProfilesRequest)
360
- @list_profiles.call(req, options, &block)
361
- end
362
-
363
- # Creates and returns a new profile.
364
- #
365
- # @param parent [String]
366
- # Required. The name of the tenant this profile belongs to.
367
- #
368
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
369
- # "projects/foo/tenants/bar".
370
- # @param profile [Google::Cloud::Talent::V4beta1::Profile | Hash]
371
- # Required. The profile to be created.
372
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Profile`
373
- # can also be provided.
374
- # @param options [Google::Gax::CallOptions]
375
- # Overrides the default settings for this call, e.g, timeout,
376
- # retries, etc.
377
- # @yield [result, operation] Access the result along with the RPC operation
378
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Profile]
379
- # @yieldparam operation [GRPC::ActiveCall::Operation]
380
- # @return [Google::Cloud::Talent::V4beta1::Profile]
381
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
382
- # @example
383
- # require "google/cloud/talent"
384
- #
385
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
386
- # formatted_parent = Google::Cloud::Talent::V4beta1::ProfileServiceClient.tenant_path("[PROJECT]", "[TENANT]")
387
- #
388
- # # TODO: Initialize `profile`:
389
- # profile = {}
390
- # response = profile_client.create_profile(formatted_parent, profile)
391
-
392
- def create_profile \
393
- parent,
394
- profile,
395
- options: nil,
396
- &block
397
- req = {
398
- parent: parent,
399
- profile: profile
400
- }.delete_if { |_, v| v.nil? }
401
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateProfileRequest)
402
- @create_profile.call(req, options, &block)
403
- end
404
-
405
- # Gets the specified profile.
406
- #
407
- # @param name [String]
408
- # Required. Resource name of the profile to get.
409
- #
410
- # The format is
411
- # "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For
412
- # example, "projects/foo/tenants/bar/profiles/baz".
413
- # @param options [Google::Gax::CallOptions]
414
- # Overrides the default settings for this call, e.g, timeout,
415
- # retries, etc.
416
- # @yield [result, operation] Access the result along with the RPC operation
417
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Profile]
418
- # @yieldparam operation [GRPC::ActiveCall::Operation]
419
- # @return [Google::Cloud::Talent::V4beta1::Profile]
420
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
421
- # @example
422
- # require "google/cloud/talent"
423
- #
424
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
425
- # formatted_name = Google::Cloud::Talent::V4beta1::ProfileServiceClient.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]")
426
- # response = profile_client.get_profile(formatted_name)
427
-
428
- def get_profile \
429
- name,
430
- options: nil,
431
- &block
432
- req = {
433
- name: name
434
- }.delete_if { |_, v| v.nil? }
435
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetProfileRequest)
436
- @get_profile.call(req, options, &block)
437
- end
438
-
439
- # Updates the specified profile and returns the updated result.
440
- #
441
- # @param profile [Google::Cloud::Talent::V4beta1::Profile | Hash]
442
- # Required. Profile to be updated.
443
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Profile`
444
- # can also be provided.
445
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
446
- # A field mask to specify the profile fields to update.
447
- #
448
- # A full update is performed if it is unset.
449
- #
450
- # Valid values are:
451
- #
452
- # * external_id
453
- # * source
454
- # * source_types
455
- # * uri
456
- # * is_hirable
457
- # * create_time
458
- # * update_time
459
- # * candidate_update_time
460
- # * resume_update_time
461
- # * resume
462
- # * person_names
463
- # * addresses
464
- # * email_addresses
465
- # * phone_numbers
466
- # * personal_uris
467
- # * additional_contact_info
468
- # * employment_records
469
- # * education_records
470
- # * skills
471
- # * activities
472
- # * publications
473
- # * patents
474
- # * certifications
475
- # * recruiting_notes
476
- # * custom_attributes
477
- # * group_id
478
- # * external_system
479
- # * source_note
480
- # * primary_responsibilities
481
- # * citizenships
482
- # * work_authorizations
483
- # * employee_types
484
- # * language_code
485
- # * qualification_summary
486
- # * allowed_contact_types
487
- # * preferred_contact_types
488
- # * contact_availability
489
- # * language_fluencies
490
- # * work_preference
491
- # * industry_experiences
492
- # * work_environment_experiences
493
- # * work_availability
494
- # * security_clearances
495
- # * references
496
- # * assessments
497
- # * interviews
498
- # A hash of the same form as `Google::Protobuf::FieldMask`
499
- # can also be provided.
500
- # @param options [Google::Gax::CallOptions]
501
- # Overrides the default settings for this call, e.g, timeout,
502
- # retries, etc.
503
- # @yield [result, operation] Access the result along with the RPC operation
504
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Profile]
505
- # @yieldparam operation [GRPC::ActiveCall::Operation]
506
- # @return [Google::Cloud::Talent::V4beta1::Profile]
507
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
508
- # @example
509
- # require "google/cloud/talent"
510
- #
511
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
512
- #
513
- # # TODO: Initialize `profile`:
514
- # profile = {}
515
- # response = profile_client.update_profile(profile)
516
-
517
- def update_profile \
518
- profile,
519
- update_mask: nil,
520
- options: nil,
521
- &block
522
- req = {
523
- profile: profile,
524
- update_mask: update_mask
525
- }.delete_if { |_, v| v.nil? }
526
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateProfileRequest)
527
- @update_profile.call(req, options, &block)
528
- end
529
-
530
- # Deletes the specified profile.
531
- # Prerequisite: The profile has no associated applications or assignments
532
- # associated.
533
- #
534
- # @param name [String]
535
- # Required. Resource name of the profile to be deleted.
536
- #
537
- # The format is
538
- # "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For
539
- # example, "projects/foo/tenants/bar/profiles/baz".
540
- # @param options [Google::Gax::CallOptions]
541
- # Overrides the default settings for this call, e.g, timeout,
542
- # retries, etc.
543
- # @yield [result, operation] Access the result along with the RPC operation
544
- # @yieldparam result []
545
- # @yieldparam operation [GRPC::ActiveCall::Operation]
546
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
547
- # @example
548
- # require "google/cloud/talent"
549
- #
550
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
551
- # formatted_name = Google::Cloud::Talent::V4beta1::ProfileServiceClient.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]")
552
- # profile_client.delete_profile(formatted_name)
553
-
554
- def delete_profile \
555
- name,
556
- options: nil,
557
- &block
558
- req = {
559
- name: name
560
- }.delete_if { |_, v| v.nil? }
561
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteProfileRequest)
562
- @delete_profile.call(req, options, &block)
563
- nil
564
- end
565
-
566
- # Searches for profiles within a tenant.
567
- #
568
- # For example, search by raw queries "software engineer in Mountain View" or
569
- # search by structured filters (location filter, education filter, etc.).
570
- #
571
- # See
572
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest SearchProfilesRequest}
573
- # for more information.
574
- #
575
- # @param parent [String]
576
- # Required. The resource name of the tenant to search within.
577
- #
578
- # The format is "projects/{project_id}/tenants/{tenant_id}". For example,
579
- # "projects/foo/tenants/bar".
580
- # @param request_metadata [Google::Cloud::Talent::V4beta1::RequestMetadata | Hash]
581
- # Required. The meta information collected about the profile search user.
582
- # This is used to improve the search quality of the service. These values are
583
- # provided by users, and must be precise and consistent.
584
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::RequestMetadata`
585
- # can also be provided.
586
- # @param profile_query [Google::Cloud::Talent::V4beta1::ProfileQuery | Hash]
587
- # Search query to execute. See
588
- # {Google::Cloud::Talent::V4beta1::ProfileQuery ProfileQuery} for more details.
589
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::ProfileQuery`
590
- # can also be provided.
591
- # @param page_size [Integer]
592
- # The maximum number of resources contained in the underlying API
593
- # response. If page streaming is performed per-resource, this
594
- # parameter does not affect the return value. If page streaming is
595
- # performed per-page, this determines the maximum number of
596
- # resources in a page.
597
- # @param offset [Integer]
598
- # An integer that specifies the current offset (that is, starting result) in
599
- # search results. This field is only considered if
600
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#page_token page_token}
601
- # is unset.
602
- #
603
- # The maximum allowed value is 5000. Otherwise an error is thrown.
604
- #
605
- # For example, 0 means to search from the first profile, and 10 means to
606
- # search from the 11th profile. This can be used for pagination, for example
607
- # pageSize = 10 and offset = 10 means to search from the second page.
608
- # @param disable_spell_check [true, false]
609
- # This flag controls the spell-check feature. If `false`, the
610
- # service attempts to correct a misspelled query.
611
- #
612
- # For example, "enginee" is corrected to "engineer".
613
- # @param order_by [String]
614
- # The criteria that determines how search results are sorted.
615
- # Defaults is "relevance desc" if no value is specified.
616
- #
617
- # Supported options are:
618
- #
619
- # * "relevance desc": By descending relevance, as determined by the API
620
- # algorithms.
621
- # * "update_date desc": Sort by
622
- # {Google::Cloud::Talent::V4beta1::Profile#update_time Profile#update_time} in
623
- # descending order
624
- # (recently updated profiles first).
625
- # * "create_date desc": Sort by
626
- # {Google::Cloud::Talent::V4beta1::Profile#create_time Profile#create_time} in
627
- # descending order
628
- # (recently created profiles first).
629
- # * "first_name": Sort by
630
- # {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#given_name PersonName::PersonStructuredName#given_name}
631
- # in
632
- # ascending order.
633
- # * "first_name desc": Sort by
634
- # {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#given_name PersonName::PersonStructuredName#given_name}
635
- # in descending order.
636
- # * "last_name": Sort by
637
- # {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#family_name PersonName::PersonStructuredName#family_name}
638
- # in
639
- # ascending order.
640
- # * "last_name desc": Sort by
641
- # {Google::Cloud::Talent::V4beta1::PersonName::PersonStructuredName#family_name PersonName::PersonStructuredName#family_name}
642
- # in ascending order.
643
- # @param case_sensitive_sort [true, false]
644
- # When sort by field is based on alphabetical order, sort values case
645
- # sensitively (based on ASCII) when the value is set to true. Default value
646
- # is case in-sensitive sort (false).
647
- # @param histogram_queries [Array<Google::Cloud::Talent::V4beta1::HistogramQuery | Hash>]
648
- # A list of expressions specifies histogram requests against matching
649
- # profiles for
650
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest SearchProfilesRequest}.
651
- #
652
- # The expression syntax looks like a function definition with parameters.
653
- #
654
- # Function syntax: function_name(histogram_facet[, list of buckets])
655
- #
656
- # Data types:
657
- #
658
- # * Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+.
659
- # * String: string like "any string with backslash escape for quote(\")."
660
- # * Number: whole number and floating point number like 10, -1 and -0.01.
661
- # * List: list of elements with comma(,) separator surrounded by square
662
- # brackets. For example, [1, 2, 3] and ["one", "two", "three"].
663
- #
664
- # Built-in constants:
665
- #
666
- # * MIN (minimum number similar to java Double.MIN_VALUE)
667
- # * MAX (maximum number similar to java Double.MAX_VALUE)
668
- #
669
- # Built-in functions:
670
- #
671
- # * bucket(start, end[, label])
672
- # Bucket build-in function creates a bucket with range of [start, end). Note
673
- # that the end is exclusive.
674
- # For example, bucket(1, MAX, "positive number") or bucket(1, 10).
675
- #
676
- # Histogram Facets:
677
- #
678
- # * admin1: Admin1 is a global placeholder for referring to state, province,
679
- # or the particular term a country uses to define the geographic structure
680
- # below the country level. Examples include states codes such as "CA", "IL",
681
- # "NY", and provinces, such as "BC".
682
- # * locality: Locality is a global placeholder for referring to city, town,
683
- # or the particular term a country uses to define the geographic structure
684
- # below the admin1 level. Examples include city names such as
685
- # "Mountain View" and "New York".
686
- # * extended_locality: Extended locality is concatenated version of admin1
687
- # and locality with comma separator. For example, "Mountain View, CA" and
688
- # "New York, NY".
689
- # * postal_code: Postal code of profile which follows locale code.
690
- # * country: Country code (ISO-3166-1 alpha-2 code) of profile, such as US,
691
- # JP, GB.
692
- # * job_title: Normalized job titles specified in EmploymentHistory.
693
- # * company_name: Normalized company name of profiles to match on.
694
- # * institution: The school name. For example, "MIT",
695
- # "University of California, Berkeley"
696
- # * degree: Highest education degree in ISCED code. Each value in degree
697
- # covers a specific level of education, without any expansion to upper nor
698
- # lower levels of education degree.
699
- # * experience_in_months: experience in months. 0 means 0 month to 1 month
700
- # (exclusive).
701
- # * application_date: The application date specifies application start dates.
702
- # See
703
- # {Google::Cloud::Talent::V4beta1::ApplicationDateFilter ApplicationDateFilter}
704
- # for more details.
705
- # * application_outcome_notes: The application outcome reason specifies the
706
- # reasons behind the outcome of the job application.
707
- # See
708
- # {Google::Cloud::Talent::V4beta1::ApplicationOutcomeNotesFilter ApplicationOutcomeNotesFilter}
709
- # for more details.
710
- # * application_job_title: The application job title specifies the job
711
- # applied for in the application.
712
- # See
713
- # {Google::Cloud::Talent::V4beta1::ApplicationJobFilter ApplicationJobFilter}
714
- # for more details.
715
- # * hirable_status: Hirable status specifies the profile's hirable status.
716
- # * string_custom_attribute: String custom attributes. Values can be accessed
717
- # via square bracket notation like string_custom_attribute["key1"].
718
- # * numeric_custom_attribute: Numeric custom attributes. Values can be
719
- # accessed via square bracket notation like numeric_custom_attribute["key1"].
720
- #
721
- # Example expressions:
722
- #
723
- # * count(admin1)
724
- # * count(experience_in_months, [bucket(0, 12, "1 year"),
725
- # bucket(12, 36, "1-3 years"), bucket(36, MAX, "3+ years")])
726
- # * count(string_custom_attribute["assigned_recruiter"])
727
- # * count(numeric_custom_attribute["favorite_number"],
728
- # [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")])
729
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::HistogramQuery`
730
- # can also be provided.
731
- # @param result_set_id [String]
732
- # An id that uniquely identifies the result set of a
733
- # {Google::Cloud::Talent::V4beta1::ProfileService::SearchProfiles SearchProfiles}
734
- # call. The id should be retrieved from the
735
- # {Google::Cloud::Talent::V4beta1::SearchProfilesResponse SearchProfilesResponse}
736
- # message returned from a previous invocation of
737
- # {Google::Cloud::Talent::V4beta1::ProfileService::SearchProfiles SearchProfiles}.
738
- #
739
- # A result set is an ordered list of search results.
740
- #
741
- # If this field is not set, a new result set is computed based on the
742
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#profile_query profile_query}.
743
- # A new
744
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#result_set_id result_set_id}
745
- # is returned as a handle to access this result set.
746
- #
747
- # If this field is set, the service will ignore the resource and
748
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#profile_query profile_query}
749
- # values, and simply retrieve a page of results from the corresponding result
750
- # set. In this case, one and only one of
751
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#page_token page_token}
752
- # or {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#offset offset} must
753
- # be set.
754
- #
755
- # A typical use case is to invoke
756
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest SearchProfilesRequest}
757
- # without this field, then use the resulting
758
- # {Google::Cloud::Talent::V4beta1::SearchProfilesRequest#result_set_id result_set_id}
759
- # in
760
- # {Google::Cloud::Talent::V4beta1::SearchProfilesResponse SearchProfilesResponse}
761
- # to page through the results.
762
- # @param strict_keywords_search [true, false]
763
- # This flag is used to indicate whether the service will attempt to
764
- # understand synonyms and terms related to the search query or treat the
765
- # query "as is" when it generates a set of results. By default this flag is
766
- # set to false, thus allowing expanded results to also be returned. For
767
- # example a search for "software engineer" might also return candidates who
768
- # have experience in jobs similar to software engineer positions. By setting
769
- # this flag to true, the service will only attempt to deliver candidates has
770
- # software engineer in his/her global fields by treating "software engineer"
771
- # as a keyword.
772
- #
773
- # It is recommended to provide a feature in the UI (such as a checkbox) to
774
- # allow recruiters to set this flag to true if they intend to search for
775
- # longer boolean strings.
776
- # @param options [Google::Gax::CallOptions]
777
- # Overrides the default settings for this call, e.g, timeout,
778
- # retries, etc.
779
- # @yield [result, operation] Access the result along with the RPC operation
780
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SummarizedProfile>]
781
- # @yieldparam operation [GRPC::ActiveCall::Operation]
782
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::SummarizedProfile>]
783
- # An enumerable of Google::Cloud::Talent::V4beta1::SummarizedProfile instances.
784
- # See Google::Gax::PagedEnumerable documentation for other
785
- # operations such as per-page iteration or access to the response
786
- # object.
787
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
788
- # @example
789
- # require "google/cloud/talent"
790
- #
791
- # profile_client = Google::Cloud::Talent::ProfileService.new(version: :v4beta1)
792
- # formatted_parent = Google::Cloud::Talent::V4beta1::ProfileServiceClient.tenant_path("[PROJECT]", "[TENANT]")
793
- #
794
- # # TODO: Initialize `request_metadata`:
795
- # request_metadata = {}
796
- #
797
- # # Iterate over all results.
798
- # profile_client.search_profiles(formatted_parent, request_metadata).each do |element|
799
- # # Process element.
800
- # end
801
- #
802
- # # Or iterate over results one page at a time.
803
- # profile_client.search_profiles(formatted_parent, request_metadata).each_page do |page|
804
- # # Process each page at a time.
805
- # page.each do |element|
806
- # # Process element.
807
- # end
808
- # end
809
-
810
- def search_profiles \
811
- parent,
812
- request_metadata,
813
- profile_query: nil,
814
- page_size: nil,
815
- offset: nil,
816
- disable_spell_check: nil,
817
- order_by: nil,
818
- case_sensitive_sort: nil,
819
- histogram_queries: nil,
820
- result_set_id: nil,
821
- strict_keywords_search: nil,
822
- options: nil,
823
- &block
824
- req = {
825
- parent: parent,
826
- request_metadata: request_metadata,
827
- profile_query: profile_query,
828
- page_size: page_size,
829
- offset: offset,
830
- disable_spell_check: disable_spell_check,
831
- order_by: order_by,
832
- case_sensitive_sort: case_sensitive_sort,
833
- histogram_queries: histogram_queries,
834
- result_set_id: result_set_id,
835
- strict_keywords_search: strict_keywords_search
836
- }.delete_if { |_, v| v.nil? }
837
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::SearchProfilesRequest)
838
- @search_profiles.call(req, options, &block)
839
- end
840
- end
841
- end
842
- end
843
- end
844
- end