mux_ruby 3.15.0 → 3.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) 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/CreateAssetRequest.md +3 -1
  6. data/docs/CreateLiveStreamRequest.md +2 -0
  7. data/docs/CreatePlaybackIDRequest.md +3 -1
  8. data/docs/CreatePlaybackRestrictionRequest.md +3 -1
  9. data/docs/CreateUploadRequest.md +1 -1
  10. data/docs/DRMConfiguration.md +18 -0
  11. data/docs/DRMConfigurationResponse.md +18 -0
  12. data/docs/DRMConfigurationsApi.md +153 -0
  13. data/docs/DeliveryReport.md +2 -0
  14. data/docs/GenerateTrackSubtitlesResponse.md +1 -1
  15. data/docs/ListDRMConfigurationsResponse.md +18 -0
  16. data/docs/MetricsApi.md +8 -8
  17. data/docs/PlaybackID.md +3 -1
  18. data/docs/PlaybackRestriction.md +3 -1
  19. data/docs/PlaybackRestrictionsApi.md +73 -0
  20. data/docs/UpdateLiveStreamNewAssetSettings.md +18 -0
  21. data/docs/UpdateLiveStreamRequest.md +3 -1
  22. data/docs/UpdateUserAgentRestrictionRequest.md +20 -0
  23. data/docs/UserAgentRestrictionRequest.md +20 -0
  24. data/docs/UserAgentRestrictionSettings.md +20 -0
  25. data/docs/VideoView.md +13 -1
  26. data/gen/generator-config.json +1 -1
  27. data/lib/mux_ruby/api/drm_configurations_api.rb +148 -0
  28. data/lib/mux_ruby/api/metrics_api.rb +14 -14
  29. data/lib/mux_ruby/api/playback_restrictions_api.rb +71 -0
  30. data/lib/mux_ruby/models/abridged_video_view.rb +14 -5
  31. data/lib/mux_ruby/models/create_asset_request.rb +14 -2
  32. data/lib/mux_ruby/models/create_live_stream_request.rb +13 -1
  33. data/lib/mux_ruby/models/create_playback_id_request.rb +14 -4
  34. data/lib/mux_ruby/models/create_playback_restriction_request.rb +13 -4
  35. data/lib/mux_ruby/models/create_upload_request.rb +1 -0
  36. data/lib/mux_ruby/models/delivery_report.rb +23 -1
  37. data/lib/mux_ruby/models/drm_configuration.rb +219 -0
  38. data/lib/mux_ruby/models/drm_configuration_response.rb +218 -0
  39. data/lib/mux_ruby/models/generate_track_subtitles_response.rb +4 -2
  40. data/lib/mux_ruby/models/list_drm_configurations_response.rb +220 -0
  41. data/lib/mux_ruby/models/playback_id.rb +14 -4
  42. data/lib/mux_ruby/models/playback_policy.rb +1 -0
  43. data/lib/mux_ruby/models/playback_restriction.rb +13 -4
  44. data/lib/mux_ruby/models/update_live_stream_new_asset_settings.rb +254 -0
  45. data/lib/mux_ruby/models/update_live_stream_request.rb +13 -4
  46. data/lib/mux_ruby/models/update_user_agent_restriction_request.rb +233 -0
  47. data/lib/mux_ruby/models/user_agent_restriction_request.rb +234 -0
  48. data/lib/mux_ruby/models/user_agent_restriction_settings.rb +234 -0
  49. data/lib/mux_ruby/models/video_view.rb +66 -4
  50. data/lib/mux_ruby/version.rb +1 -1
  51. data/lib/mux_ruby.rb +8 -0
  52. data/spec/api/drm_configurations_api_spec.rb +60 -0
  53. data/spec/models/drm_configuration_response_spec.rb +34 -0
  54. data/spec/models/drm_configuration_spec.rb +34 -0
  55. data/spec/models/list_drm_configurations_response_spec.rb +34 -0
  56. data/spec/models/update_live_stream_new_asset_settings_spec.rb +38 -0
  57. data/spec/models/update_user_agent_restriction_request_spec.rb +40 -0
  58. data/spec/models/user_agent_restriction_request_spec.rb +40 -0
  59. data/spec/models/user_agent_restriction_settings_spec.rb +40 -0
  60. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/byebug/byebug.so +0 -0
  61. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +6 -6
  62. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/ffi_c.so +0 -0
  63. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/gem_make.out +6 -6
  64. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/mkmf.log +18 -18
  65. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/gem_make.out +14 -14
  66. 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
  67. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/gem_make.out +6 -6
  68. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/mkmf.log +4 -4
  69. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/psych.so +0 -0
  70. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/gem_make.out +6 -6
  71. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/mkmf.log +2 -2
  72. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/stringio.so +0 -0
  73. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/ext/byebug/Makefile +3 -3
  74. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/lib/byebug/byebug.so +0 -0
  75. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/Makefile +3 -3
  76. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/lib/ffi_c.so +0 -0
  77. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +3 -3
  78. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/lib/jaro_winkler/jaro_winkler_ext.so +0 -0
  79. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/ext/psych/Makefile +3 -3
  80. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/lib/psych.so +0 -0
  81. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/ext/stringio/Makefile +3 -3
  82. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/lib/stringio.so +0 -0
  83. metadata +185 -153
@@ -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
@@ -18,9 +18,12 @@ module MuxRuby
18
18
  # An array of objects that each describe an input file to be used to create the asset. As a shortcut, input can also be a string URL for a file when only one input file is used. See `input[].url` for requirements.
19
19
  attr_accessor :input
20
20
 
21
- # An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: `\"public\"` (anyone with the playback URL can stream the asset). And `\"signed\"` (an additional access token is required to play the asset). If no playback_policy is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy.
21
+ # An array of playback policy names that you want applied to this asset and available through `playback_ids`. Options include: * `\"public\"` (anyone with the playback URL can stream the asset). * `\"signed\"` (an additional access token is required to play the asset). If no `playback_policy` is set, the asset will have no playback IDs and will therefore not be playable. For simplicity, a single string name can be used in place of the array in the case of only one playback policy.
22
22
  attr_accessor :playback_policy
23
23
 
24
+ # An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID.
25
+ attr_accessor :advanced_playback_policies
26
+
24
27
  attr_accessor :per_title_encode
25
28
 
26
29
  # 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**.
@@ -71,6 +74,7 @@ module MuxRuby
71
74
  {
72
75
  :'input' => :'input',
73
76
  :'playback_policy' => :'playback_policy',
77
+ :'advanced_playback_policies' => :'advanced_playback_policies',
74
78
  :'per_title_encode' => :'per_title_encode',
75
79
  :'passthrough' => :'passthrough',
76
80
  :'mp4_support' => :'mp4_support',
@@ -92,6 +96,7 @@ module MuxRuby
92
96
  {
93
97
  :'input' => :'Array<InputSettings>',
94
98
  :'playback_policy' => :'Array<PlaybackPolicy>',
99
+ :'advanced_playback_policies' => :'Array<CreatePlaybackIDRequest>',
95
100
  :'per_title_encode' => :'Boolean',
96
101
  :'passthrough' => :'String',
97
102
  :'mp4_support' => :'String',
@@ -136,6 +141,12 @@ module MuxRuby
136
141
  end
137
142
  end
138
143
 
144
+ if attributes.key?(:'advanced_playback_policies')
145
+ if (value = attributes[:'advanced_playback_policies']).is_a?(Array)
146
+ self.advanced_playback_policies = value
147
+ end
148
+ end
149
+
139
150
  if attributes.key?(:'per_title_encode')
140
151
  self.per_title_encode = attributes[:'per_title_encode']
141
152
  end
@@ -239,6 +250,7 @@ module MuxRuby
239
250
  self.class == o.class &&
240
251
  input == o.input &&
241
252
  playback_policy == o.playback_policy &&
253
+ advanced_playback_policies == o.advanced_playback_policies &&
242
254
  per_title_encode == o.per_title_encode &&
243
255
  passthrough == o.passthrough &&
244
256
  mp4_support == o.mp4_support &&
@@ -258,7 +270,7 @@ module MuxRuby
258
270
  # Calculates hash code according to all attributes.
259
271
  # @return [Integer] Hash code
260
272
  def hash
261
- [input, playback_policy, per_title_encode, passthrough, mp4_support, normalize_audio, master_access, test, max_resolution_tier, encoding_tier].hash
273
+ [input, playback_policy, advanced_playback_policies, per_title_encode, passthrough, mp4_support, normalize_audio, master_access, test, max_resolution_tier, encoding_tier].hash
262
274
  end
263
275
 
264
276
  # Builds the object from hash
@@ -17,6 +17,9 @@ module MuxRuby
17
17
  class CreateLiveStreamRequest
18
18
  attr_accessor :playback_policy
19
19
 
20
+ # An array of playback policy objects that you want applied to this asset and available through `playback_ids`. `advanced_playback_policies` must be used instead of `playback_policy` when creating a DRM playback ID.
21
+ attr_accessor :advanced_playback_policies
22
+
20
23
  attr_accessor :new_asset_settings
21
24
 
22
25
  # When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. Defaults to 60 seconds on the API if not specified. If not specified directly, Standard Latency streams have a Reconnect Window of 60 seconds; Reduced and Low Latency streams have a default of 0 seconds, or no Reconnect Window. For that reason, we suggest specifying a value other than zero for Reduced and Low Latency streams. Reduced and Low Latency streams with a Reconnect Window greater than zero will insert slate media into the recorded asset while waiting for the streaming software to reconnect or when there are brief interruptions in the live stream media. When using a Reconnect Window setting higher than 60 seconds with a Standard Latency stream, we highly recommend enabling slate with the `use_slate_for_standard_latency` option.
@@ -82,6 +85,7 @@ module MuxRuby
82
85
  def self.attribute_map
83
86
  {
84
87
  :'playback_policy' => :'playback_policy',
88
+ :'advanced_playback_policies' => :'advanced_playback_policies',
85
89
  :'new_asset_settings' => :'new_asset_settings',
86
90
  :'reconnect_window' => :'reconnect_window',
87
91
  :'use_slate_for_standard_latency' => :'use_slate_for_standard_latency',
@@ -108,6 +112,7 @@ module MuxRuby
108
112
  def self.openapi_types
109
113
  {
110
114
  :'playback_policy' => :'Array<PlaybackPolicy>',
115
+ :'advanced_playback_policies' => :'Array<CreatePlaybackIDRequest>',
111
116
  :'new_asset_settings' => :'CreateAssetRequest',
112
117
  :'reconnect_window' => :'Float',
113
118
  :'use_slate_for_standard_latency' => :'Boolean',
@@ -152,6 +157,12 @@ module MuxRuby
152
157
  end
153
158
  end
154
159
 
160
+ if attributes.key?(:'advanced_playback_policies')
161
+ if (value = attributes[:'advanced_playback_policies']).is_a?(Array)
162
+ self.advanced_playback_policies = value
163
+ end
164
+ end
165
+
155
166
  if attributes.key?(:'new_asset_settings')
156
167
  self.new_asset_settings = attributes[:'new_asset_settings']
157
168
  end
@@ -300,6 +311,7 @@ module MuxRuby
300
311
  return true if self.equal?(o)
301
312
  self.class == o.class &&
302
313
  playback_policy == o.playback_policy &&
314
+ advanced_playback_policies == o.advanced_playback_policies &&
303
315
  new_asset_settings == o.new_asset_settings &&
304
316
  reconnect_window == o.reconnect_window &&
305
317
  use_slate_for_standard_latency == o.use_slate_for_standard_latency &&
@@ -325,7 +337,7 @@ module MuxRuby
325
337
  # Calculates hash code according to all attributes.
326
338
  # @return [Integer] Hash code
327
339
  def hash
328
- [playback_policy, new_asset_settings, reconnect_window, use_slate_for_standard_latency, reconnect_slate_url, passthrough, audio_only, embedded_subtitles, generated_subtitles, reduced_latency, low_latency, latency_mode, test, simulcast_targets, max_continuous_duration].hash
340
+ [playback_policy, advanced_playback_policies, new_asset_settings, reconnect_window, use_slate_for_standard_latency, reconnect_slate_url, passthrough, audio_only, embedded_subtitles, generated_subtitles, reduced_latency, low_latency, latency_mode, test, simulcast_targets, max_continuous_duration].hash
329
341
  end
330
342
 
331
343
  # Builds the object from hash
@@ -17,10 +17,14 @@ module MuxRuby
17
17
  class CreatePlaybackIDRequest
18
18
  attr_accessor :policy
19
19
 
20
+ # The DRM configuration used by this playback ID. Must only be set when `policy` is set to `drm`.
21
+ attr_accessor :drm_configuration_id
22
+
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
23
- :'policy' => :'policy'
26
+ :'policy' => :'policy',
27
+ :'drm_configuration_id' => :'drm_configuration_id'
24
28
  }
25
29
  end
26
30
 
@@ -32,7 +36,8 @@ module MuxRuby
32
36
  # Attribute type mapping.
33
37
  def self.openapi_types
34
38
  {
35
- :'policy' => :'PlaybackPolicy'
39
+ :'policy' => :'PlaybackPolicy',
40
+ :'drm_configuration_id' => :'String'
36
41
  }
37
42
  end
38
43
 
@@ -60,6 +65,10 @@ module MuxRuby
60
65
  if attributes.key?(:'policy')
61
66
  self.policy = attributes[:'policy']
62
67
  end
68
+
69
+ if attributes.key?(:'drm_configuration_id')
70
+ self.drm_configuration_id = attributes[:'drm_configuration_id']
71
+ end
63
72
  end
64
73
 
65
74
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -80,7 +89,8 @@ module MuxRuby
80
89
  def ==(o)
81
90
  return true if self.equal?(o)
82
91
  self.class == o.class &&
83
- policy == o.policy
92
+ policy == o.policy &&
93
+ drm_configuration_id == o.drm_configuration_id
84
94
  end
85
95
 
86
96
  # @see the `==` method
@@ -92,7 +102,7 @@ module MuxRuby
92
102
  # Calculates hash code according to all attributes.
93
103
  # @return [Integer] Hash code
94
104
  def hash
95
- [policy].hash
105
+ [policy, drm_configuration_id].hash
96
106
  end
97
107
 
98
108
  # Builds the object from hash
@@ -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
@@ -23,6 +23,7 @@ module MuxRuby
23
23
 
24
24
  attr_accessor :new_asset_settings
25
25
 
26
+ # Indicates if this is a test Direct Upload, in which case the Asset that gets created will be a `test` Asset.
26
27
  attr_accessor :test
27
28
 
28
29
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -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
@@ -0,0 +1,219 @@
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 DRMConfiguration
18
+ # Unique identifier for the DRM Configuration. Max 255 characters.
19
+ attr_accessor :id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'id' => :'id'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'id' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::DRMConfiguration` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::DRMConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'id')
62
+ self.id = attributes[:'id']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ id == o.id
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Integer] Hash code
95
+ def hash
96
+ [id].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def self.build_from_hash(attributes)
103
+ new.build_from_hash(attributes)
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = MuxRuby.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end