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