google-cloud-talent 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,31 @@
|
|
1
|
+
{
|
2
|
+
"interfaces": {
|
3
|
+
"google.cloud.talent.v4beta1.ResumeService": {
|
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
|
+
"ParseResume": {
|
24
|
+
"timeout_millis": 30000,
|
25
|
+
"retry_codes_name": "non_idempotent",
|
26
|
+
"retry_params_name": "default"
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/talent/v4beta1/resume_service.proto
|
3
|
+
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/annotations_pb'
|
8
|
+
require 'google/cloud/talent/v4beta1/profile_pb'
|
9
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
|
+
add_message "google.cloud.talent.v4beta1.ParseResumeRequest" do
|
11
|
+
optional :parent, :string, 1
|
12
|
+
optional :resume, :bytes, 2
|
13
|
+
optional :region_code, :string, 3
|
14
|
+
optional :language_code, :string, 4
|
15
|
+
optional :options, :message, 5, "google.cloud.talent.v4beta1.ParseResumeOptions"
|
16
|
+
end
|
17
|
+
add_message "google.cloud.talent.v4beta1.ParseResumeOptions" do
|
18
|
+
optional :enable_ocr, :bool, 1
|
19
|
+
optional :enable_full_skill_detection, :bool, 2
|
20
|
+
end
|
21
|
+
add_message "google.cloud.talent.v4beta1.ParseResumeResponse" do
|
22
|
+
optional :profile, :message, 1, "google.cloud.talent.v4beta1.Profile"
|
23
|
+
optional :raw_text, :string, 2
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
module Google
|
28
|
+
module Cloud
|
29
|
+
module Talent
|
30
|
+
module V4beta1
|
31
|
+
ParseResumeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ParseResumeRequest").msgclass
|
32
|
+
ParseResumeOptions = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ParseResumeOptions").msgclass
|
33
|
+
ParseResumeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ParseResumeResponse").msgclass
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/talent/v4beta1/resume_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/resume_service_pb'
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module Talent
|
27
|
+
module V4beta1
|
28
|
+
module ResumeService
|
29
|
+
# A service that handles resume parsing.
|
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.ResumeService'
|
37
|
+
|
38
|
+
# Parses a resume into a [Profile][google.cloud.talent.v4beta1.Profile]. The
|
39
|
+
# API attempts to fill out the following profile fields if present within the
|
40
|
+
# resume:
|
41
|
+
#
|
42
|
+
# * personNames
|
43
|
+
# * addresses
|
44
|
+
# * emailAddress
|
45
|
+
# * phoneNumbers
|
46
|
+
# * personalUris
|
47
|
+
# * employmentRecords
|
48
|
+
# * educationRecords
|
49
|
+
# * skills
|
50
|
+
#
|
51
|
+
# Note that some attributes in these fields may not be populated if they're
|
52
|
+
# not present within the resume or unrecognizable by the resume parser.
|
53
|
+
#
|
54
|
+
# This API does not save the resume or profile. To create a profile from this
|
55
|
+
# resume, clients need to call the CreateProfile method again with the
|
56
|
+
# profile returned.
|
57
|
+
#
|
58
|
+
# The following list of formats are supported:
|
59
|
+
#
|
60
|
+
# * PDF
|
61
|
+
# * TXT
|
62
|
+
# * DOC
|
63
|
+
# * RTF
|
64
|
+
# * DOCX
|
65
|
+
# * PNG (only when [ParseResumeRequest.enable_ocr][] is set to `true`,
|
66
|
+
# otherwise an error is thrown)
|
67
|
+
rpc :ParseResume, ParseResumeRequest, ParseResumeResponse
|
68
|
+
end
|
69
|
+
|
70
|
+
Stub = Service.rpc_stub_class
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/talent/v4beta1/tenant.proto
|
3
|
+
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/annotations_pb'
|
8
|
+
require 'google/cloud/talent/v4beta1/common_pb'
|
9
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
|
+
add_message "google.cloud.talent.v4beta1.Tenant" do
|
11
|
+
optional :name, :string, 1
|
12
|
+
optional :external_id, :string, 2
|
13
|
+
optional :usage_type, :enum, 3, "google.cloud.talent.v4beta1.Tenant.DataUsageType"
|
14
|
+
end
|
15
|
+
add_enum "google.cloud.talent.v4beta1.Tenant.DataUsageType" do
|
16
|
+
value :DATA_USAGE_TYPE_UNSPECIFIED, 0
|
17
|
+
value :AGGREGATED, 1
|
18
|
+
value :ISOLATED, 2
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Talent
|
25
|
+
module V4beta1
|
26
|
+
Tenant = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant").msgclass
|
27
|
+
Tenant::DataUsageType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant.DataUsageType").enummodule
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,466 @@
|
|
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/tenant_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/tenant_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 tenant management, including CRUD and enumeration.
|
36
|
+
#
|
37
|
+
# @!attribute [r] tenant_service_stub
|
38
|
+
# @return [Google::Cloud::Talent::V4beta1::TenantService::Stub]
|
39
|
+
class TenantServiceClient
|
40
|
+
# @private
|
41
|
+
attr_reader :tenant_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
|
+
PAGE_DESCRIPTORS = {
|
55
|
+
"list_tenants" => Google::Gax::PageDescriptor.new(
|
56
|
+
"page_token",
|
57
|
+
"next_page_token",
|
58
|
+
"tenants")
|
59
|
+
}.freeze
|
60
|
+
|
61
|
+
private_constant :PAGE_DESCRIPTORS
|
62
|
+
|
63
|
+
# The scopes needed to make gRPC calls to all of the methods defined in
|
64
|
+
# this service.
|
65
|
+
ALL_SCOPES = [
|
66
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
67
|
+
"https://www.googleapis.com/auth/jobs"
|
68
|
+
].freeze
|
69
|
+
|
70
|
+
|
71
|
+
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
72
|
+
"projects/{project}"
|
73
|
+
)
|
74
|
+
|
75
|
+
private_constant :PROJECT_PATH_TEMPLATE
|
76
|
+
|
77
|
+
TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
78
|
+
"projects/{project}/tenants/{tenant}"
|
79
|
+
)
|
80
|
+
|
81
|
+
private_constant :TENANT_PATH_TEMPLATE
|
82
|
+
|
83
|
+
# Returns a fully-qualified project resource name string.
|
84
|
+
# @param project [String]
|
85
|
+
# @return [String]
|
86
|
+
def self.project_path project
|
87
|
+
PROJECT_PATH_TEMPLATE.render(
|
88
|
+
:"project" => project
|
89
|
+
)
|
90
|
+
end
|
91
|
+
|
92
|
+
# Returns a fully-qualified tenant resource name string.
|
93
|
+
# @param project [String]
|
94
|
+
# @param tenant [String]
|
95
|
+
# @return [String]
|
96
|
+
def self.tenant_path project, tenant
|
97
|
+
TENANT_PATH_TEMPLATE.render(
|
98
|
+
:"project" => project,
|
99
|
+
:"tenant" => tenant
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
103
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
104
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
105
|
+
# be many types.
|
106
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
107
|
+
# authenticating requests made by this client.
|
108
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
109
|
+
# credentials for this client.
|
110
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
111
|
+
# credentials for this client.
|
112
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
113
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
114
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
115
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
116
|
+
# metadata for requests, generally, to give OAuth credentials.
|
117
|
+
# @param scopes [Array<String>]
|
118
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
119
|
+
# an updater_proc is supplied.
|
120
|
+
# @param client_config [Hash]
|
121
|
+
# A Hash for call options for each method. See
|
122
|
+
# Google::Gax#construct_settings for the structure of
|
123
|
+
# this data. Falls back to the default config if not specified
|
124
|
+
# or the specified config is missing data points.
|
125
|
+
# @param timeout [Numeric]
|
126
|
+
# The default timeout, in seconds, for calls made through this client.
|
127
|
+
# @param metadata [Hash]
|
128
|
+
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
129
|
+
# @param exception_transformer [Proc]
|
130
|
+
# An optional proc that intercepts any exceptions raised during an API call to inject
|
131
|
+
# custom error handling.
|
132
|
+
def initialize \
|
133
|
+
credentials: nil,
|
134
|
+
scopes: ALL_SCOPES,
|
135
|
+
client_config: {},
|
136
|
+
timeout: DEFAULT_TIMEOUT,
|
137
|
+
metadata: nil,
|
138
|
+
exception_transformer: nil,
|
139
|
+
lib_name: nil,
|
140
|
+
lib_version: ""
|
141
|
+
# These require statements are intentionally placed here to initialize
|
142
|
+
# the gRPC module only when it's required.
|
143
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
144
|
+
require "google/gax/grpc"
|
145
|
+
require "google/cloud/talent/v4beta1/tenant_service_services_pb"
|
146
|
+
|
147
|
+
credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
|
148
|
+
|
149
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
150
|
+
updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
|
151
|
+
end
|
152
|
+
if credentials.is_a?(GRPC::Core::Channel)
|
153
|
+
channel = credentials
|
154
|
+
end
|
155
|
+
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
156
|
+
chan_creds = credentials
|
157
|
+
end
|
158
|
+
if credentials.is_a?(Proc)
|
159
|
+
updater_proc = credentials
|
160
|
+
end
|
161
|
+
if credentials.is_a?(Google::Auth::Credentials)
|
162
|
+
updater_proc = credentials.updater_proc
|
163
|
+
end
|
164
|
+
|
165
|
+
package_version = Gem.loaded_specs['google-cloud-talent'].version.version
|
166
|
+
|
167
|
+
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
168
|
+
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
169
|
+
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
170
|
+
google_api_client << " grpc/#{GRPC::VERSION}"
|
171
|
+
google_api_client.freeze
|
172
|
+
|
173
|
+
headers = { :"x-goog-api-client" => google_api_client }
|
174
|
+
headers.merge!(metadata) unless metadata.nil?
|
175
|
+
client_config_file = Pathname.new(__dir__).join(
|
176
|
+
"tenant_service_client_config.json"
|
177
|
+
)
|
178
|
+
defaults = client_config_file.open do |f|
|
179
|
+
Google::Gax.construct_settings(
|
180
|
+
"google.cloud.talent.v4beta1.TenantService",
|
181
|
+
JSON.parse(f.read),
|
182
|
+
client_config,
|
183
|
+
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
184
|
+
timeout,
|
185
|
+
page_descriptors: PAGE_DESCRIPTORS,
|
186
|
+
errors: Google::Gax::Grpc::API_ERRORS,
|
187
|
+
metadata: headers
|
188
|
+
)
|
189
|
+
end
|
190
|
+
|
191
|
+
# Allow overriding the service path/port in subclasses.
|
192
|
+
service_path = self.class::SERVICE_ADDRESS
|
193
|
+
port = self.class::DEFAULT_SERVICE_PORT
|
194
|
+
interceptors = self.class::GRPC_INTERCEPTORS
|
195
|
+
@tenant_service_stub = Google::Gax::Grpc.create_stub(
|
196
|
+
service_path,
|
197
|
+
port,
|
198
|
+
chan_creds: chan_creds,
|
199
|
+
channel: channel,
|
200
|
+
updater_proc: updater_proc,
|
201
|
+
scopes: scopes,
|
202
|
+
interceptors: interceptors,
|
203
|
+
&Google::Cloud::Talent::V4beta1::TenantService::Stub.method(:new)
|
204
|
+
)
|
205
|
+
|
206
|
+
@create_tenant = Google::Gax.create_api_call(
|
207
|
+
@tenant_service_stub.method(:create_tenant),
|
208
|
+
defaults["create_tenant"],
|
209
|
+
exception_transformer: exception_transformer
|
210
|
+
)
|
211
|
+
@get_tenant = Google::Gax.create_api_call(
|
212
|
+
@tenant_service_stub.method(:get_tenant),
|
213
|
+
defaults["get_tenant"],
|
214
|
+
exception_transformer: exception_transformer
|
215
|
+
)
|
216
|
+
@update_tenant = Google::Gax.create_api_call(
|
217
|
+
@tenant_service_stub.method(:update_tenant),
|
218
|
+
defaults["update_tenant"],
|
219
|
+
exception_transformer: exception_transformer
|
220
|
+
)
|
221
|
+
@delete_tenant = Google::Gax.create_api_call(
|
222
|
+
@tenant_service_stub.method(:delete_tenant),
|
223
|
+
defaults["delete_tenant"],
|
224
|
+
exception_transformer: exception_transformer
|
225
|
+
)
|
226
|
+
@list_tenants = Google::Gax.create_api_call(
|
227
|
+
@tenant_service_stub.method(:list_tenants),
|
228
|
+
defaults["list_tenants"],
|
229
|
+
exception_transformer: exception_transformer
|
230
|
+
)
|
231
|
+
end
|
232
|
+
|
233
|
+
# Service calls
|
234
|
+
|
235
|
+
# Creates a new tenant entity.
|
236
|
+
#
|
237
|
+
# @param parent [String]
|
238
|
+
# Required.
|
239
|
+
#
|
240
|
+
# Resource name of the project under which the tenant is created.
|
241
|
+
#
|
242
|
+
# The format is "projects/{project_id}", for example,
|
243
|
+
# "projects/api-test-project".
|
244
|
+
# @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
|
245
|
+
# Required.
|
246
|
+
#
|
247
|
+
# The tenant to be created.
|
248
|
+
# A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
|
249
|
+
# can also be provided.
|
250
|
+
# @param options [Google::Gax::CallOptions]
|
251
|
+
# Overrides the default settings for this call, e.g, timeout,
|
252
|
+
# retries, etc.
|
253
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
254
|
+
# @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
|
255
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
256
|
+
# @return [Google::Cloud::Talent::V4beta1::Tenant]
|
257
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
258
|
+
# @example
|
259
|
+
# require "google/cloud/talent"
|
260
|
+
#
|
261
|
+
# tenant_service_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
|
262
|
+
# formatted_parent = Google::Cloud::Talent::V4beta1::TenantServiceClient.project_path("[PROJECT]")
|
263
|
+
#
|
264
|
+
# # TODO: Initialize `tenant`:
|
265
|
+
# tenant = {}
|
266
|
+
# response = tenant_service_client.create_tenant(formatted_parent, tenant)
|
267
|
+
|
268
|
+
def create_tenant \
|
269
|
+
parent,
|
270
|
+
tenant,
|
271
|
+
options: nil,
|
272
|
+
&block
|
273
|
+
req = {
|
274
|
+
parent: parent,
|
275
|
+
tenant: tenant
|
276
|
+
}.delete_if { |_, v| v.nil? }
|
277
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateTenantRequest)
|
278
|
+
@create_tenant.call(req, options, &block)
|
279
|
+
end
|
280
|
+
|
281
|
+
# Retrieves specified tenant.
|
282
|
+
#
|
283
|
+
# @param name [String]
|
284
|
+
# Required.
|
285
|
+
#
|
286
|
+
# The resource name of the tenant to be retrieved.
|
287
|
+
#
|
288
|
+
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
|
289
|
+
# "projects/api-test-project/tenants/foo".
|
290
|
+
# @param options [Google::Gax::CallOptions]
|
291
|
+
# Overrides the default settings for this call, e.g, timeout,
|
292
|
+
# retries, etc.
|
293
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
294
|
+
# @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
|
295
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
296
|
+
# @return [Google::Cloud::Talent::V4beta1::Tenant]
|
297
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
298
|
+
# @example
|
299
|
+
# require "google/cloud/talent"
|
300
|
+
#
|
301
|
+
# tenant_service_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
|
302
|
+
# formatted_name = Google::Cloud::Talent::V4beta1::TenantServiceClient.tenant_path("[PROJECT]", "[TENANT]")
|
303
|
+
# response = tenant_service_client.get_tenant(formatted_name)
|
304
|
+
|
305
|
+
def get_tenant \
|
306
|
+
name,
|
307
|
+
options: nil,
|
308
|
+
&block
|
309
|
+
req = {
|
310
|
+
name: name
|
311
|
+
}.delete_if { |_, v| v.nil? }
|
312
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetTenantRequest)
|
313
|
+
@get_tenant.call(req, options, &block)
|
314
|
+
end
|
315
|
+
|
316
|
+
# Updates specified tenant.
|
317
|
+
#
|
318
|
+
# @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
|
319
|
+
# Required.
|
320
|
+
#
|
321
|
+
# The tenant resource to replace the current resource in the system.
|
322
|
+
# A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
|
323
|
+
# can also be provided.
|
324
|
+
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
325
|
+
# Optional but strongly recommended for the best service
|
326
|
+
# experience.
|
327
|
+
#
|
328
|
+
# If
|
329
|
+
# {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask}
|
330
|
+
# is provided, only the specified fields in
|
331
|
+
# {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are
|
332
|
+
# updated. Otherwise all the fields are updated.
|
333
|
+
#
|
334
|
+
# A field mask to specify the tenant fields to be updated. Only
|
335
|
+
# top level fields of {Google::Cloud::Talent::V4beta1::Tenant Tenant} are
|
336
|
+
# supported.
|
337
|
+
# A hash of the same form as `Google::Protobuf::FieldMask`
|
338
|
+
# can also be provided.
|
339
|
+
# @param options [Google::Gax::CallOptions]
|
340
|
+
# Overrides the default settings for this call, e.g, timeout,
|
341
|
+
# retries, etc.
|
342
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
343
|
+
# @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
|
344
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
345
|
+
# @return [Google::Cloud::Talent::V4beta1::Tenant]
|
346
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
347
|
+
# @example
|
348
|
+
# require "google/cloud/talent"
|
349
|
+
#
|
350
|
+
# tenant_service_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
|
351
|
+
#
|
352
|
+
# # TODO: Initialize `tenant`:
|
353
|
+
# tenant = {}
|
354
|
+
# response = tenant_service_client.update_tenant(tenant)
|
355
|
+
|
356
|
+
def update_tenant \
|
357
|
+
tenant,
|
358
|
+
update_mask: nil,
|
359
|
+
options: nil,
|
360
|
+
&block
|
361
|
+
req = {
|
362
|
+
tenant: tenant,
|
363
|
+
update_mask: update_mask
|
364
|
+
}.delete_if { |_, v| v.nil? }
|
365
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateTenantRequest)
|
366
|
+
@update_tenant.call(req, options, &block)
|
367
|
+
end
|
368
|
+
|
369
|
+
# Deletes specified tenant.
|
370
|
+
#
|
371
|
+
# @param name [String]
|
372
|
+
# Required.
|
373
|
+
#
|
374
|
+
# The resource name of the tenant to be deleted.
|
375
|
+
#
|
376
|
+
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
|
377
|
+
# "projects/api-test-project/tenants/foo".
|
378
|
+
# @param options [Google::Gax::CallOptions]
|
379
|
+
# Overrides the default settings for this call, e.g, timeout,
|
380
|
+
# retries, etc.
|
381
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
382
|
+
# @yieldparam result []
|
383
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
384
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
385
|
+
# @example
|
386
|
+
# require "google/cloud/talent"
|
387
|
+
#
|
388
|
+
# tenant_service_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
|
389
|
+
# formatted_name = Google::Cloud::Talent::V4beta1::TenantServiceClient.tenant_path("[PROJECT]", "[TENANT]")
|
390
|
+
# tenant_service_client.delete_tenant(formatted_name)
|
391
|
+
|
392
|
+
def delete_tenant \
|
393
|
+
name,
|
394
|
+
options: nil,
|
395
|
+
&block
|
396
|
+
req = {
|
397
|
+
name: name
|
398
|
+
}.delete_if { |_, v| v.nil? }
|
399
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteTenantRequest)
|
400
|
+
@delete_tenant.call(req, options, &block)
|
401
|
+
nil
|
402
|
+
end
|
403
|
+
|
404
|
+
# Lists all tenants associated with the project.
|
405
|
+
#
|
406
|
+
# @param parent [String]
|
407
|
+
# Required.
|
408
|
+
#
|
409
|
+
# Resource name of the project under which the tenant is created.
|
410
|
+
#
|
411
|
+
# The format is "projects/{project_id}", for example,
|
412
|
+
# "projects/api-test-project".
|
413
|
+
# @param page_size [Integer]
|
414
|
+
# The maximum number of resources contained in the underlying API
|
415
|
+
# response. If page streaming is performed per-resource, this
|
416
|
+
# parameter does not affect the return value. If page streaming is
|
417
|
+
# performed per-page, this determines the maximum number of
|
418
|
+
# resources in a page.
|
419
|
+
# @param options [Google::Gax::CallOptions]
|
420
|
+
# Overrides the default settings for this call, e.g, timeout,
|
421
|
+
# retries, etc.
|
422
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
423
|
+
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
|
424
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
425
|
+
# @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
|
426
|
+
# An enumerable of Google::Cloud::Talent::V4beta1::Tenant instances.
|
427
|
+
# See Google::Gax::PagedEnumerable documentation for other
|
428
|
+
# operations such as per-page iteration or access to the response
|
429
|
+
# object.
|
430
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
431
|
+
# @example
|
432
|
+
# require "google/cloud/talent"
|
433
|
+
#
|
434
|
+
# tenant_service_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
|
435
|
+
# formatted_parent = Google::Cloud::Talent::V4beta1::TenantServiceClient.project_path("[PROJECT]")
|
436
|
+
#
|
437
|
+
# # Iterate over all results.
|
438
|
+
# tenant_service_client.list_tenants(formatted_parent).each do |element|
|
439
|
+
# # Process element.
|
440
|
+
# end
|
441
|
+
#
|
442
|
+
# # Or iterate over results one page at a time.
|
443
|
+
# tenant_service_client.list_tenants(formatted_parent).each_page do |page|
|
444
|
+
# # Process each page at a time.
|
445
|
+
# page.each do |element|
|
446
|
+
# # Process element.
|
447
|
+
# end
|
448
|
+
# end
|
449
|
+
|
450
|
+
def list_tenants \
|
451
|
+
parent,
|
452
|
+
page_size: nil,
|
453
|
+
options: nil,
|
454
|
+
&block
|
455
|
+
req = {
|
456
|
+
parent: parent,
|
457
|
+
page_size: page_size
|
458
|
+
}.delete_if { |_, v| v.nil? }
|
459
|
+
req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListTenantsRequest)
|
460
|
+
@list_tenants.call(req, options, &block)
|
461
|
+
end
|
462
|
+
end
|
463
|
+
end
|
464
|
+
end
|
465
|
+
end
|
466
|
+
end
|