mux_ruby 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +4 -4
  4. data/docs/AssetNonStandardInputReasons.md +2 -0
  5. data/docs/AssetsApi.md +2 -0
  6. data/docs/CreateLiveStreamRequest.md +4 -0
  7. data/docs/ExportsApi.md +1 -1
  8. data/docs/FiltersApi.md +2 -2
  9. data/docs/GetLiveStreamPlaybackIDResponse.md +18 -0
  10. data/docs/LiveStream.md +2 -0
  11. data/docs/LiveStreamEmbeddedSubtitleSettings.md +24 -0
  12. data/docs/LiveStreamsApi.md +144 -0
  13. data/docs/RealTimeApi.md +2 -2
  14. data/docs/RealTimeBreakdownValue.md +2 -2
  15. data/docs/RealTimeTimeseriesDatapoint.md +2 -2
  16. data/docs/UpdateLiveStreamEmbeddedSubtitlesRequest.md +18 -0
  17. data/examples/data/exercise-errors.rb +1 -2
  18. data/examples/video/exercise-assets.rb +1 -0
  19. data/gen/generator-config.json +2 -1
  20. data/gen/templates/gemspec.mustache +1 -0
  21. data/lib/mux_ruby/api/assets_api.rb +2 -0
  22. data/lib/mux_ruby/api/exports_api.rb +2 -2
  23. data/lib/mux_ruby/api/filters_api.rb +4 -4
  24. data/lib/mux_ruby/api/live_streams_api.rb +138 -0
  25. data/lib/mux_ruby/api/real_time_api.rb +4 -4
  26. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +23 -1
  27. data/lib/mux_ruby/models/create_live_stream_request.rb +23 -1
  28. data/lib/mux_ruby/models/get_live_stream_playback_id_response.rb +218 -0
  29. data/lib/mux_ruby/models/live_stream.rb +11 -1
  30. data/lib/mux_ruby/models/live_stream_embedded_subtitle_settings.rb +287 -0
  31. data/lib/mux_ruby/models/real_time_breakdown_value.rb +7 -7
  32. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +7 -7
  33. data/lib/mux_ruby/models/track.rb +0 -12
  34. data/lib/mux_ruby/models/update_live_stream_embedded_subtitles_request.rb +221 -0
  35. data/lib/mux_ruby/version.rb +1 -1
  36. data/lib/mux_ruby.rb +3 -0
  37. data/mux_ruby.gemspec +1 -0
  38. data/spec/models/get_live_stream_playback_id_response_spec.rb +34 -0
  39. data/spec/models/live_stream_embedded_subtitle_settings_spec.rb +56 -0
  40. data/spec/models/update_live_stream_embedded_subtitles_request_spec.rb +34 -0
  41. metadata +106 -93
@@ -602,6 +602,73 @@ module MuxRuby
602
602
  return data, status_code, headers
603
603
  end
604
604
 
605
+ # Retrieve a live stream playback ID
606
+ # @param live_stream_id [String] The live stream ID
607
+ # @param playback_id [String] The live stream's playback ID.
608
+ # @param [Hash] opts the optional parameters
609
+ # @return [GetLiveStreamPlaybackIDResponse]
610
+ def get_live_stream_playback_id(live_stream_id, playback_id, opts = {})
611
+ data, _status_code, _headers = get_live_stream_playback_id_with_http_info(live_stream_id, playback_id, opts)
612
+ data
613
+ end
614
+
615
+ # Retrieve a live stream playback ID
616
+ # @param live_stream_id [String] The live stream ID
617
+ # @param playback_id [String] The live stream's playback ID.
618
+ # @param [Hash] opts the optional parameters
619
+ # @return [Array<(GetLiveStreamPlaybackIDResponse, Integer, Hash)>] GetLiveStreamPlaybackIDResponse data, response status code and response headers
620
+ def get_live_stream_playback_id_with_http_info(live_stream_id, playback_id, opts = {})
621
+ if @api_client.config.debugging
622
+ @api_client.config.logger.debug 'Calling API: LiveStreamsApi.get_live_stream_playback_id ...'
623
+ end
624
+ # verify the required parameter 'live_stream_id' is set
625
+ if @api_client.config.client_side_validation && live_stream_id.nil?
626
+ fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.get_live_stream_playback_id"
627
+ end
628
+ # verify the required parameter 'playback_id' is set
629
+ if @api_client.config.client_side_validation && playback_id.nil?
630
+ fail ArgumentError, "Missing the required parameter 'playback_id' when calling LiveStreamsApi.get_live_stream_playback_id"
631
+ end
632
+ # resource path
633
+ local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s)).sub('{' + 'PLAYBACK_ID' + '}', CGI.escape(playback_id.to_s))
634
+
635
+ # query parameters
636
+ query_params = opts[:query_params] || {}
637
+
638
+ # header parameters
639
+ header_params = opts[:header_params] || {}
640
+ # HTTP header 'Accept' (if needed)
641
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
642
+
643
+ # form parameters
644
+ form_params = opts[:form_params] || {}
645
+
646
+ # http body (model)
647
+ post_body = opts[:debug_body]
648
+
649
+ # return_type
650
+ return_type = opts[:debug_return_type] || 'GetLiveStreamPlaybackIDResponse'
651
+
652
+ # auth_names
653
+ auth_names = opts[:debug_auth_names] || ['accessToken']
654
+
655
+ new_options = opts.merge(
656
+ :operation => :"LiveStreamsApi.get_live_stream_playback_id",
657
+ :header_params => header_params,
658
+ :query_params => query_params,
659
+ :form_params => form_params,
660
+ :body => post_body,
661
+ :auth_names => auth_names,
662
+ :return_type => return_type
663
+ )
664
+
665
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
666
+ if @api_client.config.debugging
667
+ @api_client.config.logger.debug "API called: LiveStreamsApi#get_live_stream_playback_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
668
+ end
669
+ return data, status_code, headers
670
+ end
671
+
605
672
  # Retrieve a Live Stream Simulcast Target
606
673
  # 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.
607
674
  # @param live_stream_id [String] The live stream ID
@@ -860,5 +927,76 @@ module MuxRuby
860
927
  end
861
928
  return data, status_code, headers
862
929
  end
930
+
931
+ # Update a live stream's embedded subtitles
932
+ # Configures a live stream to receive embedded closed captions. The resulting Asset's subtitle text track will have `closed_captions: true` set.
933
+ # @param live_stream_id [String] The live stream ID
934
+ # @param update_live_stream_embedded_subtitles_request [UpdateLiveStreamEmbeddedSubtitlesRequest]
935
+ # @param [Hash] opts the optional parameters
936
+ # @return [LiveStreamResponse]
937
+ def update_live_stream_embedded_subtitles(live_stream_id, update_live_stream_embedded_subtitles_request, opts = {})
938
+ data, _status_code, _headers = update_live_stream_embedded_subtitles_with_http_info(live_stream_id, update_live_stream_embedded_subtitles_request, opts)
939
+ data
940
+ end
941
+
942
+ # Update a live stream&#39;s embedded subtitles
943
+ # Configures a live stream to receive embedded closed captions. The resulting Asset&#39;s subtitle text track will have &#x60;closed_captions: true&#x60; set.
944
+ # @param live_stream_id [String] The live stream ID
945
+ # @param update_live_stream_embedded_subtitles_request [UpdateLiveStreamEmbeddedSubtitlesRequest]
946
+ # @param [Hash] opts the optional parameters
947
+ # @return [Array<(LiveStreamResponse, Integer, Hash)>] LiveStreamResponse data, response status code and response headers
948
+ def update_live_stream_embedded_subtitles_with_http_info(live_stream_id, update_live_stream_embedded_subtitles_request, opts = {})
949
+ if @api_client.config.debugging
950
+ @api_client.config.logger.debug 'Calling API: LiveStreamsApi.update_live_stream_embedded_subtitles ...'
951
+ end
952
+ # verify the required parameter 'live_stream_id' is set
953
+ if @api_client.config.client_side_validation && live_stream_id.nil?
954
+ fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.update_live_stream_embedded_subtitles"
955
+ end
956
+ # verify the required parameter 'update_live_stream_embedded_subtitles_request' is set
957
+ if @api_client.config.client_side_validation && update_live_stream_embedded_subtitles_request.nil?
958
+ fail ArgumentError, "Missing the required parameter 'update_live_stream_embedded_subtitles_request' when calling LiveStreamsApi.update_live_stream_embedded_subtitles"
959
+ end
960
+ # resource path
961
+ local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/embedded-subtitles'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))
962
+
963
+ # query parameters
964
+ query_params = opts[:query_params] || {}
965
+
966
+ # header parameters
967
+ header_params = opts[:header_params] || {}
968
+ # HTTP header 'Accept' (if needed)
969
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
970
+ # HTTP header 'Content-Type'
971
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
972
+
973
+ # form parameters
974
+ form_params = opts[:form_params] || {}
975
+
976
+ # http body (model)
977
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_live_stream_embedded_subtitles_request)
978
+
979
+ # return_type
980
+ return_type = opts[:debug_return_type] || 'LiveStreamResponse'
981
+
982
+ # auth_names
983
+ auth_names = opts[:debug_auth_names] || ['accessToken']
984
+
985
+ new_options = opts.merge(
986
+ :operation => :"LiveStreamsApi.update_live_stream_embedded_subtitles",
987
+ :header_params => header_params,
988
+ :query_params => query_params,
989
+ :form_params => form_params,
990
+ :body => post_body,
991
+ :auth_names => auth_names,
992
+ :return_type => return_type
993
+ )
994
+
995
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
996
+ if @api_client.config.debugging
997
+ @api_client.config.logger.debug "API called: LiveStreamsApi#update_live_stream_embedded_subtitles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
998
+ end
999
+ return data, status_code, headers
1000
+ end
863
1001
  end
864
1002
  end
@@ -257,7 +257,7 @@ module MuxRuby
257
257
  end
258
258
 
259
259
  # List Real-Time Dimensions
260
- # Lists availiable real-time dimensions.
260
+ # Lists available real-time dimensions.
261
261
  # @param [Hash] opts the optional parameters
262
262
  # @return [ListRealTimeDimensionsResponse]
263
263
  def list_realtime_dimensions(opts = {})
@@ -266,7 +266,7 @@ module MuxRuby
266
266
  end
267
267
 
268
268
  # List Real-Time Dimensions
269
- # Lists availiable real-time dimensions.
269
+ # Lists available real-time dimensions.
270
270
  # @param [Hash] opts the optional parameters
271
271
  # @return [Array<(ListRealTimeDimensionsResponse, Integer, Hash)>] ListRealTimeDimensionsResponse data, response status code and response headers
272
272
  def list_realtime_dimensions_with_http_info(opts = {})
@@ -314,7 +314,7 @@ module MuxRuby
314
314
  end
315
315
 
316
316
  # List Real-Time Metrics
317
- # Lists availiable real-time metrics.
317
+ # Lists available real-time metrics.
318
318
  # @param [Hash] opts the optional parameters
319
319
  # @return [ListRealTimeMetricsResponse]
320
320
  def list_realtime_metrics(opts = {})
@@ -323,7 +323,7 @@ module MuxRuby
323
323
  end
324
324
 
325
325
  # List Real-Time Metrics
326
- # Lists availiable real-time metrics.
326
+ # Lists available real-time metrics.
327
327
  # @param [Hash] opts the optional parameters
328
328
  # @return [Array<(ListRealTimeMetricsResponse, Integer, Hash)>] ListRealTimeMetricsResponse data, response status code and response headers
329
329
  def list_realtime_metrics_with_http_info(opts = {})
@@ -31,6 +31,9 @@ module MuxRuby
31
31
  # The video resolution of the input file. Video resolution higher than 2048 pixels on any one dimension (height or width) is considered non-standard, The resolution value is presented as `width` x `height` in pixels.
32
32
  attr_accessor :video_resolution
33
33
 
34
+ # The video bitrate of the input file is `high`. This parameter is present when the average bitrate of any key frame interval (also known as Group of Pictures or GOP) is higher than what's considered standard which typically is 16 Mbps.
35
+ attr_accessor :video_bitrate
36
+
34
37
  # The video pixel aspect ratio of the input file.
35
38
  attr_accessor :pixel_aspect_ratio
36
39
 
@@ -73,6 +76,7 @@ module MuxRuby
73
76
  :'video_gop_size' => :'video_gop_size',
74
77
  :'video_frame_rate' => :'video_frame_rate',
75
78
  :'video_resolution' => :'video_resolution',
79
+ :'video_bitrate' => :'video_bitrate',
76
80
  :'pixel_aspect_ratio' => :'pixel_aspect_ratio',
77
81
  :'video_edit_list' => :'video_edit_list',
78
82
  :'audio_edit_list' => :'audio_edit_list',
@@ -93,6 +97,7 @@ module MuxRuby
93
97
  :'video_gop_size' => :'String',
94
98
  :'video_frame_rate' => :'String',
95
99
  :'video_resolution' => :'String',
100
+ :'video_bitrate' => :'String',
96
101
  :'pixel_aspect_ratio' => :'String',
97
102
  :'video_edit_list' => :'String',
98
103
  :'audio_edit_list' => :'String',
@@ -141,6 +146,10 @@ module MuxRuby
141
146
  self.video_resolution = attributes[:'video_resolution']
142
147
  end
143
148
 
149
+ if attributes.key?(:'video_bitrate')
150
+ self.video_bitrate = attributes[:'video_bitrate']
151
+ end
152
+
144
153
  if attributes.key?(:'pixel_aspect_ratio')
145
154
  self.pixel_aspect_ratio = attributes[:'pixel_aspect_ratio']
146
155
  end
@@ -170,6 +179,8 @@ module MuxRuby
170
179
  def valid?
171
180
  video_gop_size_validator = EnumAttributeValidator.new('String', ["high"])
172
181
  return false unless video_gop_size_validator.valid?(@video_gop_size)
182
+ video_bitrate_validator = EnumAttributeValidator.new('String', ["high"])
183
+ return false unless video_bitrate_validator.valid?(@video_bitrate)
173
184
  video_edit_list_validator = EnumAttributeValidator.new('String', ["non-standard"])
174
185
  return false unless video_edit_list_validator.valid?(@video_edit_list)
175
186
  audio_edit_list_validator = EnumAttributeValidator.new('String', ["non-standard"])
@@ -189,6 +200,16 @@ module MuxRuby
189
200
  @video_gop_size = video_gop_size
190
201
  end
191
202
 
203
+ # Custom attribute writer method checking allowed values (enum).
204
+ # @param [Object] video_bitrate Object to be assigned
205
+ def video_bitrate=(video_bitrate)
206
+ validator = EnumAttributeValidator.new('String', ["high"])
207
+ unless validator.valid?(video_bitrate)
208
+ fail ArgumentError, "invalid value for \"video_bitrate\", must be one of #{validator.allowable_values}."
209
+ end
210
+ @video_bitrate = video_bitrate
211
+ end
212
+
192
213
  # Custom attribute writer method checking allowed values (enum).
193
214
  # @param [Object] video_edit_list Object to be assigned
194
215
  def video_edit_list=(video_edit_list)
@@ -229,6 +250,7 @@ module MuxRuby
229
250
  video_gop_size == o.video_gop_size &&
230
251
  video_frame_rate == o.video_frame_rate &&
231
252
  video_resolution == o.video_resolution &&
253
+ video_bitrate == o.video_bitrate &&
232
254
  pixel_aspect_ratio == o.pixel_aspect_ratio &&
233
255
  video_edit_list == o.video_edit_list &&
234
256
  audio_edit_list == o.audio_edit_list &&
@@ -244,7 +266,7 @@ module MuxRuby
244
266
  # Calculates hash code according to all attributes.
245
267
  # @return [Integer] Hash code
246
268
  def hash
247
- [video_codec, audio_codec, video_gop_size, video_frame_rate, video_resolution, pixel_aspect_ratio, video_edit_list, audio_edit_list, unexpected_media_file_parameters].hash
269
+ [video_codec, audio_codec, video_gop_size, video_frame_rate, video_resolution, video_bitrate, pixel_aspect_ratio, video_edit_list, audio_edit_list, unexpected_media_file_parameters].hash
248
270
  end
249
271
 
250
272
  # Builds the object from hash
@@ -27,9 +27,15 @@ module MuxRuby
27
27
  # Force the live stream to only process the audio track when the value is set to true. Mux drops the video track if broadcasted.
28
28
  attr_accessor :audio_only
29
29
 
30
+ # Describe the embedded closed caption contents of the incoming live stream.
31
+ attr_accessor :embedded_subtitles
32
+
30
33
  # Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/
31
34
  attr_accessor :reduced_latency
32
35
 
36
+ # Latency is the time from when the streamer does something in real life to when you see it happen in the player. Setting this option will enable compatibility with the LL-HLS specification for low-latency streaming. This typically has lower latency than Reduced Latency streams, and cannot be combined with Reduced Latency. Note: Reconnect windows are incompatible with Low Latency and will always be set to zero (0) seconds.
37
+ attr_accessor :low_latency
38
+
33
39
  # Marks the live stream as a test live stream when the value is set to true. A test live stream can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test live streams created. Test live streams are watermarked with the Mux logo and limited to 5 minutes. The test live stream is disabled after the stream is active for 5 mins and the recorded asset also deleted after 24 hours.
34
40
  attr_accessor :test
35
41
 
@@ -43,7 +49,9 @@ module MuxRuby
43
49
  :'reconnect_window' => :'reconnect_window',
44
50
  :'passthrough' => :'passthrough',
45
51
  :'audio_only' => :'audio_only',
52
+ :'embedded_subtitles' => :'embedded_subtitles',
46
53
  :'reduced_latency' => :'reduced_latency',
54
+ :'low_latency' => :'low_latency',
47
55
  :'test' => :'test',
48
56
  :'simulcast_targets' => :'simulcast_targets'
49
57
  }
@@ -62,7 +70,9 @@ module MuxRuby
62
70
  :'reconnect_window' => :'Float',
63
71
  :'passthrough' => :'String',
64
72
  :'audio_only' => :'Boolean',
73
+ :'embedded_subtitles' => :'Array<LiveStreamEmbeddedSubtitleSettings>',
65
74
  :'reduced_latency' => :'Boolean',
75
+ :'low_latency' => :'Boolean',
66
76
  :'test' => :'Boolean',
67
77
  :'simulcast_targets' => :'Array<CreateSimulcastTargetRequest>'
68
78
  }
@@ -111,10 +121,20 @@ module MuxRuby
111
121
  self.audio_only = attributes[:'audio_only']
112
122
  end
113
123
 
124
+ if attributes.key?(:'embedded_subtitles')
125
+ if (value = attributes[:'embedded_subtitles']).is_a?(Array)
126
+ self.embedded_subtitles = value
127
+ end
128
+ end
129
+
114
130
  if attributes.key?(:'reduced_latency')
115
131
  self.reduced_latency = attributes[:'reduced_latency']
116
132
  end
117
133
 
134
+ if attributes.key?(:'low_latency')
135
+ self.low_latency = attributes[:'low_latency']
136
+ end
137
+
118
138
  if attributes.key?(:'test')
119
139
  self.test = attributes[:'test']
120
140
  end
@@ -173,7 +193,9 @@ module MuxRuby
173
193
  reconnect_window == o.reconnect_window &&
174
194
  passthrough == o.passthrough &&
175
195
  audio_only == o.audio_only &&
196
+ embedded_subtitles == o.embedded_subtitles &&
176
197
  reduced_latency == o.reduced_latency &&
198
+ low_latency == o.low_latency &&
177
199
  test == o.test &&
178
200
  simulcast_targets == o.simulcast_targets
179
201
  end
@@ -187,7 +209,7 @@ module MuxRuby
187
209
  # Calculates hash code according to all attributes.
188
210
  # @return [Integer] Hash code
189
211
  def hash
190
- [playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, reduced_latency, test, simulcast_targets].hash
212
+ [playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, embedded_subtitles, reduced_latency, low_latency, test, simulcast_targets].hash
191
213
  end
192
214
 
193
215
  # Builds the object from hash
@@ -0,0 +1,218 @@
1
+ =begin
2
+ #Mux API
3
+
4
+ #Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.
5
+
6
+ The version of the OpenAPI document: v1
7
+ Contact: devex@mux.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MuxRuby
17
+ class GetLiveStreamPlaybackIDResponse
18
+ attr_accessor :data
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'data' => :'PlaybackID'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::GetLiveStreamPlaybackIDResponse` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::GetLiveStreamPlaybackIDResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'data')
61
+ self.data = attributes[:'data']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ data == o.data
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [data].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :Time
134
+ Time.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ # models (e.g. Pet) or oneOf
165
+ klass = MuxRuby.const_get(type)
166
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -50,6 +50,9 @@ module MuxRuby
50
50
  # Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. **Note**: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. See the [Reduce live stream latency guide](https://docs.mux.com/guides/video/reduce-live-stream-latency) to understand the tradeoffs.
51
51
  attr_accessor :reduced_latency
52
52
 
53
+ # Latency is the time from when the streamer does something in real life to when you see it happen in the player. Setting this option will enable compatibility with the LL-HLS specification for low-latency streaming. This typically has lower latency than Reduced Latency streams, and cannot be combined with Reduced Latency. Note: Reconnect windows are incompatible with Low Latency and will always be set to zero (0) seconds.
54
+ attr_accessor :low_latency
55
+
53
56
  # Each Simulcast Target contains configuration details to broadcast (or \"restream\") a live stream to a third-party streaming service. [See the Stream live to 3rd party platforms guide](https://docs.mux.com/guides/video/stream-live-to-3rd-party-platforms).
54
57
  attr_accessor :simulcast_targets
55
58
 
@@ -93,6 +96,7 @@ module MuxRuby
93
96
  :'audio_only' => :'audio_only',
94
97
  :'reconnect_window' => :'reconnect_window',
95
98
  :'reduced_latency' => :'reduced_latency',
99
+ :'low_latency' => :'low_latency',
96
100
  :'simulcast_targets' => :'simulcast_targets',
97
101
  :'test' => :'test'
98
102
  }
@@ -118,6 +122,7 @@ module MuxRuby
118
122
  :'audio_only' => :'Boolean',
119
123
  :'reconnect_window' => :'Float',
120
124
  :'reduced_latency' => :'Boolean',
125
+ :'low_latency' => :'Boolean',
121
126
  :'simulcast_targets' => :'Array<SimulcastTarget>',
122
127
  :'test' => :'Boolean'
123
128
  }
@@ -198,6 +203,10 @@ module MuxRuby
198
203
  self.reduced_latency = attributes[:'reduced_latency']
199
204
  end
200
205
 
206
+ if attributes.key?(:'low_latency')
207
+ self.low_latency = attributes[:'low_latency']
208
+ end
209
+
201
210
  if attributes.key?(:'simulcast_targets')
202
211
  if (value = attributes[:'simulcast_targets']).is_a?(Array)
203
212
  self.simulcast_targets = value
@@ -251,6 +260,7 @@ module MuxRuby
251
260
  audio_only == o.audio_only &&
252
261
  reconnect_window == o.reconnect_window &&
253
262
  reduced_latency == o.reduced_latency &&
263
+ low_latency == o.low_latency &&
254
264
  simulcast_targets == o.simulcast_targets &&
255
265
  test == o.test
256
266
  end
@@ -264,7 +274,7 @@ module MuxRuby
264
274
  # Calculates hash code according to all attributes.
265
275
  # @return [Integer] Hash code
266
276
  def hash
267
- [id, created_at, stream_key, active_asset_id, recent_asset_ids, status, playback_ids, new_asset_settings, passthrough, audio_only, reconnect_window, reduced_latency, simulcast_targets, test].hash
277
+ [id, created_at, stream_key, active_asset_id, recent_asset_ids, status, playback_ids, new_asset_settings, passthrough, audio_only, reconnect_window, reduced_latency, low_latency, simulcast_targets, test].hash
268
278
  end
269
279
 
270
280
  # Builds the object from hash