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

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,6 +38,9 @@ module Google
38
38
  # Protocol (RTMP) and Secure Reliable Transport (SRT).
39
39
  #
40
40
  class Client
41
+ # @private
42
+ API_VERSION = ""
43
+
41
44
  # @private
42
45
  DEFAULT_ENDPOINT_TEMPLATE = "livestream.$UNIVERSE_DOMAIN$"
43
46
 
@@ -321,12 +324,13 @@ module Google
321
324
  # Customize the options with defaults
322
325
  call_metadata = @config.rpcs.create_channel.metadata.to_h
323
326
 
324
- # Set x-goog-api-client and x-goog-user-project headers
327
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
325
328
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
326
329
  lib_name: @config.lib_name, lib_version: @config.lib_version,
327
330
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
328
331
  transports_version_send: [:rest]
329
332
 
333
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
330
334
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
331
335
 
332
336
  options.apply_defaults timeout: @config.rpcs.create_channel.timeout,
@@ -418,12 +422,13 @@ module Google
418
422
  # Customize the options with defaults
419
423
  call_metadata = @config.rpcs.list_channels.metadata.to_h
420
424
 
421
- # Set x-goog-api-client and x-goog-user-project headers
425
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
422
426
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
423
427
  lib_name: @config.lib_name, lib_version: @config.lib_version,
424
428
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
425
429
  transports_version_send: [:rest]
426
430
 
431
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
427
432
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
428
433
 
429
434
  options.apply_defaults timeout: @config.rpcs.list_channels.timeout,
@@ -497,12 +502,13 @@ module Google
497
502
  # Customize the options with defaults
498
503
  call_metadata = @config.rpcs.get_channel.metadata.to_h
499
504
 
500
- # Set x-goog-api-client and x-goog-user-project headers
505
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
501
506
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
502
507
  lib_name: @config.lib_name, lib_version: @config.lib_version,
503
508
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
504
509
  transports_version_send: [:rest]
505
510
 
511
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
506
512
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
507
513
 
508
514
  options.apply_defaults timeout: @config.rpcs.get_channel.timeout,
@@ -602,12 +608,13 @@ module Google
602
608
  # Customize the options with defaults
603
609
  call_metadata = @config.rpcs.delete_channel.metadata.to_h
604
610
 
605
- # Set x-goog-api-client and x-goog-user-project headers
611
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
606
612
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
607
613
  lib_name: @config.lib_name, lib_version: @config.lib_version,
608
614
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
609
615
  transports_version_send: [:rest]
610
616
 
617
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
611
618
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
612
619
 
613
620
  options.apply_defaults timeout: @config.rpcs.delete_channel.timeout,
@@ -723,12 +730,13 @@ module Google
723
730
  # Customize the options with defaults
724
731
  call_metadata = @config.rpcs.update_channel.metadata.to_h
725
732
 
726
- # Set x-goog-api-client and x-goog-user-project headers
733
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
727
734
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
728
735
  lib_name: @config.lib_name, lib_version: @config.lib_version,
729
736
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
730
737
  transports_version_send: [:rest]
731
738
 
739
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
732
740
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
733
741
 
734
742
  options.apply_defaults timeout: @config.rpcs.update_channel.timeout,
@@ -825,12 +833,13 @@ module Google
825
833
  # Customize the options with defaults
826
834
  call_metadata = @config.rpcs.start_channel.metadata.to_h
827
835
 
828
- # Set x-goog-api-client and x-goog-user-project headers
836
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
829
837
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
830
838
  lib_name: @config.lib_name, lib_version: @config.lib_version,
831
839
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
832
840
  transports_version_send: [:rest]
833
841
 
842
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
834
843
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
835
844
 
836
845
  options.apply_defaults timeout: @config.rpcs.start_channel.timeout,
@@ -927,12 +936,13 @@ module Google
927
936
  # Customize the options with defaults
928
937
  call_metadata = @config.rpcs.stop_channel.metadata.to_h
929
938
 
930
- # Set x-goog-api-client and x-goog-user-project headers
939
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
931
940
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
932
941
  lib_name: @config.lib_name, lib_version: @config.lib_version,
933
942
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
934
943
  transports_version_send: [:rest]
935
944
 
945
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
936
946
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
937
947
 
938
948
  options.apply_defaults timeout: @config.rpcs.stop_channel.timeout,
@@ -1034,12 +1044,13 @@ module Google
1034
1044
  # Customize the options with defaults
1035
1045
  call_metadata = @config.rpcs.create_input.metadata.to_h
1036
1046
 
1037
- # Set x-goog-api-client and x-goog-user-project headers
1047
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1038
1048
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1039
1049
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1040
1050
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1041
1051
  transports_version_send: [:rest]
1042
1052
 
1053
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1043
1054
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1044
1055
 
1045
1056
  options.apply_defaults timeout: @config.rpcs.create_input.timeout,
@@ -1131,12 +1142,13 @@ module Google
1131
1142
  # Customize the options with defaults
1132
1143
  call_metadata = @config.rpcs.list_inputs.metadata.to_h
1133
1144
 
1134
- # Set x-goog-api-client and x-goog-user-project headers
1145
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1135
1146
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1136
1147
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1137
1148
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1138
1149
  transports_version_send: [:rest]
1139
1150
 
1151
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1140
1152
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1141
1153
 
1142
1154
  options.apply_defaults timeout: @config.rpcs.list_inputs.timeout,
@@ -1210,12 +1222,13 @@ module Google
1210
1222
  # Customize the options with defaults
1211
1223
  call_metadata = @config.rpcs.get_input.metadata.to_h
1212
1224
 
1213
- # Set x-goog-api-client and x-goog-user-project headers
1225
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1214
1226
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1215
1227
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1216
1228
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1217
1229
  transports_version_send: [:rest]
1218
1230
 
1231
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1219
1232
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1220
1233
 
1221
1234
  options.apply_defaults timeout: @config.rpcs.get_input.timeout,
@@ -1310,12 +1323,13 @@ module Google
1310
1323
  # Customize the options with defaults
1311
1324
  call_metadata = @config.rpcs.delete_input.metadata.to_h
1312
1325
 
1313
- # Set x-goog-api-client and x-goog-user-project headers
1326
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1314
1327
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1315
1328
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1316
1329
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1317
1330
  transports_version_send: [:rest]
1318
1331
 
1332
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1319
1333
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1320
1334
 
1321
1335
  options.apply_defaults timeout: @config.rpcs.delete_input.timeout,
@@ -1423,12 +1437,13 @@ module Google
1423
1437
  # Customize the options with defaults
1424
1438
  call_metadata = @config.rpcs.update_input.metadata.to_h
1425
1439
 
1426
- # Set x-goog-api-client and x-goog-user-project headers
1440
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1427
1441
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1428
1442
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1429
1443
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1430
1444
  transports_version_send: [:rest]
1431
1445
 
1446
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1432
1447
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1433
1448
 
1434
1449
  options.apply_defaults timeout: @config.rpcs.update_input.timeout,
@@ -1523,12 +1538,13 @@ module Google
1523
1538
  # Customize the options with defaults
1524
1539
  call_metadata = @config.rpcs.create_event.metadata.to_h
1525
1540
 
1526
- # Set x-goog-api-client and x-goog-user-project headers
1541
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1527
1542
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1528
1543
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1529
1544
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1530
1545
  transports_version_send: [:rest]
1531
1546
 
1547
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1532
1548
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1533
1549
 
1534
1550
  options.apply_defaults timeout: @config.rpcs.create_event.timeout,
@@ -1619,12 +1635,13 @@ module Google
1619
1635
  # Customize the options with defaults
1620
1636
  call_metadata = @config.rpcs.list_events.metadata.to_h
1621
1637
 
1622
- # Set x-goog-api-client and x-goog-user-project headers
1638
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1623
1639
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1624
1640
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1625
1641
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1626
1642
  transports_version_send: [:rest]
1627
1643
 
1644
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1628
1645
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1629
1646
 
1630
1647
  options.apply_defaults timeout: @config.rpcs.list_events.timeout,
@@ -1698,12 +1715,13 @@ module Google
1698
1715
  # Customize the options with defaults
1699
1716
  call_metadata = @config.rpcs.get_event.metadata.to_h
1700
1717
 
1701
- # Set x-goog-api-client and x-goog-user-project headers
1718
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1702
1719
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1703
1720
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1704
1721
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1705
1722
  transports_version_send: [:rest]
1706
1723
 
1724
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1707
1725
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1708
1726
 
1709
1727
  options.apply_defaults timeout: @config.rpcs.get_event.timeout,
@@ -1791,12 +1809,13 @@ module Google
1791
1809
  # Customize the options with defaults
1792
1810
  call_metadata = @config.rpcs.delete_event.metadata.to_h
1793
1811
 
1794
- # Set x-goog-api-client and x-goog-user-project headers
1812
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1795
1813
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1796
1814
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1797
1815
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1798
1816
  transports_version_send: [:rest]
1799
1817
 
1818
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1800
1819
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1801
1820
 
1802
1821
  options.apply_defaults timeout: @config.rpcs.delete_event.timeout,
@@ -1815,6 +1834,390 @@ module Google
1815
1834
  raise ::Google::Cloud::Error.from_error(e)
1816
1835
  end
1817
1836
 
1837
+ ##
1838
+ # Returns a list of all clips in the specified channel.
1839
+ #
1840
+ # @overload list_clips(request, options = nil)
1841
+ # Pass arguments to `list_clips` via a request object, either of type
1842
+ # {::Google::Cloud::Video::LiveStream::V1::ListClipsRequest} or an equivalent Hash.
1843
+ #
1844
+ # @param request [::Google::Cloud::Video::LiveStream::V1::ListClipsRequest, ::Hash]
1845
+ # A request object representing the call parameters. Required. To specify no
1846
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1847
+ # @param options [::Gapic::CallOptions, ::Hash]
1848
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1849
+ #
1850
+ # @overload list_clips(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1851
+ # Pass arguments to `list_clips` via keyword arguments. Note that at
1852
+ # least one keyword argument is required. To specify no parameters, or to keep all
1853
+ # the default parameter values, pass an empty Hash as a request object (see above).
1854
+ #
1855
+ # @param parent [::String]
1856
+ # Required. Parent value for ListClipsRequest
1857
+ # @param page_size [::Integer]
1858
+ # Requested page size. Server may return fewer items than requested.
1859
+ # If unspecified, server will pick an appropriate default.
1860
+ # @param page_token [::String]
1861
+ # A token identifying a page of results the server should return.
1862
+ # @param filter [::String]
1863
+ # Filtering results
1864
+ # @param order_by [::String]
1865
+ # Hint for how to order the results
1866
+ # @yield [result, operation] Access the result along with the TransportOperation object
1867
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::ListClipsResponse]
1868
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1869
+ #
1870
+ # @return [::Google::Cloud::Video::LiveStream::V1::ListClipsResponse]
1871
+ #
1872
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1873
+ #
1874
+ # @example Basic example
1875
+ # require "google/cloud/video/live_stream/v1"
1876
+ #
1877
+ # # Create a client object. The client can be reused for multiple calls.
1878
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new
1879
+ #
1880
+ # # Create a request. To set request fields, pass in keyword arguments.
1881
+ # request = Google::Cloud::Video::LiveStream::V1::ListClipsRequest.new
1882
+ #
1883
+ # # Call the list_clips method.
1884
+ # result = client.list_clips request
1885
+ #
1886
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1887
+ # # over elements, and API calls will be issued to fetch pages as needed.
1888
+ # result.each do |item|
1889
+ # # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Clip.
1890
+ # p item
1891
+ # end
1892
+ #
1893
+ def list_clips request, options = nil
1894
+ raise ::ArgumentError, "request must be provided" if request.nil?
1895
+
1896
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::ListClipsRequest
1897
+
1898
+ # Converts hash and nil to an options object
1899
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1900
+
1901
+ # Customize the options with defaults
1902
+ call_metadata = @config.rpcs.list_clips.metadata.to_h
1903
+
1904
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1905
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1906
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1907
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1908
+ transports_version_send: [:rest]
1909
+
1910
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1911
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1912
+
1913
+ options.apply_defaults timeout: @config.rpcs.list_clips.timeout,
1914
+ metadata: call_metadata,
1915
+ retry_policy: @config.rpcs.list_clips.retry_policy
1916
+
1917
+ options.apply_defaults timeout: @config.timeout,
1918
+ metadata: @config.metadata,
1919
+ retry_policy: @config.retry_policy
1920
+
1921
+ @livestream_service_stub.list_clips request, options do |result, operation|
1922
+ yield result, operation if block_given?
1923
+ return result
1924
+ end
1925
+ rescue ::Gapic::Rest::Error => e
1926
+ raise ::Google::Cloud::Error.from_error(e)
1927
+ end
1928
+
1929
+ ##
1930
+ # Returns the specified clip.
1931
+ #
1932
+ # @overload get_clip(request, options = nil)
1933
+ # Pass arguments to `get_clip` via a request object, either of type
1934
+ # {::Google::Cloud::Video::LiveStream::V1::GetClipRequest} or an equivalent Hash.
1935
+ #
1936
+ # @param request [::Google::Cloud::Video::LiveStream::V1::GetClipRequest, ::Hash]
1937
+ # A request object representing the call parameters. Required. To specify no
1938
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1939
+ # @param options [::Gapic::CallOptions, ::Hash]
1940
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1941
+ #
1942
+ # @overload get_clip(name: nil)
1943
+ # Pass arguments to `get_clip` via keyword arguments. Note that at
1944
+ # least one keyword argument is required. To specify no parameters, or to keep all
1945
+ # the default parameter values, pass an empty Hash as a request object (see above).
1946
+ #
1947
+ # @param name [::String]
1948
+ # Required. Name of the resource, in the following form:
1949
+ # `projects/{project}/locations/{location}/channels/{channel}/clips/{clip}`.
1950
+ # @yield [result, operation] Access the result along with the TransportOperation object
1951
+ # @yieldparam result [::Google::Cloud::Video::LiveStream::V1::Clip]
1952
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1953
+ #
1954
+ # @return [::Google::Cloud::Video::LiveStream::V1::Clip]
1955
+ #
1956
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1957
+ #
1958
+ # @example Basic example
1959
+ # require "google/cloud/video/live_stream/v1"
1960
+ #
1961
+ # # Create a client object. The client can be reused for multiple calls.
1962
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new
1963
+ #
1964
+ # # Create a request. To set request fields, pass in keyword arguments.
1965
+ # request = Google::Cloud::Video::LiveStream::V1::GetClipRequest.new
1966
+ #
1967
+ # # Call the get_clip method.
1968
+ # result = client.get_clip request
1969
+ #
1970
+ # # The returned object is of type Google::Cloud::Video::LiveStream::V1::Clip.
1971
+ # p result
1972
+ #
1973
+ def get_clip request, options = nil
1974
+ raise ::ArgumentError, "request must be provided" if request.nil?
1975
+
1976
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::GetClipRequest
1977
+
1978
+ # Converts hash and nil to an options object
1979
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1980
+
1981
+ # Customize the options with defaults
1982
+ call_metadata = @config.rpcs.get_clip.metadata.to_h
1983
+
1984
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1985
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1986
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1987
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1988
+ transports_version_send: [:rest]
1989
+
1990
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1991
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1992
+
1993
+ options.apply_defaults timeout: @config.rpcs.get_clip.timeout,
1994
+ metadata: call_metadata,
1995
+ retry_policy: @config.rpcs.get_clip.retry_policy
1996
+
1997
+ options.apply_defaults timeout: @config.timeout,
1998
+ metadata: @config.metadata,
1999
+ retry_policy: @config.retry_policy
2000
+
2001
+ @livestream_service_stub.get_clip request, options do |result, operation|
2002
+ yield result, operation if block_given?
2003
+ return result
2004
+ end
2005
+ rescue ::Gapic::Rest::Error => e
2006
+ raise ::Google::Cloud::Error.from_error(e)
2007
+ end
2008
+
2009
+ ##
2010
+ # Creates a clip with the provided clip ID in the specified channel.
2011
+ #
2012
+ # @overload create_clip(request, options = nil)
2013
+ # Pass arguments to `create_clip` via a request object, either of type
2014
+ # {::Google::Cloud::Video::LiveStream::V1::CreateClipRequest} or an equivalent Hash.
2015
+ #
2016
+ # @param request [::Google::Cloud::Video::LiveStream::V1::CreateClipRequest, ::Hash]
2017
+ # A request object representing the call parameters. Required. To specify no
2018
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2019
+ # @param options [::Gapic::CallOptions, ::Hash]
2020
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2021
+ #
2022
+ # @overload create_clip(parent: nil, clip_id: nil, clip: nil, request_id: nil)
2023
+ # Pass arguments to `create_clip` via keyword arguments. Note that at
2024
+ # least one keyword argument is required. To specify no parameters, or to keep all
2025
+ # the default parameter values, pass an empty Hash as a request object (see above).
2026
+ #
2027
+ # @param parent [::String]
2028
+ # Required. The parent resource name, in the following form:
2029
+ # `projects/{project}/locations/{location}/channels/{channel}`.
2030
+ # @param clip_id [::String]
2031
+ # Required. Id of the requesting object in the following form:
2032
+ #
2033
+ # 1. 1 character minimum, 63 characters maximum
2034
+ # 2. Only contains letters, digits, underscores, and hyphens
2035
+ # @param clip [::Google::Cloud::Video::LiveStream::V1::Clip, ::Hash]
2036
+ # Required. The resource being created
2037
+ # @param request_id [::String]
2038
+ # Optional. An optional request ID to identify requests. Specify a unique
2039
+ # request ID so that if you must retry your request, the server will know to
2040
+ # ignore the request if it has already been completed. The server will
2041
+ # guarantee that for at least 60 minutes since the first request.
2042
+ #
2043
+ # For example, consider a situation where you make an initial request and
2044
+ # the request times out. If you make the request again with the same request
2045
+ # ID, the server can check if original operation with the same request ID
2046
+ # was received, and if so, will ignore the second request. This prevents
2047
+ # clients from accidentally creating duplicate commitments.
2048
+ #
2049
+ # The request ID must be a valid UUID with the exception that zero UUID is
2050
+ # not supported (00000000-0000-0000-0000-000000000000).
2051
+ # @yield [result, operation] Access the result along with the TransportOperation object
2052
+ # @yieldparam result [::Gapic::Operation]
2053
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2054
+ #
2055
+ # @return [::Gapic::Operation]
2056
+ #
2057
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2058
+ #
2059
+ # @example Basic example
2060
+ # require "google/cloud/video/live_stream/v1"
2061
+ #
2062
+ # # Create a client object. The client can be reused for multiple calls.
2063
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new
2064
+ #
2065
+ # # Create a request. To set request fields, pass in keyword arguments.
2066
+ # request = Google::Cloud::Video::LiveStream::V1::CreateClipRequest.new
2067
+ #
2068
+ # # Call the create_clip method.
2069
+ # result = client.create_clip request
2070
+ #
2071
+ # # The returned object is of type Gapic::Operation. You can use it to
2072
+ # # check the status of an operation, cancel it, or wait for results.
2073
+ # # Here is how to wait for a response.
2074
+ # result.wait_until_done! timeout: 60
2075
+ # if result.response?
2076
+ # p result.response
2077
+ # else
2078
+ # puts "No response received."
2079
+ # end
2080
+ #
2081
+ def create_clip request, options = nil
2082
+ raise ::ArgumentError, "request must be provided" if request.nil?
2083
+
2084
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::CreateClipRequest
2085
+
2086
+ # Converts hash and nil to an options object
2087
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2088
+
2089
+ # Customize the options with defaults
2090
+ call_metadata = @config.rpcs.create_clip.metadata.to_h
2091
+
2092
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2093
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2094
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2095
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
2096
+ transports_version_send: [:rest]
2097
+
2098
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2099
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2100
+
2101
+ options.apply_defaults timeout: @config.rpcs.create_clip.timeout,
2102
+ metadata: call_metadata,
2103
+ retry_policy: @config.rpcs.create_clip.retry_policy
2104
+
2105
+ options.apply_defaults timeout: @config.timeout,
2106
+ metadata: @config.metadata,
2107
+ retry_policy: @config.retry_policy
2108
+
2109
+ @livestream_service_stub.create_clip request, options do |result, operation|
2110
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2111
+ yield result, operation if block_given?
2112
+ return result
2113
+ end
2114
+ rescue ::Gapic::Rest::Error => e
2115
+ raise ::Google::Cloud::Error.from_error(e)
2116
+ end
2117
+
2118
+ ##
2119
+ # Deletes the specified clip job resource. This method only deletes the clip
2120
+ # job and does not delete the VOD clip stored in the GCS.
2121
+ #
2122
+ # @overload delete_clip(request, options = nil)
2123
+ # Pass arguments to `delete_clip` via a request object, either of type
2124
+ # {::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest} or an equivalent Hash.
2125
+ #
2126
+ # @param request [::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest, ::Hash]
2127
+ # A request object representing the call parameters. Required. To specify no
2128
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2129
+ # @param options [::Gapic::CallOptions, ::Hash]
2130
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2131
+ #
2132
+ # @overload delete_clip(name: nil, request_id: nil)
2133
+ # Pass arguments to `delete_clip` via keyword arguments. Note that at
2134
+ # least one keyword argument is required. To specify no parameters, or to keep all
2135
+ # the default parameter values, pass an empty Hash as a request object (see above).
2136
+ #
2137
+ # @param name [::String]
2138
+ # Required. The name of the clip resource, in the form of:
2139
+ # `projects/{project}/locations/{location}/channels/{channelId}/clips/{clipId}`.
2140
+ # @param request_id [::String]
2141
+ # Optional. A request ID to identify requests. Specify a unique request ID
2142
+ # so that if you must retry your request, the server will know to ignore
2143
+ # the request if it has already been completed. The server will guarantee
2144
+ # that for at least 60 minutes since the first request.
2145
+ #
2146
+ # For example, consider a situation where you make an initial request and the
2147
+ # request times out. If you make the request again with the same request ID,
2148
+ # the server can check if original operation with the same request ID was
2149
+ # received, and if so, will ignore the second request. This prevents clients
2150
+ # from accidentally creating duplicate commitments.
2151
+ #
2152
+ # The request ID must be a valid UUID with the exception that zero UUID is
2153
+ # not supported `(00000000-0000-0000-0000-000000000000)`.
2154
+ # @yield [result, operation] Access the result along with the TransportOperation object
2155
+ # @yieldparam result [::Gapic::Operation]
2156
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2157
+ #
2158
+ # @return [::Gapic::Operation]
2159
+ #
2160
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2161
+ #
2162
+ # @example Basic example
2163
+ # require "google/cloud/video/live_stream/v1"
2164
+ #
2165
+ # # Create a client object. The client can be reused for multiple calls.
2166
+ # client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Rest::Client.new
2167
+ #
2168
+ # # Create a request. To set request fields, pass in keyword arguments.
2169
+ # request = Google::Cloud::Video::LiveStream::V1::DeleteClipRequest.new
2170
+ #
2171
+ # # Call the delete_clip method.
2172
+ # result = client.delete_clip request
2173
+ #
2174
+ # # The returned object is of type Gapic::Operation. You can use it to
2175
+ # # check the status of an operation, cancel it, or wait for results.
2176
+ # # Here is how to wait for a response.
2177
+ # result.wait_until_done! timeout: 60
2178
+ # if result.response?
2179
+ # p result.response
2180
+ # else
2181
+ # puts "No response received."
2182
+ # end
2183
+ #
2184
+ def delete_clip request, options = nil
2185
+ raise ::ArgumentError, "request must be provided" if request.nil?
2186
+
2187
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Video::LiveStream::V1::DeleteClipRequest
2188
+
2189
+ # Converts hash and nil to an options object
2190
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2191
+
2192
+ # Customize the options with defaults
2193
+ call_metadata = @config.rpcs.delete_clip.metadata.to_h
2194
+
2195
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2196
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2197
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2198
+ gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
2199
+ transports_version_send: [:rest]
2200
+
2201
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2202
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2203
+
2204
+ options.apply_defaults timeout: @config.rpcs.delete_clip.timeout,
2205
+ metadata: call_metadata,
2206
+ retry_policy: @config.rpcs.delete_clip.retry_policy
2207
+
2208
+ options.apply_defaults timeout: @config.timeout,
2209
+ metadata: @config.metadata,
2210
+ retry_policy: @config.retry_policy
2211
+
2212
+ @livestream_service_stub.delete_clip request, options do |result, operation|
2213
+ result = ::Gapic::Operation.new result, @operations_client, options: options
2214
+ yield result, operation if block_given?
2215
+ return result
2216
+ end
2217
+ rescue ::Gapic::Rest::Error => e
2218
+ raise ::Google::Cloud::Error.from_error(e)
2219
+ end
2220
+
1818
2221
  ##
1819
2222
  # Creates a Asset with the provided unique ID in the specified
1820
2223
  # region.
@@ -1898,12 +2301,13 @@ module Google
1898
2301
  # Customize the options with defaults
1899
2302
  call_metadata = @config.rpcs.create_asset.metadata.to_h
1900
2303
 
1901
- # Set x-goog-api-client and x-goog-user-project headers
2304
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1902
2305
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1903
2306
  lib_name: @config.lib_name, lib_version: @config.lib_version,
1904
2307
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
1905
2308
  transports_version_send: [:rest]
1906
2309
 
2310
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1907
2311
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1908
2312
 
1909
2313
  options.apply_defaults timeout: @config.rpcs.create_asset.timeout,
@@ -1999,12 +2403,13 @@ module Google
1999
2403
  # Customize the options with defaults
2000
2404
  call_metadata = @config.rpcs.delete_asset.metadata.to_h
2001
2405
 
2002
- # Set x-goog-api-client and x-goog-user-project headers
2406
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2003
2407
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2004
2408
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2005
2409
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
2006
2410
  transports_version_send: [:rest]
2007
2411
 
2412
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2008
2413
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2009
2414
 
2010
2415
  options.apply_defaults timeout: @config.rpcs.delete_asset.timeout,
@@ -2079,12 +2484,13 @@ module Google
2079
2484
  # Customize the options with defaults
2080
2485
  call_metadata = @config.rpcs.get_asset.metadata.to_h
2081
2486
 
2082
- # Set x-goog-api-client and x-goog-user-project headers
2487
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2083
2488
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2084
2489
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2085
2490
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
2086
2491
  transports_version_send: [:rest]
2087
2492
 
2493
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2088
2494
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2089
2495
 
2090
2496
  options.apply_defaults timeout: @config.rpcs.get_asset.timeout,
@@ -2171,12 +2577,13 @@ module Google
2171
2577
  # Customize the options with defaults
2172
2578
  call_metadata = @config.rpcs.list_assets.metadata.to_h
2173
2579
 
2174
- # Set x-goog-api-client and x-goog-user-project headers
2580
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2175
2581
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2176
2582
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2177
2583
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
2178
2584
  transports_version_send: [:rest]
2179
2585
 
2586
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2180
2587
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2181
2588
 
2182
2589
  options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
@@ -2250,12 +2657,13 @@ module Google
2250
2657
  # Customize the options with defaults
2251
2658
  call_metadata = @config.rpcs.get_pool.metadata.to_h
2252
2659
 
2253
- # Set x-goog-api-client and x-goog-user-project headers
2660
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2254
2661
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2255
2662
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2256
2663
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
2257
2664
  transports_version_send: [:rest]
2258
2665
 
2666
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2259
2667
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2260
2668
 
2261
2669
  options.apply_defaults timeout: @config.rpcs.get_pool.timeout,
@@ -2357,12 +2765,13 @@ module Google
2357
2765
  # Customize the options with defaults
2358
2766
  call_metadata = @config.rpcs.update_pool.metadata.to_h
2359
2767
 
2360
- # Set x-goog-api-client and x-goog-user-project headers
2768
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2361
2769
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2362
2770
  lib_name: @config.lib_name, lib_version: @config.lib_version,
2363
2771
  gapic_version: ::Google::Cloud::Video::LiveStream::V1::VERSION,
2364
2772
  transports_version_send: [:rest]
2365
2773
 
2774
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2366
2775
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2367
2776
 
2368
2777
  options.apply_defaults timeout: @config.rpcs.update_pool.timeout,
@@ -2603,6 +3012,26 @@ module Google
2603
3012
  #
2604
3013
  attr_reader :delete_event
2605
3014
  ##
3015
+ # RPC-specific configuration for `list_clips`
3016
+ # @return [::Gapic::Config::Method]
3017
+ #
3018
+ attr_reader :list_clips
3019
+ ##
3020
+ # RPC-specific configuration for `get_clip`
3021
+ # @return [::Gapic::Config::Method]
3022
+ #
3023
+ attr_reader :get_clip
3024
+ ##
3025
+ # RPC-specific configuration for `create_clip`
3026
+ # @return [::Gapic::Config::Method]
3027
+ #
3028
+ attr_reader :create_clip
3029
+ ##
3030
+ # RPC-specific configuration for `delete_clip`
3031
+ # @return [::Gapic::Config::Method]
3032
+ #
3033
+ attr_reader :delete_clip
3034
+ ##
2606
3035
  # RPC-specific configuration for `create_asset`
2607
3036
  # @return [::Gapic::Config::Method]
2608
3037
  #
@@ -2667,6 +3096,14 @@ module Google
2667
3096
  @get_event = ::Gapic::Config::Method.new get_event_config
2668
3097
  delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event
2669
3098
  @delete_event = ::Gapic::Config::Method.new delete_event_config
3099
+ list_clips_config = parent_rpcs.list_clips if parent_rpcs.respond_to? :list_clips
3100
+ @list_clips = ::Gapic::Config::Method.new list_clips_config
3101
+ get_clip_config = parent_rpcs.get_clip if parent_rpcs.respond_to? :get_clip
3102
+ @get_clip = ::Gapic::Config::Method.new get_clip_config
3103
+ create_clip_config = parent_rpcs.create_clip if parent_rpcs.respond_to? :create_clip
3104
+ @create_clip = ::Gapic::Config::Method.new create_clip_config
3105
+ delete_clip_config = parent_rpcs.delete_clip if parent_rpcs.respond_to? :delete_clip
3106
+ @delete_clip = ::Gapic::Config::Method.new delete_clip_config
2670
3107
  create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset
2671
3108
  @create_asset = ::Gapic::Config::Method.new create_asset_config
2672
3109
  delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset