mux_ruby 1.4.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +37 -35
  4. data/README.md +6 -1
  5. data/docs/Asset.md +3 -1
  6. data/docs/AssetNonStandardInputReasons.md +16 -0
  7. data/docs/AssetRecordingTimes.md +9 -0
  8. data/docs/CreateAssetRequest.md +1 -1
  9. data/docs/CreateLiveStreamRequest.md +2 -0
  10. data/docs/CreateUploadRequest.md +1 -0
  11. data/docs/DimensionValue.md +9 -0
  12. data/docs/DimensionsApi.md +118 -0
  13. data/docs/DisableLiveStreamResponse.md +8 -0
  14. data/docs/EnableLiveStreamResponse.md +8 -0
  15. data/docs/FiltersApi.md +2 -2
  16. data/docs/GetRealTimeBreakdownResponse.md +10 -0
  17. data/docs/GetRealTimeHistogramTimeseriesResponse.md +11 -0
  18. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +8 -0
  19. data/docs/GetRealTimeTimeseriesResponse.md +10 -0
  20. data/docs/Incident.md +28 -0
  21. data/docs/IncidentBreakdown.md +10 -0
  22. data/docs/IncidentNotification.md +10 -0
  23. data/docs/IncidentNotificationRule.md +12 -0
  24. data/docs/IncidentResponse.md +9 -0
  25. data/docs/IncidentsApi.md +186 -0
  26. data/docs/ListDimensionValuesResponse.md +10 -0
  27. data/docs/ListDimensionsResponse.md +10 -0
  28. data/docs/ListIncidentsResponse.md +10 -0
  29. data/docs/ListRealTimeDimensionsResponse.md +10 -0
  30. data/docs/ListRealTimeDimensionsResponseData.md +9 -0
  31. data/docs/ListRealTimeMetricsResponse.md +10 -0
  32. data/docs/ListRelatedIncidentsResponse.md +10 -0
  33. data/docs/LiveStream.md +2 -1
  34. data/docs/LiveStreamsApi.md +104 -0
  35. data/docs/NotificationRule.md +10 -0
  36. data/docs/RealTimeApi.md +280 -0
  37. data/docs/RealTimeBreakdownValue.md +12 -0
  38. data/docs/RealTimeHistogramTimeseriesBucket.md +9 -0
  39. data/docs/RealTimeHistogramTimeseriesBucketValues.md +9 -0
  40. data/docs/RealTimeHistogramTimeseriesDatapoint.md +14 -0
  41. data/docs/RealTimeTimeseriesDatapoint.md +10 -0
  42. data/docs/Upload.md +1 -0
  43. data/docs/VideoView.md +16 -14
  44. data/examples/data/exercise-dimensions.rb +29 -0
  45. data/examples/data/exercise-errors.rb +1 -1
  46. data/examples/data/exercise-incidents.rb +29 -0
  47. data/examples/data/exercise-realtime.rb +60 -0
  48. data/examples/video/exercise-live-streams.rb +22 -0
  49. data/lib/mux_ruby.rb +30 -0
  50. data/lib/mux_ruby/api/dimensions_api.rb +128 -0
  51. data/lib/mux_ruby/api/filters_api.rb +4 -4
  52. data/lib/mux_ruby/api/incidents_api.rb +217 -0
  53. data/lib/mux_ruby/api/live_streams_api.rb +106 -0
  54. data/lib/mux_ruby/api/real_time_api.rb +311 -0
  55. data/lib/mux_ruby/api_client.rb +1 -1
  56. data/lib/mux_ruby/configuration.rb +1 -4
  57. data/lib/mux_ruby/models/asset.rb +46 -13
  58. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +335 -0
  59. data/lib/mux_ruby/models/asset_recording_times.rb +195 -0
  60. data/lib/mux_ruby/models/asset_static_renditions_files.rb +4 -4
  61. data/lib/mux_ruby/models/create_asset_request.rb +13 -13
  62. data/lib/mux_ruby/models/create_live_stream_request.rb +24 -4
  63. data/lib/mux_ruby/models/create_upload_request.rb +13 -4
  64. data/lib/mux_ruby/models/dimension_value.rb +193 -0
  65. data/lib/mux_ruby/models/disable_live_stream_response.rb +184 -0
  66. data/lib/mux_ruby/models/enable_live_stream_response.rb +184 -0
  67. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +206 -0
  68. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +215 -0
  69. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +186 -0
  70. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +206 -0
  71. data/lib/mux_ruby/models/incident.rb +370 -0
  72. data/lib/mux_ruby/models/incident_breakdown.rb +202 -0
  73. data/lib/mux_ruby/models/incident_notification.rb +202 -0
  74. data/lib/mux_ruby/models/incident_notification_rule.rb +222 -0
  75. data/lib/mux_ruby/models/incident_response.rb +195 -0
  76. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +46 -0
  77. data/lib/mux_ruby/models/list_dimension_values_response.rb +206 -0
  78. data/lib/mux_ruby/models/list_dimensions_response.rb +204 -0
  79. data/lib/mux_ruby/models/list_incidents_response.rb +206 -0
  80. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +206 -0
  81. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +193 -0
  82. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +206 -0
  83. data/lib/mux_ruby/models/list_related_incidents_response.rb +206 -0
  84. data/lib/mux_ruby/models/live_stream.rb +14 -5
  85. data/lib/mux_ruby/models/notification_rule.rb +202 -0
  86. data/lib/mux_ruby/models/real_time_breakdown_value.rb +220 -0
  87. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +193 -0
  88. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +193 -0
  89. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +240 -0
  90. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +202 -0
  91. data/lib/mux_ruby/models/upload.rb +13 -4
  92. data/lib/mux_ruby/models/video_view.rb +36 -18
  93. data/lib/mux_ruby/version.rb +1 -1
  94. data/spec/api/dimensions_api_spec.rb +55 -0
  95. data/spec/api/filters_api_spec.rb +2 -2
  96. data/spec/api/incidents_api_spec.rb +73 -0
  97. data/spec/api/live_streams_api_spec.rb +24 -0
  98. data/spec/api/real_time_api_spec.rb +93 -0
  99. data/spec/models/asset_non_standard_input_reasons_spec.rb +98 -0
  100. data/spec/models/asset_recording_times_spec.rb +40 -0
  101. data/spec/models/asset_spec.rb +22 -6
  102. data/spec/models/asset_static_renditions_files_spec.rb +2 -2
  103. data/spec/models/create_asset_request_spec.rb +6 -6
  104. data/spec/models/create_live_stream_request_spec.rb +12 -0
  105. data/spec/models/create_upload_request_spec.rb +6 -0
  106. data/spec/models/dimension_value_spec.rb +40 -0
  107. data/spec/models/disable_live_stream_response_spec.rb +34 -0
  108. data/spec/models/enable_live_stream_response_spec.rb +34 -0
  109. data/spec/models/get_real_time_breakdown_response_spec.rb +46 -0
  110. data/spec/models/get_real_time_histogram_timeseries_response_meta_spec.rb +34 -0
  111. data/spec/models/get_real_time_histogram_timeseries_response_spec.rb +52 -0
  112. data/spec/models/get_real_time_timeseries_response_spec.rb +46 -0
  113. data/spec/models/incident_breakdown_spec.rb +46 -0
  114. data/spec/models/incident_notification_rule_spec.rb +58 -0
  115. data/spec/models/incident_notification_spec.rb +46 -0
  116. data/spec/models/incident_response_spec.rb +40 -0
  117. data/spec/models/incident_spec.rb +154 -0
  118. data/spec/models/input_settings_overlay_settings_spec.rb +8 -0
  119. data/spec/models/list_dimension_values_response_spec.rb +46 -0
  120. data/spec/models/list_dimensions_response_spec.rb +46 -0
  121. data/spec/models/list_incidents_response_spec.rb +46 -0
  122. data/spec/models/list_real_time_dimensions_response_data_spec.rb +40 -0
  123. data/spec/models/list_real_time_dimensions_response_spec.rb +46 -0
  124. data/spec/models/list_real_time_metrics_response_spec.rb +46 -0
  125. data/spec/models/list_related_incidents_response_spec.rb +46 -0
  126. data/spec/models/live_stream_spec.rb +6 -0
  127. data/spec/models/notification_rule_spec.rb +46 -0
  128. data/spec/models/real_time_breakdown_value_spec.rb +58 -0
  129. data/spec/models/real_time_histogram_timeseries_bucket_spec.rb +40 -0
  130. data/spec/models/real_time_histogram_timeseries_bucket_values_spec.rb +40 -0
  131. data/spec/models/real_time_histogram_timeseries_datapoint_spec.rb +70 -0
  132. data/spec/models/real_time_timeseries_datapoint_spec.rb +46 -0
  133. data/spec/models/upload_spec.rb +6 -0
  134. data/spec/models/video_view_spec.rb +12 -0
  135. data/test.sh +28 -0
  136. metadata +181 -58
@@ -27,8 +27,6 @@ module MuxRuby
27
27
 
28
28
  attr_accessor :tracks
29
29
 
30
- attr_accessor :demo
31
-
32
30
  attr_accessor :errors
33
31
 
34
32
  attr_accessor :per_title_encode
@@ -49,6 +47,13 @@ module MuxRuby
49
47
 
50
48
  attr_accessor :static_renditions
51
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
+
55
+ attr_accessor :test
56
+
52
57
  class EnumAttributeValidator
53
58
  attr_reader :datatype
54
59
  attr_reader :allowable_values
@@ -84,7 +89,6 @@ module MuxRuby
84
89
  :'aspect_ratio' => :'aspect_ratio',
85
90
  :'playback_ids' => :'playback_ids',
86
91
  :'tracks' => :'tracks',
87
- :'demo' => :'demo',
88
92
  :'errors' => :'errors',
89
93
  :'per_title_encode' => :'per_title_encode',
90
94
  :'is_live' => :'is_live',
@@ -94,7 +98,10 @@ module MuxRuby
94
98
  :'master_access' => :'master_access',
95
99
  :'mp4_support' => :'mp4_support',
96
100
  :'normalize_audio' => :'normalize_audio',
97
- :'static_renditions' => :'static_renditions'
101
+ :'static_renditions' => :'static_renditions',
102
+ :'recording_times' => :'recording_times',
103
+ :'non_standard_input_reasons' => :'non_standard_input_reasons',
104
+ :'test' => :'test'
98
105
  }
99
106
  end
100
107
 
@@ -111,7 +118,6 @@ module MuxRuby
111
118
  :'aspect_ratio' => :'String',
112
119
  :'playback_ids' => :'Array<PlaybackID>',
113
120
  :'tracks' => :'Array<Track>',
114
- :'demo' => :'BOOLEAN',
115
121
  :'errors' => :'AssetErrors',
116
122
  :'per_title_encode' => :'BOOLEAN',
117
123
  :'is_live' => :'BOOLEAN',
@@ -121,7 +127,10 @@ module MuxRuby
121
127
  :'master_access' => :'String',
122
128
  :'mp4_support' => :'String',
123
129
  :'normalize_audio' => :'BOOLEAN',
124
- :'static_renditions' => :'AssetStaticRenditions'
130
+ :'static_renditions' => :'AssetStaticRenditions',
131
+ :'recording_times' => :'Array<AssetRecordingTimes>',
132
+ :'non_standard_input_reasons' => :'AssetNonStandardInputReasons',
133
+ :'test' => :'BOOLEAN'
125
134
  }
126
135
  end
127
136
 
@@ -177,10 +186,6 @@ module MuxRuby
177
186
  end
178
187
  end
179
188
 
180
- if attributes.has_key?(:'demo')
181
- self.demo = attributes[:'demo']
182
- end
183
-
184
189
  if attributes.has_key?(:'errors')
185
190
  self.errors = attributes[:'errors']
186
191
  end
@@ -226,6 +231,20 @@ module MuxRuby
226
231
  if attributes.has_key?(:'static_renditions')
227
232
  self.static_renditions = attributes[:'static_renditions']
228
233
  end
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
+
245
+ if attributes.has_key?(:'test')
246
+ self.test = attributes[:'test']
247
+ end
229
248
  end
230
249
 
231
250
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -238,6 +257,8 @@ module MuxRuby
238
257
  # Check to see if the all the properties in the model are valid
239
258
  # @return true if the model is valid
240
259
  def valid?
260
+ max_stored_resolution_validator = EnumAttributeValidator.new('String', ['Audio only', 'SD', 'HD', 'FHD', 'UHD'])
261
+ return false unless max_stored_resolution_validator.valid?(@max_stored_resolution)
241
262
  master_access_validator = EnumAttributeValidator.new('String', ['temporary', 'none'])
242
263
  return false unless master_access_validator.valid?(@master_access)
243
264
  mp4_support_validator = EnumAttributeValidator.new('String', ['standard', 'none'])
@@ -245,6 +266,16 @@ module MuxRuby
245
266
  true
246
267
  end
247
268
 
269
+ # Custom attribute writer method checking allowed values (enum).
270
+ # @param [Object] max_stored_resolution Object to be assigned
271
+ def max_stored_resolution=(max_stored_resolution)
272
+ validator = EnumAttributeValidator.new('String', ['Audio only', 'SD', 'HD', 'FHD', 'UHD'])
273
+ unless validator.valid?(max_stored_resolution)
274
+ fail ArgumentError, 'invalid value for "max_stored_resolution", must be one of #{validator.allowable_values}.'
275
+ end
276
+ @max_stored_resolution = max_stored_resolution
277
+ end
278
+
248
279
  # Custom attribute writer method checking allowed values (enum).
249
280
  # @param [Object] master_access Object to be assigned
250
281
  def master_access=(master_access)
@@ -280,7 +311,6 @@ module MuxRuby
280
311
  aspect_ratio == o.aspect_ratio &&
281
312
  playback_ids == o.playback_ids &&
282
313
  tracks == o.tracks &&
283
- demo == o.demo &&
284
314
  errors == o.errors &&
285
315
  per_title_encode == o.per_title_encode &&
286
316
  is_live == o.is_live &&
@@ -290,7 +320,10 @@ module MuxRuby
290
320
  master_access == o.master_access &&
291
321
  mp4_support == o.mp4_support &&
292
322
  normalize_audio == o.normalize_audio &&
293
- static_renditions == o.static_renditions
323
+ static_renditions == o.static_renditions &&
324
+ recording_times == o.recording_times &&
325
+ non_standard_input_reasons == o.non_standard_input_reasons &&
326
+ test == o.test
294
327
  end
295
328
 
296
329
  # @see the `==` method
@@ -302,7 +335,7 @@ module MuxRuby
302
335
  # Calculates hash code according to all attributes.
303
336
  # @return [Fixnum] Hash code
304
337
  def 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
338
+ [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
339
  end
307
340
 
308
341
  # 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