google-cloud-datastream-v1alpha1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +167 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +139 -0
  6. data/lib/google/cloud/datastream/v1alpha1/datastream/client.rb +2192 -0
  7. data/lib/google/cloud/datastream/v1alpha1/datastream/credentials.rb +47 -0
  8. data/lib/google/cloud/datastream/v1alpha1/datastream/operations.rb +664 -0
  9. data/lib/google/cloud/datastream/v1alpha1/datastream/paths.rb +128 -0
  10. data/lib/google/cloud/datastream/v1alpha1/datastream.rb +50 -0
  11. data/lib/google/cloud/datastream/v1alpha1/datastream_pb.rb +216 -0
  12. data/lib/google/cloud/datastream/v1alpha1/datastream_resources_pb.rb +314 -0
  13. data/lib/google/cloud/datastream/v1alpha1/datastream_services_pb.rb +94 -0
  14. data/lib/google/cloud/datastream/v1alpha1/version.rb +28 -0
  15. data/lib/google/cloud/datastream/v1alpha1.rb +38 -0
  16. data/lib/google-cloud-datastream-v1alpha1.rb +21 -0
  17. data/proto_docs/README.md +4 -0
  18. data/proto_docs/google/api/field_behavior.rb +71 -0
  19. data/proto_docs/google/api/resource.rb +283 -0
  20. data/proto_docs/google/cloud/datastream/v1alpha1/datastream.rb +638 -0
  21. data/proto_docs/google/cloud/datastream/v1alpha1/datastream_resources.rb +788 -0
  22. data/proto_docs/google/longrunning/operations.rb +164 -0
  23. data/proto_docs/google/protobuf/any.rb +141 -0
  24. data/proto_docs/google/protobuf/duration.rb +98 -0
  25. data/proto_docs/google/protobuf/empty.rb +36 -0
  26. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  27. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  28. data/proto_docs/google/rpc/status.rb +46 -0
  29. metadata +220 -0
@@ -0,0 +1,2192 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/v1alpha1/datastream_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Datastream
25
+ module V1alpha1
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::V1alpha1::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::V1alpha1::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", "V1alpha1"]
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::V1alpha1::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::V1alpha1::Datastream::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::Datastream::V1alpha1::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/v1alpha1/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.endpoint = @config.endpoint
164
+ end
165
+
166
+ @datastream_stub = ::Gapic::ServiceStub.new(
167
+ ::Google::Cloud::Datastream::V1alpha1::Datastream::Stub,
168
+ credentials: credentials,
169
+ endpoint: @config.endpoint,
170
+ channel_args: @config.channel_args,
171
+ interceptors: @config.interceptors
172
+ )
173
+ end
174
+
175
+ ##
176
+ # Get the associated client for long-running operations.
177
+ #
178
+ # @return [::Google::Cloud::Datastream::V1alpha1::Datastream::Operations]
179
+ #
180
+ attr_reader :operations_client
181
+
182
+ # Service calls
183
+
184
+ ##
185
+ # Use this method to list connection profiles created in a project and
186
+ # location.
187
+ #
188
+ # @overload list_connection_profiles(request, options = nil)
189
+ # Pass arguments to `list_connection_profiles` via a request object, either of type
190
+ # {::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest} or an equivalent Hash.
191
+ #
192
+ # @param request [::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest, ::Hash]
193
+ # A request object representing the call parameters. Required. To specify no
194
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
195
+ # @param options [::Gapic::CallOptions, ::Hash]
196
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
197
+ #
198
+ # @overload list_connection_profiles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
199
+ # Pass arguments to `list_connection_profiles` via keyword arguments. Note that at
200
+ # least one keyword argument is required. To specify no parameters, or to keep all
201
+ # the default parameter values, pass an empty Hash as a request object (see above).
202
+ #
203
+ # @param parent [::String]
204
+ # Required. The parent that owns the collection of connection profiles.
205
+ # @param page_size [::Integer]
206
+ # Maximum number of connection profiles to return.
207
+ # If unspecified, at most 50 connection profiles will be returned.
208
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
209
+ # @param page_token [::String]
210
+ # Page token received from a previous `ListConnectionProfiles` call.
211
+ # Provide this to retrieve the subsequent page.
212
+ #
213
+ # When paginating, all other parameters provided to `ListConnectionProfiles`
214
+ # must match the call that provided the page token.
215
+ # @param filter [::String]
216
+ # Filter request.
217
+ # @param order_by [::String]
218
+ # Order by fields for the result.
219
+ #
220
+ # @yield [response, operation] Access the result along with the RPC operation
221
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::ConnectionProfile>]
222
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
223
+ #
224
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::ConnectionProfile>]
225
+ #
226
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
227
+ #
228
+ def list_connection_profiles request, options = nil
229
+ raise ::ArgumentError, "request must be provided" if request.nil?
230
+
231
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest
232
+
233
+ # Converts hash and nil to an options object
234
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
235
+
236
+ # Customize the options with defaults
237
+ metadata = @config.rpcs.list_connection_profiles.metadata.to_h
238
+
239
+ # Set x-goog-api-client and x-goog-user-project headers
240
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
241
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
242
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
243
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
244
+
245
+ header_params = {
246
+ "parent" => request.parent
247
+ }
248
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
249
+ metadata[:"x-goog-request-params"] ||= request_params_header
250
+
251
+ options.apply_defaults timeout: @config.rpcs.list_connection_profiles.timeout,
252
+ metadata: metadata,
253
+ retry_policy: @config.rpcs.list_connection_profiles.retry_policy
254
+
255
+ options.apply_defaults timeout: @config.timeout,
256
+ metadata: @config.metadata,
257
+ retry_policy: @config.retry_policy
258
+
259
+ @datastream_stub.call_rpc :list_connection_profiles, request, options: options do |response, operation|
260
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_connection_profiles, request, response, operation, options
261
+ yield response, operation if block_given?
262
+ return response
263
+ end
264
+ rescue ::GRPC::BadStatus => e
265
+ raise ::Google::Cloud::Error.from_error(e)
266
+ end
267
+
268
+ ##
269
+ # Use this method to get details about a connection profile.
270
+ #
271
+ # @overload get_connection_profile(request, options = nil)
272
+ # Pass arguments to `get_connection_profile` via a request object, either of type
273
+ # {::Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest} or an equivalent Hash.
274
+ #
275
+ # @param request [::Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest, ::Hash]
276
+ # A request object representing the call parameters. Required. To specify no
277
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
278
+ # @param options [::Gapic::CallOptions, ::Hash]
279
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
280
+ #
281
+ # @overload get_connection_profile(name: nil)
282
+ # Pass arguments to `get_connection_profile` via keyword arguments. Note that at
283
+ # least one keyword argument is required. To specify no parameters, or to keep all
284
+ # the default parameter values, pass an empty Hash as a request object (see above).
285
+ #
286
+ # @param name [::String]
287
+ # Required. The name of the connection profile resource to get.
288
+ #
289
+ # @yield [response, operation] Access the result along with the RPC operation
290
+ # @yieldparam response [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile]
291
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
292
+ #
293
+ # @return [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile]
294
+ #
295
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
296
+ #
297
+ def get_connection_profile request, options = nil
298
+ raise ::ArgumentError, "request must be provided" if request.nil?
299
+
300
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest
301
+
302
+ # Converts hash and nil to an options object
303
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
304
+
305
+ # Customize the options with defaults
306
+ metadata = @config.rpcs.get_connection_profile.metadata.to_h
307
+
308
+ # Set x-goog-api-client and x-goog-user-project headers
309
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
310
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
311
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
312
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
313
+
314
+ header_params = {
315
+ "name" => request.name
316
+ }
317
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
318
+ metadata[:"x-goog-request-params"] ||= request_params_header
319
+
320
+ options.apply_defaults timeout: @config.rpcs.get_connection_profile.timeout,
321
+ metadata: metadata,
322
+ retry_policy: @config.rpcs.get_connection_profile.retry_policy
323
+
324
+ options.apply_defaults timeout: @config.timeout,
325
+ metadata: @config.metadata,
326
+ retry_policy: @config.retry_policy
327
+
328
+ @datastream_stub.call_rpc :get_connection_profile, request, options: options do |response, operation|
329
+ yield response, operation if block_given?
330
+ return response
331
+ end
332
+ rescue ::GRPC::BadStatus => e
333
+ raise ::Google::Cloud::Error.from_error(e)
334
+ end
335
+
336
+ ##
337
+ # Use this method to create a connection profile in a project and location.
338
+ #
339
+ # @overload create_connection_profile(request, options = nil)
340
+ # Pass arguments to `create_connection_profile` via a request object, either of type
341
+ # {::Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest} or an equivalent Hash.
342
+ #
343
+ # @param request [::Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest, ::Hash]
344
+ # A request object representing the call parameters. Required. To specify no
345
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
346
+ # @param options [::Gapic::CallOptions, ::Hash]
347
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
348
+ #
349
+ # @overload create_connection_profile(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil)
350
+ # Pass arguments to `create_connection_profile` via keyword arguments. Note that at
351
+ # least one keyword argument is required. To specify no parameters, or to keep all
352
+ # the default parameter values, pass an empty Hash as a request object (see above).
353
+ #
354
+ # @param parent [::String]
355
+ # Required. The parent that owns the collection of ConnectionProfiles.
356
+ # @param connection_profile_id [::String]
357
+ # Required. The connection profile identifier.
358
+ # @param connection_profile [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile, ::Hash]
359
+ # Required. The connection profile resource to create.
360
+ # @param request_id [::String]
361
+ # Optional. A request ID to identify requests. Specify a unique request ID
362
+ # so that if you must retry your request, the server will know to ignore
363
+ # the request if it has already been completed. The server will guarantee
364
+ # that for at least 60 minutes since the first request.
365
+ #
366
+ # For example, consider a situation where you make an initial request and the
367
+ # request times out. If you make the request again with the same request ID,
368
+ # the server can check if original operation with the same request ID was
369
+ # received, and if so, will ignore the second request. This prevents clients
370
+ # from accidentally creating duplicate commitments.
371
+ #
372
+ # The request ID must be a valid UUID with the exception that zero UUID is
373
+ # not supported (00000000-0000-0000-0000-000000000000).
374
+ #
375
+ # @yield [response, operation] Access the result along with the RPC operation
376
+ # @yieldparam response [::Gapic::Operation]
377
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
378
+ #
379
+ # @return [::Gapic::Operation]
380
+ #
381
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
382
+ #
383
+ def create_connection_profile request, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request.nil?
385
+
386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest
387
+
388
+ # Converts hash and nil to an options object
389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
+
391
+ # Customize the options with defaults
392
+ metadata = @config.rpcs.create_connection_profile.metadata.to_h
393
+
394
+ # Set x-goog-api-client and x-goog-user-project headers
395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
397
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
398
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
399
+
400
+ header_params = {
401
+ "parent" => request.parent
402
+ }
403
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
404
+ metadata[:"x-goog-request-params"] ||= request_params_header
405
+
406
+ options.apply_defaults timeout: @config.rpcs.create_connection_profile.timeout,
407
+ metadata: metadata,
408
+ retry_policy: @config.rpcs.create_connection_profile.retry_policy
409
+
410
+ options.apply_defaults timeout: @config.timeout,
411
+ metadata: @config.metadata,
412
+ retry_policy: @config.retry_policy
413
+
414
+ @datastream_stub.call_rpc :create_connection_profile, request, options: options do |response, operation|
415
+ response = ::Gapic::Operation.new response, @operations_client, options: options
416
+ yield response, operation if block_given?
417
+ return response
418
+ end
419
+ rescue ::GRPC::BadStatus => e
420
+ raise ::Google::Cloud::Error.from_error(e)
421
+ end
422
+
423
+ ##
424
+ # Use this method to update the parameters of a connection profile.
425
+ #
426
+ # @overload update_connection_profile(request, options = nil)
427
+ # Pass arguments to `update_connection_profile` via a request object, either of type
428
+ # {::Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest} or an equivalent Hash.
429
+ #
430
+ # @param request [::Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest, ::Hash]
431
+ # A request object representing the call parameters. Required. To specify no
432
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
433
+ # @param options [::Gapic::CallOptions, ::Hash]
434
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
435
+ #
436
+ # @overload update_connection_profile(update_mask: nil, connection_profile: nil, request_id: nil)
437
+ # Pass arguments to `update_connection_profile` via keyword arguments. Note that at
438
+ # least one keyword argument is required. To specify no parameters, or to keep all
439
+ # the default parameter values, pass an empty Hash as a request object (see above).
440
+ #
441
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
442
+ # Optional. Field mask is used to specify the fields to be overwritten in the
443
+ # ConnectionProfile resource by the update.
444
+ # The fields specified in the update_mask are relative to the resource, not
445
+ # the full request. A field will be overwritten if it is in the mask. If the
446
+ # user does not provide a mask then all fields will be overwritten.
447
+ # @param connection_profile [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile, ::Hash]
448
+ # Required. The ConnectionProfile to update.
449
+ # @param request_id [::String]
450
+ # Optional. A request ID to identify requests. Specify a unique request ID
451
+ # so that if you must retry your request, the server will know to ignore
452
+ # the request if it has already been completed. The server will guarantee
453
+ # that for at least 60 minutes since the first request.
454
+ #
455
+ # For example, consider a situation where you make an initial request and the
456
+ # request times out. If you make the request again with the same request ID,
457
+ # the server can check if original operation with the same request ID was
458
+ # received, and if so, will ignore the second request. This prevents clients
459
+ # from accidentally creating duplicate commitments.
460
+ #
461
+ # The request ID must be a valid UUID with the exception that zero UUID is
462
+ # not supported (00000000-0000-0000-0000-000000000000).
463
+ #
464
+ # @yield [response, operation] Access the result along with the RPC operation
465
+ # @yieldparam response [::Gapic::Operation]
466
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
467
+ #
468
+ # @return [::Gapic::Operation]
469
+ #
470
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
471
+ #
472
+ def update_connection_profile request, options = nil
473
+ raise ::ArgumentError, "request must be provided" if request.nil?
474
+
475
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest
476
+
477
+ # Converts hash and nil to an options object
478
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
479
+
480
+ # Customize the options with defaults
481
+ metadata = @config.rpcs.update_connection_profile.metadata.to_h
482
+
483
+ # Set x-goog-api-client and x-goog-user-project headers
484
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
485
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
486
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
487
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
488
+
489
+ header_params = {
490
+ "connection_profile.name" => request.connection_profile.name
491
+ }
492
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
493
+ metadata[:"x-goog-request-params"] ||= request_params_header
494
+
495
+ options.apply_defaults timeout: @config.rpcs.update_connection_profile.timeout,
496
+ metadata: metadata,
497
+ retry_policy: @config.rpcs.update_connection_profile.retry_policy
498
+
499
+ options.apply_defaults timeout: @config.timeout,
500
+ metadata: @config.metadata,
501
+ retry_policy: @config.retry_policy
502
+
503
+ @datastream_stub.call_rpc :update_connection_profile, request, options: options do |response, operation|
504
+ response = ::Gapic::Operation.new response, @operations_client, options: options
505
+ yield response, operation if block_given?
506
+ return response
507
+ end
508
+ rescue ::GRPC::BadStatus => e
509
+ raise ::Google::Cloud::Error.from_error(e)
510
+ end
511
+
512
+ ##
513
+ # Use this method to delete a connection profile..
514
+ #
515
+ # @overload delete_connection_profile(request, options = nil)
516
+ # Pass arguments to `delete_connection_profile` via a request object, either of type
517
+ # {::Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest} or an equivalent Hash.
518
+ #
519
+ # @param request [::Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest, ::Hash]
520
+ # A request object representing the call parameters. Required. To specify no
521
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
522
+ # @param options [::Gapic::CallOptions, ::Hash]
523
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
524
+ #
525
+ # @overload delete_connection_profile(name: nil, request_id: nil)
526
+ # Pass arguments to `delete_connection_profile` via keyword arguments. Note that at
527
+ # least one keyword argument is required. To specify no parameters, or to keep all
528
+ # the default parameter values, pass an empty Hash as a request object (see above).
529
+ #
530
+ # @param name [::String]
531
+ # Required. The name of the connection profile resource to delete.
532
+ # @param request_id [::String]
533
+ # Optional. A request ID to identify requests. Specify a unique request ID
534
+ # so that if you must retry your request, the server will know to ignore
535
+ # the request if it has already been completed. The server will guarantee
536
+ # that for at least 60 minutes after the first request.
537
+ #
538
+ # For example, consider a situation where you make an initial request and the
539
+ # request times out. If you make the request again with the same request ID,
540
+ # the server can check if original operation with the same request ID was
541
+ # received, and if so, will ignore the second request. This prevents clients
542
+ # from accidentally creating duplicate commitments.
543
+ #
544
+ # The request ID must be a valid UUID with the exception that zero UUID is
545
+ # not supported (00000000-0000-0000-0000-000000000000).
546
+ #
547
+ # @yield [response, operation] Access the result along with the RPC operation
548
+ # @yieldparam response [::Gapic::Operation]
549
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
550
+ #
551
+ # @return [::Gapic::Operation]
552
+ #
553
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
554
+ #
555
+ def delete_connection_profile request, options = nil
556
+ raise ::ArgumentError, "request must be provided" if request.nil?
557
+
558
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest
559
+
560
+ # Converts hash and nil to an options object
561
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
562
+
563
+ # Customize the options with defaults
564
+ metadata = @config.rpcs.delete_connection_profile.metadata.to_h
565
+
566
+ # Set x-goog-api-client and x-goog-user-project headers
567
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
568
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
569
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
570
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
571
+
572
+ header_params = {
573
+ "name" => request.name
574
+ }
575
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
576
+ metadata[:"x-goog-request-params"] ||= request_params_header
577
+
578
+ options.apply_defaults timeout: @config.rpcs.delete_connection_profile.timeout,
579
+ metadata: metadata,
580
+ retry_policy: @config.rpcs.delete_connection_profile.retry_policy
581
+
582
+ options.apply_defaults timeout: @config.timeout,
583
+ metadata: @config.metadata,
584
+ retry_policy: @config.retry_policy
585
+
586
+ @datastream_stub.call_rpc :delete_connection_profile, request, options: options do |response, operation|
587
+ response = ::Gapic::Operation.new response, @operations_client, options: options
588
+ yield response, operation if block_given?
589
+ return response
590
+ end
591
+ rescue ::GRPC::BadStatus => e
592
+ raise ::Google::Cloud::Error.from_error(e)
593
+ end
594
+
595
+ ##
596
+ # Use this method to discover a connection profile.
597
+ # The discover API call exposes the data objects and metadata belonging to
598
+ # the profile. Typically, a request returns children data objects under a
599
+ # parent data object that's optionally supplied in the request.
600
+ #
601
+ # @overload discover_connection_profile(request, options = nil)
602
+ # Pass arguments to `discover_connection_profile` via a request object, either of type
603
+ # {::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest} or an equivalent Hash.
604
+ #
605
+ # @param request [::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest, ::Hash]
606
+ # A request object representing the call parameters. Required. To specify no
607
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
608
+ # @param options [::Gapic::CallOptions, ::Hash]
609
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
610
+ #
611
+ # @overload discover_connection_profile(parent: nil, connection_profile: nil, connection_profile_name: nil, recursive: nil, recursion_depth: nil, oracle_rdbms: nil, mysql_rdbms: nil)
612
+ # Pass arguments to `discover_connection_profile` via keyword arguments. Note that at
613
+ # least one keyword argument is required. To specify no parameters, or to keep all
614
+ # the default parameter values, pass an empty Hash as a request object (see above).
615
+ #
616
+ # @param parent [::String]
617
+ # Required. The parent resource of the ConnectionProfile type. Must be in the
618
+ # format `projects/*/locations/*`.
619
+ # @param connection_profile [::Google::Cloud::Datastream::V1alpha1::ConnectionProfile, ::Hash]
620
+ # An ad-hoc ConnectionProfile configuration.
621
+ # @param connection_profile_name [::String]
622
+ # A reference to an existing ConnectionProfile.
623
+ # @param recursive [::Boolean]
624
+ # Whether to retrieve the full hierarchy of data objects (TRUE) or only the
625
+ # current level (FALSE).
626
+ # @param recursion_depth [::Integer]
627
+ # The number of hierarchy levels below the current level to be retrieved.
628
+ # @param oracle_rdbms [::Google::Cloud::Datastream::V1alpha1::OracleRdbms, ::Hash]
629
+ # Oracle RDBMS to enrich with child data objects and metadata.
630
+ # @param mysql_rdbms [::Google::Cloud::Datastream::V1alpha1::MysqlRdbms, ::Hash]
631
+ # MySQL RDBMS to enrich with child data objects and metadata.
632
+ #
633
+ # @yield [response, operation] Access the result along with the RPC operation
634
+ # @yieldparam response [::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse]
635
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
636
+ #
637
+ # @return [::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse]
638
+ #
639
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
640
+ #
641
+ def discover_connection_profile request, options = nil
642
+ raise ::ArgumentError, "request must be provided" if request.nil?
643
+
644
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest
645
+
646
+ # Converts hash and nil to an options object
647
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
648
+
649
+ # Customize the options with defaults
650
+ metadata = @config.rpcs.discover_connection_profile.metadata.to_h
651
+
652
+ # Set x-goog-api-client and x-goog-user-project headers
653
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
654
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
655
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
656
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
657
+
658
+ header_params = {
659
+ "parent" => request.parent
660
+ }
661
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
662
+ metadata[:"x-goog-request-params"] ||= request_params_header
663
+
664
+ options.apply_defaults timeout: @config.rpcs.discover_connection_profile.timeout,
665
+ metadata: metadata,
666
+ retry_policy: @config.rpcs.discover_connection_profile.retry_policy
667
+
668
+ options.apply_defaults timeout: @config.timeout,
669
+ metadata: @config.metadata,
670
+ retry_policy: @config.retry_policy
671
+
672
+ @datastream_stub.call_rpc :discover_connection_profile, request, options: options do |response, operation|
673
+ yield response, operation if block_given?
674
+ return response
675
+ end
676
+ rescue ::GRPC::BadStatus => e
677
+ raise ::Google::Cloud::Error.from_error(e)
678
+ end
679
+
680
+ ##
681
+ # Use this method to list streams in a project and location.
682
+ #
683
+ # @overload list_streams(request, options = nil)
684
+ # Pass arguments to `list_streams` via a request object, either of type
685
+ # {::Google::Cloud::Datastream::V1alpha1::ListStreamsRequest} or an equivalent Hash.
686
+ #
687
+ # @param request [::Google::Cloud::Datastream::V1alpha1::ListStreamsRequest, ::Hash]
688
+ # A request object representing the call parameters. Required. To specify no
689
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
690
+ # @param options [::Gapic::CallOptions, ::Hash]
691
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
692
+ #
693
+ # @overload list_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
694
+ # Pass arguments to `list_streams` via keyword arguments. Note that at
695
+ # least one keyword argument is required. To specify no parameters, or to keep all
696
+ # the default parameter values, pass an empty Hash as a request object (see above).
697
+ #
698
+ # @param parent [::String]
699
+ # Required. The parent that owns the collection of streams.
700
+ # @param page_size [::Integer]
701
+ # Maximum number of streams to return.
702
+ # If unspecified, at most 50 streams will be returned. The maximum
703
+ # value is 1000; values above 1000 will be coerced to 1000.
704
+ # @param page_token [::String]
705
+ # Page token received from a previous `ListStreams` call.
706
+ # Provide this to retrieve the subsequent page.
707
+ #
708
+ # When paginating, all other parameters provided to `ListStreams`
709
+ # must match the call that provided the page token.
710
+ # @param filter [::String]
711
+ # Filter request.
712
+ # @param order_by [::String]
713
+ # Order by fields for the result.
714
+ #
715
+ # @yield [response, operation] Access the result along with the RPC operation
716
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Stream>]
717
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
718
+ #
719
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Stream>]
720
+ #
721
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
722
+ #
723
+ def list_streams request, options = nil
724
+ raise ::ArgumentError, "request must be provided" if request.nil?
725
+
726
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListStreamsRequest
727
+
728
+ # Converts hash and nil to an options object
729
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
730
+
731
+ # Customize the options with defaults
732
+ metadata = @config.rpcs.list_streams.metadata.to_h
733
+
734
+ # Set x-goog-api-client and x-goog-user-project headers
735
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
736
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
737
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
738
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
739
+
740
+ header_params = {
741
+ "parent" => request.parent
742
+ }
743
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
744
+ metadata[:"x-goog-request-params"] ||= request_params_header
745
+
746
+ options.apply_defaults timeout: @config.rpcs.list_streams.timeout,
747
+ metadata: metadata,
748
+ retry_policy: @config.rpcs.list_streams.retry_policy
749
+
750
+ options.apply_defaults timeout: @config.timeout,
751
+ metadata: @config.metadata,
752
+ retry_policy: @config.retry_policy
753
+
754
+ @datastream_stub.call_rpc :list_streams, request, options: options do |response, operation|
755
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_streams, request, response, operation, options
756
+ yield response, operation if block_given?
757
+ return response
758
+ end
759
+ rescue ::GRPC::BadStatus => e
760
+ raise ::Google::Cloud::Error.from_error(e)
761
+ end
762
+
763
+ ##
764
+ # Use this method to get details about a stream.
765
+ #
766
+ # @overload get_stream(request, options = nil)
767
+ # Pass arguments to `get_stream` via a request object, either of type
768
+ # {::Google::Cloud::Datastream::V1alpha1::GetStreamRequest} or an equivalent Hash.
769
+ #
770
+ # @param request [::Google::Cloud::Datastream::V1alpha1::GetStreamRequest, ::Hash]
771
+ # A request object representing the call parameters. Required. To specify no
772
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
773
+ # @param options [::Gapic::CallOptions, ::Hash]
774
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
775
+ #
776
+ # @overload get_stream(name: nil)
777
+ # Pass arguments to `get_stream` via keyword arguments. Note that at
778
+ # least one keyword argument is required. To specify no parameters, or to keep all
779
+ # the default parameter values, pass an empty Hash as a request object (see above).
780
+ #
781
+ # @param name [::String]
782
+ # Required. The name of the stream resource to get.
783
+ #
784
+ # @yield [response, operation] Access the result along with the RPC operation
785
+ # @yieldparam response [::Google::Cloud::Datastream::V1alpha1::Stream]
786
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
787
+ #
788
+ # @return [::Google::Cloud::Datastream::V1alpha1::Stream]
789
+ #
790
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
791
+ #
792
+ def get_stream request, options = nil
793
+ raise ::ArgumentError, "request must be provided" if request.nil?
794
+
795
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetStreamRequest
796
+
797
+ # Converts hash and nil to an options object
798
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
799
+
800
+ # Customize the options with defaults
801
+ metadata = @config.rpcs.get_stream.metadata.to_h
802
+
803
+ # Set x-goog-api-client and x-goog-user-project headers
804
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
805
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
806
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
807
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
808
+
809
+ header_params = {
810
+ "name" => request.name
811
+ }
812
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
813
+ metadata[:"x-goog-request-params"] ||= request_params_header
814
+
815
+ options.apply_defaults timeout: @config.rpcs.get_stream.timeout,
816
+ metadata: metadata,
817
+ retry_policy: @config.rpcs.get_stream.retry_policy
818
+
819
+ options.apply_defaults timeout: @config.timeout,
820
+ metadata: @config.metadata,
821
+ retry_policy: @config.retry_policy
822
+
823
+ @datastream_stub.call_rpc :get_stream, request, options: options do |response, operation|
824
+ yield response, operation if block_given?
825
+ return response
826
+ end
827
+ rescue ::GRPC::BadStatus => e
828
+ raise ::Google::Cloud::Error.from_error(e)
829
+ end
830
+
831
+ ##
832
+ # Use this method to create a stream.
833
+ #
834
+ # @overload create_stream(request, options = nil)
835
+ # Pass arguments to `create_stream` via a request object, either of type
836
+ # {::Google::Cloud::Datastream::V1alpha1::CreateStreamRequest} or an equivalent Hash.
837
+ #
838
+ # @param request [::Google::Cloud::Datastream::V1alpha1::CreateStreamRequest, ::Hash]
839
+ # A request object representing the call parameters. Required. To specify no
840
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
841
+ # @param options [::Gapic::CallOptions, ::Hash]
842
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
843
+ #
844
+ # @overload create_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil, validate_only: nil, force: nil)
845
+ # Pass arguments to `create_stream` via keyword arguments. Note that at
846
+ # least one keyword argument is required. To specify no parameters, or to keep all
847
+ # the default parameter values, pass an empty Hash as a request object (see above).
848
+ #
849
+ # @param parent [::String]
850
+ # Required. The parent that owns the collection of streams.
851
+ # @param stream_id [::String]
852
+ # Required. The stream identifier.
853
+ # @param stream [::Google::Cloud::Datastream::V1alpha1::Stream, ::Hash]
854
+ # Required. The stream resource to create.
855
+ # @param request_id [::String]
856
+ # Optional. A request ID to identify requests. Specify a unique request ID
857
+ # so that if you must retry your request, the server will know to ignore
858
+ # the request if it has already been completed. The server will guarantee
859
+ # that for at least 60 minutes since the first request.
860
+ #
861
+ # For example, consider a situation where you make an initial request and the
862
+ # request times out. If you make the request again with the same request ID,
863
+ # the server can check if original operation with the same request ID was
864
+ # received, and if so, will ignore the second request. This prevents clients
865
+ # from accidentally creating duplicate commitments.
866
+ #
867
+ # The request ID must be a valid UUID with the exception that zero UUID is
868
+ # not supported (00000000-0000-0000-0000-000000000000).
869
+ # @param validate_only [::Boolean]
870
+ # Optional. Only validate the stream, but do not create any resources.
871
+ # The default is false.
872
+ # @param force [::Boolean]
873
+ # Optional. Create the stream without validating it.
874
+ #
875
+ # @yield [response, operation] Access the result along with the RPC operation
876
+ # @yieldparam response [::Gapic::Operation]
877
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
878
+ #
879
+ # @return [::Gapic::Operation]
880
+ #
881
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
882
+ #
883
+ def create_stream request, options = nil
884
+ raise ::ArgumentError, "request must be provided" if request.nil?
885
+
886
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreateStreamRequest
887
+
888
+ # Converts hash and nil to an options object
889
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
890
+
891
+ # Customize the options with defaults
892
+ metadata = @config.rpcs.create_stream.metadata.to_h
893
+
894
+ # Set x-goog-api-client and x-goog-user-project headers
895
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
896
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
897
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
898
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
899
+
900
+ header_params = {
901
+ "parent" => request.parent
902
+ }
903
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
904
+ metadata[:"x-goog-request-params"] ||= request_params_header
905
+
906
+ options.apply_defaults timeout: @config.rpcs.create_stream.timeout,
907
+ metadata: metadata,
908
+ retry_policy: @config.rpcs.create_stream.retry_policy
909
+
910
+ options.apply_defaults timeout: @config.timeout,
911
+ metadata: @config.metadata,
912
+ retry_policy: @config.retry_policy
913
+
914
+ @datastream_stub.call_rpc :create_stream, request, options: options do |response, operation|
915
+ response = ::Gapic::Operation.new response, @operations_client, options: options
916
+ yield response, operation if block_given?
917
+ return response
918
+ end
919
+ rescue ::GRPC::BadStatus => e
920
+ raise ::Google::Cloud::Error.from_error(e)
921
+ end
922
+
923
+ ##
924
+ # Use this method to update the configuration of a stream.
925
+ #
926
+ # @overload update_stream(request, options = nil)
927
+ # Pass arguments to `update_stream` via a request object, either of type
928
+ # {::Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest} or an equivalent Hash.
929
+ #
930
+ # @param request [::Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest, ::Hash]
931
+ # A request object representing the call parameters. Required. To specify no
932
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
933
+ # @param options [::Gapic::CallOptions, ::Hash]
934
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
935
+ #
936
+ # @overload update_stream(update_mask: nil, stream: nil, request_id: nil, validate_only: nil, force: nil)
937
+ # Pass arguments to `update_stream` via keyword arguments. Note that at
938
+ # least one keyword argument is required. To specify no parameters, or to keep all
939
+ # the default parameter values, pass an empty Hash as a request object (see above).
940
+ #
941
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
942
+ # Optional. Field mask is used to specify the fields to be overwritten in the
943
+ # stream resource by the update.
944
+ # The fields specified in the update_mask are relative to the resource, not
945
+ # the full request. A field will be overwritten if it is in the mask. If the
946
+ # user does not provide a mask then all fields will be overwritten.
947
+ # @param stream [::Google::Cloud::Datastream::V1alpha1::Stream, ::Hash]
948
+ # Required. The stream resource to update.
949
+ # @param request_id [::String]
950
+ # Optional. A request ID to identify requests. Specify a unique request ID
951
+ # so that if you must retry your request, the server will know to ignore
952
+ # the request if it has already been completed. The server will guarantee
953
+ # that for at least 60 minutes since the first request.
954
+ #
955
+ # For example, consider a situation where you make an initial request and the
956
+ # request times out. If you make the request again with the same request ID,
957
+ # the server can check if original operation with the same request ID was
958
+ # received, and if so, will ignore the second request. This prevents clients
959
+ # from accidentally creating duplicate commitments.
960
+ #
961
+ # The request ID must be a valid UUID with the exception that zero UUID is
962
+ # not supported (00000000-0000-0000-0000-000000000000).
963
+ # @param validate_only [::Boolean]
964
+ # Optional. Only validate the stream with the changes, without actually updating it.
965
+ # The default is false.
966
+ # @param force [::Boolean]
967
+ # Optional. Execute the update without validating it.
968
+ #
969
+ # @yield [response, operation] Access the result along with the RPC operation
970
+ # @yieldparam response [::Gapic::Operation]
971
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
972
+ #
973
+ # @return [::Gapic::Operation]
974
+ #
975
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
976
+ #
977
+ def update_stream request, options = nil
978
+ raise ::ArgumentError, "request must be provided" if request.nil?
979
+
980
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest
981
+
982
+ # Converts hash and nil to an options object
983
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
984
+
985
+ # Customize the options with defaults
986
+ metadata = @config.rpcs.update_stream.metadata.to_h
987
+
988
+ # Set x-goog-api-client and x-goog-user-project headers
989
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
990
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
991
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
992
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
993
+
994
+ header_params = {
995
+ "stream.name" => request.stream.name
996
+ }
997
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
998
+ metadata[:"x-goog-request-params"] ||= request_params_header
999
+
1000
+ options.apply_defaults timeout: @config.rpcs.update_stream.timeout,
1001
+ metadata: metadata,
1002
+ retry_policy: @config.rpcs.update_stream.retry_policy
1003
+
1004
+ options.apply_defaults timeout: @config.timeout,
1005
+ metadata: @config.metadata,
1006
+ retry_policy: @config.retry_policy
1007
+
1008
+ @datastream_stub.call_rpc :update_stream, request, options: options do |response, operation|
1009
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1010
+ yield response, operation if block_given?
1011
+ return response
1012
+ end
1013
+ rescue ::GRPC::BadStatus => e
1014
+ raise ::Google::Cloud::Error.from_error(e)
1015
+ end
1016
+
1017
+ ##
1018
+ # Use this method to delete a stream.
1019
+ #
1020
+ # @overload delete_stream(request, options = nil)
1021
+ # Pass arguments to `delete_stream` via a request object, either of type
1022
+ # {::Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest} or an equivalent Hash.
1023
+ #
1024
+ # @param request [::Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest, ::Hash]
1025
+ # A request object representing the call parameters. Required. To specify no
1026
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1027
+ # @param options [::Gapic::CallOptions, ::Hash]
1028
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1029
+ #
1030
+ # @overload delete_stream(name: nil, request_id: nil)
1031
+ # Pass arguments to `delete_stream` via keyword arguments. Note that at
1032
+ # least one keyword argument is required. To specify no parameters, or to keep all
1033
+ # the default parameter values, pass an empty Hash as a request object (see above).
1034
+ #
1035
+ # @param name [::String]
1036
+ # Required. The name of the stream resource to delete.
1037
+ # @param request_id [::String]
1038
+ # Optional. A request ID to identify requests. Specify a unique request ID
1039
+ # so that if you must retry your request, the server will know to ignore
1040
+ # the request if it has already been completed. The server will guarantee
1041
+ # that for at least 60 minutes after the first request.
1042
+ #
1043
+ # For example, consider a situation where you make an initial request and the
1044
+ # request times out. If you make the request again with the same request ID,
1045
+ # the server can check if original operation with the same request ID was
1046
+ # received, and if so, will ignore the second request. This prevents clients
1047
+ # from accidentally creating duplicate commitments.
1048
+ #
1049
+ # The request ID must be a valid UUID with the exception that zero UUID is
1050
+ # not supported (00000000-0000-0000-0000-000000000000).
1051
+ #
1052
+ # @yield [response, operation] Access the result along with the RPC operation
1053
+ # @yieldparam response [::Gapic::Operation]
1054
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1055
+ #
1056
+ # @return [::Gapic::Operation]
1057
+ #
1058
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1059
+ #
1060
+ def delete_stream request, options = nil
1061
+ raise ::ArgumentError, "request must be provided" if request.nil?
1062
+
1063
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest
1064
+
1065
+ # Converts hash and nil to an options object
1066
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1067
+
1068
+ # Customize the options with defaults
1069
+ metadata = @config.rpcs.delete_stream.metadata.to_h
1070
+
1071
+ # Set x-goog-api-client and x-goog-user-project headers
1072
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1073
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1074
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1075
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1076
+
1077
+ header_params = {
1078
+ "name" => request.name
1079
+ }
1080
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1081
+ metadata[:"x-goog-request-params"] ||= request_params_header
1082
+
1083
+ options.apply_defaults timeout: @config.rpcs.delete_stream.timeout,
1084
+ metadata: metadata,
1085
+ retry_policy: @config.rpcs.delete_stream.retry_policy
1086
+
1087
+ options.apply_defaults timeout: @config.timeout,
1088
+ metadata: @config.metadata,
1089
+ retry_policy: @config.retry_policy
1090
+
1091
+ @datastream_stub.call_rpc :delete_stream, request, options: options do |response, operation|
1092
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1093
+ yield response, operation if block_given?
1094
+ return response
1095
+ end
1096
+ rescue ::GRPC::BadStatus => e
1097
+ raise ::Google::Cloud::Error.from_error(e)
1098
+ end
1099
+
1100
+ ##
1101
+ # Use this method to fetch any errors associated with a stream.
1102
+ #
1103
+ # @overload fetch_errors(request, options = nil)
1104
+ # Pass arguments to `fetch_errors` via a request object, either of type
1105
+ # {::Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest} or an equivalent Hash.
1106
+ #
1107
+ # @param request [::Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest, ::Hash]
1108
+ # A request object representing the call parameters. Required. To specify no
1109
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1110
+ # @param options [::Gapic::CallOptions, ::Hash]
1111
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1112
+ #
1113
+ # @overload fetch_errors(stream: nil)
1114
+ # Pass arguments to `fetch_errors` via keyword arguments. Note that at
1115
+ # least one keyword argument is required. To specify no parameters, or to keep all
1116
+ # the default parameter values, pass an empty Hash as a request object (see above).
1117
+ #
1118
+ # @param stream [::String]
1119
+ # Name of the Stream resource for which to fetch any errors.
1120
+ #
1121
+ # @yield [response, operation] Access the result along with the RPC operation
1122
+ # @yieldparam response [::Gapic::Operation]
1123
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1124
+ #
1125
+ # @return [::Gapic::Operation]
1126
+ #
1127
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1128
+ #
1129
+ def fetch_errors request, options = nil
1130
+ raise ::ArgumentError, "request must be provided" if request.nil?
1131
+
1132
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest
1133
+
1134
+ # Converts hash and nil to an options object
1135
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1136
+
1137
+ # Customize the options with defaults
1138
+ metadata = @config.rpcs.fetch_errors.metadata.to_h
1139
+
1140
+ # Set x-goog-api-client and x-goog-user-project headers
1141
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1142
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1143
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1144
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1145
+
1146
+ header_params = {
1147
+ "stream" => request.stream
1148
+ }
1149
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1150
+ metadata[:"x-goog-request-params"] ||= request_params_header
1151
+
1152
+ options.apply_defaults timeout: @config.rpcs.fetch_errors.timeout,
1153
+ metadata: metadata,
1154
+ retry_policy: @config.rpcs.fetch_errors.retry_policy
1155
+
1156
+ options.apply_defaults timeout: @config.timeout,
1157
+ metadata: @config.metadata,
1158
+ retry_policy: @config.retry_policy
1159
+
1160
+ @datastream_stub.call_rpc :fetch_errors, request, options: options do |response, operation|
1161
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1162
+ yield response, operation if block_given?
1163
+ return response
1164
+ end
1165
+ rescue ::GRPC::BadStatus => e
1166
+ raise ::Google::Cloud::Error.from_error(e)
1167
+ end
1168
+
1169
+ ##
1170
+ # The FetchStaticIps API call exposes the static ips used by Datastream.
1171
+ # Typically, a request returns children data objects under
1172
+ # a parent data object that's optionally supplied in the request.
1173
+ #
1174
+ # @overload fetch_static_ips(request, options = nil)
1175
+ # Pass arguments to `fetch_static_ips` via a request object, either of type
1176
+ # {::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest} or an equivalent Hash.
1177
+ #
1178
+ # @param request [::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest, ::Hash]
1179
+ # A request object representing the call parameters. Required. To specify no
1180
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1181
+ # @param options [::Gapic::CallOptions, ::Hash]
1182
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1183
+ #
1184
+ # @overload fetch_static_ips(name: nil, page_size: nil, page_token: nil)
1185
+ # Pass arguments to `fetch_static_ips` via keyword arguments. Note that at
1186
+ # least one keyword argument is required. To specify no parameters, or to keep all
1187
+ # the default parameter values, pass an empty Hash as a request object (see above).
1188
+ #
1189
+ # @param name [::String]
1190
+ # Required. The name resource of the Response type. Must be in the
1191
+ # format `projects/*/locations/*`.
1192
+ # @param page_size [::Integer]
1193
+ # Maximum number of Ips to return, will likely not be specified.
1194
+ # @param page_token [::String]
1195
+ # A page token, received from a previous `ListStaticIps` call.
1196
+ # will likely not be specified.
1197
+ #
1198
+ # @yield [response, operation] Access the result along with the RPC operation
1199
+ # @yieldparam response [::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsResponse]
1200
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1201
+ #
1202
+ # @return [::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsResponse]
1203
+ #
1204
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1205
+ #
1206
+ def fetch_static_ips request, options = nil
1207
+ raise ::ArgumentError, "request must be provided" if request.nil?
1208
+
1209
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest
1210
+
1211
+ # Converts hash and nil to an options object
1212
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1213
+
1214
+ # Customize the options with defaults
1215
+ metadata = @config.rpcs.fetch_static_ips.metadata.to_h
1216
+
1217
+ # Set x-goog-api-client and x-goog-user-project headers
1218
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1219
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1220
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1221
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1222
+
1223
+ header_params = {
1224
+ "name" => request.name
1225
+ }
1226
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1227
+ metadata[:"x-goog-request-params"] ||= request_params_header
1228
+
1229
+ options.apply_defaults timeout: @config.rpcs.fetch_static_ips.timeout,
1230
+ metadata: metadata,
1231
+ retry_policy: @config.rpcs.fetch_static_ips.retry_policy
1232
+
1233
+ options.apply_defaults timeout: @config.timeout,
1234
+ metadata: @config.metadata,
1235
+ retry_policy: @config.retry_policy
1236
+
1237
+ @datastream_stub.call_rpc :fetch_static_ips, request, options: options do |response, operation|
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 create a private connectivity configuration.
1247
+ #
1248
+ # @overload create_private_connection(request, options = nil)
1249
+ # Pass arguments to `create_private_connection` via a request object, either of type
1250
+ # {::Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest} or an equivalent Hash.
1251
+ #
1252
+ # @param request [::Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest, ::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 create_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil)
1259
+ # Pass arguments to `create_private_connection` 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 parent [::String]
1264
+ # Required. The parent that owns the collection of PrivateConnections.
1265
+ # @param private_connection_id [::String]
1266
+ # Required. The private connectivity identifier.
1267
+ # @param private_connection [::Google::Cloud::Datastream::V1alpha1::PrivateConnection, ::Hash]
1268
+ # Required. The Private Connectivity resource to create.
1269
+ # @param request_id [::String]
1270
+ # Optional. A request ID to identify requests. Specify a unique request ID
1271
+ # so that if you must retry your request, the server will know to ignore
1272
+ # the request if it has already been completed. The server will guarantee
1273
+ # that for at least 60 minutes since the first request.
1274
+ #
1275
+ # For example, consider a situation where you make an initial request and the
1276
+ # request times out. If you make the request again with the same request ID,
1277
+ # the server can check if original operation with the same request ID was
1278
+ # received, and if so, will ignore the second request. This prevents clients
1279
+ # from accidentally creating duplicate commitments.
1280
+ #
1281
+ # The request ID must be a valid UUID with the exception that zero UUID is
1282
+ # not supported (00000000-0000-0000-0000-000000000000).
1283
+ #
1284
+ # @yield [response, operation] Access the result along with the RPC operation
1285
+ # @yieldparam response [::Gapic::Operation]
1286
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1287
+ #
1288
+ # @return [::Gapic::Operation]
1289
+ #
1290
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1291
+ #
1292
+ def create_private_connection request, options = nil
1293
+ raise ::ArgumentError, "request must be provided" if request.nil?
1294
+
1295
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest
1296
+
1297
+ # Converts hash and nil to an options object
1298
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1299
+
1300
+ # Customize the options with defaults
1301
+ metadata = @config.rpcs.create_private_connection.metadata.to_h
1302
+
1303
+ # Set x-goog-api-client and x-goog-user-project headers
1304
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1305
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1306
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1307
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1308
+
1309
+ header_params = {
1310
+ "parent" => request.parent
1311
+ }
1312
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1313
+ metadata[:"x-goog-request-params"] ||= request_params_header
1314
+
1315
+ options.apply_defaults timeout: @config.rpcs.create_private_connection.timeout,
1316
+ metadata: metadata,
1317
+ retry_policy: @config.rpcs.create_private_connection.retry_policy
1318
+
1319
+ options.apply_defaults timeout: @config.timeout,
1320
+ metadata: @config.metadata,
1321
+ retry_policy: @config.retry_policy
1322
+
1323
+ @datastream_stub.call_rpc :create_private_connection, request, options: options do |response, operation|
1324
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1325
+ yield response, operation if block_given?
1326
+ return response
1327
+ end
1328
+ rescue ::GRPC::BadStatus => e
1329
+ raise ::Google::Cloud::Error.from_error(e)
1330
+ end
1331
+
1332
+ ##
1333
+ # Use this method to get details about a private connectivity configuration.
1334
+ #
1335
+ # @overload get_private_connection(request, options = nil)
1336
+ # Pass arguments to `get_private_connection` via a request object, either of type
1337
+ # {::Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest} or an equivalent Hash.
1338
+ #
1339
+ # @param request [::Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest, ::Hash]
1340
+ # A request object representing the call parameters. Required. To specify no
1341
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1342
+ # @param options [::Gapic::CallOptions, ::Hash]
1343
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1344
+ #
1345
+ # @overload get_private_connection(name: nil)
1346
+ # Pass arguments to `get_private_connection` via keyword arguments. Note that at
1347
+ # least one keyword argument is required. To specify no parameters, or to keep all
1348
+ # the default parameter values, pass an empty Hash as a request object (see above).
1349
+ #
1350
+ # @param name [::String]
1351
+ # Required. The name of the private connectivity configuration to get.
1352
+ #
1353
+ # @yield [response, operation] Access the result along with the RPC operation
1354
+ # @yieldparam response [::Google::Cloud::Datastream::V1alpha1::PrivateConnection]
1355
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1356
+ #
1357
+ # @return [::Google::Cloud::Datastream::V1alpha1::PrivateConnection]
1358
+ #
1359
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1360
+ #
1361
+ def get_private_connection request, options = nil
1362
+ raise ::ArgumentError, "request must be provided" if request.nil?
1363
+
1364
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest
1365
+
1366
+ # Converts hash and nil to an options object
1367
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1368
+
1369
+ # Customize the options with defaults
1370
+ metadata = @config.rpcs.get_private_connection.metadata.to_h
1371
+
1372
+ # Set x-goog-api-client and x-goog-user-project headers
1373
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1374
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1375
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1376
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1377
+
1378
+ header_params = {
1379
+ "name" => request.name
1380
+ }
1381
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1382
+ metadata[:"x-goog-request-params"] ||= request_params_header
1383
+
1384
+ options.apply_defaults timeout: @config.rpcs.get_private_connection.timeout,
1385
+ metadata: metadata,
1386
+ retry_policy: @config.rpcs.get_private_connection.retry_policy
1387
+
1388
+ options.apply_defaults timeout: @config.timeout,
1389
+ metadata: @config.metadata,
1390
+ retry_policy: @config.retry_policy
1391
+
1392
+ @datastream_stub.call_rpc :get_private_connection, request, options: options do |response, operation|
1393
+ yield response, operation if block_given?
1394
+ return response
1395
+ end
1396
+ rescue ::GRPC::BadStatus => e
1397
+ raise ::Google::Cloud::Error.from_error(e)
1398
+ end
1399
+
1400
+ ##
1401
+ # Use this method to list private connectivity configurations in a project
1402
+ # and location.
1403
+ #
1404
+ # @overload list_private_connections(request, options = nil)
1405
+ # Pass arguments to `list_private_connections` via a request object, either of type
1406
+ # {::Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest} or an equivalent Hash.
1407
+ #
1408
+ # @param request [::Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest, ::Hash]
1409
+ # A request object representing the call parameters. Required. To specify no
1410
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1411
+ # @param options [::Gapic::CallOptions, ::Hash]
1412
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1413
+ #
1414
+ # @overload list_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1415
+ # Pass arguments to `list_private_connections` via keyword arguments. Note that at
1416
+ # least one keyword argument is required. To specify no parameters, or to keep all
1417
+ # the default parameter values, pass an empty Hash as a request object (see above).
1418
+ #
1419
+ # @param parent [::String]
1420
+ # Required. The parent that owns the collection of private connectivity configurations.
1421
+ # @param page_size [::Integer]
1422
+ # Maximum number of private connectivity configurations to return.
1423
+ # If unspecified, at most 50 private connectivity configurations that will be
1424
+ # returned. The maximum value is 1000; values above 1000 will be coerced to
1425
+ # 1000.
1426
+ # @param page_token [::String]
1427
+ # Page token received from a previous `ListPrivateConnections` call.
1428
+ # Provide this to retrieve the subsequent page.
1429
+ #
1430
+ # When paginating, all other parameters provided to
1431
+ # `ListPrivateConnections` must match the call that provided the page
1432
+ # token.
1433
+ # @param filter [::String]
1434
+ # Filter request.
1435
+ # @param order_by [::String]
1436
+ # Order by fields for the result.
1437
+ #
1438
+ # @yield [response, operation] Access the result along with the RPC operation
1439
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::PrivateConnection>]
1440
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1441
+ #
1442
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::PrivateConnection>]
1443
+ #
1444
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1445
+ #
1446
+ def list_private_connections request, options = nil
1447
+ raise ::ArgumentError, "request must be provided" if request.nil?
1448
+
1449
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest
1450
+
1451
+ # Converts hash and nil to an options object
1452
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1453
+
1454
+ # Customize the options with defaults
1455
+ metadata = @config.rpcs.list_private_connections.metadata.to_h
1456
+
1457
+ # Set x-goog-api-client and x-goog-user-project headers
1458
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1459
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1460
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1461
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1462
+
1463
+ header_params = {
1464
+ "parent" => request.parent
1465
+ }
1466
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1467
+ metadata[:"x-goog-request-params"] ||= request_params_header
1468
+
1469
+ options.apply_defaults timeout: @config.rpcs.list_private_connections.timeout,
1470
+ metadata: metadata,
1471
+ retry_policy: @config.rpcs.list_private_connections.retry_policy
1472
+
1473
+ options.apply_defaults timeout: @config.timeout,
1474
+ metadata: @config.metadata,
1475
+ retry_policy: @config.retry_policy
1476
+
1477
+ @datastream_stub.call_rpc :list_private_connections, request, options: options do |response, operation|
1478
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_private_connections, request, response, operation, options
1479
+ yield response, operation if block_given?
1480
+ return response
1481
+ end
1482
+ rescue ::GRPC::BadStatus => e
1483
+ raise ::Google::Cloud::Error.from_error(e)
1484
+ end
1485
+
1486
+ ##
1487
+ # Use this method to delete a private connectivity configuration.
1488
+ #
1489
+ # @overload delete_private_connection(request, options = nil)
1490
+ # Pass arguments to `delete_private_connection` via a request object, either of type
1491
+ # {::Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest} or an equivalent Hash.
1492
+ #
1493
+ # @param request [::Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest, ::Hash]
1494
+ # A request object representing the call parameters. Required. To specify no
1495
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1496
+ # @param options [::Gapic::CallOptions, ::Hash]
1497
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1498
+ #
1499
+ # @overload delete_private_connection(name: nil, request_id: nil, force: nil)
1500
+ # Pass arguments to `delete_private_connection` via keyword arguments. Note that at
1501
+ # least one keyword argument is required. To specify no parameters, or to keep all
1502
+ # the default parameter values, pass an empty Hash as a request object (see above).
1503
+ #
1504
+ # @param name [::String]
1505
+ # Required. The name of the private connectivity configuration to delete.
1506
+ # @param request_id [::String]
1507
+ # Optional. A request ID to identify requests. Specify a unique request ID
1508
+ # so that if you must retry your request, the server will know to ignore
1509
+ # the request if it has already been completed. The server will guarantee
1510
+ # that for at least 60 minutes after the first request.
1511
+ #
1512
+ # For example, consider a situation where you make an initial request and the
1513
+ # request times out. If you make the request again with the same request ID,
1514
+ # the server can check if original operation with the same request ID was
1515
+ # received, and if so, will ignore the second request. This prevents clients
1516
+ # from accidentally creating duplicate commitments.
1517
+ #
1518
+ # The request ID must be a valid UUID with the exception that zero UUID is
1519
+ # not supported (00000000-0000-0000-0000-000000000000).
1520
+ # @param force [::Boolean]
1521
+ # Optional. If set to true, any child routes that belong to this PrivateConnection will
1522
+ # also be deleted.
1523
+ #
1524
+ # @yield [response, operation] Access the result along with the RPC operation
1525
+ # @yieldparam response [::Gapic::Operation]
1526
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1527
+ #
1528
+ # @return [::Gapic::Operation]
1529
+ #
1530
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1531
+ #
1532
+ def delete_private_connection request, options = nil
1533
+ raise ::ArgumentError, "request must be provided" if request.nil?
1534
+
1535
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest
1536
+
1537
+ # Converts hash and nil to an options object
1538
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1539
+
1540
+ # Customize the options with defaults
1541
+ metadata = @config.rpcs.delete_private_connection.metadata.to_h
1542
+
1543
+ # Set x-goog-api-client and x-goog-user-project headers
1544
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1545
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1546
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1547
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1548
+
1549
+ header_params = {
1550
+ "name" => request.name
1551
+ }
1552
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1553
+ metadata[:"x-goog-request-params"] ||= request_params_header
1554
+
1555
+ options.apply_defaults timeout: @config.rpcs.delete_private_connection.timeout,
1556
+ metadata: metadata,
1557
+ retry_policy: @config.rpcs.delete_private_connection.retry_policy
1558
+
1559
+ options.apply_defaults timeout: @config.timeout,
1560
+ metadata: @config.metadata,
1561
+ retry_policy: @config.retry_policy
1562
+
1563
+ @datastream_stub.call_rpc :delete_private_connection, request, options: options do |response, operation|
1564
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1565
+ yield response, operation if block_given?
1566
+ return response
1567
+ end
1568
+ rescue ::GRPC::BadStatus => e
1569
+ raise ::Google::Cloud::Error.from_error(e)
1570
+ end
1571
+
1572
+ ##
1573
+ # Use this method to create a route for a private connectivity in a project
1574
+ # and location.
1575
+ #
1576
+ # @overload create_route(request, options = nil)
1577
+ # Pass arguments to `create_route` via a request object, either of type
1578
+ # {::Google::Cloud::Datastream::V1alpha1::CreateRouteRequest} or an equivalent Hash.
1579
+ #
1580
+ # @param request [::Google::Cloud::Datastream::V1alpha1::CreateRouteRequest, ::Hash]
1581
+ # A request object representing the call parameters. Required. To specify no
1582
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1583
+ # @param options [::Gapic::CallOptions, ::Hash]
1584
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1585
+ #
1586
+ # @overload create_route(parent: nil, route_id: nil, route: nil, request_id: nil)
1587
+ # Pass arguments to `create_route` via keyword arguments. Note that at
1588
+ # least one keyword argument is required. To specify no parameters, or to keep all
1589
+ # the default parameter values, pass an empty Hash as a request object (see above).
1590
+ #
1591
+ # @param parent [::String]
1592
+ # Required. The parent that owns the collection of Routes.
1593
+ # @param route_id [::String]
1594
+ # Required. The Route identifier.
1595
+ # @param route [::Google::Cloud::Datastream::V1alpha1::Route, ::Hash]
1596
+ # Required. The Route resource to create.
1597
+ # @param request_id [::String]
1598
+ # Optional. A request ID to identify requests. Specify a unique request ID
1599
+ # so that if you must retry your request, the server will know to ignore
1600
+ # the request if it has already been completed. The server will guarantee
1601
+ # that for at least 60 minutes since the first request.
1602
+ #
1603
+ # For example, consider a situation where you make an initial request and the
1604
+ # request times out. If you make the request again with the same request ID,
1605
+ # the server can check if original operation with the same request ID was
1606
+ # received, and if so, will ignore the second request. This prevents clients
1607
+ # from accidentally creating duplicate commitments.
1608
+ #
1609
+ # The request ID must be a valid UUID with the exception that zero UUID is
1610
+ # not supported (00000000-0000-0000-0000-000000000000).
1611
+ #
1612
+ # @yield [response, operation] Access the result along with the RPC operation
1613
+ # @yieldparam response [::Gapic::Operation]
1614
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1615
+ #
1616
+ # @return [::Gapic::Operation]
1617
+ #
1618
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1619
+ #
1620
+ def create_route request, options = nil
1621
+ raise ::ArgumentError, "request must be provided" if request.nil?
1622
+
1623
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::CreateRouteRequest
1624
+
1625
+ # Converts hash and nil to an options object
1626
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1627
+
1628
+ # Customize the options with defaults
1629
+ metadata = @config.rpcs.create_route.metadata.to_h
1630
+
1631
+ # Set x-goog-api-client and x-goog-user-project headers
1632
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1633
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1634
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1635
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1636
+
1637
+ header_params = {
1638
+ "parent" => request.parent
1639
+ }
1640
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1641
+ metadata[:"x-goog-request-params"] ||= request_params_header
1642
+
1643
+ options.apply_defaults timeout: @config.rpcs.create_route.timeout,
1644
+ metadata: metadata,
1645
+ retry_policy: @config.rpcs.create_route.retry_policy
1646
+
1647
+ options.apply_defaults timeout: @config.timeout,
1648
+ metadata: @config.metadata,
1649
+ retry_policy: @config.retry_policy
1650
+
1651
+ @datastream_stub.call_rpc :create_route, request, options: options do |response, operation|
1652
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1653
+ yield response, operation if block_given?
1654
+ return response
1655
+ end
1656
+ rescue ::GRPC::BadStatus => e
1657
+ raise ::Google::Cloud::Error.from_error(e)
1658
+ end
1659
+
1660
+ ##
1661
+ # Use this method to get details about a route.
1662
+ #
1663
+ # @overload get_route(request, options = nil)
1664
+ # Pass arguments to `get_route` via a request object, either of type
1665
+ # {::Google::Cloud::Datastream::V1alpha1::GetRouteRequest} or an equivalent Hash.
1666
+ #
1667
+ # @param request [::Google::Cloud::Datastream::V1alpha1::GetRouteRequest, ::Hash]
1668
+ # A request object representing the call parameters. Required. To specify no
1669
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1670
+ # @param options [::Gapic::CallOptions, ::Hash]
1671
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1672
+ #
1673
+ # @overload get_route(name: nil)
1674
+ # Pass arguments to `get_route` via keyword arguments. Note that at
1675
+ # least one keyword argument is required. To specify no parameters, or to keep all
1676
+ # the default parameter values, pass an empty Hash as a request object (see above).
1677
+ #
1678
+ # @param name [::String]
1679
+ # Required. The name of the Route resource to get.
1680
+ #
1681
+ # @yield [response, operation] Access the result along with the RPC operation
1682
+ # @yieldparam response [::Google::Cloud::Datastream::V1alpha1::Route]
1683
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1684
+ #
1685
+ # @return [::Google::Cloud::Datastream::V1alpha1::Route]
1686
+ #
1687
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1688
+ #
1689
+ def get_route request, options = nil
1690
+ raise ::ArgumentError, "request must be provided" if request.nil?
1691
+
1692
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::GetRouteRequest
1693
+
1694
+ # Converts hash and nil to an options object
1695
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1696
+
1697
+ # Customize the options with defaults
1698
+ metadata = @config.rpcs.get_route.metadata.to_h
1699
+
1700
+ # Set x-goog-api-client and x-goog-user-project headers
1701
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1702
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1703
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1704
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1705
+
1706
+ header_params = {
1707
+ "name" => request.name
1708
+ }
1709
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1710
+ metadata[:"x-goog-request-params"] ||= request_params_header
1711
+
1712
+ options.apply_defaults timeout: @config.rpcs.get_route.timeout,
1713
+ metadata: metadata,
1714
+ retry_policy: @config.rpcs.get_route.retry_policy
1715
+
1716
+ options.apply_defaults timeout: @config.timeout,
1717
+ metadata: @config.metadata,
1718
+ retry_policy: @config.retry_policy
1719
+
1720
+ @datastream_stub.call_rpc :get_route, request, options: options do |response, operation|
1721
+ yield response, operation if block_given?
1722
+ return response
1723
+ end
1724
+ rescue ::GRPC::BadStatus => e
1725
+ raise ::Google::Cloud::Error.from_error(e)
1726
+ end
1727
+
1728
+ ##
1729
+ # Use this method to list routes created for a private connectivity in a
1730
+ # project and location.
1731
+ #
1732
+ # @overload list_routes(request, options = nil)
1733
+ # Pass arguments to `list_routes` via a request object, either of type
1734
+ # {::Google::Cloud::Datastream::V1alpha1::ListRoutesRequest} or an equivalent Hash.
1735
+ #
1736
+ # @param request [::Google::Cloud::Datastream::V1alpha1::ListRoutesRequest, ::Hash]
1737
+ # A request object representing the call parameters. Required. To specify no
1738
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1739
+ # @param options [::Gapic::CallOptions, ::Hash]
1740
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1741
+ #
1742
+ # @overload list_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1743
+ # Pass arguments to `list_routes` via keyword arguments. Note that at
1744
+ # least one keyword argument is required. To specify no parameters, or to keep all
1745
+ # the default parameter values, pass an empty Hash as a request object (see above).
1746
+ #
1747
+ # @param parent [::String]
1748
+ # Required. The parent that owns the collection of Routess.
1749
+ # @param page_size [::Integer]
1750
+ # Maximum number of Routes to return. The service may return
1751
+ # fewer than this value. If unspecified, at most 50 Routes
1752
+ # will be returned. The maximum value is 1000; values above 1000 will be
1753
+ # coerced to 1000.
1754
+ # @param page_token [::String]
1755
+ # Page token received from a previous `ListRoutes` call.
1756
+ # Provide this to retrieve the subsequent page.
1757
+ #
1758
+ # When paginating, all other parameters provided to
1759
+ # `ListRoutes` must match the call that provided the page
1760
+ # token.
1761
+ # @param filter [::String]
1762
+ # Filter request.
1763
+ # @param order_by [::String]
1764
+ # Order by fields for the result.
1765
+ #
1766
+ # @yield [response, operation] Access the result along with the RPC operation
1767
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Route>]
1768
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1769
+ #
1770
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Datastream::V1alpha1::Route>]
1771
+ #
1772
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1773
+ #
1774
+ def list_routes request, options = nil
1775
+ raise ::ArgumentError, "request must be provided" if request.nil?
1776
+
1777
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::ListRoutesRequest
1778
+
1779
+ # Converts hash and nil to an options object
1780
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1781
+
1782
+ # Customize the options with defaults
1783
+ metadata = @config.rpcs.list_routes.metadata.to_h
1784
+
1785
+ # Set x-goog-api-client and x-goog-user-project headers
1786
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1787
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1788
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1789
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1790
+
1791
+ header_params = {
1792
+ "parent" => request.parent
1793
+ }
1794
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1795
+ metadata[:"x-goog-request-params"] ||= request_params_header
1796
+
1797
+ options.apply_defaults timeout: @config.rpcs.list_routes.timeout,
1798
+ metadata: metadata,
1799
+ retry_policy: @config.rpcs.list_routes.retry_policy
1800
+
1801
+ options.apply_defaults timeout: @config.timeout,
1802
+ metadata: @config.metadata,
1803
+ retry_policy: @config.retry_policy
1804
+
1805
+ @datastream_stub.call_rpc :list_routes, request, options: options do |response, operation|
1806
+ response = ::Gapic::PagedEnumerable.new @datastream_stub, :list_routes, request, response, operation, options
1807
+ yield response, operation if block_given?
1808
+ return response
1809
+ end
1810
+ rescue ::GRPC::BadStatus => e
1811
+ raise ::Google::Cloud::Error.from_error(e)
1812
+ end
1813
+
1814
+ ##
1815
+ # Use this method to delete a route.
1816
+ #
1817
+ # @overload delete_route(request, options = nil)
1818
+ # Pass arguments to `delete_route` via a request object, either of type
1819
+ # {::Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest} or an equivalent Hash.
1820
+ #
1821
+ # @param request [::Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest, ::Hash]
1822
+ # A request object representing the call parameters. Required. To specify no
1823
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1824
+ # @param options [::Gapic::CallOptions, ::Hash]
1825
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1826
+ #
1827
+ # @overload delete_route(name: nil, request_id: nil)
1828
+ # Pass arguments to `delete_route` via keyword arguments. Note that at
1829
+ # least one keyword argument is required. To specify no parameters, or to keep all
1830
+ # the default parameter values, pass an empty Hash as a request object (see above).
1831
+ #
1832
+ # @param name [::String]
1833
+ # Required. The name of the Route resource to delete.
1834
+ # @param request_id [::String]
1835
+ # Optional. A request ID to identify requests. Specify a unique request ID
1836
+ # so that if you must retry your request, the server will know to ignore
1837
+ # the request if it has already been completed. The server will guarantee
1838
+ # that for at least 60 minutes after the first request.
1839
+ #
1840
+ # For example, consider a situation where you make an initial request and the
1841
+ # request times out. If you make the request again with the same request ID,
1842
+ # the server can check if original operation with the same request ID was
1843
+ # received, and if so, will ignore the second request. This prevents clients
1844
+ # from accidentally creating duplicate commitments.
1845
+ #
1846
+ # The request ID must be a valid UUID with the exception that zero UUID is
1847
+ # not supported (00000000-0000-0000-0000-000000000000).
1848
+ #
1849
+ # @yield [response, operation] Access the result along with the RPC operation
1850
+ # @yieldparam response [::Gapic::Operation]
1851
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1852
+ #
1853
+ # @return [::Gapic::Operation]
1854
+ #
1855
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1856
+ #
1857
+ def delete_route request, options = nil
1858
+ raise ::ArgumentError, "request must be provided" if request.nil?
1859
+
1860
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest
1861
+
1862
+ # Converts hash and nil to an options object
1863
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1864
+
1865
+ # Customize the options with defaults
1866
+ metadata = @config.rpcs.delete_route.metadata.to_h
1867
+
1868
+ # Set x-goog-api-client and x-goog-user-project headers
1869
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1870
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1871
+ gapic_version: ::Google::Cloud::Datastream::V1alpha1::VERSION
1872
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1873
+
1874
+ header_params = {
1875
+ "name" => request.name
1876
+ }
1877
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1878
+ metadata[:"x-goog-request-params"] ||= request_params_header
1879
+
1880
+ options.apply_defaults timeout: @config.rpcs.delete_route.timeout,
1881
+ metadata: metadata,
1882
+ retry_policy: @config.rpcs.delete_route.retry_policy
1883
+
1884
+ options.apply_defaults timeout: @config.timeout,
1885
+ metadata: @config.metadata,
1886
+ retry_policy: @config.retry_policy
1887
+
1888
+ @datastream_stub.call_rpc :delete_route, request, options: options do |response, operation|
1889
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1890
+ yield response, operation if block_given?
1891
+ return response
1892
+ end
1893
+ rescue ::GRPC::BadStatus => e
1894
+ raise ::Google::Cloud::Error.from_error(e)
1895
+ end
1896
+
1897
+ ##
1898
+ # Configuration class for the Datastream API.
1899
+ #
1900
+ # This class represents the configuration for Datastream,
1901
+ # providing control over timeouts, retry behavior, logging, transport
1902
+ # parameters, and other low-level controls. Certain parameters can also be
1903
+ # applied individually to specific RPCs. See
1904
+ # {::Google::Cloud::Datastream::V1alpha1::Datastream::Client::Configuration::Rpcs}
1905
+ # for a list of RPCs that can be configured independently.
1906
+ #
1907
+ # Configuration can be applied globally to all clients, or to a single client
1908
+ # on construction.
1909
+ #
1910
+ # @example
1911
+ #
1912
+ # # Modify the global config, setting the timeout for
1913
+ # # list_connection_profiles to 20 seconds,
1914
+ # # and all remaining timeouts to 10 seconds.
1915
+ # ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.configure do |config|
1916
+ # config.timeout = 10.0
1917
+ # config.rpcs.list_connection_profiles.timeout = 20.0
1918
+ # end
1919
+ #
1920
+ # # Apply the above configuration only to a new client.
1921
+ # client = ::Google::Cloud::Datastream::V1alpha1::Datastream::Client.new do |config|
1922
+ # config.timeout = 10.0
1923
+ # config.rpcs.list_connection_profiles.timeout = 20.0
1924
+ # end
1925
+ #
1926
+ # @!attribute [rw] endpoint
1927
+ # The hostname or hostname:port of the service endpoint.
1928
+ # Defaults to `"datastream.googleapis.com"`.
1929
+ # @return [::String]
1930
+ # @!attribute [rw] credentials
1931
+ # Credentials to send with calls. You may provide any of the following types:
1932
+ # * (`String`) The path to a service account key file in JSON format
1933
+ # * (`Hash`) A service account key as a Hash
1934
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1935
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1936
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1937
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1938
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1939
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1940
+ # * (`nil`) indicating no credentials
1941
+ # @return [::Object]
1942
+ # @!attribute [rw] scope
1943
+ # The OAuth scopes
1944
+ # @return [::Array<::String>]
1945
+ # @!attribute [rw] lib_name
1946
+ # The library name as recorded in instrumentation and logging
1947
+ # @return [::String]
1948
+ # @!attribute [rw] lib_version
1949
+ # The library version as recorded in instrumentation and logging
1950
+ # @return [::String]
1951
+ # @!attribute [rw] channel_args
1952
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1953
+ # `GRPC::Core::Channel` object is provided as the credential.
1954
+ # @return [::Hash]
1955
+ # @!attribute [rw] interceptors
1956
+ # An array of interceptors that are run before calls are executed.
1957
+ # @return [::Array<::GRPC::ClientInterceptor>]
1958
+ # @!attribute [rw] timeout
1959
+ # The call timeout in seconds.
1960
+ # @return [::Numeric]
1961
+ # @!attribute [rw] metadata
1962
+ # Additional gRPC headers to be sent with the call.
1963
+ # @return [::Hash{::Symbol=>::String}]
1964
+ # @!attribute [rw] retry_policy
1965
+ # The retry policy. The value is a hash with the following keys:
1966
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1967
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1968
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1969
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1970
+ # trigger a retry.
1971
+ # @return [::Hash]
1972
+ # @!attribute [rw] quota_project
1973
+ # A separate project against which to charge quota.
1974
+ # @return [::String]
1975
+ #
1976
+ class Configuration
1977
+ extend ::Gapic::Config
1978
+
1979
+ config_attr :endpoint, "datastream.googleapis.com", ::String
1980
+ config_attr :credentials, nil do |value|
1981
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1982
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1983
+ allowed.any? { |klass| klass === value }
1984
+ end
1985
+ config_attr :scope, nil, ::String, ::Array, nil
1986
+ config_attr :lib_name, nil, ::String, nil
1987
+ config_attr :lib_version, nil, ::String, nil
1988
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1989
+ config_attr :interceptors, nil, ::Array, nil
1990
+ config_attr :timeout, nil, ::Numeric, nil
1991
+ config_attr :metadata, nil, ::Hash, nil
1992
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1993
+ config_attr :quota_project, nil, ::String, nil
1994
+
1995
+ # @private
1996
+ def initialize parent_config = nil
1997
+ @parent_config = parent_config unless parent_config.nil?
1998
+
1999
+ yield self if block_given?
2000
+ end
2001
+
2002
+ ##
2003
+ # Configurations for individual RPCs
2004
+ # @return [Rpcs]
2005
+ #
2006
+ def rpcs
2007
+ @rpcs ||= begin
2008
+ parent_rpcs = nil
2009
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2010
+ Rpcs.new parent_rpcs
2011
+ end
2012
+ end
2013
+
2014
+ ##
2015
+ # Configuration RPC class for the Datastream API.
2016
+ #
2017
+ # Includes fields providing the configuration for each RPC in this service.
2018
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2019
+ # the following configuration fields:
2020
+ #
2021
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2022
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2023
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2024
+ # include the following keys:
2025
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2026
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2027
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2028
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2029
+ # trigger a retry.
2030
+ #
2031
+ class Rpcs
2032
+ ##
2033
+ # RPC-specific configuration for `list_connection_profiles`
2034
+ # @return [::Gapic::Config::Method]
2035
+ #
2036
+ attr_reader :list_connection_profiles
2037
+ ##
2038
+ # RPC-specific configuration for `get_connection_profile`
2039
+ # @return [::Gapic::Config::Method]
2040
+ #
2041
+ attr_reader :get_connection_profile
2042
+ ##
2043
+ # RPC-specific configuration for `create_connection_profile`
2044
+ # @return [::Gapic::Config::Method]
2045
+ #
2046
+ attr_reader :create_connection_profile
2047
+ ##
2048
+ # RPC-specific configuration for `update_connection_profile`
2049
+ # @return [::Gapic::Config::Method]
2050
+ #
2051
+ attr_reader :update_connection_profile
2052
+ ##
2053
+ # RPC-specific configuration for `delete_connection_profile`
2054
+ # @return [::Gapic::Config::Method]
2055
+ #
2056
+ attr_reader :delete_connection_profile
2057
+ ##
2058
+ # RPC-specific configuration for `discover_connection_profile`
2059
+ # @return [::Gapic::Config::Method]
2060
+ #
2061
+ attr_reader :discover_connection_profile
2062
+ ##
2063
+ # RPC-specific configuration for `list_streams`
2064
+ # @return [::Gapic::Config::Method]
2065
+ #
2066
+ attr_reader :list_streams
2067
+ ##
2068
+ # RPC-specific configuration for `get_stream`
2069
+ # @return [::Gapic::Config::Method]
2070
+ #
2071
+ attr_reader :get_stream
2072
+ ##
2073
+ # RPC-specific configuration for `create_stream`
2074
+ # @return [::Gapic::Config::Method]
2075
+ #
2076
+ attr_reader :create_stream
2077
+ ##
2078
+ # RPC-specific configuration for `update_stream`
2079
+ # @return [::Gapic::Config::Method]
2080
+ #
2081
+ attr_reader :update_stream
2082
+ ##
2083
+ # RPC-specific configuration for `delete_stream`
2084
+ # @return [::Gapic::Config::Method]
2085
+ #
2086
+ attr_reader :delete_stream
2087
+ ##
2088
+ # RPC-specific configuration for `fetch_errors`
2089
+ # @return [::Gapic::Config::Method]
2090
+ #
2091
+ attr_reader :fetch_errors
2092
+ ##
2093
+ # RPC-specific configuration for `fetch_static_ips`
2094
+ # @return [::Gapic::Config::Method]
2095
+ #
2096
+ attr_reader :fetch_static_ips
2097
+ ##
2098
+ # RPC-specific configuration for `create_private_connection`
2099
+ # @return [::Gapic::Config::Method]
2100
+ #
2101
+ attr_reader :create_private_connection
2102
+ ##
2103
+ # RPC-specific configuration for `get_private_connection`
2104
+ # @return [::Gapic::Config::Method]
2105
+ #
2106
+ attr_reader :get_private_connection
2107
+ ##
2108
+ # RPC-specific configuration for `list_private_connections`
2109
+ # @return [::Gapic::Config::Method]
2110
+ #
2111
+ attr_reader :list_private_connections
2112
+ ##
2113
+ # RPC-specific configuration for `delete_private_connection`
2114
+ # @return [::Gapic::Config::Method]
2115
+ #
2116
+ attr_reader :delete_private_connection
2117
+ ##
2118
+ # RPC-specific configuration for `create_route`
2119
+ # @return [::Gapic::Config::Method]
2120
+ #
2121
+ attr_reader :create_route
2122
+ ##
2123
+ # RPC-specific configuration for `get_route`
2124
+ # @return [::Gapic::Config::Method]
2125
+ #
2126
+ attr_reader :get_route
2127
+ ##
2128
+ # RPC-specific configuration for `list_routes`
2129
+ # @return [::Gapic::Config::Method]
2130
+ #
2131
+ attr_reader :list_routes
2132
+ ##
2133
+ # RPC-specific configuration for `delete_route`
2134
+ # @return [::Gapic::Config::Method]
2135
+ #
2136
+ attr_reader :delete_route
2137
+
2138
+ # @private
2139
+ def initialize parent_rpcs = nil
2140
+ list_connection_profiles_config = parent_rpcs.list_connection_profiles if parent_rpcs.respond_to? :list_connection_profiles
2141
+ @list_connection_profiles = ::Gapic::Config::Method.new list_connection_profiles_config
2142
+ get_connection_profile_config = parent_rpcs.get_connection_profile if parent_rpcs.respond_to? :get_connection_profile
2143
+ @get_connection_profile = ::Gapic::Config::Method.new get_connection_profile_config
2144
+ create_connection_profile_config = parent_rpcs.create_connection_profile if parent_rpcs.respond_to? :create_connection_profile
2145
+ @create_connection_profile = ::Gapic::Config::Method.new create_connection_profile_config
2146
+ update_connection_profile_config = parent_rpcs.update_connection_profile if parent_rpcs.respond_to? :update_connection_profile
2147
+ @update_connection_profile = ::Gapic::Config::Method.new update_connection_profile_config
2148
+ delete_connection_profile_config = parent_rpcs.delete_connection_profile if parent_rpcs.respond_to? :delete_connection_profile
2149
+ @delete_connection_profile = ::Gapic::Config::Method.new delete_connection_profile_config
2150
+ discover_connection_profile_config = parent_rpcs.discover_connection_profile if parent_rpcs.respond_to? :discover_connection_profile
2151
+ @discover_connection_profile = ::Gapic::Config::Method.new discover_connection_profile_config
2152
+ list_streams_config = parent_rpcs.list_streams if parent_rpcs.respond_to? :list_streams
2153
+ @list_streams = ::Gapic::Config::Method.new list_streams_config
2154
+ get_stream_config = parent_rpcs.get_stream if parent_rpcs.respond_to? :get_stream
2155
+ @get_stream = ::Gapic::Config::Method.new get_stream_config
2156
+ create_stream_config = parent_rpcs.create_stream if parent_rpcs.respond_to? :create_stream
2157
+ @create_stream = ::Gapic::Config::Method.new create_stream_config
2158
+ update_stream_config = parent_rpcs.update_stream if parent_rpcs.respond_to? :update_stream
2159
+ @update_stream = ::Gapic::Config::Method.new update_stream_config
2160
+ delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream
2161
+ @delete_stream = ::Gapic::Config::Method.new delete_stream_config
2162
+ fetch_errors_config = parent_rpcs.fetch_errors if parent_rpcs.respond_to? :fetch_errors
2163
+ @fetch_errors = ::Gapic::Config::Method.new fetch_errors_config
2164
+ fetch_static_ips_config = parent_rpcs.fetch_static_ips if parent_rpcs.respond_to? :fetch_static_ips
2165
+ @fetch_static_ips = ::Gapic::Config::Method.new fetch_static_ips_config
2166
+ create_private_connection_config = parent_rpcs.create_private_connection if parent_rpcs.respond_to? :create_private_connection
2167
+ @create_private_connection = ::Gapic::Config::Method.new create_private_connection_config
2168
+ get_private_connection_config = parent_rpcs.get_private_connection if parent_rpcs.respond_to? :get_private_connection
2169
+ @get_private_connection = ::Gapic::Config::Method.new get_private_connection_config
2170
+ list_private_connections_config = parent_rpcs.list_private_connections if parent_rpcs.respond_to? :list_private_connections
2171
+ @list_private_connections = ::Gapic::Config::Method.new list_private_connections_config
2172
+ delete_private_connection_config = parent_rpcs.delete_private_connection if parent_rpcs.respond_to? :delete_private_connection
2173
+ @delete_private_connection = ::Gapic::Config::Method.new delete_private_connection_config
2174
+ create_route_config = parent_rpcs.create_route if parent_rpcs.respond_to? :create_route
2175
+ @create_route = ::Gapic::Config::Method.new create_route_config
2176
+ get_route_config = parent_rpcs.get_route if parent_rpcs.respond_to? :get_route
2177
+ @get_route = ::Gapic::Config::Method.new get_route_config
2178
+ list_routes_config = parent_rpcs.list_routes if parent_rpcs.respond_to? :list_routes
2179
+ @list_routes = ::Gapic::Config::Method.new list_routes_config
2180
+ delete_route_config = parent_rpcs.delete_route if parent_rpcs.respond_to? :delete_route
2181
+ @delete_route = ::Gapic::Config::Method.new delete_route_config
2182
+
2183
+ yield self if block_given?
2184
+ end
2185
+ end
2186
+ end
2187
+ end
2188
+ end
2189
+ end
2190
+ end
2191
+ end
2192
+ end