google-cloud-vpc_access-v1 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +2 -2
- data/lib/google/cloud/vpc_access/v1/bindings_override.rb +91 -0
- data/lib/google/cloud/vpc_access/v1/rest.rb +38 -0
- data/lib/google/cloud/vpc_access/v1/version.rb +1 -1
- data/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb +12 -14
- data/lib/google/cloud/vpc_access/v1/vpc_access_service/operations.rb +12 -14
- data/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb +615 -0
- data/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/operations.rb +793 -0
- data/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb +285 -0
- data/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb +56 -0
- data/lib/google/cloud/vpc_access/v1/vpc_access_service.rb +7 -1
- data/lib/google/cloud/vpc_access/v1.rb +7 -2
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +18 -10
@@ -0,0 +1,615 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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/vpcaccess/v1/vpc_access_pb"
|
21
|
+
require "google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module VpcAccess
|
27
|
+
module V1
|
28
|
+
module VpcAccessService
|
29
|
+
module Rest
|
30
|
+
##
|
31
|
+
# REST client for the VpcAccessService service.
|
32
|
+
#
|
33
|
+
# Serverless VPC Access API allows users to create and manage connectors for
|
34
|
+
# App Engine, Cloud Functions and Cloud Run to have internal connections to
|
35
|
+
# Virtual Private Cloud networks.
|
36
|
+
#
|
37
|
+
class Client
|
38
|
+
include Paths
|
39
|
+
|
40
|
+
# @private
|
41
|
+
attr_reader :vpc_access_service_stub
|
42
|
+
|
43
|
+
##
|
44
|
+
# Configure the VpcAccessService Client class.
|
45
|
+
#
|
46
|
+
# See {::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client::Configuration}
|
47
|
+
# for a description of the configuration fields.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
#
|
51
|
+
# # Modify the configuration for all VpcAccessService clients
|
52
|
+
# ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.configure do |config|
|
53
|
+
# config.timeout = 10.0
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# @yield [config] Configure the Client client.
|
57
|
+
# @yieldparam config [Client::Configuration]
|
58
|
+
#
|
59
|
+
# @return [Client::Configuration]
|
60
|
+
#
|
61
|
+
def self.configure
|
62
|
+
@configure ||= begin
|
63
|
+
namespace = ["Google", "Cloud", "VpcAccess", "V1"]
|
64
|
+
parent_config = while namespace.any?
|
65
|
+
parent_name = namespace.join "::"
|
66
|
+
parent_const = const_get parent_name
|
67
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
68
|
+
namespace.pop
|
69
|
+
end
|
70
|
+
default_config = Client::Configuration.new parent_config
|
71
|
+
|
72
|
+
default_config.timeout = 60.0
|
73
|
+
default_config.retry_policy = {
|
74
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2]
|
75
|
+
}
|
76
|
+
|
77
|
+
default_config.rpcs.create_connector.timeout = 60.0
|
78
|
+
|
79
|
+
default_config.rpcs.get_connector.timeout = 60.0
|
80
|
+
|
81
|
+
default_config.rpcs.list_connectors.timeout = 60.0
|
82
|
+
|
83
|
+
default_config.rpcs.delete_connector.timeout = 60.0
|
84
|
+
|
85
|
+
default_config
|
86
|
+
end
|
87
|
+
yield @configure if block_given?
|
88
|
+
@configure
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# Configure the VpcAccessService Client instance.
|
93
|
+
#
|
94
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
95
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
96
|
+
# should be made on {Client.configure}.
|
97
|
+
#
|
98
|
+
# See {::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client::Configuration}
|
99
|
+
# for a description of the configuration fields.
|
100
|
+
#
|
101
|
+
# @yield [config] Configure the Client client.
|
102
|
+
# @yieldparam config [Client::Configuration]
|
103
|
+
#
|
104
|
+
# @return [Client::Configuration]
|
105
|
+
#
|
106
|
+
def configure
|
107
|
+
yield @config if block_given?
|
108
|
+
@config
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Create a new VpcAccessService REST client object.
|
113
|
+
#
|
114
|
+
# @example
|
115
|
+
#
|
116
|
+
# # Create a client using the default configuration
|
117
|
+
# client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new
|
118
|
+
#
|
119
|
+
# # Create a client using a custom configuration
|
120
|
+
# client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config|
|
121
|
+
# config.timeout = 10.0
|
122
|
+
# end
|
123
|
+
#
|
124
|
+
# @yield [config] Configure the VpcAccessService client.
|
125
|
+
# @yieldparam config [Client::Configuration]
|
126
|
+
#
|
127
|
+
def initialize
|
128
|
+
# Create the configuration object
|
129
|
+
@config = Configuration.new Client.configure
|
130
|
+
|
131
|
+
# Yield the configuration if needed
|
132
|
+
yield @config if block_given?
|
133
|
+
|
134
|
+
# Create credentials
|
135
|
+
credentials = @config.credentials
|
136
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
137
|
+
# but only if the default endpoint does not have a region prefix.
|
138
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
139
|
+
!@config.endpoint.split(".").first.include?("-")
|
140
|
+
credentials ||= Credentials.default scope: @config.scope,
|
141
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
142
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
143
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
144
|
+
end
|
145
|
+
|
146
|
+
@quota_project_id = @config.quota_project
|
147
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
148
|
+
|
149
|
+
@operations_client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Operations.new do |config|
|
150
|
+
config.credentials = credentials
|
151
|
+
config.quota_project = @quota_project_id
|
152
|
+
config.endpoint = @config.endpoint
|
153
|
+
end
|
154
|
+
|
155
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
156
|
+
config.credentials = credentials
|
157
|
+
config.quota_project = @quota_project_id
|
158
|
+
config.endpoint = @config.endpoint
|
159
|
+
config.bindings_override = @config.bindings_override
|
160
|
+
end
|
161
|
+
|
162
|
+
@vpc_access_service_stub = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
163
|
+
end
|
164
|
+
|
165
|
+
##
|
166
|
+
# Get the associated client for long-running operations.
|
167
|
+
#
|
168
|
+
# @return [::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Operations]
|
169
|
+
#
|
170
|
+
attr_reader :operations_client
|
171
|
+
|
172
|
+
##
|
173
|
+
# Get the associated client for mix-in of the Locations.
|
174
|
+
#
|
175
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
176
|
+
#
|
177
|
+
attr_reader :location_client
|
178
|
+
|
179
|
+
# Service calls
|
180
|
+
|
181
|
+
##
|
182
|
+
# Creates a Serverless VPC Access connector, returns an operation.
|
183
|
+
#
|
184
|
+
# @overload create_connector(request, options = nil)
|
185
|
+
# Pass arguments to `create_connector` via a request object, either of type
|
186
|
+
# {::Google::Cloud::VpcAccess::V1::CreateConnectorRequest} or an equivalent Hash.
|
187
|
+
#
|
188
|
+
# @param request [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, ::Hash]
|
189
|
+
# A request object representing the call parameters. Required. To specify no
|
190
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
191
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
192
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
193
|
+
#
|
194
|
+
# @overload create_connector(parent: nil, connector_id: nil, connector: nil)
|
195
|
+
# Pass arguments to `create_connector` via keyword arguments. Note that at
|
196
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
197
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
198
|
+
#
|
199
|
+
# @param parent [::String]
|
200
|
+
# Required. The project and location in which the configuration should be created,
|
201
|
+
# specified in the format `projects/*/locations/*`.
|
202
|
+
# @param connector_id [::String]
|
203
|
+
# Required. The ID to use for this connector.
|
204
|
+
# @param connector [::Google::Cloud::VpcAccess::V1::Connector, ::Hash]
|
205
|
+
# Required. Resource to create.
|
206
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
207
|
+
# @yieldparam result [::Gapic::Operation]
|
208
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
209
|
+
#
|
210
|
+
# @return [::Gapic::Operation]
|
211
|
+
#
|
212
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
213
|
+
def create_connector request, options = nil
|
214
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
215
|
+
|
216
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest
|
217
|
+
|
218
|
+
# Converts hash and nil to an options object
|
219
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
220
|
+
|
221
|
+
# Customize the options with defaults
|
222
|
+
call_metadata = @config.rpcs.create_connector.metadata.to_h
|
223
|
+
|
224
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
225
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
226
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
227
|
+
gapic_version: ::Google::Cloud::VpcAccess::V1::VERSION,
|
228
|
+
transports_version_send: [:rest]
|
229
|
+
|
230
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
231
|
+
|
232
|
+
options.apply_defaults timeout: @config.rpcs.create_connector.timeout,
|
233
|
+
metadata: call_metadata,
|
234
|
+
retry_policy: @config.rpcs.create_connector.retry_policy
|
235
|
+
|
236
|
+
options.apply_defaults timeout: @config.timeout,
|
237
|
+
metadata: @config.metadata,
|
238
|
+
retry_policy: @config.retry_policy
|
239
|
+
|
240
|
+
@vpc_access_service_stub.create_connector request, options do |result, operation|
|
241
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
242
|
+
yield result, operation if block_given?
|
243
|
+
return result
|
244
|
+
end
|
245
|
+
rescue ::Gapic::Rest::Error => e
|
246
|
+
raise ::Google::Cloud::Error.from_error(e)
|
247
|
+
end
|
248
|
+
|
249
|
+
##
|
250
|
+
# Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource
|
251
|
+
# does not exist.
|
252
|
+
#
|
253
|
+
# @overload get_connector(request, options = nil)
|
254
|
+
# Pass arguments to `get_connector` via a request object, either of type
|
255
|
+
# {::Google::Cloud::VpcAccess::V1::GetConnectorRequest} or an equivalent Hash.
|
256
|
+
#
|
257
|
+
# @param request [::Google::Cloud::VpcAccess::V1::GetConnectorRequest, ::Hash]
|
258
|
+
# A request object representing the call parameters. Required. To specify no
|
259
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
260
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
261
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
262
|
+
#
|
263
|
+
# @overload get_connector(name: nil)
|
264
|
+
# Pass arguments to `get_connector` via keyword arguments. Note that at
|
265
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
266
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
267
|
+
#
|
268
|
+
# @param name [::String]
|
269
|
+
# Required. Name of a Serverless VPC Access connector to get.
|
270
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
271
|
+
# @yieldparam result [::Google::Cloud::VpcAccess::V1::Connector]
|
272
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
273
|
+
#
|
274
|
+
# @return [::Google::Cloud::VpcAccess::V1::Connector]
|
275
|
+
#
|
276
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
277
|
+
def get_connector request, options = nil
|
278
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
279
|
+
|
280
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::GetConnectorRequest
|
281
|
+
|
282
|
+
# Converts hash and nil to an options object
|
283
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
284
|
+
|
285
|
+
# Customize the options with defaults
|
286
|
+
call_metadata = @config.rpcs.get_connector.metadata.to_h
|
287
|
+
|
288
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
289
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
290
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
291
|
+
gapic_version: ::Google::Cloud::VpcAccess::V1::VERSION,
|
292
|
+
transports_version_send: [:rest]
|
293
|
+
|
294
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
295
|
+
|
296
|
+
options.apply_defaults timeout: @config.rpcs.get_connector.timeout,
|
297
|
+
metadata: call_metadata,
|
298
|
+
retry_policy: @config.rpcs.get_connector.retry_policy
|
299
|
+
|
300
|
+
options.apply_defaults timeout: @config.timeout,
|
301
|
+
metadata: @config.metadata,
|
302
|
+
retry_policy: @config.retry_policy
|
303
|
+
|
304
|
+
@vpc_access_service_stub.get_connector request, options do |result, operation|
|
305
|
+
yield result, operation if block_given?
|
306
|
+
return result
|
307
|
+
end
|
308
|
+
rescue ::Gapic::Rest::Error => e
|
309
|
+
raise ::Google::Cloud::Error.from_error(e)
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# Lists Serverless VPC Access connectors.
|
314
|
+
#
|
315
|
+
# @overload list_connectors(request, options = nil)
|
316
|
+
# Pass arguments to `list_connectors` via a request object, either of type
|
317
|
+
# {::Google::Cloud::VpcAccess::V1::ListConnectorsRequest} or an equivalent Hash.
|
318
|
+
#
|
319
|
+
# @param request [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, ::Hash]
|
320
|
+
# A request object representing the call parameters. Required. To specify no
|
321
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
322
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
323
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
324
|
+
#
|
325
|
+
# @overload list_connectors(parent: nil, page_size: nil, page_token: nil)
|
326
|
+
# Pass arguments to `list_connectors` via keyword arguments. Note that at
|
327
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
328
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
329
|
+
#
|
330
|
+
# @param parent [::String]
|
331
|
+
# Required. The project and location from which the routes should be listed.
|
332
|
+
# @param page_size [::Integer]
|
333
|
+
# Maximum number of functions to return per call.
|
334
|
+
# @param page_token [::String]
|
335
|
+
# Continuation token.
|
336
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
337
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>]
|
338
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
339
|
+
#
|
340
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>]
|
341
|
+
#
|
342
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
343
|
+
def list_connectors request, options = nil
|
344
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
345
|
+
|
346
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest
|
347
|
+
|
348
|
+
# Converts hash and nil to an options object
|
349
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
350
|
+
|
351
|
+
# Customize the options with defaults
|
352
|
+
call_metadata = @config.rpcs.list_connectors.metadata.to_h
|
353
|
+
|
354
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
355
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
356
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
357
|
+
gapic_version: ::Google::Cloud::VpcAccess::V1::VERSION,
|
358
|
+
transports_version_send: [:rest]
|
359
|
+
|
360
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
361
|
+
|
362
|
+
options.apply_defaults timeout: @config.rpcs.list_connectors.timeout,
|
363
|
+
metadata: call_metadata,
|
364
|
+
retry_policy: @config.rpcs.list_connectors.retry_policy
|
365
|
+
|
366
|
+
options.apply_defaults timeout: @config.timeout,
|
367
|
+
metadata: @config.metadata,
|
368
|
+
retry_policy: @config.retry_policy
|
369
|
+
|
370
|
+
@vpc_access_service_stub.list_connectors request, options do |result, operation|
|
371
|
+
result = ::Gapic::Rest::PagedEnumerable.new @vpc_access_service_stub, :list_connectors, "connectors", request, result, options
|
372
|
+
yield result, operation if block_given?
|
373
|
+
return result
|
374
|
+
end
|
375
|
+
rescue ::Gapic::Rest::Error => e
|
376
|
+
raise ::Google::Cloud::Error.from_error(e)
|
377
|
+
end
|
378
|
+
|
379
|
+
##
|
380
|
+
# Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the
|
381
|
+
# resource does not exist.
|
382
|
+
#
|
383
|
+
# @overload delete_connector(request, options = nil)
|
384
|
+
# Pass arguments to `delete_connector` via a request object, either of type
|
385
|
+
# {::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest} or an equivalent Hash.
|
386
|
+
#
|
387
|
+
# @param request [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, ::Hash]
|
388
|
+
# A request object representing the call parameters. Required. To specify no
|
389
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
390
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
391
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
392
|
+
#
|
393
|
+
# @overload delete_connector(name: nil)
|
394
|
+
# Pass arguments to `delete_connector` via keyword arguments. Note that at
|
395
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
396
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
397
|
+
#
|
398
|
+
# @param name [::String]
|
399
|
+
# Required. Name of a Serverless VPC Access connector to delete.
|
400
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
401
|
+
# @yieldparam result [::Gapic::Operation]
|
402
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
403
|
+
#
|
404
|
+
# @return [::Gapic::Operation]
|
405
|
+
#
|
406
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
407
|
+
def delete_connector request, options = nil
|
408
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
409
|
+
|
410
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest
|
411
|
+
|
412
|
+
# Converts hash and nil to an options object
|
413
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
414
|
+
|
415
|
+
# Customize the options with defaults
|
416
|
+
call_metadata = @config.rpcs.delete_connector.metadata.to_h
|
417
|
+
|
418
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
419
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
420
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
421
|
+
gapic_version: ::Google::Cloud::VpcAccess::V1::VERSION,
|
422
|
+
transports_version_send: [:rest]
|
423
|
+
|
424
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
425
|
+
|
426
|
+
options.apply_defaults timeout: @config.rpcs.delete_connector.timeout,
|
427
|
+
metadata: call_metadata,
|
428
|
+
retry_policy: @config.rpcs.delete_connector.retry_policy
|
429
|
+
|
430
|
+
options.apply_defaults timeout: @config.timeout,
|
431
|
+
metadata: @config.metadata,
|
432
|
+
retry_policy: @config.retry_policy
|
433
|
+
|
434
|
+
@vpc_access_service_stub.delete_connector request, options do |result, operation|
|
435
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
436
|
+
yield result, operation if block_given?
|
437
|
+
return result
|
438
|
+
end
|
439
|
+
rescue ::Gapic::Rest::Error => e
|
440
|
+
raise ::Google::Cloud::Error.from_error(e)
|
441
|
+
end
|
442
|
+
|
443
|
+
##
|
444
|
+
# Configuration class for the VpcAccessService REST API.
|
445
|
+
#
|
446
|
+
# This class represents the configuration for VpcAccessService REST,
|
447
|
+
# providing control over timeouts, retry behavior, logging, transport
|
448
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
449
|
+
# applied individually to specific RPCs. See
|
450
|
+
# {::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client::Configuration::Rpcs}
|
451
|
+
# for a list of RPCs that can be configured independently.
|
452
|
+
#
|
453
|
+
# Configuration can be applied globally to all clients, or to a single client
|
454
|
+
# on construction.
|
455
|
+
#
|
456
|
+
# @example
|
457
|
+
#
|
458
|
+
# # Modify the global config, setting the timeout for
|
459
|
+
# # create_connector to 20 seconds,
|
460
|
+
# # and all remaining timeouts to 10 seconds.
|
461
|
+
# ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.configure do |config|
|
462
|
+
# config.timeout = 10.0
|
463
|
+
# config.rpcs.create_connector.timeout = 20.0
|
464
|
+
# end
|
465
|
+
#
|
466
|
+
# # Apply the above configuration only to a new client.
|
467
|
+
# client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config|
|
468
|
+
# config.timeout = 10.0
|
469
|
+
# config.rpcs.create_connector.timeout = 20.0
|
470
|
+
# end
|
471
|
+
#
|
472
|
+
# @!attribute [rw] endpoint
|
473
|
+
# The hostname or hostname:port of the service endpoint.
|
474
|
+
# Defaults to `"vpcaccess.googleapis.com"`.
|
475
|
+
# @return [::String]
|
476
|
+
# @!attribute [rw] credentials
|
477
|
+
# Credentials to send with calls. You may provide any of the following types:
|
478
|
+
# * (`String`) The path to a service account key file in JSON format
|
479
|
+
# * (`Hash`) A service account key as a Hash
|
480
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
481
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
482
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
483
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
484
|
+
# * (`nil`) indicating no credentials
|
485
|
+
# @return [::Object]
|
486
|
+
# @!attribute [rw] scope
|
487
|
+
# The OAuth scopes
|
488
|
+
# @return [::Array<::String>]
|
489
|
+
# @!attribute [rw] lib_name
|
490
|
+
# The library name as recorded in instrumentation and logging
|
491
|
+
# @return [::String]
|
492
|
+
# @!attribute [rw] lib_version
|
493
|
+
# The library version as recorded in instrumentation and logging
|
494
|
+
# @return [::String]
|
495
|
+
# @!attribute [rw] timeout
|
496
|
+
# The call timeout in seconds.
|
497
|
+
# @return [::Numeric]
|
498
|
+
# @!attribute [rw] metadata
|
499
|
+
# Additional headers to be sent with the call.
|
500
|
+
# @return [::Hash{::Symbol=>::String}]
|
501
|
+
# @!attribute [rw] retry_policy
|
502
|
+
# The retry policy. The value is a hash with the following keys:
|
503
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
504
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
505
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
506
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
507
|
+
# trigger a retry.
|
508
|
+
# @return [::Hash]
|
509
|
+
# @!attribute [rw] quota_project
|
510
|
+
# A separate project against which to charge quota.
|
511
|
+
# @return [::String]
|
512
|
+
#
|
513
|
+
class Configuration
|
514
|
+
extend ::Gapic::Config
|
515
|
+
|
516
|
+
config_attr :endpoint, "vpcaccess.googleapis.com", ::String
|
517
|
+
config_attr :credentials, nil do |value|
|
518
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
519
|
+
allowed.any? { |klass| klass === value }
|
520
|
+
end
|
521
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
522
|
+
config_attr :lib_name, nil, ::String, nil
|
523
|
+
config_attr :lib_version, nil, ::String, nil
|
524
|
+
config_attr :timeout, nil, ::Numeric, nil
|
525
|
+
config_attr :metadata, nil, ::Hash, nil
|
526
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
527
|
+
config_attr :quota_project, nil, ::String, nil
|
528
|
+
|
529
|
+
# @private
|
530
|
+
# Overrides for http bindings for the RPCs of this service
|
531
|
+
# are only used when this service is used as mixin, and only
|
532
|
+
# by the host service.
|
533
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
534
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
535
|
+
|
536
|
+
# @private
|
537
|
+
def initialize parent_config = nil
|
538
|
+
@parent_config = parent_config unless parent_config.nil?
|
539
|
+
|
540
|
+
yield self if block_given?
|
541
|
+
end
|
542
|
+
|
543
|
+
##
|
544
|
+
# Configurations for individual RPCs
|
545
|
+
# @return [Rpcs]
|
546
|
+
#
|
547
|
+
def rpcs
|
548
|
+
@rpcs ||= begin
|
549
|
+
parent_rpcs = nil
|
550
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
551
|
+
Rpcs.new parent_rpcs
|
552
|
+
end
|
553
|
+
end
|
554
|
+
|
555
|
+
##
|
556
|
+
# Configuration RPC class for the VpcAccessService API.
|
557
|
+
#
|
558
|
+
# Includes fields providing the configuration for each RPC in this service.
|
559
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
560
|
+
# the following configuration fields:
|
561
|
+
#
|
562
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
563
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
564
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
565
|
+
# include the following keys:
|
566
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
567
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
568
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
569
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
570
|
+
# trigger a retry.
|
571
|
+
#
|
572
|
+
class Rpcs
|
573
|
+
##
|
574
|
+
# RPC-specific configuration for `create_connector`
|
575
|
+
# @return [::Gapic::Config::Method]
|
576
|
+
#
|
577
|
+
attr_reader :create_connector
|
578
|
+
##
|
579
|
+
# RPC-specific configuration for `get_connector`
|
580
|
+
# @return [::Gapic::Config::Method]
|
581
|
+
#
|
582
|
+
attr_reader :get_connector
|
583
|
+
##
|
584
|
+
# RPC-specific configuration for `list_connectors`
|
585
|
+
# @return [::Gapic::Config::Method]
|
586
|
+
#
|
587
|
+
attr_reader :list_connectors
|
588
|
+
##
|
589
|
+
# RPC-specific configuration for `delete_connector`
|
590
|
+
# @return [::Gapic::Config::Method]
|
591
|
+
#
|
592
|
+
attr_reader :delete_connector
|
593
|
+
|
594
|
+
# @private
|
595
|
+
def initialize parent_rpcs = nil
|
596
|
+
create_connector_config = parent_rpcs.create_connector if parent_rpcs.respond_to? :create_connector
|
597
|
+
@create_connector = ::Gapic::Config::Method.new create_connector_config
|
598
|
+
get_connector_config = parent_rpcs.get_connector if parent_rpcs.respond_to? :get_connector
|
599
|
+
@get_connector = ::Gapic::Config::Method.new get_connector_config
|
600
|
+
list_connectors_config = parent_rpcs.list_connectors if parent_rpcs.respond_to? :list_connectors
|
601
|
+
@list_connectors = ::Gapic::Config::Method.new list_connectors_config
|
602
|
+
delete_connector_config = parent_rpcs.delete_connector if parent_rpcs.respond_to? :delete_connector
|
603
|
+
@delete_connector = ::Gapic::Config::Method.new delete_connector_config
|
604
|
+
|
605
|
+
yield self if block_given?
|
606
|
+
end
|
607
|
+
end
|
608
|
+
end
|
609
|
+
end
|
610
|
+
end
|
611
|
+
end
|
612
|
+
end
|
613
|
+
end
|
614
|
+
end
|
615
|
+
end
|