google-cloud-talent 0.10.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +347 -0
- data/README.md +35 -25
- data/lib/{google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb → google-cloud-talent.rb} +4 -14
- data/lib/google/cloud/talent.rb +253 -441
- data/lib/google/cloud/talent/version.rb +6 -2
- metadata +62 -111
- data/LICENSE +0 -201
- data/lib/google/cloud/talent/v4beta1.rb +0 -543
- data/lib/google/cloud/talent/v4beta1/application_pb.rb +0 -63
- data/lib/google/cloud/talent/v4beta1/application_service_client.rb +0 -527
- data/lib/google/cloud/talent/v4beta1/application_service_client_config.json +0 -51
- data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +0 -55
- data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +0 -55
- data/lib/google/cloud/talent/v4beta1/batch_pb.rb +0 -18
- data/lib/google/cloud/talent/v4beta1/common_pb.rb +0 -341
- data/lib/google/cloud/talent/v4beta1/company_pb.rb +0 -41
- data/lib/google/cloud/talent/v4beta1/company_service_client.rb +0 -536
- data/lib/google/cloud/talent/v4beta1/company_service_client_config.json +0 -51
- data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +0 -56
- data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +0 -55
- data/lib/google/cloud/talent/v4beta1/completion_client.rb +0 -344
- data/lib/google/cloud/talent/v4beta1/completion_client_config.json +0 -31
- data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +0 -56
- data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +0 -47
- data/lib/google/cloud/talent/v4beta1/credentials.rb +0 -42
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application.rb +0 -162
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application_service.rb +0 -100
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +0 -1057
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +0 -107
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +0 -116
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +0 -130
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +0 -224
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +0 -36
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +0 -763
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +0 -50
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +0 -331
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +0 -694
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +0 -750
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +0 -361
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +0 -70
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +0 -96
- data/lib/google/cloud/talent/v4beta1/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb +0 -34
- data/lib/google/cloud/talent/v4beta1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/talent/v4beta1/doc/google/type/date.rb +0 -43
- data/lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb +0 -31
- data/lib/google/cloud/talent/v4beta1/doc/google/type/money.rb +0 -36
- data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +0 -128
- data/lib/google/cloud/talent/v4beta1/doc/google/type/timeofday.rb +0 -37
- data/lib/google/cloud/talent/v4beta1/event_pb.rb +0 -69
- data/lib/google/cloud/talent/v4beta1/event_service_client.rb +0 -271
- data/lib/google/cloud/talent/v4beta1/event_service_client_config.json +0 -31
- data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +0 -27
- data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +0 -52
- data/lib/google/cloud/talent/v4beta1/filters_pb.rb +0 -187
- data/lib/google/cloud/talent/v4beta1/helpers.rb +0 -179
- data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +0 -27
- data/lib/google/cloud/talent/v4beta1/job_pb.rb +0 -72
- data/lib/google/cloud/talent/v4beta1/job_service_client.rb +0 -1521
- data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +0 -76
- data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +0 -166
- data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +0 -87
- data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -213
- data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -765
- data/lib/google/cloud/talent/v4beta1/profile_service_client_config.json +0 -56
- data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +0 -91
- data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +0 -64
- data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -34
- data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -474
- data/lib/google/cloud/talent/v4beta1/tenant_service_client_config.json +0 -51
- data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +0 -55
- data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +0 -54
@@ -1,51 +0,0 @@
|
|
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
|
-
"DeleteCompany": {
|
24
|
-
"timeout_millis": 60000,
|
25
|
-
"retry_codes_name": "idempotent",
|
26
|
-
"retry_params_name": "default"
|
27
|
-
},
|
28
|
-
"CreateCompany": {
|
29
|
-
"timeout_millis": 60000,
|
30
|
-
"retry_codes_name": "non_idempotent",
|
31
|
-
"retry_params_name": "default"
|
32
|
-
},
|
33
|
-
"GetCompany": {
|
34
|
-
"timeout_millis": 60000,
|
35
|
-
"retry_codes_name": "idempotent",
|
36
|
-
"retry_params_name": "default"
|
37
|
-
},
|
38
|
-
"UpdateCompany": {
|
39
|
-
"timeout_millis": 60000,
|
40
|
-
"retry_codes_name": "non_idempotent",
|
41
|
-
"retry_params_name": "default"
|
42
|
-
},
|
43
|
-
"ListCompanies": {
|
44
|
-
"timeout_millis": 60000,
|
45
|
-
"retry_codes_name": "idempotent",
|
46
|
-
"retry_params_name": "default"
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}
|
@@ -1,56 +0,0 @@
|
|
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/api/client_pb'
|
9
|
-
require 'google/api/field_behavior_pb'
|
10
|
-
require 'google/api/resource_pb'
|
11
|
-
require 'google/cloud/talent/v4beta1/common_pb'
|
12
|
-
require 'google/cloud/talent/v4beta1/company_pb'
|
13
|
-
require 'google/protobuf/empty_pb'
|
14
|
-
require 'google/protobuf/field_mask_pb'
|
15
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
16
|
-
add_message "google.cloud.talent.v4beta1.CreateCompanyRequest" do
|
17
|
-
optional :parent, :string, 1
|
18
|
-
optional :company, :message, 2, "google.cloud.talent.v4beta1.Company"
|
19
|
-
end
|
20
|
-
add_message "google.cloud.talent.v4beta1.GetCompanyRequest" do
|
21
|
-
optional :name, :string, 1
|
22
|
-
end
|
23
|
-
add_message "google.cloud.talent.v4beta1.UpdateCompanyRequest" do
|
24
|
-
optional :company, :message, 1, "google.cloud.talent.v4beta1.Company"
|
25
|
-
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
26
|
-
end
|
27
|
-
add_message "google.cloud.talent.v4beta1.DeleteCompanyRequest" do
|
28
|
-
optional :name, :string, 1
|
29
|
-
end
|
30
|
-
add_message "google.cloud.talent.v4beta1.ListCompaniesRequest" do
|
31
|
-
optional :parent, :string, 1
|
32
|
-
optional :page_token, :string, 2
|
33
|
-
optional :page_size, :int32, 3
|
34
|
-
optional :require_open_jobs, :bool, 4
|
35
|
-
end
|
36
|
-
add_message "google.cloud.talent.v4beta1.ListCompaniesResponse" do
|
37
|
-
repeated :companies, :message, 1, "google.cloud.talent.v4beta1.Company"
|
38
|
-
optional :next_page_token, :string, 2
|
39
|
-
optional :metadata, :message, 3, "google.cloud.talent.v4beta1.ResponseMetadata"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
module Google
|
44
|
-
module Cloud
|
45
|
-
module Talent
|
46
|
-
module V4beta1
|
47
|
-
CreateCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateCompanyRequest").msgclass
|
48
|
-
GetCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetCompanyRequest").msgclass
|
49
|
-
UpdateCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateCompanyRequest").msgclass
|
50
|
-
DeleteCompanyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteCompanyRequest").msgclass
|
51
|
-
ListCompaniesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesRequest").msgclass
|
52
|
-
ListCompaniesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListCompaniesResponse").msgclass
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
@@ -1,55 +0,0 @@
|
|
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 2020 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
|
-
require 'grpc'
|
21
|
-
require 'google/cloud/talent/v4beta1/company_service_pb'
|
22
|
-
|
23
|
-
module Google
|
24
|
-
module Cloud
|
25
|
-
module Talent
|
26
|
-
module V4beta1
|
27
|
-
module CompanyService
|
28
|
-
# A service that handles company management, including CRUD and enumeration.
|
29
|
-
class Service
|
30
|
-
|
31
|
-
include GRPC::GenericService
|
32
|
-
|
33
|
-
self.marshal_class_method = :encode
|
34
|
-
self.unmarshal_class_method = :decode
|
35
|
-
self.service_name = 'google.cloud.talent.v4beta1.CompanyService'
|
36
|
-
|
37
|
-
# Creates a new company entity.
|
38
|
-
rpc :CreateCompany, CreateCompanyRequest, Company
|
39
|
-
# Retrieves specified company.
|
40
|
-
rpc :GetCompany, GetCompanyRequest, Company
|
41
|
-
# Updates specified company.
|
42
|
-
rpc :UpdateCompany, UpdateCompanyRequest, Company
|
43
|
-
# Deletes specified company.
|
44
|
-
# Prerequisite: The company has no jobs associated with it.
|
45
|
-
rpc :DeleteCompany, DeleteCompanyRequest, Google::Protobuf::Empty
|
46
|
-
# Lists all companies associated with the project.
|
47
|
-
rpc :ListCompanies, ListCompaniesRequest, ListCompaniesResponse
|
48
|
-
end
|
49
|
-
|
50
|
-
Stub = Service.rpc_stub_class
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,344 +0,0 @@
|
|
1
|
-
# Copyright 2020 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
|
-
require "google/cloud/talent/version"
|
31
|
-
|
32
|
-
module Google
|
33
|
-
module Cloud
|
34
|
-
module Talent
|
35
|
-
module V4beta1
|
36
|
-
# A service handles auto completion.
|
37
|
-
#
|
38
|
-
# @!attribute [r] completion_stub
|
39
|
-
# @return [Google::Cloud::Talent::V4beta1::Completion::Stub]
|
40
|
-
class CompletionClient
|
41
|
-
# @private
|
42
|
-
attr_reader :completion_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
|
-
# The scopes needed to make gRPC calls to all of the methods defined in
|
56
|
-
# this service.
|
57
|
-
ALL_SCOPES = [
|
58
|
-
"https://www.googleapis.com/auth/cloud-platform",
|
59
|
-
"https://www.googleapis.com/auth/jobs"
|
60
|
-
].freeze
|
61
|
-
|
62
|
-
|
63
|
-
COMPANY_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
64
|
-
"projects/{project}/tenants/{tenant}/companies/{company}"
|
65
|
-
)
|
66
|
-
|
67
|
-
private_constant :COMPANY_PATH_TEMPLATE
|
68
|
-
|
69
|
-
COMPANY_WITHOUT_TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
70
|
-
"projects/{project}/companies/{company}"
|
71
|
-
)
|
72
|
-
|
73
|
-
private_constant :COMPANY_WITHOUT_TENANT_PATH_TEMPLATE
|
74
|
-
|
75
|
-
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
76
|
-
"projects/{project}"
|
77
|
-
)
|
78
|
-
|
79
|
-
private_constant :PROJECT_PATH_TEMPLATE
|
80
|
-
|
81
|
-
TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
82
|
-
"projects/{project}/tenants/{tenant}"
|
83
|
-
)
|
84
|
-
|
85
|
-
private_constant :TENANT_PATH_TEMPLATE
|
86
|
-
|
87
|
-
# Returns a fully-qualified company resource name string.
|
88
|
-
# @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
|
89
|
-
# This helper function will be deleted in the next major version.
|
90
|
-
# @param project [String]
|
91
|
-
# @param tenant [String]
|
92
|
-
# @param company [String]
|
93
|
-
# @return [String]
|
94
|
-
def self.company_path project, tenant, company
|
95
|
-
COMPANY_PATH_TEMPLATE.render(
|
96
|
-
:"project" => project,
|
97
|
-
:"tenant" => tenant,
|
98
|
-
:"company" => company
|
99
|
-
)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Returns a fully-qualified company_without_tenant resource name string.
|
103
|
-
# @deprecated Multi-pattern resource names will have unified creation and parsing helper functions.
|
104
|
-
# This helper function will be deleted in the next major version.
|
105
|
-
# @param project [String]
|
106
|
-
# @param company [String]
|
107
|
-
# @return [String]
|
108
|
-
def self.company_without_tenant_path project, company
|
109
|
-
COMPANY_WITHOUT_TENANT_PATH_TEMPLATE.render(
|
110
|
-
:"project" => project,
|
111
|
-
:"company" => company
|
112
|
-
)
|
113
|
-
end
|
114
|
-
|
115
|
-
# Returns a fully-qualified project resource name string.
|
116
|
-
# @param project [String]
|
117
|
-
# @return [String]
|
118
|
-
def self.project_path project
|
119
|
-
PROJECT_PATH_TEMPLATE.render(
|
120
|
-
:"project" => project
|
121
|
-
)
|
122
|
-
end
|
123
|
-
|
124
|
-
# Returns a fully-qualified tenant resource name string.
|
125
|
-
# @param project [String]
|
126
|
-
# @param tenant [String]
|
127
|
-
# @return [String]
|
128
|
-
def self.tenant_path project, tenant
|
129
|
-
TENANT_PATH_TEMPLATE.render(
|
130
|
-
:"project" => project,
|
131
|
-
:"tenant" => tenant
|
132
|
-
)
|
133
|
-
end
|
134
|
-
|
135
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
136
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
137
|
-
# be many types.
|
138
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
139
|
-
# authenticating requests made by this client.
|
140
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
141
|
-
# credentials for this client.
|
142
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
143
|
-
# credentials for this client.
|
144
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
145
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
146
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
147
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
148
|
-
# metadata for requests, generally, to give OAuth credentials.
|
149
|
-
# @param scopes [Array<String>]
|
150
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
151
|
-
# an updater_proc is supplied.
|
152
|
-
# @param client_config [Hash]
|
153
|
-
# A Hash for call options for each method. See
|
154
|
-
# Google::Gax#construct_settings for the structure of
|
155
|
-
# this data. Falls back to the default config if not specified
|
156
|
-
# or the specified config is missing data points.
|
157
|
-
# @param timeout [Numeric]
|
158
|
-
# The default timeout, in seconds, for calls made through this client.
|
159
|
-
# @param metadata [Hash]
|
160
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
161
|
-
# @param service_address [String]
|
162
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
163
|
-
# @param service_port [Integer]
|
164
|
-
# Override for the service port, or `nil` to leave as the default.
|
165
|
-
# @param exception_transformer [Proc]
|
166
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
167
|
-
# custom error handling.
|
168
|
-
def initialize \
|
169
|
-
credentials: nil,
|
170
|
-
scopes: ALL_SCOPES,
|
171
|
-
client_config: {},
|
172
|
-
timeout: DEFAULT_TIMEOUT,
|
173
|
-
metadata: nil,
|
174
|
-
service_address: nil,
|
175
|
-
service_port: nil,
|
176
|
-
exception_transformer: nil,
|
177
|
-
lib_name: nil,
|
178
|
-
lib_version: ""
|
179
|
-
# These require statements are intentionally placed here to initialize
|
180
|
-
# the gRPC module only when it's required.
|
181
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
182
|
-
require "google/gax/grpc"
|
183
|
-
require "google/cloud/talent/v4beta1/completion_service_services_pb"
|
184
|
-
|
185
|
-
credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
|
186
|
-
|
187
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
188
|
-
updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
|
189
|
-
end
|
190
|
-
if credentials.is_a?(GRPC::Core::Channel)
|
191
|
-
channel = credentials
|
192
|
-
end
|
193
|
-
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
194
|
-
chan_creds = credentials
|
195
|
-
end
|
196
|
-
if credentials.is_a?(Proc)
|
197
|
-
updater_proc = credentials
|
198
|
-
end
|
199
|
-
if credentials.is_a?(Google::Auth::Credentials)
|
200
|
-
updater_proc = credentials.updater_proc
|
201
|
-
end
|
202
|
-
|
203
|
-
package_version = Google::Cloud::Talent::VERSION
|
204
|
-
|
205
|
-
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
206
|
-
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
207
|
-
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
208
|
-
google_api_client << " grpc/#{GRPC::VERSION}"
|
209
|
-
google_api_client.freeze
|
210
|
-
|
211
|
-
headers = { :"x-goog-api-client" => google_api_client }
|
212
|
-
if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
|
213
|
-
headers[:"x-goog-user-project"] = credentials.quota_project_id
|
214
|
-
end
|
215
|
-
headers.merge!(metadata) unless metadata.nil?
|
216
|
-
client_config_file = Pathname.new(__dir__).join(
|
217
|
-
"completion_client_config.json"
|
218
|
-
)
|
219
|
-
defaults = client_config_file.open do |f|
|
220
|
-
Google::Gax.construct_settings(
|
221
|
-
"google.cloud.talent.v4beta1.Completion",
|
222
|
-
JSON.parse(f.read),
|
223
|
-
client_config,
|
224
|
-
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
225
|
-
timeout,
|
226
|
-
errors: Google::Gax::Grpc::API_ERRORS,
|
227
|
-
metadata: headers
|
228
|
-
)
|
229
|
-
end
|
230
|
-
|
231
|
-
# Allow overriding the service path/port in subclasses.
|
232
|
-
service_path = service_address || self.class::SERVICE_ADDRESS
|
233
|
-
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
234
|
-
interceptors = self.class::GRPC_INTERCEPTORS
|
235
|
-
@completion_stub = Google::Gax::Grpc.create_stub(
|
236
|
-
service_path,
|
237
|
-
port,
|
238
|
-
chan_creds: chan_creds,
|
239
|
-
channel: channel,
|
240
|
-
updater_proc: updater_proc,
|
241
|
-
scopes: scopes,
|
242
|
-
interceptors: interceptors,
|
243
|
-
&Google::Cloud::Talent::V4beta1::Completion::Stub.method(:new)
|
244
|
-
)
|
245
|
-
|
246
|
-
@complete_query = Google::Gax.create_api_call(
|
247
|
-
@completion_stub.method(:complete_query),
|
248
|
-
defaults["complete_query"],
|
249
|
-
exception_transformer: exception_transformer,
|
250
|
-
params_extractor: proc do |request|
|
251
|
-
{'parent' => request.parent}
|
252
|
-
end
|
253
|
-
)
|
254
|
-
end
|
255
|
-
|
256
|
-
# Service calls
|
257
|
-
|
258
|
-
# Completes the specified prefix with keyword suggestions.
|
259
|
-
# Intended for use by a job search auto-complete search box.
|
260
|
-
#
|
261
|
-
# @param parent [String]
|
262
|
-
# Required. Resource name of tenant the completion is performed within.
|
263
|
-
#
|
264
|
-
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
|
265
|
-
# "projects/foo/tenant/bar".
|
266
|
-
#
|
267
|
-
# If tenant id is unspecified, the default tenant is used, for
|
268
|
-
# example, "projects/foo".
|
269
|
-
# @param query [String]
|
270
|
-
# Required. The query used to generate suggestions.
|
271
|
-
#
|
272
|
-
# The maximum number of allowed characters is 255.
|
273
|
-
# @param page_size [Integer]
|
274
|
-
# Required. Completion result count.
|
275
|
-
#
|
276
|
-
# The maximum allowed page size is 10.
|
277
|
-
# @param language_codes [Array<String>]
|
278
|
-
# The list of languages of the query. This is
|
279
|
-
# the BCP-47 language code, such as "en-US" or "sr-Latn".
|
280
|
-
# For more information, see
|
281
|
-
# [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47).
|
282
|
-
#
|
283
|
-
# The maximum number of allowed characters is 255.
|
284
|
-
# @param company [String]
|
285
|
-
# If provided, restricts completion to specified company.
|
286
|
-
#
|
287
|
-
# The format is
|
288
|
-
# "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for
|
289
|
-
# example, "projects/foo/tenants/bar/companies/baz".
|
290
|
-
#
|
291
|
-
# If tenant id is unspecified, the default tenant is used, for
|
292
|
-
# example, "projects/foo".
|
293
|
-
# @param scope [Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope]
|
294
|
-
# The scope of the completion. The defaults is {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionScope::PUBLIC CompletionScope::PUBLIC}.
|
295
|
-
# @param type [Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType]
|
296
|
-
# The completion topic. The default is {Google::Cloud::Talent::V4beta1::CompleteQueryRequest::CompletionType::COMBINED CompletionType::COMBINED}.
|
297
|
-
# @param options [Google::Gax::CallOptions]
|
298
|
-
# Overrides the default settings for this call, e.g, timeout,
|
299
|
-
# retries, etc.
|
300
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
301
|
-
# @yieldparam result [Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
|
302
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
303
|
-
# @return [Google::Cloud::Talent::V4beta1::CompleteQueryResponse]
|
304
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
305
|
-
# @example
|
306
|
-
# require "google/cloud/talent"
|
307
|
-
#
|
308
|
-
# completion_client = Google::Cloud::Talent::Completion.new(version: :v4beta1)
|
309
|
-
# formatted_parent = Google::Cloud::Talent::V4beta1::CompletionClient.project_path("[PROJECT]")
|
310
|
-
#
|
311
|
-
# # TODO: Initialize `query`:
|
312
|
-
# query = ''
|
313
|
-
#
|
314
|
-
# # TODO: Initialize `page_size`:
|
315
|
-
# page_size = 0
|
316
|
-
# response = completion_client.complete_query(formatted_parent, query, page_size)
|
317
|
-
|
318
|
-
def complete_query \
|
319
|
-
parent,
|
320
|
-
query,
|
321
|
-
page_size,
|
322
|
-
language_codes: nil,
|
323
|
-
company: nil,
|
324
|
-
scope: nil,
|
325
|
-
type: nil,
|
326
|
-
options: nil,
|
327
|
-
&block
|
328
|
-
req = {
|
329
|
-
parent: parent,
|
330
|
-
query: query,
|
331
|
-
page_size: page_size,
|
332
|
-
language_codes: language_codes,
|
333
|
-
company: company,
|
334
|
-
scope: scope,
|
335
|
-
type: type
|
336
|
-
}.delete_if { |_, v| v.nil? }
|
337
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CompleteQueryRequest)
|
338
|
-
@complete_query.call(req, options, &block)
|
339
|
-
end
|
340
|
-
end
|
341
|
-
end
|
342
|
-
end
|
343
|
-
end
|
344
|
-
end
|