google-cloud-talent 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/talent.rb +28 -0
  3. data/lib/google/cloud/talent/v4beta1.rb +57 -0
  4. data/lib/google/cloud/talent/v4beta1/application_pb.rb +1 -2
  5. data/lib/google/cloud/talent/v4beta1/application_service_client.rb +26 -24
  6. data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +1 -0
  7. data/lib/google/cloud/talent/v4beta1/batch_pb.rb +30 -0
  8. data/lib/google/cloud/talent/v4beta1/common_pb.rb +1 -0
  9. data/lib/google/cloud/talent/v4beta1/company_pb.rb +1 -1
  10. data/lib/google/cloud/talent/v4beta1/company_service_client.rb +28 -29
  11. data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +1 -0
  12. data/lib/google/cloud/talent/v4beta1/completion_client.rb +36 -32
  13. data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +1 -0
  14. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application.rb +14 -33
  15. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application_service.rb +18 -27
  16. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +144 -135
  17. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +19 -36
  18. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +20 -32
  19. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +30 -32
  20. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +121 -41
  21. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +3 -7
  22. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +239 -281
  23. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +9 -3
  24. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +129 -142
  25. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +280 -215
  26. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +198 -338
  27. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +128 -108
  28. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +11 -13
  29. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +16 -27
  30. data/lib/google/cloud/talent/v4beta1/doc/google/longrunning/operations.rb +51 -0
  31. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/any.rb +131 -0
  32. data/lib/google/cloud/talent/v4beta1/doc/google/rpc/status.rb +87 -0
  33. data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +1 -1
  34. data/lib/google/cloud/talent/v4beta1/event_pb.rb +1 -1
  35. data/lib/google/cloud/talent/v4beta1/event_service_client.rb +13 -10
  36. data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +1 -0
  37. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +6 -1
  38. data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +1 -1
  39. data/lib/google/cloud/talent/v4beta1/job_pb.rb +1 -1
  40. data/lib/google/cloud/talent/v4beta1/job_service_client.rb +528 -301
  41. data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +10 -0
  42. data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +13 -0
  43. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +16 -8
  44. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +118 -91
  45. data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +3 -0
  46. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +3 -1
  47. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +1 -1
  48. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +24 -24
  49. data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +1 -0
  50. data/lib/google/cloud/talent/version.rb +22 -0
  51. metadata +8 -9
  52. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/resume_service.rb +0 -98
  53. data/lib/google/cloud/talent/v4beta1/resume_service_client.rb +0 -296
  54. data/lib/google/cloud/talent/v4beta1/resume_service_client_config.json +0 -31
  55. data/lib/google/cloud/talent/v4beta1/resume_service_pb.rb +0 -37
  56. data/lib/google/cloud/talent/v4beta1/resume_service_services_pb.rb +0 -75
@@ -5,6 +5,7 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
+ require 'google/api/client_pb'
8
9
  require 'google/cloud/talent/v4beta1/common_pb'
9
10
  require 'google/cloud/talent/v4beta1/filters_pb'
10
11
  require 'google/cloud/talent/v4beta1/histogram_pb'
@@ -47,6 +48,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
47
48
  optional :order_by, :string, 8
48
49
  optional :case_sensitive_sort, :bool, 9
49
50
  repeated :histogram_queries, :message, 10, "google.cloud.talent.v4beta1.HistogramQuery"
51
+ optional :result_set_id, :string, 12
50
52
  end
51
53
  add_message "google.cloud.talent.v4beta1.SearchProfilesResponse" do
52
54
  optional :estimated_total_size, :int64, 1
@@ -55,6 +57,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
55
57
  optional :next_page_token, :string, 4
56
58
  repeated :histogram_query_results, :message, 5, "google.cloud.talent.v4beta1.HistogramQueryResult"
57
59
  repeated :summarized_profiles, :message, 6, "google.cloud.talent.v4beta1.SummarizedProfile"
60
+ optional :result_set_id, :string, 7
58
61
  end
59
62
  add_message "google.cloud.talent.v4beta1.SummarizedProfile" do
60
63
  repeated :profiles, :message, 1, "google.cloud.talent.v4beta1.Profile"
@@ -53,7 +53,9 @@ module Google
53
53
  # For example, search by raw queries "software engineer in Mountain View" or
54
54
  # search by structured filters (location filter, education filter, etc.).
55
55
  #
56
- # See [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information.
56
+ # See
57
+ # [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest]
58
+ # for more information.
57
59
  rpc :SearchProfiles, SearchProfilesRequest, SearchProfilesResponse
58
60
  end
59
61
 
@@ -4,8 +4,8 @@
4
4
 
5
5
  require 'google/protobuf'
6
6
 
7
- require 'google/cloud/talent/v4beta1/common_pb'
8
7
  require 'google/api/annotations_pb'
8
+ require 'google/cloud/talent/v4beta1/common_pb'
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_message "google.cloud.talent.v4beta1.Tenant" do
11
11
  optional :name, :string, 1
@@ -27,6 +27,7 @@ require "google/gax"
27
27
 
28
28
  require "google/cloud/talent/v4beta1/tenant_service_pb"
29
29
  require "google/cloud/talent/v4beta1/credentials"
30
+ require "google/cloud/talent/version"
30
31
 
31
32
  module Google
32
33
  module Cloud
@@ -126,6 +127,10 @@ module Google
126
127
  # The default timeout, in seconds, for calls made through this client.
127
128
  # @param metadata [Hash]
128
129
  # Default metadata to be sent with each request. This can be overridden on a per call basis.
130
+ # @param service_address [String]
131
+ # Override for the service hostname, or `nil` to leave as the default.
132
+ # @param service_port [Integer]
133
+ # Override for the service port, or `nil` to leave as the default.
129
134
  # @param exception_transformer [Proc]
130
135
  # An optional proc that intercepts any exceptions raised during an API call to inject
131
136
  # custom error handling.
@@ -135,6 +140,8 @@ module Google
135
140
  client_config: {},
136
141
  timeout: DEFAULT_TIMEOUT,
137
142
  metadata: nil,
143
+ service_address: nil,
144
+ service_port: nil,
138
145
  exception_transformer: nil,
139
146
  lib_name: nil,
140
147
  lib_version: ""
@@ -162,7 +169,7 @@ module Google
162
169
  updater_proc = credentials.updater_proc
163
170
  end
164
171
 
165
- package_version = Gem.loaded_specs['google-cloud-talent'].version.version
172
+ package_version = Google::Cloud::Talent::VERSION
166
173
 
167
174
  google_api_client = "gl-ruby/#{RUBY_VERSION}"
168
175
  google_api_client << " #{lib_name}/#{lib_version}" if lib_name
@@ -189,8 +196,8 @@ module Google
189
196
  end
190
197
 
191
198
  # Allow overriding the service path/port in subclasses.
192
- service_path = self.class::SERVICE_ADDRESS
193
- port = self.class::DEFAULT_SERVICE_PORT
199
+ service_path = service_address || self.class::SERVICE_ADDRESS
200
+ port = service_port || self.class::DEFAULT_SERVICE_PORT
194
201
  interceptors = self.class::GRPC_INTERCEPTORS
195
202
  @tenant_service_stub = Google::Gax::Grpc.create_stub(
196
203
  service_path,
@@ -250,16 +257,12 @@ module Google
250
257
  # Creates a new tenant entity.
251
258
  #
252
259
  # @param parent [String]
253
- # Required.
254
- #
255
- # Resource name of the project under which the tenant is created.
260
+ # Required. Resource name of the project under which the tenant is created.
256
261
  #
257
262
  # The format is "projects/{project_id}", for example,
258
263
  # "projects/api-test-project".
259
264
  # @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
260
- # Required.
261
- #
262
- # The tenant to be created.
265
+ # Required. The tenant to be created.
263
266
  # A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
264
267
  # can also be provided.
265
268
  # @param options [Google::Gax::CallOptions]
@@ -296,9 +299,7 @@ module Google
296
299
  # Retrieves specified tenant.
297
300
  #
298
301
  # @param name [String]
299
- # Required.
300
- #
301
- # The resource name of the tenant to be retrieved.
302
+ # Required. The resource name of the tenant to be retrieved.
302
303
  #
303
304
  # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
304
305
  # "projects/api-test-project/tenants/foo".
@@ -331,20 +332,23 @@ module Google
331
332
  # Updates specified tenant.
332
333
  #
333
334
  # @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
334
- # Required.
335
- #
336
- # The tenant resource to replace the current resource in the system.
335
+ # Required. The tenant resource to replace the current resource in the
336
+ # system.
337
337
  # A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
338
338
  # can also be provided.
339
339
  # @param update_mask [Google::Protobuf::FieldMask | Hash]
340
340
  # Optional but strongly recommended for the best service
341
341
  # experience.
342
342
  #
343
- # If {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} is provided, only the specified fields in
344
- # {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are updated. Otherwise all the fields are updated.
343
+ # If
344
+ # {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask}
345
+ # is provided, only the specified fields in
346
+ # {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are
347
+ # updated. Otherwise all the fields are updated.
345
348
  #
346
349
  # A field mask to specify the tenant fields to be updated. Only
347
- # top level fields of {Google::Cloud::Talent::V4beta1::Tenant Tenant} are supported.
350
+ # top level fields of {Google::Cloud::Talent::V4beta1::Tenant Tenant} are
351
+ # supported.
348
352
  # A hash of the same form as `Google::Protobuf::FieldMask`
349
353
  # can also be provided.
350
354
  # @param options [Google::Gax::CallOptions]
@@ -380,9 +384,7 @@ module Google
380
384
  # Deletes specified tenant.
381
385
  #
382
386
  # @param name [String]
383
- # Required.
384
- #
385
- # The resource name of the tenant to be deleted.
387
+ # Required. The resource name of the tenant to be deleted.
386
388
  #
387
389
  # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
388
390
  # "projects/api-test-project/tenants/foo".
@@ -415,9 +417,7 @@ module Google
415
417
  # Lists all tenants associated with the project.
416
418
  #
417
419
  # @param parent [String]
418
- # Required.
419
- #
420
- # Resource name of the project under which the tenant is created.
420
+ # Required. Resource name of the project under which the tenant is created.
421
421
  #
422
422
  # The format is "projects/{project_id}", for example,
423
423
  # "projects/api-test-project".
@@ -5,6 +5,7 @@
5
5
  require 'google/protobuf'
6
6
 
7
7
  require 'google/api/annotations_pb'
8
+ require 'google/api/client_pb'
8
9
  require 'google/cloud/talent/v4beta1/common_pb'
9
10
  require 'google/cloud/talent/v4beta1/tenant_pb'
10
11
  require 'google/protobuf/empty_pb'
@@ -0,0 +1,22 @@
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
+
16
+ module Google
17
+ module Cloud
18
+ module Talent
19
+ VERSION = "0.4.0".freeze
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-talent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-10 00:00:00.000000000 Z
11
+ date: 2019-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '1.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -138,14 +138,16 @@ files:
138
138
  - lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb
139
139
  - lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb
140
140
  - lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb
141
- - lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/resume_service.rb
142
141
  - lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb
143
142
  - lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb
143
+ - lib/google/cloud/talent/v4beta1/doc/google/longrunning/operations.rb
144
+ - lib/google/cloud/talent/v4beta1/doc/google/protobuf/any.rb
144
145
  - lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb
145
146
  - lib/google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb
146
147
  - lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb
147
148
  - lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb
148
149
  - lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb
150
+ - lib/google/cloud/talent/v4beta1/doc/google/rpc/status.rb
149
151
  - lib/google/cloud/talent/v4beta1/doc/google/type/date.rb
150
152
  - lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb
151
153
  - lib/google/cloud/talent/v4beta1/doc/google/type/money.rb
@@ -169,15 +171,12 @@ files:
169
171
  - lib/google/cloud/talent/v4beta1/profile_service_client_config.json
170
172
  - lib/google/cloud/talent/v4beta1/profile_service_pb.rb
171
173
  - lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb
172
- - lib/google/cloud/talent/v4beta1/resume_service_client.rb
173
- - lib/google/cloud/talent/v4beta1/resume_service_client_config.json
174
- - lib/google/cloud/talent/v4beta1/resume_service_pb.rb
175
- - lib/google/cloud/talent/v4beta1/resume_service_services_pb.rb
176
174
  - lib/google/cloud/talent/v4beta1/tenant_pb.rb
177
175
  - lib/google/cloud/talent/v4beta1/tenant_service_client.rb
178
176
  - lib/google/cloud/talent/v4beta1/tenant_service_client_config.json
179
177
  - lib/google/cloud/talent/v4beta1/tenant_service_pb.rb
180
178
  - lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb
179
+ - lib/google/cloud/talent/version.rb
181
180
  homepage: https://github.com/googleapis/googleapis
182
181
  licenses:
183
182
  - Apache-2.0
@@ -1,98 +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
-
16
- module Google
17
- module Cloud
18
- module Talent
19
- module V4beta1
20
- # Parse resume request.
21
- # @!attribute [rw] parent
22
- # @return [String]
23
- # Required.
24
- #
25
- # The resource name of the project.
26
- #
27
- # The format is "projects/{project_id}", for example,
28
- # "projects/api-test-project".
29
- # @!attribute [rw] resume
30
- # @return [String]
31
- # Required.
32
- #
33
- # The bytes of the resume file in common format, for example, PDF, TXT.
34
- # UTF-8 encoding is required if the resume is text-based, otherwise an error
35
- # is thrown.
36
- # @!attribute [rw] region_code
37
- # @return [String]
38
- # Optional.
39
- #
40
- # The region code indicating where the resume is from. Values
41
- # are as per the ISO-3166-2 format. For example, US, FR, DE.
42
- #
43
- # This value is optional, but providing this value improves the resume
44
- # parsing quality and performance.
45
- #
46
- # An error is thrown if the regionCode is invalid.
47
- # @!attribute [rw] language_code
48
- # @return [String]
49
- # Optional.
50
- #
51
- # The language code of contents in the resume.
52
- #
53
- # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn".
54
- # For more information, see
55
- # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){:
56
- # class="external" target="_blank" }.
57
- # @!attribute [rw] options
58
- # @return [Google::Cloud::Talent::V4beta1::ParseResumeOptions]
59
- # Optional.
60
- #
61
- # Options that change how the resume parse is performed.
62
- class ParseResumeRequest; end
63
-
64
- # Options that change how the resume parse is performed.
65
- # @!attribute [rw] enable_ocr
66
- # @return [true, false]
67
- # Optional.
68
- #
69
- # Controls whether Optical Character Recognition (OCR) is enabled.
70
- #
71
- # OCR is used to decipher pictorial resumes, or resumes that have some
72
- # element of pictorial detail (for example, contact information placed within
73
- # an image in a pdf). Note that the API call has a higher latency if OCR is
74
- # enabled.
75
- # @!attribute [rw] enable_full_skill_detection
76
- # @return [true, false]
77
- # Optional.
78
- #
79
- # Controls whether detected skills are included in the parsed profile from
80
- # sections of the resume other than just skills sections.
81
- #
82
- # Normally, returned skills are limited to those taken from a resume section
83
- # intended to list skills. When enabled, this feature causes detected
84
- # skills in other sections to also be included in the returned profile.
85
- class ParseResumeOptions; end
86
-
87
- # Parse resume response.
88
- # @!attribute [rw] profile
89
- # @return [Google::Cloud::Talent::V4beta1::Profile]
90
- # The profile parsed from resume.
91
- # @!attribute [rw] raw_text
92
- # @return [String]
93
- # Raw text from resume.
94
- class ParseResumeResponse; end
95
- end
96
- end
97
- end
98
- end
@@ -1,296 +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/resume_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/resume_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 resume parsing.
36
- #
37
- # @!attribute [r] resume_service_stub
38
- # @return [Google::Cloud::Talent::V4beta1::ResumeService::Stub]
39
- class ResumeServiceClient
40
- # @private
41
- attr_reader :resume_service_stub
42
-
43
- # The default address of the service.
44
- SERVICE_ADDRESS = "jobs.googleapis.com".freeze
45
-
46
- # The default port of the service.
47
- DEFAULT_SERVICE_PORT = 443
48
-
49
- # The default set of gRPC interceptors.
50
- GRPC_INTERCEPTORS = []
51
-
52
- DEFAULT_TIMEOUT = 30
53
-
54
- # The scopes needed to make gRPC calls to all of the methods defined in
55
- # this service.
56
- ALL_SCOPES = [
57
- "https://www.googleapis.com/auth/cloud-platform",
58
- "https://www.googleapis.com/auth/jobs"
59
- ].freeze
60
-
61
-
62
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
63
- "projects/{project}"
64
- )
65
-
66
- private_constant :PROJECT_PATH_TEMPLATE
67
-
68
- # Returns a fully-qualified project resource name string.
69
- # @param project [String]
70
- # @return [String]
71
- def self.project_path project
72
- PROJECT_PATH_TEMPLATE.render(
73
- :"project" => project
74
- )
75
- end
76
-
77
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
78
- # Provides the means for authenticating requests made by the client. This parameter can
79
- # be many types.
80
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
81
- # authenticating requests made by this client.
82
- # A `String` will be treated as the path to the keyfile to be used for the construction of
83
- # credentials for this client.
84
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
85
- # credentials for this client.
86
- # A `GRPC::Core::Channel` will be used to make calls through.
87
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
88
- # should already be composed with a `GRPC::Core::CallCredentials` object.
89
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
90
- # metadata for requests, generally, to give OAuth credentials.
91
- # @param scopes [Array<String>]
92
- # The OAuth scopes for this service. This parameter is ignored if
93
- # an updater_proc is supplied.
94
- # @param client_config [Hash]
95
- # A Hash for call options for each method. See
96
- # Google::Gax#construct_settings for the structure of
97
- # this data. Falls back to the default config if not specified
98
- # or the specified config is missing data points.
99
- # @param timeout [Numeric]
100
- # The default timeout, in seconds, for calls made through this client.
101
- # @param metadata [Hash]
102
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
103
- # @param exception_transformer [Proc]
104
- # An optional proc that intercepts any exceptions raised during an API call to inject
105
- # custom error handling.
106
- def initialize \
107
- credentials: nil,
108
- scopes: ALL_SCOPES,
109
- client_config: {},
110
- timeout: DEFAULT_TIMEOUT,
111
- metadata: nil,
112
- exception_transformer: nil,
113
- lib_name: nil,
114
- lib_version: ""
115
- # These require statements are intentionally placed here to initialize
116
- # the gRPC module only when it's required.
117
- # See https://github.com/googleapis/toolkit/issues/446
118
- require "google/gax/grpc"
119
- require "google/cloud/talent/v4beta1/resume_service_services_pb"
120
-
121
- credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
122
-
123
- if credentials.is_a?(String) || credentials.is_a?(Hash)
124
- updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
125
- end
126
- if credentials.is_a?(GRPC::Core::Channel)
127
- channel = credentials
128
- end
129
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
130
- chan_creds = credentials
131
- end
132
- if credentials.is_a?(Proc)
133
- updater_proc = credentials
134
- end
135
- if credentials.is_a?(Google::Auth::Credentials)
136
- updater_proc = credentials.updater_proc
137
- end
138
-
139
- package_version = Gem.loaded_specs['google-cloud-talent'].version.version
140
-
141
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
142
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
143
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
144
- google_api_client << " grpc/#{GRPC::VERSION}"
145
- google_api_client.freeze
146
-
147
- headers = { :"x-goog-api-client" => google_api_client }
148
- headers.merge!(metadata) unless metadata.nil?
149
- client_config_file = Pathname.new(__dir__).join(
150
- "resume_service_client_config.json"
151
- )
152
- defaults = client_config_file.open do |f|
153
- Google::Gax.construct_settings(
154
- "google.cloud.talent.v4beta1.ResumeService",
155
- JSON.parse(f.read),
156
- client_config,
157
- Google::Gax::Grpc::STATUS_CODE_NAMES,
158
- timeout,
159
- errors: Google::Gax::Grpc::API_ERRORS,
160
- metadata: headers
161
- )
162
- end
163
-
164
- # Allow overriding the service path/port in subclasses.
165
- service_path = self.class::SERVICE_ADDRESS
166
- port = self.class::DEFAULT_SERVICE_PORT
167
- interceptors = self.class::GRPC_INTERCEPTORS
168
- @resume_service_stub = Google::Gax::Grpc.create_stub(
169
- service_path,
170
- port,
171
- chan_creds: chan_creds,
172
- channel: channel,
173
- updater_proc: updater_proc,
174
- scopes: scopes,
175
- interceptors: interceptors,
176
- &Google::Cloud::Talent::V4beta1::ResumeService::Stub.method(:new)
177
- )
178
-
179
- @parse_resume = Google::Gax.create_api_call(
180
- @resume_service_stub.method(:parse_resume),
181
- defaults["parse_resume"],
182
- exception_transformer: exception_transformer
183
- )
184
- end
185
-
186
- # Service calls
187
-
188
- # Parses a resume into a {Google::Cloud::Talent::V4beta1::Profile Profile}. The
189
- # API attempts to fill out the following profile fields if present within the
190
- # resume:
191
- #
192
- # * personNames
193
- # * addresses
194
- # * emailAddress
195
- # * phoneNumbers
196
- # * personalUris
197
- # * employmentRecords
198
- # * educationRecords
199
- # * skills
200
- #
201
- # Note that some attributes in these fields may not be populated if they're
202
- # not present within the resume or unrecognizable by the resume parser.
203
- #
204
- # This API does not save the resume or profile. To create a profile from this
205
- # resume, clients need to call the CreateProfile method again with the
206
- # profile returned.
207
- #
208
- # The following list of formats are supported:
209
- #
210
- # * PDF
211
- # * TXT
212
- # * DOC
213
- # * RTF
214
- # * DOCX
215
- # * PNG (only when {ParseResumeRequest#enable_ocr} is set to `true`,
216
- # otherwise an error is thrown)
217
- #
218
- # @param parent [String]
219
- # Required.
220
- #
221
- # The resource name of the project.
222
- #
223
- # The format is "projects/{project_id}", for example,
224
- # "projects/api-test-project".
225
- # @param resume [String]
226
- # Required.
227
- #
228
- # The bytes of the resume file in common format, for example, PDF, TXT.
229
- # UTF-8 encoding is required if the resume is text-based, otherwise an error
230
- # is thrown.
231
- # @param region_code [String]
232
- # Optional.
233
- #
234
- # The region code indicating where the resume is from. Values
235
- # are as per the ISO-3166-2 format. For example, US, FR, DE.
236
- #
237
- # This value is optional, but providing this value improves the resume
238
- # parsing quality and performance.
239
- #
240
- # An error is thrown if the regionCode is invalid.
241
- # @param language_code [String]
242
- # Optional.
243
- #
244
- # The language code of contents in the resume.
245
- #
246
- # Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn".
247
- # For more information, see
248
- # [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){:
249
- # class="external" target="_blank" }.
250
- # @param options_ [Google::Cloud::Talent::V4beta1::ParseResumeOptions | Hash]
251
- # Optional.
252
- #
253
- # Options that change how the resume parse is performed.
254
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::ParseResumeOptions`
255
- # can also be provided.
256
- # @param options [Google::Gax::CallOptions]
257
- # Overrides the default settings for this call, e.g, timeout,
258
- # retries, etc.
259
- # @yield [result, operation] Access the result along with the RPC operation
260
- # @yieldparam result [Google::Cloud::Talent::V4beta1::ParseResumeResponse]
261
- # @yieldparam operation [GRPC::ActiveCall::Operation]
262
- # @return [Google::Cloud::Talent::V4beta1::ParseResumeResponse]
263
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
264
- # @example
265
- # require "google/cloud/talent"
266
- #
267
- # resume_client = Google::Cloud::Talent::Resume.new(version: :v4beta1)
268
- # formatted_parent = Google::Cloud::Talent::V4beta1::ResumeServiceClient.project_path("[PROJECT]")
269
- #
270
- # # TODO: Initialize `resume`:
271
- # resume = ''
272
- # response = resume_client.parse_resume(formatted_parent, resume)
273
-
274
- def parse_resume \
275
- parent,
276
- resume,
277
- region_code: nil,
278
- language_code: nil,
279
- options_: nil,
280
- options: nil,
281
- &block
282
- req = {
283
- parent: parent,
284
- resume: resume,
285
- region_code: region_code,
286
- language_code: language_code,
287
- options: options_
288
- }.delete_if { |_, v| v.nil? }
289
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ParseResumeRequest)
290
- @parse_resume.call(req, options, &block)
291
- end
292
- end
293
- end
294
- end
295
- end
296
- end