google-cloud-video-live_stream-v1 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -213,15 +213,27 @@ module Google
213
213
  endpoint: @config.endpoint,
214
214
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
215
215
  universe_domain: @config.universe_domain,
216
- credentials: credentials
216
+ credentials: credentials,
217
+ logger: @config.logger
217
218
  )
218
219
 
220
+ @livestream_service_stub.logger(stub: true)&.info do |entry|
221
+ entry.set_system_name
222
+ entry.set_service
223
+ entry.message = "Created client for #{entry.service}"
224
+ entry.set_credentials_fields credentials
225
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
226
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
227
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
228
+ end
229
+
219
230
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
220
231
  config.credentials = credentials
221
232
  config.quota_project = @quota_project_id
222
233
  config.endpoint = @livestream_service_stub.endpoint
223
234
  config.universe_domain = @livestream_service_stub.universe_domain
224
235
  config.bindings_override = @config.bindings_override
236
+ config.logger = @livestream_service_stub.logger if config.respond_to? :logger=
225
237
  end
226
238
  end
227
239
 
@@ -239,6 +251,15 @@ module Google
239
251
  #
240
252
  attr_reader :location_client
241
253
 
254
+ ##
255
+ # The logger used for request/response debug logging.
256
+ #
257
+ # @return [Logger]
258
+ #
259
+ def logger
260
+ @livestream_service_stub.logger
261
+ end
262
+
242
263
  # Service calls
243
264
 
244
265
  ##
@@ -344,7 +365,7 @@ module Google
344
365
  @livestream_service_stub.create_channel request, options do |result, operation|
345
366
  result = ::Gapic::Operation.new result, @operations_client, options: options
346
367
  yield result, operation if block_given?
347
- return result
368
+ throw :response, result
348
369
  end
349
370
  rescue ::Gapic::Rest::Error => e
350
371
  raise ::Google::Cloud::Error.from_error(e)
@@ -441,7 +462,6 @@ module Google
441
462
 
442
463
  @livestream_service_stub.list_channels request, options do |result, operation|
443
464
  yield result, operation if block_given?
444
- return result
445
465
  end
446
466
  rescue ::Gapic::Rest::Error => e
447
467
  raise ::Google::Cloud::Error.from_error(e)
@@ -521,7 +541,6 @@ module Google
521
541
 
522
542
  @livestream_service_stub.get_channel request, options do |result, operation|
523
543
  yield result, operation if block_given?
524
- return result
525
544
  end
526
545
  rescue ::Gapic::Rest::Error => e
527
546
  raise ::Google::Cloud::Error.from_error(e)
@@ -628,7 +647,7 @@ module Google
628
647
  @livestream_service_stub.delete_channel request, options do |result, operation|
629
648
  result = ::Gapic::Operation.new result, @operations_client, options: options
630
649
  yield result, operation if block_given?
631
- return result
650
+ throw :response, result
632
651
  end
633
652
  rescue ::Gapic::Rest::Error => e
634
653
  raise ::Google::Cloud::Error.from_error(e)
@@ -750,7 +769,7 @@ module Google
750
769
  @livestream_service_stub.update_channel request, options do |result, operation|
751
770
  result = ::Gapic::Operation.new result, @operations_client, options: options
752
771
  yield result, operation if block_given?
753
- return result
772
+ throw :response, result
754
773
  end
755
774
  rescue ::Gapic::Rest::Error => e
756
775
  raise ::Google::Cloud::Error.from_error(e)
@@ -853,7 +872,7 @@ module Google
853
872
  @livestream_service_stub.start_channel request, options do |result, operation|
854
873
  result = ::Gapic::Operation.new result, @operations_client, options: options
855
874
  yield result, operation if block_given?
856
- return result
875
+ throw :response, result
857
876
  end
858
877
  rescue ::Gapic::Rest::Error => e
859
878
  raise ::Google::Cloud::Error.from_error(e)
@@ -956,7 +975,7 @@ module Google
956
975
  @livestream_service_stub.stop_channel request, options do |result, operation|
957
976
  result = ::Gapic::Operation.new result, @operations_client, options: options
958
977
  yield result, operation if block_given?
959
- return result
978
+ throw :response, result
960
979
  end
961
980
  rescue ::Gapic::Rest::Error => e
962
981
  raise ::Google::Cloud::Error.from_error(e)
@@ -1064,7 +1083,7 @@ module Google
1064
1083
  @livestream_service_stub.create_input request, options do |result, operation|
1065
1084
  result = ::Gapic::Operation.new result, @operations_client, options: options
1066
1085
  yield result, operation if block_given?
1067
- return result
1086
+ throw :response, result
1068
1087
  end
1069
1088
  rescue ::Gapic::Rest::Error => e
1070
1089
  raise ::Google::Cloud::Error.from_error(e)
@@ -1161,7 +1180,6 @@ module Google
1161
1180
 
1162
1181
  @livestream_service_stub.list_inputs request, options do |result, operation|
1163
1182
  yield result, operation if block_given?
1164
- return result
1165
1183
  end
1166
1184
  rescue ::Gapic::Rest::Error => e
1167
1185
  raise ::Google::Cloud::Error.from_error(e)
@@ -1241,7 +1259,6 @@ module Google
1241
1259
 
1242
1260
  @livestream_service_stub.get_input request, options do |result, operation|
1243
1261
  yield result, operation if block_given?
1244
- return result
1245
1262
  end
1246
1263
  rescue ::Gapic::Rest::Error => e
1247
1264
  raise ::Google::Cloud::Error.from_error(e)
@@ -1343,7 +1360,7 @@ module Google
1343
1360
  @livestream_service_stub.delete_input request, options do |result, operation|
1344
1361
  result = ::Gapic::Operation.new result, @operations_client, options: options
1345
1362
  yield result, operation if block_given?
1346
- return result
1363
+ throw :response, result
1347
1364
  end
1348
1365
  rescue ::Gapic::Rest::Error => e
1349
1366
  raise ::Google::Cloud::Error.from_error(e)
@@ -1457,7 +1474,7 @@ module Google
1457
1474
  @livestream_service_stub.update_input request, options do |result, operation|
1458
1475
  result = ::Gapic::Operation.new result, @operations_client, options: options
1459
1476
  yield result, operation if block_given?
1460
- return result
1477
+ throw :response, result
1461
1478
  end
1462
1479
  rescue ::Gapic::Rest::Error => e
1463
1480
  raise ::Google::Cloud::Error.from_error(e)
@@ -1557,7 +1574,6 @@ module Google
1557
1574
 
1558
1575
  @livestream_service_stub.create_event request, options do |result, operation|
1559
1576
  yield result, operation if block_given?
1560
- return result
1561
1577
  end
1562
1578
  rescue ::Gapic::Rest::Error => e
1563
1579
  raise ::Google::Cloud::Error.from_error(e)
@@ -1654,7 +1670,6 @@ module Google
1654
1670
 
1655
1671
  @livestream_service_stub.list_events request, options do |result, operation|
1656
1672
  yield result, operation if block_given?
1657
- return result
1658
1673
  end
1659
1674
  rescue ::Gapic::Rest::Error => e
1660
1675
  raise ::Google::Cloud::Error.from_error(e)
@@ -1734,7 +1749,6 @@ module Google
1734
1749
 
1735
1750
  @livestream_service_stub.get_event request, options do |result, operation|
1736
1751
  yield result, operation if block_given?
1737
- return result
1738
1752
  end
1739
1753
  rescue ::Gapic::Rest::Error => e
1740
1754
  raise ::Google::Cloud::Error.from_error(e)
@@ -1828,7 +1842,6 @@ module Google
1828
1842
 
1829
1843
  @livestream_service_stub.delete_event request, options do |result, operation|
1830
1844
  yield result, operation if block_given?
1831
- return result
1832
1845
  end
1833
1846
  rescue ::Gapic::Rest::Error => e
1834
1847
  raise ::Google::Cloud::Error.from_error(e)
@@ -1920,7 +1933,6 @@ module Google
1920
1933
 
1921
1934
  @livestream_service_stub.list_clips request, options do |result, operation|
1922
1935
  yield result, operation if block_given?
1923
- return result
1924
1936
  end
1925
1937
  rescue ::Gapic::Rest::Error => e
1926
1938
  raise ::Google::Cloud::Error.from_error(e)
@@ -2000,7 +2012,6 @@ module Google
2000
2012
 
2001
2013
  @livestream_service_stub.get_clip request, options do |result, operation|
2002
2014
  yield result, operation if block_given?
2003
- return result
2004
2015
  end
2005
2016
  rescue ::Gapic::Rest::Error => e
2006
2017
  raise ::Google::Cloud::Error.from_error(e)
@@ -2109,7 +2120,7 @@ module Google
2109
2120
  @livestream_service_stub.create_clip request, options do |result, operation|
2110
2121
  result = ::Gapic::Operation.new result, @operations_client, options: options
2111
2122
  yield result, operation if block_given?
2112
- return result
2123
+ throw :response, result
2113
2124
  end
2114
2125
  rescue ::Gapic::Rest::Error => e
2115
2126
  raise ::Google::Cloud::Error.from_error(e)
@@ -2212,7 +2223,7 @@ module Google
2212
2223
  @livestream_service_stub.delete_clip request, options do |result, operation|
2213
2224
  result = ::Gapic::Operation.new result, @operations_client, options: options
2214
2225
  yield result, operation if block_given?
2215
- return result
2226
+ throw :response, result
2216
2227
  end
2217
2228
  rescue ::Gapic::Rest::Error => e
2218
2229
  raise ::Google::Cloud::Error.from_error(e)
@@ -2321,7 +2332,7 @@ module Google
2321
2332
  @livestream_service_stub.create_asset request, options do |result, operation|
2322
2333
  result = ::Gapic::Operation.new result, @operations_client, options: options
2323
2334
  yield result, operation if block_given?
2324
- return result
2335
+ throw :response, result
2325
2336
  end
2326
2337
  rescue ::Gapic::Rest::Error => e
2327
2338
  raise ::Google::Cloud::Error.from_error(e)
@@ -2423,7 +2434,7 @@ module Google
2423
2434
  @livestream_service_stub.delete_asset request, options do |result, operation|
2424
2435
  result = ::Gapic::Operation.new result, @operations_client, options: options
2425
2436
  yield result, operation if block_given?
2426
- return result
2437
+ throw :response, result
2427
2438
  end
2428
2439
  rescue ::Gapic::Rest::Error => e
2429
2440
  raise ::Google::Cloud::Error.from_error(e)
@@ -2503,7 +2514,6 @@ module Google
2503
2514
 
2504
2515
  @livestream_service_stub.get_asset request, options do |result, operation|
2505
2516
  yield result, operation if block_given?
2506
- return result
2507
2517
  end
2508
2518
  rescue ::Gapic::Rest::Error => e
2509
2519
  raise ::Google::Cloud::Error.from_error(e)
@@ -2596,7 +2606,6 @@ module Google
2596
2606
 
2597
2607
  @livestream_service_stub.list_assets request, options do |result, operation|
2598
2608
  yield result, operation if block_given?
2599
- return result
2600
2609
  end
2601
2610
  rescue ::Gapic::Rest::Error => e
2602
2611
  raise ::Google::Cloud::Error.from_error(e)
@@ -2676,7 +2685,6 @@ module Google
2676
2685
 
2677
2686
  @livestream_service_stub.get_pool request, options do |result, operation|
2678
2687
  yield result, operation if block_given?
2679
- return result
2680
2688
  end
2681
2689
  rescue ::Gapic::Rest::Error => e
2682
2690
  raise ::Google::Cloud::Error.from_error(e)
@@ -2785,7 +2793,7 @@ module Google
2785
2793
  @livestream_service_stub.update_pool request, options do |result, operation|
2786
2794
  result = ::Gapic::Operation.new result, @operations_client, options: options
2787
2795
  yield result, operation if block_given?
2788
- return result
2796
+ throw :response, result
2789
2797
  end
2790
2798
  rescue ::Gapic::Rest::Error => e
2791
2799
  raise ::Google::Cloud::Error.from_error(e)
@@ -2865,6 +2873,11 @@ module Google
2865
2873
  # default endpoint URL. The default value of nil uses the environment
2866
2874
  # universe (usually the default "googleapis.com" universe).
2867
2875
  # @return [::String,nil]
2876
+ # @!attribute [rw] logger
2877
+ # A custom logger to use for request/response debug logging, or the value
2878
+ # `:default` (the default) to construct a default logger, or `nil` to
2879
+ # explicitly disable logging.
2880
+ # @return [::Logger,:default,nil]
2868
2881
  #
2869
2882
  class Configuration
2870
2883
  extend ::Gapic::Config
@@ -2893,6 +2906,7 @@ module Google
2893
2906
  # by the host service.
2894
2907
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2895
2908
  config_attr :bindings_override, {}, ::Hash, nil
2909
+ config_attr :logger, :default, ::Logger, nil, :default
2896
2910
 
2897
2911
  # @private
2898
2912
  def initialize parent_config = nil
@@ -116,14 +116,6 @@ module Google
116
116
  # Lists operations that match the specified filter in the request. If the
117
117
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
118
118
  #
119
- # NOTE: the `name` binding allows API services to override the binding
120
- # to use different resource name schemes, such as `users/*/operations`. To
121
- # override the binding, API services can add a binding such as
122
- # `"/v1/{name=users/*}/operations"` to their service configuration.
123
- # For backwards compatibility, the default name includes the operations
124
- # collection id, however overriding users must ensure the name binding
125
- # is the parent resource, without the operations collection id.
126
- #
127
119
  # @overload list_operations(request, options = nil)
128
120
  # Pass arguments to `list_operations` via a request object, either of type
129
121
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -205,7 +197,7 @@ module Google
205
197
  @operations_stub.list_operations request, options do |result, operation|
206
198
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
207
199
  yield result, operation if block_given?
208
- return result
200
+ throw :response, result
209
201
  end
210
202
  rescue ::Gapic::Rest::Error => e
211
203
  raise ::Google::Cloud::Error.from_error(e)
@@ -294,7 +286,7 @@ module Google
294
286
  @operations_stub.get_operation request, options do |result, operation|
295
287
  result = ::Gapic::Operation.new result, @operations_client, options: options
296
288
  yield result, operation if block_given?
297
- return result
289
+ throw :response, result
298
290
  end
299
291
  rescue ::Gapic::Rest::Error => e
300
292
  raise ::Google::Cloud::Error.from_error(e)
@@ -376,7 +368,6 @@ module Google
376
368
 
377
369
  @operations_stub.delete_operation request, options do |result, operation|
378
370
  yield result, operation if block_given?
379
- return result
380
371
  end
381
372
  rescue ::Gapic::Rest::Error => e
382
373
  raise ::Google::Cloud::Error.from_error(e)
@@ -391,8 +382,9 @@ module Google
391
382
  # other methods to check whether the cancellation succeeded or whether the
392
383
  # operation completed despite cancellation. On successful cancellation,
393
384
  # the operation is not deleted; instead, it becomes an operation with
394
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
395
- # corresponding to `Code.CANCELLED`.
385
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
386
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
387
+ # `Code.CANCELLED`.
396
388
  #
397
389
  # @overload cancel_operation(request, options = nil)
398
390
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -464,7 +456,6 @@ module Google
464
456
 
465
457
  @operations_stub.cancel_operation request, options do |result, operation|
466
458
  yield result, operation if block_given?
467
- return result
468
459
  end
469
460
  rescue ::Gapic::Rest::Error => e
470
461
  raise ::Google::Cloud::Error.from_error(e)
@@ -544,6 +535,11 @@ module Google
544
535
  # default endpoint URL. The default value of nil uses the environment
545
536
  # universe (usually the default "googleapis.com" universe).
546
537
  # @return [::String,nil]
538
+ # @!attribute [rw] logger
539
+ # A custom logger to use for request/response debug logging, or the value
540
+ # `:default` (the default) to construct a default logger, or `nil` to
541
+ # explicitly disable logging.
542
+ # @return [::Logger,:default,nil]
547
543
  #
548
544
  class Configuration
549
545
  extend ::Gapic::Config
@@ -565,6 +561,7 @@ module Google
565
561
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
566
562
  config_attr :quota_project, nil, ::String, nil
567
563
  config_attr :universe_domain, nil, ::String, nil
564
+ config_attr :logger, :default, ::Logger, nil, :default
568
565
 
569
566
  # @private
570
567
  def initialize parent_config = nil
@@ -684,16 +681,18 @@ module Google
684
681
 
685
682
  response = @client_stub.make_http_request(
686
683
  verb,
687
- uri: uri,
688
- body: body || "",
689
- params: query_string_params,
684
+ uri: uri,
685
+ body: body || "",
686
+ params: query_string_params,
687
+ method_name: "list_operations",
690
688
  options: options
691
689
  )
692
690
  operation = ::Gapic::Rest::TransportOperation.new response
693
691
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
694
-
695
- yield result, operation if block_given?
696
- result
692
+ catch :response do
693
+ yield result, operation if block_given?
694
+ result
695
+ end
697
696
  end
698
697
 
699
698
  ##
@@ -722,16 +721,18 @@ module Google
722
721
 
723
722
  response = @client_stub.make_http_request(
724
723
  verb,
725
- uri: uri,
726
- body: body || "",
727
- params: query_string_params,
724
+ uri: uri,
725
+ body: body || "",
726
+ params: query_string_params,
727
+ method_name: "get_operation",
728
728
  options: options
729
729
  )
730
730
  operation = ::Gapic::Rest::TransportOperation.new response
731
731
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
732
-
733
- yield result, operation if block_given?
734
- result
732
+ catch :response do
733
+ yield result, operation if block_given?
734
+ result
735
+ end
735
736
  end
736
737
 
737
738
  ##
@@ -760,16 +761,18 @@ module Google
760
761
 
761
762
  response = @client_stub.make_http_request(
762
763
  verb,
763
- uri: uri,
764
- body: body || "",
765
- params: query_string_params,
764
+ uri: uri,
765
+ body: body || "",
766
+ params: query_string_params,
767
+ method_name: "delete_operation",
766
768
  options: options
767
769
  )
768
770
  operation = ::Gapic::Rest::TransportOperation.new response
769
771
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
770
-
771
- yield result, operation if block_given?
772
- result
772
+ catch :response do
773
+ yield result, operation if block_given?
774
+ result
775
+ end
773
776
  end
774
777
 
775
778
  ##
@@ -798,16 +801,18 @@ module Google
798
801
 
799
802
  response = @client_stub.make_http_request(
800
803
  verb,
801
- uri: uri,
802
- body: body || "",
803
- params: query_string_params,
804
+ uri: uri,
805
+ body: body || "",
806
+ params: query_string_params,
807
+ method_name: "cancel_operation",
804
808
  options: options
805
809
  )
806
810
  operation = ::Gapic::Rest::TransportOperation.new response
807
811
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
808
-
809
- yield result, operation if block_given?
810
- result
812
+ catch :response do
813
+ yield result, operation if block_given?
814
+ result
815
+ end
811
816
  end
812
817
 
813
818
  ##