google-cloud-talent-v4beta1 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 +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +71 -0
- data/lib/google-cloud-talent-v4beta1.rb +21 -0
- data/lib/google/cloud/common_resources_pb.rb +15 -0
- data/lib/google/cloud/talent/v4beta1.rb +41 -0
- data/lib/google/cloud/talent/v4beta1/application_pb.rb +64 -0
- data/lib/google/cloud/talent/v4beta1/application_service.rb +50 -0
- data/lib/google/cloud/talent/v4beta1/application_service/client.rb +717 -0
- data/lib/google/cloud/talent/v4beta1/application_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/application_service/paths.rb +155 -0
- data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +56 -0
- data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +54 -0
- data/lib/google/cloud/talent/v4beta1/batch_pb.rb +19 -0
- data/lib/google/cloud/talent/v4beta1/common_pb.rb +342 -0
- data/lib/google/cloud/talent/v4beta1/company_pb.rb +42 -0
- data/lib/google/cloud/talent/v4beta1/company_service.rb +49 -0
- data/lib/google/cloud/talent/v4beta1/company_service/client.rb +732 -0
- data/lib/google/cloud/talent/v4beta1/company_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/company_service/paths.rb +105 -0
- data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +57 -0
- data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +54 -0
- data/lib/google/cloud/talent/v4beta1/completion.rb +49 -0
- data/lib/google/cloud/talent/v4beta1/completion/client.rb +407 -0
- data/lib/google/cloud/talent/v4beta1/completion/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/completion/paths.rb +105 -0
- data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +57 -0
- data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +46 -0
- data/lib/google/cloud/talent/v4beta1/event_pb.rb +70 -0
- data/lib/google/cloud/talent/v4beta1/event_service.rb +49 -0
- data/lib/google/cloud/talent/v4beta1/event_service/client.rb +379 -0
- data/lib/google/cloud/talent/v4beta1/event_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/event_service/paths.rb +64 -0
- data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +28 -0
- data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +51 -0
- data/lib/google/cloud/talent/v4beta1/filters_pb.rb +188 -0
- data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +28 -0
- data/lib/google/cloud/talent/v4beta1/job_pb.rb +73 -0
- data/lib/google/cloud/talent/v4beta1/job_service.rb +50 -0
- data/lib/google/cloud/talent/v4beta1/job_service/client.rb +1660 -0
- data/lib/google/cloud/talent/v4beta1/job_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +564 -0
- data/lib/google/cloud/talent/v4beta1/job_service/paths.rb +146 -0
- data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +167 -0
- data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +86 -0
- data/lib/google/cloud/talent/v4beta1/profile_pb.rb +214 -0
- data/lib/google/cloud/talent/v4beta1/profile_service.rb +50 -0
- data/lib/google/cloud/talent/v4beta1/profile_service/client.rb +992 -0
- data/lib/google/cloud/talent/v4beta1/profile_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/profile_service/paths.rb +69 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +92 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +63 -0
- data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +35 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service.rb +49 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +712 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb +64 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +56 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/version.rb +28 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/cloud/talent/v4beta1/application.rb +169 -0
- data/proto_docs/google/cloud/talent/v4beta1/application_service.rb +122 -0
- data/proto_docs/google/cloud/talent/v4beta1/common.rb +1106 -0
- data/proto_docs/google/cloud/talent/v4beta1/company.rb +117 -0
- data/proto_docs/google/cloud/talent/v4beta1/company_service.rb +138 -0
- data/proto_docs/google/cloud/talent/v4beta1/completion_service.rb +143 -0
- data/proto_docs/google/cloud/talent/v4beta1/event.rb +237 -0
- data/proto_docs/google/cloud/talent/v4beta1/event_service.rb +43 -0
- data/proto_docs/google/cloud/talent/v4beta1/filters.rb +818 -0
- data/proto_docs/google/cloud/talent/v4beta1/histogram.rb +69 -0
- data/proto_docs/google/cloud/talent/v4beta1/job.rb +356 -0
- data/proto_docs/google/cloud/talent/v4beta1/job_service.rb +746 -0
- data/proto_docs/google/cloud/talent/v4beta1/profile.rb +811 -0
- data/proto_docs/google/cloud/talent/v4beta1/profile_service.rb +392 -0
- data/proto_docs/google/cloud/talent/v4beta1/tenant.rb +77 -0
- data/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb +118 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/date.rb +50 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- data/proto_docs/google/type/money.rb +43 -0
- data/proto_docs/google/type/postal_address.rb +135 -0
- data/proto_docs/google/type/timeofday.rb +44 -0
- metadata +251 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/talent/v4beta1/company.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/field_behavior_pb'
|
7
|
+
require 'google/api/resource_pb'
|
8
|
+
require 'google/cloud/talent/v4beta1/common_pb'
|
9
|
+
require 'google/api/annotations_pb'
|
10
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
|
+
add_file("google/cloud/talent/v4beta1/company.proto", :syntax => :proto3) do
|
12
|
+
add_message "google.cloud.talent.v4beta1.Company" do
|
13
|
+
optional :name, :string, 1
|
14
|
+
optional :display_name, :string, 2
|
15
|
+
optional :external_id, :string, 3
|
16
|
+
optional :size, :enum, 4, "google.cloud.talent.v4beta1.CompanySize"
|
17
|
+
optional :headquarters_address, :string, 5
|
18
|
+
optional :hiring_agency, :bool, 6
|
19
|
+
optional :eeo_text, :string, 7
|
20
|
+
optional :website_uri, :string, 8
|
21
|
+
optional :career_site_uri, :string, 9
|
22
|
+
optional :image_uri, :string, 10
|
23
|
+
repeated :keyword_searchable_job_custom_attributes, :string, 11
|
24
|
+
optional :derived_info, :message, 12, "google.cloud.talent.v4beta1.Company.DerivedInfo"
|
25
|
+
optional :suspended, :bool, 13
|
26
|
+
end
|
27
|
+
add_message "google.cloud.talent.v4beta1.Company.DerivedInfo" do
|
28
|
+
optional :headquarters_location, :message, 1, "google.cloud.talent.v4beta1.Location"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
module Google
|
34
|
+
module Cloud
|
35
|
+
module Talent
|
36
|
+
module V4beta1
|
37
|
+
Company = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company").msgclass
|
38
|
+
Company::DerivedInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Company.DerivedInfo").msgclass
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/talent/v4beta1/version"
|
24
|
+
|
25
|
+
require "google/cloud/talent/v4beta1/company_service/credentials"
|
26
|
+
require "google/cloud/talent/v4beta1/company_service/paths"
|
27
|
+
require "google/cloud/talent/v4beta1/company_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Talent
|
32
|
+
module V4beta1
|
33
|
+
##
|
34
|
+
# A service that handles company management, including CRUD and enumeration.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/talent/v4beta1/company_service"
|
39
|
+
# client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new
|
40
|
+
#
|
41
|
+
module CompanyService
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "company_service", "helpers.rb"
|
49
|
+
require "google/cloud/talent/v4beta1/company_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,732 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/talent/v4beta1/company_service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Talent
|
25
|
+
module V4beta1
|
26
|
+
module CompanyService
|
27
|
+
##
|
28
|
+
# Client for the CompanyService service.
|
29
|
+
#
|
30
|
+
# A service that handles company management, including CRUD and enumeration.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
include Paths
|
34
|
+
|
35
|
+
# @private
|
36
|
+
attr_reader :company_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the CompanyService Client class.
|
40
|
+
#
|
41
|
+
# See {Google::Cloud::Talent::V4beta1::CompanyService::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# ## Example
|
45
|
+
#
|
46
|
+
# To modify the configuration for all CompanyService clients:
|
47
|
+
#
|
48
|
+
# Google::Cloud::Talent::V4beta1::CompanyService::Client.configure do |config|
|
49
|
+
# config.timeout = 10_000
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "Talent", "V4beta1"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.rpcs.create_company.timeout = 30.0
|
69
|
+
|
70
|
+
default_config.rpcs.get_company.timeout = 30.0
|
71
|
+
default_config.rpcs.get_company.retry_policy = {
|
72
|
+
initial_delay: 0.1,
|
73
|
+
max_delay: 60.0,
|
74
|
+
multiplier: 1.3,
|
75
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
76
|
+
}
|
77
|
+
|
78
|
+
default_config.rpcs.update_company.timeout = 30.0
|
79
|
+
|
80
|
+
default_config.rpcs.delete_company.timeout = 30.0
|
81
|
+
default_config.rpcs.delete_company.retry_policy = {
|
82
|
+
initial_delay: 0.1,
|
83
|
+
max_delay: 60.0,
|
84
|
+
multiplier: 1.3,
|
85
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
86
|
+
}
|
87
|
+
|
88
|
+
default_config.rpcs.list_companies.timeout = 30.0
|
89
|
+
default_config.rpcs.list_companies.retry_policy = {
|
90
|
+
initial_delay: 0.1,
|
91
|
+
max_delay: 60.0,
|
92
|
+
multiplier: 1.3,
|
93
|
+
retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
|
94
|
+
}
|
95
|
+
|
96
|
+
default_config
|
97
|
+
end
|
98
|
+
yield @configure if block_given?
|
99
|
+
@configure
|
100
|
+
end
|
101
|
+
|
102
|
+
##
|
103
|
+
# Configure the CompanyService Client instance.
|
104
|
+
#
|
105
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
106
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
107
|
+
# should be made on {Client.configure}.
|
108
|
+
#
|
109
|
+
# See {Google::Cloud::Talent::V4beta1::CompanyService::Client::Configuration}
|
110
|
+
# for a description of the configuration fields.
|
111
|
+
#
|
112
|
+
# @yield [config] Configure the Client client.
|
113
|
+
# @yieldparam config [Client::Configuration]
|
114
|
+
#
|
115
|
+
# @return [Client::Configuration]
|
116
|
+
#
|
117
|
+
def configure
|
118
|
+
yield @config if block_given?
|
119
|
+
@config
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Create a new CompanyService client object.
|
124
|
+
#
|
125
|
+
# ## Examples
|
126
|
+
#
|
127
|
+
# To create a new CompanyService client with the default
|
128
|
+
# configuration:
|
129
|
+
#
|
130
|
+
# client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new
|
131
|
+
#
|
132
|
+
# To create a new CompanyService client with a custom
|
133
|
+
# configuration:
|
134
|
+
#
|
135
|
+
# client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config|
|
136
|
+
# config.timeout = 10_000
|
137
|
+
# end
|
138
|
+
#
|
139
|
+
# @yield [config] Configure the CompanyService client.
|
140
|
+
# @yieldparam config [Client::Configuration]
|
141
|
+
#
|
142
|
+
def initialize
|
143
|
+
# These require statements are intentionally placed here to initialize
|
144
|
+
# the gRPC module only when it's required.
|
145
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
146
|
+
require "gapic/grpc"
|
147
|
+
require "google/cloud/talent/v4beta1/company_service_services_pb"
|
148
|
+
|
149
|
+
# Create the configuration object
|
150
|
+
@config = Configuration.new Client.configure
|
151
|
+
|
152
|
+
# Yield the configuration if needed
|
153
|
+
yield @config if block_given?
|
154
|
+
|
155
|
+
# Create credentials
|
156
|
+
credentials = @config.credentials
|
157
|
+
credentials ||= Credentials.default scope: @config.scope
|
158
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
159
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
160
|
+
end
|
161
|
+
@quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
|
162
|
+
|
163
|
+
@company_service_stub = Gapic::ServiceStub.new(
|
164
|
+
Google::Cloud::Talent::V4beta1::CompanyService::Stub,
|
165
|
+
credentials: credentials,
|
166
|
+
endpoint: @config.endpoint,
|
167
|
+
channel_args: @config.channel_args,
|
168
|
+
interceptors: @config.interceptors
|
169
|
+
)
|
170
|
+
end
|
171
|
+
|
172
|
+
# Service calls
|
173
|
+
|
174
|
+
##
|
175
|
+
# Creates a new company entity.
|
176
|
+
#
|
177
|
+
# @overload create_company(request, options = nil)
|
178
|
+
# Pass arguments to `create_company` via a request object, either of type
|
179
|
+
# {Google::Cloud::Talent::V4beta1::CreateCompanyRequest} or an equivalent Hash.
|
180
|
+
#
|
181
|
+
# @param request [Google::Cloud::Talent::V4beta1::CreateCompanyRequest, Hash]
|
182
|
+
# A request object representing the call parameters. Required. To specify no
|
183
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
184
|
+
# @param options [Gapic::CallOptions, Hash]
|
185
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
186
|
+
#
|
187
|
+
# @overload create_company(parent: nil, company: nil)
|
188
|
+
# Pass arguments to `create_company` via keyword arguments. Note that at
|
189
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
190
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
191
|
+
#
|
192
|
+
# @param parent [String]
|
193
|
+
# Required. Resource name of the tenant under which the company is created.
|
194
|
+
#
|
195
|
+
# The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
|
196
|
+
# "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
|
197
|
+
# is created, for example, "projects/foo".
|
198
|
+
# @param company [Google::Cloud::Talent::V4beta1::Company, Hash]
|
199
|
+
# Required. The company to be created.
|
200
|
+
#
|
201
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
202
|
+
# @yieldparam response [Google::Cloud::Talent::V4beta1::Company]
|
203
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
204
|
+
#
|
205
|
+
# @return [Google::Cloud::Talent::V4beta1::Company]
|
206
|
+
#
|
207
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
208
|
+
#
|
209
|
+
def create_company request, options = nil
|
210
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
211
|
+
|
212
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::CreateCompanyRequest
|
213
|
+
|
214
|
+
# Converts hash and nil to an options object
|
215
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
216
|
+
|
217
|
+
# Customize the options with defaults
|
218
|
+
metadata = @config.rpcs.create_company.metadata.to_h
|
219
|
+
|
220
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
221
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
222
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
223
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
|
224
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
225
|
+
|
226
|
+
header_params = {
|
227
|
+
"parent" => request.parent
|
228
|
+
}
|
229
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
230
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
231
|
+
|
232
|
+
options.apply_defaults timeout: @config.rpcs.create_company.timeout,
|
233
|
+
metadata: metadata,
|
234
|
+
retry_policy: @config.rpcs.create_company.retry_policy
|
235
|
+
options.apply_defaults metadata: @config.metadata,
|
236
|
+
retry_policy: @config.retry_policy
|
237
|
+
|
238
|
+
@company_service_stub.call_rpc :create_company, request, options: options do |response, operation|
|
239
|
+
yield response, operation if block_given?
|
240
|
+
return response
|
241
|
+
end
|
242
|
+
rescue GRPC::BadStatus => e
|
243
|
+
raise Google::Cloud::Error.from_error(e)
|
244
|
+
end
|
245
|
+
|
246
|
+
##
|
247
|
+
# Retrieves specified company.
|
248
|
+
#
|
249
|
+
# @overload get_company(request, options = nil)
|
250
|
+
# Pass arguments to `get_company` via a request object, either of type
|
251
|
+
# {Google::Cloud::Talent::V4beta1::GetCompanyRequest} or an equivalent Hash.
|
252
|
+
#
|
253
|
+
# @param request [Google::Cloud::Talent::V4beta1::GetCompanyRequest, Hash]
|
254
|
+
# A request object representing the call parameters. Required. To specify no
|
255
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
256
|
+
# @param options [Gapic::CallOptions, Hash]
|
257
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
258
|
+
#
|
259
|
+
# @overload get_company(name: nil)
|
260
|
+
# Pass arguments to `get_company` via keyword arguments. Note that at
|
261
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
262
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
263
|
+
#
|
264
|
+
# @param name [String]
|
265
|
+
# Required. The resource name of the company to be retrieved.
|
266
|
+
#
|
267
|
+
# The format is
|
268
|
+
# "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
|
269
|
+
# example, "projects/api-test-project/tenants/foo/companies/bar".
|
270
|
+
#
|
271
|
+
# If tenant id is unspecified, the default tenant is used, for
|
272
|
+
# example, "projects/api-test-project/companies/bar".
|
273
|
+
#
|
274
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
275
|
+
# @yieldparam response [Google::Cloud::Talent::V4beta1::Company]
|
276
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
277
|
+
#
|
278
|
+
# @return [Google::Cloud::Talent::V4beta1::Company]
|
279
|
+
#
|
280
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
281
|
+
#
|
282
|
+
def get_company request, options = nil
|
283
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
284
|
+
|
285
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::GetCompanyRequest
|
286
|
+
|
287
|
+
# Converts hash and nil to an options object
|
288
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
289
|
+
|
290
|
+
# Customize the options with defaults
|
291
|
+
metadata = @config.rpcs.get_company.metadata.to_h
|
292
|
+
|
293
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
294
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
295
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
296
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
|
297
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
298
|
+
|
299
|
+
header_params = {
|
300
|
+
"name" => request.name
|
301
|
+
}
|
302
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
303
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
304
|
+
|
305
|
+
options.apply_defaults timeout: @config.rpcs.get_company.timeout,
|
306
|
+
metadata: metadata,
|
307
|
+
retry_policy: @config.rpcs.get_company.retry_policy
|
308
|
+
options.apply_defaults metadata: @config.metadata,
|
309
|
+
retry_policy: @config.retry_policy
|
310
|
+
|
311
|
+
@company_service_stub.call_rpc :get_company, request, options: options do |response, operation|
|
312
|
+
yield response, operation if block_given?
|
313
|
+
return response
|
314
|
+
end
|
315
|
+
rescue GRPC::BadStatus => e
|
316
|
+
raise Google::Cloud::Error.from_error(e)
|
317
|
+
end
|
318
|
+
|
319
|
+
##
|
320
|
+
# Updates specified company.
|
321
|
+
#
|
322
|
+
# @overload update_company(request, options = nil)
|
323
|
+
# Pass arguments to `update_company` via a request object, either of type
|
324
|
+
# {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest} or an equivalent Hash.
|
325
|
+
#
|
326
|
+
# @param request [Google::Cloud::Talent::V4beta1::UpdateCompanyRequest, Hash]
|
327
|
+
# A request object representing the call parameters. Required. To specify no
|
328
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
329
|
+
# @param options [Gapic::CallOptions, Hash]
|
330
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
331
|
+
#
|
332
|
+
# @overload update_company(company: nil, update_mask: nil)
|
333
|
+
# Pass arguments to `update_company` via keyword arguments. Note that at
|
334
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
335
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
336
|
+
#
|
337
|
+
# @param company [Google::Cloud::Talent::V4beta1::Company, Hash]
|
338
|
+
# Required. The company resource to replace the current resource in the system.
|
339
|
+
# @param update_mask [Google::Protobuf::FieldMask, Hash]
|
340
|
+
# Strongly recommended for the best service experience.
|
341
|
+
#
|
342
|
+
# If {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#update_mask update_mask} is provided, only the specified fields in
|
343
|
+
# {Google::Cloud::Talent::V4beta1::UpdateCompanyRequest#company company} are updated. Otherwise all the fields are updated.
|
344
|
+
#
|
345
|
+
# A field mask to specify the company fields to be updated. Only
|
346
|
+
# top level fields of {Google::Cloud::Talent::V4beta1::Company Company} are supported.
|
347
|
+
#
|
348
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
349
|
+
# @yieldparam response [Google::Cloud::Talent::V4beta1::Company]
|
350
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
351
|
+
#
|
352
|
+
# @return [Google::Cloud::Talent::V4beta1::Company]
|
353
|
+
#
|
354
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
355
|
+
#
|
356
|
+
def update_company request, options = nil
|
357
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
358
|
+
|
359
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::UpdateCompanyRequest
|
360
|
+
|
361
|
+
# Converts hash and nil to an options object
|
362
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
363
|
+
|
364
|
+
# Customize the options with defaults
|
365
|
+
metadata = @config.rpcs.update_company.metadata.to_h
|
366
|
+
|
367
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
368
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
369
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
370
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
|
371
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
372
|
+
|
373
|
+
header_params = {
|
374
|
+
"company.name" => request.company.name
|
375
|
+
}
|
376
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
377
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
378
|
+
|
379
|
+
options.apply_defaults timeout: @config.rpcs.update_company.timeout,
|
380
|
+
metadata: metadata,
|
381
|
+
retry_policy: @config.rpcs.update_company.retry_policy
|
382
|
+
options.apply_defaults metadata: @config.metadata,
|
383
|
+
retry_policy: @config.retry_policy
|
384
|
+
|
385
|
+
@company_service_stub.call_rpc :update_company, request, options: options do |response, operation|
|
386
|
+
yield response, operation if block_given?
|
387
|
+
return response
|
388
|
+
end
|
389
|
+
rescue GRPC::BadStatus => e
|
390
|
+
raise Google::Cloud::Error.from_error(e)
|
391
|
+
end
|
392
|
+
|
393
|
+
##
|
394
|
+
# Deletes specified company.
|
395
|
+
# Prerequisite: The company has no jobs associated with it.
|
396
|
+
#
|
397
|
+
# @overload delete_company(request, options = nil)
|
398
|
+
# Pass arguments to `delete_company` via a request object, either of type
|
399
|
+
# {Google::Cloud::Talent::V4beta1::DeleteCompanyRequest} or an equivalent Hash.
|
400
|
+
#
|
401
|
+
# @param request [Google::Cloud::Talent::V4beta1::DeleteCompanyRequest, Hash]
|
402
|
+
# A request object representing the call parameters. Required. To specify no
|
403
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
404
|
+
# @param options [Gapic::CallOptions, Hash]
|
405
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
406
|
+
#
|
407
|
+
# @overload delete_company(name: nil)
|
408
|
+
# Pass arguments to `delete_company` via keyword arguments. Note that at
|
409
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
410
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
411
|
+
#
|
412
|
+
# @param name [String]
|
413
|
+
# Required. The resource name of the company to be deleted.
|
414
|
+
#
|
415
|
+
# The format is
|
416
|
+
# "projects/\\{project_id}/tenants/\\{tenant_id}/companies/\\{company_id}", for
|
417
|
+
# example, "projects/foo/tenants/bar/companies/baz".
|
418
|
+
#
|
419
|
+
# If tenant id is unspecified, the default tenant is used, for
|
420
|
+
# example, "projects/foo/companies/bar".
|
421
|
+
#
|
422
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
423
|
+
# @yieldparam response [Google::Protobuf::Empty]
|
424
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
425
|
+
#
|
426
|
+
# @return [Google::Protobuf::Empty]
|
427
|
+
#
|
428
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
429
|
+
#
|
430
|
+
def delete_company request, options = nil
|
431
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
432
|
+
|
433
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::DeleteCompanyRequest
|
434
|
+
|
435
|
+
# Converts hash and nil to an options object
|
436
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
437
|
+
|
438
|
+
# Customize the options with defaults
|
439
|
+
metadata = @config.rpcs.delete_company.metadata.to_h
|
440
|
+
|
441
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
442
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
443
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
444
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
|
445
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
446
|
+
|
447
|
+
header_params = {
|
448
|
+
"name" => request.name
|
449
|
+
}
|
450
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
451
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
452
|
+
|
453
|
+
options.apply_defaults timeout: @config.rpcs.delete_company.timeout,
|
454
|
+
metadata: metadata,
|
455
|
+
retry_policy: @config.rpcs.delete_company.retry_policy
|
456
|
+
options.apply_defaults metadata: @config.metadata,
|
457
|
+
retry_policy: @config.retry_policy
|
458
|
+
|
459
|
+
@company_service_stub.call_rpc :delete_company, request, options: options do |response, operation|
|
460
|
+
yield response, operation if block_given?
|
461
|
+
return response
|
462
|
+
end
|
463
|
+
rescue GRPC::BadStatus => e
|
464
|
+
raise Google::Cloud::Error.from_error(e)
|
465
|
+
end
|
466
|
+
|
467
|
+
##
|
468
|
+
# Lists all companies associated with the project.
|
469
|
+
#
|
470
|
+
# @overload list_companies(request, options = nil)
|
471
|
+
# Pass arguments to `list_companies` via a request object, either of type
|
472
|
+
# {Google::Cloud::Talent::V4beta1::ListCompaniesRequest} or an equivalent Hash.
|
473
|
+
#
|
474
|
+
# @param request [Google::Cloud::Talent::V4beta1::ListCompaniesRequest, Hash]
|
475
|
+
# A request object representing the call parameters. Required. To specify no
|
476
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
477
|
+
# @param options [Gapic::CallOptions, Hash]
|
478
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
479
|
+
#
|
480
|
+
# @overload list_companies(parent: nil, page_token: nil, page_size: nil, require_open_jobs: nil)
|
481
|
+
# Pass arguments to `list_companies` via keyword arguments. Note that at
|
482
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
483
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
484
|
+
#
|
485
|
+
# @param parent [String]
|
486
|
+
# Required. Resource name of the tenant under which the company is created.
|
487
|
+
#
|
488
|
+
# The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
|
489
|
+
# "projects/foo/tenant/bar".
|
490
|
+
#
|
491
|
+
# If tenant id is unspecified, the default tenant will be used, for
|
492
|
+
# example, "projects/foo".
|
493
|
+
# @param page_token [String]
|
494
|
+
# The starting indicator from which to return results.
|
495
|
+
# @param page_size [Integer]
|
496
|
+
# The maximum number of companies to be returned, at most 100.
|
497
|
+
# Default is 100 if a non-positive number is provided.
|
498
|
+
# @param require_open_jobs [Boolean]
|
499
|
+
# Set to true if the companies requested must have open jobs.
|
500
|
+
#
|
501
|
+
# Defaults to false.
|
502
|
+
#
|
503
|
+
# If true, at most {Google::Cloud::Talent::V4beta1::ListCompaniesRequest#page_size page_size} of companies are fetched, among which
|
504
|
+
# only those with open jobs are returned.
|
505
|
+
#
|
506
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
507
|
+
# @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Talent::V4beta1::Company>]
|
508
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
509
|
+
#
|
510
|
+
# @return [Gapic::PagedEnumerable<Google::Cloud::Talent::V4beta1::Company>]
|
511
|
+
#
|
512
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
513
|
+
#
|
514
|
+
def list_companies request, options = nil
|
515
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
516
|
+
|
517
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::ListCompaniesRequest
|
518
|
+
|
519
|
+
# Converts hash and nil to an options object
|
520
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
521
|
+
|
522
|
+
# Customize the options with defaults
|
523
|
+
metadata = @config.rpcs.list_companies.metadata.to_h
|
524
|
+
|
525
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
526
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
527
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
528
|
+
gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
|
529
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
530
|
+
|
531
|
+
header_params = {
|
532
|
+
"parent" => request.parent
|
533
|
+
}
|
534
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
535
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
536
|
+
|
537
|
+
options.apply_defaults timeout: @config.rpcs.list_companies.timeout,
|
538
|
+
metadata: metadata,
|
539
|
+
retry_policy: @config.rpcs.list_companies.retry_policy
|
540
|
+
options.apply_defaults metadata: @config.metadata,
|
541
|
+
retry_policy: @config.retry_policy
|
542
|
+
|
543
|
+
@company_service_stub.call_rpc :list_companies, request, options: options do |response, operation|
|
544
|
+
response = Gapic::PagedEnumerable.new @company_service_stub, :list_companies, request, response, operation, options
|
545
|
+
yield response, operation if block_given?
|
546
|
+
return response
|
547
|
+
end
|
548
|
+
rescue GRPC::BadStatus => e
|
549
|
+
raise Google::Cloud::Error.from_error(e)
|
550
|
+
end
|
551
|
+
|
552
|
+
##
|
553
|
+
# Configuration class for the CompanyService API.
|
554
|
+
#
|
555
|
+
# This class represents the configuration for CompanyService,
|
556
|
+
# providing control over timeouts, retry behavior, logging, transport
|
557
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
558
|
+
# applied individually to specific RPCs. See
|
559
|
+
# {Google::Cloud::Talent::V4beta1::CompanyService::Client::Configuration::Rpcs}
|
560
|
+
# for a list of RPCs that can be configured independently.
|
561
|
+
#
|
562
|
+
# Configuration can be applied globally to all clients, or to a single client
|
563
|
+
# on construction.
|
564
|
+
#
|
565
|
+
# # Examples
|
566
|
+
#
|
567
|
+
# To modify the global config, setting the timeout for create_company
|
568
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
569
|
+
#
|
570
|
+
# Google::Cloud::Talent::V4beta1::CompanyService::Client.configure do |config|
|
571
|
+
# config.timeout = 10_000
|
572
|
+
# config.rpcs.create_company.timeout = 20_000
|
573
|
+
# end
|
574
|
+
#
|
575
|
+
# To apply the above configuration only to a new client:
|
576
|
+
#
|
577
|
+
# client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new do |config|
|
578
|
+
# config.timeout = 10_000
|
579
|
+
# config.rpcs.create_company.timeout = 20_000
|
580
|
+
# end
|
581
|
+
#
|
582
|
+
# @!attribute [rw] endpoint
|
583
|
+
# The hostname or hostname:port of the service endpoint.
|
584
|
+
# Defaults to `"jobs.googleapis.com"`.
|
585
|
+
# @return [String]
|
586
|
+
# @!attribute [rw] credentials
|
587
|
+
# Credentials to send with calls. You may provide any of the following types:
|
588
|
+
# * (`String`) The path to a service account key file in JSON format
|
589
|
+
# * (`Hash`) A service account key as a Hash
|
590
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
591
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
592
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
593
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
594
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
595
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
596
|
+
# * (`nil`) indicating no credentials
|
597
|
+
# @return [Object]
|
598
|
+
# @!attribute [rw] scope
|
599
|
+
# The OAuth scopes
|
600
|
+
# @return [Array<String>]
|
601
|
+
# @!attribute [rw] lib_name
|
602
|
+
# The library name as recorded in instrumentation and logging
|
603
|
+
# @return [String]
|
604
|
+
# @!attribute [rw] lib_version
|
605
|
+
# The library version as recorded in instrumentation and logging
|
606
|
+
# @return [String]
|
607
|
+
# @!attribute [rw] channel_args
|
608
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
609
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
610
|
+
# @return [Hash]
|
611
|
+
# @!attribute [rw] interceptors
|
612
|
+
# An array of interceptors that are run before calls are executed.
|
613
|
+
# @return [Array<GRPC::ClientInterceptor>]
|
614
|
+
# @!attribute [rw] timeout
|
615
|
+
# The call timeout in milliseconds.
|
616
|
+
# @return [Numeric]
|
617
|
+
# @!attribute [rw] metadata
|
618
|
+
# Additional gRPC headers to be sent with the call.
|
619
|
+
# @return [Hash{Symbol=>String}]
|
620
|
+
# @!attribute [rw] retry_policy
|
621
|
+
# The retry policy. The value is a hash with the following keys:
|
622
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
623
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
624
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
625
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
626
|
+
# trigger a retry.
|
627
|
+
# @return [Hash]
|
628
|
+
#
|
629
|
+
class Configuration
|
630
|
+
extend Gapic::Config
|
631
|
+
|
632
|
+
config_attr :endpoint, "jobs.googleapis.com", String
|
633
|
+
config_attr :credentials, nil do |value|
|
634
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
635
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
636
|
+
allowed.any? { |klass| klass === value }
|
637
|
+
end
|
638
|
+
config_attr :scope, nil, String, Array, nil
|
639
|
+
config_attr :lib_name, nil, String, nil
|
640
|
+
config_attr :lib_version, nil, String, nil
|
641
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
642
|
+
config_attr :interceptors, nil, Array, nil
|
643
|
+
config_attr :timeout, nil, Numeric, nil
|
644
|
+
config_attr :metadata, nil, Hash, nil
|
645
|
+
config_attr :retry_policy, nil, Hash, Proc, nil
|
646
|
+
|
647
|
+
# @private
|
648
|
+
def initialize parent_config = nil
|
649
|
+
@parent_config = parent_config unless parent_config.nil?
|
650
|
+
|
651
|
+
yield self if block_given?
|
652
|
+
end
|
653
|
+
|
654
|
+
##
|
655
|
+
# Configurations for individual RPCs
|
656
|
+
# @return [Rpcs]
|
657
|
+
#
|
658
|
+
def rpcs
|
659
|
+
@rpcs ||= begin
|
660
|
+
parent_rpcs = nil
|
661
|
+
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
|
662
|
+
Rpcs.new parent_rpcs
|
663
|
+
end
|
664
|
+
end
|
665
|
+
|
666
|
+
##
|
667
|
+
# Configuration RPC class for the CompanyService API.
|
668
|
+
#
|
669
|
+
# Includes fields providing the configuration for each RPC in this service.
|
670
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
671
|
+
# the following configuration fields:
|
672
|
+
#
|
673
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
674
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
675
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
676
|
+
# include the following keys:
|
677
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
678
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
679
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
680
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
681
|
+
# trigger a retry.
|
682
|
+
#
|
683
|
+
class Rpcs
|
684
|
+
##
|
685
|
+
# RPC-specific configuration for `create_company`
|
686
|
+
# @return [Gapic::Config::Method]
|
687
|
+
#
|
688
|
+
attr_reader :create_company
|
689
|
+
##
|
690
|
+
# RPC-specific configuration for `get_company`
|
691
|
+
# @return [Gapic::Config::Method]
|
692
|
+
#
|
693
|
+
attr_reader :get_company
|
694
|
+
##
|
695
|
+
# RPC-specific configuration for `update_company`
|
696
|
+
# @return [Gapic::Config::Method]
|
697
|
+
#
|
698
|
+
attr_reader :update_company
|
699
|
+
##
|
700
|
+
# RPC-specific configuration for `delete_company`
|
701
|
+
# @return [Gapic::Config::Method]
|
702
|
+
#
|
703
|
+
attr_reader :delete_company
|
704
|
+
##
|
705
|
+
# RPC-specific configuration for `list_companies`
|
706
|
+
# @return [Gapic::Config::Method]
|
707
|
+
#
|
708
|
+
attr_reader :list_companies
|
709
|
+
|
710
|
+
# @private
|
711
|
+
def initialize parent_rpcs = nil
|
712
|
+
create_company_config = parent_rpcs&.create_company if parent_rpcs&.respond_to? :create_company
|
713
|
+
@create_company = Gapic::Config::Method.new create_company_config
|
714
|
+
get_company_config = parent_rpcs&.get_company if parent_rpcs&.respond_to? :get_company
|
715
|
+
@get_company = Gapic::Config::Method.new get_company_config
|
716
|
+
update_company_config = parent_rpcs&.update_company if parent_rpcs&.respond_to? :update_company
|
717
|
+
@update_company = Gapic::Config::Method.new update_company_config
|
718
|
+
delete_company_config = parent_rpcs&.delete_company if parent_rpcs&.respond_to? :delete_company
|
719
|
+
@delete_company = Gapic::Config::Method.new delete_company_config
|
720
|
+
list_companies_config = parent_rpcs&.list_companies if parent_rpcs&.respond_to? :list_companies
|
721
|
+
@list_companies = Gapic::Config::Method.new list_companies_config
|
722
|
+
|
723
|
+
yield self if block_given?
|
724
|
+
end
|
725
|
+
end
|
726
|
+
end
|
727
|
+
end
|
728
|
+
end
|
729
|
+
end
|
730
|
+
end
|
731
|
+
end
|
732
|
+
end
|