google-cloud-network_connectivity-v1 1.7.0 → 1.8.0

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.
@@ -0,0 +1,1765 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/v1/data_transfer_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module NetworkConnectivity
27
+ module V1
28
+ module DataTransferService
29
+ ##
30
+ # Client for the DataTransferService service.
31
+ #
32
+ # DataTransferService is the service for the Data Transfer API.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "networkconnectivity.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :data_transfer_service_stub
45
+
46
+ ##
47
+ # Configure the DataTransferService Client class.
48
+ #
49
+ # See {::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all DataTransferService clients
55
+ # ::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "NetworkConnectivity", "V1"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.timeout = 60.0
76
+ default_config.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config.rpcs.list_multicloud_data_transfer_configs.timeout = 60.0
81
+
82
+ default_config.rpcs.get_multicloud_data_transfer_config.timeout = 60.0
83
+
84
+ default_config.rpcs.create_multicloud_data_transfer_config.timeout = 60.0
85
+
86
+ default_config.rpcs.update_multicloud_data_transfer_config.timeout = 60.0
87
+
88
+ default_config.rpcs.delete_multicloud_data_transfer_config.timeout = 60.0
89
+
90
+ default_config.rpcs.list_destinations.timeout = 60.0
91
+
92
+ default_config.rpcs.get_destination.timeout = 60.0
93
+
94
+ default_config.rpcs.create_destination.timeout = 60.0
95
+
96
+ default_config.rpcs.update_destination.timeout = 60.0
97
+
98
+ default_config.rpcs.delete_destination.timeout = 60.0
99
+
100
+ default_config.rpcs.get_multicloud_data_transfer_supported_service.timeout = 60.0
101
+
102
+ default_config.rpcs.list_multicloud_data_transfer_supported_services.timeout = 60.0
103
+
104
+ default_config
105
+ end
106
+ yield @configure if block_given?
107
+ @configure
108
+ end
109
+
110
+ ##
111
+ # Configure the DataTransferService Client instance.
112
+ #
113
+ # The configuration is set to the derived mode, meaning that values can be changed,
114
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
115
+ # should be made on {Client.configure}.
116
+ #
117
+ # See {::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client::Configuration}
118
+ # for a description of the configuration fields.
119
+ #
120
+ # @yield [config] Configure the Client client.
121
+ # @yieldparam config [Client::Configuration]
122
+ #
123
+ # @return [Client::Configuration]
124
+ #
125
+ def configure
126
+ yield @config if block_given?
127
+ @config
128
+ end
129
+
130
+ ##
131
+ # The effective universe domain
132
+ #
133
+ # @return [String]
134
+ #
135
+ def universe_domain
136
+ @data_transfer_service_stub.universe_domain
137
+ end
138
+
139
+ ##
140
+ # Create a new DataTransferService client object.
141
+ #
142
+ # @example
143
+ #
144
+ # # Create a client using the default configuration
145
+ # client = ::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
146
+ #
147
+ # # Create a client using a custom configuration
148
+ # client = ::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new do |config|
149
+ # config.timeout = 10.0
150
+ # end
151
+ #
152
+ # @yield [config] Configure the DataTransferService client.
153
+ # @yieldparam config [Client::Configuration]
154
+ #
155
+ def initialize
156
+ # These require statements are intentionally placed here to initialize
157
+ # the gRPC module only when it's required.
158
+ # See https://github.com/googleapis/toolkit/issues/446
159
+ require "gapic/grpc"
160
+ require "google/cloud/networkconnectivity/v1/data_transfer_services_pb"
161
+
162
+ # Create the configuration object
163
+ @config = Configuration.new Client.configure
164
+
165
+ # Yield the configuration if needed
166
+ yield @config if block_given?
167
+
168
+ # Create credentials
169
+ credentials = @config.credentials
170
+ # Use self-signed JWT if the endpoint is unchanged from default,
171
+ # but only if the default endpoint does not have a region prefix.
172
+ enable_self_signed_jwt = @config.endpoint.nil? ||
173
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
174
+ !@config.endpoint.split(".").first.include?("-"))
175
+ credentials ||= Credentials.default scope: @config.scope,
176
+ enable_self_signed_jwt: enable_self_signed_jwt
177
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
178
+ credentials = Credentials.new credentials, scope: @config.scope
179
+ end
180
+ @quota_project_id = @config.quota_project
181
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
182
+
183
+ @operations_client = Operations.new do |config|
184
+ config.credentials = credentials
185
+ config.quota_project = @quota_project_id
186
+ config.endpoint = @config.endpoint
187
+ config.universe_domain = @config.universe_domain
188
+ end
189
+
190
+ @data_transfer_service_stub = ::Gapic::ServiceStub.new(
191
+ ::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Stub,
192
+ credentials: credentials,
193
+ endpoint: @config.endpoint,
194
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
195
+ universe_domain: @config.universe_domain,
196
+ channel_args: @config.channel_args,
197
+ interceptors: @config.interceptors,
198
+ channel_pool_config: @config.channel_pool,
199
+ logger: @config.logger
200
+ )
201
+
202
+ @data_transfer_service_stub.stub_logger&.info do |entry|
203
+ entry.set_system_name
204
+ entry.set_service
205
+ entry.message = "Created client for #{entry.service}"
206
+ entry.set_credentials_fields credentials
207
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
208
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
209
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
210
+ end
211
+
212
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
213
+ config.credentials = credentials
214
+ config.quota_project = @quota_project_id
215
+ config.endpoint = @data_transfer_service_stub.endpoint
216
+ config.universe_domain = @data_transfer_service_stub.universe_domain
217
+ config.logger = @data_transfer_service_stub.logger if config.respond_to? :logger=
218
+ end
219
+
220
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
221
+ config.credentials = credentials
222
+ config.quota_project = @quota_project_id
223
+ config.endpoint = @data_transfer_service_stub.endpoint
224
+ config.universe_domain = @data_transfer_service_stub.universe_domain
225
+ config.logger = @data_transfer_service_stub.logger if config.respond_to? :logger=
226
+ end
227
+ end
228
+
229
+ ##
230
+ # Get the associated client for long-running operations.
231
+ #
232
+ # @return [::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Operations]
233
+ #
234
+ attr_reader :operations_client
235
+
236
+ ##
237
+ # Get the associated client for mix-in of the Locations.
238
+ #
239
+ # @return [Google::Cloud::Location::Locations::Client]
240
+ #
241
+ attr_reader :location_client
242
+
243
+ ##
244
+ # Get the associated client for mix-in of the IAMPolicy.
245
+ #
246
+ # @return [Google::Iam::V1::IAMPolicy::Client]
247
+ #
248
+ attr_reader :iam_policy_client
249
+
250
+ ##
251
+ # The logger used for request/response debug logging.
252
+ #
253
+ # @return [Logger]
254
+ #
255
+ def logger
256
+ @data_transfer_service_stub.logger
257
+ end
258
+
259
+ # Service calls
260
+
261
+ ##
262
+ # Lists the `MulticloudDataTransferConfig` resources in a specified project
263
+ # and location.
264
+ #
265
+ # @overload list_multicloud_data_transfer_configs(request, options = nil)
266
+ # Pass arguments to `list_multicloud_data_transfer_configs` via a request object, either of type
267
+ # {::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferConfigsRequest} or an equivalent Hash.
268
+ #
269
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferConfigsRequest, ::Hash]
270
+ # A request object representing the call parameters. Required. To specify no
271
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
272
+ # @param options [::Gapic::CallOptions, ::Hash]
273
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
274
+ #
275
+ # @overload list_multicloud_data_transfer_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil)
276
+ # Pass arguments to `list_multicloud_data_transfer_configs` via keyword arguments. Note that at
277
+ # least one keyword argument is required. To specify no parameters, or to keep all
278
+ # the default parameter values, pass an empty Hash as a request object (see above).
279
+ #
280
+ # @param parent [::String]
281
+ # Required. The name of the parent resource.
282
+ # @param page_size [::Integer]
283
+ # Optional. The maximum number of results listed per page.
284
+ # @param page_token [::String]
285
+ # Optional. The page token.
286
+ # @param filter [::String]
287
+ # Optional. An expression that filters the results listed in the response.
288
+ # @param order_by [::String]
289
+ # Optional. The sort order of the results.
290
+ # @param return_partial_success [::Boolean]
291
+ # Optional. If `true`, allows partial responses for multi-regional aggregated
292
+ # list requests.
293
+ #
294
+ # @yield [response, operation] Access the result along with the RPC operation
295
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig>]
296
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
297
+ #
298
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig>]
299
+ #
300
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
301
+ #
302
+ # @example Basic example
303
+ # require "google/cloud/network_connectivity/v1"
304
+ #
305
+ # # Create a client object. The client can be reused for multiple calls.
306
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
307
+ #
308
+ # # Create a request. To set request fields, pass in keyword arguments.
309
+ # request = Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferConfigsRequest.new
310
+ #
311
+ # # Call the list_multicloud_data_transfer_configs method.
312
+ # result = client.list_multicloud_data_transfer_configs request
313
+ #
314
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
315
+ # # over elements, and API calls will be issued to fetch pages as needed.
316
+ # result.each do |item|
317
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig.
318
+ # p item
319
+ # end
320
+ #
321
+ def list_multicloud_data_transfer_configs request, options = nil
322
+ raise ::ArgumentError, "request must be provided" if request.nil?
323
+
324
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferConfigsRequest
325
+
326
+ # Converts hash and nil to an options object
327
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
328
+
329
+ # Customize the options with defaults
330
+ metadata = @config.rpcs.list_multicloud_data_transfer_configs.metadata.to_h
331
+
332
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
333
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
334
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
335
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
336
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
337
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
338
+
339
+ header_params = {}
340
+ if request.parent
341
+ header_params["parent"] = request.parent
342
+ end
343
+
344
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
345
+ metadata[:"x-goog-request-params"] ||= request_params_header
346
+
347
+ options.apply_defaults timeout: @config.rpcs.list_multicloud_data_transfer_configs.timeout,
348
+ metadata: metadata,
349
+ retry_policy: @config.rpcs.list_multicloud_data_transfer_configs.retry_policy
350
+
351
+ options.apply_defaults timeout: @config.timeout,
352
+ metadata: @config.metadata,
353
+ retry_policy: @config.retry_policy
354
+
355
+ @data_transfer_service_stub.call_rpc :list_multicloud_data_transfer_configs, request, options: options do |response, operation|
356
+ response = ::Gapic::PagedEnumerable.new @data_transfer_service_stub, :list_multicloud_data_transfer_configs, request, response, operation, options
357
+ yield response, operation if block_given?
358
+ throw :response, response
359
+ end
360
+ rescue ::GRPC::BadStatus => e
361
+ raise ::Google::Cloud::Error.from_error(e)
362
+ end
363
+
364
+ ##
365
+ # Gets the details of a `MulticloudDataTransferConfig` resource.
366
+ #
367
+ # @overload get_multicloud_data_transfer_config(request, options = nil)
368
+ # Pass arguments to `get_multicloud_data_transfer_config` via a request object, either of type
369
+ # {::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferConfigRequest} or an equivalent Hash.
370
+ #
371
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferConfigRequest, ::Hash]
372
+ # A request object representing the call parameters. Required. To specify no
373
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
374
+ # @param options [::Gapic::CallOptions, ::Hash]
375
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
376
+ #
377
+ # @overload get_multicloud_data_transfer_config(name: nil)
378
+ # Pass arguments to `get_multicloud_data_transfer_config` via keyword arguments. Note that at
379
+ # least one keyword argument is required. To specify no parameters, or to keep all
380
+ # the default parameter values, pass an empty Hash as a request object (see above).
381
+ #
382
+ # @param name [::String]
383
+ # Required. The name of the `MulticloudDataTransferConfig` resource to get.
384
+ #
385
+ # @yield [response, operation] Access the result along with the RPC operation
386
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig]
387
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
388
+ #
389
+ # @return [::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig]
390
+ #
391
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
392
+ #
393
+ # @example Basic example
394
+ # require "google/cloud/network_connectivity/v1"
395
+ #
396
+ # # Create a client object. The client can be reused for multiple calls.
397
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
398
+ #
399
+ # # Create a request. To set request fields, pass in keyword arguments.
400
+ # request = Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferConfigRequest.new
401
+ #
402
+ # # Call the get_multicloud_data_transfer_config method.
403
+ # result = client.get_multicloud_data_transfer_config request
404
+ #
405
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig.
406
+ # p result
407
+ #
408
+ def get_multicloud_data_transfer_config request, options = nil
409
+ raise ::ArgumentError, "request must be provided" if request.nil?
410
+
411
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferConfigRequest
412
+
413
+ # Converts hash and nil to an options object
414
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
415
+
416
+ # Customize the options with defaults
417
+ metadata = @config.rpcs.get_multicloud_data_transfer_config.metadata.to_h
418
+
419
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
420
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
421
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
422
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
423
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
424
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
425
+
426
+ header_params = {}
427
+ if request.name
428
+ header_params["name"] = request.name
429
+ end
430
+
431
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
432
+ metadata[:"x-goog-request-params"] ||= request_params_header
433
+
434
+ options.apply_defaults timeout: @config.rpcs.get_multicloud_data_transfer_config.timeout,
435
+ metadata: metadata,
436
+ retry_policy: @config.rpcs.get_multicloud_data_transfer_config.retry_policy
437
+
438
+ options.apply_defaults timeout: @config.timeout,
439
+ metadata: @config.metadata,
440
+ retry_policy: @config.retry_policy
441
+
442
+ @data_transfer_service_stub.call_rpc :get_multicloud_data_transfer_config, request, options: options do |response, operation|
443
+ yield response, operation if block_given?
444
+ end
445
+ rescue ::GRPC::BadStatus => e
446
+ raise ::Google::Cloud::Error.from_error(e)
447
+ end
448
+
449
+ ##
450
+ # Creates a `MulticloudDataTransferConfig` resource in a specified project
451
+ # and location.
452
+ #
453
+ # @overload create_multicloud_data_transfer_config(request, options = nil)
454
+ # Pass arguments to `create_multicloud_data_transfer_config` via a request object, either of type
455
+ # {::Google::Cloud::NetworkConnectivity::V1::CreateMulticloudDataTransferConfigRequest} or an equivalent Hash.
456
+ #
457
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::CreateMulticloudDataTransferConfigRequest, ::Hash]
458
+ # A request object representing the call parameters. Required. To specify no
459
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
460
+ # @param options [::Gapic::CallOptions, ::Hash]
461
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
462
+ #
463
+ # @overload create_multicloud_data_transfer_config(parent: nil, multicloud_data_transfer_config_id: nil, multicloud_data_transfer_config: nil, request_id: nil)
464
+ # Pass arguments to `create_multicloud_data_transfer_config` via keyword arguments. Note that at
465
+ # least one keyword argument is required. To specify no parameters, or to keep all
466
+ # the default parameter values, pass an empty Hash as a request object (see above).
467
+ #
468
+ # @param parent [::String]
469
+ # Required. The name of the parent resource.
470
+ # @param multicloud_data_transfer_config_id [::String]
471
+ # Required. The ID to use for the `MulticloudDataTransferConfig` resource,
472
+ # which becomes the final component of the `MulticloudDataTransferConfig`
473
+ # resource name.
474
+ # @param multicloud_data_transfer_config [::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig, ::Hash]
475
+ # Required. The `MulticloudDataTransferConfig` resource to create.
476
+ # @param request_id [::String]
477
+ # Optional. A request ID to identify requests. Specify a unique request ID
478
+ # so that if you must retry your request, the server can ignore
479
+ # the request if it has already been completed. The server waits
480
+ # for at least 60 minutes since the first request.
481
+ #
482
+ # For example, consider a situation where you make an initial request and
483
+ # the request times out. If you make the request again with the same request
484
+ # ID, the server can check if original operation with the same request ID
485
+ # was received, and if so, can ignore the second request. This prevents
486
+ # clients from accidentally creating duplicate `MulticloudDataTransferConfig`
487
+ # resources.
488
+ #
489
+ # The request ID must be a valid UUID with the exception that zero UUID
490
+ # (00000000-0000-0000-0000-000000000000) isn't supported.
491
+ #
492
+ # @yield [response, operation] Access the result along with the RPC operation
493
+ # @yieldparam response [::Gapic::Operation]
494
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
495
+ #
496
+ # @return [::Gapic::Operation]
497
+ #
498
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
499
+ #
500
+ # @example Basic example
501
+ # require "google/cloud/network_connectivity/v1"
502
+ #
503
+ # # Create a client object. The client can be reused for multiple calls.
504
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
505
+ #
506
+ # # Create a request. To set request fields, pass in keyword arguments.
507
+ # request = Google::Cloud::NetworkConnectivity::V1::CreateMulticloudDataTransferConfigRequest.new
508
+ #
509
+ # # Call the create_multicloud_data_transfer_config method.
510
+ # result = client.create_multicloud_data_transfer_config request
511
+ #
512
+ # # The returned object is of type Gapic::Operation. You can use it to
513
+ # # check the status of an operation, cancel it, or wait for results.
514
+ # # Here is how to wait for a response.
515
+ # result.wait_until_done! timeout: 60
516
+ # if result.response?
517
+ # p result.response
518
+ # else
519
+ # puts "No response received."
520
+ # end
521
+ #
522
+ def create_multicloud_data_transfer_config request, options = nil
523
+ raise ::ArgumentError, "request must be provided" if request.nil?
524
+
525
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::CreateMulticloudDataTransferConfigRequest
526
+
527
+ # Converts hash and nil to an options object
528
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
529
+
530
+ # Customize the options with defaults
531
+ metadata = @config.rpcs.create_multicloud_data_transfer_config.metadata.to_h
532
+
533
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
534
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
535
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
536
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
537
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
538
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
539
+
540
+ header_params = {}
541
+ if request.parent
542
+ header_params["parent"] = request.parent
543
+ end
544
+
545
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
546
+ metadata[:"x-goog-request-params"] ||= request_params_header
547
+
548
+ options.apply_defaults timeout: @config.rpcs.create_multicloud_data_transfer_config.timeout,
549
+ metadata: metadata,
550
+ retry_policy: @config.rpcs.create_multicloud_data_transfer_config.retry_policy
551
+
552
+ options.apply_defaults timeout: @config.timeout,
553
+ metadata: @config.metadata,
554
+ retry_policy: @config.retry_policy
555
+
556
+ @data_transfer_service_stub.call_rpc :create_multicloud_data_transfer_config, request, options: options do |response, operation|
557
+ response = ::Gapic::Operation.new response, @operations_client, options: options
558
+ yield response, operation if block_given?
559
+ throw :response, response
560
+ end
561
+ rescue ::GRPC::BadStatus => e
562
+ raise ::Google::Cloud::Error.from_error(e)
563
+ end
564
+
565
+ ##
566
+ # Updates a `MulticloudDataTransferConfig` resource in a specified project
567
+ # and location.
568
+ #
569
+ # @overload update_multicloud_data_transfer_config(request, options = nil)
570
+ # Pass arguments to `update_multicloud_data_transfer_config` via a request object, either of type
571
+ # {::Google::Cloud::NetworkConnectivity::V1::UpdateMulticloudDataTransferConfigRequest} or an equivalent Hash.
572
+ #
573
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::UpdateMulticloudDataTransferConfigRequest, ::Hash]
574
+ # A request object representing the call parameters. Required. To specify no
575
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
576
+ # @param options [::Gapic::CallOptions, ::Hash]
577
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
578
+ #
579
+ # @overload update_multicloud_data_transfer_config(update_mask: nil, multicloud_data_transfer_config: nil, request_id: nil)
580
+ # Pass arguments to `update_multicloud_data_transfer_config` via keyword arguments. Note that at
581
+ # least one keyword argument is required. To specify no parameters, or to keep all
582
+ # the default parameter values, pass an empty Hash as a request object (see above).
583
+ #
584
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
585
+ # Optional. `FieldMask` is used to specify the fields in the
586
+ # `MulticloudDataTransferConfig` resource to be overwritten by the update.
587
+ # The fields specified in `update_mask` are relative to the resource, not
588
+ # the full request. A field is overwritten if it is in the mask. If you
589
+ # don't specify a mask, all fields are overwritten.
590
+ # @param multicloud_data_transfer_config [::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferConfig, ::Hash]
591
+ # Required. The `MulticloudDataTransferConfig` resource to update.
592
+ # @param request_id [::String]
593
+ # Optional. A request ID to identify requests. Specify a unique request ID
594
+ # so that if you must retry your request, the server can ignore
595
+ # the request if it has already been completed. The server waits
596
+ # for at least 60 minutes since the first request.
597
+ #
598
+ # For example, consider a situation where you make an initial request and
599
+ # the request times out. If you make the request again with the same request
600
+ # ID, the server can check if original operation with the same request ID
601
+ # was received, and if so, can ignore the second request. This prevents
602
+ # clients from accidentally creating duplicate `MulticloudDataTransferConfig`
603
+ # resources.
604
+ #
605
+ # The request ID must be a valid UUID with the exception that zero UUID
606
+ # (00000000-0000-0000-0000-000000000000) isn't supported.
607
+ #
608
+ # @yield [response, operation] Access the result along with the RPC operation
609
+ # @yieldparam response [::Gapic::Operation]
610
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
611
+ #
612
+ # @return [::Gapic::Operation]
613
+ #
614
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
615
+ #
616
+ # @example Basic example
617
+ # require "google/cloud/network_connectivity/v1"
618
+ #
619
+ # # Create a client object. The client can be reused for multiple calls.
620
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
621
+ #
622
+ # # Create a request. To set request fields, pass in keyword arguments.
623
+ # request = Google::Cloud::NetworkConnectivity::V1::UpdateMulticloudDataTransferConfigRequest.new
624
+ #
625
+ # # Call the update_multicloud_data_transfer_config method.
626
+ # result = client.update_multicloud_data_transfer_config request
627
+ #
628
+ # # The returned object is of type Gapic::Operation. You can use it to
629
+ # # check the status of an operation, cancel it, or wait for results.
630
+ # # Here is how to wait for a response.
631
+ # result.wait_until_done! timeout: 60
632
+ # if result.response?
633
+ # p result.response
634
+ # else
635
+ # puts "No response received."
636
+ # end
637
+ #
638
+ def update_multicloud_data_transfer_config request, options = nil
639
+ raise ::ArgumentError, "request must be provided" if request.nil?
640
+
641
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateMulticloudDataTransferConfigRequest
642
+
643
+ # Converts hash and nil to an options object
644
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
645
+
646
+ # Customize the options with defaults
647
+ metadata = @config.rpcs.update_multicloud_data_transfer_config.metadata.to_h
648
+
649
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
650
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
651
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
652
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
653
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
654
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
655
+
656
+ header_params = {}
657
+ if request.multicloud_data_transfer_config&.name
658
+ header_params["multicloud_data_transfer_config.name"] = request.multicloud_data_transfer_config.name
659
+ end
660
+
661
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
662
+ metadata[:"x-goog-request-params"] ||= request_params_header
663
+
664
+ options.apply_defaults timeout: @config.rpcs.update_multicloud_data_transfer_config.timeout,
665
+ metadata: metadata,
666
+ retry_policy: @config.rpcs.update_multicloud_data_transfer_config.retry_policy
667
+
668
+ options.apply_defaults timeout: @config.timeout,
669
+ metadata: @config.metadata,
670
+ retry_policy: @config.retry_policy
671
+
672
+ @data_transfer_service_stub.call_rpc :update_multicloud_data_transfer_config, request, options: options do |response, operation|
673
+ response = ::Gapic::Operation.new response, @operations_client, options: options
674
+ yield response, operation if block_given?
675
+ throw :response, response
676
+ end
677
+ rescue ::GRPC::BadStatus => e
678
+ raise ::Google::Cloud::Error.from_error(e)
679
+ end
680
+
681
+ ##
682
+ # Deletes a `MulticloudDataTransferConfig` resource.
683
+ #
684
+ # @overload delete_multicloud_data_transfer_config(request, options = nil)
685
+ # Pass arguments to `delete_multicloud_data_transfer_config` via a request object, either of type
686
+ # {::Google::Cloud::NetworkConnectivity::V1::DeleteMulticloudDataTransferConfigRequest} or an equivalent Hash.
687
+ #
688
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::DeleteMulticloudDataTransferConfigRequest, ::Hash]
689
+ # A request object representing the call parameters. Required. To specify no
690
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
691
+ # @param options [::Gapic::CallOptions, ::Hash]
692
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
693
+ #
694
+ # @overload delete_multicloud_data_transfer_config(name: nil, request_id: nil, etag: nil)
695
+ # Pass arguments to `delete_multicloud_data_transfer_config` via keyword arguments. Note that at
696
+ # least one keyword argument is required. To specify no parameters, or to keep all
697
+ # the default parameter values, pass an empty Hash as a request object (see above).
698
+ #
699
+ # @param name [::String]
700
+ # Required. The name of the `MulticloudDataTransferConfig` resource to
701
+ # delete.
702
+ # @param request_id [::String]
703
+ # Optional. A request ID to identify requests. Specify a unique request ID
704
+ # so that if you must retry your request, the server can ignore
705
+ # the request if it has already been completed. The server waits
706
+ # for at least 60 minutes since the first request.
707
+ #
708
+ # For example, consider a situation where you make an initial request and
709
+ # the request times out. If you make the request again with the same request
710
+ # ID, the server can check if original operation with the same request ID
711
+ # was received, and if so, can ignore the second request. This prevents
712
+ # clients from accidentally creating duplicate `MulticloudDataTransferConfig`
713
+ # resources.
714
+ #
715
+ # The request ID must be a valid UUID with the exception that zero UUID
716
+ # (00000000-0000-0000-0000-000000000000) isn't supported.
717
+ # @param etag [::String]
718
+ # Optional. The etag is computed by the server, and might be sent with update
719
+ # and delete requests so that the client has an up-to-date value before
720
+ # proceeding.
721
+ #
722
+ # @yield [response, operation] Access the result along with the RPC operation
723
+ # @yieldparam response [::Gapic::Operation]
724
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
725
+ #
726
+ # @return [::Gapic::Operation]
727
+ #
728
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
729
+ #
730
+ # @example Basic example
731
+ # require "google/cloud/network_connectivity/v1"
732
+ #
733
+ # # Create a client object. The client can be reused for multiple calls.
734
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
735
+ #
736
+ # # Create a request. To set request fields, pass in keyword arguments.
737
+ # request = Google::Cloud::NetworkConnectivity::V1::DeleteMulticloudDataTransferConfigRequest.new
738
+ #
739
+ # # Call the delete_multicloud_data_transfer_config method.
740
+ # result = client.delete_multicloud_data_transfer_config request
741
+ #
742
+ # # The returned object is of type Gapic::Operation. You can use it to
743
+ # # check the status of an operation, cancel it, or wait for results.
744
+ # # Here is how to wait for a response.
745
+ # result.wait_until_done! timeout: 60
746
+ # if result.response?
747
+ # p result.response
748
+ # else
749
+ # puts "No response received."
750
+ # end
751
+ #
752
+ def delete_multicloud_data_transfer_config request, options = nil
753
+ raise ::ArgumentError, "request must be provided" if request.nil?
754
+
755
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::DeleteMulticloudDataTransferConfigRequest
756
+
757
+ # Converts hash and nil to an options object
758
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
759
+
760
+ # Customize the options with defaults
761
+ metadata = @config.rpcs.delete_multicloud_data_transfer_config.metadata.to_h
762
+
763
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
764
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
766
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
767
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
768
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
769
+
770
+ header_params = {}
771
+ if request.name
772
+ header_params["name"] = request.name
773
+ end
774
+
775
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
776
+ metadata[:"x-goog-request-params"] ||= request_params_header
777
+
778
+ options.apply_defaults timeout: @config.rpcs.delete_multicloud_data_transfer_config.timeout,
779
+ metadata: metadata,
780
+ retry_policy: @config.rpcs.delete_multicloud_data_transfer_config.retry_policy
781
+
782
+ options.apply_defaults timeout: @config.timeout,
783
+ metadata: @config.metadata,
784
+ retry_policy: @config.retry_policy
785
+
786
+ @data_transfer_service_stub.call_rpc :delete_multicloud_data_transfer_config, request, options: options do |response, operation|
787
+ response = ::Gapic::Operation.new response, @operations_client, options: options
788
+ yield response, operation if block_given?
789
+ throw :response, response
790
+ end
791
+ rescue ::GRPC::BadStatus => e
792
+ raise ::Google::Cloud::Error.from_error(e)
793
+ end
794
+
795
+ ##
796
+ # Lists the `Destination` resources in a specified project and location.
797
+ #
798
+ # @overload list_destinations(request, options = nil)
799
+ # Pass arguments to `list_destinations` via a request object, either of type
800
+ # {::Google::Cloud::NetworkConnectivity::V1::ListDestinationsRequest} or an equivalent Hash.
801
+ #
802
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::ListDestinationsRequest, ::Hash]
803
+ # A request object representing the call parameters. Required. To specify no
804
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
805
+ # @param options [::Gapic::CallOptions, ::Hash]
806
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
807
+ #
808
+ # @overload list_destinations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, return_partial_success: nil)
809
+ # Pass arguments to `list_destinations` via keyword arguments. Note that at
810
+ # least one keyword argument is required. To specify no parameters, or to keep all
811
+ # the default parameter values, pass an empty Hash as a request object (see above).
812
+ #
813
+ # @param parent [::String]
814
+ # Required. The name of the parent resource.
815
+ # @param page_size [::Integer]
816
+ # Optional. The maximum number of results listed per page.
817
+ # @param page_token [::String]
818
+ # Optional. The page token.
819
+ # @param filter [::String]
820
+ # Optional. An expression that filters the results listed in the response.
821
+ # @param order_by [::String]
822
+ # Optional. The sort order of the results.
823
+ # @param return_partial_success [::Boolean]
824
+ # Optional. If `true`, allow partial responses for multi-regional aggregated
825
+ # list requests.
826
+ #
827
+ # @yield [response, operation] Access the result along with the RPC operation
828
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Destination>]
829
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
830
+ #
831
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Destination>]
832
+ #
833
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
834
+ #
835
+ # @example Basic example
836
+ # require "google/cloud/network_connectivity/v1"
837
+ #
838
+ # # Create a client object. The client can be reused for multiple calls.
839
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
840
+ #
841
+ # # Create a request. To set request fields, pass in keyword arguments.
842
+ # request = Google::Cloud::NetworkConnectivity::V1::ListDestinationsRequest.new
843
+ #
844
+ # # Call the list_destinations method.
845
+ # result = client.list_destinations request
846
+ #
847
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
848
+ # # over elements, and API calls will be issued to fetch pages as needed.
849
+ # result.each do |item|
850
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Destination.
851
+ # p item
852
+ # end
853
+ #
854
+ def list_destinations request, options = nil
855
+ raise ::ArgumentError, "request must be provided" if request.nil?
856
+
857
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListDestinationsRequest
858
+
859
+ # Converts hash and nil to an options object
860
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
861
+
862
+ # Customize the options with defaults
863
+ metadata = @config.rpcs.list_destinations.metadata.to_h
864
+
865
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
866
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
867
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
868
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
869
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
870
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
871
+
872
+ header_params = {}
873
+ if request.parent
874
+ header_params["parent"] = request.parent
875
+ end
876
+
877
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
878
+ metadata[:"x-goog-request-params"] ||= request_params_header
879
+
880
+ options.apply_defaults timeout: @config.rpcs.list_destinations.timeout,
881
+ metadata: metadata,
882
+ retry_policy: @config.rpcs.list_destinations.retry_policy
883
+
884
+ options.apply_defaults timeout: @config.timeout,
885
+ metadata: @config.metadata,
886
+ retry_policy: @config.retry_policy
887
+
888
+ @data_transfer_service_stub.call_rpc :list_destinations, request, options: options do |response, operation|
889
+ response = ::Gapic::PagedEnumerable.new @data_transfer_service_stub, :list_destinations, request, response, operation, options
890
+ yield response, operation if block_given?
891
+ throw :response, response
892
+ end
893
+ rescue ::GRPC::BadStatus => e
894
+ raise ::Google::Cloud::Error.from_error(e)
895
+ end
896
+
897
+ ##
898
+ # Gets the details of a `Destination` resource.
899
+ #
900
+ # @overload get_destination(request, options = nil)
901
+ # Pass arguments to `get_destination` via a request object, either of type
902
+ # {::Google::Cloud::NetworkConnectivity::V1::GetDestinationRequest} or an equivalent Hash.
903
+ #
904
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::GetDestinationRequest, ::Hash]
905
+ # A request object representing the call parameters. Required. To specify no
906
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
907
+ # @param options [::Gapic::CallOptions, ::Hash]
908
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
909
+ #
910
+ # @overload get_destination(name: nil)
911
+ # Pass arguments to `get_destination` via keyword arguments. Note that at
912
+ # least one keyword argument is required. To specify no parameters, or to keep all
913
+ # the default parameter values, pass an empty Hash as a request object (see above).
914
+ #
915
+ # @param name [::String]
916
+ # Required. The name of the `Destination` resource to get.
917
+ #
918
+ # @yield [response, operation] Access the result along with the RPC operation
919
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::Destination]
920
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
921
+ #
922
+ # @return [::Google::Cloud::NetworkConnectivity::V1::Destination]
923
+ #
924
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
925
+ #
926
+ # @example Basic example
927
+ # require "google/cloud/network_connectivity/v1"
928
+ #
929
+ # # Create a client object. The client can be reused for multiple calls.
930
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
931
+ #
932
+ # # Create a request. To set request fields, pass in keyword arguments.
933
+ # request = Google::Cloud::NetworkConnectivity::V1::GetDestinationRequest.new
934
+ #
935
+ # # Call the get_destination method.
936
+ # result = client.get_destination request
937
+ #
938
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Destination.
939
+ # p result
940
+ #
941
+ def get_destination request, options = nil
942
+ raise ::ArgumentError, "request must be provided" if request.nil?
943
+
944
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetDestinationRequest
945
+
946
+ # Converts hash and nil to an options object
947
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
948
+
949
+ # Customize the options with defaults
950
+ metadata = @config.rpcs.get_destination.metadata.to_h
951
+
952
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
953
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
954
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
955
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
956
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
957
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
958
+
959
+ header_params = {}
960
+ if request.name
961
+ header_params["name"] = request.name
962
+ end
963
+
964
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
965
+ metadata[:"x-goog-request-params"] ||= request_params_header
966
+
967
+ options.apply_defaults timeout: @config.rpcs.get_destination.timeout,
968
+ metadata: metadata,
969
+ retry_policy: @config.rpcs.get_destination.retry_policy
970
+
971
+ options.apply_defaults timeout: @config.timeout,
972
+ metadata: @config.metadata,
973
+ retry_policy: @config.retry_policy
974
+
975
+ @data_transfer_service_stub.call_rpc :get_destination, request, options: options do |response, operation|
976
+ yield response, operation if block_given?
977
+ end
978
+ rescue ::GRPC::BadStatus => e
979
+ raise ::Google::Cloud::Error.from_error(e)
980
+ end
981
+
982
+ ##
983
+ # Creates a `Destination` resource in a specified project and location.
984
+ #
985
+ # @overload create_destination(request, options = nil)
986
+ # Pass arguments to `create_destination` via a request object, either of type
987
+ # {::Google::Cloud::NetworkConnectivity::V1::CreateDestinationRequest} or an equivalent Hash.
988
+ #
989
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::CreateDestinationRequest, ::Hash]
990
+ # A request object representing the call parameters. Required. To specify no
991
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
992
+ # @param options [::Gapic::CallOptions, ::Hash]
993
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
994
+ #
995
+ # @overload create_destination(parent: nil, destination_id: nil, destination: nil, request_id: nil)
996
+ # Pass arguments to `create_destination` via keyword arguments. Note that at
997
+ # least one keyword argument is required. To specify no parameters, or to keep all
998
+ # the default parameter values, pass an empty Hash as a request object (see above).
999
+ #
1000
+ # @param parent [::String]
1001
+ # Required. The name of the parent resource.
1002
+ # @param destination_id [::String]
1003
+ # Required. The ID to use for the `Destination` resource, which becomes the
1004
+ # final component of the `Destination` resource name.
1005
+ # @param destination [::Google::Cloud::NetworkConnectivity::V1::Destination, ::Hash]
1006
+ # Required. The `Destination` resource to create.
1007
+ # @param request_id [::String]
1008
+ # Optional. A request ID to identify requests. Specify a unique request ID
1009
+ # so that if you must retry your request, the server can ignore
1010
+ # the request if it has already been completed. The server waits
1011
+ # for at least 60 minutes since the first request.
1012
+ #
1013
+ # For example, consider a situation where you make an initial request and
1014
+ # the request times out. If you make the request again with the same request
1015
+ # ID, the server can check if original operation with the same request ID
1016
+ # was received, and if so, can ignore the second request. This prevents
1017
+ # clients from accidentally creating duplicate `Destination`
1018
+ # resources.
1019
+ #
1020
+ # The request ID must be a valid UUID with the exception that zero UUID
1021
+ # (00000000-0000-0000-0000-000000000000) isn't supported.
1022
+ #
1023
+ # @yield [response, operation] Access the result along with the RPC operation
1024
+ # @yieldparam response [::Gapic::Operation]
1025
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1026
+ #
1027
+ # @return [::Gapic::Operation]
1028
+ #
1029
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1030
+ #
1031
+ # @example Basic example
1032
+ # require "google/cloud/network_connectivity/v1"
1033
+ #
1034
+ # # Create a client object. The client can be reused for multiple calls.
1035
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
1036
+ #
1037
+ # # Create a request. To set request fields, pass in keyword arguments.
1038
+ # request = Google::Cloud::NetworkConnectivity::V1::CreateDestinationRequest.new
1039
+ #
1040
+ # # Call the create_destination method.
1041
+ # result = client.create_destination request
1042
+ #
1043
+ # # The returned object is of type Gapic::Operation. You can use it to
1044
+ # # check the status of an operation, cancel it, or wait for results.
1045
+ # # Here is how to wait for a response.
1046
+ # result.wait_until_done! timeout: 60
1047
+ # if result.response?
1048
+ # p result.response
1049
+ # else
1050
+ # puts "No response received."
1051
+ # end
1052
+ #
1053
+ def create_destination request, options = nil
1054
+ raise ::ArgumentError, "request must be provided" if request.nil?
1055
+
1056
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::CreateDestinationRequest
1057
+
1058
+ # Converts hash and nil to an options object
1059
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1060
+
1061
+ # Customize the options with defaults
1062
+ metadata = @config.rpcs.create_destination.metadata.to_h
1063
+
1064
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1065
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1066
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1067
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1068
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1069
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1070
+
1071
+ header_params = {}
1072
+ if request.parent
1073
+ header_params["parent"] = request.parent
1074
+ end
1075
+
1076
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1077
+ metadata[:"x-goog-request-params"] ||= request_params_header
1078
+
1079
+ options.apply_defaults timeout: @config.rpcs.create_destination.timeout,
1080
+ metadata: metadata,
1081
+ retry_policy: @config.rpcs.create_destination.retry_policy
1082
+
1083
+ options.apply_defaults timeout: @config.timeout,
1084
+ metadata: @config.metadata,
1085
+ retry_policy: @config.retry_policy
1086
+
1087
+ @data_transfer_service_stub.call_rpc :create_destination, request, options: options do |response, operation|
1088
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1089
+ yield response, operation if block_given?
1090
+ throw :response, response
1091
+ end
1092
+ rescue ::GRPC::BadStatus => e
1093
+ raise ::Google::Cloud::Error.from_error(e)
1094
+ end
1095
+
1096
+ ##
1097
+ # Updates a `Destination` resource in a specified project and location.
1098
+ #
1099
+ # @overload update_destination(request, options = nil)
1100
+ # Pass arguments to `update_destination` via a request object, either of type
1101
+ # {::Google::Cloud::NetworkConnectivity::V1::UpdateDestinationRequest} or an equivalent Hash.
1102
+ #
1103
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::UpdateDestinationRequest, ::Hash]
1104
+ # A request object representing the call parameters. Required. To specify no
1105
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1106
+ # @param options [::Gapic::CallOptions, ::Hash]
1107
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1108
+ #
1109
+ # @overload update_destination(update_mask: nil, destination: nil, request_id: nil)
1110
+ # Pass arguments to `update_destination` via keyword arguments. Note that at
1111
+ # least one keyword argument is required. To specify no parameters, or to keep all
1112
+ # the default parameter values, pass an empty Hash as a request object (see above).
1113
+ #
1114
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1115
+ # Optional. `FieldMask is used to specify the fields to be overwritten in the
1116
+ # `Destination` resource by the update.
1117
+ # The fields specified in `update_mask` are relative to the resource, not
1118
+ # the full request. A field is overwritten if it is in the mask. If you
1119
+ # don't specify a mask, all fields are overwritten.
1120
+ # @param destination [::Google::Cloud::NetworkConnectivity::V1::Destination, ::Hash]
1121
+ # Required. The `Destination` resource to update.
1122
+ # @param request_id [::String]
1123
+ # Optional. A request ID to identify requests. Specify a unique request ID
1124
+ # so that if you must retry your request, the server can ignore
1125
+ # the request if it has already been completed. The server waits
1126
+ # for at least 60 minutes since the first request.
1127
+ #
1128
+ # For example, consider a situation where you make an initial request and
1129
+ # the request times out. If you make the request again with the same request
1130
+ # ID, the server can check if original operation with the same request ID
1131
+ # was received, and if so, can ignore the second request.
1132
+ #
1133
+ # The request ID must be a valid UUID with the exception that zero UUID
1134
+ # (00000000-0000-0000-0000-000000000000) isn't supported.
1135
+ #
1136
+ # @yield [response, operation] Access the result along with the RPC operation
1137
+ # @yieldparam response [::Gapic::Operation]
1138
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1139
+ #
1140
+ # @return [::Gapic::Operation]
1141
+ #
1142
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1143
+ #
1144
+ # @example Basic example
1145
+ # require "google/cloud/network_connectivity/v1"
1146
+ #
1147
+ # # Create a client object. The client can be reused for multiple calls.
1148
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
1149
+ #
1150
+ # # Create a request. To set request fields, pass in keyword arguments.
1151
+ # request = Google::Cloud::NetworkConnectivity::V1::UpdateDestinationRequest.new
1152
+ #
1153
+ # # Call the update_destination method.
1154
+ # result = client.update_destination request
1155
+ #
1156
+ # # The returned object is of type Gapic::Operation. You can use it to
1157
+ # # check the status of an operation, cancel it, or wait for results.
1158
+ # # Here is how to wait for a response.
1159
+ # result.wait_until_done! timeout: 60
1160
+ # if result.response?
1161
+ # p result.response
1162
+ # else
1163
+ # puts "No response received."
1164
+ # end
1165
+ #
1166
+ def update_destination request, options = nil
1167
+ raise ::ArgumentError, "request must be provided" if request.nil?
1168
+
1169
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::UpdateDestinationRequest
1170
+
1171
+ # Converts hash and nil to an options object
1172
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1173
+
1174
+ # Customize the options with defaults
1175
+ metadata = @config.rpcs.update_destination.metadata.to_h
1176
+
1177
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1178
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1179
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1180
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1181
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1182
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1183
+
1184
+ header_params = {}
1185
+ if request.destination&.name
1186
+ header_params["destination.name"] = request.destination.name
1187
+ end
1188
+
1189
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1190
+ metadata[:"x-goog-request-params"] ||= request_params_header
1191
+
1192
+ options.apply_defaults timeout: @config.rpcs.update_destination.timeout,
1193
+ metadata: metadata,
1194
+ retry_policy: @config.rpcs.update_destination.retry_policy
1195
+
1196
+ options.apply_defaults timeout: @config.timeout,
1197
+ metadata: @config.metadata,
1198
+ retry_policy: @config.retry_policy
1199
+
1200
+ @data_transfer_service_stub.call_rpc :update_destination, request, options: options do |response, operation|
1201
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1202
+ yield response, operation if block_given?
1203
+ throw :response, response
1204
+ end
1205
+ rescue ::GRPC::BadStatus => e
1206
+ raise ::Google::Cloud::Error.from_error(e)
1207
+ end
1208
+
1209
+ ##
1210
+ # Deletes a `Destination` resource.
1211
+ #
1212
+ # @overload delete_destination(request, options = nil)
1213
+ # Pass arguments to `delete_destination` via a request object, either of type
1214
+ # {::Google::Cloud::NetworkConnectivity::V1::DeleteDestinationRequest} or an equivalent Hash.
1215
+ #
1216
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::DeleteDestinationRequest, ::Hash]
1217
+ # A request object representing the call parameters. Required. To specify no
1218
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1219
+ # @param options [::Gapic::CallOptions, ::Hash]
1220
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1221
+ #
1222
+ # @overload delete_destination(name: nil, request_id: nil, etag: nil)
1223
+ # Pass arguments to `delete_destination` via keyword arguments. Note that at
1224
+ # least one keyword argument is required. To specify no parameters, or to keep all
1225
+ # the default parameter values, pass an empty Hash as a request object (see above).
1226
+ #
1227
+ # @param name [::String]
1228
+ # Required. The name of the `Destination` resource to delete.
1229
+ # @param request_id [::String]
1230
+ # Optional. A request ID to identify requests. Specify a unique request ID
1231
+ # so that if you must retry your request, the server can ignore
1232
+ # the request if it has already been completed. The server waits
1233
+ # for at least 60 minutes since the first request.
1234
+ #
1235
+ # For example, consider a situation where you make an initial request and
1236
+ # the request times out. If you make the request again with the same request
1237
+ # ID, the server can check if original operation with the same request ID
1238
+ # was received, and if so, can ignore the second request.
1239
+ #
1240
+ # The request ID must be a valid UUID with the exception that zero UUID
1241
+ # (00000000-0000-0000-0000-000000000000) isn't supported.
1242
+ # @param etag [::String]
1243
+ # Optional. The etag is computed by the server, and might be sent with update
1244
+ # and delete requests so that the client has an up-to-date value before
1245
+ # proceeding.
1246
+ #
1247
+ # @yield [response, operation] Access the result along with the RPC operation
1248
+ # @yieldparam response [::Gapic::Operation]
1249
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1250
+ #
1251
+ # @return [::Gapic::Operation]
1252
+ #
1253
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1254
+ #
1255
+ # @example Basic example
1256
+ # require "google/cloud/network_connectivity/v1"
1257
+ #
1258
+ # # Create a client object. The client can be reused for multiple calls.
1259
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
1260
+ #
1261
+ # # Create a request. To set request fields, pass in keyword arguments.
1262
+ # request = Google::Cloud::NetworkConnectivity::V1::DeleteDestinationRequest.new
1263
+ #
1264
+ # # Call the delete_destination method.
1265
+ # result = client.delete_destination request
1266
+ #
1267
+ # # The returned object is of type Gapic::Operation. You can use it to
1268
+ # # check the status of an operation, cancel it, or wait for results.
1269
+ # # Here is how to wait for a response.
1270
+ # result.wait_until_done! timeout: 60
1271
+ # if result.response?
1272
+ # p result.response
1273
+ # else
1274
+ # puts "No response received."
1275
+ # end
1276
+ #
1277
+ def delete_destination request, options = nil
1278
+ raise ::ArgumentError, "request must be provided" if request.nil?
1279
+
1280
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::DeleteDestinationRequest
1281
+
1282
+ # Converts hash and nil to an options object
1283
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1284
+
1285
+ # Customize the options with defaults
1286
+ metadata = @config.rpcs.delete_destination.metadata.to_h
1287
+
1288
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1289
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1290
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1291
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1292
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1293
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1294
+
1295
+ header_params = {}
1296
+ if request.name
1297
+ header_params["name"] = request.name
1298
+ end
1299
+
1300
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1301
+ metadata[:"x-goog-request-params"] ||= request_params_header
1302
+
1303
+ options.apply_defaults timeout: @config.rpcs.delete_destination.timeout,
1304
+ metadata: metadata,
1305
+ retry_policy: @config.rpcs.delete_destination.retry_policy
1306
+
1307
+ options.apply_defaults timeout: @config.timeout,
1308
+ metadata: @config.metadata,
1309
+ retry_policy: @config.retry_policy
1310
+
1311
+ @data_transfer_service_stub.call_rpc :delete_destination, request, options: options do |response, operation|
1312
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1313
+ yield response, operation if block_given?
1314
+ throw :response, response
1315
+ end
1316
+ rescue ::GRPC::BadStatus => e
1317
+ raise ::Google::Cloud::Error.from_error(e)
1318
+ end
1319
+
1320
+ ##
1321
+ # Gets the details of a service that is supported for Data Transfer
1322
+ # Essentials.
1323
+ #
1324
+ # @overload get_multicloud_data_transfer_supported_service(request, options = nil)
1325
+ # Pass arguments to `get_multicloud_data_transfer_supported_service` via a request object, either of type
1326
+ # {::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferSupportedServiceRequest} or an equivalent Hash.
1327
+ #
1328
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferSupportedServiceRequest, ::Hash]
1329
+ # A request object representing the call parameters. Required. To specify no
1330
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1331
+ # @param options [::Gapic::CallOptions, ::Hash]
1332
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1333
+ #
1334
+ # @overload get_multicloud_data_transfer_supported_service(name: nil)
1335
+ # Pass arguments to `get_multicloud_data_transfer_supported_service` via keyword arguments. Note that at
1336
+ # least one keyword argument is required. To specify no parameters, or to keep all
1337
+ # the default parameter values, pass an empty Hash as a request object (see above).
1338
+ #
1339
+ # @param name [::String]
1340
+ # Required. The name of the service.
1341
+ #
1342
+ # @yield [response, operation] Access the result along with the RPC operation
1343
+ # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService]
1344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1345
+ #
1346
+ # @return [::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService]
1347
+ #
1348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1349
+ #
1350
+ # @example Basic example
1351
+ # require "google/cloud/network_connectivity/v1"
1352
+ #
1353
+ # # Create a client object. The client can be reused for multiple calls.
1354
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
1355
+ #
1356
+ # # Create a request. To set request fields, pass in keyword arguments.
1357
+ # request = Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferSupportedServiceRequest.new
1358
+ #
1359
+ # # Call the get_multicloud_data_transfer_supported_service method.
1360
+ # result = client.get_multicloud_data_transfer_supported_service request
1361
+ #
1362
+ # # The returned object is of type Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService.
1363
+ # p result
1364
+ #
1365
+ def get_multicloud_data_transfer_supported_service request, options = nil
1366
+ raise ::ArgumentError, "request must be provided" if request.nil?
1367
+
1368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetMulticloudDataTransferSupportedServiceRequest
1369
+
1370
+ # Converts hash and nil to an options object
1371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1372
+
1373
+ # Customize the options with defaults
1374
+ metadata = @config.rpcs.get_multicloud_data_transfer_supported_service.metadata.to_h
1375
+
1376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1377
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1379
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1380
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1381
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1382
+
1383
+ header_params = {}
1384
+ if request.name
1385
+ header_params["name"] = request.name
1386
+ end
1387
+
1388
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1389
+ metadata[:"x-goog-request-params"] ||= request_params_header
1390
+
1391
+ options.apply_defaults timeout: @config.rpcs.get_multicloud_data_transfer_supported_service.timeout,
1392
+ metadata: metadata,
1393
+ retry_policy: @config.rpcs.get_multicloud_data_transfer_supported_service.retry_policy
1394
+
1395
+ options.apply_defaults timeout: @config.timeout,
1396
+ metadata: @config.metadata,
1397
+ retry_policy: @config.retry_policy
1398
+
1399
+ @data_transfer_service_stub.call_rpc :get_multicloud_data_transfer_supported_service, request, options: options do |response, operation|
1400
+ yield response, operation if block_given?
1401
+ end
1402
+ rescue ::GRPC::BadStatus => e
1403
+ raise ::Google::Cloud::Error.from_error(e)
1404
+ end
1405
+
1406
+ ##
1407
+ # Lists the services in the project for a region that are supported for
1408
+ # Data Transfer Essentials.
1409
+ #
1410
+ # @overload list_multicloud_data_transfer_supported_services(request, options = nil)
1411
+ # Pass arguments to `list_multicloud_data_transfer_supported_services` via a request object, either of type
1412
+ # {::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferSupportedServicesRequest} or an equivalent Hash.
1413
+ #
1414
+ # @param request [::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferSupportedServicesRequest, ::Hash]
1415
+ # A request object representing the call parameters. Required. To specify no
1416
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1417
+ # @param options [::Gapic::CallOptions, ::Hash]
1418
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1419
+ #
1420
+ # @overload list_multicloud_data_transfer_supported_services(parent: nil, page_size: nil, page_token: nil)
1421
+ # Pass arguments to `list_multicloud_data_transfer_supported_services` via keyword arguments. Note that at
1422
+ # least one keyword argument is required. To specify no parameters, or to keep all
1423
+ # the default parameter values, pass an empty Hash as a request object (see above).
1424
+ #
1425
+ # @param parent [::String]
1426
+ # Required. The name of the parent resource.
1427
+ # @param page_size [::Integer]
1428
+ # Optional. The maximum number of results listed per page.
1429
+ # @param page_token [::String]
1430
+ # Optional. The page token.
1431
+ #
1432
+ # @yield [response, operation] Access the result along with the RPC operation
1433
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService>]
1434
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1435
+ #
1436
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService>]
1437
+ #
1438
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1439
+ #
1440
+ # @example Basic example
1441
+ # require "google/cloud/network_connectivity/v1"
1442
+ #
1443
+ # # Create a client object. The client can be reused for multiple calls.
1444
+ # client = Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new
1445
+ #
1446
+ # # Create a request. To set request fields, pass in keyword arguments.
1447
+ # request = Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferSupportedServicesRequest.new
1448
+ #
1449
+ # # Call the list_multicloud_data_transfer_supported_services method.
1450
+ # result = client.list_multicloud_data_transfer_supported_services request
1451
+ #
1452
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1453
+ # # over elements, and API calls will be issued to fetch pages as needed.
1454
+ # result.each do |item|
1455
+ # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::MulticloudDataTransferSupportedService.
1456
+ # p item
1457
+ # end
1458
+ #
1459
+ def list_multicloud_data_transfer_supported_services request, options = nil
1460
+ raise ::ArgumentError, "request must be provided" if request.nil?
1461
+
1462
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListMulticloudDataTransferSupportedServicesRequest
1463
+
1464
+ # Converts hash and nil to an options object
1465
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1466
+
1467
+ # Customize the options with defaults
1468
+ metadata = @config.rpcs.list_multicloud_data_transfer_supported_services.metadata.to_h
1469
+
1470
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1471
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1472
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1473
+ gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION
1474
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1475
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1476
+
1477
+ header_params = {}
1478
+ if request.parent
1479
+ header_params["parent"] = request.parent
1480
+ end
1481
+
1482
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1483
+ metadata[:"x-goog-request-params"] ||= request_params_header
1484
+
1485
+ options.apply_defaults timeout: @config.rpcs.list_multicloud_data_transfer_supported_services.timeout,
1486
+ metadata: metadata,
1487
+ retry_policy: @config.rpcs.list_multicloud_data_transfer_supported_services.retry_policy
1488
+
1489
+ options.apply_defaults timeout: @config.timeout,
1490
+ metadata: @config.metadata,
1491
+ retry_policy: @config.retry_policy
1492
+
1493
+ @data_transfer_service_stub.call_rpc :list_multicloud_data_transfer_supported_services, request, options: options do |response, operation|
1494
+ response = ::Gapic::PagedEnumerable.new @data_transfer_service_stub, :list_multicloud_data_transfer_supported_services, request, response, operation, options
1495
+ yield response, operation if block_given?
1496
+ throw :response, response
1497
+ end
1498
+ rescue ::GRPC::BadStatus => e
1499
+ raise ::Google::Cloud::Error.from_error(e)
1500
+ end
1501
+
1502
+ ##
1503
+ # Configuration class for the DataTransferService API.
1504
+ #
1505
+ # This class represents the configuration for DataTransferService,
1506
+ # providing control over timeouts, retry behavior, logging, transport
1507
+ # parameters, and other low-level controls. Certain parameters can also be
1508
+ # applied individually to specific RPCs. See
1509
+ # {::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client::Configuration::Rpcs}
1510
+ # for a list of RPCs that can be configured independently.
1511
+ #
1512
+ # Configuration can be applied globally to all clients, or to a single client
1513
+ # on construction.
1514
+ #
1515
+ # @example
1516
+ #
1517
+ # # Modify the global config, setting the timeout for
1518
+ # # list_multicloud_data_transfer_configs to 20 seconds,
1519
+ # # and all remaining timeouts to 10 seconds.
1520
+ # ::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.configure do |config|
1521
+ # config.timeout = 10.0
1522
+ # config.rpcs.list_multicloud_data_transfer_configs.timeout = 20.0
1523
+ # end
1524
+ #
1525
+ # # Apply the above configuration only to a new client.
1526
+ # client = ::Google::Cloud::NetworkConnectivity::V1::DataTransferService::Client.new do |config|
1527
+ # config.timeout = 10.0
1528
+ # config.rpcs.list_multicloud_data_transfer_configs.timeout = 20.0
1529
+ # end
1530
+ #
1531
+ # @!attribute [rw] endpoint
1532
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1533
+ # nil, indicating to use the default endpoint in the current universe domain.
1534
+ # @return [::String,nil]
1535
+ # @!attribute [rw] credentials
1536
+ # Credentials to send with calls. You may provide any of the following types:
1537
+ # * (`String`) The path to a service account key file in JSON format
1538
+ # * (`Hash`) A service account key as a Hash
1539
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1540
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1541
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1542
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1543
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1544
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1545
+ # * (`nil`) indicating no credentials
1546
+ #
1547
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1548
+ # external source for authentication to Google Cloud, you must validate it before
1549
+ # providing it to a Google API client library. Providing an unvalidated credential
1550
+ # configuration to Google APIs can compromise the security of your systems and data.
1551
+ # For more information, refer to [Validate credential configurations from external
1552
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1553
+ # @return [::Object]
1554
+ # @!attribute [rw] scope
1555
+ # The OAuth scopes
1556
+ # @return [::Array<::String>]
1557
+ # @!attribute [rw] lib_name
1558
+ # The library name as recorded in instrumentation and logging
1559
+ # @return [::String]
1560
+ # @!attribute [rw] lib_version
1561
+ # The library version as recorded in instrumentation and logging
1562
+ # @return [::String]
1563
+ # @!attribute [rw] channel_args
1564
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1565
+ # `GRPC::Core::Channel` object is provided as the credential.
1566
+ # @return [::Hash]
1567
+ # @!attribute [rw] interceptors
1568
+ # An array of interceptors that are run before calls are executed.
1569
+ # @return [::Array<::GRPC::ClientInterceptor>]
1570
+ # @!attribute [rw] timeout
1571
+ # The call timeout in seconds.
1572
+ # @return [::Numeric]
1573
+ # @!attribute [rw] metadata
1574
+ # Additional gRPC headers to be sent with the call.
1575
+ # @return [::Hash{::Symbol=>::String}]
1576
+ # @!attribute [rw] retry_policy
1577
+ # The retry policy. The value is a hash with the following keys:
1578
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1579
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1580
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1581
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1582
+ # trigger a retry.
1583
+ # @return [::Hash]
1584
+ # @!attribute [rw] quota_project
1585
+ # A separate project against which to charge quota.
1586
+ # @return [::String]
1587
+ # @!attribute [rw] universe_domain
1588
+ # The universe domain within which to make requests. This determines the
1589
+ # default endpoint URL. The default value of nil uses the environment
1590
+ # universe (usually the default "googleapis.com" universe).
1591
+ # @return [::String,nil]
1592
+ # @!attribute [rw] logger
1593
+ # A custom logger to use for request/response debug logging, or the value
1594
+ # `:default` (the default) to construct a default logger, or `nil` to
1595
+ # explicitly disable logging.
1596
+ # @return [::Logger,:default,nil]
1597
+ #
1598
+ class Configuration
1599
+ extend ::Gapic::Config
1600
+
1601
+ # @private
1602
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1603
+ DEFAULT_ENDPOINT = "networkconnectivity.googleapis.com"
1604
+
1605
+ config_attr :endpoint, nil, ::String, nil
1606
+ config_attr :credentials, nil do |value|
1607
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1608
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1609
+ allowed.any? { |klass| klass === value }
1610
+ end
1611
+ config_attr :scope, nil, ::String, ::Array, nil
1612
+ config_attr :lib_name, nil, ::String, nil
1613
+ config_attr :lib_version, nil, ::String, nil
1614
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1615
+ config_attr :interceptors, nil, ::Array, nil
1616
+ config_attr :timeout, nil, ::Numeric, nil
1617
+ config_attr :metadata, nil, ::Hash, nil
1618
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1619
+ config_attr :quota_project, nil, ::String, nil
1620
+ config_attr :universe_domain, nil, ::String, nil
1621
+ config_attr :logger, :default, ::Logger, nil, :default
1622
+
1623
+ # @private
1624
+ def initialize parent_config = nil
1625
+ @parent_config = parent_config unless parent_config.nil?
1626
+
1627
+ yield self if block_given?
1628
+ end
1629
+
1630
+ ##
1631
+ # Configurations for individual RPCs
1632
+ # @return [Rpcs]
1633
+ #
1634
+ def rpcs
1635
+ @rpcs ||= begin
1636
+ parent_rpcs = nil
1637
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1638
+ Rpcs.new parent_rpcs
1639
+ end
1640
+ end
1641
+
1642
+ ##
1643
+ # Configuration for the channel pool
1644
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1645
+ #
1646
+ def channel_pool
1647
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1648
+ end
1649
+
1650
+ ##
1651
+ # Configuration RPC class for the DataTransferService API.
1652
+ #
1653
+ # Includes fields providing the configuration for each RPC in this service.
1654
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1655
+ # the following configuration fields:
1656
+ #
1657
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1658
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1659
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1660
+ # include the following keys:
1661
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1662
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1663
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1664
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1665
+ # trigger a retry.
1666
+ #
1667
+ class Rpcs
1668
+ ##
1669
+ # RPC-specific configuration for `list_multicloud_data_transfer_configs`
1670
+ # @return [::Gapic::Config::Method]
1671
+ #
1672
+ attr_reader :list_multicloud_data_transfer_configs
1673
+ ##
1674
+ # RPC-specific configuration for `get_multicloud_data_transfer_config`
1675
+ # @return [::Gapic::Config::Method]
1676
+ #
1677
+ attr_reader :get_multicloud_data_transfer_config
1678
+ ##
1679
+ # RPC-specific configuration for `create_multicloud_data_transfer_config`
1680
+ # @return [::Gapic::Config::Method]
1681
+ #
1682
+ attr_reader :create_multicloud_data_transfer_config
1683
+ ##
1684
+ # RPC-specific configuration for `update_multicloud_data_transfer_config`
1685
+ # @return [::Gapic::Config::Method]
1686
+ #
1687
+ attr_reader :update_multicloud_data_transfer_config
1688
+ ##
1689
+ # RPC-specific configuration for `delete_multicloud_data_transfer_config`
1690
+ # @return [::Gapic::Config::Method]
1691
+ #
1692
+ attr_reader :delete_multicloud_data_transfer_config
1693
+ ##
1694
+ # RPC-specific configuration for `list_destinations`
1695
+ # @return [::Gapic::Config::Method]
1696
+ #
1697
+ attr_reader :list_destinations
1698
+ ##
1699
+ # RPC-specific configuration for `get_destination`
1700
+ # @return [::Gapic::Config::Method]
1701
+ #
1702
+ attr_reader :get_destination
1703
+ ##
1704
+ # RPC-specific configuration for `create_destination`
1705
+ # @return [::Gapic::Config::Method]
1706
+ #
1707
+ attr_reader :create_destination
1708
+ ##
1709
+ # RPC-specific configuration for `update_destination`
1710
+ # @return [::Gapic::Config::Method]
1711
+ #
1712
+ attr_reader :update_destination
1713
+ ##
1714
+ # RPC-specific configuration for `delete_destination`
1715
+ # @return [::Gapic::Config::Method]
1716
+ #
1717
+ attr_reader :delete_destination
1718
+ ##
1719
+ # RPC-specific configuration for `get_multicloud_data_transfer_supported_service`
1720
+ # @return [::Gapic::Config::Method]
1721
+ #
1722
+ attr_reader :get_multicloud_data_transfer_supported_service
1723
+ ##
1724
+ # RPC-specific configuration for `list_multicloud_data_transfer_supported_services`
1725
+ # @return [::Gapic::Config::Method]
1726
+ #
1727
+ attr_reader :list_multicloud_data_transfer_supported_services
1728
+
1729
+ # @private
1730
+ def initialize parent_rpcs = nil
1731
+ list_multicloud_data_transfer_configs_config = parent_rpcs.list_multicloud_data_transfer_configs if parent_rpcs.respond_to? :list_multicloud_data_transfer_configs
1732
+ @list_multicloud_data_transfer_configs = ::Gapic::Config::Method.new list_multicloud_data_transfer_configs_config
1733
+ get_multicloud_data_transfer_config_config = parent_rpcs.get_multicloud_data_transfer_config if parent_rpcs.respond_to? :get_multicloud_data_transfer_config
1734
+ @get_multicloud_data_transfer_config = ::Gapic::Config::Method.new get_multicloud_data_transfer_config_config
1735
+ create_multicloud_data_transfer_config_config = parent_rpcs.create_multicloud_data_transfer_config if parent_rpcs.respond_to? :create_multicloud_data_transfer_config
1736
+ @create_multicloud_data_transfer_config = ::Gapic::Config::Method.new create_multicloud_data_transfer_config_config
1737
+ update_multicloud_data_transfer_config_config = parent_rpcs.update_multicloud_data_transfer_config if parent_rpcs.respond_to? :update_multicloud_data_transfer_config
1738
+ @update_multicloud_data_transfer_config = ::Gapic::Config::Method.new update_multicloud_data_transfer_config_config
1739
+ delete_multicloud_data_transfer_config_config = parent_rpcs.delete_multicloud_data_transfer_config if parent_rpcs.respond_to? :delete_multicloud_data_transfer_config
1740
+ @delete_multicloud_data_transfer_config = ::Gapic::Config::Method.new delete_multicloud_data_transfer_config_config
1741
+ list_destinations_config = parent_rpcs.list_destinations if parent_rpcs.respond_to? :list_destinations
1742
+ @list_destinations = ::Gapic::Config::Method.new list_destinations_config
1743
+ get_destination_config = parent_rpcs.get_destination if parent_rpcs.respond_to? :get_destination
1744
+ @get_destination = ::Gapic::Config::Method.new get_destination_config
1745
+ create_destination_config = parent_rpcs.create_destination if parent_rpcs.respond_to? :create_destination
1746
+ @create_destination = ::Gapic::Config::Method.new create_destination_config
1747
+ update_destination_config = parent_rpcs.update_destination if parent_rpcs.respond_to? :update_destination
1748
+ @update_destination = ::Gapic::Config::Method.new update_destination_config
1749
+ delete_destination_config = parent_rpcs.delete_destination if parent_rpcs.respond_to? :delete_destination
1750
+ @delete_destination = ::Gapic::Config::Method.new delete_destination_config
1751
+ get_multicloud_data_transfer_supported_service_config = parent_rpcs.get_multicloud_data_transfer_supported_service if parent_rpcs.respond_to? :get_multicloud_data_transfer_supported_service
1752
+ @get_multicloud_data_transfer_supported_service = ::Gapic::Config::Method.new get_multicloud_data_transfer_supported_service_config
1753
+ list_multicloud_data_transfer_supported_services_config = parent_rpcs.list_multicloud_data_transfer_supported_services if parent_rpcs.respond_to? :list_multicloud_data_transfer_supported_services
1754
+ @list_multicloud_data_transfer_supported_services = ::Gapic::Config::Method.new list_multicloud_data_transfer_supported_services_config
1755
+
1756
+ yield self if block_given?
1757
+ end
1758
+ end
1759
+ end
1760
+ end
1761
+ end
1762
+ end
1763
+ end
1764
+ end
1765
+ end