mux_ruby 3.14.0 → 3.16.0

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +4 -4
  4. data/docs/AbridgedVideoView.md +3 -1
  5. data/docs/AssetsApi.md +1 -1
  6. data/docs/CreateAssetRequest.md +1 -1
  7. data/docs/CreatePlaybackRestrictionRequest.md +3 -1
  8. data/docs/DeliveryReport.md +2 -0
  9. data/docs/GenerateTrackSubtitlesResponse.md +1 -1
  10. data/docs/PlaybackRestriction.md +3 -1
  11. data/docs/PlaybackRestrictionsApi.md +73 -0
  12. data/docs/UpdateAssetMP4SupportRequest.md +1 -1
  13. data/docs/UpdateLiveStreamNewAssetSettings.md +18 -0
  14. data/docs/UpdateLiveStreamRequest.md +3 -1
  15. data/docs/UpdateUserAgentRestrictionRequest.md +20 -0
  16. data/docs/UserAgentRestrictionRequest.md +20 -0
  17. data/docs/UserAgentRestrictionSettings.md +20 -0
  18. data/docs/VideoView.md +13 -1
  19. data/gen/generator-config.json +1 -1
  20. data/lib/mux_ruby/api/assets_api.rb +2 -2
  21. data/lib/mux_ruby/api/metrics_api.rb +6 -6
  22. data/lib/mux_ruby/api/playback_restrictions_api.rb +71 -0
  23. data/lib/mux_ruby/models/abridged_video_view.rb +14 -5
  24. data/lib/mux_ruby/models/asset.rb +2 -2
  25. data/lib/mux_ruby/models/asset_static_renditions_files.rb +2 -2
  26. data/lib/mux_ruby/models/create_asset_request.rb +3 -3
  27. data/lib/mux_ruby/models/create_playback_restriction_request.rb +13 -4
  28. data/lib/mux_ruby/models/delivery_report.rb +23 -1
  29. data/lib/mux_ruby/models/generate_track_subtitles_response.rb +4 -2
  30. data/lib/mux_ruby/models/playback_restriction.rb +13 -4
  31. data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +3 -3
  32. data/lib/mux_ruby/models/update_live_stream_new_asset_settings.rb +254 -0
  33. data/lib/mux_ruby/models/update_live_stream_request.rb +13 -4
  34. data/lib/mux_ruby/models/update_user_agent_restriction_request.rb +233 -0
  35. data/lib/mux_ruby/models/user_agent_restriction_request.rb +234 -0
  36. data/lib/mux_ruby/models/user_agent_restriction_settings.rb +234 -0
  37. data/lib/mux_ruby/models/video_view.rb +66 -4
  38. data/lib/mux_ruby/version.rb +1 -1
  39. data/lib/mux_ruby.rb +4 -0
  40. data/spec/models/update_live_stream_new_asset_settings_spec.rb +38 -0
  41. data/spec/models/update_user_agent_restriction_request_spec.rb +40 -0
  42. data/spec/models/user_agent_restriction_request_spec.rb +40 -0
  43. data/spec/models/user_agent_restriction_settings_spec.rb +40 -0
  44. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/byebug/byebug.so +0 -0
  45. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +6 -6
  46. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/ffi_c.so +0 -0
  47. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/gem_make.out +6 -6
  48. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/mkmf.log +16 -16
  49. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/gem_make.out +14 -14
  50. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/jaro_winkler/jaro_winkler_ext.so +0 -0
  51. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/gem_make.out +6 -6
  52. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/mkmf.log +4 -4
  53. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/psych.so +0 -0
  54. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/gem_make.out +6 -6
  55. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/mkmf.log +2 -2
  56. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/stringio.so +0 -0
  57. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/ext/byebug/Makefile +3 -3
  58. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/lib/byebug/byebug.so +0 -0
  59. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/Makefile +3 -3
  60. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/lib/ffi_c.so +0 -0
  61. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +3 -3
  62. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/lib/jaro_winkler/jaro_winkler_ext.so +0 -0
  63. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/ext/psych/Makefile +3 -3
  64. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/lib/psych.so +0 -0
  65. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/ext/stringio/Makefile +3 -3
  66. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/lib/stringio.so +0 -0
  67. metadata +172 -156
@@ -41,6 +41,8 @@ module MuxRuby
41
41
 
42
42
  attr_accessor :watch_time
43
43
 
44
+ attr_accessor :playback_failure
45
+
44
46
  # Attribute mapping from ruby-style variable name to JSON key.
45
47
  def self.attribute_map
46
48
  {
@@ -56,7 +58,8 @@ module MuxRuby
56
58
  :'view_start' => :'view_start',
57
59
  :'view_end' => :'view_end',
58
60
  :'viewer_experience_score' => :'viewer_experience_score',
59
- :'watch_time' => :'watch_time'
61
+ :'watch_time' => :'watch_time',
62
+ :'playback_failure' => :'playback_failure'
60
63
  }
61
64
  end
62
65
 
@@ -80,7 +83,8 @@ module MuxRuby
80
83
  :'view_start' => :'String',
81
84
  :'view_end' => :'String',
82
85
  :'viewer_experience_score' => :'Float',
83
- :'watch_time' => :'Integer'
86
+ :'watch_time' => :'Integer',
87
+ :'playback_failure' => :'Boolean'
84
88
  }
85
89
  end
86
90
 
@@ -95,7 +99,7 @@ module MuxRuby
95
99
  :'error_type_id',
96
100
  :'country_code',
97
101
  :'viewer_experience_score',
98
- :'watch_time'
102
+ :'watch_time',
99
103
  ])
100
104
  end
101
105
 
@@ -165,6 +169,10 @@ module MuxRuby
165
169
  if attributes.key?(:'watch_time')
166
170
  self.watch_time = attributes[:'watch_time']
167
171
  end
172
+
173
+ if attributes.key?(:'playback_failure')
174
+ self.playback_failure = attributes[:'playback_failure']
175
+ end
168
176
  end
169
177
 
170
178
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -197,7 +205,8 @@ module MuxRuby
197
205
  view_start == o.view_start &&
198
206
  view_end == o.view_end &&
199
207
  viewer_experience_score == o.viewer_experience_score &&
200
- watch_time == o.watch_time
208
+ watch_time == o.watch_time &&
209
+ playback_failure == o.playback_failure
201
210
  end
202
211
 
203
212
  # @see the `==` method
@@ -209,7 +218,7 @@ module MuxRuby
209
218
  # Calculates hash code according to all attributes.
210
219
  # @return [Integer] Hash code
211
220
  def hash
212
- [id, viewer_os_family, viewer_application_name, video_title, total_row_count, player_error_message, player_error_code, error_type_id, country_code, view_start, view_end, viewer_experience_score, watch_time].hash
221
+ [id, viewer_os_family, viewer_application_name, video_title, total_row_count, player_error_message, player_error_code, error_type_id, country_code, view_start, view_end, viewer_experience_score, watch_time, playback_failure].hash
213
222
  end
214
223
 
215
224
  # Builds the object from hash
@@ -355,7 +355,7 @@ module MuxRuby
355
355
  return false unless encoding_tier_validator.valid?(@encoding_tier)
356
356
  master_access_validator = EnumAttributeValidator.new('String', ["temporary", "none"])
357
357
  return false unless master_access_validator.valid?(@master_access)
358
- mp4_support_validator = EnumAttributeValidator.new('String', ["standard", "none"])
358
+ mp4_support_validator = EnumAttributeValidator.new('String', ["standard", "none", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
359
359
  return false unless mp4_support_validator.valid?(@mp4_support)
360
360
  ingest_type_validator = EnumAttributeValidator.new('String', ["on_demand_url", "on_demand_direct_upload", "on_demand_clip", "live_rtmp", "live_srt"])
361
361
  return false unless ingest_type_validator.valid?(@ingest_type)
@@ -425,7 +425,7 @@ module MuxRuby
425
425
  # Custom attribute writer method checking allowed values (enum).
426
426
  # @param [Object] mp4_support Object to be assigned
427
427
  def mp4_support=(mp4_support)
428
- validator = EnumAttributeValidator.new('String', ["standard", "none"])
428
+ validator = EnumAttributeValidator.new('String', ["standard", "none", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
429
429
  unless validator.valid?(mp4_support)
430
430
  fail ArgumentError, "invalid value for \"mp4_support\", must be one of #{validator.allowable_values}."
431
431
  end
@@ -139,7 +139,7 @@ module MuxRuby
139
139
  # Check to see if the all the properties in the model are valid
140
140
  # @return true if the model is valid
141
141
  def valid?
142
- name_validator = EnumAttributeValidator.new('String', ["low.mp4", "medium.mp4", "high.mp4", "audio.m4a"])
142
+ name_validator = EnumAttributeValidator.new('String', ["low.mp4", "medium.mp4", "high.mp4", "audio.m4a", "capped-1080p.mp4"])
143
143
  return false unless name_validator.valid?(@name)
144
144
  ext_validator = EnumAttributeValidator.new('String', ["mp4", "m4a"])
145
145
  return false unless ext_validator.valid?(@ext)
@@ -149,7 +149,7 @@ module MuxRuby
149
149
  # Custom attribute writer method checking allowed values (enum).
150
150
  # @param [Object] name Object to be assigned
151
151
  def name=(name)
152
- validator = EnumAttributeValidator.new('String', ["low.mp4", "medium.mp4", "high.mp4", "audio.m4a"])
152
+ validator = EnumAttributeValidator.new('String', ["low.mp4", "medium.mp4", "high.mp4", "audio.m4a", "capped-1080p.mp4"])
153
153
  unless validator.valid?(name)
154
154
  fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
155
155
  end
@@ -26,7 +26,7 @@ module MuxRuby
26
26
  # Arbitrary user-supplied metadata that will be included in the asset details and related webhooks. Can be used to store your own ID for a video along with the asset. **Max: 255 characters**.
27
27
  attr_accessor :passthrough
28
28
 
29
- # Specify what level (if any) of support for mp4 playback. In most cases you should use our default HLS-based streaming playback ({playback_id}.m3u8) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information.
29
+ # Specify what level of support for mp4 playback. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). MP4 files are not produced for `none` (default). In most cases you should use our default HLS-based streaming playback (`{playback_id}.m3u8`) which can automatically adjust to viewers' connection speeds, but an mp4 can be useful for some legacy devices or downloading for offline playback. See the [Download your videos guide](https://docs.mux.com/guides/enable-static-mp4-renditions) for more information.
30
30
  attr_accessor :mp4_support
31
31
 
32
32
  # Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets.
@@ -181,7 +181,7 @@ module MuxRuby
181
181
  # Check to see if the all the properties in the model are valid
182
182
  # @return true if the model is valid
183
183
  def valid?
184
- mp4_support_validator = EnumAttributeValidator.new('String', ["none", "standard"])
184
+ mp4_support_validator = EnumAttributeValidator.new('String', ["none", "standard", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
185
185
  return false unless mp4_support_validator.valid?(@mp4_support)
186
186
  master_access_validator = EnumAttributeValidator.new('String', ["none", "temporary"])
187
187
  return false unless master_access_validator.valid?(@master_access)
@@ -195,7 +195,7 @@ module MuxRuby
195
195
  # Custom attribute writer method checking allowed values (enum).
196
196
  # @param [Object] mp4_support Object to be assigned
197
197
  def mp4_support=(mp4_support)
198
- validator = EnumAttributeValidator.new('String', ["none", "standard"])
198
+ validator = EnumAttributeValidator.new('String', ["none", "standard", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
199
199
  unless validator.valid?(mp4_support)
200
200
  fail ArgumentError, "invalid value for \"mp4_support\", must be one of #{validator.allowable_values}."
201
201
  end
@@ -17,10 +17,13 @@ module MuxRuby
17
17
  class CreatePlaybackRestrictionRequest
18
18
  attr_accessor :referrer
19
19
 
20
+ attr_accessor :user_agent
21
+
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
21
23
  def self.attribute_map
22
24
  {
23
- :'referrer' => :'referrer'
25
+ :'referrer' => :'referrer',
26
+ :'user_agent' => :'user_agent'
24
27
  }
25
28
  end
26
29
 
@@ -32,7 +35,8 @@ module MuxRuby
32
35
  # Attribute type mapping.
33
36
  def self.openapi_types
34
37
  {
35
- :'referrer' => :'ReferrerDomainRestriction'
38
+ :'referrer' => :'ReferrerDomainRestriction',
39
+ :'user_agent' => :'UserAgentRestrictionRequest'
36
40
  }
37
41
  end
38
42
 
@@ -60,6 +64,10 @@ module MuxRuby
60
64
  if attributes.key?(:'referrer')
61
65
  self.referrer = attributes[:'referrer']
62
66
  end
67
+
68
+ if attributes.key?(:'user_agent')
69
+ self.user_agent = attributes[:'user_agent']
70
+ end
63
71
  end
64
72
 
65
73
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -80,7 +88,8 @@ module MuxRuby
80
88
  def ==(o)
81
89
  return true if self.equal?(o)
82
90
  self.class == o.class &&
83
- referrer == o.referrer
91
+ referrer == o.referrer &&
92
+ user_agent == o.user_agent
84
93
  end
85
94
 
86
95
  # @see the `==` method
@@ -92,7 +101,7 @@ module MuxRuby
92
101
  # Calculates hash code according to all attributes.
93
102
  # @return [Integer] Hash code
94
103
  def hash
95
- [referrer].hash
104
+ [referrer, user_agent].hash
96
105
  end
97
106
 
98
107
  # Builds the object from hash
@@ -39,6 +39,9 @@ module MuxRuby
39
39
  # The resolution tier that the asset was ingested at, affecting billing for ingest & storage
40
40
  attr_accessor :asset_resolution_tier
41
41
 
42
+ # The encoding tier that the asset was ingested at. [See the encoding tiers guide for more details.](https://docs.mux.com/guides/use-encoding-tiers)
43
+ attr_accessor :asset_encoding_tier
44
+
42
45
  # Total number of delivered seconds during this time window.
43
46
  attr_accessor :delivered_seconds
44
47
 
@@ -77,6 +80,7 @@ module MuxRuby
77
80
  :'asset_state' => :'asset_state',
78
81
  :'asset_duration' => :'asset_duration',
79
82
  :'asset_resolution_tier' => :'asset_resolution_tier',
83
+ :'asset_encoding_tier' => :'asset_encoding_tier',
80
84
  :'delivered_seconds' => :'delivered_seconds',
81
85
  :'delivered_seconds_by_resolution' => :'delivered_seconds_by_resolution'
82
86
  }
@@ -98,6 +102,7 @@ module MuxRuby
98
102
  :'asset_state' => :'String',
99
103
  :'asset_duration' => :'Float',
100
104
  :'asset_resolution_tier' => :'String',
105
+ :'asset_encoding_tier' => :'String',
101
106
  :'delivered_seconds' => :'Float',
102
107
  :'delivered_seconds_by_resolution' => :'DeliveryReportDeliveredSecondsByResolution'
103
108
  }
@@ -156,6 +161,10 @@ module MuxRuby
156
161
  self.asset_resolution_tier = attributes[:'asset_resolution_tier']
157
162
  end
158
163
 
164
+ if attributes.key?(:'asset_encoding_tier')
165
+ self.asset_encoding_tier = attributes[:'asset_encoding_tier']
166
+ end
167
+
159
168
  if attributes.key?(:'delivered_seconds')
160
169
  self.delivered_seconds = attributes[:'delivered_seconds']
161
170
  end
@@ -179,6 +188,8 @@ module MuxRuby
179
188
  return false unless asset_state_validator.valid?(@asset_state)
180
189
  asset_resolution_tier_validator = EnumAttributeValidator.new('String', ["audio-only", "720p", "1080p", "1440p", "2160p"])
181
190
  return false unless asset_resolution_tier_validator.valid?(@asset_resolution_tier)
191
+ asset_encoding_tier_validator = EnumAttributeValidator.new('String', ["smart", "baseline"])
192
+ return false unless asset_encoding_tier_validator.valid?(@asset_encoding_tier)
182
193
  true
183
194
  end
184
195
 
@@ -202,6 +213,16 @@ module MuxRuby
202
213
  @asset_resolution_tier = asset_resolution_tier
203
214
  end
204
215
 
216
+ # Custom attribute writer method checking allowed values (enum).
217
+ # @param [Object] asset_encoding_tier Object to be assigned
218
+ def asset_encoding_tier=(asset_encoding_tier)
219
+ validator = EnumAttributeValidator.new('String', ["smart", "baseline"])
220
+ unless validator.valid?(asset_encoding_tier)
221
+ fail ArgumentError, "invalid value for \"asset_encoding_tier\", must be one of #{validator.allowable_values}."
222
+ end
223
+ @asset_encoding_tier = asset_encoding_tier
224
+ end
225
+
205
226
  # Checks equality by comparing each attribute.
206
227
  # @param [Object] Object to be compared
207
228
  def ==(o)
@@ -215,6 +236,7 @@ module MuxRuby
215
236
  asset_state == o.asset_state &&
216
237
  asset_duration == o.asset_duration &&
217
238
  asset_resolution_tier == o.asset_resolution_tier &&
239
+ asset_encoding_tier == o.asset_encoding_tier &&
218
240
  delivered_seconds == o.delivered_seconds &&
219
241
  delivered_seconds_by_resolution == o.delivered_seconds_by_resolution
220
242
  end
@@ -228,7 +250,7 @@ module MuxRuby
228
250
  # Calculates hash code according to all attributes.
229
251
  # @return [Integer] Hash code
230
252
  def hash
231
- [live_stream_id, asset_id, passthrough, created_at, deleted_at, asset_state, asset_duration, asset_resolution_tier, delivered_seconds, delivered_seconds_by_resolution].hash
253
+ [live_stream_id, asset_id, passthrough, created_at, deleted_at, asset_state, asset_duration, asset_resolution_tier, asset_encoding_tier, delivered_seconds, delivered_seconds_by_resolution].hash
232
254
  end
233
255
 
234
256
  # Builds the object from hash
@@ -32,7 +32,7 @@ module MuxRuby
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'data' => :'Track'
35
+ :'data' => :'Array<Track>'
36
36
  }
37
37
  end
38
38
 
@@ -58,7 +58,9 @@ module MuxRuby
58
58
  }
59
59
 
60
60
  if attributes.key?(:'data')
61
- self.data = attributes[:'data']
61
+ if (value = attributes[:'data']).is_a?(Array)
62
+ self.data = value
63
+ end
62
64
  end
63
65
  end
64
66
 
@@ -26,13 +26,16 @@ module MuxRuby
26
26
 
27
27
  attr_accessor :referrer
28
28
 
29
+ attr_accessor :user_agent
30
+
29
31
  # Attribute mapping from ruby-style variable name to JSON key.
30
32
  def self.attribute_map
31
33
  {
32
34
  :'id' => :'id',
33
35
  :'created_at' => :'created_at',
34
36
  :'updated_at' => :'updated_at',
35
- :'referrer' => :'referrer'
37
+ :'referrer' => :'referrer',
38
+ :'user_agent' => :'user_agent'
36
39
  }
37
40
  end
38
41
 
@@ -47,7 +50,8 @@ module MuxRuby
47
50
  :'id' => :'String',
48
51
  :'created_at' => :'String',
49
52
  :'updated_at' => :'String',
50
- :'referrer' => :'ReferrerDomainRestriction'
53
+ :'referrer' => :'ReferrerDomainRestriction',
54
+ :'user_agent' => :'UserAgentRestrictionSettings'
51
55
  }
52
56
  end
53
57
 
@@ -87,6 +91,10 @@ module MuxRuby
87
91
  if attributes.key?(:'referrer')
88
92
  self.referrer = attributes[:'referrer']
89
93
  end
94
+
95
+ if attributes.key?(:'user_agent')
96
+ self.user_agent = attributes[:'user_agent']
97
+ end
90
98
  end
91
99
 
92
100
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -110,7 +118,8 @@ module MuxRuby
110
118
  id == o.id &&
111
119
  created_at == o.created_at &&
112
120
  updated_at == o.updated_at &&
113
- referrer == o.referrer
121
+ referrer == o.referrer &&
122
+ user_agent == o.user_agent
114
123
  end
115
124
 
116
125
  # @see the `==` method
@@ -122,7 +131,7 @@ module MuxRuby
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [id, created_at, updated_at, referrer].hash
134
+ [id, created_at, updated_at, referrer, user_agent].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module MuxRuby
17
17
  class UpdateAssetMP4SupportRequest
18
- # String value for the level of mp4 support
18
+ # Specify what level of support for mp4 playback. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset). `none` will delete the MP4s from the asset in question.
19
19
  attr_accessor :mp4_support
20
20
 
21
21
  class EnumAttributeValidator
@@ -95,7 +95,7 @@ module MuxRuby
95
95
  # Check to see if the all the properties in the model are valid
96
96
  # @return true if the model is valid
97
97
  def valid?
98
- mp4_support_validator = EnumAttributeValidator.new('String', ["standard", "none"])
98
+ mp4_support_validator = EnumAttributeValidator.new('String', ["standard", "none", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
99
99
  return false unless mp4_support_validator.valid?(@mp4_support)
100
100
  true
101
101
  end
@@ -103,7 +103,7 @@ module MuxRuby
103
103
  # Custom attribute writer method checking allowed values (enum).
104
104
  # @param [Object] mp4_support Object to be assigned
105
105
  def mp4_support=(mp4_support)
106
- validator = EnumAttributeValidator.new('String', ["standard", "none"])
106
+ validator = EnumAttributeValidator.new('String', ["standard", "none", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
107
107
  unless validator.valid?(mp4_support)
108
108
  fail ArgumentError, "invalid value for \"mp4_support\", must be one of #{validator.allowable_values}."
109
109
  end
@@ -0,0 +1,254 @@
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
+ # Updates the new asset settings to use to generate a new asset for this live stream. Only the `mp4_support` setting may be updated.
18
+ class UpdateLiveStreamNewAssetSettings
19
+ # Specify what level of support for mp4 playback should be added to new assets generated from this live stream. * The `none` option disables MP4 support for new assets. MP4 files will not be produced for an asset generated from this live stream. * The `capped-1080p` option produces a single MP4 file, called `capped-1080p.mp4`, with the video resolution capped at 1080p. This option produces an `audio.m4a` file for an audio-only asset. * The `audio-only` option produces a single M4A file, called `audio.m4a` for a video or an audio-only asset. MP4 generation will error when this option is specified for a video-only asset. * The `audio-only,capped-1080p` option produces both the `audio.m4a` and `capped-1080p.mp4` files. Only the `capped-1080p.mp4` file is produced for a video-only asset, while only the `audio.m4a` file is produced for an audio-only asset. * The `standard`(deprecated) option produces up to three MP4 files with different levels of resolution (`high.mp4`, `medium.mp4`, `low.mp4`, or `audio.m4a` for an audio-only asset).
20
+ attr_accessor :mp4_support
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'mp4_support' => :'mp4_support'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'mp4_support' => :'String'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::UpdateLiveStreamNewAssetSettings` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!self.class.attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::UpdateLiveStreamNewAssetSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'mp4_support')
85
+ self.mp4_support = attributes[:'mp4_support']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ mp4_support_validator = EnumAttributeValidator.new('String', ["none", "standard", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
100
+ return false unless mp4_support_validator.valid?(@mp4_support)
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method checking allowed values (enum).
105
+ # @param [Object] mp4_support Object to be assigned
106
+ def mp4_support=(mp4_support)
107
+ validator = EnumAttributeValidator.new('String', ["none", "standard", "capped-1080p", "audio-only", "audio-only,capped-1080p"])
108
+ unless validator.valid?(mp4_support)
109
+ fail ArgumentError, "invalid value for \"mp4_support\", must be one of #{validator.allowable_values}."
110
+ end
111
+ @mp4_support = mp4_support
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ mp4_support == o.mp4_support
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [mp4_support].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.openapi_types.each_pair do |key, type|
147
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
148
+ self.send("#{key}=", nil)
149
+ elsif type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
154
+ end
155
+ elsif !attributes[self.class.attribute_map[key]].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
+ end
158
+ end
159
+
160
+ self
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :Time
170
+ Time.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :Boolean
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ # models (e.g. Pet) or oneOf
201
+ klass = MuxRuby.const_get(type)
202
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
203
+ end
204
+ end
205
+
206
+ # Returns the string representation of the object
207
+ # @return [String] String presentation of the object
208
+ def to_s
209
+ to_hash.to_s
210
+ end
211
+
212
+ # to_body is an alias to to_hash (backward compatibility)
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_body
215
+ to_hash
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+
254
+ end