mux_ruby 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 044a3655b853ad9277d213c6259b2a73071fb1c198ae46956f368d6933f5a288
4
- data.tar.gz: 0424ff46a5d2035d32092ca261a75422bde616a324341b1f144180cee74d5dfe
3
+ metadata.gz: ccbf90e37874b351e072e692180c58a354d436faddbb9f9d0f2c9a9d95868f4f
4
+ data.tar.gz: b8e1b2f842ec53b7447df8d4cb7ba51a4ec39ec83593edfcd83dc8e76289222e
5
5
  SHA512:
6
- metadata.gz: d37bb4b970e888934ef8c7041b0d16b6669e97c1250504c962f81462c9c278f75e513e6bfe25a415aa94f3e2b1add8ae699a7181a0a834f4cc29f751d0deeee9
7
- data.tar.gz: 3618c152283e26e9a6ce43426279e3cff70f94b5ba2184b7707519c99b9b613d448c3b567c463b6fa4b2b2045b0ad9d28f59e0eb1f8b9e8a2c0f139daf711ac7
6
+ metadata.gz: 7d4b97bfbe38e4fcbab508520383eec2d36c79551cc176a1ae4b4d2bb397e2d3e05dbab8d58da94de21c409fb2f2d66e95b4f6d16121c8673e182ecd2014f538
7
+ data.tar.gz: 0e7ac75c0ce0d429ae02710b35a1bc7ef3a5182ef1f138c8f2b435ac1b2a3fe70e259ed10c224a44865d06101adb7c4fd34cc262f60095f6b9391e60a7e9f8a6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mux_ruby (1.6.0)
4
+ mux_ruby (1.7.0)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
  typhoeus (~> 1.0, >= 1.0.1)
7
7
 
@@ -23,6 +23,8 @@ Name | Type | Description | Notes
23
23
  **mp4_support** | **String** | | [optional] [default to 'none']
24
24
  **normalize_audio** | **BOOLEAN** | | [optional] [default to false]
25
25
  **static_renditions** | [**AssetStaticRenditions**](AssetStaticRenditions.md) | | [optional]
26
+ **recording_times** | [**Array<AssetRecordingTimes>**](AssetRecordingTimes.md) | An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream | [optional]
27
+ **non_standard_input_reasons** | [**AssetNonStandardInputReasons**](AssetNonStandardInputReasons.md) | | [optional]
26
28
  **test** | **BOOLEAN** | | [optional]
27
29
 
28
30
 
@@ -0,0 +1,16 @@
1
+ # MuxRuby::AssetNonStandardInputReasons
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **video_codec** | **String** | The video codec used on the input file | [optional]
7
+ **audio_codec** | **String** | The audio codec used on the input file | [optional]
8
+ **video_gop_size** | **String** | The video key frame Interval (also called as Group of Picture or GOP) of the input file | [optional]
9
+ **video_frame_rate** | **String** | The video frame rate of the input file | [optional]
10
+ **video_resolution** | **String** | The video resolution of the input file | [optional]
11
+ **pixel_aspect_ratio** | **String** | The video pixel aspect ratio of the input file | [optional]
12
+ **video_edit_list** | **String** | Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List | [optional]
13
+ **audio_edit_list** | **String** | Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List | [optional]
14
+ **unexpected_media_file_parameters** | **String** | A catch-all reason when the input file in created with non-standard encoding parameters | [optional]
15
+
16
+
@@ -0,0 +1,9 @@
1
+ # MuxRuby::AssetRecordingTimes
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **started_at** | **DateTime** | The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format | [optional]
7
+ **duration** | **Float** | The duration of the live stream recorded. The time value is in seconds | [optional]
8
+
9
+
@@ -0,0 +1,8 @@
1
+ # MuxRuby::DisableLiveStreamResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **data** | [**Object**](.md) | | [optional]
7
+
8
+
@@ -0,0 +1,8 @@
1
+ # MuxRuby::EnableLiveStreamResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **data** | [**Object**](.md) | | [optional]
7
+
8
+
@@ -10,6 +10,8 @@ Method | HTTP request | Description
10
10
  [**delete_live_stream**](LiveStreamsApi.md#delete_live_stream) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream
11
11
  [**delete_live_stream_playback_id**](LiveStreamsApi.md#delete_live_stream_playback_id) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID
12
12
  [**delete_live_stream_simulcast_target**](LiveStreamsApi.md#delete_live_stream_simulcast_target) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a Live Stream Simulcast Target
13
+ [**disable_live_stream**](LiveStreamsApi.md#disable_live_stream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/disable | Disable a live stream
14
+ [**enable_live_stream**](LiveStreamsApi.md#enable_live_stream) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/enable | Enable a live stream
13
15
  [**get_live_stream**](LiveStreamsApi.md#get_live_stream) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream
14
16
  [**get_live_stream_simulcast_target**](LiveStreamsApi.md#get_live_stream_simulcast_target) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target
15
17
  [**list_live_streams**](LiveStreamsApi.md#list_live_streams) | **GET** /video/v1/live-streams | List live streams
@@ -320,6 +322,108 @@ nil (empty response body)
320
322
 
321
323
 
322
324
 
325
+ # **disable_live_stream**
326
+ > DisableLiveStreamResponse disable_live_stream(live_stream_id)
327
+
328
+ Disable a live stream
329
+
330
+ Disables a live stream, making it reject incoming RTMP streams until re-enabled.
331
+
332
+ ### Example
333
+ ```ruby
334
+ # load the gem
335
+ require 'mux_ruby'
336
+ # setup authorization
337
+ MuxRuby.configure do |config|
338
+ # Configure HTTP basic authorization: accessToken
339
+ config.username = 'YOUR USERNAME'
340
+ config.password = 'YOUR PASSWORD'
341
+ end
342
+
343
+ api_instance = MuxRuby::LiveStreamsApi.new
344
+ live_stream_id = 'live_stream_id_example' # String | The live stream ID
345
+
346
+ begin
347
+ #Disable a live stream
348
+ result = api_instance.disable_live_stream(live_stream_id)
349
+ p result
350
+ rescue MuxRuby::ApiError => e
351
+ puts "Exception when calling LiveStreamsApi->disable_live_stream: #{e}"
352
+ end
353
+ ```
354
+
355
+ ### Parameters
356
+
357
+ Name | Type | Description | Notes
358
+ ------------- | ------------- | ------------- | -------------
359
+ **live_stream_id** | **String**| The live stream ID |
360
+
361
+ ### Return type
362
+
363
+ [**DisableLiveStreamResponse**](DisableLiveStreamResponse.md)
364
+
365
+ ### Authorization
366
+
367
+ [accessToken](../README.md#accessToken)
368
+
369
+ ### HTTP request headers
370
+
371
+ - **Content-Type**: Not defined
372
+ - **Accept**: application/json
373
+
374
+
375
+
376
+ # **enable_live_stream**
377
+ > EnableLiveStreamResponse enable_live_stream(live_stream_id)
378
+
379
+ Enable a live stream
380
+
381
+ Enables a live stream, allowing it to accept an incoming RTMP stream.
382
+
383
+ ### Example
384
+ ```ruby
385
+ # load the gem
386
+ require 'mux_ruby'
387
+ # setup authorization
388
+ MuxRuby.configure do |config|
389
+ # Configure HTTP basic authorization: accessToken
390
+ config.username = 'YOUR USERNAME'
391
+ config.password = 'YOUR PASSWORD'
392
+ end
393
+
394
+ api_instance = MuxRuby::LiveStreamsApi.new
395
+ live_stream_id = 'live_stream_id_example' # String | The live stream ID
396
+
397
+ begin
398
+ #Enable a live stream
399
+ result = api_instance.enable_live_stream(live_stream_id)
400
+ p result
401
+ rescue MuxRuby::ApiError => e
402
+ puts "Exception when calling LiveStreamsApi->enable_live_stream: #{e}"
403
+ end
404
+ ```
405
+
406
+ ### Parameters
407
+
408
+ Name | Type | Description | Notes
409
+ ------------- | ------------- | ------------- | -------------
410
+ **live_stream_id** | **String**| The live stream ID |
411
+
412
+ ### Return type
413
+
414
+ [**EnableLiveStreamResponse**](EnableLiveStreamResponse.md)
415
+
416
+ ### Authorization
417
+
418
+ [accessToken](../README.md#accessToken)
419
+
420
+ ### HTTP request headers
421
+
422
+ - **Content-Type**: Not defined
423
+ - **Accept**: application/json
424
+
425
+
426
+
323
427
  # **get_live_stream**
324
428
  > LiveStreamResponse get_live_stream(live_stream_id)
325
429
 
@@ -104,6 +104,28 @@ rescue MuxRuby::ApiError => e
104
104
  end
105
105
  puts "signal-live-stream-complete OK ✅"
106
106
 
107
+ # ========== disable-live-stream ==========
108
+ begin
109
+ live_api.disable_live_stream(stream.data.id)
110
+ disabled_live_stream = live_api.get_live_stream(stream.data.id)
111
+ assert disabled_live_stream.data.status == 'disabled'
112
+ rescue MuxRuby::ApiError => e
113
+ puts "Should not have errored when disabling stream"
114
+ exit 1
115
+ end
116
+ puts "disable-live-stream OK ✅"
117
+
118
+ # ========== enable-live-stream ==========
119
+ begin
120
+ live_api.enable_live_stream(stream.data.id)
121
+ enabled_live_stream = live_api.get_live_stream(stream.data.id)
122
+ assert enabled_live_stream.data.status == 'idle'
123
+ rescue MuxRuby::ApiError => e
124
+ puts "Should not have errored when enabling stream"
125
+ exit 1
126
+ end
127
+ puts "enable-live-stream OK ✅"
128
+
107
129
  # ========== delete-live-stream ==========
108
130
  live_api.delete_live_stream(stream.data.id)
109
131
  begin
@@ -14,6 +14,8 @@ require 'mux_ruby/models/abridged_video_view'
14
14
  require 'mux_ruby/models/asset'
15
15
  require 'mux_ruby/models/asset_errors'
16
16
  require 'mux_ruby/models/asset_master'
17
+ require 'mux_ruby/models/asset_non_standard_input_reasons'
18
+ require 'mux_ruby/models/asset_recording_times'
17
19
  require 'mux_ruby/models/asset_response'
18
20
  require 'mux_ruby/models/asset_static_renditions'
19
21
  require 'mux_ruby/models/asset_static_renditions_files'
@@ -27,6 +29,8 @@ require 'mux_ruby/models/create_track_request'
27
29
  require 'mux_ruby/models/create_track_response'
28
30
  require 'mux_ruby/models/create_upload_request'
29
31
  require 'mux_ruby/models/delivery_report'
32
+ require 'mux_ruby/models/disable_live_stream_response'
33
+ require 'mux_ruby/models/enable_live_stream_response'
30
34
  require 'mux_ruby/models/error'
31
35
  require 'mux_ruby/models/filter_value'
32
36
  require 'mux_ruby/models/get_asset_input_info_response'
@@ -343,6 +343,112 @@ module MuxRuby
343
343
  return data, status_code, headers
344
344
  end
345
345
 
346
+ # Disable a live stream
347
+ # Disables a live stream, making it reject incoming RTMP streams until re-enabled.
348
+ # @param live_stream_id The live stream ID
349
+ # @param [Hash] opts the optional parameters
350
+ # @return [DisableLiveStreamResponse]
351
+ def disable_live_stream(live_stream_id, opts = {})
352
+ data, _status_code, _headers = disable_live_stream_with_http_info(live_stream_id, opts)
353
+ data
354
+ end
355
+
356
+ # Disable a live stream
357
+ # Disables a live stream, making it reject incoming RTMP streams until re-enabled.
358
+ # @param live_stream_id The live stream ID
359
+ # @param [Hash] opts the optional parameters
360
+ # @return [Array<(DisableLiveStreamResponse, Fixnum, Hash)>] DisableLiveStreamResponse data, response status code and response headers
361
+ def disable_live_stream_with_http_info(live_stream_id, opts = {})
362
+ if @api_client.config.debugging
363
+ @api_client.config.logger.debug 'Calling API: LiveStreamsApi.disable_live_stream ...'
364
+ end
365
+ # verify the required parameter 'live_stream_id' is set
366
+ if @api_client.config.client_side_validation && live_stream_id.nil?
367
+ fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.disable_live_stream"
368
+ end
369
+ # resource path
370
+ local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/disable'.sub('{' + 'LIVE_STREAM_ID' + '}', live_stream_id.to_s)
371
+
372
+ # query parameters
373
+ query_params = {}
374
+
375
+ # header parameters
376
+ header_params = {}
377
+ # HTTP header 'Accept' (if needed)
378
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
379
+
380
+ # form parameters
381
+ form_params = {}
382
+
383
+ # http body (model)
384
+ post_body = nil
385
+ auth_names = ['accessToken']
386
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
387
+ :header_params => header_params,
388
+ :query_params => query_params,
389
+ :form_params => form_params,
390
+ :body => post_body,
391
+ :auth_names => auth_names,
392
+ :return_type => 'DisableLiveStreamResponse')
393
+ if @api_client.config.debugging
394
+ @api_client.config.logger.debug "API called: LiveStreamsApi#disable_live_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
395
+ end
396
+ return data, status_code, headers
397
+ end
398
+
399
+ # Enable a live stream
400
+ # Enables a live stream, allowing it to accept an incoming RTMP stream.
401
+ # @param live_stream_id The live stream ID
402
+ # @param [Hash] opts the optional parameters
403
+ # @return [EnableLiveStreamResponse]
404
+ def enable_live_stream(live_stream_id, opts = {})
405
+ data, _status_code, _headers = enable_live_stream_with_http_info(live_stream_id, opts)
406
+ data
407
+ end
408
+
409
+ # Enable a live stream
410
+ # Enables a live stream, allowing it to accept an incoming RTMP stream.
411
+ # @param live_stream_id The live stream ID
412
+ # @param [Hash] opts the optional parameters
413
+ # @return [Array<(EnableLiveStreamResponse, Fixnum, Hash)>] EnableLiveStreamResponse data, response status code and response headers
414
+ def enable_live_stream_with_http_info(live_stream_id, opts = {})
415
+ if @api_client.config.debugging
416
+ @api_client.config.logger.debug 'Calling API: LiveStreamsApi.enable_live_stream ...'
417
+ end
418
+ # verify the required parameter 'live_stream_id' is set
419
+ if @api_client.config.client_side_validation && live_stream_id.nil?
420
+ fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.enable_live_stream"
421
+ end
422
+ # resource path
423
+ local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/enable'.sub('{' + 'LIVE_STREAM_ID' + '}', live_stream_id.to_s)
424
+
425
+ # query parameters
426
+ query_params = {}
427
+
428
+ # header parameters
429
+ header_params = {}
430
+ # HTTP header 'Accept' (if needed)
431
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
432
+
433
+ # form parameters
434
+ form_params = {}
435
+
436
+ # http body (model)
437
+ post_body = nil
438
+ auth_names = ['accessToken']
439
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
440
+ :header_params => header_params,
441
+ :query_params => query_params,
442
+ :form_params => form_params,
443
+ :body => post_body,
444
+ :auth_names => auth_names,
445
+ :return_type => 'EnableLiveStreamResponse')
446
+ if @api_client.config.debugging
447
+ @api_client.config.logger.debug "API called: LiveStreamsApi#enable_live_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
448
+ end
449
+ return data, status_code, headers
450
+ end
451
+
346
452
  # Retrieve a live stream
347
453
  # 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.
348
454
  # @param live_stream_id The live stream ID
@@ -47,6 +47,11 @@ module MuxRuby
47
47
 
48
48
  attr_accessor :static_renditions
49
49
 
50
+ # An array of individual live stream recording sessions. A recording session is created on each encoder connection during the live stream
51
+ attr_accessor :recording_times
52
+
53
+ attr_accessor :non_standard_input_reasons
54
+
50
55
  attr_accessor :test
51
56
 
52
57
  class EnumAttributeValidator
@@ -94,6 +99,8 @@ module MuxRuby
94
99
  :'mp4_support' => :'mp4_support',
95
100
  :'normalize_audio' => :'normalize_audio',
96
101
  :'static_renditions' => :'static_renditions',
102
+ :'recording_times' => :'recording_times',
103
+ :'non_standard_input_reasons' => :'non_standard_input_reasons',
97
104
  :'test' => :'test'
98
105
  }
99
106
  end
@@ -121,6 +128,8 @@ module MuxRuby
121
128
  :'mp4_support' => :'String',
122
129
  :'normalize_audio' => :'BOOLEAN',
123
130
  :'static_renditions' => :'AssetStaticRenditions',
131
+ :'recording_times' => :'Array<AssetRecordingTimes>',
132
+ :'non_standard_input_reasons' => :'AssetNonStandardInputReasons',
124
133
  :'test' => :'BOOLEAN'
125
134
  }
126
135
  end
@@ -223,6 +232,16 @@ module MuxRuby
223
232
  self.static_renditions = attributes[:'static_renditions']
224
233
  end
225
234
 
235
+ if attributes.has_key?(:'recording_times')
236
+ if (value = attributes[:'recording_times']).is_a?(Array)
237
+ self.recording_times = value
238
+ end
239
+ end
240
+
241
+ if attributes.has_key?(:'non_standard_input_reasons')
242
+ self.non_standard_input_reasons = attributes[:'non_standard_input_reasons']
243
+ end
244
+
226
245
  if attributes.has_key?(:'test')
227
246
  self.test = attributes[:'test']
228
247
  end
@@ -290,6 +309,8 @@ module MuxRuby
290
309
  mp4_support == o.mp4_support &&
291
310
  normalize_audio == o.normalize_audio &&
292
311
  static_renditions == o.static_renditions &&
312
+ recording_times == o.recording_times &&
313
+ non_standard_input_reasons == o.non_standard_input_reasons &&
293
314
  test == o.test
294
315
  end
295
316
 
@@ -302,7 +323,7 @@ module MuxRuby
302
323
  # Calculates hash code according to all attributes.
303
324
  # @return [Fixnum] Hash code
304
325
  def hash
305
- [id, created_at, deleted_at, status, duration, max_stored_resolution, max_stored_frame_rate, aspect_ratio, playback_ids, tracks, errors, per_title_encode, is_live, passthrough, live_stream_id, master, master_access, mp4_support, normalize_audio, static_renditions, test].hash
326
+ [id, created_at, deleted_at, status, duration, max_stored_resolution, max_stored_frame_rate, aspect_ratio, playback_ids, tracks, errors, per_title_encode, is_live, passthrough, live_stream_id, master, master_access, mp4_support, normalize_audio, static_renditions, recording_times, non_standard_input_reasons, test].hash
306
327
  end
307
328
 
308
329
  # Builds the object from hash
@@ -0,0 +1,335 @@
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 'date'
7
+
8
+ module MuxRuby
9
+ class AssetNonStandardInputReasons
10
+ # The video codec used on the input file
11
+ attr_accessor :video_codec
12
+
13
+ # The audio codec used on the input file
14
+ attr_accessor :audio_codec
15
+
16
+ # The video key frame Interval (also called as Group of Picture or GOP) of the input file
17
+ attr_accessor :video_gop_size
18
+
19
+ # The video frame rate of the input file
20
+ attr_accessor :video_frame_rate
21
+
22
+ # The video resolution of the input file
23
+ attr_accessor :video_resolution
24
+
25
+ # The video pixel aspect ratio of the input file
26
+ attr_accessor :pixel_aspect_ratio
27
+
28
+ # Video Edit List reason indicates that the input file's video track contains a complex Edit Decision List
29
+ attr_accessor :video_edit_list
30
+
31
+ # Audio Edit List reason indicates that the input file's audio track contains a complex Edit Decision List
32
+ attr_accessor :audio_edit_list
33
+
34
+ # A catch-all reason when the input file in created with non-standard encoding parameters
35
+ attr_accessor :unexpected_media_file_parameters
36
+
37
+ class EnumAttributeValidator
38
+ attr_reader :datatype
39
+ attr_reader :allowable_values
40
+
41
+ def initialize(datatype, allowable_values)
42
+ @allowable_values = allowable_values.map do |value|
43
+ case datatype.to_s
44
+ when /Integer/i
45
+ value.to_i
46
+ when /Float/i
47
+ value.to_f
48
+ else
49
+ value
50
+ end
51
+ end
52
+ end
53
+
54
+ def valid?(value)
55
+ !value || allowable_values.include?(value)
56
+ end
57
+ end
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'video_codec' => :'video_codec',
63
+ :'audio_codec' => :'audio_codec',
64
+ :'video_gop_size' => :'video_gop_size',
65
+ :'video_frame_rate' => :'video_frame_rate',
66
+ :'video_resolution' => :'video_resolution',
67
+ :'pixel_aspect_ratio' => :'pixel_aspect_ratio',
68
+ :'video_edit_list' => :'video_edit_list',
69
+ :'audio_edit_list' => :'audio_edit_list',
70
+ :'unexpected_media_file_parameters' => :'unexpected_media_file_parameters'
71
+ }
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'video_codec' => :'String',
78
+ :'audio_codec' => :'String',
79
+ :'video_gop_size' => :'String',
80
+ :'video_frame_rate' => :'String',
81
+ :'video_resolution' => :'String',
82
+ :'pixel_aspect_ratio' => :'String',
83
+ :'video_edit_list' => :'String',
84
+ :'audio_edit_list' => :'String',
85
+ :'unexpected_media_file_parameters' => :'String'
86
+ }
87
+ end
88
+
89
+ # Initializes the object
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ def initialize(attributes = {})
92
+ return unless attributes.is_a?(Hash)
93
+
94
+ # convert string to symbol for hash key
95
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
96
+
97
+ if attributes.has_key?(:'video_codec')
98
+ self.video_codec = attributes[:'video_codec']
99
+ end
100
+
101
+ if attributes.has_key?(:'audio_codec')
102
+ self.audio_codec = attributes[:'audio_codec']
103
+ end
104
+
105
+ if attributes.has_key?(:'video_gop_size')
106
+ self.video_gop_size = attributes[:'video_gop_size']
107
+ end
108
+
109
+ if attributes.has_key?(:'video_frame_rate')
110
+ self.video_frame_rate = attributes[:'video_frame_rate']
111
+ end
112
+
113
+ if attributes.has_key?(:'video_resolution')
114
+ self.video_resolution = attributes[:'video_resolution']
115
+ end
116
+
117
+ if attributes.has_key?(:'pixel_aspect_ratio')
118
+ self.pixel_aspect_ratio = attributes[:'pixel_aspect_ratio']
119
+ end
120
+
121
+ if attributes.has_key?(:'video_edit_list')
122
+ self.video_edit_list = attributes[:'video_edit_list']
123
+ end
124
+
125
+ if attributes.has_key?(:'audio_edit_list')
126
+ self.audio_edit_list = attributes[:'audio_edit_list']
127
+ end
128
+
129
+ if attributes.has_key?(:'unexpected_media_file_parameters')
130
+ self.unexpected_media_file_parameters = attributes[:'unexpected_media_file_parameters']
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ video_gop_size_validator = EnumAttributeValidator.new('String', ['high'])
145
+ return false unless video_gop_size_validator.valid?(@video_gop_size)
146
+ video_edit_list_validator = EnumAttributeValidator.new('String', ['non-standard'])
147
+ return false unless video_edit_list_validator.valid?(@video_edit_list)
148
+ audio_edit_list_validator = EnumAttributeValidator.new('String', ['non-standard'])
149
+ return false unless audio_edit_list_validator.valid?(@audio_edit_list)
150
+ unexpected_media_file_parameters_validator = EnumAttributeValidator.new('String', ['non-standard'])
151
+ return false unless unexpected_media_file_parameters_validator.valid?(@unexpected_media_file_parameters)
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method checking allowed values (enum).
156
+ # @param [Object] video_gop_size Object to be assigned
157
+ def video_gop_size=(video_gop_size)
158
+ validator = EnumAttributeValidator.new('String', ['high'])
159
+ unless validator.valid?(video_gop_size)
160
+ fail ArgumentError, 'invalid value for "video_gop_size", must be one of #{validator.allowable_values}.'
161
+ end
162
+ @video_gop_size = video_gop_size
163
+ end
164
+
165
+ # Custom attribute writer method checking allowed values (enum).
166
+ # @param [Object] video_edit_list Object to be assigned
167
+ def video_edit_list=(video_edit_list)
168
+ validator = EnumAttributeValidator.new('String', ['non-standard'])
169
+ unless validator.valid?(video_edit_list)
170
+ fail ArgumentError, 'invalid value for "video_edit_list", must be one of #{validator.allowable_values}.'
171
+ end
172
+ @video_edit_list = video_edit_list
173
+ end
174
+
175
+ # Custom attribute writer method checking allowed values (enum).
176
+ # @param [Object] audio_edit_list Object to be assigned
177
+ def audio_edit_list=(audio_edit_list)
178
+ validator = EnumAttributeValidator.new('String', ['non-standard'])
179
+ unless validator.valid?(audio_edit_list)
180
+ fail ArgumentError, 'invalid value for "audio_edit_list", must be one of #{validator.allowable_values}.'
181
+ end
182
+ @audio_edit_list = audio_edit_list
183
+ end
184
+
185
+ # Custom attribute writer method checking allowed values (enum).
186
+ # @param [Object] unexpected_media_file_parameters Object to be assigned
187
+ def unexpected_media_file_parameters=(unexpected_media_file_parameters)
188
+ validator = EnumAttributeValidator.new('String', ['non-standard'])
189
+ unless validator.valid?(unexpected_media_file_parameters)
190
+ fail ArgumentError, 'invalid value for "unexpected_media_file_parameters", must be one of #{validator.allowable_values}.'
191
+ end
192
+ @unexpected_media_file_parameters = unexpected_media_file_parameters
193
+ end
194
+
195
+ # Checks equality by comparing each attribute.
196
+ # @param [Object] Object to be compared
197
+ def ==(o)
198
+ return true if self.equal?(o)
199
+ self.class == o.class &&
200
+ video_codec == o.video_codec &&
201
+ audio_codec == o.audio_codec &&
202
+ video_gop_size == o.video_gop_size &&
203
+ video_frame_rate == o.video_frame_rate &&
204
+ video_resolution == o.video_resolution &&
205
+ pixel_aspect_ratio == o.pixel_aspect_ratio &&
206
+ video_edit_list == o.video_edit_list &&
207
+ audio_edit_list == o.audio_edit_list &&
208
+ unexpected_media_file_parameters == o.unexpected_media_file_parameters
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Fixnum] Hash code
219
+ def hash
220
+ [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
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ new.build_from_hash(attributes)
228
+ end
229
+
230
+ # Builds the object from hash
231
+ # @param [Hash] attributes Model attributes in the form of hash
232
+ # @return [Object] Returns the model itself
233
+ def build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+ self.class.openapi_types.each_pair do |key, type|
236
+ if type =~ /\AArray<(.*)>/i
237
+ # check to ensure the input is an array given that the attribute
238
+ # is documented as an array but the input is not
239
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
240
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
241
+ end
242
+ elsif !attributes[self.class.attribute_map[key]].nil?
243
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
244
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
245
+ end
246
+
247
+ self
248
+ end
249
+
250
+ # Deserializes the data based on type
251
+ # @param string type Data type
252
+ # @param string value Value to be deserialized
253
+ # @return [Object] Deserialized data
254
+ def _deserialize(type, value)
255
+ case type.to_sym
256
+ when :DateTime
257
+ DateTime.parse(value)
258
+ when :Date
259
+ Date.parse(value)
260
+ when :String
261
+ value.to_s
262
+ when :Integer
263
+ value.to_i
264
+ when :Float
265
+ value.to_f
266
+ when :BOOLEAN
267
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
268
+ true
269
+ else
270
+ false
271
+ end
272
+ when :Object
273
+ # generic object (usually a Hash), return directly
274
+ value
275
+ when /\AArray<(?<inner_type>.+)>\z/
276
+ inner_type = Regexp.last_match[:inner_type]
277
+ value.map { |v| _deserialize(inner_type, v) }
278
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
279
+ k_type = Regexp.last_match[:k_type]
280
+ v_type = Regexp.last_match[:v_type]
281
+ {}.tap do |hash|
282
+ value.each do |k, v|
283
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
284
+ end
285
+ end
286
+ else # model
287
+ MuxRuby.const_get(type).build_from_hash(value)
288
+ end
289
+ end
290
+
291
+ # Returns the string representation of the object
292
+ # @return [String] String presentation of the object
293
+ def to_s
294
+ to_hash.to_s
295
+ end
296
+
297
+ # to_body is an alias to to_hash (backward compatibility)
298
+ # @return [Hash] Returns the object in the form of hash
299
+ def to_body
300
+ to_hash
301
+ end
302
+
303
+ # Returns the object in the form of hash
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_hash
306
+ hash = {}
307
+ self.class.attribute_map.each_pair do |attr, param|
308
+ value = self.send(attr)
309
+ next if value.nil?
310
+ hash[param] = _to_hash(value)
311
+ end
312
+ hash
313
+ end
314
+
315
+ # Outputs non-array value in the form of hash
316
+ # For object, use to_hash. Otherwise, just return the value
317
+ # @param [Object] value Any valid value
318
+ # @return [Hash] Returns the value in the form of hash
319
+ def _to_hash(value)
320
+ if value.is_a?(Array)
321
+ value.compact.map { |v| _to_hash(v) }
322
+ elsif value.is_a?(Hash)
323
+ {}.tap do |hash|
324
+ value.each { |k, v| hash[k] = _to_hash(v) }
325
+ end
326
+ elsif value.respond_to? :to_hash
327
+ value.to_hash
328
+ else
329
+ value
330
+ end
331
+ end
332
+
333
+ end
334
+
335
+ end