google-cloud-network_connectivity-v1beta 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/network_connectivity/v1beta/bindings_override.rb +180 -0
  3. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/rest/client.rb +1666 -0
  4. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/rest/operations.rb +927 -0
  5. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/rest/service_stub.rb +817 -0
  6. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service/rest.rb +54 -0
  7. data/lib/google/cloud/network_connectivity/v1beta/data_transfer_service.rb +6 -0
  8. data/lib/google/cloud/network_connectivity/v1beta/hub_service/rest/client.rb +3353 -0
  9. data/lib/google/cloud/network_connectivity/v1beta/hub_service/rest/operations.rb +927 -0
  10. data/lib/google/cloud/network_connectivity/v1beta/hub_service/rest/service_stub.rb +1800 -0
  11. data/lib/google/cloud/network_connectivity/v1beta/hub_service/rest.rb +56 -0
  12. data/lib/google/cloud/network_connectivity/v1beta/hub_service.rb +6 -0
  13. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/rest/client.rb +817 -0
  14. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/rest/operations.rb +927 -0
  15. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/rest/service_stub.rb +326 -0
  16. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service/rest.rb +55 -0
  17. data/lib/google/cloud/network_connectivity/v1beta/policy_based_routing_service.rb +6 -0
  18. data/lib/google/cloud/network_connectivity/v1beta/rest.rb +41 -0
  19. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/rest/client.rb +1287 -0
  20. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/rest/operations.rb +927 -0
  21. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/rest/service_stub.rb +632 -0
  22. data/lib/google/cloud/network_connectivity/v1beta/transport_manager/rest.rb +54 -0
  23. data/lib/google/cloud/network_connectivity/v1beta/transport_manager.rb +6 -0
  24. data/lib/google/cloud/network_connectivity/v1beta/version.rb +1 -1
  25. data/lib/google/cloud/network_connectivity/v1beta.rb +5 -0
  26. data/proto_docs/google/protobuf/timestamp.rb +7 -6
  27. metadata +19 -2
  28. data/proto_docs/google/type/expr.rb +0 -75
@@ -0,0 +1,1287 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/networkconnectivity/v1beta/transport_manager_pb"
21
+ require "google/cloud/network_connectivity/v1beta/transport_manager/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+ require "google/iam/v1/rest"
24
+
25
+ module Google
26
+ module Cloud
27
+ module NetworkConnectivity
28
+ module V1beta
29
+ module TransportManager
30
+ module Rest
31
+ ##
32
+ # REST client for the TransportManager service.
33
+ #
34
+ # The CLH based service for managing RemoteTransportProfiles and Transports.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "networkconnectivity.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :transport_manager_stub
47
+
48
+ ##
49
+ # Configure the TransportManager Client class.
50
+ #
51
+ # See {::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all TransportManager clients
57
+ # ::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "NetworkConnectivity", "V1beta"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config.timeout = 60.0
78
+ default_config.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.create_transport.timeout = 60.0
83
+
84
+ default_config.rpcs.update_transport.timeout = 60.0
85
+
86
+ default_config.rpcs.delete_transport.timeout = 60.0
87
+
88
+ default_config
89
+ end
90
+ yield @configure if block_given?
91
+ @configure
92
+ end
93
+
94
+ ##
95
+ # Configure the TransportManager Client instance.
96
+ #
97
+ # The configuration is set to the derived mode, meaning that values can be changed,
98
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
99
+ # should be made on {Client.configure}.
100
+ #
101
+ # See {::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client::Configuration}
102
+ # for a description of the configuration fields.
103
+ #
104
+ # @yield [config] Configure the Client client.
105
+ # @yieldparam config [Client::Configuration]
106
+ #
107
+ # @return [Client::Configuration]
108
+ #
109
+ def configure
110
+ yield @config if block_given?
111
+ @config
112
+ end
113
+
114
+ ##
115
+ # The effective universe domain
116
+ #
117
+ # @return [String]
118
+ #
119
+ def universe_domain
120
+ @transport_manager_stub.universe_domain
121
+ end
122
+
123
+ ##
124
+ # Create a new TransportManager REST client object.
125
+ #
126
+ # @example
127
+ #
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
130
+ #
131
+ # # Create a client using a custom configuration
132
+ # client = ::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new do |config|
133
+ # config.timeout = 10.0
134
+ # end
135
+ #
136
+ # @yield [config] Configure the TransportManager client.
137
+ # @yieldparam config [Client::Configuration]
138
+ #
139
+ def initialize
140
+ # Create the configuration object
141
+ @config = Configuration.new Client.configure
142
+
143
+ # Yield the configuration if needed
144
+ yield @config if block_given?
145
+
146
+ # Create credentials
147
+ credentials = @config.credentials
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
+ # but only if the default endpoint does not have a region prefix.
150
+ enable_self_signed_jwt = @config.endpoint.nil? ||
151
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
+ !@config.endpoint.split(".").first.include?("-"))
153
+ credentials ||= Credentials.default scope: @config.scope,
154
+ enable_self_signed_jwt: enable_self_signed_jwt
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
+ credentials = Credentials.new credentials, scope: @config.scope
157
+ end
158
+
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
+
162
+ @operations_client = ::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Operations.new do |config|
163
+ config.credentials = credentials
164
+ config.quota_project = @quota_project_id
165
+ config.endpoint = @config.endpoint
166
+ config.universe_domain = @config.universe_domain
167
+ end
168
+
169
+ @transport_manager_stub = ::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::ServiceStub.new(
170
+ endpoint: @config.endpoint,
171
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
172
+ universe_domain: @config.universe_domain,
173
+ credentials: credentials,
174
+ logger: @config.logger
175
+ )
176
+
177
+ @transport_manager_stub.logger(stub: true)&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
187
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
188
+ config.credentials = credentials
189
+ config.quota_project = @quota_project_id
190
+ config.endpoint = @transport_manager_stub.endpoint
191
+ config.universe_domain = @transport_manager_stub.universe_domain
192
+ config.bindings_override = @config.bindings_override
193
+ config.logger = @transport_manager_stub.logger if config.respond_to? :logger=
194
+ end
195
+
196
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
197
+ config.credentials = credentials
198
+ config.quota_project = @quota_project_id
199
+ config.endpoint = @transport_manager_stub.endpoint
200
+ config.universe_domain = @transport_manager_stub.universe_domain
201
+ config.bindings_override = @config.bindings_override
202
+ config.logger = @transport_manager_stub.logger if config.respond_to? :logger=
203
+ end
204
+ end
205
+
206
+ ##
207
+ # Get the associated client for long-running operations.
208
+ #
209
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Operations]
210
+ #
211
+ attr_reader :operations_client
212
+
213
+ ##
214
+ # Get the associated client for mix-in of the Locations.
215
+ #
216
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
217
+ #
218
+ attr_reader :location_client
219
+
220
+ ##
221
+ # Get the associated client for mix-in of the IAMPolicy.
222
+ #
223
+ # @return [Google::Iam::V1::IAMPolicy::Rest::Client]
224
+ #
225
+ attr_reader :iam_policy_client
226
+
227
+ ##
228
+ # The logger used for request/response debug logging.
229
+ #
230
+ # @return [Logger]
231
+ #
232
+ def logger
233
+ @transport_manager_stub.logger
234
+ end
235
+
236
+ # Service calls
237
+
238
+ ##
239
+ # Lists RemoteTransportProfiles in a given project and location.
240
+ #
241
+ # @overload list_remote_transport_profiles(request, options = nil)
242
+ # Pass arguments to `list_remote_transport_profiles` via a request object, either of type
243
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListRemoteTransportProfilesRequest} or an equivalent Hash.
244
+ #
245
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListRemoteTransportProfilesRequest, ::Hash]
246
+ # A request object representing the call parameters. Required. To specify no
247
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
248
+ # @param options [::Gapic::CallOptions, ::Hash]
249
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
250
+ #
251
+ # @overload list_remote_transport_profiles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
252
+ # Pass arguments to `list_remote_transport_profiles` via keyword arguments. Note that at
253
+ # least one keyword argument is required. To specify no parameters, or to keep all
254
+ # the default parameter values, pass an empty Hash as a request object (see above).
255
+ #
256
+ # @param parent [::String]
257
+ # Required. Parent value for ListRemoteTransportProfilesRequest.
258
+ # @param page_size [::Integer]
259
+ # Optional. Requested page size. Server may return fewer items than
260
+ # requested. If unspecified, server will pick an appropriate default.
261
+ # @param page_token [::String]
262
+ # Optional. A token identifying a page of results the server should return.
263
+ # @param filter [::String]
264
+ # Optional. Filtering results.
265
+ # @param order_by [::String]
266
+ # Optional. Hint for how to order the results.
267
+ # @yield [result, operation] Access the result along with the TransportOperation object
268
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::RemoteTransportProfile>]
269
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
270
+ #
271
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::RemoteTransportProfile>]
272
+ #
273
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
274
+ #
275
+ # @example Basic example
276
+ # require "google/cloud/network_connectivity/v1beta"
277
+ #
278
+ # # Create a client object. The client can be reused for multiple calls.
279
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
280
+ #
281
+ # # Create a request. To set request fields, pass in keyword arguments.
282
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListRemoteTransportProfilesRequest.new
283
+ #
284
+ # # Call the list_remote_transport_profiles method.
285
+ # result = client.list_remote_transport_profiles request
286
+ #
287
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
288
+ # # over elements, and API calls will be issued to fetch pages as needed.
289
+ # result.each do |item|
290
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::RemoteTransportProfile.
291
+ # p item
292
+ # end
293
+ #
294
+ def list_remote_transport_profiles request, options = nil
295
+ raise ::ArgumentError, "request must be provided" if request.nil?
296
+
297
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListRemoteTransportProfilesRequest
298
+
299
+ # Converts hash and nil to an options object
300
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
301
+
302
+ # Customize the options with defaults
303
+ call_metadata = @config.rpcs.list_remote_transport_profiles.metadata.to_h
304
+
305
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
306
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
307
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
308
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
309
+ transports_version_send: [:rest]
310
+
311
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
312
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
313
+
314
+ options.apply_defaults timeout: @config.rpcs.list_remote_transport_profiles.timeout,
315
+ metadata: call_metadata,
316
+ retry_policy: @config.rpcs.list_remote_transport_profiles.retry_policy
317
+
318
+ options.apply_defaults timeout: @config.timeout,
319
+ metadata: @config.metadata,
320
+ retry_policy: @config.retry_policy
321
+
322
+ @transport_manager_stub.list_remote_transport_profiles request, options do |result, operation|
323
+ result = ::Gapic::Rest::PagedEnumerable.new @transport_manager_stub, :list_remote_transport_profiles, "remote_transport_profiles", request, result, options
324
+ yield result, operation if block_given?
325
+ throw :response, result
326
+ end
327
+ rescue ::Gapic::Rest::Error => e
328
+ raise ::Google::Cloud::Error.from_error(e)
329
+ end
330
+
331
+ ##
332
+ # Gets details of a single RemoteTransportProfile.
333
+ #
334
+ # @overload get_remote_transport_profile(request, options = nil)
335
+ # Pass arguments to `get_remote_transport_profile` via a request object, either of type
336
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetRemoteTransportProfileRequest} or an equivalent Hash.
337
+ #
338
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetRemoteTransportProfileRequest, ::Hash]
339
+ # A request object representing the call parameters. Required. To specify no
340
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
341
+ # @param options [::Gapic::CallOptions, ::Hash]
342
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
343
+ #
344
+ # @overload get_remote_transport_profile(name: nil)
345
+ # Pass arguments to `get_remote_transport_profile` via keyword arguments. Note that at
346
+ # least one keyword argument is required. To specify no parameters, or to keep all
347
+ # the default parameter values, pass an empty Hash as a request object (see above).
348
+ #
349
+ # @param name [::String]
350
+ # Required. Name of the resource.
351
+ # @yield [result, operation] Access the result along with the TransportOperation object
352
+ # @yieldparam result [::Google::Cloud::NetworkConnectivity::V1beta::RemoteTransportProfile]
353
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
354
+ #
355
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::RemoteTransportProfile]
356
+ #
357
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
358
+ #
359
+ # @example Basic example
360
+ # require "google/cloud/network_connectivity/v1beta"
361
+ #
362
+ # # Create a client object. The client can be reused for multiple calls.
363
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
364
+ #
365
+ # # Create a request. To set request fields, pass in keyword arguments.
366
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetRemoteTransportProfileRequest.new
367
+ #
368
+ # # Call the get_remote_transport_profile method.
369
+ # result = client.get_remote_transport_profile request
370
+ #
371
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::RemoteTransportProfile.
372
+ # p result
373
+ #
374
+ def get_remote_transport_profile request, options = nil
375
+ raise ::ArgumentError, "request must be provided" if request.nil?
376
+
377
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetRemoteTransportProfileRequest
378
+
379
+ # Converts hash and nil to an options object
380
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
381
+
382
+ # Customize the options with defaults
383
+ call_metadata = @config.rpcs.get_remote_transport_profile.metadata.to_h
384
+
385
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
386
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
387
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
388
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
389
+ transports_version_send: [:rest]
390
+
391
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
392
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
393
+
394
+ options.apply_defaults timeout: @config.rpcs.get_remote_transport_profile.timeout,
395
+ metadata: call_metadata,
396
+ retry_policy: @config.rpcs.get_remote_transport_profile.retry_policy
397
+
398
+ options.apply_defaults timeout: @config.timeout,
399
+ metadata: @config.metadata,
400
+ retry_policy: @config.retry_policy
401
+
402
+ @transport_manager_stub.get_remote_transport_profile request, options do |result, operation|
403
+ yield result, operation if block_given?
404
+ end
405
+ rescue ::Gapic::Rest::Error => e
406
+ raise ::Google::Cloud::Error.from_error(e)
407
+ end
408
+
409
+ ##
410
+ # Gets details of a single RemoteTransportProfile given an activation key.
411
+ #
412
+ # @overload parse_from_activation_key(request, options = nil)
413
+ # Pass arguments to `parse_from_activation_key` via a request object, either of type
414
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ParseFromActivationKeyRequest} or an equivalent Hash.
415
+ #
416
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ParseFromActivationKeyRequest, ::Hash]
417
+ # A request object representing the call parameters. Required. To specify no
418
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
419
+ # @param options [::Gapic::CallOptions, ::Hash]
420
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
421
+ #
422
+ # @overload parse_from_activation_key(parent: nil, activation_key: nil)
423
+ # Pass arguments to `parse_from_activation_key` via keyword arguments. Note that at
424
+ # least one keyword argument is required. To specify no parameters, or to keep all
425
+ # the default parameter values, pass an empty Hash as a request object (see above).
426
+ #
427
+ # @param parent [::String]
428
+ # Required. Parent value for ParseFromActivationKeyRequest.
429
+ # @param activation_key [::String]
430
+ # Required. The activation key to get the RemoteTransportProfile for.
431
+ # @yield [result, operation] Access the result along with the TransportOperation object
432
+ # @yieldparam result [::Google::Cloud::NetworkConnectivity::V1beta::ParseFromActivationKeyResponse]
433
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
434
+ #
435
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::ParseFromActivationKeyResponse]
436
+ #
437
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
438
+ #
439
+ # @example Basic example
440
+ # require "google/cloud/network_connectivity/v1beta"
441
+ #
442
+ # # Create a client object. The client can be reused for multiple calls.
443
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
444
+ #
445
+ # # Create a request. To set request fields, pass in keyword arguments.
446
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ParseFromActivationKeyRequest.new
447
+ #
448
+ # # Call the parse_from_activation_key method.
449
+ # result = client.parse_from_activation_key request
450
+ #
451
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::ParseFromActivationKeyResponse.
452
+ # p result
453
+ #
454
+ def parse_from_activation_key request, options = nil
455
+ raise ::ArgumentError, "request must be provided" if request.nil?
456
+
457
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ParseFromActivationKeyRequest
458
+
459
+ # Converts hash and nil to an options object
460
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
461
+
462
+ # Customize the options with defaults
463
+ call_metadata = @config.rpcs.parse_from_activation_key.metadata.to_h
464
+
465
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
466
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
467
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
468
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
469
+ transports_version_send: [:rest]
470
+
471
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
472
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
473
+
474
+ options.apply_defaults timeout: @config.rpcs.parse_from_activation_key.timeout,
475
+ metadata: call_metadata,
476
+ retry_policy: @config.rpcs.parse_from_activation_key.retry_policy
477
+
478
+ options.apply_defaults timeout: @config.timeout,
479
+ metadata: @config.metadata,
480
+ retry_policy: @config.retry_policy
481
+
482
+ @transport_manager_stub.parse_from_activation_key request, options do |result, operation|
483
+ yield result, operation if block_given?
484
+ end
485
+ rescue ::Gapic::Rest::Error => e
486
+ raise ::Google::Cloud::Error.from_error(e)
487
+ end
488
+
489
+ ##
490
+ # Lists Transports in a given project and location.
491
+ #
492
+ # @overload list_transports(request, options = nil)
493
+ # Pass arguments to `list_transports` via a request object, either of type
494
+ # {::Google::Cloud::NetworkConnectivity::V1beta::ListTransportsRequest} or an equivalent Hash.
495
+ #
496
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::ListTransportsRequest, ::Hash]
497
+ # A request object representing the call parameters. Required. To specify no
498
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
499
+ # @param options [::Gapic::CallOptions, ::Hash]
500
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
501
+ #
502
+ # @overload list_transports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
503
+ # Pass arguments to `list_transports` via keyword arguments. Note that at
504
+ # least one keyword argument is required. To specify no parameters, or to keep all
505
+ # the default parameter values, pass an empty Hash as a request object (see above).
506
+ #
507
+ # @param parent [::String]
508
+ # Required. Parent value for ListTransportsRequest.
509
+ # @param page_size [::Integer]
510
+ # Optional. Requested page size. Server may return fewer items than
511
+ # requested. If unspecified, server will pick an appropriate default.
512
+ # @param page_token [::String]
513
+ # Optional. A token identifying a page of results the server should return.
514
+ # @param filter [::String]
515
+ # Optional. Filtering results.
516
+ # @param order_by [::String]
517
+ # Optional. Hint for how to order the results.
518
+ # @yield [result, operation] Access the result along with the TransportOperation object
519
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Transport>]
520
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
521
+ #
522
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1beta::Transport>]
523
+ #
524
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
525
+ #
526
+ # @example Basic example
527
+ # require "google/cloud/network_connectivity/v1beta"
528
+ #
529
+ # # Create a client object. The client can be reused for multiple calls.
530
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
531
+ #
532
+ # # Create a request. To set request fields, pass in keyword arguments.
533
+ # request = Google::Cloud::NetworkConnectivity::V1beta::ListTransportsRequest.new
534
+ #
535
+ # # Call the list_transports method.
536
+ # result = client.list_transports request
537
+ #
538
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
539
+ # # over elements, and API calls will be issued to fetch pages as needed.
540
+ # result.each do |item|
541
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1beta::Transport.
542
+ # p item
543
+ # end
544
+ #
545
+ def list_transports request, options = nil
546
+ raise ::ArgumentError, "request must be provided" if request.nil?
547
+
548
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::ListTransportsRequest
549
+
550
+ # Converts hash and nil to an options object
551
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
552
+
553
+ # Customize the options with defaults
554
+ call_metadata = @config.rpcs.list_transports.metadata.to_h
555
+
556
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
557
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
558
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
559
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
560
+ transports_version_send: [:rest]
561
+
562
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
563
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
564
+
565
+ options.apply_defaults timeout: @config.rpcs.list_transports.timeout,
566
+ metadata: call_metadata,
567
+ retry_policy: @config.rpcs.list_transports.retry_policy
568
+
569
+ options.apply_defaults timeout: @config.timeout,
570
+ metadata: @config.metadata,
571
+ retry_policy: @config.retry_policy
572
+
573
+ @transport_manager_stub.list_transports request, options do |result, operation|
574
+ result = ::Gapic::Rest::PagedEnumerable.new @transport_manager_stub, :list_transports, "transports", request, result, options
575
+ yield result, operation if block_given?
576
+ throw :response, result
577
+ end
578
+ rescue ::Gapic::Rest::Error => e
579
+ raise ::Google::Cloud::Error.from_error(e)
580
+ end
581
+
582
+ ##
583
+ # Gets details of a single Transport.
584
+ #
585
+ # @overload get_transport(request, options = nil)
586
+ # Pass arguments to `get_transport` via a request object, either of type
587
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetTransportRequest} or an equivalent Hash.
588
+ #
589
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetTransportRequest, ::Hash]
590
+ # A request object representing the call parameters. Required. To specify no
591
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
592
+ # @param options [::Gapic::CallOptions, ::Hash]
593
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
594
+ #
595
+ # @overload get_transport(name: nil)
596
+ # Pass arguments to `get_transport` via keyword arguments. Note that at
597
+ # least one keyword argument is required. To specify no parameters, or to keep all
598
+ # the default parameter values, pass an empty Hash as a request object (see above).
599
+ #
600
+ # @param name [::String]
601
+ # Required. Name of the resource.
602
+ # @yield [result, operation] Access the result along with the TransportOperation object
603
+ # @yieldparam result [::Google::Cloud::NetworkConnectivity::V1beta::Transport]
604
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
605
+ #
606
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::Transport]
607
+ #
608
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
609
+ #
610
+ # @example Basic example
611
+ # require "google/cloud/network_connectivity/v1beta"
612
+ #
613
+ # # Create a client object. The client can be reused for multiple calls.
614
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
615
+ #
616
+ # # Create a request. To set request fields, pass in keyword arguments.
617
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetTransportRequest.new
618
+ #
619
+ # # Call the get_transport method.
620
+ # result = client.get_transport request
621
+ #
622
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::Transport.
623
+ # p result
624
+ #
625
+ def get_transport request, options = nil
626
+ raise ::ArgumentError, "request must be provided" if request.nil?
627
+
628
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetTransportRequest
629
+
630
+ # Converts hash and nil to an options object
631
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
632
+
633
+ # Customize the options with defaults
634
+ call_metadata = @config.rpcs.get_transport.metadata.to_h
635
+
636
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
637
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
638
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
639
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
640
+ transports_version_send: [:rest]
641
+
642
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
643
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
644
+
645
+ options.apply_defaults timeout: @config.rpcs.get_transport.timeout,
646
+ metadata: call_metadata,
647
+ retry_policy: @config.rpcs.get_transport.retry_policy
648
+
649
+ options.apply_defaults timeout: @config.timeout,
650
+ metadata: @config.metadata,
651
+ retry_policy: @config.retry_policy
652
+
653
+ @transport_manager_stub.get_transport request, options do |result, operation|
654
+ yield result, operation if block_given?
655
+ end
656
+ rescue ::Gapic::Rest::Error => e
657
+ raise ::Google::Cloud::Error.from_error(e)
658
+ end
659
+
660
+ ##
661
+ # Gets the operational status of a single Transport.
662
+ #
663
+ # @overload get_status(request, options = nil)
664
+ # Pass arguments to `get_status` via a request object, either of type
665
+ # {::Google::Cloud::NetworkConnectivity::V1beta::GetStatusRequest} or an equivalent Hash.
666
+ #
667
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::GetStatusRequest, ::Hash]
668
+ # A request object representing the call parameters. Required. To specify no
669
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
670
+ # @param options [::Gapic::CallOptions, ::Hash]
671
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
672
+ #
673
+ # @overload get_status(name: nil, skip_cache: nil)
674
+ # Pass arguments to `get_status` via keyword arguments. Note that at
675
+ # least one keyword argument is required. To specify no parameters, or to keep all
676
+ # the default parameter values, pass an empty Hash as a request object (see above).
677
+ #
678
+ # @param name [::String]
679
+ # Required. Name of the resource.
680
+ # @param skip_cache [::Boolean]
681
+ # Optional. If set to true, the response will bypass any caches and return
682
+ # the freshest possible data.
683
+ # @yield [result, operation] Access the result along with the TransportOperation object
684
+ # @yieldparam result [::Google::Cloud::NetworkConnectivity::V1beta::GetStatusResponse]
685
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
686
+ #
687
+ # @return [::Google::Cloud::NetworkConnectivity::V1beta::GetStatusResponse]
688
+ #
689
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
690
+ #
691
+ # @example Basic example
692
+ # require "google/cloud/network_connectivity/v1beta"
693
+ #
694
+ # # Create a client object. The client can be reused for multiple calls.
695
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
696
+ #
697
+ # # Create a request. To set request fields, pass in keyword arguments.
698
+ # request = Google::Cloud::NetworkConnectivity::V1beta::GetStatusRequest.new
699
+ #
700
+ # # Call the get_status method.
701
+ # result = client.get_status request
702
+ #
703
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1beta::GetStatusResponse.
704
+ # p result
705
+ #
706
+ def get_status request, options = nil
707
+ raise ::ArgumentError, "request must be provided" if request.nil?
708
+
709
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::GetStatusRequest
710
+
711
+ # Converts hash and nil to an options object
712
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
713
+
714
+ # Customize the options with defaults
715
+ call_metadata = @config.rpcs.get_status.metadata.to_h
716
+
717
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
718
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
719
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
720
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
721
+ transports_version_send: [:rest]
722
+
723
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
724
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
725
+
726
+ options.apply_defaults timeout: @config.rpcs.get_status.timeout,
727
+ metadata: call_metadata,
728
+ retry_policy: @config.rpcs.get_status.retry_policy
729
+
730
+ options.apply_defaults timeout: @config.timeout,
731
+ metadata: @config.metadata,
732
+ retry_policy: @config.retry_policy
733
+
734
+ @transport_manager_stub.get_status request, options do |result, operation|
735
+ yield result, operation if block_given?
736
+ end
737
+ rescue ::Gapic::Rest::Error => e
738
+ raise ::Google::Cloud::Error.from_error(e)
739
+ end
740
+
741
+ ##
742
+ # Creates a new Transport in a given project and location.
743
+ #
744
+ # @overload create_transport(request, options = nil)
745
+ # Pass arguments to `create_transport` via a request object, either of type
746
+ # {::Google::Cloud::NetworkConnectivity::V1beta::CreateTransportRequest} or an equivalent Hash.
747
+ #
748
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::CreateTransportRequest, ::Hash]
749
+ # A request object representing the call parameters. Required. To specify no
750
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
751
+ # @param options [::Gapic::CallOptions, ::Hash]
752
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
753
+ #
754
+ # @overload create_transport(parent: nil, transport_id: nil, transport: nil, request_id: nil)
755
+ # Pass arguments to `create_transport` via keyword arguments. Note that at
756
+ # least one keyword argument is required. To specify no parameters, or to keep all
757
+ # the default parameter values, pass an empty Hash as a request object (see above).
758
+ #
759
+ # @param parent [::String]
760
+ # Required. Value for parent.
761
+ # @param transport_id [::String]
762
+ # Required. Id of the requesting object
763
+ # @param transport [::Google::Cloud::NetworkConnectivity::V1beta::Transport, ::Hash]
764
+ # Required. The resource being created
765
+ # @param request_id [::String]
766
+ # Optional. An optional request ID to identify requests. Specify a unique
767
+ # request ID so that if you must retry your request, the server will know to
768
+ # ignore the request if it has already been completed. The server will
769
+ # guarantee that for at least 60 minutes since the first request.
770
+ #
771
+ # For example, consider a situation where you make an initial request and the
772
+ # request times out. If you make the request again with the same request
773
+ # ID, the server can check if original operation with the same request ID
774
+ # was received, and if so, will ignore the second request. This prevents
775
+ # clients from accidentally creating duplicate commitments.
776
+ #
777
+ # The request ID must be a valid UUID with the exception that zero UUID is
778
+ # not supported (00000000-0000-0000-0000-000000000000).
779
+ # @yield [result, operation] Access the result along with the TransportOperation object
780
+ # @yieldparam result [::Gapic::Operation]
781
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
782
+ #
783
+ # @return [::Gapic::Operation]
784
+ #
785
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
786
+ #
787
+ # @example Basic example
788
+ # require "google/cloud/network_connectivity/v1beta"
789
+ #
790
+ # # Create a client object. The client can be reused for multiple calls.
791
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
792
+ #
793
+ # # Create a request. To set request fields, pass in keyword arguments.
794
+ # request = Google::Cloud::NetworkConnectivity::V1beta::CreateTransportRequest.new
795
+ #
796
+ # # Call the create_transport method.
797
+ # result = client.create_transport request
798
+ #
799
+ # # The returned object is of type Gapic::Operation. You can use it to
800
+ # # check the status of an operation, cancel it, or wait for results.
801
+ # # Here is how to wait for a response.
802
+ # result.wait_until_done! timeout: 60
803
+ # if result.response?
804
+ # p result.response
805
+ # else
806
+ # puts "No response received."
807
+ # end
808
+ #
809
+ def create_transport request, options = nil
810
+ raise ::ArgumentError, "request must be provided" if request.nil?
811
+
812
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::CreateTransportRequest
813
+
814
+ # Converts hash and nil to an options object
815
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
816
+
817
+ # Customize the options with defaults
818
+ call_metadata = @config.rpcs.create_transport.metadata.to_h
819
+
820
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
821
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
822
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
823
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
824
+ transports_version_send: [:rest]
825
+
826
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
827
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
828
+
829
+ options.apply_defaults timeout: @config.rpcs.create_transport.timeout,
830
+ metadata: call_metadata,
831
+ retry_policy: @config.rpcs.create_transport.retry_policy
832
+
833
+ options.apply_defaults timeout: @config.timeout,
834
+ metadata: @config.metadata,
835
+ retry_policy: @config.retry_policy
836
+
837
+ @transport_manager_stub.create_transport request, options do |result, operation|
838
+ result = ::Gapic::Operation.new result, @operations_client, options: options
839
+ yield result, operation if block_given?
840
+ throw :response, result
841
+ end
842
+ rescue ::Gapic::Rest::Error => e
843
+ raise ::Google::Cloud::Error.from_error(e)
844
+ end
845
+
846
+ ##
847
+ # Updates the parameters of a single Transport.
848
+ #
849
+ # @overload update_transport(request, options = nil)
850
+ # Pass arguments to `update_transport` via a request object, either of type
851
+ # {::Google::Cloud::NetworkConnectivity::V1beta::UpdateTransportRequest} or an equivalent Hash.
852
+ #
853
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::UpdateTransportRequest, ::Hash]
854
+ # A request object representing the call parameters. Required. To specify no
855
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
856
+ # @param options [::Gapic::CallOptions, ::Hash]
857
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
858
+ #
859
+ # @overload update_transport(update_mask: nil, transport: nil, request_id: nil)
860
+ # Pass arguments to `update_transport` via keyword arguments. Note that at
861
+ # least one keyword argument is required. To specify no parameters, or to keep all
862
+ # the default parameter values, pass an empty Hash as a request object (see above).
863
+ #
864
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
865
+ # Optional. Field mask is used to specify the fields to be overwritten in the
866
+ # Transport resource by the update.
867
+ # The fields specified in the update_mask are relative to the resource, not
868
+ # the full request. A field will be overwritten if it is in the mask. If the
869
+ # user does not provide a mask then all fields present in the request will be
870
+ # overwritten.
871
+ # @param transport [::Google::Cloud::NetworkConnectivity::V1beta::Transport, ::Hash]
872
+ # Required. The resource being updated.
873
+ # @param request_id [::String]
874
+ # Optional. An optional request ID to identify requests. Specify a unique
875
+ # request ID so that if you must retry your request, the server will know to
876
+ # ignore the request if it has already been completed. The server will
877
+ # guarantee that for at least 60 minutes since the first request.
878
+ #
879
+ # For example, consider a situation where you make an initial request and the
880
+ # request times out. If you make the request again with the same request
881
+ # ID, the server can check if original operation with the same request ID
882
+ # was received, and if so, will ignore the second request. This prevents
883
+ # clients from accidentally creating duplicate commitments.
884
+ #
885
+ # The request ID must be a valid UUID with the exception that zero UUID is
886
+ # not supported (00000000-0000-0000-0000-000000000000).
887
+ # @yield [result, operation] Access the result along with the TransportOperation object
888
+ # @yieldparam result [::Gapic::Operation]
889
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
890
+ #
891
+ # @return [::Gapic::Operation]
892
+ #
893
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
894
+ #
895
+ # @example Basic example
896
+ # require "google/cloud/network_connectivity/v1beta"
897
+ #
898
+ # # Create a client object. The client can be reused for multiple calls.
899
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
900
+ #
901
+ # # Create a request. To set request fields, pass in keyword arguments.
902
+ # request = Google::Cloud::NetworkConnectivity::V1beta::UpdateTransportRequest.new
903
+ #
904
+ # # Call the update_transport method.
905
+ # result = client.update_transport request
906
+ #
907
+ # # The returned object is of type Gapic::Operation. You can use it to
908
+ # # check the status of an operation, cancel it, or wait for results.
909
+ # # Here is how to wait for a response.
910
+ # result.wait_until_done! timeout: 60
911
+ # if result.response?
912
+ # p result.response
913
+ # else
914
+ # puts "No response received."
915
+ # end
916
+ #
917
+ def update_transport request, options = nil
918
+ raise ::ArgumentError, "request must be provided" if request.nil?
919
+
920
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::UpdateTransportRequest
921
+
922
+ # Converts hash and nil to an options object
923
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
924
+
925
+ # Customize the options with defaults
926
+ call_metadata = @config.rpcs.update_transport.metadata.to_h
927
+
928
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
929
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
930
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
931
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
932
+ transports_version_send: [:rest]
933
+
934
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
935
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
936
+
937
+ options.apply_defaults timeout: @config.rpcs.update_transport.timeout,
938
+ metadata: call_metadata,
939
+ retry_policy: @config.rpcs.update_transport.retry_policy
940
+
941
+ options.apply_defaults timeout: @config.timeout,
942
+ metadata: @config.metadata,
943
+ retry_policy: @config.retry_policy
944
+
945
+ @transport_manager_stub.update_transport request, options do |result, operation|
946
+ result = ::Gapic::Operation.new result, @operations_client, options: options
947
+ yield result, operation if block_given?
948
+ throw :response, result
949
+ end
950
+ rescue ::Gapic::Rest::Error => e
951
+ raise ::Google::Cloud::Error.from_error(e)
952
+ end
953
+
954
+ ##
955
+ # Deletes a single Transport.
956
+ #
957
+ # @overload delete_transport(request, options = nil)
958
+ # Pass arguments to `delete_transport` via a request object, either of type
959
+ # {::Google::Cloud::NetworkConnectivity::V1beta::DeleteTransportRequest} or an equivalent Hash.
960
+ #
961
+ # @param request [::Google::Cloud::NetworkConnectivity::V1beta::DeleteTransportRequest, ::Hash]
962
+ # A request object representing the call parameters. Required. To specify no
963
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
964
+ # @param options [::Gapic::CallOptions, ::Hash]
965
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
966
+ #
967
+ # @overload delete_transport(name: nil, request_id: nil)
968
+ # Pass arguments to `delete_transport` via keyword arguments. Note that at
969
+ # least one keyword argument is required. To specify no parameters, or to keep all
970
+ # the default parameter values, pass an empty Hash as a request object (see above).
971
+ #
972
+ # @param name [::String]
973
+ # Required. Name of the resource.
974
+ # @param request_id [::String]
975
+ # Optional. An optional request ID to identify requests. Specify a unique
976
+ # request ID so that if you must retry your request, the server will know to
977
+ # ignore the request if it has already been completed. The server will
978
+ # guarantee that for at least 60 minutes after the first request.
979
+ #
980
+ # For example, consider a situation where you make an initial request and the
981
+ # request times out. If you make the request again with the same request
982
+ # ID, the server can check if original operation with the same request ID
983
+ # was received, and if so, will ignore the second request. This prevents
984
+ # clients from accidentally creating duplicate commitments.
985
+ #
986
+ # The request ID must be a valid UUID with the exception that zero UUID is
987
+ # not supported (00000000-0000-0000-0000-000000000000).
988
+ # @yield [result, operation] Access the result along with the TransportOperation object
989
+ # @yieldparam result [::Gapic::Operation]
990
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
991
+ #
992
+ # @return [::Gapic::Operation]
993
+ #
994
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
995
+ #
996
+ # @example Basic example
997
+ # require "google/cloud/network_connectivity/v1beta"
998
+ #
999
+ # # Create a client object. The client can be reused for multiple calls.
1000
+ # client = Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new
1001
+ #
1002
+ # # Create a request. To set request fields, pass in keyword arguments.
1003
+ # request = Google::Cloud::NetworkConnectivity::V1beta::DeleteTransportRequest.new
1004
+ #
1005
+ # # Call the delete_transport method.
1006
+ # result = client.delete_transport request
1007
+ #
1008
+ # # The returned object is of type Gapic::Operation. You can use it to
1009
+ # # check the status of an operation, cancel it, or wait for results.
1010
+ # # Here is how to wait for a response.
1011
+ # result.wait_until_done! timeout: 60
1012
+ # if result.response?
1013
+ # p result.response
1014
+ # else
1015
+ # puts "No response received."
1016
+ # end
1017
+ #
1018
+ def delete_transport request, options = nil
1019
+ raise ::ArgumentError, "request must be provided" if request.nil?
1020
+
1021
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1beta::DeleteTransportRequest
1022
+
1023
+ # Converts hash and nil to an options object
1024
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1025
+
1026
+ # Customize the options with defaults
1027
+ call_metadata = @config.rpcs.delete_transport.metadata.to_h
1028
+
1029
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1030
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1031
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1032
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1beta::VERSION,
1033
+ transports_version_send: [:rest]
1034
+
1035
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1036
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1037
+
1038
+ options.apply_defaults timeout: @config.rpcs.delete_transport.timeout,
1039
+ metadata: call_metadata,
1040
+ retry_policy: @config.rpcs.delete_transport.retry_policy
1041
+
1042
+ options.apply_defaults timeout: @config.timeout,
1043
+ metadata: @config.metadata,
1044
+ retry_policy: @config.retry_policy
1045
+
1046
+ @transport_manager_stub.delete_transport request, options do |result, operation|
1047
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1048
+ yield result, operation if block_given?
1049
+ throw :response, result
1050
+ end
1051
+ rescue ::Gapic::Rest::Error => e
1052
+ raise ::Google::Cloud::Error.from_error(e)
1053
+ end
1054
+
1055
+ ##
1056
+ # Configuration class for the TransportManager REST API.
1057
+ #
1058
+ # This class represents the configuration for TransportManager REST,
1059
+ # providing control over timeouts, retry behavior, logging, transport
1060
+ # parameters, and other low-level controls. Certain parameters can also be
1061
+ # applied individually to specific RPCs. See
1062
+ # {::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client::Configuration::Rpcs}
1063
+ # for a list of RPCs that can be configured independently.
1064
+ #
1065
+ # Configuration can be applied globally to all clients, or to a single client
1066
+ # on construction.
1067
+ #
1068
+ # @example
1069
+ #
1070
+ # # Modify the global config, setting the timeout for
1071
+ # # list_remote_transport_profiles to 20 seconds,
1072
+ # # and all remaining timeouts to 10 seconds.
1073
+ # ::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.configure do |config|
1074
+ # config.timeout = 10.0
1075
+ # config.rpcs.list_remote_transport_profiles.timeout = 20.0
1076
+ # end
1077
+ #
1078
+ # # Apply the above configuration only to a new client.
1079
+ # client = ::Google::Cloud::NetworkConnectivity::V1beta::TransportManager::Rest::Client.new do |config|
1080
+ # config.timeout = 10.0
1081
+ # config.rpcs.list_remote_transport_profiles.timeout = 20.0
1082
+ # end
1083
+ #
1084
+ # @!attribute [rw] endpoint
1085
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1086
+ # nil, indicating to use the default endpoint in the current universe domain.
1087
+ # @return [::String,nil]
1088
+ # @!attribute [rw] credentials
1089
+ # Credentials to send with calls. You may provide any of the following types:
1090
+ # * (`String`) The path to a service account key file in JSON format
1091
+ # * (`Hash`) A service account key as a Hash
1092
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1093
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1094
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1095
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1096
+ # * (`nil`) indicating no credentials
1097
+ #
1098
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1099
+ # external source for authentication to Google Cloud, you must validate it before
1100
+ # providing it to a Google API client library. Providing an unvalidated credential
1101
+ # configuration to Google APIs can compromise the security of your systems and data.
1102
+ # For more information, refer to [Validate credential configurations from external
1103
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1104
+ # @return [::Object]
1105
+ # @!attribute [rw] scope
1106
+ # The OAuth scopes
1107
+ # @return [::Array<::String>]
1108
+ # @!attribute [rw] lib_name
1109
+ # The library name as recorded in instrumentation and logging
1110
+ # @return [::String]
1111
+ # @!attribute [rw] lib_version
1112
+ # The library version as recorded in instrumentation and logging
1113
+ # @return [::String]
1114
+ # @!attribute [rw] timeout
1115
+ # The call timeout in seconds.
1116
+ # @return [::Numeric]
1117
+ # @!attribute [rw] metadata
1118
+ # Additional headers to be sent with the call.
1119
+ # @return [::Hash{::Symbol=>::String}]
1120
+ # @!attribute [rw] retry_policy
1121
+ # The retry policy. The value is a hash with the following keys:
1122
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1123
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1124
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1125
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1126
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1127
+ # trigger a retry.
1128
+ # @return [::Hash]
1129
+ # @!attribute [rw] quota_project
1130
+ # A separate project against which to charge quota.
1131
+ # @return [::String]
1132
+ # @!attribute [rw] universe_domain
1133
+ # The universe domain within which to make requests. This determines the
1134
+ # default endpoint URL. The default value of nil uses the environment
1135
+ # universe (usually the default "googleapis.com" universe).
1136
+ # @return [::String,nil]
1137
+ # @!attribute [rw] logger
1138
+ # A custom logger to use for request/response debug logging, or the value
1139
+ # `:default` (the default) to construct a default logger, or `nil` to
1140
+ # explicitly disable logging.
1141
+ # @return [::Logger,:default,nil]
1142
+ #
1143
+ class Configuration
1144
+ extend ::Gapic::Config
1145
+
1146
+ # @private
1147
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1148
+ DEFAULT_ENDPOINT = "networkconnectivity.googleapis.com"
1149
+
1150
+ config_attr :endpoint, nil, ::String, nil
1151
+ config_attr :credentials, nil do |value|
1152
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1153
+ allowed.any? { |klass| klass === value }
1154
+ end
1155
+ config_attr :scope, nil, ::String, ::Array, nil
1156
+ config_attr :lib_name, nil, ::String, nil
1157
+ config_attr :lib_version, nil, ::String, nil
1158
+ config_attr :timeout, nil, ::Numeric, nil
1159
+ config_attr :metadata, nil, ::Hash, nil
1160
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1161
+ config_attr :quota_project, nil, ::String, nil
1162
+ config_attr :universe_domain, nil, ::String, nil
1163
+
1164
+ # @private
1165
+ # Overrides for http bindings for the RPCs of this service
1166
+ # are only used when this service is used as mixin, and only
1167
+ # by the host service.
1168
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1169
+ config_attr :bindings_override, {}, ::Hash, nil
1170
+ config_attr :logger, :default, ::Logger, nil, :default
1171
+
1172
+ # @private
1173
+ def initialize parent_config = nil
1174
+ @parent_config = parent_config unless parent_config.nil?
1175
+
1176
+ yield self if block_given?
1177
+ end
1178
+
1179
+ ##
1180
+ # Configurations for individual RPCs
1181
+ # @return [Rpcs]
1182
+ #
1183
+ def rpcs
1184
+ @rpcs ||= begin
1185
+ parent_rpcs = nil
1186
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1187
+ Rpcs.new parent_rpcs
1188
+ end
1189
+ end
1190
+
1191
+ ##
1192
+ # Configuration RPC class for the TransportManager API.
1193
+ #
1194
+ # Includes fields providing the configuration for each RPC in this service.
1195
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1196
+ # the following configuration fields:
1197
+ #
1198
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1199
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1200
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1201
+ # include the following keys:
1202
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1203
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1204
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1205
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1206
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1207
+ # trigger a retry.
1208
+ #
1209
+ class Rpcs
1210
+ ##
1211
+ # RPC-specific configuration for `list_remote_transport_profiles`
1212
+ # @return [::Gapic::Config::Method]
1213
+ #
1214
+ attr_reader :list_remote_transport_profiles
1215
+ ##
1216
+ # RPC-specific configuration for `get_remote_transport_profile`
1217
+ # @return [::Gapic::Config::Method]
1218
+ #
1219
+ attr_reader :get_remote_transport_profile
1220
+ ##
1221
+ # RPC-specific configuration for `parse_from_activation_key`
1222
+ # @return [::Gapic::Config::Method]
1223
+ #
1224
+ attr_reader :parse_from_activation_key
1225
+ ##
1226
+ # RPC-specific configuration for `list_transports`
1227
+ # @return [::Gapic::Config::Method]
1228
+ #
1229
+ attr_reader :list_transports
1230
+ ##
1231
+ # RPC-specific configuration for `get_transport`
1232
+ # @return [::Gapic::Config::Method]
1233
+ #
1234
+ attr_reader :get_transport
1235
+ ##
1236
+ # RPC-specific configuration for `get_status`
1237
+ # @return [::Gapic::Config::Method]
1238
+ #
1239
+ attr_reader :get_status
1240
+ ##
1241
+ # RPC-specific configuration for `create_transport`
1242
+ # @return [::Gapic::Config::Method]
1243
+ #
1244
+ attr_reader :create_transport
1245
+ ##
1246
+ # RPC-specific configuration for `update_transport`
1247
+ # @return [::Gapic::Config::Method]
1248
+ #
1249
+ attr_reader :update_transport
1250
+ ##
1251
+ # RPC-specific configuration for `delete_transport`
1252
+ # @return [::Gapic::Config::Method]
1253
+ #
1254
+ attr_reader :delete_transport
1255
+
1256
+ # @private
1257
+ def initialize parent_rpcs = nil
1258
+ list_remote_transport_profiles_config = parent_rpcs.list_remote_transport_profiles if parent_rpcs.respond_to? :list_remote_transport_profiles
1259
+ @list_remote_transport_profiles = ::Gapic::Config::Method.new list_remote_transport_profiles_config
1260
+ get_remote_transport_profile_config = parent_rpcs.get_remote_transport_profile if parent_rpcs.respond_to? :get_remote_transport_profile
1261
+ @get_remote_transport_profile = ::Gapic::Config::Method.new get_remote_transport_profile_config
1262
+ parse_from_activation_key_config = parent_rpcs.parse_from_activation_key if parent_rpcs.respond_to? :parse_from_activation_key
1263
+ @parse_from_activation_key = ::Gapic::Config::Method.new parse_from_activation_key_config
1264
+ list_transports_config = parent_rpcs.list_transports if parent_rpcs.respond_to? :list_transports
1265
+ @list_transports = ::Gapic::Config::Method.new list_transports_config
1266
+ get_transport_config = parent_rpcs.get_transport if parent_rpcs.respond_to? :get_transport
1267
+ @get_transport = ::Gapic::Config::Method.new get_transport_config
1268
+ get_status_config = parent_rpcs.get_status if parent_rpcs.respond_to? :get_status
1269
+ @get_status = ::Gapic::Config::Method.new get_status_config
1270
+ create_transport_config = parent_rpcs.create_transport if parent_rpcs.respond_to? :create_transport
1271
+ @create_transport = ::Gapic::Config::Method.new create_transport_config
1272
+ update_transport_config = parent_rpcs.update_transport if parent_rpcs.respond_to? :update_transport
1273
+ @update_transport = ::Gapic::Config::Method.new update_transport_config
1274
+ delete_transport_config = parent_rpcs.delete_transport if parent_rpcs.respond_to? :delete_transport
1275
+ @delete_transport = ::Gapic::Config::Method.new delete_transport_config
1276
+
1277
+ yield self if block_given?
1278
+ end
1279
+ end
1280
+ end
1281
+ end
1282
+ end
1283
+ end
1284
+ end
1285
+ end
1286
+ end
1287
+ end