google-cloud-datastream-v1 0.1.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,3039 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2022 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/datastream/v1/datastream_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Datastream
25
+ module V1
26
+ module Datastream
27
+ ##
28
+ # Client for the Datastream service.
29
+ #
30
+ # Datastream service
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :datastream_stub
37
+
38
+ ##
39
+ # Configure the Datastream Client class.
40
+ #
41
+ # See {::Google::Cloud::Datastream::V1::Datastream::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # @example
45
+ #
46
+ # # Modify the configuration for all Datastream clients
47
+ # ::Google::Cloud::Datastream::V1::Datastream::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
50
+ #
51
+ # @yield [config] Configure the Client client.
52
+ # @yieldparam config [Client::Configuration]
53
+ #
54
+ # @return [Client::Configuration]
55
+ #
56
+ def self.configure
57
+ @configure ||= begin
58
+ namespace = ["Google", "Cloud", "Datastream", "V1"]
59
+ parent_config = while namespace.any?
60
+ parent_name = namespace.join "::"
61
+ parent_const = const_get parent_name
62
+ break parent_const.configure if parent_const.respond_to? :configure
63
+ namespace.pop
64
+ end
65
+ default_config = Client::Configuration.new parent_config
66
+
67
+ default_config.timeout = 60.0
68
+ default_config.retry_policy = {
69
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
70
+ }
71
+
72
+ default_config.rpcs.create_connection_profile.timeout = 60.0
73
+
74
+ default_config.rpcs.update_connection_profile.timeout = 60.0
75
+
76
+ default_config.rpcs.delete_connection_profile.timeout = 60.0
77
+
78
+ default_config.rpcs.create_stream.timeout = 60.0
79
+
80
+ default_config.rpcs.update_stream.timeout = 60.0
81
+
82
+ default_config.rpcs.delete_stream.timeout = 60.0
83
+
84
+ default_config.rpcs.create_private_connection.timeout = 60.0
85
+
86
+ default_config.rpcs.delete_private_connection.timeout = 60.0
87
+
88
+ default_config.rpcs.create_route.timeout = 60.0
89
+
90
+ default_config.rpcs.delete_route.timeout = 60.0
91
+
92
+ default_config
93
+ end
94
+ yield @configure if block_given?
95
+ @configure
96
+ end
97
+
98
+ ##
99
+ # Configure the Datastream Client instance.
100
+ #
101
+ # The configuration is set to the derived mode, meaning that values can be changed,
102
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
103
+ # should be made on {Client.configure}.
104
+ #
105
+ # See {::Google::Cloud::Datastream::V1::Datastream::Client::Configuration}
106
+ # for a description of the configuration fields.
107
+ #
108
+ # @yield [config] Configure the Client client.
109
+ # @yieldparam config [Client::Configuration]
110
+ #
111
+ # @return [Client::Configuration]
112
+ #
113
+ def configure
114
+ yield @config if block_given?
115
+ @config
116
+ end
117
+
118
+ ##
119
+ # Create a new Datastream client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::Datastream::V1::Datastream::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the Datastream client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # These require statements are intentionally placed here to initialize
136
+ # the gRPC module only when it's required.
137
+ # See https://github.com/googleapis/toolkit/issues/446
138
+ require "gapic/grpc"
139
+ require "google/cloud/datastream/v1/datastream_services_pb"
140
+
141
+ # Create the configuration object
142
+ @config = Configuration.new Client.configure
143
+
144
+ # Yield the configuration if needed
145
+ yield @config if block_given?
146
+
147
+ # Create credentials
148
+ credentials = @config.credentials
149
+ # Use self-signed JWT if the endpoint is unchanged from default,
150
+ # but only if the default endpoint does not have a region prefix.
151
+ enable_self_signed_jwt = @config.endpoint == Client.configure.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
+ @quota_project_id = @config.quota_project
159
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
160
+
161
+ @operations_client = Operations.new do |config|
162
+ config.credentials = credentials
163
+ config.quota_project = @quota_project_id
164
+ config.endpoint = @config.endpoint
165
+ end
166
+
167
+ @datastream_stub = ::Gapic::ServiceStub.new(
168
+ ::Google::Cloud::Datastream::V1::Datastream::Stub,
169
+ credentials: credentials,
170
+ endpoint: @config.endpoint,
171
+ channel_args: @config.channel_args,
172
+ interceptors: @config.interceptors
173
+ )
174
+ end
175
+
176
+ ##
177
+ # Get the associated client for long-running operations.
178
+ #
179
+ # @return [::Google::Cloud::Datastream::V1::Datastream::Operations]
180
+ #
181
+ attr_reader :operations_client
182
+
183
+ # Service calls
184
+
185
+ ##
186
+ # Use this method to list connection profiles created in a project and
187
+ # location.
188
+ #
189
+ # @overload list_connection_profiles(request, options = nil)
190
+ # Pass arguments to `list_connection_profiles` via a request object, either of type
191
+ # {::Google::Cloud::Datastream::V1::ListConnectionProfilesRequest} or an equivalent Hash.
192
+ #
193
+ # @param request [::Google::Cloud::Datastream::V1::ListConnectionProfilesRequest, ::Hash]
194
+ # A request object representing the call parameters. Required. To specify no
195
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
196
+ # @param options [::Gapic::CallOptions, ::Hash]
197
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
198
+ #
199
+ # @overload list_connection_profiles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
200
+ # Pass arguments to `list_connection_profiles` via keyword arguments. Note that at
201
+ # least one keyword argument is required. To specify no parameters, or to keep all
202
+ # the default parameter values, pass an empty Hash as a request object (see above).
203
+ #
204
+ # @param parent [::String]
205
+ # Required. The parent that owns the collection of connection profiles.
206
+ # @param page_size [::Integer]
207
+ # Maximum number of connection profiles to return.
208
+ # If unspecified, at most 50 connection profiles will be returned.
209
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
210
+ # @param page_token [::String]
211
+ # Page token received from a previous `ListConnectionProfiles` call.
212
+ # Provide this to retrieve the subsequent page.
213
+ #
214
+ # When paginating, all other parameters provided to `ListConnectionProfiles`
215
+ # must match the call that provided the page token.
216
+ # @param filter [::String]
217
+ # Filter request.
218
+ # @param order_by [::String]
219
+ # Order by fields for the result.
220
+ #
221
+ # @yield [response, operation] Access the result along with the RPC operation
222
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::ConnectionProfile>]
223
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
224
+ #
225
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::ConnectionProfile>]
226
+ #
227
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/cloud/datastream/v1"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Cloud::Datastream::V1::ListConnectionProfilesRequest.new
237
+ #
238
+ # # Call the list_connection_profiles method.
239
+ # result = client.list_connection_profiles request
240
+ #
241
+ # # The returned object is of type Gapic::PagedEnumerable. You can
242
+ # # iterate over all elements by calling #each, and the enumerable
243
+ # # will lazily make API calls to fetch subsequent pages. Other
244
+ # # methods are also available for managing paging directly.
245
+ # result.each do |response|
246
+ # # Each element is of type ::Google::Cloud::Datastream::V1::ConnectionProfile.
247
+ # p response
248
+ # end
249
+ #
250
+ def list_connection_profiles request, options = nil
251
+ raise ::ArgumentError, "request must be provided" if request.nil?
252
+
253
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::ListConnectionProfilesRequest
254
+
255
+ # Converts hash and nil to an options object
256
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
257
+
258
+ # Customize the options with defaults
259
+ metadata = @config.rpcs.list_connection_profiles.metadata.to_h
260
+
261
+ # Set x-goog-api-client and x-goog-user-project headers
262
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
263
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
264
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
265
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
266
+
267
+ header_params = {}
268
+ if request.parent
269
+ header_params["parent"] = request.parent
270
+ end
271
+
272
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
273
+ metadata[:"x-goog-request-params"] ||= request_params_header
274
+
275
+ options.apply_defaults timeout: @config.rpcs.list_connection_profiles.timeout,
276
+ metadata: metadata,
277
+ retry_policy: @config.rpcs.list_connection_profiles.retry_policy
278
+
279
+ options.apply_defaults timeout: @config.timeout,
280
+ metadata: @config.metadata,
281
+ retry_policy: @config.retry_policy
282
+
283
+ @datastream_stub.call_rpc :list_connection_profiles, request, options: options do |response, operation|
284
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_connection_profiles, request, response, operation, options
285
+ yield response, operation if block_given?
286
+ return response
287
+ end
288
+ rescue ::GRPC::BadStatus => e
289
+ raise ::Google::Cloud::Error.from_error(e)
290
+ end
291
+
292
+ ##
293
+ # Use this method to get details about a connection profile.
294
+ #
295
+ # @overload get_connection_profile(request, options = nil)
296
+ # Pass arguments to `get_connection_profile` via a request object, either of type
297
+ # {::Google::Cloud::Datastream::V1::GetConnectionProfileRequest} or an equivalent Hash.
298
+ #
299
+ # @param request [::Google::Cloud::Datastream::V1::GetConnectionProfileRequest, ::Hash]
300
+ # A request object representing the call parameters. Required. To specify no
301
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
302
+ # @param options [::Gapic::CallOptions, ::Hash]
303
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
304
+ #
305
+ # @overload get_connection_profile(name: nil)
306
+ # Pass arguments to `get_connection_profile` via keyword arguments. Note that at
307
+ # least one keyword argument is required. To specify no parameters, or to keep all
308
+ # the default parameter values, pass an empty Hash as a request object (see above).
309
+ #
310
+ # @param name [::String]
311
+ # Required. The name of the connection profile resource to get.
312
+ #
313
+ # @yield [response, operation] Access the result along with the RPC operation
314
+ # @yieldparam response [::Google::Cloud::Datastream::V1::ConnectionProfile]
315
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
316
+ #
317
+ # @return [::Google::Cloud::Datastream::V1::ConnectionProfile]
318
+ #
319
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
320
+ #
321
+ # @example Basic example
322
+ # require "google/cloud/datastream/v1"
323
+ #
324
+ # # Create a client object. The client can be reused for multiple calls.
325
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
326
+ #
327
+ # # Create a request. To set request fields, pass in keyword arguments.
328
+ # request = Google::Cloud::Datastream::V1::GetConnectionProfileRequest.new
329
+ #
330
+ # # Call the get_connection_profile method.
331
+ # result = client.get_connection_profile request
332
+ #
333
+ # # The returned object is of type Google::Cloud::Datastream::V1::ConnectionProfile.
334
+ # p result
335
+ #
336
+ def get_connection_profile request, options = nil
337
+ raise ::ArgumentError, "request must be provided" if request.nil?
338
+
339
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::GetConnectionProfileRequest
340
+
341
+ # Converts hash and nil to an options object
342
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
343
+
344
+ # Customize the options with defaults
345
+ metadata = @config.rpcs.get_connection_profile.metadata.to_h
346
+
347
+ # Set x-goog-api-client and x-goog-user-project headers
348
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
349
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
350
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
351
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
+
353
+ header_params = {}
354
+ if request.name
355
+ header_params["name"] = request.name
356
+ end
357
+
358
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
359
+ metadata[:"x-goog-request-params"] ||= request_params_header
360
+
361
+ options.apply_defaults timeout: @config.rpcs.get_connection_profile.timeout,
362
+ metadata: metadata,
363
+ retry_policy: @config.rpcs.get_connection_profile.retry_policy
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
367
+ retry_policy: @config.retry_policy
368
+
369
+ @datastream_stub.call_rpc :get_connection_profile, request, options: options do |response, operation|
370
+ yield response, operation if block_given?
371
+ return response
372
+ end
373
+ rescue ::GRPC::BadStatus => e
374
+ raise ::Google::Cloud::Error.from_error(e)
375
+ end
376
+
377
+ ##
378
+ # Use this method to create a connection profile in a project and location.
379
+ #
380
+ # @overload create_connection_profile(request, options = nil)
381
+ # Pass arguments to `create_connection_profile` via a request object, either of type
382
+ # {::Google::Cloud::Datastream::V1::CreateConnectionProfileRequest} or an equivalent Hash.
383
+ #
384
+ # @param request [::Google::Cloud::Datastream::V1::CreateConnectionProfileRequest, ::Hash]
385
+ # A request object representing the call parameters. Required. To specify no
386
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
387
+ # @param options [::Gapic::CallOptions, ::Hash]
388
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
389
+ #
390
+ # @overload create_connection_profile(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil, validate_only: nil, force: nil)
391
+ # Pass arguments to `create_connection_profile` via keyword arguments. Note that at
392
+ # least one keyword argument is required. To specify no parameters, or to keep all
393
+ # the default parameter values, pass an empty Hash as a request object (see above).
394
+ #
395
+ # @param parent [::String]
396
+ # Required. The parent that owns the collection of ConnectionProfiles.
397
+ # @param connection_profile_id [::String]
398
+ # Required. The connection profile identifier.
399
+ # @param connection_profile [::Google::Cloud::Datastream::V1::ConnectionProfile, ::Hash]
400
+ # Required. The connection profile resource to create.
401
+ # @param request_id [::String]
402
+ # Optional. A request ID to identify requests. Specify a unique request ID
403
+ # so that if you must retry your request, the server will know to ignore
404
+ # the request if it has already been completed. The server will guarantee
405
+ # that for at least 60 minutes since the first request.
406
+ #
407
+ # For example, consider a situation where you make an initial request and the
408
+ # request times out. If you make the request again with the same request ID,
409
+ # the server can check if original operation with the same request ID was
410
+ # received, and if so, will ignore the second request. This prevents clients
411
+ # from accidentally creating duplicate commitments.
412
+ #
413
+ # The request ID must be a valid UUID with the exception that zero UUID is
414
+ # not supported (00000000-0000-0000-0000-000000000000).
415
+ # @param validate_only [::Boolean]
416
+ # Optional. Only validate the connection profile, but don't create any resources.
417
+ # The default is false.
418
+ # @param force [::Boolean]
419
+ # Optional. Create the connection profile without validating it.
420
+ #
421
+ # @yield [response, operation] Access the result along with the RPC operation
422
+ # @yieldparam response [::Gapic::Operation]
423
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
424
+ #
425
+ # @return [::Gapic::Operation]
426
+ #
427
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
428
+ #
429
+ # @example Basic example
430
+ # require "google/cloud/datastream/v1"
431
+ #
432
+ # # Create a client object. The client can be reused for multiple calls.
433
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
434
+ #
435
+ # # Create a request. To set request fields, pass in keyword arguments.
436
+ # request = Google::Cloud::Datastream::V1::CreateConnectionProfileRequest.new
437
+ #
438
+ # # Call the create_connection_profile method.
439
+ # result = client.create_connection_profile request
440
+ #
441
+ # # The returned object is of type Gapic::Operation. You can use this
442
+ # # object to check the status of an operation, cancel it, or wait
443
+ # # for results. Here is how to block until completion:
444
+ # result.wait_until_done! timeout: 60
445
+ # if result.response?
446
+ # p result.response
447
+ # else
448
+ # puts "Error!"
449
+ # end
450
+ #
451
+ def create_connection_profile request, options = nil
452
+ raise ::ArgumentError, "request must be provided" if request.nil?
453
+
454
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::CreateConnectionProfileRequest
455
+
456
+ # Converts hash and nil to an options object
457
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
458
+
459
+ # Customize the options with defaults
460
+ metadata = @config.rpcs.create_connection_profile.metadata.to_h
461
+
462
+ # Set x-goog-api-client and x-goog-user-project headers
463
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
464
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
465
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
466
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
467
+
468
+ header_params = {}
469
+ if request.parent
470
+ header_params["parent"] = request.parent
471
+ end
472
+
473
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
474
+ metadata[:"x-goog-request-params"] ||= request_params_header
475
+
476
+ options.apply_defaults timeout: @config.rpcs.create_connection_profile.timeout,
477
+ metadata: metadata,
478
+ retry_policy: @config.rpcs.create_connection_profile.retry_policy
479
+
480
+ options.apply_defaults timeout: @config.timeout,
481
+ metadata: @config.metadata,
482
+ retry_policy: @config.retry_policy
483
+
484
+ @datastream_stub.call_rpc :create_connection_profile, request, options: options do |response, operation|
485
+ response = ::Gapic::Operation.new response, @operations_client, options: options
486
+ yield response, operation if block_given?
487
+ return response
488
+ end
489
+ rescue ::GRPC::BadStatus => e
490
+ raise ::Google::Cloud::Error.from_error(e)
491
+ end
492
+
493
+ ##
494
+ # Use this method to update the parameters of a connection profile.
495
+ #
496
+ # @overload update_connection_profile(request, options = nil)
497
+ # Pass arguments to `update_connection_profile` via a request object, either of type
498
+ # {::Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest} or an equivalent Hash.
499
+ #
500
+ # @param request [::Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest, ::Hash]
501
+ # A request object representing the call parameters. Required. To specify no
502
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
503
+ # @param options [::Gapic::CallOptions, ::Hash]
504
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
505
+ #
506
+ # @overload update_connection_profile(update_mask: nil, connection_profile: nil, request_id: nil, validate_only: nil, force: nil)
507
+ # Pass arguments to `update_connection_profile` via keyword arguments. Note that at
508
+ # least one keyword argument is required. To specify no parameters, or to keep all
509
+ # the default parameter values, pass an empty Hash as a request object (see above).
510
+ #
511
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
512
+ # Optional. Field mask is used to specify the fields to be overwritten in the
513
+ # ConnectionProfile resource by the update.
514
+ # The fields specified in the update_mask are relative to the resource, not
515
+ # the full request. A field will be overwritten if it is in the mask. If the
516
+ # user does not provide a mask then all fields will be overwritten.
517
+ # @param connection_profile [::Google::Cloud::Datastream::V1::ConnectionProfile, ::Hash]
518
+ # Required. The connection profile to update.
519
+ # @param request_id [::String]
520
+ # Optional. A request ID to identify requests. Specify a unique request ID
521
+ # so that if you must retry your request, the server will know to ignore
522
+ # the request if it has already been completed. The server will guarantee
523
+ # that for at least 60 minutes since the first request.
524
+ #
525
+ # For example, consider a situation where you make an initial request and the
526
+ # request times out. If you make the request again with the same request ID,
527
+ # the server can check if original operation with the same request ID was
528
+ # received, and if so, will ignore the second request. This prevents clients
529
+ # from accidentally creating duplicate commitments.
530
+ #
531
+ # The request ID must be a valid UUID with the exception that zero UUID is
532
+ # not supported (00000000-0000-0000-0000-000000000000).
533
+ # @param validate_only [::Boolean]
534
+ # Optional. Only validate the connection profile, but don't update any resources.
535
+ # The default is false.
536
+ # @param force [::Boolean]
537
+ # Optional. Update the connection profile without validating it.
538
+ #
539
+ # @yield [response, operation] Access the result along with the RPC operation
540
+ # @yieldparam response [::Gapic::Operation]
541
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
542
+ #
543
+ # @return [::Gapic::Operation]
544
+ #
545
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
546
+ #
547
+ # @example Basic example
548
+ # require "google/cloud/datastream/v1"
549
+ #
550
+ # # Create a client object. The client can be reused for multiple calls.
551
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
552
+ #
553
+ # # Create a request. To set request fields, pass in keyword arguments.
554
+ # request = Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest.new
555
+ #
556
+ # # Call the update_connection_profile method.
557
+ # result = client.update_connection_profile request
558
+ #
559
+ # # The returned object is of type Gapic::Operation. You can use this
560
+ # # object to check the status of an operation, cancel it, or wait
561
+ # # for results. Here is how to block until completion:
562
+ # result.wait_until_done! timeout: 60
563
+ # if result.response?
564
+ # p result.response
565
+ # else
566
+ # puts "Error!"
567
+ # end
568
+ #
569
+ def update_connection_profile request, options = nil
570
+ raise ::ArgumentError, "request must be provided" if request.nil?
571
+
572
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest
573
+
574
+ # Converts hash and nil to an options object
575
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
576
+
577
+ # Customize the options with defaults
578
+ metadata = @config.rpcs.update_connection_profile.metadata.to_h
579
+
580
+ # Set x-goog-api-client and x-goog-user-project headers
581
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
582
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
583
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
584
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
585
+
586
+ header_params = {}
587
+ if request.connection_profile&.name
588
+ header_params["connection_profile.name"] = request.connection_profile.name
589
+ end
590
+
591
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
592
+ metadata[:"x-goog-request-params"] ||= request_params_header
593
+
594
+ options.apply_defaults timeout: @config.rpcs.update_connection_profile.timeout,
595
+ metadata: metadata,
596
+ retry_policy: @config.rpcs.update_connection_profile.retry_policy
597
+
598
+ options.apply_defaults timeout: @config.timeout,
599
+ metadata: @config.metadata,
600
+ retry_policy: @config.retry_policy
601
+
602
+ @datastream_stub.call_rpc :update_connection_profile, request, options: options do |response, operation|
603
+ response = ::Gapic::Operation.new response, @operations_client, options: options
604
+ yield response, operation if block_given?
605
+ return response
606
+ end
607
+ rescue ::GRPC::BadStatus => e
608
+ raise ::Google::Cloud::Error.from_error(e)
609
+ end
610
+
611
+ ##
612
+ # Use this method to delete a connection profile.
613
+ #
614
+ # @overload delete_connection_profile(request, options = nil)
615
+ # Pass arguments to `delete_connection_profile` via a request object, either of type
616
+ # {::Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest} or an equivalent Hash.
617
+ #
618
+ # @param request [::Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest, ::Hash]
619
+ # A request object representing the call parameters. Required. To specify no
620
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
621
+ # @param options [::Gapic::CallOptions, ::Hash]
622
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
623
+ #
624
+ # @overload delete_connection_profile(name: nil, request_id: nil)
625
+ # Pass arguments to `delete_connection_profile` via keyword arguments. Note that at
626
+ # least one keyword argument is required. To specify no parameters, or to keep all
627
+ # the default parameter values, pass an empty Hash as a request object (see above).
628
+ #
629
+ # @param name [::String]
630
+ # Required. The name of the connection profile resource to delete.
631
+ # @param request_id [::String]
632
+ # Optional. A request ID to identify requests. Specify a unique request ID
633
+ # so that if you must retry your request, the server will know to ignore
634
+ # the request if it has already been completed. The server will guarantee
635
+ # that for at least 60 minutes after the first request.
636
+ #
637
+ # For example, consider a situation where you make an initial request and the
638
+ # request times out. If you make the request again with the same request ID,
639
+ # the server can check if original operation with the same request ID was
640
+ # received, and if so, will ignore the second request. This prevents clients
641
+ # from accidentally creating duplicate commitments.
642
+ #
643
+ # The request ID must be a valid UUID with the exception that zero UUID is
644
+ # not supported (00000000-0000-0000-0000-000000000000).
645
+ #
646
+ # @yield [response, operation] Access the result along with the RPC operation
647
+ # @yieldparam response [::Gapic::Operation]
648
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
649
+ #
650
+ # @return [::Gapic::Operation]
651
+ #
652
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
653
+ #
654
+ # @example Basic example
655
+ # require "google/cloud/datastream/v1"
656
+ #
657
+ # # Create a client object. The client can be reused for multiple calls.
658
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
659
+ #
660
+ # # Create a request. To set request fields, pass in keyword arguments.
661
+ # request = Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest.new
662
+ #
663
+ # # Call the delete_connection_profile method.
664
+ # result = client.delete_connection_profile request
665
+ #
666
+ # # The returned object is of type Gapic::Operation. You can use this
667
+ # # object to check the status of an operation, cancel it, or wait
668
+ # # for results. Here is how to block until completion:
669
+ # result.wait_until_done! timeout: 60
670
+ # if result.response?
671
+ # p result.response
672
+ # else
673
+ # puts "Error!"
674
+ # end
675
+ #
676
+ def delete_connection_profile request, options = nil
677
+ raise ::ArgumentError, "request must be provided" if request.nil?
678
+
679
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest
680
+
681
+ # Converts hash and nil to an options object
682
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
683
+
684
+ # Customize the options with defaults
685
+ metadata = @config.rpcs.delete_connection_profile.metadata.to_h
686
+
687
+ # Set x-goog-api-client and x-goog-user-project headers
688
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
689
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
690
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
691
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
692
+
693
+ header_params = {}
694
+ if request.name
695
+ header_params["name"] = request.name
696
+ end
697
+
698
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
699
+ metadata[:"x-goog-request-params"] ||= request_params_header
700
+
701
+ options.apply_defaults timeout: @config.rpcs.delete_connection_profile.timeout,
702
+ metadata: metadata,
703
+ retry_policy: @config.rpcs.delete_connection_profile.retry_policy
704
+
705
+ options.apply_defaults timeout: @config.timeout,
706
+ metadata: @config.metadata,
707
+ retry_policy: @config.retry_policy
708
+
709
+ @datastream_stub.call_rpc :delete_connection_profile, request, options: options do |response, operation|
710
+ response = ::Gapic::Operation.new response, @operations_client, options: options
711
+ yield response, operation if block_given?
712
+ return response
713
+ end
714
+ rescue ::GRPC::BadStatus => e
715
+ raise ::Google::Cloud::Error.from_error(e)
716
+ end
717
+
718
+ ##
719
+ # Use this method to discover a connection profile.
720
+ # The discover API call exposes the data objects and metadata belonging to
721
+ # the profile. Typically, a request returns children data objects of a
722
+ # parent data object that's optionally supplied in the request.
723
+ #
724
+ # @overload discover_connection_profile(request, options = nil)
725
+ # Pass arguments to `discover_connection_profile` via a request object, either of type
726
+ # {::Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest} or an equivalent Hash.
727
+ #
728
+ # @param request [::Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest, ::Hash]
729
+ # A request object representing the call parameters. Required. To specify no
730
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
731
+ # @param options [::Gapic::CallOptions, ::Hash]
732
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
733
+ #
734
+ # @overload discover_connection_profile(parent: nil, connection_profile: nil, connection_profile_name: nil, full_hierarchy: nil, hierarchy_depth: nil, oracle_rdbms: nil, mysql_rdbms: nil)
735
+ # Pass arguments to `discover_connection_profile` via keyword arguments. Note that at
736
+ # least one keyword argument is required. To specify no parameters, or to keep all
737
+ # the default parameter values, pass an empty Hash as a request object (see above).
738
+ #
739
+ # @param parent [::String]
740
+ # Required. The parent resource of the connection profile type. Must be in the
741
+ # format `projects/*/locations/*`.
742
+ # @param connection_profile [::Google::Cloud::Datastream::V1::ConnectionProfile, ::Hash]
743
+ # An ad-hoc connection profile configuration.
744
+ # @param connection_profile_name [::String]
745
+ # A reference to an existing connection profile.
746
+ # @param full_hierarchy [::Boolean]
747
+ # Whether to retrieve the full hierarchy of data objects (TRUE) or only the
748
+ # current level (FALSE).
749
+ # @param hierarchy_depth [::Integer]
750
+ # The number of hierarchy levels below the current level to be retrieved.
751
+ # @param oracle_rdbms [::Google::Cloud::Datastream::V1::OracleRdbms, ::Hash]
752
+ # Oracle RDBMS to enrich with child data objects and metadata.
753
+ # @param mysql_rdbms [::Google::Cloud::Datastream::V1::MysqlRdbms, ::Hash]
754
+ # MySQL RDBMS to enrich with child data objects and metadata.
755
+ #
756
+ # @yield [response, operation] Access the result along with the RPC operation
757
+ # @yieldparam response [::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse]
758
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
759
+ #
760
+ # @return [::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse]
761
+ #
762
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
763
+ #
764
+ # @example Basic example
765
+ # require "google/cloud/datastream/v1"
766
+ #
767
+ # # Create a client object. The client can be reused for multiple calls.
768
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
769
+ #
770
+ # # Create a request. To set request fields, pass in keyword arguments.
771
+ # request = Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest.new
772
+ #
773
+ # # Call the discover_connection_profile method.
774
+ # result = client.discover_connection_profile request
775
+ #
776
+ # # The returned object is of type Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse.
777
+ # p result
778
+ #
779
+ def discover_connection_profile request, options = nil
780
+ raise ::ArgumentError, "request must be provided" if request.nil?
781
+
782
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest
783
+
784
+ # Converts hash and nil to an options object
785
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
786
+
787
+ # Customize the options with defaults
788
+ metadata = @config.rpcs.discover_connection_profile.metadata.to_h
789
+
790
+ # Set x-goog-api-client and x-goog-user-project headers
791
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
792
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
793
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
794
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
795
+
796
+ header_params = {}
797
+ if request.parent
798
+ header_params["parent"] = request.parent
799
+ end
800
+
801
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
802
+ metadata[:"x-goog-request-params"] ||= request_params_header
803
+
804
+ options.apply_defaults timeout: @config.rpcs.discover_connection_profile.timeout,
805
+ metadata: metadata,
806
+ retry_policy: @config.rpcs.discover_connection_profile.retry_policy
807
+
808
+ options.apply_defaults timeout: @config.timeout,
809
+ metadata: @config.metadata,
810
+ retry_policy: @config.retry_policy
811
+
812
+ @datastream_stub.call_rpc :discover_connection_profile, request, options: options do |response, operation|
813
+ yield response, operation if block_given?
814
+ return response
815
+ end
816
+ rescue ::GRPC::BadStatus => e
817
+ raise ::Google::Cloud::Error.from_error(e)
818
+ end
819
+
820
+ ##
821
+ # Use this method to list streams in a project and location.
822
+ #
823
+ # @overload list_streams(request, options = nil)
824
+ # Pass arguments to `list_streams` via a request object, either of type
825
+ # {::Google::Cloud::Datastream::V1::ListStreamsRequest} or an equivalent Hash.
826
+ #
827
+ # @param request [::Google::Cloud::Datastream::V1::ListStreamsRequest, ::Hash]
828
+ # A request object representing the call parameters. Required. To specify no
829
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
830
+ # @param options [::Gapic::CallOptions, ::Hash]
831
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
832
+ #
833
+ # @overload list_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
834
+ # Pass arguments to `list_streams` via keyword arguments. Note that at
835
+ # least one keyword argument is required. To specify no parameters, or to keep all
836
+ # the default parameter values, pass an empty Hash as a request object (see above).
837
+ #
838
+ # @param parent [::String]
839
+ # Required. The parent that owns the collection of streams.
840
+ # @param page_size [::Integer]
841
+ # Maximum number of streams to return.
842
+ # If unspecified, at most 50 streams will be returned. The maximum
843
+ # value is 1000; values above 1000 will be coerced to 1000.
844
+ # @param page_token [::String]
845
+ # Page token received from a previous `ListStreams` call.
846
+ # Provide this to retrieve the subsequent page.
847
+ #
848
+ # When paginating, all other parameters provided to `ListStreams`
849
+ # must match the call that provided the page token.
850
+ # @param filter [::String]
851
+ # Filter request.
852
+ # @param order_by [::String]
853
+ # Order by fields for the result.
854
+ #
855
+ # @yield [response, operation] Access the result along with the RPC operation
856
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Stream>]
857
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
858
+ #
859
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Stream>]
860
+ #
861
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
862
+ #
863
+ # @example Basic example
864
+ # require "google/cloud/datastream/v1"
865
+ #
866
+ # # Create a client object. The client can be reused for multiple calls.
867
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
868
+ #
869
+ # # Create a request. To set request fields, pass in keyword arguments.
870
+ # request = Google::Cloud::Datastream::V1::ListStreamsRequest.new
871
+ #
872
+ # # Call the list_streams method.
873
+ # result = client.list_streams request
874
+ #
875
+ # # The returned object is of type Gapic::PagedEnumerable. You can
876
+ # # iterate over all elements by calling #each, and the enumerable
877
+ # # will lazily make API calls to fetch subsequent pages. Other
878
+ # # methods are also available for managing paging directly.
879
+ # result.each do |response|
880
+ # # Each element is of type ::Google::Cloud::Datastream::V1::Stream.
881
+ # p response
882
+ # end
883
+ #
884
+ def list_streams request, options = nil
885
+ raise ::ArgumentError, "request must be provided" if request.nil?
886
+
887
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::ListStreamsRequest
888
+
889
+ # Converts hash and nil to an options object
890
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
891
+
892
+ # Customize the options with defaults
893
+ metadata = @config.rpcs.list_streams.metadata.to_h
894
+
895
+ # Set x-goog-api-client and x-goog-user-project headers
896
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
897
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
898
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
899
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
900
+
901
+ header_params = {}
902
+ if request.parent
903
+ header_params["parent"] = request.parent
904
+ end
905
+
906
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
907
+ metadata[:"x-goog-request-params"] ||= request_params_header
908
+
909
+ options.apply_defaults timeout: @config.rpcs.list_streams.timeout,
910
+ metadata: metadata,
911
+ retry_policy: @config.rpcs.list_streams.retry_policy
912
+
913
+ options.apply_defaults timeout: @config.timeout,
914
+ metadata: @config.metadata,
915
+ retry_policy: @config.retry_policy
916
+
917
+ @datastream_stub.call_rpc :list_streams, request, options: options do |response, operation|
918
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_streams, request, response, operation, options
919
+ yield response, operation if block_given?
920
+ return response
921
+ end
922
+ rescue ::GRPC::BadStatus => e
923
+ raise ::Google::Cloud::Error.from_error(e)
924
+ end
925
+
926
+ ##
927
+ # Use this method to get details about a stream.
928
+ #
929
+ # @overload get_stream(request, options = nil)
930
+ # Pass arguments to `get_stream` via a request object, either of type
931
+ # {::Google::Cloud::Datastream::V1::GetStreamRequest} or an equivalent Hash.
932
+ #
933
+ # @param request [::Google::Cloud::Datastream::V1::GetStreamRequest, ::Hash]
934
+ # A request object representing the call parameters. Required. To specify no
935
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
936
+ # @param options [::Gapic::CallOptions, ::Hash]
937
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
938
+ #
939
+ # @overload get_stream(name: nil)
940
+ # Pass arguments to `get_stream` via keyword arguments. Note that at
941
+ # least one keyword argument is required. To specify no parameters, or to keep all
942
+ # the default parameter values, pass an empty Hash as a request object (see above).
943
+ #
944
+ # @param name [::String]
945
+ # Required. The name of the stream resource to get.
946
+ #
947
+ # @yield [response, operation] Access the result along with the RPC operation
948
+ # @yieldparam response [::Google::Cloud::Datastream::V1::Stream]
949
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
950
+ #
951
+ # @return [::Google::Cloud::Datastream::V1::Stream]
952
+ #
953
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
954
+ #
955
+ # @example Basic example
956
+ # require "google/cloud/datastream/v1"
957
+ #
958
+ # # Create a client object. The client can be reused for multiple calls.
959
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
960
+ #
961
+ # # Create a request. To set request fields, pass in keyword arguments.
962
+ # request = Google::Cloud::Datastream::V1::GetStreamRequest.new
963
+ #
964
+ # # Call the get_stream method.
965
+ # result = client.get_stream request
966
+ #
967
+ # # The returned object is of type Google::Cloud::Datastream::V1::Stream.
968
+ # p result
969
+ #
970
+ def get_stream request, options = nil
971
+ raise ::ArgumentError, "request must be provided" if request.nil?
972
+
973
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::GetStreamRequest
974
+
975
+ # Converts hash and nil to an options object
976
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
977
+
978
+ # Customize the options with defaults
979
+ metadata = @config.rpcs.get_stream.metadata.to_h
980
+
981
+ # Set x-goog-api-client and x-goog-user-project headers
982
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
983
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
984
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
985
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
986
+
987
+ header_params = {}
988
+ if request.name
989
+ header_params["name"] = request.name
990
+ end
991
+
992
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
993
+ metadata[:"x-goog-request-params"] ||= request_params_header
994
+
995
+ options.apply_defaults timeout: @config.rpcs.get_stream.timeout,
996
+ metadata: metadata,
997
+ retry_policy: @config.rpcs.get_stream.retry_policy
998
+
999
+ options.apply_defaults timeout: @config.timeout,
1000
+ metadata: @config.metadata,
1001
+ retry_policy: @config.retry_policy
1002
+
1003
+ @datastream_stub.call_rpc :get_stream, request, options: options do |response, operation|
1004
+ yield response, operation if block_given?
1005
+ return response
1006
+ end
1007
+ rescue ::GRPC::BadStatus => e
1008
+ raise ::Google::Cloud::Error.from_error(e)
1009
+ end
1010
+
1011
+ ##
1012
+ # Use this method to create a stream.
1013
+ #
1014
+ # @overload create_stream(request, options = nil)
1015
+ # Pass arguments to `create_stream` via a request object, either of type
1016
+ # {::Google::Cloud::Datastream::V1::CreateStreamRequest} or an equivalent Hash.
1017
+ #
1018
+ # @param request [::Google::Cloud::Datastream::V1::CreateStreamRequest, ::Hash]
1019
+ # A request object representing the call parameters. Required. To specify no
1020
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1021
+ # @param options [::Gapic::CallOptions, ::Hash]
1022
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1023
+ #
1024
+ # @overload create_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil, validate_only: nil, force: nil)
1025
+ # Pass arguments to `create_stream` via keyword arguments. Note that at
1026
+ # least one keyword argument is required. To specify no parameters, or to keep all
1027
+ # the default parameter values, pass an empty Hash as a request object (see above).
1028
+ #
1029
+ # @param parent [::String]
1030
+ # Required. The parent that owns the collection of streams.
1031
+ # @param stream_id [::String]
1032
+ # Required. The stream identifier.
1033
+ # @param stream [::Google::Cloud::Datastream::V1::Stream, ::Hash]
1034
+ # Required. The stream resource to create.
1035
+ # @param request_id [::String]
1036
+ # Optional. A request ID to identify requests. Specify a unique request ID
1037
+ # so that if you must retry your request, the server will know to ignore
1038
+ # the request if it has already been completed. The server will guarantee
1039
+ # that for at least 60 minutes since the first request.
1040
+ #
1041
+ # For example, consider a situation where you make an initial request and the
1042
+ # request times out. If you make the request again with the same request ID,
1043
+ # the server can check if original operation with the same request ID was
1044
+ # received, and if so, will ignore the second request. This prevents clients
1045
+ # from accidentally creating duplicate commitments.
1046
+ #
1047
+ # The request ID must be a valid UUID with the exception that zero UUID is
1048
+ # not supported (00000000-0000-0000-0000-000000000000).
1049
+ # @param validate_only [::Boolean]
1050
+ # Optional. Only validate the stream, but don't create any resources.
1051
+ # The default is false.
1052
+ # @param force [::Boolean]
1053
+ # Optional. Create the stream without validating it.
1054
+ #
1055
+ # @yield [response, operation] Access the result along with the RPC operation
1056
+ # @yieldparam response [::Gapic::Operation]
1057
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1058
+ #
1059
+ # @return [::Gapic::Operation]
1060
+ #
1061
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1062
+ #
1063
+ # @example Basic example
1064
+ # require "google/cloud/datastream/v1"
1065
+ #
1066
+ # # Create a client object. The client can be reused for multiple calls.
1067
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1068
+ #
1069
+ # # Create a request. To set request fields, pass in keyword arguments.
1070
+ # request = Google::Cloud::Datastream::V1::CreateStreamRequest.new
1071
+ #
1072
+ # # Call the create_stream method.
1073
+ # result = client.create_stream request
1074
+ #
1075
+ # # The returned object is of type Gapic::Operation. You can use this
1076
+ # # object to check the status of an operation, cancel it, or wait
1077
+ # # for results. Here is how to block until completion:
1078
+ # result.wait_until_done! timeout: 60
1079
+ # if result.response?
1080
+ # p result.response
1081
+ # else
1082
+ # puts "Error!"
1083
+ # end
1084
+ #
1085
+ def create_stream request, options = nil
1086
+ raise ::ArgumentError, "request must be provided" if request.nil?
1087
+
1088
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::CreateStreamRequest
1089
+
1090
+ # Converts hash and nil to an options object
1091
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1092
+
1093
+ # Customize the options with defaults
1094
+ metadata = @config.rpcs.create_stream.metadata.to_h
1095
+
1096
+ # Set x-goog-api-client and x-goog-user-project headers
1097
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1098
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1099
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1100
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1101
+
1102
+ header_params = {}
1103
+ if request.parent
1104
+ header_params["parent"] = request.parent
1105
+ end
1106
+
1107
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1108
+ metadata[:"x-goog-request-params"] ||= request_params_header
1109
+
1110
+ options.apply_defaults timeout: @config.rpcs.create_stream.timeout,
1111
+ metadata: metadata,
1112
+ retry_policy: @config.rpcs.create_stream.retry_policy
1113
+
1114
+ options.apply_defaults timeout: @config.timeout,
1115
+ metadata: @config.metadata,
1116
+ retry_policy: @config.retry_policy
1117
+
1118
+ @datastream_stub.call_rpc :create_stream, request, options: options do |response, operation|
1119
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1120
+ yield response, operation if block_given?
1121
+ return response
1122
+ end
1123
+ rescue ::GRPC::BadStatus => e
1124
+ raise ::Google::Cloud::Error.from_error(e)
1125
+ end
1126
+
1127
+ ##
1128
+ # Use this method to update the configuration of a stream.
1129
+ #
1130
+ # @overload update_stream(request, options = nil)
1131
+ # Pass arguments to `update_stream` via a request object, either of type
1132
+ # {::Google::Cloud::Datastream::V1::UpdateStreamRequest} or an equivalent Hash.
1133
+ #
1134
+ # @param request [::Google::Cloud::Datastream::V1::UpdateStreamRequest, ::Hash]
1135
+ # A request object representing the call parameters. Required. To specify no
1136
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1137
+ # @param options [::Gapic::CallOptions, ::Hash]
1138
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1139
+ #
1140
+ # @overload update_stream(update_mask: nil, stream: nil, request_id: nil, validate_only: nil, force: nil)
1141
+ # Pass arguments to `update_stream` via keyword arguments. Note that at
1142
+ # least one keyword argument is required. To specify no parameters, or to keep all
1143
+ # the default parameter values, pass an empty Hash as a request object (see above).
1144
+ #
1145
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1146
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1147
+ # stream resource by the update.
1148
+ # The fields specified in the update_mask are relative to the resource, not
1149
+ # the full request. A field will be overwritten if it is in the mask. If the
1150
+ # user does not provide a mask then all fields will be overwritten.
1151
+ # @param stream [::Google::Cloud::Datastream::V1::Stream, ::Hash]
1152
+ # Required. The stream resource to update.
1153
+ # @param request_id [::String]
1154
+ # Optional. A request ID to identify requests. Specify a unique request ID
1155
+ # so that if you must retry your request, the server will know to ignore
1156
+ # the request if it has already been completed. The server will guarantee
1157
+ # that for at least 60 minutes since the first request.
1158
+ #
1159
+ # For example, consider a situation where you make an initial request and the
1160
+ # request times out. If you make the request again with the same request ID,
1161
+ # the server can check if original operation with the same request ID was
1162
+ # received, and if so, will ignore the second request. This prevents clients
1163
+ # from accidentally creating duplicate commitments.
1164
+ #
1165
+ # The request ID must be a valid UUID with the exception that zero UUID is
1166
+ # not supported (00000000-0000-0000-0000-000000000000).
1167
+ # @param validate_only [::Boolean]
1168
+ # Optional. Only validate the stream with the changes, without actually updating it.
1169
+ # The default is false.
1170
+ # @param force [::Boolean]
1171
+ # Optional. Update the stream without validating it.
1172
+ #
1173
+ # @yield [response, operation] Access the result along with the RPC operation
1174
+ # @yieldparam response [::Gapic::Operation]
1175
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1176
+ #
1177
+ # @return [::Gapic::Operation]
1178
+ #
1179
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1180
+ #
1181
+ # @example Basic example
1182
+ # require "google/cloud/datastream/v1"
1183
+ #
1184
+ # # Create a client object. The client can be reused for multiple calls.
1185
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1186
+ #
1187
+ # # Create a request. To set request fields, pass in keyword arguments.
1188
+ # request = Google::Cloud::Datastream::V1::UpdateStreamRequest.new
1189
+ #
1190
+ # # Call the update_stream method.
1191
+ # result = client.update_stream request
1192
+ #
1193
+ # # The returned object is of type Gapic::Operation. You can use this
1194
+ # # object to check the status of an operation, cancel it, or wait
1195
+ # # for results. Here is how to block until completion:
1196
+ # result.wait_until_done! timeout: 60
1197
+ # if result.response?
1198
+ # p result.response
1199
+ # else
1200
+ # puts "Error!"
1201
+ # end
1202
+ #
1203
+ def update_stream request, options = nil
1204
+ raise ::ArgumentError, "request must be provided" if request.nil?
1205
+
1206
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::UpdateStreamRequest
1207
+
1208
+ # Converts hash and nil to an options object
1209
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1210
+
1211
+ # Customize the options with defaults
1212
+ metadata = @config.rpcs.update_stream.metadata.to_h
1213
+
1214
+ # Set x-goog-api-client and x-goog-user-project headers
1215
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1216
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1217
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1218
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1219
+
1220
+ header_params = {}
1221
+ if request.stream&.name
1222
+ header_params["stream.name"] = request.stream.name
1223
+ end
1224
+
1225
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1226
+ metadata[:"x-goog-request-params"] ||= request_params_header
1227
+
1228
+ options.apply_defaults timeout: @config.rpcs.update_stream.timeout,
1229
+ metadata: metadata,
1230
+ retry_policy: @config.rpcs.update_stream.retry_policy
1231
+
1232
+ options.apply_defaults timeout: @config.timeout,
1233
+ metadata: @config.metadata,
1234
+ retry_policy: @config.retry_policy
1235
+
1236
+ @datastream_stub.call_rpc :update_stream, request, options: options do |response, operation|
1237
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1238
+ yield response, operation if block_given?
1239
+ return response
1240
+ end
1241
+ rescue ::GRPC::BadStatus => e
1242
+ raise ::Google::Cloud::Error.from_error(e)
1243
+ end
1244
+
1245
+ ##
1246
+ # Use this method to delete a stream.
1247
+ #
1248
+ # @overload delete_stream(request, options = nil)
1249
+ # Pass arguments to `delete_stream` via a request object, either of type
1250
+ # {::Google::Cloud::Datastream::V1::DeleteStreamRequest} or an equivalent Hash.
1251
+ #
1252
+ # @param request [::Google::Cloud::Datastream::V1::DeleteStreamRequest, ::Hash]
1253
+ # A request object representing the call parameters. Required. To specify no
1254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1255
+ # @param options [::Gapic::CallOptions, ::Hash]
1256
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1257
+ #
1258
+ # @overload delete_stream(name: nil, request_id: nil)
1259
+ # Pass arguments to `delete_stream` via keyword arguments. Note that at
1260
+ # least one keyword argument is required. To specify no parameters, or to keep all
1261
+ # the default parameter values, pass an empty Hash as a request object (see above).
1262
+ #
1263
+ # @param name [::String]
1264
+ # Required. The name of the stream resource to delete.
1265
+ # @param request_id [::String]
1266
+ # Optional. A request ID to identify requests. Specify a unique request ID
1267
+ # so that if you must retry your request, the server will know to ignore
1268
+ # the request if it has already been completed. The server will guarantee
1269
+ # that for at least 60 minutes after the first request.
1270
+ #
1271
+ # For example, consider a situation where you make an initial request and the
1272
+ # request times out. If you make the request again with the same request ID,
1273
+ # the server can check if original operation with the same request ID was
1274
+ # received, and if so, will ignore the second request. This prevents clients
1275
+ # from accidentally creating duplicate commitments.
1276
+ #
1277
+ # The request ID must be a valid UUID with the exception that zero UUID is
1278
+ # not supported (00000000-0000-0000-0000-000000000000).
1279
+ #
1280
+ # @yield [response, operation] Access the result along with the RPC operation
1281
+ # @yieldparam response [::Gapic::Operation]
1282
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1283
+ #
1284
+ # @return [::Gapic::Operation]
1285
+ #
1286
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1287
+ #
1288
+ # @example Basic example
1289
+ # require "google/cloud/datastream/v1"
1290
+ #
1291
+ # # Create a client object. The client can be reused for multiple calls.
1292
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1293
+ #
1294
+ # # Create a request. To set request fields, pass in keyword arguments.
1295
+ # request = Google::Cloud::Datastream::V1::DeleteStreamRequest.new
1296
+ #
1297
+ # # Call the delete_stream method.
1298
+ # result = client.delete_stream request
1299
+ #
1300
+ # # The returned object is of type Gapic::Operation. You can use this
1301
+ # # object to check the status of an operation, cancel it, or wait
1302
+ # # for results. Here is how to block until completion:
1303
+ # result.wait_until_done! timeout: 60
1304
+ # if result.response?
1305
+ # p result.response
1306
+ # else
1307
+ # puts "Error!"
1308
+ # end
1309
+ #
1310
+ def delete_stream request, options = nil
1311
+ raise ::ArgumentError, "request must be provided" if request.nil?
1312
+
1313
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::DeleteStreamRequest
1314
+
1315
+ # Converts hash and nil to an options object
1316
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1317
+
1318
+ # Customize the options with defaults
1319
+ metadata = @config.rpcs.delete_stream.metadata.to_h
1320
+
1321
+ # Set x-goog-api-client and x-goog-user-project headers
1322
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1323
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1324
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1325
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1326
+
1327
+ header_params = {}
1328
+ if request.name
1329
+ header_params["name"] = request.name
1330
+ end
1331
+
1332
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1333
+ metadata[:"x-goog-request-params"] ||= request_params_header
1334
+
1335
+ options.apply_defaults timeout: @config.rpcs.delete_stream.timeout,
1336
+ metadata: metadata,
1337
+ retry_policy: @config.rpcs.delete_stream.retry_policy
1338
+
1339
+ options.apply_defaults timeout: @config.timeout,
1340
+ metadata: @config.metadata,
1341
+ retry_policy: @config.retry_policy
1342
+
1343
+ @datastream_stub.call_rpc :delete_stream, request, options: options do |response, operation|
1344
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1345
+ yield response, operation if block_given?
1346
+ return response
1347
+ end
1348
+ rescue ::GRPC::BadStatus => e
1349
+ raise ::Google::Cloud::Error.from_error(e)
1350
+ end
1351
+
1352
+ ##
1353
+ # Use this method to get details about a stream object.
1354
+ #
1355
+ # @overload get_stream_object(request, options = nil)
1356
+ # Pass arguments to `get_stream_object` via a request object, either of type
1357
+ # {::Google::Cloud::Datastream::V1::GetStreamObjectRequest} or an equivalent Hash.
1358
+ #
1359
+ # @param request [::Google::Cloud::Datastream::V1::GetStreamObjectRequest, ::Hash]
1360
+ # A request object representing the call parameters. Required. To specify no
1361
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1362
+ # @param options [::Gapic::CallOptions, ::Hash]
1363
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1364
+ #
1365
+ # @overload get_stream_object(name: nil)
1366
+ # Pass arguments to `get_stream_object` via keyword arguments. Note that at
1367
+ # least one keyword argument is required. To specify no parameters, or to keep all
1368
+ # the default parameter values, pass an empty Hash as a request object (see above).
1369
+ #
1370
+ # @param name [::String]
1371
+ # Required. The name of the stream object resource to get.
1372
+ #
1373
+ # @yield [response, operation] Access the result along with the RPC operation
1374
+ # @yieldparam response [::Google::Cloud::Datastream::V1::StreamObject]
1375
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1376
+ #
1377
+ # @return [::Google::Cloud::Datastream::V1::StreamObject]
1378
+ #
1379
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1380
+ #
1381
+ # @example Basic example
1382
+ # require "google/cloud/datastream/v1"
1383
+ #
1384
+ # # Create a client object. The client can be reused for multiple calls.
1385
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1386
+ #
1387
+ # # Create a request. To set request fields, pass in keyword arguments.
1388
+ # request = Google::Cloud::Datastream::V1::GetStreamObjectRequest.new
1389
+ #
1390
+ # # Call the get_stream_object method.
1391
+ # result = client.get_stream_object request
1392
+ #
1393
+ # # The returned object is of type Google::Cloud::Datastream::V1::StreamObject.
1394
+ # p result
1395
+ #
1396
+ def get_stream_object request, options = nil
1397
+ raise ::ArgumentError, "request must be provided" if request.nil?
1398
+
1399
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::GetStreamObjectRequest
1400
+
1401
+ # Converts hash and nil to an options object
1402
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1403
+
1404
+ # Customize the options with defaults
1405
+ metadata = @config.rpcs.get_stream_object.metadata.to_h
1406
+
1407
+ # Set x-goog-api-client and x-goog-user-project headers
1408
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1409
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1410
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1411
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1412
+
1413
+ header_params = {}
1414
+ if request.name
1415
+ header_params["name"] = request.name
1416
+ end
1417
+
1418
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1419
+ metadata[:"x-goog-request-params"] ||= request_params_header
1420
+
1421
+ options.apply_defaults timeout: @config.rpcs.get_stream_object.timeout,
1422
+ metadata: metadata,
1423
+ retry_policy: @config.rpcs.get_stream_object.retry_policy
1424
+
1425
+ options.apply_defaults timeout: @config.timeout,
1426
+ metadata: @config.metadata,
1427
+ retry_policy: @config.retry_policy
1428
+
1429
+ @datastream_stub.call_rpc :get_stream_object, request, options: options do |response, operation|
1430
+ yield response, operation if block_given?
1431
+ return response
1432
+ end
1433
+ rescue ::GRPC::BadStatus => e
1434
+ raise ::Google::Cloud::Error.from_error(e)
1435
+ end
1436
+
1437
+ ##
1438
+ # Use this method to look up a stream object by its source object identifier.
1439
+ #
1440
+ # @overload lookup_stream_object(request, options = nil)
1441
+ # Pass arguments to `lookup_stream_object` via a request object, either of type
1442
+ # {::Google::Cloud::Datastream::V1::LookupStreamObjectRequest} or an equivalent Hash.
1443
+ #
1444
+ # @param request [::Google::Cloud::Datastream::V1::LookupStreamObjectRequest, ::Hash]
1445
+ # A request object representing the call parameters. Required. To specify no
1446
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1447
+ # @param options [::Gapic::CallOptions, ::Hash]
1448
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1449
+ #
1450
+ # @overload lookup_stream_object(parent: nil, source_object_identifier: nil)
1451
+ # Pass arguments to `lookup_stream_object` via keyword arguments. Note that at
1452
+ # least one keyword argument is required. To specify no parameters, or to keep all
1453
+ # the default parameter values, pass an empty Hash as a request object (see above).
1454
+ #
1455
+ # @param parent [::String]
1456
+ # Required. The parent stream that owns the collection of objects.
1457
+ # @param source_object_identifier [::Google::Cloud::Datastream::V1::SourceObjectIdentifier, ::Hash]
1458
+ # Required. The source object identifier which maps to the stream object.
1459
+ #
1460
+ # @yield [response, operation] Access the result along with the RPC operation
1461
+ # @yieldparam response [::Google::Cloud::Datastream::V1::StreamObject]
1462
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1463
+ #
1464
+ # @return [::Google::Cloud::Datastream::V1::StreamObject]
1465
+ #
1466
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1467
+ #
1468
+ # @example Basic example
1469
+ # require "google/cloud/datastream/v1"
1470
+ #
1471
+ # # Create a client object. The client can be reused for multiple calls.
1472
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1473
+ #
1474
+ # # Create a request. To set request fields, pass in keyword arguments.
1475
+ # request = Google::Cloud::Datastream::V1::LookupStreamObjectRequest.new
1476
+ #
1477
+ # # Call the lookup_stream_object method.
1478
+ # result = client.lookup_stream_object request
1479
+ #
1480
+ # # The returned object is of type Google::Cloud::Datastream::V1::StreamObject.
1481
+ # p result
1482
+ #
1483
+ def lookup_stream_object request, options = nil
1484
+ raise ::ArgumentError, "request must be provided" if request.nil?
1485
+
1486
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::LookupStreamObjectRequest
1487
+
1488
+ # Converts hash and nil to an options object
1489
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1490
+
1491
+ # Customize the options with defaults
1492
+ metadata = @config.rpcs.lookup_stream_object.metadata.to_h
1493
+
1494
+ # Set x-goog-api-client and x-goog-user-project headers
1495
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1496
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1497
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1498
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1499
+
1500
+ header_params = {}
1501
+ if request.parent
1502
+ header_params["parent"] = request.parent
1503
+ end
1504
+
1505
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1506
+ metadata[:"x-goog-request-params"] ||= request_params_header
1507
+
1508
+ options.apply_defaults timeout: @config.rpcs.lookup_stream_object.timeout,
1509
+ metadata: metadata,
1510
+ retry_policy: @config.rpcs.lookup_stream_object.retry_policy
1511
+
1512
+ options.apply_defaults timeout: @config.timeout,
1513
+ metadata: @config.metadata,
1514
+ retry_policy: @config.retry_policy
1515
+
1516
+ @datastream_stub.call_rpc :lookup_stream_object, request, options: options do |response, operation|
1517
+ yield response, operation if block_given?
1518
+ return response
1519
+ end
1520
+ rescue ::GRPC::BadStatus => e
1521
+ raise ::Google::Cloud::Error.from_error(e)
1522
+ end
1523
+
1524
+ ##
1525
+ # Use this method to list the objects of a specific stream.
1526
+ #
1527
+ # @overload list_stream_objects(request, options = nil)
1528
+ # Pass arguments to `list_stream_objects` via a request object, either of type
1529
+ # {::Google::Cloud::Datastream::V1::ListStreamObjectsRequest} or an equivalent Hash.
1530
+ #
1531
+ # @param request [::Google::Cloud::Datastream::V1::ListStreamObjectsRequest, ::Hash]
1532
+ # A request object representing the call parameters. Required. To specify no
1533
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1534
+ # @param options [::Gapic::CallOptions, ::Hash]
1535
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1536
+ #
1537
+ # @overload list_stream_objects(parent: nil, page_size: nil, page_token: nil)
1538
+ # Pass arguments to `list_stream_objects` via keyword arguments. Note that at
1539
+ # least one keyword argument is required. To specify no parameters, or to keep all
1540
+ # the default parameter values, pass an empty Hash as a request object (see above).
1541
+ #
1542
+ # @param parent [::String]
1543
+ # Required. The parent stream that owns the collection of objects.
1544
+ # @param page_size [::Integer]
1545
+ # Maximum number of objects to return. Default is 50.
1546
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
1547
+ # @param page_token [::String]
1548
+ # Page token received from a previous `ListStreamObjectsRequest` call.
1549
+ # Provide this to retrieve the subsequent page.
1550
+ #
1551
+ # When paginating, all other parameters provided to
1552
+ # `ListStreamObjectsRequest` must match the call that provided the page
1553
+ # token.
1554
+ #
1555
+ # @yield [response, operation] Access the result along with the RPC operation
1556
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::StreamObject>]
1557
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1558
+ #
1559
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::StreamObject>]
1560
+ #
1561
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1562
+ #
1563
+ # @example Basic example
1564
+ # require "google/cloud/datastream/v1"
1565
+ #
1566
+ # # Create a client object. The client can be reused for multiple calls.
1567
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1568
+ #
1569
+ # # Create a request. To set request fields, pass in keyword arguments.
1570
+ # request = Google::Cloud::Datastream::V1::ListStreamObjectsRequest.new
1571
+ #
1572
+ # # Call the list_stream_objects method.
1573
+ # result = client.list_stream_objects request
1574
+ #
1575
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1576
+ # # iterate over all elements by calling #each, and the enumerable
1577
+ # # will lazily make API calls to fetch subsequent pages. Other
1578
+ # # methods are also available for managing paging directly.
1579
+ # result.each do |response|
1580
+ # # Each element is of type ::Google::Cloud::Datastream::V1::StreamObject.
1581
+ # p response
1582
+ # end
1583
+ #
1584
+ def list_stream_objects request, options = nil
1585
+ raise ::ArgumentError, "request must be provided" if request.nil?
1586
+
1587
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::ListStreamObjectsRequest
1588
+
1589
+ # Converts hash and nil to an options object
1590
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1591
+
1592
+ # Customize the options with defaults
1593
+ metadata = @config.rpcs.list_stream_objects.metadata.to_h
1594
+
1595
+ # Set x-goog-api-client and x-goog-user-project headers
1596
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1597
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1598
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1599
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1600
+
1601
+ header_params = {}
1602
+ if request.parent
1603
+ header_params["parent"] = request.parent
1604
+ end
1605
+
1606
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1607
+ metadata[:"x-goog-request-params"] ||= request_params_header
1608
+
1609
+ options.apply_defaults timeout: @config.rpcs.list_stream_objects.timeout,
1610
+ metadata: metadata,
1611
+ retry_policy: @config.rpcs.list_stream_objects.retry_policy
1612
+
1613
+ options.apply_defaults timeout: @config.timeout,
1614
+ metadata: @config.metadata,
1615
+ retry_policy: @config.retry_policy
1616
+
1617
+ @datastream_stub.call_rpc :list_stream_objects, request, options: options do |response, operation|
1618
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_stream_objects, request, response, operation, options
1619
+ yield response, operation if block_given?
1620
+ return response
1621
+ end
1622
+ rescue ::GRPC::BadStatus => e
1623
+ raise ::Google::Cloud::Error.from_error(e)
1624
+ end
1625
+
1626
+ ##
1627
+ # Use this method to start a backfill job for the specified stream object.
1628
+ #
1629
+ # @overload start_backfill_job(request, options = nil)
1630
+ # Pass arguments to `start_backfill_job` via a request object, either of type
1631
+ # {::Google::Cloud::Datastream::V1::StartBackfillJobRequest} or an equivalent Hash.
1632
+ #
1633
+ # @param request [::Google::Cloud::Datastream::V1::StartBackfillJobRequest, ::Hash]
1634
+ # A request object representing the call parameters. Required. To specify no
1635
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1636
+ # @param options [::Gapic::CallOptions, ::Hash]
1637
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1638
+ #
1639
+ # @overload start_backfill_job(object: nil)
1640
+ # Pass arguments to `start_backfill_job` via keyword arguments. Note that at
1641
+ # least one keyword argument is required. To specify no parameters, or to keep all
1642
+ # the default parameter values, pass an empty Hash as a request object (see above).
1643
+ #
1644
+ # @param object [::String]
1645
+ # Required. The name of the stream object resource to start a backfill job for.
1646
+ #
1647
+ # @yield [response, operation] Access the result along with the RPC operation
1648
+ # @yieldparam response [::Google::Cloud::Datastream::V1::StartBackfillJobResponse]
1649
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1650
+ #
1651
+ # @return [::Google::Cloud::Datastream::V1::StartBackfillJobResponse]
1652
+ #
1653
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1654
+ #
1655
+ # @example Basic example
1656
+ # require "google/cloud/datastream/v1"
1657
+ #
1658
+ # # Create a client object. The client can be reused for multiple calls.
1659
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1660
+ #
1661
+ # # Create a request. To set request fields, pass in keyword arguments.
1662
+ # request = Google::Cloud::Datastream::V1::StartBackfillJobRequest.new
1663
+ #
1664
+ # # Call the start_backfill_job method.
1665
+ # result = client.start_backfill_job request
1666
+ #
1667
+ # # The returned object is of type Google::Cloud::Datastream::V1::StartBackfillJobResponse.
1668
+ # p result
1669
+ #
1670
+ def start_backfill_job request, options = nil
1671
+ raise ::ArgumentError, "request must be provided" if request.nil?
1672
+
1673
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::StartBackfillJobRequest
1674
+
1675
+ # Converts hash and nil to an options object
1676
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1677
+
1678
+ # Customize the options with defaults
1679
+ metadata = @config.rpcs.start_backfill_job.metadata.to_h
1680
+
1681
+ # Set x-goog-api-client and x-goog-user-project headers
1682
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1683
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1684
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1685
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1686
+
1687
+ header_params = {}
1688
+ if request.object
1689
+ header_params["object"] = request.object
1690
+ end
1691
+
1692
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1693
+ metadata[:"x-goog-request-params"] ||= request_params_header
1694
+
1695
+ options.apply_defaults timeout: @config.rpcs.start_backfill_job.timeout,
1696
+ metadata: metadata,
1697
+ retry_policy: @config.rpcs.start_backfill_job.retry_policy
1698
+
1699
+ options.apply_defaults timeout: @config.timeout,
1700
+ metadata: @config.metadata,
1701
+ retry_policy: @config.retry_policy
1702
+
1703
+ @datastream_stub.call_rpc :start_backfill_job, request, options: options do |response, operation|
1704
+ yield response, operation if block_given?
1705
+ return response
1706
+ end
1707
+ rescue ::GRPC::BadStatus => e
1708
+ raise ::Google::Cloud::Error.from_error(e)
1709
+ end
1710
+
1711
+ ##
1712
+ # Use this method to stop a backfill job for the specified stream object.
1713
+ #
1714
+ # @overload stop_backfill_job(request, options = nil)
1715
+ # Pass arguments to `stop_backfill_job` via a request object, either of type
1716
+ # {::Google::Cloud::Datastream::V1::StopBackfillJobRequest} or an equivalent Hash.
1717
+ #
1718
+ # @param request [::Google::Cloud::Datastream::V1::StopBackfillJobRequest, ::Hash]
1719
+ # A request object representing the call parameters. Required. To specify no
1720
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1721
+ # @param options [::Gapic::CallOptions, ::Hash]
1722
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1723
+ #
1724
+ # @overload stop_backfill_job(object: nil)
1725
+ # Pass arguments to `stop_backfill_job` via keyword arguments. Note that at
1726
+ # least one keyword argument is required. To specify no parameters, or to keep all
1727
+ # the default parameter values, pass an empty Hash as a request object (see above).
1728
+ #
1729
+ # @param object [::String]
1730
+ # Required. The name of the stream object resource to stop the backfill job for.
1731
+ #
1732
+ # @yield [response, operation] Access the result along with the RPC operation
1733
+ # @yieldparam response [::Google::Cloud::Datastream::V1::StopBackfillJobResponse]
1734
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1735
+ #
1736
+ # @return [::Google::Cloud::Datastream::V1::StopBackfillJobResponse]
1737
+ #
1738
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1739
+ #
1740
+ # @example Basic example
1741
+ # require "google/cloud/datastream/v1"
1742
+ #
1743
+ # # Create a client object. The client can be reused for multiple calls.
1744
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1745
+ #
1746
+ # # Create a request. To set request fields, pass in keyword arguments.
1747
+ # request = Google::Cloud::Datastream::V1::StopBackfillJobRequest.new
1748
+ #
1749
+ # # Call the stop_backfill_job method.
1750
+ # result = client.stop_backfill_job request
1751
+ #
1752
+ # # The returned object is of type Google::Cloud::Datastream::V1::StopBackfillJobResponse.
1753
+ # p result
1754
+ #
1755
+ def stop_backfill_job request, options = nil
1756
+ raise ::ArgumentError, "request must be provided" if request.nil?
1757
+
1758
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::StopBackfillJobRequest
1759
+
1760
+ # Converts hash and nil to an options object
1761
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1762
+
1763
+ # Customize the options with defaults
1764
+ metadata = @config.rpcs.stop_backfill_job.metadata.to_h
1765
+
1766
+ # Set x-goog-api-client and x-goog-user-project headers
1767
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1768
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1769
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1770
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1771
+
1772
+ header_params = {}
1773
+ if request.object
1774
+ header_params["object"] = request.object
1775
+ end
1776
+
1777
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1778
+ metadata[:"x-goog-request-params"] ||= request_params_header
1779
+
1780
+ options.apply_defaults timeout: @config.rpcs.stop_backfill_job.timeout,
1781
+ metadata: metadata,
1782
+ retry_policy: @config.rpcs.stop_backfill_job.retry_policy
1783
+
1784
+ options.apply_defaults timeout: @config.timeout,
1785
+ metadata: @config.metadata,
1786
+ retry_policy: @config.retry_policy
1787
+
1788
+ @datastream_stub.call_rpc :stop_backfill_job, request, options: options do |response, operation|
1789
+ yield response, operation if block_given?
1790
+ return response
1791
+ end
1792
+ rescue ::GRPC::BadStatus => e
1793
+ raise ::Google::Cloud::Error.from_error(e)
1794
+ end
1795
+
1796
+ ##
1797
+ # The FetchStaticIps API call exposes the static IP addresses used by
1798
+ # Datastream.
1799
+ #
1800
+ # @overload fetch_static_ips(request, options = nil)
1801
+ # Pass arguments to `fetch_static_ips` via a request object, either of type
1802
+ # {::Google::Cloud::Datastream::V1::FetchStaticIpsRequest} or an equivalent Hash.
1803
+ #
1804
+ # @param request [::Google::Cloud::Datastream::V1::FetchStaticIpsRequest, ::Hash]
1805
+ # A request object representing the call parameters. Required. To specify no
1806
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1807
+ # @param options [::Gapic::CallOptions, ::Hash]
1808
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1809
+ #
1810
+ # @overload fetch_static_ips(name: nil, page_size: nil, page_token: nil)
1811
+ # Pass arguments to `fetch_static_ips` via keyword arguments. Note that at
1812
+ # least one keyword argument is required. To specify no parameters, or to keep all
1813
+ # the default parameter values, pass an empty Hash as a request object (see above).
1814
+ #
1815
+ # @param name [::String]
1816
+ # Required. The resource name for the location for which static IPs should be returned.
1817
+ # Must be in the format `projects/*/locations/*`.
1818
+ # @param page_size [::Integer]
1819
+ # Maximum number of Ips to return, will likely not be specified.
1820
+ # @param page_token [::String]
1821
+ # A page token, received from a previous `ListStaticIps` call.
1822
+ # will likely not be specified.
1823
+ #
1824
+ # @yield [response, operation] Access the result along with the RPC operation
1825
+ # @yieldparam response [::Google::Cloud::Datastream::V1::FetchStaticIpsResponse]
1826
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1827
+ #
1828
+ # @return [::Google::Cloud::Datastream::V1::FetchStaticIpsResponse]
1829
+ #
1830
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1831
+ #
1832
+ # @example Basic example
1833
+ # require "google/cloud/datastream/v1"
1834
+ #
1835
+ # # Create a client object. The client can be reused for multiple calls.
1836
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1837
+ #
1838
+ # # Create a request. To set request fields, pass in keyword arguments.
1839
+ # request = Google::Cloud::Datastream::V1::FetchStaticIpsRequest.new
1840
+ #
1841
+ # # Call the fetch_static_ips method.
1842
+ # result = client.fetch_static_ips request
1843
+ #
1844
+ # # The returned object is of type Google::Cloud::Datastream::V1::FetchStaticIpsResponse.
1845
+ # p result
1846
+ #
1847
+ def fetch_static_ips request, options = nil
1848
+ raise ::ArgumentError, "request must be provided" if request.nil?
1849
+
1850
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::FetchStaticIpsRequest
1851
+
1852
+ # Converts hash and nil to an options object
1853
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1854
+
1855
+ # Customize the options with defaults
1856
+ metadata = @config.rpcs.fetch_static_ips.metadata.to_h
1857
+
1858
+ # Set x-goog-api-client and x-goog-user-project headers
1859
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1860
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1861
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1862
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1863
+
1864
+ header_params = {}
1865
+ if request.name
1866
+ header_params["name"] = request.name
1867
+ end
1868
+
1869
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1870
+ metadata[:"x-goog-request-params"] ||= request_params_header
1871
+
1872
+ options.apply_defaults timeout: @config.rpcs.fetch_static_ips.timeout,
1873
+ metadata: metadata,
1874
+ retry_policy: @config.rpcs.fetch_static_ips.retry_policy
1875
+
1876
+ options.apply_defaults timeout: @config.timeout,
1877
+ metadata: @config.metadata,
1878
+ retry_policy: @config.retry_policy
1879
+
1880
+ @datastream_stub.call_rpc :fetch_static_ips, request, options: options do |response, operation|
1881
+ yield response, operation if block_given?
1882
+ return response
1883
+ end
1884
+ rescue ::GRPC::BadStatus => e
1885
+ raise ::Google::Cloud::Error.from_error(e)
1886
+ end
1887
+
1888
+ ##
1889
+ # Use this method to create a private connectivity configuration.
1890
+ #
1891
+ # @overload create_private_connection(request, options = nil)
1892
+ # Pass arguments to `create_private_connection` via a request object, either of type
1893
+ # {::Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest} or an equivalent Hash.
1894
+ #
1895
+ # @param request [::Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest, ::Hash]
1896
+ # A request object representing the call parameters. Required. To specify no
1897
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1898
+ # @param options [::Gapic::CallOptions, ::Hash]
1899
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1900
+ #
1901
+ # @overload create_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil)
1902
+ # Pass arguments to `create_private_connection` via keyword arguments. Note that at
1903
+ # least one keyword argument is required. To specify no parameters, or to keep all
1904
+ # the default parameter values, pass an empty Hash as a request object (see above).
1905
+ #
1906
+ # @param parent [::String]
1907
+ # Required. The parent that owns the collection of PrivateConnections.
1908
+ # @param private_connection_id [::String]
1909
+ # Required. The private connectivity identifier.
1910
+ # @param private_connection [::Google::Cloud::Datastream::V1::PrivateConnection, ::Hash]
1911
+ # Required. The Private Connectivity resource to create.
1912
+ # @param request_id [::String]
1913
+ # Optional. A request ID to identify requests. Specify a unique request ID
1914
+ # so that if you must retry your request, the server will know to ignore
1915
+ # the request if it has already been completed. The server will guarantee
1916
+ # that for at least 60 minutes since the first request.
1917
+ #
1918
+ # For example, consider a situation where you make an initial request and the
1919
+ # request times out. If you make the request again with the same request ID,
1920
+ # the server can check if original operation with the same request ID was
1921
+ # received, and if so, will ignore the second request. This prevents clients
1922
+ # from accidentally creating duplicate commitments.
1923
+ #
1924
+ # The request ID must be a valid UUID with the exception that zero UUID is
1925
+ # not supported (00000000-0000-0000-0000-000000000000).
1926
+ #
1927
+ # @yield [response, operation] Access the result along with the RPC operation
1928
+ # @yieldparam response [::Gapic::Operation]
1929
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1930
+ #
1931
+ # @return [::Gapic::Operation]
1932
+ #
1933
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1934
+ #
1935
+ # @example Basic example
1936
+ # require "google/cloud/datastream/v1"
1937
+ #
1938
+ # # Create a client object. The client can be reused for multiple calls.
1939
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
1940
+ #
1941
+ # # Create a request. To set request fields, pass in keyword arguments.
1942
+ # request = Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest.new
1943
+ #
1944
+ # # Call the create_private_connection method.
1945
+ # result = client.create_private_connection request
1946
+ #
1947
+ # # The returned object is of type Gapic::Operation. You can use this
1948
+ # # object to check the status of an operation, cancel it, or wait
1949
+ # # for results. Here is how to block until completion:
1950
+ # result.wait_until_done! timeout: 60
1951
+ # if result.response?
1952
+ # p result.response
1953
+ # else
1954
+ # puts "Error!"
1955
+ # end
1956
+ #
1957
+ def create_private_connection request, options = nil
1958
+ raise ::ArgumentError, "request must be provided" if request.nil?
1959
+
1960
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest
1961
+
1962
+ # Converts hash and nil to an options object
1963
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1964
+
1965
+ # Customize the options with defaults
1966
+ metadata = @config.rpcs.create_private_connection.metadata.to_h
1967
+
1968
+ # Set x-goog-api-client and x-goog-user-project headers
1969
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1970
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1971
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
1972
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1973
+
1974
+ header_params = {}
1975
+ if request.parent
1976
+ header_params["parent"] = request.parent
1977
+ end
1978
+
1979
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1980
+ metadata[:"x-goog-request-params"] ||= request_params_header
1981
+
1982
+ options.apply_defaults timeout: @config.rpcs.create_private_connection.timeout,
1983
+ metadata: metadata,
1984
+ retry_policy: @config.rpcs.create_private_connection.retry_policy
1985
+
1986
+ options.apply_defaults timeout: @config.timeout,
1987
+ metadata: @config.metadata,
1988
+ retry_policy: @config.retry_policy
1989
+
1990
+ @datastream_stub.call_rpc :create_private_connection, request, options: options do |response, operation|
1991
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1992
+ yield response, operation if block_given?
1993
+ return response
1994
+ end
1995
+ rescue ::GRPC::BadStatus => e
1996
+ raise ::Google::Cloud::Error.from_error(e)
1997
+ end
1998
+
1999
+ ##
2000
+ # Use this method to get details about a private connectivity configuration.
2001
+ #
2002
+ # @overload get_private_connection(request, options = nil)
2003
+ # Pass arguments to `get_private_connection` via a request object, either of type
2004
+ # {::Google::Cloud::Datastream::V1::GetPrivateConnectionRequest} or an equivalent Hash.
2005
+ #
2006
+ # @param request [::Google::Cloud::Datastream::V1::GetPrivateConnectionRequest, ::Hash]
2007
+ # A request object representing the call parameters. Required. To specify no
2008
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2009
+ # @param options [::Gapic::CallOptions, ::Hash]
2010
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2011
+ #
2012
+ # @overload get_private_connection(name: nil)
2013
+ # Pass arguments to `get_private_connection` via keyword arguments. Note that at
2014
+ # least one keyword argument is required. To specify no parameters, or to keep all
2015
+ # the default parameter values, pass an empty Hash as a request object (see above).
2016
+ #
2017
+ # @param name [::String]
2018
+ # Required. The name of the private connectivity configuration to get.
2019
+ #
2020
+ # @yield [response, operation] Access the result along with the RPC operation
2021
+ # @yieldparam response [::Google::Cloud::Datastream::V1::PrivateConnection]
2022
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2023
+ #
2024
+ # @return [::Google::Cloud::Datastream::V1::PrivateConnection]
2025
+ #
2026
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2027
+ #
2028
+ # @example Basic example
2029
+ # require "google/cloud/datastream/v1"
2030
+ #
2031
+ # # Create a client object. The client can be reused for multiple calls.
2032
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
2033
+ #
2034
+ # # Create a request. To set request fields, pass in keyword arguments.
2035
+ # request = Google::Cloud::Datastream::V1::GetPrivateConnectionRequest.new
2036
+ #
2037
+ # # Call the get_private_connection method.
2038
+ # result = client.get_private_connection request
2039
+ #
2040
+ # # The returned object is of type Google::Cloud::Datastream::V1::PrivateConnection.
2041
+ # p result
2042
+ #
2043
+ def get_private_connection request, options = nil
2044
+ raise ::ArgumentError, "request must be provided" if request.nil?
2045
+
2046
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::GetPrivateConnectionRequest
2047
+
2048
+ # Converts hash and nil to an options object
2049
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2050
+
2051
+ # Customize the options with defaults
2052
+ metadata = @config.rpcs.get_private_connection.metadata.to_h
2053
+
2054
+ # Set x-goog-api-client and x-goog-user-project headers
2055
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2056
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2057
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
2058
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2059
+
2060
+ header_params = {}
2061
+ if request.name
2062
+ header_params["name"] = request.name
2063
+ end
2064
+
2065
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2066
+ metadata[:"x-goog-request-params"] ||= request_params_header
2067
+
2068
+ options.apply_defaults timeout: @config.rpcs.get_private_connection.timeout,
2069
+ metadata: metadata,
2070
+ retry_policy: @config.rpcs.get_private_connection.retry_policy
2071
+
2072
+ options.apply_defaults timeout: @config.timeout,
2073
+ metadata: @config.metadata,
2074
+ retry_policy: @config.retry_policy
2075
+
2076
+ @datastream_stub.call_rpc :get_private_connection, request, options: options do |response, operation|
2077
+ yield response, operation if block_given?
2078
+ return response
2079
+ end
2080
+ rescue ::GRPC::BadStatus => e
2081
+ raise ::Google::Cloud::Error.from_error(e)
2082
+ end
2083
+
2084
+ ##
2085
+ # Use this method to list private connectivity configurations in a project
2086
+ # and location.
2087
+ #
2088
+ # @overload list_private_connections(request, options = nil)
2089
+ # Pass arguments to `list_private_connections` via a request object, either of type
2090
+ # {::Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest} or an equivalent Hash.
2091
+ #
2092
+ # @param request [::Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest, ::Hash]
2093
+ # A request object representing the call parameters. Required. To specify no
2094
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2095
+ # @param options [::Gapic::CallOptions, ::Hash]
2096
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2097
+ #
2098
+ # @overload list_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2099
+ # Pass arguments to `list_private_connections` via keyword arguments. Note that at
2100
+ # least one keyword argument is required. To specify no parameters, or to keep all
2101
+ # the default parameter values, pass an empty Hash as a request object (see above).
2102
+ #
2103
+ # @param parent [::String]
2104
+ # Required. The parent that owns the collection of private connectivity configurations.
2105
+ # @param page_size [::Integer]
2106
+ # Maximum number of private connectivity configurations to return.
2107
+ # If unspecified, at most 50 private connectivity configurations that will be
2108
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
2109
+ # 1000.
2110
+ # @param page_token [::String]
2111
+ # Page token received from a previous `ListPrivateConnections` call.
2112
+ # Provide this to retrieve the subsequent page.
2113
+ #
2114
+ # When paginating, all other parameters provided to
2115
+ # `ListPrivateConnections` must match the call that provided the page
2116
+ # token.
2117
+ # @param filter [::String]
2118
+ # Filter request.
2119
+ # @param order_by [::String]
2120
+ # Order by fields for the result.
2121
+ #
2122
+ # @yield [response, operation] Access the result along with the RPC operation
2123
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::PrivateConnection>]
2124
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2125
+ #
2126
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::PrivateConnection>]
2127
+ #
2128
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2129
+ #
2130
+ # @example Basic example
2131
+ # require "google/cloud/datastream/v1"
2132
+ #
2133
+ # # Create a client object. The client can be reused for multiple calls.
2134
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
2135
+ #
2136
+ # # Create a request. To set request fields, pass in keyword arguments.
2137
+ # request = Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest.new
2138
+ #
2139
+ # # Call the list_private_connections method.
2140
+ # result = client.list_private_connections request
2141
+ #
2142
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2143
+ # # iterate over all elements by calling #each, and the enumerable
2144
+ # # will lazily make API calls to fetch subsequent pages. Other
2145
+ # # methods are also available for managing paging directly.
2146
+ # result.each do |response|
2147
+ # # Each element is of type ::Google::Cloud::Datastream::V1::PrivateConnection.
2148
+ # p response
2149
+ # end
2150
+ #
2151
+ def list_private_connections request, options = nil
2152
+ raise ::ArgumentError, "request must be provided" if request.nil?
2153
+
2154
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest
2155
+
2156
+ # Converts hash and nil to an options object
2157
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2158
+
2159
+ # Customize the options with defaults
2160
+ metadata = @config.rpcs.list_private_connections.metadata.to_h
2161
+
2162
+ # Set x-goog-api-client and x-goog-user-project headers
2163
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2164
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2165
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
2166
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2167
+
2168
+ header_params = {}
2169
+ if request.parent
2170
+ header_params["parent"] = request.parent
2171
+ end
2172
+
2173
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2174
+ metadata[:"x-goog-request-params"] ||= request_params_header
2175
+
2176
+ options.apply_defaults timeout: @config.rpcs.list_private_connections.timeout,
2177
+ metadata: metadata,
2178
+ retry_policy: @config.rpcs.list_private_connections.retry_policy
2179
+
2180
+ options.apply_defaults timeout: @config.timeout,
2181
+ metadata: @config.metadata,
2182
+ retry_policy: @config.retry_policy
2183
+
2184
+ @datastream_stub.call_rpc :list_private_connections, request, options: options do |response, operation|
2185
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_private_connections, request, response, operation, options
2186
+ yield response, operation if block_given?
2187
+ return response
2188
+ end
2189
+ rescue ::GRPC::BadStatus => e
2190
+ raise ::Google::Cloud::Error.from_error(e)
2191
+ end
2192
+
2193
+ ##
2194
+ # Use this method to delete a private connectivity configuration.
2195
+ #
2196
+ # @overload delete_private_connection(request, options = nil)
2197
+ # Pass arguments to `delete_private_connection` via a request object, either of type
2198
+ # {::Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest} or an equivalent Hash.
2199
+ #
2200
+ # @param request [::Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest, ::Hash]
2201
+ # A request object representing the call parameters. Required. To specify no
2202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2203
+ # @param options [::Gapic::CallOptions, ::Hash]
2204
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2205
+ #
2206
+ # @overload delete_private_connection(name: nil, request_id: nil, force: nil)
2207
+ # Pass arguments to `delete_private_connection` via keyword arguments. Note that at
2208
+ # least one keyword argument is required. To specify no parameters, or to keep all
2209
+ # the default parameter values, pass an empty Hash as a request object (see above).
2210
+ #
2211
+ # @param name [::String]
2212
+ # Required. The name of the private connectivity configuration to delete.
2213
+ # @param request_id [::String]
2214
+ # Optional. A request ID to identify requests. Specify a unique request ID
2215
+ # so that if you must retry your request, the server will know to ignore
2216
+ # the request if it has already been completed. The server will guarantee
2217
+ # that for at least 60 minutes after the first request.
2218
+ #
2219
+ # For example, consider a situation where you make an initial request and the
2220
+ # request times out. If you make the request again with the same request ID,
2221
+ # the server can check if original operation with the same request ID was
2222
+ # received, and if so, will ignore the second request. This prevents clients
2223
+ # from accidentally creating duplicate commitments.
2224
+ #
2225
+ # The request ID must be a valid UUID with the exception that zero UUID is
2226
+ # not supported (00000000-0000-0000-0000-000000000000).
2227
+ # @param force [::Boolean]
2228
+ # Optional. If set to true, any child routes that belong to this PrivateConnection will
2229
+ # also be deleted.
2230
+ #
2231
+ # @yield [response, operation] Access the result along with the RPC operation
2232
+ # @yieldparam response [::Gapic::Operation]
2233
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2234
+ #
2235
+ # @return [::Gapic::Operation]
2236
+ #
2237
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2238
+ #
2239
+ # @example Basic example
2240
+ # require "google/cloud/datastream/v1"
2241
+ #
2242
+ # # Create a client object. The client can be reused for multiple calls.
2243
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
2244
+ #
2245
+ # # Create a request. To set request fields, pass in keyword arguments.
2246
+ # request = Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest.new
2247
+ #
2248
+ # # Call the delete_private_connection method.
2249
+ # result = client.delete_private_connection request
2250
+ #
2251
+ # # The returned object is of type Gapic::Operation. You can use this
2252
+ # # object to check the status of an operation, cancel it, or wait
2253
+ # # for results. Here is how to block until completion:
2254
+ # result.wait_until_done! timeout: 60
2255
+ # if result.response?
2256
+ # p result.response
2257
+ # else
2258
+ # puts "Error!"
2259
+ # end
2260
+ #
2261
+ def delete_private_connection request, options = nil
2262
+ raise ::ArgumentError, "request must be provided" if request.nil?
2263
+
2264
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest
2265
+
2266
+ # Converts hash and nil to an options object
2267
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2268
+
2269
+ # Customize the options with defaults
2270
+ metadata = @config.rpcs.delete_private_connection.metadata.to_h
2271
+
2272
+ # Set x-goog-api-client and x-goog-user-project headers
2273
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2274
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2275
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
2276
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2277
+
2278
+ header_params = {}
2279
+ if request.name
2280
+ header_params["name"] = request.name
2281
+ end
2282
+
2283
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2284
+ metadata[:"x-goog-request-params"] ||= request_params_header
2285
+
2286
+ options.apply_defaults timeout: @config.rpcs.delete_private_connection.timeout,
2287
+ metadata: metadata,
2288
+ retry_policy: @config.rpcs.delete_private_connection.retry_policy
2289
+
2290
+ options.apply_defaults timeout: @config.timeout,
2291
+ metadata: @config.metadata,
2292
+ retry_policy: @config.retry_policy
2293
+
2294
+ @datastream_stub.call_rpc :delete_private_connection, request, options: options do |response, operation|
2295
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2296
+ yield response, operation if block_given?
2297
+ return response
2298
+ end
2299
+ rescue ::GRPC::BadStatus => e
2300
+ raise ::Google::Cloud::Error.from_error(e)
2301
+ end
2302
+
2303
+ ##
2304
+ # Use this method to create a route for a private connectivity configuration
2305
+ # in a project and location.
2306
+ #
2307
+ # @overload create_route(request, options = nil)
2308
+ # Pass arguments to `create_route` via a request object, either of type
2309
+ # {::Google::Cloud::Datastream::V1::CreateRouteRequest} or an equivalent Hash.
2310
+ #
2311
+ # @param request [::Google::Cloud::Datastream::V1::CreateRouteRequest, ::Hash]
2312
+ # A request object representing the call parameters. Required. To specify no
2313
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2314
+ # @param options [::Gapic::CallOptions, ::Hash]
2315
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2316
+ #
2317
+ # @overload create_route(parent: nil, route_id: nil, route: nil, request_id: nil)
2318
+ # Pass arguments to `create_route` via keyword arguments. Note that at
2319
+ # least one keyword argument is required. To specify no parameters, or to keep all
2320
+ # the default parameter values, pass an empty Hash as a request object (see above).
2321
+ #
2322
+ # @param parent [::String]
2323
+ # Required. The parent that owns the collection of Routes.
2324
+ # @param route_id [::String]
2325
+ # Required. The Route identifier.
2326
+ # @param route [::Google::Cloud::Datastream::V1::Route, ::Hash]
2327
+ # Required. The Route resource to create.
2328
+ # @param request_id [::String]
2329
+ # Optional. A request ID to identify requests. Specify a unique request ID
2330
+ # so that if you must retry your request, the server will know to ignore
2331
+ # the request if it has already been completed. The server will guarantee
2332
+ # that for at least 60 minutes since the first request.
2333
+ #
2334
+ # For example, consider a situation where you make an initial request and the
2335
+ # request times out. If you make the request again with the same request ID,
2336
+ # the server can check if original operation with the same request ID was
2337
+ # received, and if so, will ignore the second request. This prevents clients
2338
+ # from accidentally creating duplicate commitments.
2339
+ #
2340
+ # The request ID must be a valid UUID with the exception that zero UUID is
2341
+ # not supported (00000000-0000-0000-0000-000000000000).
2342
+ #
2343
+ # @yield [response, operation] Access the result along with the RPC operation
2344
+ # @yieldparam response [::Gapic::Operation]
2345
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2346
+ #
2347
+ # @return [::Gapic::Operation]
2348
+ #
2349
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2350
+ #
2351
+ # @example Basic example
2352
+ # require "google/cloud/datastream/v1"
2353
+ #
2354
+ # # Create a client object. The client can be reused for multiple calls.
2355
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
2356
+ #
2357
+ # # Create a request. To set request fields, pass in keyword arguments.
2358
+ # request = Google::Cloud::Datastream::V1::CreateRouteRequest.new
2359
+ #
2360
+ # # Call the create_route method.
2361
+ # result = client.create_route request
2362
+ #
2363
+ # # The returned object is of type Gapic::Operation. You can use this
2364
+ # # object to check the status of an operation, cancel it, or wait
2365
+ # # for results. Here is how to block until completion:
2366
+ # result.wait_until_done! timeout: 60
2367
+ # if result.response?
2368
+ # p result.response
2369
+ # else
2370
+ # puts "Error!"
2371
+ # end
2372
+ #
2373
+ def create_route request, options = nil
2374
+ raise ::ArgumentError, "request must be provided" if request.nil?
2375
+
2376
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::CreateRouteRequest
2377
+
2378
+ # Converts hash and nil to an options object
2379
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2380
+
2381
+ # Customize the options with defaults
2382
+ metadata = @config.rpcs.create_route.metadata.to_h
2383
+
2384
+ # Set x-goog-api-client and x-goog-user-project headers
2385
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2386
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2387
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
2388
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2389
+
2390
+ header_params = {}
2391
+ if request.parent
2392
+ header_params["parent"] = request.parent
2393
+ end
2394
+
2395
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2396
+ metadata[:"x-goog-request-params"] ||= request_params_header
2397
+
2398
+ options.apply_defaults timeout: @config.rpcs.create_route.timeout,
2399
+ metadata: metadata,
2400
+ retry_policy: @config.rpcs.create_route.retry_policy
2401
+
2402
+ options.apply_defaults timeout: @config.timeout,
2403
+ metadata: @config.metadata,
2404
+ retry_policy: @config.retry_policy
2405
+
2406
+ @datastream_stub.call_rpc :create_route, request, options: options do |response, operation|
2407
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2408
+ yield response, operation if block_given?
2409
+ return response
2410
+ end
2411
+ rescue ::GRPC::BadStatus => e
2412
+ raise ::Google::Cloud::Error.from_error(e)
2413
+ end
2414
+
2415
+ ##
2416
+ # Use this method to get details about a route.
2417
+ #
2418
+ # @overload get_route(request, options = nil)
2419
+ # Pass arguments to `get_route` via a request object, either of type
2420
+ # {::Google::Cloud::Datastream::V1::GetRouteRequest} or an equivalent Hash.
2421
+ #
2422
+ # @param request [::Google::Cloud::Datastream::V1::GetRouteRequest, ::Hash]
2423
+ # A request object representing the call parameters. Required. To specify no
2424
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2425
+ # @param options [::Gapic::CallOptions, ::Hash]
2426
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2427
+ #
2428
+ # @overload get_route(name: nil)
2429
+ # Pass arguments to `get_route` via keyword arguments. Note that at
2430
+ # least one keyword argument is required. To specify no parameters, or to keep all
2431
+ # the default parameter values, pass an empty Hash as a request object (see above).
2432
+ #
2433
+ # @param name [::String]
2434
+ # Required. The name of the Route resource to get.
2435
+ #
2436
+ # @yield [response, operation] Access the result along with the RPC operation
2437
+ # @yieldparam response [::Google::Cloud::Datastream::V1::Route]
2438
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2439
+ #
2440
+ # @return [::Google::Cloud::Datastream::V1::Route]
2441
+ #
2442
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2443
+ #
2444
+ # @example Basic example
2445
+ # require "google/cloud/datastream/v1"
2446
+ #
2447
+ # # Create a client object. The client can be reused for multiple calls.
2448
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
2449
+ #
2450
+ # # Create a request. To set request fields, pass in keyword arguments.
2451
+ # request = Google::Cloud::Datastream::V1::GetRouteRequest.new
2452
+ #
2453
+ # # Call the get_route method.
2454
+ # result = client.get_route request
2455
+ #
2456
+ # # The returned object is of type Google::Cloud::Datastream::V1::Route.
2457
+ # p result
2458
+ #
2459
+ def get_route request, options = nil
2460
+ raise ::ArgumentError, "request must be provided" if request.nil?
2461
+
2462
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::GetRouteRequest
2463
+
2464
+ # Converts hash and nil to an options object
2465
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2466
+
2467
+ # Customize the options with defaults
2468
+ metadata = @config.rpcs.get_route.metadata.to_h
2469
+
2470
+ # Set x-goog-api-client and x-goog-user-project headers
2471
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2472
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2473
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
2474
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2475
+
2476
+ header_params = {}
2477
+ if request.name
2478
+ header_params["name"] = request.name
2479
+ end
2480
+
2481
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2482
+ metadata[:"x-goog-request-params"] ||= request_params_header
2483
+
2484
+ options.apply_defaults timeout: @config.rpcs.get_route.timeout,
2485
+ metadata: metadata,
2486
+ retry_policy: @config.rpcs.get_route.retry_policy
2487
+
2488
+ options.apply_defaults timeout: @config.timeout,
2489
+ metadata: @config.metadata,
2490
+ retry_policy: @config.retry_policy
2491
+
2492
+ @datastream_stub.call_rpc :get_route, request, options: options do |response, operation|
2493
+ yield response, operation if block_given?
2494
+ return response
2495
+ end
2496
+ rescue ::GRPC::BadStatus => e
2497
+ raise ::Google::Cloud::Error.from_error(e)
2498
+ end
2499
+
2500
+ ##
2501
+ # Use this method to list routes created for a private connectivity
2502
+ # configuration in a project and location.
2503
+ #
2504
+ # @overload list_routes(request, options = nil)
2505
+ # Pass arguments to `list_routes` via a request object, either of type
2506
+ # {::Google::Cloud::Datastream::V1::ListRoutesRequest} or an equivalent Hash.
2507
+ #
2508
+ # @param request [::Google::Cloud::Datastream::V1::ListRoutesRequest, ::Hash]
2509
+ # A request object representing the call parameters. Required. To specify no
2510
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2511
+ # @param options [::Gapic::CallOptions, ::Hash]
2512
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2513
+ #
2514
+ # @overload list_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2515
+ # Pass arguments to `list_routes` via keyword arguments. Note that at
2516
+ # least one keyword argument is required. To specify no parameters, or to keep all
2517
+ # the default parameter values, pass an empty Hash as a request object (see above).
2518
+ #
2519
+ # @param parent [::String]
2520
+ # Required. The parent that owns the collection of Routess.
2521
+ # @param page_size [::Integer]
2522
+ # Maximum number of Routes to return. The service may return
2523
+ # fewer than this value. If unspecified, at most 50 Routes
2524
+ # will be returned. The maximum value is 1000; values above 1000 will be
2525
+ # coerced to 1000.
2526
+ # @param page_token [::String]
2527
+ # Page token received from a previous `ListRoutes` call.
2528
+ # Provide this to retrieve the subsequent page.
2529
+ #
2530
+ # When paginating, all other parameters provided to
2531
+ # `ListRoutes` must match the call that provided the page
2532
+ # token.
2533
+ # @param filter [::String]
2534
+ # Filter request.
2535
+ # @param order_by [::String]
2536
+ # Order by fields for the result.
2537
+ #
2538
+ # @yield [response, operation] Access the result along with the RPC operation
2539
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Route>]
2540
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2541
+ #
2542
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1::Route>]
2543
+ #
2544
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2545
+ #
2546
+ # @example Basic example
2547
+ # require "google/cloud/datastream/v1"
2548
+ #
2549
+ # # Create a client object. The client can be reused for multiple calls.
2550
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
2551
+ #
2552
+ # # Create a request. To set request fields, pass in keyword arguments.
2553
+ # request = Google::Cloud::Datastream::V1::ListRoutesRequest.new
2554
+ #
2555
+ # # Call the list_routes method.
2556
+ # result = client.list_routes request
2557
+ #
2558
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2559
+ # # iterate over all elements by calling #each, and the enumerable
2560
+ # # will lazily make API calls to fetch subsequent pages. Other
2561
+ # # methods are also available for managing paging directly.
2562
+ # result.each do |response|
2563
+ # # Each element is of type ::Google::Cloud::Datastream::V1::Route.
2564
+ # p response
2565
+ # end
2566
+ #
2567
+ def list_routes request, options = nil
2568
+ raise ::ArgumentError, "request must be provided" if request.nil?
2569
+
2570
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::ListRoutesRequest
2571
+
2572
+ # Converts hash and nil to an options object
2573
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2574
+
2575
+ # Customize the options with defaults
2576
+ metadata = @config.rpcs.list_routes.metadata.to_h
2577
+
2578
+ # Set x-goog-api-client and x-goog-user-project headers
2579
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2580
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2581
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
2582
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2583
+
2584
+ header_params = {}
2585
+ if request.parent
2586
+ header_params["parent"] = request.parent
2587
+ end
2588
+
2589
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2590
+ metadata[:"x-goog-request-params"] ||= request_params_header
2591
+
2592
+ options.apply_defaults timeout: @config.rpcs.list_routes.timeout,
2593
+ metadata: metadata,
2594
+ retry_policy: @config.rpcs.list_routes.retry_policy
2595
+
2596
+ options.apply_defaults timeout: @config.timeout,
2597
+ metadata: @config.metadata,
2598
+ retry_policy: @config.retry_policy
2599
+
2600
+ @datastream_stub.call_rpc :list_routes, request, options: options do |response, operation|
2601
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_routes, request, response, operation, options
2602
+ yield response, operation if block_given?
2603
+ return response
2604
+ end
2605
+ rescue ::GRPC::BadStatus => e
2606
+ raise ::Google::Cloud::Error.from_error(e)
2607
+ end
2608
+
2609
+ ##
2610
+ # Use this method to delete a route.
2611
+ #
2612
+ # @overload delete_route(request, options = nil)
2613
+ # Pass arguments to `delete_route` via a request object, either of type
2614
+ # {::Google::Cloud::Datastream::V1::DeleteRouteRequest} or an equivalent Hash.
2615
+ #
2616
+ # @param request [::Google::Cloud::Datastream::V1::DeleteRouteRequest, ::Hash]
2617
+ # A request object representing the call parameters. Required. To specify no
2618
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2619
+ # @param options [::Gapic::CallOptions, ::Hash]
2620
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2621
+ #
2622
+ # @overload delete_route(name: nil, request_id: nil)
2623
+ # Pass arguments to `delete_route` via keyword arguments. Note that at
2624
+ # least one keyword argument is required. To specify no parameters, or to keep all
2625
+ # the default parameter values, pass an empty Hash as a request object (see above).
2626
+ #
2627
+ # @param name [::String]
2628
+ # Required. The name of the Route resource to delete.
2629
+ # @param request_id [::String]
2630
+ # Optional. A request ID to identify requests. Specify a unique request ID
2631
+ # so that if you must retry your request, the server will know to ignore
2632
+ # the request if it has already been completed. The server will guarantee
2633
+ # that for at least 60 minutes after the first request.
2634
+ #
2635
+ # For example, consider a situation where you make an initial request and the
2636
+ # request times out. If you make the request again with the same request ID,
2637
+ # the server can check if original operation with the same request ID was
2638
+ # received, and if so, will ignore the second request. This prevents clients
2639
+ # from accidentally creating duplicate commitments.
2640
+ #
2641
+ # The request ID must be a valid UUID with the exception that zero UUID is
2642
+ # not supported (00000000-0000-0000-0000-000000000000).
2643
+ #
2644
+ # @yield [response, operation] Access the result along with the RPC operation
2645
+ # @yieldparam response [::Gapic::Operation]
2646
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2647
+ #
2648
+ # @return [::Gapic::Operation]
2649
+ #
2650
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2651
+ #
2652
+ # @example Basic example
2653
+ # require "google/cloud/datastream/v1"
2654
+ #
2655
+ # # Create a client object. The client can be reused for multiple calls.
2656
+ # client = Google::Cloud::Datastream::V1::Datastream::Client.new
2657
+ #
2658
+ # # Create a request. To set request fields, pass in keyword arguments.
2659
+ # request = Google::Cloud::Datastream::V1::DeleteRouteRequest.new
2660
+ #
2661
+ # # Call the delete_route method.
2662
+ # result = client.delete_route request
2663
+ #
2664
+ # # The returned object is of type Gapic::Operation. You can use this
2665
+ # # object to check the status of an operation, cancel it, or wait
2666
+ # # for results. Here is how to block until completion:
2667
+ # result.wait_until_done! timeout: 60
2668
+ # if result.response?
2669
+ # p result.response
2670
+ # else
2671
+ # puts "Error!"
2672
+ # end
2673
+ #
2674
+ def delete_route request, options = nil
2675
+ raise ::ArgumentError, "request must be provided" if request.nil?
2676
+
2677
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::DeleteRouteRequest
2678
+
2679
+ # Converts hash and nil to an options object
2680
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2681
+
2682
+ # Customize the options with defaults
2683
+ metadata = @config.rpcs.delete_route.metadata.to_h
2684
+
2685
+ # Set x-goog-api-client and x-goog-user-project headers
2686
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2687
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2688
+ gapic_version: ::Google::Cloud::Datastream::V1::VERSION
2689
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2690
+
2691
+ header_params = {}
2692
+ if request.name
2693
+ header_params["name"] = request.name
2694
+ end
2695
+
2696
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2697
+ metadata[:"x-goog-request-params"] ||= request_params_header
2698
+
2699
+ options.apply_defaults timeout: @config.rpcs.delete_route.timeout,
2700
+ metadata: metadata,
2701
+ retry_policy: @config.rpcs.delete_route.retry_policy
2702
+
2703
+ options.apply_defaults timeout: @config.timeout,
2704
+ metadata: @config.metadata,
2705
+ retry_policy: @config.retry_policy
2706
+
2707
+ @datastream_stub.call_rpc :delete_route, request, options: options do |response, operation|
2708
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2709
+ yield response, operation if block_given?
2710
+ return response
2711
+ end
2712
+ rescue ::GRPC::BadStatus => e
2713
+ raise ::Google::Cloud::Error.from_error(e)
2714
+ end
2715
+
2716
+ ##
2717
+ # Configuration class for the Datastream API.
2718
+ #
2719
+ # This class represents the configuration for Datastream,
2720
+ # providing control over timeouts, retry behavior, logging, transport
2721
+ # parameters, and other low-level controls. Certain parameters can also be
2722
+ # applied individually to specific RPCs. See
2723
+ # {::Google::Cloud::Datastream::V1::Datastream::Client::Configuration::Rpcs}
2724
+ # for a list of RPCs that can be configured independently.
2725
+ #
2726
+ # Configuration can be applied globally to all clients, or to a single client
2727
+ # on construction.
2728
+ #
2729
+ # @example
2730
+ #
2731
+ # # Modify the global config, setting the timeout for
2732
+ # # list_connection_profiles to 20 seconds,
2733
+ # # and all remaining timeouts to 10 seconds.
2734
+ # ::Google::Cloud::Datastream::V1::Datastream::Client.configure do |config|
2735
+ # config.timeout = 10.0
2736
+ # config.rpcs.list_connection_profiles.timeout = 20.0
2737
+ # end
2738
+ #
2739
+ # # Apply the above configuration only to a new client.
2740
+ # client = ::Google::Cloud::Datastream::V1::Datastream::Client.new do |config|
2741
+ # config.timeout = 10.0
2742
+ # config.rpcs.list_connection_profiles.timeout = 20.0
2743
+ # end
2744
+ #
2745
+ # @!attribute [rw] endpoint
2746
+ # The hostname or hostname:port of the service endpoint.
2747
+ # Defaults to `"datastream.googleapis.com"`.
2748
+ # @return [::String]
2749
+ # @!attribute [rw] credentials
2750
+ # Credentials to send with calls. You may provide any of the following types:
2751
+ # * (`String`) The path to a service account key file in JSON format
2752
+ # * (`Hash`) A service account key as a Hash
2753
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2754
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2755
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2756
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2757
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2758
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2759
+ # * (`nil`) indicating no credentials
2760
+ # @return [::Object]
2761
+ # @!attribute [rw] scope
2762
+ # The OAuth scopes
2763
+ # @return [::Array<::String>]
2764
+ # @!attribute [rw] lib_name
2765
+ # The library name as recorded in instrumentation and logging
2766
+ # @return [::String]
2767
+ # @!attribute [rw] lib_version
2768
+ # The library version as recorded in instrumentation and logging
2769
+ # @return [::String]
2770
+ # @!attribute [rw] channel_args
2771
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2772
+ # `GRPC::Core::Channel` object is provided as the credential.
2773
+ # @return [::Hash]
2774
+ # @!attribute [rw] interceptors
2775
+ # An array of interceptors that are run before calls are executed.
2776
+ # @return [::Array<::GRPC::ClientInterceptor>]
2777
+ # @!attribute [rw] timeout
2778
+ # The call timeout in seconds.
2779
+ # @return [::Numeric]
2780
+ # @!attribute [rw] metadata
2781
+ # Additional gRPC headers to be sent with the call.
2782
+ # @return [::Hash{::Symbol=>::String}]
2783
+ # @!attribute [rw] retry_policy
2784
+ # The retry policy. The value is a hash with the following keys:
2785
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2786
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2787
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2788
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2789
+ # trigger a retry.
2790
+ # @return [::Hash]
2791
+ # @!attribute [rw] quota_project
2792
+ # A separate project against which to charge quota.
2793
+ # @return [::String]
2794
+ #
2795
+ class Configuration
2796
+ extend ::Gapic::Config
2797
+
2798
+ config_attr :endpoint, "datastream.googleapis.com", ::String
2799
+ config_attr :credentials, nil do |value|
2800
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2801
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
2802
+ allowed.any? { |klass| klass === value }
2803
+ end
2804
+ config_attr :scope, nil, ::String, ::Array, nil
2805
+ config_attr :lib_name, nil, ::String, nil
2806
+ config_attr :lib_version, nil, ::String, nil
2807
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2808
+ config_attr :interceptors, nil, ::Array, nil
2809
+ config_attr :timeout, nil, ::Numeric, nil
2810
+ config_attr :metadata, nil, ::Hash, nil
2811
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2812
+ config_attr :quota_project, nil, ::String, nil
2813
+
2814
+ # @private
2815
+ def initialize parent_config = nil
2816
+ @parent_config = parent_config unless parent_config.nil?
2817
+
2818
+ yield self if block_given?
2819
+ end
2820
+
2821
+ ##
2822
+ # Configurations for individual RPCs
2823
+ # @return [Rpcs]
2824
+ #
2825
+ def rpcs
2826
+ @rpcs ||= begin
2827
+ parent_rpcs = nil
2828
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2829
+ Rpcs.new parent_rpcs
2830
+ end
2831
+ end
2832
+
2833
+ ##
2834
+ # Configuration RPC class for the Datastream API.
2835
+ #
2836
+ # Includes fields providing the configuration for each RPC in this service.
2837
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2838
+ # the following configuration fields:
2839
+ #
2840
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2841
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2842
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2843
+ # include the following keys:
2844
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2845
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2846
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2847
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2848
+ # trigger a retry.
2849
+ #
2850
+ class Rpcs
2851
+ ##
2852
+ # RPC-specific configuration for `list_connection_profiles`
2853
+ # @return [::Gapic::Config::Method]
2854
+ #
2855
+ attr_reader :list_connection_profiles
2856
+ ##
2857
+ # RPC-specific configuration for `get_connection_profile`
2858
+ # @return [::Gapic::Config::Method]
2859
+ #
2860
+ attr_reader :get_connection_profile
2861
+ ##
2862
+ # RPC-specific configuration for `create_connection_profile`
2863
+ # @return [::Gapic::Config::Method]
2864
+ #
2865
+ attr_reader :create_connection_profile
2866
+ ##
2867
+ # RPC-specific configuration for `update_connection_profile`
2868
+ # @return [::Gapic::Config::Method]
2869
+ #
2870
+ attr_reader :update_connection_profile
2871
+ ##
2872
+ # RPC-specific configuration for `delete_connection_profile`
2873
+ # @return [::Gapic::Config::Method]
2874
+ #
2875
+ attr_reader :delete_connection_profile
2876
+ ##
2877
+ # RPC-specific configuration for `discover_connection_profile`
2878
+ # @return [::Gapic::Config::Method]
2879
+ #
2880
+ attr_reader :discover_connection_profile
2881
+ ##
2882
+ # RPC-specific configuration for `list_streams`
2883
+ # @return [::Gapic::Config::Method]
2884
+ #
2885
+ attr_reader :list_streams
2886
+ ##
2887
+ # RPC-specific configuration for `get_stream`
2888
+ # @return [::Gapic::Config::Method]
2889
+ #
2890
+ attr_reader :get_stream
2891
+ ##
2892
+ # RPC-specific configuration for `create_stream`
2893
+ # @return [::Gapic::Config::Method]
2894
+ #
2895
+ attr_reader :create_stream
2896
+ ##
2897
+ # RPC-specific configuration for `update_stream`
2898
+ # @return [::Gapic::Config::Method]
2899
+ #
2900
+ attr_reader :update_stream
2901
+ ##
2902
+ # RPC-specific configuration for `delete_stream`
2903
+ # @return [::Gapic::Config::Method]
2904
+ #
2905
+ attr_reader :delete_stream
2906
+ ##
2907
+ # RPC-specific configuration for `get_stream_object`
2908
+ # @return [::Gapic::Config::Method]
2909
+ #
2910
+ attr_reader :get_stream_object
2911
+ ##
2912
+ # RPC-specific configuration for `lookup_stream_object`
2913
+ # @return [::Gapic::Config::Method]
2914
+ #
2915
+ attr_reader :lookup_stream_object
2916
+ ##
2917
+ # RPC-specific configuration for `list_stream_objects`
2918
+ # @return [::Gapic::Config::Method]
2919
+ #
2920
+ attr_reader :list_stream_objects
2921
+ ##
2922
+ # RPC-specific configuration for `start_backfill_job`
2923
+ # @return [::Gapic::Config::Method]
2924
+ #
2925
+ attr_reader :start_backfill_job
2926
+ ##
2927
+ # RPC-specific configuration for `stop_backfill_job`
2928
+ # @return [::Gapic::Config::Method]
2929
+ #
2930
+ attr_reader :stop_backfill_job
2931
+ ##
2932
+ # RPC-specific configuration for `fetch_static_ips`
2933
+ # @return [::Gapic::Config::Method]
2934
+ #
2935
+ attr_reader :fetch_static_ips
2936
+ ##
2937
+ # RPC-specific configuration for `create_private_connection`
2938
+ # @return [::Gapic::Config::Method]
2939
+ #
2940
+ attr_reader :create_private_connection
2941
+ ##
2942
+ # RPC-specific configuration for `get_private_connection`
2943
+ # @return [::Gapic::Config::Method]
2944
+ #
2945
+ attr_reader :get_private_connection
2946
+ ##
2947
+ # RPC-specific configuration for `list_private_connections`
2948
+ # @return [::Gapic::Config::Method]
2949
+ #
2950
+ attr_reader :list_private_connections
2951
+ ##
2952
+ # RPC-specific configuration for `delete_private_connection`
2953
+ # @return [::Gapic::Config::Method]
2954
+ #
2955
+ attr_reader :delete_private_connection
2956
+ ##
2957
+ # RPC-specific configuration for `create_route`
2958
+ # @return [::Gapic::Config::Method]
2959
+ #
2960
+ attr_reader :create_route
2961
+ ##
2962
+ # RPC-specific configuration for `get_route`
2963
+ # @return [::Gapic::Config::Method]
2964
+ #
2965
+ attr_reader :get_route
2966
+ ##
2967
+ # RPC-specific configuration for `list_routes`
2968
+ # @return [::Gapic::Config::Method]
2969
+ #
2970
+ attr_reader :list_routes
2971
+ ##
2972
+ # RPC-specific configuration for `delete_route`
2973
+ # @return [::Gapic::Config::Method]
2974
+ #
2975
+ attr_reader :delete_route
2976
+
2977
+ # @private
2978
+ def initialize parent_rpcs = nil
2979
+ list_connection_profiles_config = parent_rpcs.list_connection_profiles if parent_rpcs.respond_to? :list_connection_profiles
2980
+ @list_connection_profiles = ::Gapic::Config::Method.new list_connection_profiles_config
2981
+ get_connection_profile_config = parent_rpcs.get_connection_profile if parent_rpcs.respond_to? :get_connection_profile
2982
+ @get_connection_profile = ::Gapic::Config::Method.new get_connection_profile_config
2983
+ create_connection_profile_config = parent_rpcs.create_connection_profile if parent_rpcs.respond_to? :create_connection_profile
2984
+ @create_connection_profile = ::Gapic::Config::Method.new create_connection_profile_config
2985
+ update_connection_profile_config = parent_rpcs.update_connection_profile if parent_rpcs.respond_to? :update_connection_profile
2986
+ @update_connection_profile = ::Gapic::Config::Method.new update_connection_profile_config
2987
+ delete_connection_profile_config = parent_rpcs.delete_connection_profile if parent_rpcs.respond_to? :delete_connection_profile
2988
+ @delete_connection_profile = ::Gapic::Config::Method.new delete_connection_profile_config
2989
+ discover_connection_profile_config = parent_rpcs.discover_connection_profile if parent_rpcs.respond_to? :discover_connection_profile
2990
+ @discover_connection_profile = ::Gapic::Config::Method.new discover_connection_profile_config
2991
+ list_streams_config = parent_rpcs.list_streams if parent_rpcs.respond_to? :list_streams
2992
+ @list_streams = ::Gapic::Config::Method.new list_streams_config
2993
+ get_stream_config = parent_rpcs.get_stream if parent_rpcs.respond_to? :get_stream
2994
+ @get_stream = ::Gapic::Config::Method.new get_stream_config
2995
+ create_stream_config = parent_rpcs.create_stream if parent_rpcs.respond_to? :create_stream
2996
+ @create_stream = ::Gapic::Config::Method.new create_stream_config
2997
+ update_stream_config = parent_rpcs.update_stream if parent_rpcs.respond_to? :update_stream
2998
+ @update_stream = ::Gapic::Config::Method.new update_stream_config
2999
+ delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream
3000
+ @delete_stream = ::Gapic::Config::Method.new delete_stream_config
3001
+ get_stream_object_config = parent_rpcs.get_stream_object if parent_rpcs.respond_to? :get_stream_object
3002
+ @get_stream_object = ::Gapic::Config::Method.new get_stream_object_config
3003
+ lookup_stream_object_config = parent_rpcs.lookup_stream_object if parent_rpcs.respond_to? :lookup_stream_object
3004
+ @lookup_stream_object = ::Gapic::Config::Method.new lookup_stream_object_config
3005
+ list_stream_objects_config = parent_rpcs.list_stream_objects if parent_rpcs.respond_to? :list_stream_objects
3006
+ @list_stream_objects = ::Gapic::Config::Method.new list_stream_objects_config
3007
+ start_backfill_job_config = parent_rpcs.start_backfill_job if parent_rpcs.respond_to? :start_backfill_job
3008
+ @start_backfill_job = ::Gapic::Config::Method.new start_backfill_job_config
3009
+ stop_backfill_job_config = parent_rpcs.stop_backfill_job if parent_rpcs.respond_to? :stop_backfill_job
3010
+ @stop_backfill_job = ::Gapic::Config::Method.new stop_backfill_job_config
3011
+ fetch_static_ips_config = parent_rpcs.fetch_static_ips if parent_rpcs.respond_to? :fetch_static_ips
3012
+ @fetch_static_ips = ::Gapic::Config::Method.new fetch_static_ips_config
3013
+ create_private_connection_config = parent_rpcs.create_private_connection if parent_rpcs.respond_to? :create_private_connection
3014
+ @create_private_connection = ::Gapic::Config::Method.new create_private_connection_config
3015
+ get_private_connection_config = parent_rpcs.get_private_connection if parent_rpcs.respond_to? :get_private_connection
3016
+ @get_private_connection = ::Gapic::Config::Method.new get_private_connection_config
3017
+ list_private_connections_config = parent_rpcs.list_private_connections if parent_rpcs.respond_to? :list_private_connections
3018
+ @list_private_connections = ::Gapic::Config::Method.new list_private_connections_config
3019
+ delete_private_connection_config = parent_rpcs.delete_private_connection if parent_rpcs.respond_to? :delete_private_connection
3020
+ @delete_private_connection = ::Gapic::Config::Method.new delete_private_connection_config
3021
+ create_route_config = parent_rpcs.create_route if parent_rpcs.respond_to? :create_route
3022
+ @create_route = ::Gapic::Config::Method.new create_route_config
3023
+ get_route_config = parent_rpcs.get_route if parent_rpcs.respond_to? :get_route
3024
+ @get_route = ::Gapic::Config::Method.new get_route_config
3025
+ list_routes_config = parent_rpcs.list_routes if parent_rpcs.respond_to? :list_routes
3026
+ @list_routes = ::Gapic::Config::Method.new list_routes_config
3027
+ delete_route_config = parent_rpcs.delete_route if parent_rpcs.respond_to? :delete_route
3028
+ @delete_route = ::Gapic::Config::Method.new delete_route_config
3029
+
3030
+ yield self if block_given?
3031
+ end
3032
+ end
3033
+ end
3034
+ end
3035
+ end
3036
+ end
3037
+ end
3038
+ end
3039
+ end