mux_ruby 1.0.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +3 -0
  4. data/docs/Asset.md +1 -0
  5. data/docs/AssetsApi.md +103 -0
  6. data/docs/CreateAssetRequest.md +2 -0
  7. data/docs/CreateLiveStreamRequest.md +3 -0
  8. data/docs/CreateSimulcastTargetRequest.md +10 -0
  9. data/docs/CreateTrackRequest.md +14 -0
  10. data/docs/CreateTrackResponse.md +8 -0
  11. data/docs/DeliveryReport.md +14 -0
  12. data/docs/DeliveryUsageApi.md +68 -0
  13. data/docs/GetMetricTimeseriesDataResponse.md +1 -1
  14. data/docs/GetOverallValuesResponse.md +1 -1
  15. data/docs/InputSettings.md +6 -1
  16. data/docs/InputTrack.md +0 -2
  17. data/docs/Insight.md +2 -2
  18. data/docs/ListAllMetricValuesResponse.md +1 -1
  19. data/docs/ListBreakdownValuesResponse.md +1 -1
  20. data/docs/ListDeliveryUsageResponse.md +11 -0
  21. data/docs/ListErrorsResponse.md +1 -1
  22. data/docs/ListExportsResponse.md +1 -1
  23. data/docs/ListFilterValuesResponse.md +1 -1
  24. data/docs/ListFiltersResponse.md +1 -1
  25. data/docs/ListInsightsResponse.md +1 -1
  26. data/docs/ListVideoViewsResponse.md +1 -1
  27. data/docs/LiveStream.md +2 -0
  28. data/docs/LiveStreamsApi.md +161 -0
  29. data/docs/SigningKeyResponse.md +1 -1
  30. data/docs/SimulcastTarget.md +12 -0
  31. data/docs/SimulcastTargetResponse.md +8 -0
  32. data/docs/Track.md +5 -2
  33. data/docs/VideoViewResponse.md +1 -1
  34. data/examples/data/exercise-errors.rb +1 -1
  35. data/examples/data/exercise-metrics.rb +0 -7
  36. data/examples/video/exercise-assets.rb +17 -1
  37. data/examples/video/exercise-delivery-usage.rb +23 -0
  38. data/examples/video/exercise-live-streams.rb +28 -1
  39. data/lib/mux_ruby/api/assets_api.rb +113 -0
  40. data/lib/mux_ruby/api/delivery_usage_api.rb +75 -0
  41. data/lib/mux_ruby/api/live_streams_api.rb +176 -0
  42. data/lib/mux_ruby/api_client.rb +1 -1
  43. data/lib/mux_ruby/models/asset.rb +12 -1
  44. data/lib/mux_ruby/models/create_asset_request.rb +37 -4
  45. data/lib/mux_ruby/models/create_live_stream_request.rb +57 -4
  46. data/lib/mux_ruby/models/create_simulcast_target_request.rb +210 -0
  47. data/lib/mux_ruby/models/create_track_request.rb +304 -0
  48. data/lib/mux_ruby/models/create_track_response.rb +184 -0
  49. data/lib/mux_ruby/models/delivery_report.rb +238 -0
  50. data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +1 -1
  51. data/lib/mux_ruby/models/get_overall_values_response.rb +1 -1
  52. data/lib/mux_ruby/models/input_settings.rb +104 -13
  53. data/lib/mux_ruby/models/input_track.rb +4 -22
  54. data/lib/mux_ruby/models/insight.rb +2 -2
  55. data/lib/mux_ruby/models/list_all_metric_values_response.rb +1 -1
  56. data/lib/mux_ruby/models/list_breakdown_values_response.rb +1 -1
  57. data/lib/mux_ruby/models/list_delivery_usage_response.rb +216 -0
  58. data/lib/mux_ruby/models/list_errors_response.rb +1 -1
  59. data/lib/mux_ruby/models/list_exports_response.rb +1 -1
  60. data/lib/mux_ruby/models/list_filter_values_response.rb +1 -1
  61. data/lib/mux_ruby/models/list_filters_response.rb +1 -1
  62. data/lib/mux_ruby/models/list_insights_response.rb +1 -1
  63. data/lib/mux_ruby/models/list_video_views_response.rb +1 -1
  64. data/lib/mux_ruby/models/live_stream.rb +24 -4
  65. data/lib/mux_ruby/models/simulcast_target.rb +259 -0
  66. data/lib/mux_ruby/models/simulcast_target_response.rb +184 -0
  67. data/lib/mux_ruby/models/track.rb +86 -13
  68. data/lib/mux_ruby/models/video_view_response.rb +1 -1
  69. data/lib/mux_ruby/version.rb +1 -1
  70. data/lib/mux_ruby.rb +8 -0
  71. data/spec/api/assets_api_spec.rb +24 -0
  72. data/spec/api/delivery_usage_api_spec.rb +43 -0
  73. data/spec/api/live_streams_api_spec.rb +39 -0
  74. data/spec/models/asset_spec.rb +6 -0
  75. data/spec/models/create_asset_request_spec.rb +16 -0
  76. data/spec/models/create_live_stream_request_spec.rb +18 -0
  77. data/spec/models/create_simulcast_target_request_spec.rb +46 -0
  78. data/spec/models/create_track_request_spec.rb +78 -0
  79. data/spec/models/create_track_response_spec.rb +34 -0
  80. data/spec/models/delivery_report_spec.rb +70 -0
  81. data/spec/models/input_settings_spec.rb +40 -2
  82. data/spec/models/input_track_spec.rb +0 -12
  83. data/spec/models/list_delivery_usage_response_spec.rb +52 -0
  84. data/spec/models/live_stream_spec.rb +12 -0
  85. data/spec/models/simulcast_target_response_spec.rb +34 -0
  86. data/spec/models/simulcast_target_spec.rb +62 -0
  87. data/spec/models/track_spec.rb +28 -2
  88. metadata +36 -3
@@ -0,0 +1,12 @@
1
+ # MuxRuby::SimulcastTarget
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **String** | ID of the Simulcast Target | [optional]
7
+ **passthrough** | **String** | Arbitrary Metadata set when creating a simulcast target. | [optional]
8
+ **status** | **String** | The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. Compared to other errored statuses in the Mux Video API, a simulcast may transition back into the broadcasting state if a connection with the service can be re-established. | [optional]
9
+ **stream_key** | **String** | Stream Key represents an stream identifier for the third party live streaming service to simulcast the parent live stream too. | [optional]
10
+ **url** | **String** | RTMP hostname including the application name for the third party live streaming service. | [optional]
11
+
12
+
@@ -0,0 +1,8 @@
1
+ # MuxRuby::SimulcastTargetResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **data** | [**SimulcastTarget**](.md) | | [optional]
7
+
8
+
data/docs/Track.md CHANGED
@@ -11,7 +11,10 @@ Name | Type | Description | Notes
11
11
  **max_frame_rate** | **Float** | | [optional]
12
12
  **max_channels** | **Integer** | | [optional]
13
13
  **max_channel_layout** | **String** | | [optional]
14
- **text_track_type** | **String** | | [optional]
15
- **language** | **String** | | [optional]
14
+ **text_type** | **String** | | [optional]
15
+ **language_code** | **String** | | [optional]
16
+ **name** | **String** | | [optional]
17
+ **closed_captions** | **BOOLEAN** | | [optional]
18
+ **passthrough** | **String** | | [optional]
16
19
 
17
20
 
@@ -4,6 +4,6 @@
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **data** | [**VideoView**](.md) | | [optional]
7
- **timeframe** | **Array<String>** | | [optional]
7
+ **timeframe** | **Array<Integer>** | | [optional]
8
8
 
9
9
 
@@ -15,7 +15,7 @@ end
15
15
  errors_api = MuxRuby::ErrorsApi.new
16
16
 
17
17
  # ========== list-errors ==========
18
- errors = errors_api.list_errors(:filters => ['browser:Firefox'], :timeframe => ['7:days'])
18
+ errors = errors_api.list_errors(:filters => ['browser:Chrome'], :timeframe => ['7:days'])
19
19
  assert errors != nil
20
20
  assert errors.data != nil
21
21
  assert errors.data.length > 0
@@ -5,13 +5,6 @@ require 'solid_assert'
5
5
 
6
6
  SolidAssert.enable_assertions
7
7
 
8
- # Exercises all asset operations:
9
- # list-breakdown-values
10
- # get-overall-values
11
- # list-insights
12
- # get-metric-timeseries-data
13
- # list-all-metric-values
14
-
15
8
  # Authentication Setup
16
9
  openapi = MuxRuby.configure do |config|
17
10
  config.username = ENV['MUX_TOKEN_ID']
@@ -16,7 +16,7 @@ assets_api = MuxRuby::AssetsApi.new
16
16
 
17
17
  # ========== create-asset ==========
18
18
  car = MuxRuby::CreateAssetRequest.new
19
- car.input = 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4'
19
+ car.input = [{:url => 'https://storage.googleapis.com/muxdemofiles/mux-video-intro.mp4'}, {:url => "https://tears-of-steel-subtitles.s3.amazonaws.com/tears-fr.vtt", :type => "text", :text_type => "subtitles", :name => "French", :language_code => "fr", :closed_captions => false}]
20
20
  create_response = assets_api.create_asset(car)
21
21
  assert create_response != nil
22
22
  assert create_response.data.id != nil
@@ -77,6 +77,22 @@ assert mp4_asset.data.id == create_response.data.id
77
77
  assert mp4_asset.data.mp4_support == 'standard'
78
78
  puts "update-asset-mp4-support OK ✅"
79
79
 
80
+ # ========== create-asset-track ==========
81
+ cat = MuxRuby::CreateTrackRequest.new(:url => "https://tears-of-steel-subtitles.s3.amazonaws.com/tears-en.vtt", :type => "text", :text_type => "subtitles", :language_code => "en", :name => "English", :closed_captions => false)
82
+ subtitles_track = assets_api.create_asset_track(create_response.data.id, cat)
83
+ assert subtitles_track != nil
84
+ assert subtitles_track.data.id != nil
85
+ assert subtitles_track.data.name == 'English'
86
+ asset_with_2_captions = assets_api.get_asset(create_response.data.id)
87
+ assert asset_with_2_captions.data.tracks.length == 4 # Audio, Video, French that we ingested with the asset, and the English we added here!
88
+ puts "create-asset-track OK ✅"
89
+
90
+ # ========== delete-asset-track ==========
91
+ assets_api.delete_asset_track(create_response.data.id, subtitles_track.data.id)
92
+ asset_with_1_captions = assets_api.get_asset(create_response.data.id)
93
+ assert asset_with_1_captions.data.tracks.length == 3 # Audio, Video, French that we ingested with the asset
94
+ puts "delete-asset-track OK ✅"
95
+
80
96
  # ========== delete-asset-playback-id ==========
81
97
  assets_api.delete_asset_playback_id(create_response.data.id, pb_id_c.data.id)
82
98
  deleted_playback_id_asset = assets_api.get_asset(create_response.data.id)
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mux_ruby'
4
+ require 'solid_assert'
5
+
6
+ SolidAssert.enable_assertions
7
+
8
+ # Authentication Setup
9
+ openapi = MuxRuby.configure do |config|
10
+ config.username = ENV['MUX_TOKEN_ID']
11
+ config.password = ENV['MUX_TOKEN_SECRET']
12
+ end
13
+
14
+ # API Client Initialization
15
+ usage_api = MuxRuby::DeliveryUsageApi.new
16
+
17
+ # ========== list-delivery-usage ==========
18
+ # Example with a valid timeframe:
19
+ # usage = usage_api.list_delivery_usage({:timeframe => ['1574175600', '1574305200']})
20
+ usage = usage_api.list_delivery_usage()
21
+ assert usage != nil
22
+ assert usage.data != nil
23
+ puts "list-delivery-usage OK ✅"
@@ -20,6 +20,7 @@ create_asset_request.playback_policy = [MuxRuby::PlaybackPolicy::PUBLIC]
20
20
  create_live_stream_request = MuxRuby::CreateLiveStreamRequest.new
21
21
  create_live_stream_request.new_asset_settings = create_asset_request
22
22
  create_live_stream_request.playback_policy = [MuxRuby::PlaybackPolicy::PUBLIC]
23
+ create_live_stream_request.reduced_latency = true
23
24
  stream = live_api.create_live_stream(create_live_stream_request)
24
25
  assert stream != nil
25
26
  assert stream.data != nil
@@ -40,6 +41,32 @@ assert stream_get.data != nil
40
41
  assert stream_get.data.id == stream.data.id
41
42
  puts "get-live-stream OK ✅"
42
43
 
44
+ # ========== create-live-stream-simulcast-target ==========
45
+ create_simulcast_target = MuxRuby::CreateSimulcastTargetRequest.new
46
+ create_simulcast_target.passthrough = 'foo'
47
+ create_simulcast_target.stream_key = 'bar'
48
+ create_simulcast_target.url = 'rtmp://dontforgettolikeand.subscribe'
49
+ target = live_api.create_live_stream_simulcast_target(stream.data.id, create_simulcast_target)
50
+ assert target != nil
51
+ assert target.data != nil
52
+ puts "create-live-stream-simulcast-target OK ✅"
53
+
54
+ # ========== get-live-stream-simulcast-target ==========
55
+ target_get = live_api.get_live_stream_simulcast_target(stream.data.id, target.data.id)
56
+ assert target_get != nil
57
+ assert target_get.data != nil
58
+ assert target.data.id == target_get.data.id
59
+ puts "get-live-stream-simulcast-target OK ✅"
60
+
61
+ # ========== delete-live-stream-simulcast-target ==========
62
+ live_api.delete_live_stream_simulcast_target(stream.data.id, target.data.id)
63
+ puts "delete-live-stream-simulcast-target OK ✅"
64
+ stream_no_target = live_api.get_live_stream(stream.data.id)
65
+ assert stream_no_target != nil
66
+ assert stream_no_target.data != nil
67
+ assert stream_no_target.data.simulcast_targets == nil
68
+ puts "delete-live-stream-simulcast-target OK ✅"
69
+
43
70
  # ========== create-live-stream-playback-id ==========
44
71
  create_playback_id_request = MuxRuby::CreatePlaybackIDRequest.new
45
72
  create_playback_id_request.policy = MuxRuby::PlaybackPolicy::SIGNED
@@ -66,7 +93,7 @@ assert reset_key != nil
66
93
  assert reset_key.data != nil
67
94
  assert reset_key.data.id == stream.data.id
68
95
  assert reset_key.data.stream_key != stream.data.stream_key
69
- puts "delete-live-stream-playback-id OK ✅"
96
+ puts "reset-stream-key OK ✅"
70
97
 
71
98
  # ========== signal-live-stream-complete ==========
72
99
  begin
@@ -126,6 +126,65 @@ module MuxRuby
126
126
  return data, status_code, headers
127
127
  end
128
128
 
129
+ # Create an asset track
130
+ # @param asset_id The asset ID.
131
+ # @param create_track_request
132
+ # @param [Hash] opts the optional parameters
133
+ # @return [CreateTrackResponse]
134
+ def create_asset_track(asset_id, create_track_request, opts = {})
135
+ data, _status_code, _headers = create_asset_track_with_http_info(asset_id, create_track_request, opts)
136
+ data
137
+ end
138
+
139
+ # Create an asset track
140
+ # @param asset_id The asset ID.
141
+ # @param create_track_request
142
+ # @param [Hash] opts the optional parameters
143
+ # @return [Array<(CreateTrackResponse, Fixnum, Hash)>] CreateTrackResponse data, response status code and response headers
144
+ def create_asset_track_with_http_info(asset_id, create_track_request, opts = {})
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug 'Calling API: AssetsApi.create_asset_track ...'
147
+ end
148
+ # verify the required parameter 'asset_id' is set
149
+ if @api_client.config.client_side_validation && asset_id.nil?
150
+ fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.create_asset_track"
151
+ end
152
+ # verify the required parameter 'create_track_request' is set
153
+ if @api_client.config.client_side_validation && create_track_request.nil?
154
+ fail ArgumentError, "Missing the required parameter 'create_track_request' when calling AssetsApi.create_asset_track"
155
+ end
156
+ # resource path
157
+ local_var_path = '/video/v1/assets/{ASSET_ID}/tracks'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s)
158
+
159
+ # query parameters
160
+ query_params = {}
161
+
162
+ # header parameters
163
+ header_params = {}
164
+ # HTTP header 'Accept' (if needed)
165
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
166
+ # HTTP header 'Content-Type'
167
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
168
+
169
+ # form parameters
170
+ form_params = {}
171
+
172
+ # http body (model)
173
+ post_body = @api_client.object_to_http_body(create_track_request)
174
+ auth_names = ['accessToken']
175
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
176
+ :header_params => header_params,
177
+ :query_params => query_params,
178
+ :form_params => form_params,
179
+ :body => post_body,
180
+ :auth_names => auth_names,
181
+ :return_type => 'CreateTrackResponse')
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug "API called: AssetsApi#create_asset_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
+ end
185
+ return data, status_code, headers
186
+ end
187
+
129
188
  # Delete an asset
130
189
  # @param asset_id The asset ID.
131
190
  # @param [Hash] opts the optional parameters
@@ -228,6 +287,60 @@ module MuxRuby
228
287
  return data, status_code, headers
229
288
  end
230
289
 
290
+ # Delete an asset track
291
+ # @param asset_id The asset ID.
292
+ # @param track_id The track ID.
293
+ # @param [Hash] opts the optional parameters
294
+ # @return [nil]
295
+ def delete_asset_track(asset_id, track_id, opts = {})
296
+ delete_asset_track_with_http_info(asset_id, track_id, opts)
297
+ nil
298
+ end
299
+
300
+ # Delete an asset track
301
+ # @param asset_id The asset ID.
302
+ # @param track_id The track ID.
303
+ # @param [Hash] opts the optional parameters
304
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
305
+ def delete_asset_track_with_http_info(asset_id, track_id, opts = {})
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug 'Calling API: AssetsApi.delete_asset_track ...'
308
+ end
309
+ # verify the required parameter 'asset_id' is set
310
+ if @api_client.config.client_side_validation && asset_id.nil?
311
+ fail ArgumentError, "Missing the required parameter 'asset_id' when calling AssetsApi.delete_asset_track"
312
+ end
313
+ # verify the required parameter 'track_id' is set
314
+ if @api_client.config.client_side_validation && track_id.nil?
315
+ fail ArgumentError, "Missing the required parameter 'track_id' when calling AssetsApi.delete_asset_track"
316
+ end
317
+ # resource path
318
+ local_var_path = '/video/v1/assets/{ASSET_ID}/tracks/{TRACK_ID}'.sub('{' + 'ASSET_ID' + '}', asset_id.to_s).sub('{' + 'TRACK_ID' + '}', track_id.to_s)
319
+
320
+ # query parameters
321
+ query_params = {}
322
+
323
+ # header parameters
324
+ header_params = {}
325
+
326
+ # form parameters
327
+ form_params = {}
328
+
329
+ # http body (model)
330
+ post_body = nil
331
+ auth_names = ['accessToken']
332
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
333
+ :header_params => header_params,
334
+ :query_params => query_params,
335
+ :form_params => form_params,
336
+ :body => post_body,
337
+ :auth_names => auth_names)
338
+ if @api_client.config.debugging
339
+ @api_client.config.logger.debug "API called: AssetsApi#delete_asset_track\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
340
+ end
341
+ return data, status_code, headers
342
+ end
343
+
231
344
  # Retrieve an asset
232
345
  # Retrieves the details of an asset that has previously been created. Supply the unique asset ID that was returned from your previous request, and Mux will return the corresponding asset information. The same information is returned when creating an asset.
233
346
  # @param asset_id The asset ID.
@@ -0,0 +1,75 @@
1
+ =begin
2
+ # Mux Ruby - Copyright 2019 Mux Inc.
3
+ # NOTE: This file is auto generated. Do not edit this file manually.
4
+ =end
5
+
6
+ require 'uri'
7
+
8
+ module MuxRuby
9
+ class DeliveryUsageApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = ApiClient.default)
13
+ @api_client = api_client
14
+ end
15
+ # List Usage
16
+ # Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs.
17
+ # @param [Hash] opts the optional parameters
18
+ # @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60; (default to 1)
19
+ # @option opts [Integer] :limit Number of items to include in the response (default to 100)
20
+ # @option opts [String] :asset_id Filter response to return delivery usage for this asset only.
21
+ # @option opts [Array<String>] :timeframe Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made.
22
+ # @return [ListDeliveryUsageResponse]
23
+ def list_delivery_usage(opts = {})
24
+ data, _status_code, _headers = list_delivery_usage_with_http_info(opts)
25
+ data
26
+ end
27
+
28
+ # List Usage
29
+ # Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs.
30
+ # @param [Hash] opts the optional parameters
31
+ # @option opts [Integer] :page Offset by this many pages, of the size of &#x60;limit&#x60;
32
+ # @option opts [Integer] :limit Number of items to include in the response
33
+ # @option opts [String] :asset_id Filter response to return delivery usage for this asset only.
34
+ # @option opts [Array<String>] :timeframe Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made.
35
+ # @return [Array<(ListDeliveryUsageResponse, Fixnum, Hash)>] ListDeliveryUsageResponse data, response status code and response headers
36
+ def list_delivery_usage_with_http_info(opts = {})
37
+ if @api_client.config.debugging
38
+ @api_client.config.logger.debug 'Calling API: DeliveryUsageApi.list_delivery_usage ...'
39
+ end
40
+ # resource path
41
+ local_var_path = '/video/v1/delivery-usage'
42
+
43
+ # query parameters
44
+ query_params = {}
45
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
46
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
47
+ query_params[:'asset_id'] = opts[:'asset_id'] if !opts[:'asset_id'].nil?
48
+ query_params[:'timeframe[]'] = @api_client.build_collection_param(opts[:'timeframe'], :multi) if !opts[:'timeframe'].nil?
49
+
50
+ # header parameters
51
+ header_params = {}
52
+ # HTTP header 'Accept' (if needed)
53
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
54
+
55
+ # form parameters
56
+ form_params = {}
57
+
58
+ # http body (model)
59
+ post_body = nil
60
+ auth_names = ['accessToken']
61
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
62
+ :header_params => header_params,
63
+ :query_params => query_params,
64
+ :form_params => form_params,
65
+ :body => post_body,
66
+ :auth_names => auth_names,
67
+ :return_type => 'ListDeliveryUsageResponse')
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug "API called: DeliveryUsageApi#list_delivery_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
70
+ end
71
+ return data, status_code, headers
72
+ end
73
+
74
+ end
75
+ end
@@ -124,6 +124,67 @@ module MuxRuby
124
124
  return data, status_code, headers
125
125
  end
126
126
 
127
+ # Create a live stream simulcast target
128
+ # Create a simulcast target for the parent live stream. Simulcast target can only be created when the parent live stream is in idle state. Only one simulcast target can be created at a time with this API.
129
+ # @param live_stream_id The live stream ID
130
+ # @param create_simulcast_target_request
131
+ # @param [Hash] opts the optional parameters
132
+ # @return [SimulcastTargetResponse]
133
+ def create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request, opts = {})
134
+ data, _status_code, _headers = create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, opts)
135
+ data
136
+ end
137
+
138
+ # Create a live stream simulcast target
139
+ # Create a simulcast target for the parent live stream. Simulcast target can only be created when the parent live stream is in idle state. Only one simulcast target can be created at a time with this API.
140
+ # @param live_stream_id The live stream ID
141
+ # @param create_simulcast_target_request
142
+ # @param [Hash] opts the optional parameters
143
+ # @return [Array<(SimulcastTargetResponse, Fixnum, Hash)>] SimulcastTargetResponse data, response status code and response headers
144
+ def create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, opts = {})
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug 'Calling API: LiveStreamsApi.create_live_stream_simulcast_target ...'
147
+ end
148
+ # verify the required parameter 'live_stream_id' is set
149
+ if @api_client.config.client_side_validation && live_stream_id.nil?
150
+ fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.create_live_stream_simulcast_target"
151
+ end
152
+ # verify the required parameter 'create_simulcast_target_request' is set
153
+ if @api_client.config.client_side_validation && create_simulcast_target_request.nil?
154
+ fail ArgumentError, "Missing the required parameter 'create_simulcast_target_request' when calling LiveStreamsApi.create_live_stream_simulcast_target"
155
+ end
156
+ # resource path
157
+ local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets'.sub('{' + 'LIVE_STREAM_ID' + '}', live_stream_id.to_s)
158
+
159
+ # query parameters
160
+ query_params = {}
161
+
162
+ # header parameters
163
+ header_params = {}
164
+ # HTTP header 'Accept' (if needed)
165
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
166
+ # HTTP header 'Content-Type'
167
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
168
+
169
+ # form parameters
170
+ form_params = {}
171
+
172
+ # http body (model)
173
+ post_body = @api_client.object_to_http_body(create_simulcast_target_request)
174
+ auth_names = ['accessToken']
175
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
176
+ :header_params => header_params,
177
+ :query_params => query_params,
178
+ :form_params => form_params,
179
+ :body => post_body,
180
+ :auth_names => auth_names,
181
+ :return_type => 'SimulcastTargetResponse')
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug "API called: LiveStreamsApi#create_live_stream_simulcast_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
+ end
185
+ return data, status_code, headers
186
+ end
187
+
127
188
  # Delete a live stream
128
189
  # @param live_stream_id The live stream ID
129
190
  # @param [Hash] opts the optional parameters
@@ -226,6 +287,62 @@ module MuxRuby
226
287
  return data, status_code, headers
227
288
  end
228
289
 
290
+ # Delete a Live Stream Simulcast Target
291
+ # Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state.
292
+ # @param live_stream_id The live stream ID
293
+ # @param simulcast_target_id The ID of the simulcast target.
294
+ # @param [Hash] opts the optional parameters
295
+ # @return [nil]
296
+ def delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id, opts = {})
297
+ delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts)
298
+ nil
299
+ end
300
+
301
+ # Delete a Live Stream Simulcast Target
302
+ # Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state.
303
+ # @param live_stream_id The live stream ID
304
+ # @param simulcast_target_id The ID of the simulcast target.
305
+ # @param [Hash] opts the optional parameters
306
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
307
+ def delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts = {})
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug 'Calling API: LiveStreamsApi.delete_live_stream_simulcast_target ...'
310
+ end
311
+ # verify the required parameter 'live_stream_id' is set
312
+ if @api_client.config.client_side_validation && live_stream_id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.delete_live_stream_simulcast_target"
314
+ end
315
+ # verify the required parameter 'simulcast_target_id' is set
316
+ if @api_client.config.client_side_validation && simulcast_target_id.nil?
317
+ fail ArgumentError, "Missing the required parameter 'simulcast_target_id' when calling LiveStreamsApi.delete_live_stream_simulcast_target"
318
+ end
319
+ # resource path
320
+ local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', live_stream_id.to_s).sub('{' + 'SIMULCAST_TARGET_ID' + '}', simulcast_target_id.to_s)
321
+
322
+ # query parameters
323
+ query_params = {}
324
+
325
+ # header parameters
326
+ header_params = {}
327
+
328
+ # form parameters
329
+ form_params = {}
330
+
331
+ # http body (model)
332
+ post_body = nil
333
+ auth_names = ['accessToken']
334
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
335
+ :header_params => header_params,
336
+ :query_params => query_params,
337
+ :form_params => form_params,
338
+ :body => post_body,
339
+ :auth_names => auth_names)
340
+ if @api_client.config.debugging
341
+ @api_client.config.logger.debug "API called: LiveStreamsApi#delete_live_stream_simulcast_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
342
+ end
343
+ return data, status_code, headers
344
+ end
345
+
229
346
  # Retrieve a live stream
230
347
  # Retrieves the details of a live stream that has previously been created. Supply the unique live stream ID that was returned from your previous request, and Mux will return the corresponding live stream information. The same information is returned when creating a live stream.
231
348
  # @param live_stream_id The live stream ID
@@ -279,6 +396,65 @@ module MuxRuby
279
396
  return data, status_code, headers
280
397
  end
281
398
 
399
+ # Retrieve a Live Stream Simulcast Target
400
+ # Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information.
401
+ # @param live_stream_id The live stream ID
402
+ # @param simulcast_target_id The ID of the simulcast target.
403
+ # @param [Hash] opts the optional parameters
404
+ # @return [SimulcastTargetResponse]
405
+ def get_live_stream_simulcast_target(live_stream_id, simulcast_target_id, opts = {})
406
+ data, _status_code, _headers = get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts)
407
+ data
408
+ end
409
+
410
+ # Retrieve a Live Stream Simulcast Target
411
+ # Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information.
412
+ # @param live_stream_id The live stream ID
413
+ # @param simulcast_target_id The ID of the simulcast target.
414
+ # @param [Hash] opts the optional parameters
415
+ # @return [Array<(SimulcastTargetResponse, Fixnum, Hash)>] SimulcastTargetResponse data, response status code and response headers
416
+ def get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts = {})
417
+ if @api_client.config.debugging
418
+ @api_client.config.logger.debug 'Calling API: LiveStreamsApi.get_live_stream_simulcast_target ...'
419
+ end
420
+ # verify the required parameter 'live_stream_id' is set
421
+ if @api_client.config.client_side_validation && live_stream_id.nil?
422
+ fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.get_live_stream_simulcast_target"
423
+ end
424
+ # verify the required parameter 'simulcast_target_id' is set
425
+ if @api_client.config.client_side_validation && simulcast_target_id.nil?
426
+ fail ArgumentError, "Missing the required parameter 'simulcast_target_id' when calling LiveStreamsApi.get_live_stream_simulcast_target"
427
+ end
428
+ # resource path
429
+ local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', live_stream_id.to_s).sub('{' + 'SIMULCAST_TARGET_ID' + '}', simulcast_target_id.to_s)
430
+
431
+ # query parameters
432
+ query_params = {}
433
+
434
+ # header parameters
435
+ header_params = {}
436
+ # HTTP header 'Accept' (if needed)
437
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
438
+
439
+ # form parameters
440
+ form_params = {}
441
+
442
+ # http body (model)
443
+ post_body = nil
444
+ auth_names = ['accessToken']
445
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
446
+ :header_params => header_params,
447
+ :query_params => query_params,
448
+ :form_params => form_params,
449
+ :body => post_body,
450
+ :auth_names => auth_names,
451
+ :return_type => 'SimulcastTargetResponse')
452
+ if @api_client.config.debugging
453
+ @api_client.config.logger.debug "API called: LiveStreamsApi#get_live_stream_simulcast_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
454
+ end
455
+ return data, status_code, headers
456
+ end
457
+
282
458
  # List live streams
283
459
  # @param [Hash] opts the optional parameters
284
460
  # @option opts [Integer] :limit Number of items to include in the response (default to 25)
@@ -69,7 +69,7 @@ module MuxRuby
69
69
  :response_headers => response.headers,
70
70
  :response_body => response.body),
71
71
  response.status_message
72
- elsif 500 <= response.code <= 599
72
+ elsif response.code.between?(500, 599)
73
73
  fail ServiceError.new(:code => response.code,
74
74
  :response_headers => response.headers,
75
75
  :response_body => response.body),
@@ -45,6 +45,8 @@ module MuxRuby
45
45
 
46
46
  attr_accessor :mp4_support
47
47
 
48
+ attr_accessor :normalize_audio
49
+
48
50
  attr_accessor :static_renditions
49
51
 
50
52
  class EnumAttributeValidator
@@ -91,6 +93,7 @@ module MuxRuby
91
93
  :'master' => :'master',
92
94
  :'master_access' => :'master_access',
93
95
  :'mp4_support' => :'mp4_support',
96
+ :'normalize_audio' => :'normalize_audio',
94
97
  :'static_renditions' => :'static_renditions'
95
98
  }
96
99
  end
@@ -117,6 +120,7 @@ module MuxRuby
117
120
  :'master' => :'AssetMaster',
118
121
  :'master_access' => :'String',
119
122
  :'mp4_support' => :'String',
123
+ :'normalize_audio' => :'BOOLEAN',
120
124
  :'static_renditions' => :'AssetStaticRenditions'
121
125
  }
122
126
  end
@@ -213,6 +217,12 @@ module MuxRuby
213
217
  self.mp4_support = 'none'
214
218
  end
215
219
 
220
+ if attributes.has_key?(:'normalize_audio')
221
+ self.normalize_audio = attributes[:'normalize_audio']
222
+ else
223
+ self.normalize_audio = false
224
+ end
225
+
216
226
  if attributes.has_key?(:'static_renditions')
217
227
  self.static_renditions = attributes[:'static_renditions']
218
228
  end
@@ -279,6 +289,7 @@ module MuxRuby
279
289
  master == o.master &&
280
290
  master_access == o.master_access &&
281
291
  mp4_support == o.mp4_support &&
292
+ normalize_audio == o.normalize_audio &&
282
293
  static_renditions == o.static_renditions
283
294
  end
284
295
 
@@ -291,7 +302,7 @@ module MuxRuby
291
302
  # Calculates hash code according to all attributes.
292
303
  # @return [Fixnum] Hash code
293
304
  def hash
294
- [id, created_at, deleted_at, status, duration, max_stored_resolution, max_stored_frame_rate, aspect_ratio, playback_ids, tracks, demo, errors, per_title_encode, is_live, passthrough, live_stream_id, master, master_access, mp4_support, static_renditions].hash
305
+ [id, created_at, deleted_at, status, duration, max_stored_resolution, max_stored_frame_rate, aspect_ratio, playback_ids, tracks, demo, errors, per_title_encode, is_live, passthrough, live_stream_id, master, master_access, mp4_support, normalize_audio, static_renditions].hash
295
306
  end
296
307
 
297
308
  # Builds the object from hash