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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c81d9e112e8fd9c01f82ee223949ef85b42691a8cc2a649293f0605f91a2a04
4
- data.tar.gz: b6f1c639dece01a9cb27dfb34ca1650291da3f0233f889b912d2dc50739396fd
3
+ metadata.gz: b9550b7a2b9e57ed001cddf4d1f55569be361616f3df60d78da95a5a9f07abd9
4
+ data.tar.gz: af0d4559c8dd4be220699e656ed49696466788b1ff1d9daddda47073a4a3e558
5
5
  SHA512:
6
- metadata.gz: 83884d056126831dfeb65b80d441e40b688f6f791bc1ac7893a1c00a810600fef5cbbb4892b72a7f422dfa9b5174dc99c0d0c9efe647bcbf4a8de3cdd2347a0d
7
- data.tar.gz: 88fecec120dade2a8b9bc847cf0410e35c4e90bfabbd0f1fac86e398a5e284a9eed370882bc7656358f81b4902b26aaa6087ada641b6e15091a74a0451bd11d4
6
+ metadata.gz: 5172894d35f58aec20b8b83fcb292ef7d2b0d58af1735e43b03108f37fe3d13fd7d9906d3a86f31e424fe9e623dbd7a43d1639ce5bca08733a6d16635ff38faa
7
+ data.tar.gz: 33e637f33d6fdcb126a7c5c0a736084539a72fd946fb78369baa50c3a03703129e56aceb06fb0558e4540588ec8967f04b7a139a207629568064c885902998ee
data/README.md CHANGED
@@ -43,33 +43,43 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/livestream/)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/video/live_stream/v1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
@@ -220,14 +220,26 @@ module Google
220
220
  universe_domain: @config.universe_domain,
221
221
  channel_args: @config.channel_args,
222
222
  interceptors: @config.interceptors,
223
- channel_pool_config: @config.channel_pool
223
+ channel_pool_config: @config.channel_pool,
224
+ logger: @config.logger
224
225
  )
225
226
 
227
+ @livestream_service_stub.stub_logger&.info do |entry|
228
+ entry.set_system_name
229
+ entry.set_service
230
+ entry.message = "Created client for #{entry.service}"
231
+ entry.set_credentials_fields credentials
232
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
233
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
234
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
235
+ end
236
+
226
237
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
227
238
  config.credentials = credentials
228
239
  config.quota_project = @quota_project_id
229
240
  config.endpoint = @livestream_service_stub.endpoint
230
241
  config.universe_domain = @livestream_service_stub.universe_domain
242
+ config.logger = @livestream_service_stub.logger if config.respond_to? :logger=
231
243
  end
232
244
  end
233
245
 
@@ -245,6 +257,15 @@ module Google
245
257
  #
246
258
  attr_reader :location_client
247
259
 
260
+ ##
261
+ # The logger used for request/response debug logging.
262
+ #
263
+ # @return [Logger]
264
+ #
265
+ def logger
266
+ @livestream_service_stub.logger
267
+ end
268
+
248
269
  # Service calls
249
270
 
250
271
  ##
@@ -357,7 +378,7 @@ module Google
357
378
  @livestream_service_stub.call_rpc :create_channel, request, options: options do |response, operation|
358
379
  response = ::Gapic::Operation.new response, @operations_client, options: options
359
380
  yield response, operation if block_given?
360
- return response
381
+ throw :response, response
361
382
  end
362
383
  rescue ::GRPC::BadStatus => e
363
384
  raise ::Google::Cloud::Error.from_error(e)
@@ -462,7 +483,7 @@ module Google
462
483
  @livestream_service_stub.call_rpc :list_channels, request, options: options do |response, operation|
463
484
  response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_channels, request, response, operation, options
464
485
  yield response, operation if block_given?
465
- return response
486
+ throw :response, response
466
487
  end
467
488
  rescue ::GRPC::BadStatus => e
468
489
  raise ::Google::Cloud::Error.from_error(e)
@@ -549,7 +570,6 @@ module Google
549
570
 
550
571
  @livestream_service_stub.call_rpc :get_channel, request, options: options do |response, operation|
551
572
  yield response, operation if block_given?
552
- return response
553
573
  end
554
574
  rescue ::GRPC::BadStatus => e
555
575
  raise ::Google::Cloud::Error.from_error(e)
@@ -663,7 +683,7 @@ module Google
663
683
  @livestream_service_stub.call_rpc :delete_channel, request, options: options do |response, operation|
664
684
  response = ::Gapic::Operation.new response, @operations_client, options: options
665
685
  yield response, operation if block_given?
666
- return response
686
+ throw :response, response
667
687
  end
668
688
  rescue ::GRPC::BadStatus => e
669
689
  raise ::Google::Cloud::Error.from_error(e)
@@ -792,7 +812,7 @@ module Google
792
812
  @livestream_service_stub.call_rpc :update_channel, request, options: options do |response, operation|
793
813
  response = ::Gapic::Operation.new response, @operations_client, options: options
794
814
  yield response, operation if block_given?
795
- return response
815
+ throw :response, response
796
816
  end
797
817
  rescue ::GRPC::BadStatus => e
798
818
  raise ::Google::Cloud::Error.from_error(e)
@@ -902,7 +922,7 @@ module Google
902
922
  @livestream_service_stub.call_rpc :start_channel, request, options: options do |response, operation|
903
923
  response = ::Gapic::Operation.new response, @operations_client, options: options
904
924
  yield response, operation if block_given?
905
- return response
925
+ throw :response, response
906
926
  end
907
927
  rescue ::GRPC::BadStatus => e
908
928
  raise ::Google::Cloud::Error.from_error(e)
@@ -1012,7 +1032,7 @@ module Google
1012
1032
  @livestream_service_stub.call_rpc :stop_channel, request, options: options do |response, operation|
1013
1033
  response = ::Gapic::Operation.new response, @operations_client, options: options
1014
1034
  yield response, operation if block_given?
1015
- return response
1035
+ throw :response, response
1016
1036
  end
1017
1037
  rescue ::GRPC::BadStatus => e
1018
1038
  raise ::Google::Cloud::Error.from_error(e)
@@ -1127,7 +1147,7 @@ module Google
1127
1147
  @livestream_service_stub.call_rpc :create_input, request, options: options do |response, operation|
1128
1148
  response = ::Gapic::Operation.new response, @operations_client, options: options
1129
1149
  yield response, operation if block_given?
1130
- return response
1150
+ throw :response, response
1131
1151
  end
1132
1152
  rescue ::GRPC::BadStatus => e
1133
1153
  raise ::Google::Cloud::Error.from_error(e)
@@ -1232,7 +1252,7 @@ module Google
1232
1252
  @livestream_service_stub.call_rpc :list_inputs, request, options: options do |response, operation|
1233
1253
  response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_inputs, request, response, operation, options
1234
1254
  yield response, operation if block_given?
1235
- return response
1255
+ throw :response, response
1236
1256
  end
1237
1257
  rescue ::GRPC::BadStatus => e
1238
1258
  raise ::Google::Cloud::Error.from_error(e)
@@ -1319,7 +1339,6 @@ module Google
1319
1339
 
1320
1340
  @livestream_service_stub.call_rpc :get_input, request, options: options do |response, operation|
1321
1341
  yield response, operation if block_given?
1322
- return response
1323
1342
  end
1324
1343
  rescue ::GRPC::BadStatus => e
1325
1344
  raise ::Google::Cloud::Error.from_error(e)
@@ -1428,7 +1447,7 @@ module Google
1428
1447
  @livestream_service_stub.call_rpc :delete_input, request, options: options do |response, operation|
1429
1448
  response = ::Gapic::Operation.new response, @operations_client, options: options
1430
1449
  yield response, operation if block_given?
1431
- return response
1450
+ throw :response, response
1432
1451
  end
1433
1452
  rescue ::GRPC::BadStatus => e
1434
1453
  raise ::Google::Cloud::Error.from_error(e)
@@ -1549,7 +1568,7 @@ module Google
1549
1568
  @livestream_service_stub.call_rpc :update_input, request, options: options do |response, operation|
1550
1569
  response = ::Gapic::Operation.new response, @operations_client, options: options
1551
1570
  yield response, operation if block_given?
1552
- return response
1571
+ throw :response, response
1553
1572
  end
1554
1573
  rescue ::GRPC::BadStatus => e
1555
1574
  raise ::Google::Cloud::Error.from_error(e)
@@ -1656,7 +1675,6 @@ module Google
1656
1675
 
1657
1676
  @livestream_service_stub.call_rpc :create_event, request, options: options do |response, operation|
1658
1677
  yield response, operation if block_given?
1659
- return response
1660
1678
  end
1661
1679
  rescue ::GRPC::BadStatus => e
1662
1680
  raise ::Google::Cloud::Error.from_error(e)
@@ -1761,7 +1779,7 @@ module Google
1761
1779
  @livestream_service_stub.call_rpc :list_events, request, options: options do |response, operation|
1762
1780
  response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_events, request, response, operation, options
1763
1781
  yield response, operation if block_given?
1764
- return response
1782
+ throw :response, response
1765
1783
  end
1766
1784
  rescue ::GRPC::BadStatus => e
1767
1785
  raise ::Google::Cloud::Error.from_error(e)
@@ -1848,7 +1866,6 @@ module Google
1848
1866
 
1849
1867
  @livestream_service_stub.call_rpc :get_event, request, options: options do |response, operation|
1850
1868
  yield response, operation if block_given?
1851
- return response
1852
1869
  end
1853
1870
  rescue ::GRPC::BadStatus => e
1854
1871
  raise ::Google::Cloud::Error.from_error(e)
@@ -1949,7 +1966,6 @@ module Google
1949
1966
 
1950
1967
  @livestream_service_stub.call_rpc :delete_event, request, options: options do |response, operation|
1951
1968
  yield response, operation if block_given?
1952
- return response
1953
1969
  end
1954
1970
  rescue ::GRPC::BadStatus => e
1955
1971
  raise ::Google::Cloud::Error.from_error(e)
@@ -2049,7 +2065,7 @@ module Google
2049
2065
  @livestream_service_stub.call_rpc :list_clips, request, options: options do |response, operation|
2050
2066
  response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_clips, request, response, operation, options
2051
2067
  yield response, operation if block_given?
2052
- return response
2068
+ throw :response, response
2053
2069
  end
2054
2070
  rescue ::GRPC::BadStatus => e
2055
2071
  raise ::Google::Cloud::Error.from_error(e)
@@ -2136,7 +2152,6 @@ module Google
2136
2152
 
2137
2153
  @livestream_service_stub.call_rpc :get_clip, request, options: options do |response, operation|
2138
2154
  yield response, operation if block_given?
2139
- return response
2140
2155
  end
2141
2156
  rescue ::GRPC::BadStatus => e
2142
2157
  raise ::Google::Cloud::Error.from_error(e)
@@ -2252,7 +2267,7 @@ module Google
2252
2267
  @livestream_service_stub.call_rpc :create_clip, request, options: options do |response, operation|
2253
2268
  response = ::Gapic::Operation.new response, @operations_client, options: options
2254
2269
  yield response, operation if block_given?
2255
- return response
2270
+ throw :response, response
2256
2271
  end
2257
2272
  rescue ::GRPC::BadStatus => e
2258
2273
  raise ::Google::Cloud::Error.from_error(e)
@@ -2362,7 +2377,7 @@ module Google
2362
2377
  @livestream_service_stub.call_rpc :delete_clip, request, options: options do |response, operation|
2363
2378
  response = ::Gapic::Operation.new response, @operations_client, options: options
2364
2379
  yield response, operation if block_given?
2365
- return response
2380
+ throw :response, response
2366
2381
  end
2367
2382
  rescue ::GRPC::BadStatus => e
2368
2383
  raise ::Google::Cloud::Error.from_error(e)
@@ -2478,7 +2493,7 @@ module Google
2478
2493
  @livestream_service_stub.call_rpc :create_asset, request, options: options do |response, operation|
2479
2494
  response = ::Gapic::Operation.new response, @operations_client, options: options
2480
2495
  yield response, operation if block_given?
2481
- return response
2496
+ throw :response, response
2482
2497
  end
2483
2498
  rescue ::GRPC::BadStatus => e
2484
2499
  raise ::Google::Cloud::Error.from_error(e)
@@ -2587,7 +2602,7 @@ module Google
2587
2602
  @livestream_service_stub.call_rpc :delete_asset, request, options: options do |response, operation|
2588
2603
  response = ::Gapic::Operation.new response, @operations_client, options: options
2589
2604
  yield response, operation if block_given?
2590
- return response
2605
+ throw :response, response
2591
2606
  end
2592
2607
  rescue ::GRPC::BadStatus => e
2593
2608
  raise ::Google::Cloud::Error.from_error(e)
@@ -2674,7 +2689,6 @@ module Google
2674
2689
 
2675
2690
  @livestream_service_stub.call_rpc :get_asset, request, options: options do |response, operation|
2676
2691
  yield response, operation if block_given?
2677
- return response
2678
2692
  end
2679
2693
  rescue ::GRPC::BadStatus => e
2680
2694
  raise ::Google::Cloud::Error.from_error(e)
@@ -2775,7 +2789,7 @@ module Google
2775
2789
  @livestream_service_stub.call_rpc :list_assets, request, options: options do |response, operation|
2776
2790
  response = ::Gapic::PagedEnumerable.new @livestream_service_stub, :list_assets, request, response, operation, options
2777
2791
  yield response, operation if block_given?
2778
- return response
2792
+ throw :response, response
2779
2793
  end
2780
2794
  rescue ::GRPC::BadStatus => e
2781
2795
  raise ::Google::Cloud::Error.from_error(e)
@@ -2862,7 +2876,6 @@ module Google
2862
2876
 
2863
2877
  @livestream_service_stub.call_rpc :get_pool, request, options: options do |response, operation|
2864
2878
  yield response, operation if block_given?
2865
- return response
2866
2879
  end
2867
2880
  rescue ::GRPC::BadStatus => e
2868
2881
  raise ::Google::Cloud::Error.from_error(e)
@@ -2978,7 +2991,7 @@ module Google
2978
2991
  @livestream_service_stub.call_rpc :update_pool, request, options: options do |response, operation|
2979
2992
  response = ::Gapic::Operation.new response, @operations_client, options: options
2980
2993
  yield response, operation if block_given?
2981
- return response
2994
+ throw :response, response
2982
2995
  end
2983
2996
  rescue ::GRPC::BadStatus => e
2984
2997
  raise ::Google::Cloud::Error.from_error(e)
@@ -3067,6 +3080,11 @@ module Google
3067
3080
  # default endpoint URL. The default value of nil uses the environment
3068
3081
  # universe (usually the default "googleapis.com" universe).
3069
3082
  # @return [::String,nil]
3083
+ # @!attribute [rw] logger
3084
+ # A custom logger to use for request/response debug logging, or the value
3085
+ # `:default` (the default) to construct a default logger, or `nil` to
3086
+ # explicitly disable logging.
3087
+ # @return [::Logger,:default,nil]
3070
3088
  #
3071
3089
  class Configuration
3072
3090
  extend ::Gapic::Config
@@ -3091,6 +3109,7 @@ module Google
3091
3109
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3092
3110
  config_attr :quota_project, nil, ::String, nil
3093
3111
  config_attr :universe_domain, nil, ::String, nil
3112
+ config_attr :logger, :default, ::Logger, nil, :default
3094
3113
 
3095
3114
  # @private
3096
3115
  def initialize parent_config = nil
@@ -125,14 +125,6 @@ module Google
125
125
  # Lists operations that match the specified filter in the request. If the
126
126
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
127
127
  #
128
- # NOTE: the `name` binding allows API services to override the binding
129
- # to use different resource name schemes, such as `users/*/operations`. To
130
- # override the binding, API services can add a binding such as
131
- # `"/v1/{name=users/*}/operations"` to their service configuration.
132
- # For backwards compatibility, the default name includes the operations
133
- # collection id, however overriding users must ensure the name binding
134
- # is the parent resource, without the operations collection id.
135
- #
136
128
  # @overload list_operations(request, options = nil)
137
129
  # Pass arguments to `list_operations` via a request object, either of type
138
130
  # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash.
@@ -222,7 +214,7 @@ module Google
222
214
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
223
215
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
224
216
  yield response, operation if block_given?
225
- return response
217
+ throw :response, response
226
218
  end
227
219
  rescue ::GRPC::BadStatus => e
228
220
  raise ::Google::Cloud::Error.from_error(e)
@@ -318,7 +310,7 @@ module Google
318
310
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
319
311
  response = ::Gapic::Operation.new response, @operations_client, options: options
320
312
  yield response, operation if block_given?
321
- return response
313
+ throw :response, response
322
314
  end
323
315
  rescue ::GRPC::BadStatus => e
324
316
  raise ::Google::Cloud::Error.from_error(e)
@@ -407,7 +399,6 @@ module Google
407
399
 
408
400
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
409
401
  yield response, operation if block_given?
410
- return response
411
402
  end
412
403
  rescue ::GRPC::BadStatus => e
413
404
  raise ::Google::Cloud::Error.from_error(e)
@@ -422,8 +413,9 @@ module Google
422
413
  # other methods to check whether the cancellation succeeded or whether the
423
414
  # operation completed despite cancellation. On successful cancellation,
424
415
  # the operation is not deleted; instead, it becomes an operation with
425
- # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1,
426
- # corresponding to `Code.CANCELLED`.
416
+ # an {::Google::Longrunning::Operation#error Operation.error} value with a
417
+ # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to
418
+ # `Code.CANCELLED`.
427
419
  #
428
420
  # @overload cancel_operation(request, options = nil)
429
421
  # Pass arguments to `cancel_operation` via a request object, either of type
@@ -502,7 +494,6 @@ module Google
502
494
 
503
495
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
504
496
  yield response, operation if block_given?
505
- return response
506
497
  end
507
498
  rescue ::GRPC::BadStatus => e
508
499
  raise ::Google::Cloud::Error.from_error(e)
@@ -600,7 +591,7 @@ module Google
600
591
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
601
592
  response = ::Gapic::Operation.new response, @operations_client, options: options
602
593
  yield response, operation if block_given?
603
- return response
594
+ throw :response, response
604
595
  end
605
596
  rescue ::GRPC::BadStatus => e
606
597
  raise ::Google::Cloud::Error.from_error(e)
@@ -689,6 +680,11 @@ module Google
689
680
  # default endpoint URL. The default value of nil uses the environment
690
681
  # universe (usually the default "googleapis.com" universe).
691
682
  # @return [::String,nil]
683
+ # @!attribute [rw] logger
684
+ # A custom logger to use for request/response debug logging, or the value
685
+ # `:default` (the default) to construct a default logger, or `nil` to
686
+ # explicitly disable logging.
687
+ # @return [::Logger,:default,nil]
692
688
  #
693
689
  class Configuration
694
690
  extend ::Gapic::Config
@@ -713,6 +709,7 @@ module Google
713
709
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
714
710
  config_attr :quota_project, nil, ::String, nil
715
711
  config_attr :universe_domain, nil, ::String, nil
712
+ config_attr :logger, :default, ::Logger, nil, :default
716
713
 
717
714
  # @private
718
715
  def initialize parent_config = nil