google-cloud-datastream-v1 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/datastream/v1/datastream/client.rb +155 -27
- data/lib/google/cloud/datastream/v1/datastream/operations.rb +12 -15
- data/lib/google/cloud/datastream/v1/datastream/rest/client.rb +145 -27
- data/lib/google/cloud/datastream/v1/datastream/rest/operations.rb +43 -38
- data/lib/google/cloud/datastream/v1/datastream/rest/service_stub.rb +275 -151
- data/lib/google/cloud/datastream/v1/datastream_pb.rb +2 -1
- data/lib/google/cloud/datastream/v1/datastream_resources_pb.rb +27 -1
- data/lib/google/cloud/datastream/v1/datastream_services_pb.rb +3 -0
- data/lib/google/cloud/datastream/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/datastream/v1/datastream.rb +27 -3
- data/proto_docs/google/cloud/datastream/v1/datastream_resources.rb +385 -8
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +5 -5
@@ -184,15 +184,27 @@ module Google
|
|
184
184
|
endpoint: @config.endpoint,
|
185
185
|
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
186
186
|
universe_domain: @config.universe_domain,
|
187
|
-
credentials: credentials
|
187
|
+
credentials: credentials,
|
188
|
+
logger: @config.logger
|
188
189
|
)
|
189
190
|
|
191
|
+
@datastream_stub.logger(stub: true)&.info do |entry|
|
192
|
+
entry.set_system_name
|
193
|
+
entry.set_service
|
194
|
+
entry.message = "Created client for #{entry.service}"
|
195
|
+
entry.set_credentials_fields credentials
|
196
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
197
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
198
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
199
|
+
end
|
200
|
+
|
190
201
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
191
202
|
config.credentials = credentials
|
192
203
|
config.quota_project = @quota_project_id
|
193
204
|
config.endpoint = @datastream_stub.endpoint
|
194
205
|
config.universe_domain = @datastream_stub.universe_domain
|
195
206
|
config.bindings_override = @config.bindings_override
|
207
|
+
config.logger = @datastream_stub.logger if config.respond_to? :logger=
|
196
208
|
end
|
197
209
|
|
198
210
|
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
@@ -200,6 +212,7 @@ module Google
|
|
200
212
|
config.quota_project = @quota_project_id
|
201
213
|
config.endpoint = @datastream_stub.endpoint
|
202
214
|
config.universe_domain = @datastream_stub.universe_domain
|
215
|
+
config.logger = @datastream_stub.logger if config.respond_to? :logger=
|
203
216
|
end
|
204
217
|
end
|
205
218
|
|
@@ -224,6 +237,15 @@ module Google
|
|
224
237
|
#
|
225
238
|
attr_reader :iam_policy_client
|
226
239
|
|
240
|
+
##
|
241
|
+
# The logger used for request/response debug logging.
|
242
|
+
#
|
243
|
+
# @return [Logger]
|
244
|
+
#
|
245
|
+
def logger
|
246
|
+
@datastream_stub.logger
|
247
|
+
end
|
248
|
+
|
227
249
|
# Service calls
|
228
250
|
|
229
251
|
##
|
@@ -318,7 +340,6 @@ module Google
|
|
318
340
|
|
319
341
|
@datastream_stub.list_connection_profiles request, options do |result, operation|
|
320
342
|
yield result, operation if block_given?
|
321
|
-
return result
|
322
343
|
end
|
323
344
|
rescue ::Gapic::Rest::Error => e
|
324
345
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -397,7 +418,6 @@ module Google
|
|
397
418
|
|
398
419
|
@datastream_stub.get_connection_profile request, options do |result, operation|
|
399
420
|
yield result, operation if block_given?
|
400
|
-
return result
|
401
421
|
end
|
402
422
|
rescue ::Gapic::Rest::Error => e
|
403
423
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -507,7 +527,7 @@ module Google
|
|
507
527
|
@datastream_stub.create_connection_profile request, options do |result, operation|
|
508
528
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
509
529
|
yield result, operation if block_given?
|
510
|
-
|
530
|
+
throw :response, result
|
511
531
|
end
|
512
532
|
rescue ::Gapic::Rest::Error => e
|
513
533
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -619,7 +639,7 @@ module Google
|
|
619
639
|
@datastream_stub.update_connection_profile request, options do |result, operation|
|
620
640
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
621
641
|
yield result, operation if block_given?
|
622
|
-
|
642
|
+
throw :response, result
|
623
643
|
end
|
624
644
|
rescue ::Gapic::Rest::Error => e
|
625
645
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -720,7 +740,7 @@ module Google
|
|
720
740
|
@datastream_stub.delete_connection_profile request, options do |result, operation|
|
721
741
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
722
742
|
yield result, operation if block_given?
|
723
|
-
|
743
|
+
throw :response, result
|
724
744
|
end
|
725
745
|
rescue ::Gapic::Rest::Error => e
|
726
746
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -742,7 +762,7 @@ module Google
|
|
742
762
|
# @param options [::Gapic::CallOptions, ::Hash]
|
743
763
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
744
764
|
#
|
745
|
-
# @overload discover_connection_profile(parent: nil, connection_profile: nil, connection_profile_name: nil, full_hierarchy: nil, hierarchy_depth: nil, oracle_rdbms: nil, mysql_rdbms: nil, postgresql_rdbms: nil)
|
765
|
+
# @overload discover_connection_profile(parent: nil, connection_profile: nil, connection_profile_name: nil, full_hierarchy: nil, hierarchy_depth: nil, oracle_rdbms: nil, mysql_rdbms: nil, postgresql_rdbms: nil, sql_server_rdbms: nil)
|
746
766
|
# Pass arguments to `discover_connection_profile` via keyword arguments. Note that at
|
747
767
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
748
768
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -765,6 +785,8 @@ module Google
|
|
765
785
|
# MySQL RDBMS to enrich with child data objects and metadata.
|
766
786
|
# @param postgresql_rdbms [::Google::Cloud::Datastream::V1::PostgresqlRdbms, ::Hash]
|
767
787
|
# PostgreSQL RDBMS to enrich with child data objects and metadata.
|
788
|
+
# @param sql_server_rdbms [::Google::Cloud::Datastream::V1::SqlServerRdbms, ::Hash]
|
789
|
+
# SQLServer RDBMS to enrich with child data objects and metadata.
|
768
790
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
769
791
|
# @yieldparam result [::Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse]
|
770
792
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -818,7 +840,6 @@ module Google
|
|
818
840
|
|
819
841
|
@datastream_stub.discover_connection_profile request, options do |result, operation|
|
820
842
|
yield result, operation if block_given?
|
821
|
-
return result
|
822
843
|
end
|
823
844
|
rescue ::Gapic::Rest::Error => e
|
824
845
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -915,7 +936,6 @@ module Google
|
|
915
936
|
|
916
937
|
@datastream_stub.list_streams request, options do |result, operation|
|
917
938
|
yield result, operation if block_given?
|
918
|
-
return result
|
919
939
|
end
|
920
940
|
rescue ::Gapic::Rest::Error => e
|
921
941
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -994,7 +1014,6 @@ module Google
|
|
994
1014
|
|
995
1015
|
@datastream_stub.get_stream request, options do |result, operation|
|
996
1016
|
yield result, operation if block_given?
|
997
|
-
return result
|
998
1017
|
end
|
999
1018
|
rescue ::Gapic::Rest::Error => e
|
1000
1019
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1104,7 +1123,7 @@ module Google
|
|
1104
1123
|
@datastream_stub.create_stream request, options do |result, operation|
|
1105
1124
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1106
1125
|
yield result, operation if block_given?
|
1107
|
-
|
1126
|
+
throw :response, result
|
1108
1127
|
end
|
1109
1128
|
rescue ::Gapic::Rest::Error => e
|
1110
1129
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1216,7 +1235,7 @@ module Google
|
|
1216
1235
|
@datastream_stub.update_stream request, options do |result, operation|
|
1217
1236
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1218
1237
|
yield result, operation if block_given?
|
1219
|
-
|
1238
|
+
throw :response, result
|
1220
1239
|
end
|
1221
1240
|
rescue ::Gapic::Rest::Error => e
|
1222
1241
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1317,7 +1336,101 @@ module Google
|
|
1317
1336
|
@datastream_stub.delete_stream request, options do |result, operation|
|
1318
1337
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1319
1338
|
yield result, operation if block_given?
|
1320
|
-
|
1339
|
+
throw :response, result
|
1340
|
+
end
|
1341
|
+
rescue ::Gapic::Rest::Error => e
|
1342
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1343
|
+
end
|
1344
|
+
|
1345
|
+
##
|
1346
|
+
# Use this method to start, resume or recover a stream with a non default CDC
|
1347
|
+
# strategy.
|
1348
|
+
#
|
1349
|
+
# @overload run_stream(request, options = nil)
|
1350
|
+
# Pass arguments to `run_stream` via a request object, either of type
|
1351
|
+
# {::Google::Cloud::Datastream::V1::RunStreamRequest} or an equivalent Hash.
|
1352
|
+
#
|
1353
|
+
# @param request [::Google::Cloud::Datastream::V1::RunStreamRequest, ::Hash]
|
1354
|
+
# A request object representing the call parameters. Required. To specify no
|
1355
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1356
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1357
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1358
|
+
#
|
1359
|
+
# @overload run_stream(name: nil, cdc_strategy: nil, force: nil)
|
1360
|
+
# Pass arguments to `run_stream` via keyword arguments. Note that at
|
1361
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1362
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1363
|
+
#
|
1364
|
+
# @param name [::String]
|
1365
|
+
# Required. Name of the stream resource to start, in the format:
|
1366
|
+
# projects/\\{project_id}/locations/\\{location}/streams/\\{stream_name}
|
1367
|
+
# @param cdc_strategy [::Google::Cloud::Datastream::V1::CdcStrategy, ::Hash]
|
1368
|
+
# Optional. The CDC strategy of the stream. If not set, the system's default
|
1369
|
+
# value will be used.
|
1370
|
+
# @param force [::Boolean]
|
1371
|
+
# Optional. Update the stream without validating it.
|
1372
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1373
|
+
# @yieldparam result [::Gapic::Operation]
|
1374
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1375
|
+
#
|
1376
|
+
# @return [::Gapic::Operation]
|
1377
|
+
#
|
1378
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1379
|
+
#
|
1380
|
+
# @example Basic example
|
1381
|
+
# require "google/cloud/datastream/v1"
|
1382
|
+
#
|
1383
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1384
|
+
# client = Google::Cloud::Datastream::V1::Datastream::Rest::Client.new
|
1385
|
+
#
|
1386
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1387
|
+
# request = Google::Cloud::Datastream::V1::RunStreamRequest.new
|
1388
|
+
#
|
1389
|
+
# # Call the run_stream method.
|
1390
|
+
# result = client.run_stream request
|
1391
|
+
#
|
1392
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1393
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1394
|
+
# # Here is how to wait for a response.
|
1395
|
+
# result.wait_until_done! timeout: 60
|
1396
|
+
# if result.response?
|
1397
|
+
# p result.response
|
1398
|
+
# else
|
1399
|
+
# puts "No response received."
|
1400
|
+
# end
|
1401
|
+
#
|
1402
|
+
def run_stream request, options = nil
|
1403
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1404
|
+
|
1405
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastream::V1::RunStreamRequest
|
1406
|
+
|
1407
|
+
# Converts hash and nil to an options object
|
1408
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1409
|
+
|
1410
|
+
# Customize the options with defaults
|
1411
|
+
call_metadata = @config.rpcs.run_stream.metadata.to_h
|
1412
|
+
|
1413
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1414
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1415
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1416
|
+
gapic_version: ::Google::Cloud::Datastream::V1::VERSION,
|
1417
|
+
transports_version_send: [:rest]
|
1418
|
+
|
1419
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1420
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1421
|
+
|
1422
|
+
options.apply_defaults timeout: @config.rpcs.run_stream.timeout,
|
1423
|
+
metadata: call_metadata,
|
1424
|
+
retry_policy: @config.rpcs.run_stream.retry_policy
|
1425
|
+
|
1426
|
+
options.apply_defaults timeout: @config.timeout,
|
1427
|
+
metadata: @config.metadata,
|
1428
|
+
retry_policy: @config.retry_policy
|
1429
|
+
|
1430
|
+
@datastream_stub.run_stream request, options do |result, operation|
|
1431
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1432
|
+
yield result, operation if block_given?
|
1433
|
+
throw :response, result
|
1321
1434
|
end
|
1322
1435
|
rescue ::Gapic::Rest::Error => e
|
1323
1436
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1396,7 +1509,6 @@ module Google
|
|
1396
1509
|
|
1397
1510
|
@datastream_stub.get_stream_object request, options do |result, operation|
|
1398
1511
|
yield result, operation if block_given?
|
1399
|
-
return result
|
1400
1512
|
end
|
1401
1513
|
rescue ::Gapic::Rest::Error => e
|
1402
1514
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1477,7 +1589,6 @@ module Google
|
|
1477
1589
|
|
1478
1590
|
@datastream_stub.lookup_stream_object request, options do |result, operation|
|
1479
1591
|
yield result, operation if block_given?
|
1480
|
-
return result
|
1481
1592
|
end
|
1482
1593
|
rescue ::Gapic::Rest::Error => e
|
1483
1594
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1571,7 +1682,7 @@ module Google
|
|
1571
1682
|
@datastream_stub.list_stream_objects request, options do |result, operation|
|
1572
1683
|
result = ::Gapic::Rest::PagedEnumerable.new @datastream_stub, :list_stream_objects, "stream_objects", request, result, options
|
1573
1684
|
yield result, operation if block_given?
|
1574
|
-
|
1685
|
+
throw :response, result
|
1575
1686
|
end
|
1576
1687
|
rescue ::Gapic::Rest::Error => e
|
1577
1688
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1651,7 +1762,6 @@ module Google
|
|
1651
1762
|
|
1652
1763
|
@datastream_stub.start_backfill_job request, options do |result, operation|
|
1653
1764
|
yield result, operation if block_given?
|
1654
|
-
return result
|
1655
1765
|
end
|
1656
1766
|
rescue ::Gapic::Rest::Error => e
|
1657
1767
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1731,7 +1841,6 @@ module Google
|
|
1731
1841
|
|
1732
1842
|
@datastream_stub.stop_backfill_job request, options do |result, operation|
|
1733
1843
|
yield result, operation if block_given?
|
1734
|
-
return result
|
1735
1844
|
end
|
1736
1845
|
rescue ::Gapic::Rest::Error => e
|
1737
1846
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1818,7 +1927,7 @@ module Google
|
|
1818
1927
|
@datastream_stub.fetch_static_ips request, options do |result, operation|
|
1819
1928
|
result = ::Gapic::Rest::PagedEnumerable.new @datastream_stub, :fetch_static_ips, "static_ips", request, result, options
|
1820
1929
|
yield result, operation if block_given?
|
1821
|
-
|
1930
|
+
throw :response, result
|
1822
1931
|
end
|
1823
1932
|
rescue ::Gapic::Rest::Error => e
|
1824
1933
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1925,7 +2034,7 @@ module Google
|
|
1925
2034
|
@datastream_stub.create_private_connection request, options do |result, operation|
|
1926
2035
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1927
2036
|
yield result, operation if block_given?
|
1928
|
-
|
2037
|
+
throw :response, result
|
1929
2038
|
end
|
1930
2039
|
rescue ::Gapic::Rest::Error => e
|
1931
2040
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2004,7 +2113,6 @@ module Google
|
|
2004
2113
|
|
2005
2114
|
@datastream_stub.get_private_connection request, options do |result, operation|
|
2006
2115
|
yield result, operation if block_given?
|
2007
|
-
return result
|
2008
2116
|
end
|
2009
2117
|
rescue ::Gapic::Rest::Error => e
|
2010
2118
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2105,7 +2213,6 @@ module Google
|
|
2105
2213
|
|
2106
2214
|
@datastream_stub.list_private_connections request, options do |result, operation|
|
2107
2215
|
yield result, operation if block_given?
|
2108
|
-
return result
|
2109
2216
|
end
|
2110
2217
|
rescue ::Gapic::Rest::Error => e
|
2111
2218
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2209,7 +2316,7 @@ module Google
|
|
2209
2316
|
@datastream_stub.delete_private_connection request, options do |result, operation|
|
2210
2317
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2211
2318
|
yield result, operation if block_given?
|
2212
|
-
|
2319
|
+
throw :response, result
|
2213
2320
|
end
|
2214
2321
|
rescue ::Gapic::Rest::Error => e
|
2215
2322
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2315,7 +2422,7 @@ module Google
|
|
2315
2422
|
@datastream_stub.create_route request, options do |result, operation|
|
2316
2423
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2317
2424
|
yield result, operation if block_given?
|
2318
|
-
|
2425
|
+
throw :response, result
|
2319
2426
|
end
|
2320
2427
|
rescue ::Gapic::Rest::Error => e
|
2321
2428
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2394,7 +2501,6 @@ module Google
|
|
2394
2501
|
|
2395
2502
|
@datastream_stub.get_route request, options do |result, operation|
|
2396
2503
|
yield result, operation if block_given?
|
2397
|
-
return result
|
2398
2504
|
end
|
2399
2505
|
rescue ::Gapic::Rest::Error => e
|
2400
2506
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2494,7 +2600,6 @@ module Google
|
|
2494
2600
|
|
2495
2601
|
@datastream_stub.list_routes request, options do |result, operation|
|
2496
2602
|
yield result, operation if block_given?
|
2497
|
-
return result
|
2498
2603
|
end
|
2499
2604
|
rescue ::Gapic::Rest::Error => e
|
2500
2605
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2595,7 +2700,7 @@ module Google
|
|
2595
2700
|
@datastream_stub.delete_route request, options do |result, operation|
|
2596
2701
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
2597
2702
|
yield result, operation if block_given?
|
2598
|
-
|
2703
|
+
throw :response, result
|
2599
2704
|
end
|
2600
2705
|
rescue ::Gapic::Rest::Error => e
|
2601
2706
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2675,6 +2780,11 @@ module Google
|
|
2675
2780
|
# default endpoint URL. The default value of nil uses the environment
|
2676
2781
|
# universe (usually the default "googleapis.com" universe).
|
2677
2782
|
# @return [::String,nil]
|
2783
|
+
# @!attribute [rw] logger
|
2784
|
+
# A custom logger to use for request/response debug logging, or the value
|
2785
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2786
|
+
# explicitly disable logging.
|
2787
|
+
# @return [::Logger,:default,nil]
|
2678
2788
|
#
|
2679
2789
|
class Configuration
|
2680
2790
|
extend ::Gapic::Config
|
@@ -2703,6 +2813,7 @@ module Google
|
|
2703
2813
|
# by the host service.
|
2704
2814
|
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
2705
2815
|
config_attr :bindings_override, {}, ::Hash, nil
|
2816
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2706
2817
|
|
2707
2818
|
# @private
|
2708
2819
|
def initialize parent_config = nil
|
@@ -2797,6 +2908,11 @@ module Google
|
|
2797
2908
|
#
|
2798
2909
|
attr_reader :delete_stream
|
2799
2910
|
##
|
2911
|
+
# RPC-specific configuration for `run_stream`
|
2912
|
+
# @return [::Gapic::Config::Method]
|
2913
|
+
#
|
2914
|
+
attr_reader :run_stream
|
2915
|
+
##
|
2800
2916
|
# RPC-specific configuration for `get_stream_object`
|
2801
2917
|
# @return [::Gapic::Config::Method]
|
2802
2918
|
#
|
@@ -2891,6 +3007,8 @@ module Google
|
|
2891
3007
|
@update_stream = ::Gapic::Config::Method.new update_stream_config
|
2892
3008
|
delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream
|
2893
3009
|
@delete_stream = ::Gapic::Config::Method.new delete_stream_config
|
3010
|
+
run_stream_config = parent_rpcs.run_stream if parent_rpcs.respond_to? :run_stream
|
3011
|
+
@run_stream = ::Gapic::Config::Method.new run_stream_config
|
2894
3012
|
get_stream_object_config = parent_rpcs.get_stream_object if parent_rpcs.respond_to? :get_stream_object
|
2895
3013
|
@get_stream_object = ::Gapic::Config::Method.new get_stream_object_config
|
2896
3014
|
lookup_stream_object_config = parent_rpcs.lookup_stream_object if parent_rpcs.respond_to? :lookup_stream_object
|
@@ -115,14 +115,6 @@ module Google
|
|
115
115
|
# Lists operations that match the specified filter in the request. If the
|
116
116
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
117
117
|
#
|
118
|
-
# NOTE: the `name` binding allows API services to override the binding
|
119
|
-
# to use different resource name schemes, such as `users/*/operations`. To
|
120
|
-
# override the binding, API services can add a binding such as
|
121
|
-
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
122
|
-
# For backwards compatibility, the default name includes the operations
|
123
|
-
# collection id, however overriding users must ensure the name binding
|
124
|
-
# is the parent resource, without the operations collection id.
|
125
|
-
#
|
126
118
|
# @overload list_operations(request, options = nil)
|
127
119
|
# Pass arguments to `list_operations` via a request object, either of type
|
128
120
|
# {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
|
@@ -204,7 +196,7 @@ module Google
|
|
204
196
|
@operations_stub.list_operations request, options do |result, operation|
|
205
197
|
result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
|
206
198
|
yield result, operation if block_given?
|
207
|
-
|
199
|
+
throw :response, result
|
208
200
|
end
|
209
201
|
rescue ::Gapic::Rest::Error => e
|
210
202
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -293,7 +285,7 @@ module Google
|
|
293
285
|
@operations_stub.get_operation request, options do |result, operation|
|
294
286
|
result = ::Gapic::Operation.new result, @operations_client, options: options
|
295
287
|
yield result, operation if block_given?
|
296
|
-
|
288
|
+
throw :response, result
|
297
289
|
end
|
298
290
|
rescue ::Gapic::Rest::Error => e
|
299
291
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -375,7 +367,6 @@ module Google
|
|
375
367
|
|
376
368
|
@operations_stub.delete_operation request, options do |result, operation|
|
377
369
|
yield result, operation if block_given?
|
378
|
-
return result
|
379
370
|
end
|
380
371
|
rescue ::Gapic::Rest::Error => e
|
381
372
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -390,8 +381,9 @@ module Google
|
|
390
381
|
# other methods to check whether the cancellation succeeded or whether the
|
391
382
|
# operation completed despite cancellation. On successful cancellation,
|
392
383
|
# the operation is not deleted; instead, it becomes an operation with
|
393
|
-
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
394
|
-
# corresponding to
|
384
|
+
# an {::Google::Longrunning::Operation#error Operation.error} value with a
|
385
|
+
# {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
|
386
|
+
# `Code.CANCELLED`.
|
395
387
|
#
|
396
388
|
# @overload cancel_operation(request, options = nil)
|
397
389
|
# Pass arguments to `cancel_operation` via a request object, either of type
|
@@ -463,7 +455,6 @@ module Google
|
|
463
455
|
|
464
456
|
@operations_stub.cancel_operation request, options do |result, operation|
|
465
457
|
yield result, operation if block_given?
|
466
|
-
return result
|
467
458
|
end
|
468
459
|
rescue ::Gapic::Rest::Error => e
|
469
460
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -543,6 +534,11 @@ module Google
|
|
543
534
|
# default endpoint URL. The default value of nil uses the environment
|
544
535
|
# universe (usually the default "googleapis.com" universe).
|
545
536
|
# @return [::String,nil]
|
537
|
+
# @!attribute [rw] logger
|
538
|
+
# A custom logger to use for request/response debug logging, or the value
|
539
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
540
|
+
# explicitly disable logging.
|
541
|
+
# @return [::Logger,:default,nil]
|
546
542
|
#
|
547
543
|
class Configuration
|
548
544
|
extend ::Gapic::Config
|
@@ -564,6 +560,7 @@ module Google
|
|
564
560
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
565
561
|
config_attr :quota_project, nil, ::String, nil
|
566
562
|
config_attr :universe_domain, nil, ::String, nil
|
563
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
567
564
|
|
568
565
|
# @private
|
569
566
|
def initialize parent_config = nil
|
@@ -683,16 +680,18 @@ module Google
|
|
683
680
|
|
684
681
|
response = @client_stub.make_http_request(
|
685
682
|
verb,
|
686
|
-
uri:
|
687
|
-
body:
|
688
|
-
params:
|
683
|
+
uri: uri,
|
684
|
+
body: body || "",
|
685
|
+
params: query_string_params,
|
686
|
+
method_name: "list_operations",
|
689
687
|
options: options
|
690
688
|
)
|
691
689
|
operation = ::Gapic::Rest::TransportOperation.new response
|
692
690
|
result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
|
693
|
-
|
694
|
-
|
695
|
-
|
691
|
+
catch :response do
|
692
|
+
yield result, operation if block_given?
|
693
|
+
result
|
694
|
+
end
|
696
695
|
end
|
697
696
|
|
698
697
|
##
|
@@ -721,16 +720,18 @@ module Google
|
|
721
720
|
|
722
721
|
response = @client_stub.make_http_request(
|
723
722
|
verb,
|
724
|
-
uri:
|
725
|
-
body:
|
726
|
-
params:
|
723
|
+
uri: uri,
|
724
|
+
body: body || "",
|
725
|
+
params: query_string_params,
|
726
|
+
method_name: "get_operation",
|
727
727
|
options: options
|
728
728
|
)
|
729
729
|
operation = ::Gapic::Rest::TransportOperation.new response
|
730
730
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
731
|
-
|
732
|
-
|
733
|
-
|
731
|
+
catch :response do
|
732
|
+
yield result, operation if block_given?
|
733
|
+
result
|
734
|
+
end
|
734
735
|
end
|
735
736
|
|
736
737
|
##
|
@@ -759,16 +760,18 @@ module Google
|
|
759
760
|
|
760
761
|
response = @client_stub.make_http_request(
|
761
762
|
verb,
|
762
|
-
uri:
|
763
|
-
body:
|
764
|
-
params:
|
763
|
+
uri: uri,
|
764
|
+
body: body || "",
|
765
|
+
params: query_string_params,
|
766
|
+
method_name: "delete_operation",
|
765
767
|
options: options
|
766
768
|
)
|
767
769
|
operation = ::Gapic::Rest::TransportOperation.new response
|
768
770
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
769
|
-
|
770
|
-
|
771
|
-
|
771
|
+
catch :response do
|
772
|
+
yield result, operation if block_given?
|
773
|
+
result
|
774
|
+
end
|
772
775
|
end
|
773
776
|
|
774
777
|
##
|
@@ -797,16 +800,18 @@ module Google
|
|
797
800
|
|
798
801
|
response = @client_stub.make_http_request(
|
799
802
|
verb,
|
800
|
-
uri:
|
801
|
-
body:
|
802
|
-
params:
|
803
|
+
uri: uri,
|
804
|
+
body: body || "",
|
805
|
+
params: query_string_params,
|
806
|
+
method_name: "cancel_operation",
|
803
807
|
options: options
|
804
808
|
)
|
805
809
|
operation = ::Gapic::Rest::TransportOperation.new response
|
806
810
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
807
|
-
|
808
|
-
|
809
|
-
|
811
|
+
catch :response do
|
812
|
+
yield result, operation if block_given?
|
813
|
+
result
|
814
|
+
end
|
810
815
|
end
|
811
816
|
|
812
817
|
##
|