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,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"interfaces": {
|
|
3
|
+
"google.cloud.talent.v4beta1.CompanyService": {
|
|
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
|
+
"CreateCompany": {
|
|
24
|
+
"timeout_millis": 30000,
|
|
25
|
+
"retry_codes_name": "non_idempotent",
|
|
26
|
+
"retry_params_name": "default"
|
|
27
|
+
},
|
|
28
|
+
"GetCompany": {
|
|
29
|
+
"timeout_millis": 30000,
|
|
30
|
+
"retry_codes_name": "idempotent",
|
|
31
|
+
"retry_params_name": "default"
|
|
32
|
+
},
|
|
33
|
+
"UpdateCompany": {
|
|
34
|
+
"timeout_millis": 30000,
|
|
35
|
+
"retry_codes_name": "non_idempotent",
|
|
36
|
+
"retry_params_name": "default"
|
|
37
|
+
},
|
|
38
|
+
"DeleteCompany": {
|
|
39
|
+
"timeout_millis": 30000,
|
|
40
|
+
"retry_codes_name": "idempotent",
|
|
41
|
+
"retry_params_name": "default"
|
|
42
|
+
},
|
|
43
|
+
"ListCompanies": {
|
|
44
|
+
"timeout_millis": 30000,
|
|
45
|
+
"retry_codes_name": "idempotent",
|
|
46
|
+
"retry_params_name": "default"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# source: google/cloud/talent/v4beta1/company_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/company_pb'
|
|
10
|
+
require 'google/protobuf/empty_pb'
|
|
11
|
+
require 'google/protobuf/field_mask_pb'
|
|
12
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
13
|
+
add_message "google.cloud.talent.v4beta1.CreateCompanyRequest" do
|
|
14
|
+
optional :parent, :string, 1
|
|
15
|
+
optional :company, :message, 2, "google.cloud.talent.v4beta1.Company"
|
|
16
|
+
end
|
|
17
|
+
add_message "google.cloud.talent.v4beta1.GetCompanyRequest" do
|
|
18
|
+
optional :name, :string, 1
|
|
19
|
+
end
|
|
20
|
+
add_message "google.cloud.talent.v4beta1.UpdateCompanyRequest" do
|
|
21
|
+
optional :company, :message, 1, "google.cloud.talent.v4beta1.Company"
|
|
22
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
|
23
|
+
end
|
|
24
|
+
add_message "google.cloud.talent.v4beta1.DeleteCompanyRequest" do
|
|
25
|
+
optional :name, :string, 1
|
|
26
|
+
end
|
|
27
|
+
add_message "google.cloud.talent.v4beta1.ListCompaniesRequest" do
|
|
28
|
+
optional :parent, :string, 1
|
|
29
|
+
optional :page_token, :string, 2
|
|
30
|
+
optional :page_size, :int32, 3
|
|
31
|
+
optional :require_open_jobs, :bool, 4
|
|
32
|
+
end
|
|
33
|
+
add_message "google.cloud.talent.v4beta1.ListCompaniesResponse" do
|
|
34
|
+
repeated :companies, :message, 1, "google.cloud.talent.v4beta1.Company"
|
|
35
|
+
optional :next_page_token, :string, 2
|
|
36
|
+
optional :metadata, :message, 3, "google.cloud.talent.v4beta1.ResponseMetadata"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
module Google
|
|
41
|
+
module Cloud
|
|
42
|
+
module Talent
|
|
43
|
+
module V4beta1
|
|
44
|
+
CreateCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateCompanyRequest").msgclass
|
|
45
|
+
GetCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetCompanyRequest").msgclass
|
|
46
|
+
UpdateCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateCompanyRequest").msgclass
|
|
47
|
+
DeleteCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteCompanyRequest").msgclass
|
|
48
|
+
ListCompaniesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesRequest").msgclass
|
|
49
|
+
ListCompaniesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesResponse").msgclass
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# Source: google/cloud/talent/v4beta1/company_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/company_service_pb'
|
|
23
|
+
|
|
24
|
+
module Google
|
|
25
|
+
module Cloud
|
|
26
|
+
module Talent
|
|
27
|
+
module V4beta1
|
|
28
|
+
module CompanyService
|
|
29
|
+
# A service that handles company management, including CRUD and enumeration.
|
|
30
|
+
class Service
|
|
31
|
+
|
|
32
|
+
include GRPC::GenericService
|
|
33
|
+
|
|
34
|
+
self.marshal_class_method = :encode
|
|
35
|
+
self.unmarshal_class_method = :decode
|
|
36
|
+
self.service_name = 'google.cloud.talent.v4beta1.CompanyService'
|
|
37
|
+
|
|
38
|
+
# Creates a new company entity.
|
|
39
|
+
rpc :CreateCompany, CreateCompanyRequest, Company
|
|
40
|
+
# Retrieves specified company.
|
|
41
|
+
rpc :GetCompany, GetCompanyRequest, Company
|
|
42
|
+
# Updates specified company.
|
|
43
|
+
rpc :UpdateCompany, UpdateCompanyRequest, Company
|
|
44
|
+
# Deletes specified company.
|
|
45
|
+
# Prerequisite: The company has no jobs associated with it.
|
|
46
|
+
rpc :DeleteCompany, DeleteCompanyRequest, Google::Protobuf::Empty
|
|
47
|
+
# Lists all companies associated with the project.
|
|
48
|
+
rpc :ListCompanies, ListCompaniesRequest, ListCompaniesResponse
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
Stub = Service.rpc_stub_class
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,303 @@
|
|
|
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/completion_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/completion_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 handles auto completion.
|
|
36
|
+
#
|
|
37
|
+
# @!attribute [r] completion_stub
|
|
38
|
+
# @return [Google::Cloud::Talent::V4beta1::Completion::Stub]
|
|
39
|
+
class CompletionClient
|
|
40
|
+
# @private
|
|
41
|
+
attr_reader :completion_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/completion_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
|
+
"completion_client_config.json"
|
|
151
|
+
)
|
|
152
|
+
defaults = client_config_file.open do |f|
|
|
153
|
+
Google::Gax.construct_settings(
|
|
154
|
+
"google.cloud.talent.v4beta1.Completion",
|
|
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
|
+
@completion_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::Completion::Stub.method(:new)
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
@complete_query = Google::Gax.create_api_call(
|
|
180
|
+
@completion_stub.method(:complete_query),
|
|
181
|
+
defaults["complete_query"],
|
|
182
|
+
exception_transformer: exception_transformer
|
|
183
|
+
)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Service calls
|
|
187
|
+
|
|
188
|
+
# Completes the specified prefix with keyword suggestions.
|
|
189
|
+
# Intended for use by a job search auto-complete search box.
|
|
190
|
+
#
|
|
191
|
+
# @param name [String]
|
|
192
|
+
# Required.
|
|
193
|
+
#
|
|
194
|
+
# Resource name of project the completion is performed within.
|
|
195
|
+
#
|
|
196
|
+
# The format is "projects/{project_id}", for example,
|
|
197
|
+
# "projects/api-test-project".
|
|
198
|
+
# @param query [String]
|
|
199
|
+
# Required.
|
|
200
|
+
#
|
|
201
|
+
# The query used to generate suggestions.
|
|
202
|
+
#
|
|
203
|
+
# The maximum number of allowed characters is 255.
|
|
204
|
+
# @param page_size [Integer]
|
|
205
|
+
# Required.
|
|
206
|
+
#
|
|
207
|
+
# Completion result count.
|
|
208
|
+
#
|
|
209
|
+
# The maximum allowed page size is 10.
|
|
210
|
+
# @param language_codes [Array<String>]
|
|
211
|
+
# Optional.
|
|
212
|
+
#
|
|
213
|
+
# The list of languages of the query. This is
|
|
214
|
+
# the BCP-47 language code, such as "en-US" or "sr-Latn".
|
|
215
|
+
# For more information, see
|
|
216
|
+
# [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47).
|
|
217
|
+
#
|
|
218
|
+
# For
|
|
219
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::JOB_TITLE CompletionType::JOB_TITLE}
|
|
220
|
+
# type, only open jobs with the same
|
|
221
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes}
|
|
222
|
+
# are returned.
|
|
223
|
+
#
|
|
224
|
+
# For
|
|
225
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMPANY_NAME CompletionType::COMPANY_NAME}
|
|
226
|
+
# type, only companies having open jobs with the same
|
|
227
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes}
|
|
228
|
+
# are returned.
|
|
229
|
+
#
|
|
230
|
+
# For
|
|
231
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType::COMBINED}
|
|
232
|
+
# type, only open jobs with the same
|
|
233
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes}
|
|
234
|
+
# or companies having open jobs with the same
|
|
235
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest#language_codes language_codes}
|
|
236
|
+
# are returned.
|
|
237
|
+
#
|
|
238
|
+
# The maximum number of allowed characters is 255.
|
|
239
|
+
# @param company_name [String]
|
|
240
|
+
# Optional.
|
|
241
|
+
#
|
|
242
|
+
# If provided, restricts completion to specified company.
|
|
243
|
+
#
|
|
244
|
+
# The format is "projects/{project_id}/companies/{company_id}", for example,
|
|
245
|
+
# "projects/api-test-project/companies/foo".
|
|
246
|
+
# @param scope [Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope]
|
|
247
|
+
# Optional.
|
|
248
|
+
#
|
|
249
|
+
# The scope of the completion. The defaults is
|
|
250
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope::PUBLIC}.
|
|
251
|
+
# @param type [Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType]
|
|
252
|
+
# Optional.
|
|
253
|
+
#
|
|
254
|
+
# The completion topic. The default is
|
|
255
|
+
# {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType::COMBINED}.
|
|
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::CompleteQueryResponse]
|
|
261
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
|
262
|
+
# @return [Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
|
|
263
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
|
264
|
+
# @example
|
|
265
|
+
# require "google/cloud/talent"
|
|
266
|
+
#
|
|
267
|
+
# completion_client = Google::Cloud::Talent::Completion.new(version: :v4beta1)
|
|
268
|
+
# formatted_name = Google::Cloud::Talent::V4beta1::CompletionClient.project_path("[PROJECT]")
|
|
269
|
+
#
|
|
270
|
+
# # TODO: Initialize `query`:
|
|
271
|
+
# query = ''
|
|
272
|
+
#
|
|
273
|
+
# # TODO: Initialize `page_size`:
|
|
274
|
+
# page_size = 0
|
|
275
|
+
# response = completion_client.complete_query(formatted_name, query, page_size)
|
|
276
|
+
|
|
277
|
+
def complete_query \
|
|
278
|
+
name,
|
|
279
|
+
query,
|
|
280
|
+
page_size,
|
|
281
|
+
language_codes: nil,
|
|
282
|
+
company_name: nil,
|
|
283
|
+
scope: nil,
|
|
284
|
+
type: nil,
|
|
285
|
+
options: nil,
|
|
286
|
+
&block
|
|
287
|
+
req = {
|
|
288
|
+
name: name,
|
|
289
|
+
query: query,
|
|
290
|
+
page_size: page_size,
|
|
291
|
+
language_codes: language_codes,
|
|
292
|
+
company_name: company_name,
|
|
293
|
+
scope: scope,
|
|
294
|
+
type: type
|
|
295
|
+
}.delete_if { |_, v| v.nil? }
|
|
296
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CompleteQueryRequest)
|
|
297
|
+
@complete_query.call(req, options, &block)
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
end
|