google-cloud-talent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +9 -0
- data/LICENSE +201 -0
- data/README.md +69 -0
- data/lib/google/cloud/talent.rb +456 -0
- data/lib/google/cloud/talent/v4beta1.rb +484 -0
- data/lib/google/cloud/talent/v4beta1/batch_pb.rb +21 -0
- data/lib/google/cloud/talent/v4beta1/common_pb.rb +264 -0
- data/lib/google/cloud/talent/v4beta1/company_pb.rb +39 -0
- data/lib/google/cloud/talent/v4beta1/company_service_client.rb +479 -0
- data/lib/google/cloud/talent/v4beta1/company_service_client_config.json +51 -0
- data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +56 -0
- data/lib/google/cloud/talent/v4beta1/completion_client.rb +303 -0
- data/lib/google/cloud/talent/v4beta1/completion_client_config.json +31 -0
- data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +48 -0
- data/lib/google/cloud/talent/v4beta1/credentials.rb +42 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +890 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +125 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +130 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +153 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +252 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +34 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +853 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +56 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +409 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +732 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +1125 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +392 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/resume_service.rb +98 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +68 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +119 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb +91 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb +29 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb +230 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb +109 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb +34 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/date.rb +39 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb +65 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/money.rb +36 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +126 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/timeofday.rb +38 -0
- data/lib/google/cloud/talent/v4beta1/event_pb.rb +75 -0
- data/lib/google/cloud/talent/v4beta1/event_service_client.rb +239 -0
- data/lib/google/cloud/talent/v4beta1/event_service_client_config.json +31 -0
- data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +24 -0
- data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/filters_pb.rb +182 -0
- data/lib/google/cloud/talent/v4beta1/helpers.rb +90 -0
- data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +28 -0
- data/lib/google/cloud/talent/v4beta1/job_pb.rb +69 -0
- data/lib/google/cloud/talent/v4beta1/job_service_client.rb +1295 -0
- data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +66 -0
- data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +142 -0
- data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +88 -0
- data/lib/google/cloud/talent/v4beta1/profile_pb.rb +249 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +757 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_client_config.json +56 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +81 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +65 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_client.rb +296 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_client_config.json +31 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_pb.rb +37 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_services_pb.rb +75 -0
- data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +31 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +466 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_client_config.json +51 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +55 -0
- metadata +197 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"interfaces": {
|
|
3
|
+
"google.cloud.talent.v4beta1.ProfileService": {
|
|
4
|
+
"retry_codes": {
|
|
5
|
+
"idempotent": [
|
|
6
|
+
"DEADLINE_EXCEEDED",
|
|
7
|
+
"UNAVAILABLE"
|
|
8
|
+
],
|
|
9
|
+
"non_idempotent": []
|
|
10
|
+
},
|
|
11
|
+
"retry_params": {
|
|
12
|
+
"default": {
|
|
13
|
+
"initial_retry_delay_millis": 100,
|
|
14
|
+
"retry_delay_multiplier": 1.3,
|
|
15
|
+
"max_retry_delay_millis": 60000,
|
|
16
|
+
"initial_rpc_timeout_millis": 20000,
|
|
17
|
+
"rpc_timeout_multiplier": 1.0,
|
|
18
|
+
"max_rpc_timeout_millis": 20000,
|
|
19
|
+
"total_timeout_millis": 600000
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"methods": {
|
|
23
|
+
"ListProfiles": {
|
|
24
|
+
"timeout_millis": 30000,
|
|
25
|
+
"retry_codes_name": "idempotent",
|
|
26
|
+
"retry_params_name": "default"
|
|
27
|
+
},
|
|
28
|
+
"CreateProfile": {
|
|
29
|
+
"timeout_millis": 30000,
|
|
30
|
+
"retry_codes_name": "non_idempotent",
|
|
31
|
+
"retry_params_name": "default"
|
|
32
|
+
},
|
|
33
|
+
"GetProfile": {
|
|
34
|
+
"timeout_millis": 30000,
|
|
35
|
+
"retry_codes_name": "idempotent",
|
|
36
|
+
"retry_params_name": "default"
|
|
37
|
+
},
|
|
38
|
+
"UpdateProfile": {
|
|
39
|
+
"timeout_millis": 30000,
|
|
40
|
+
"retry_codes_name": "non_idempotent",
|
|
41
|
+
"retry_params_name": "default"
|
|
42
|
+
},
|
|
43
|
+
"DeleteProfile": {
|
|
44
|
+
"timeout_millis": 30000,
|
|
45
|
+
"retry_codes_name": "idempotent",
|
|
46
|
+
"retry_params_name": "default"
|
|
47
|
+
},
|
|
48
|
+
"SearchProfiles": {
|
|
49
|
+
"timeout_millis": 30000,
|
|
50
|
+
"retry_codes_name": "non_idempotent",
|
|
51
|
+
"retry_params_name": "default"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# source: google/cloud/talent/v4beta1/profile_service.proto
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
require 'google/protobuf'
|
|
6
|
+
|
|
7
|
+
require 'google/api/annotations_pb'
|
|
8
|
+
require 'google/cloud/talent/v4beta1/common_pb'
|
|
9
|
+
require 'google/cloud/talent/v4beta1/filters_pb'
|
|
10
|
+
require 'google/cloud/talent/v4beta1/histogram_pb'
|
|
11
|
+
require 'google/cloud/talent/v4beta1/profile_pb'
|
|
12
|
+
require 'google/protobuf/empty_pb'
|
|
13
|
+
require 'google/protobuf/field_mask_pb'
|
|
14
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
15
|
+
add_message "google.cloud.talent.v4beta1.ListProfilesRequest" do
|
|
16
|
+
optional :parent, :string, 1
|
|
17
|
+
optional :page_token, :string, 2
|
|
18
|
+
optional :page_size, :int32, 3
|
|
19
|
+
optional :field_mask, :message, 4, "google.protobuf.FieldMask"
|
|
20
|
+
end
|
|
21
|
+
add_message "google.cloud.talent.v4beta1.ListProfilesResponse" do
|
|
22
|
+
repeated :profiles, :message, 1, "google.cloud.talent.v4beta1.Profile"
|
|
23
|
+
optional :next_page_token, :string, 2
|
|
24
|
+
end
|
|
25
|
+
add_message "google.cloud.talent.v4beta1.CreateProfileRequest" do
|
|
26
|
+
optional :parent, :string, 1
|
|
27
|
+
optional :profile, :message, 2, "google.cloud.talent.v4beta1.Profile"
|
|
28
|
+
end
|
|
29
|
+
add_message "google.cloud.talent.v4beta1.GetProfileRequest" do
|
|
30
|
+
optional :name, :string, 1
|
|
31
|
+
end
|
|
32
|
+
add_message "google.cloud.talent.v4beta1.UpdateProfileRequest" do
|
|
33
|
+
optional :profile, :message, 1, "google.cloud.talent.v4beta1.Profile"
|
|
34
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
|
35
|
+
end
|
|
36
|
+
add_message "google.cloud.talent.v4beta1.DeleteProfileRequest" do
|
|
37
|
+
optional :name, :string, 1
|
|
38
|
+
end
|
|
39
|
+
add_message "google.cloud.talent.v4beta1.SearchProfilesRequest" do
|
|
40
|
+
optional :parent, :string, 1
|
|
41
|
+
optional :request_metadata, :message, 2, "google.cloud.talent.v4beta1.RequestMetadata"
|
|
42
|
+
optional :profile_query, :message, 3, "google.cloud.talent.v4beta1.ProfileQuery"
|
|
43
|
+
optional :page_size, :int32, 4
|
|
44
|
+
optional :page_token, :string, 5
|
|
45
|
+
optional :offset, :int32, 6
|
|
46
|
+
optional :disable_spell_check, :bool, 7
|
|
47
|
+
optional :order_by, :string, 8
|
|
48
|
+
optional :case_sensitive_sort, :bool, 9
|
|
49
|
+
repeated :histogram_queries, :message, 10, "google.cloud.talent.v4beta1.HistogramQuery"
|
|
50
|
+
end
|
|
51
|
+
add_message "google.cloud.talent.v4beta1.SearchProfilesResponse" do
|
|
52
|
+
optional :estimated_total_size, :int64, 1
|
|
53
|
+
optional :spell_correction, :message, 2, "google.cloud.talent.v4beta1.SpellingCorrection"
|
|
54
|
+
optional :metadata, :message, 3, "google.cloud.talent.v4beta1.ResponseMetadata"
|
|
55
|
+
optional :next_page_token, :string, 4
|
|
56
|
+
repeated :histogram_query_results, :message, 5, "google.cloud.talent.v4beta1.HistogramQueryResult"
|
|
57
|
+
repeated :summarized_profiles, :message, 6, "google.cloud.talent.v4beta1.SummarizedProfile"
|
|
58
|
+
end
|
|
59
|
+
add_message "google.cloud.talent.v4beta1.SummarizedProfile" do
|
|
60
|
+
repeated :profiles, :message, 1, "google.cloud.talent.v4beta1.Profile"
|
|
61
|
+
optional :summary, :message, 2, "google.cloud.talent.v4beta1.Profile"
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
module Google
|
|
66
|
+
module Cloud
|
|
67
|
+
module Talent
|
|
68
|
+
module V4beta1
|
|
69
|
+
ListProfilesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListProfilesRequest").msgclass
|
|
70
|
+
ListProfilesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListProfilesResponse").msgclass
|
|
71
|
+
CreateProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateProfileRequest").msgclass
|
|
72
|
+
GetProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetProfileRequest").msgclass
|
|
73
|
+
UpdateProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateProfileRequest").msgclass
|
|
74
|
+
DeleteProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteProfileRequest").msgclass
|
|
75
|
+
SearchProfilesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchProfilesRequest").msgclass
|
|
76
|
+
SearchProfilesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchProfilesResponse").msgclass
|
|
77
|
+
SummarizedProfile = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SummarizedProfile").msgclass
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# Source: google/cloud/talent/v4beta1/profile_service.proto for package 'google.cloud.talent.v4beta1'
|
|
3
|
+
# Original file comments:
|
|
4
|
+
# Copyright 2019 Google LLC.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
require 'grpc'
|
|
22
|
+
require 'google/cloud/talent/v4beta1/profile_service_pb'
|
|
23
|
+
|
|
24
|
+
module Google
|
|
25
|
+
module Cloud
|
|
26
|
+
module Talent
|
|
27
|
+
module V4beta1
|
|
28
|
+
module ProfileService
|
|
29
|
+
# A service that handles profile management, including profile CRUD,
|
|
30
|
+
# enumeration and search.
|
|
31
|
+
class Service
|
|
32
|
+
|
|
33
|
+
include GRPC::GenericService
|
|
34
|
+
|
|
35
|
+
self.marshal_class_method = :encode
|
|
36
|
+
self.unmarshal_class_method = :decode
|
|
37
|
+
self.service_name = 'google.cloud.talent.v4beta1.ProfileService'
|
|
38
|
+
|
|
39
|
+
# Lists profiles by filter. The order is unspecified.
|
|
40
|
+
rpc :ListProfiles, ListProfilesRequest, ListProfilesResponse
|
|
41
|
+
# Creates and returns a new profile.
|
|
42
|
+
rpc :CreateProfile, CreateProfileRequest, Profile
|
|
43
|
+
# Gets the specified profile.
|
|
44
|
+
rpc :GetProfile, GetProfileRequest, Profile
|
|
45
|
+
# Updates the specified profile and returns the updated result.
|
|
46
|
+
rpc :UpdateProfile, UpdateProfileRequest, Profile
|
|
47
|
+
# Deletes the specified profile.
|
|
48
|
+
rpc :DeleteProfile, DeleteProfileRequest, Google::Protobuf::Empty
|
|
49
|
+
# Searches for profiles within a tenant.
|
|
50
|
+
#
|
|
51
|
+
# For example, search by raw queries "software engineer in Mountain View" or
|
|
52
|
+
# search by structured filters (location filter, education filter, etc.).
|
|
53
|
+
#
|
|
54
|
+
# See
|
|
55
|
+
# [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest]
|
|
56
|
+
# for more information.
|
|
57
|
+
rpc :SearchProfiles, SearchProfilesRequest, SearchProfilesResponse
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
Stub = Service.rpc_stub_class
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,296 @@
|
|
|
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_service_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_service_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
|