google-cloud-talent 0.1.0

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