mux_ruby 3.15.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 (59) 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/CreatePlaybackRestrictionRequest.md +3 -1
  6. data/docs/DeliveryReport.md +2 -0
  7. data/docs/GenerateTrackSubtitlesResponse.md +1 -1
  8. data/docs/PlaybackRestriction.md +3 -1
  9. data/docs/PlaybackRestrictionsApi.md +73 -0
  10. data/docs/UpdateLiveStreamNewAssetSettings.md +18 -0
  11. data/docs/UpdateLiveStreamRequest.md +3 -1
  12. data/docs/UpdateUserAgentRestrictionRequest.md +20 -0
  13. data/docs/UserAgentRestrictionRequest.md +20 -0
  14. data/docs/UserAgentRestrictionSettings.md +20 -0
  15. data/docs/VideoView.md +13 -1
  16. data/gen/generator-config.json +1 -1
  17. data/lib/mux_ruby/api/metrics_api.rb +6 -6
  18. data/lib/mux_ruby/api/playback_restrictions_api.rb +71 -0
  19. data/lib/mux_ruby/models/abridged_video_view.rb +14 -5
  20. data/lib/mux_ruby/models/create_playback_restriction_request.rb +13 -4
  21. data/lib/mux_ruby/models/delivery_report.rb +23 -1
  22. data/lib/mux_ruby/models/generate_track_subtitles_response.rb +4 -2
  23. data/lib/mux_ruby/models/playback_restriction.rb +13 -4
  24. data/lib/mux_ruby/models/update_live_stream_new_asset_settings.rb +254 -0
  25. data/lib/mux_ruby/models/update_live_stream_request.rb +13 -4
  26. data/lib/mux_ruby/models/update_user_agent_restriction_request.rb +233 -0
  27. data/lib/mux_ruby/models/user_agent_restriction_request.rb +234 -0
  28. data/lib/mux_ruby/models/user_agent_restriction_settings.rb +234 -0
  29. data/lib/mux_ruby/models/video_view.rb +66 -4
  30. data/lib/mux_ruby/version.rb +1 -1
  31. data/lib/mux_ruby.rb +4 -0
  32. data/spec/models/update_live_stream_new_asset_settings_spec.rb +38 -0
  33. data/spec/models/update_user_agent_restriction_request_spec.rb +40 -0
  34. data/spec/models/user_agent_restriction_request_spec.rb +40 -0
  35. data/spec/models/user_agent_restriction_settings_spec.rb +40 -0
  36. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/byebug/byebug.so +0 -0
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-11.1.3/gem_make.out +6 -6
  38. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/ffi_c.so +0 -0
  39. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/gem_make.out +6 -6
  40. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/ffi-1.16.3/mkmf.log +16 -16
  41. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.4/gem_make.out +14 -14
  42. 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
  43. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/gem_make.out +6 -6
  44. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/mkmf.log +4 -4
  45. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-4.0.4/psych.so +0 -0
  46. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/gem_make.out +6 -6
  47. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/mkmf.log +2 -2
  48. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.0.2/stringio.so +0 -0
  49. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/ext/byebug/Makefile +3 -3
  50. data/vendor/bundle/ruby/3.2.0/gems/byebug-11.1.3/lib/byebug/byebug.so +0 -0
  51. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/ext/ffi_c/Makefile +3 -3
  52. data/vendor/bundle/ruby/3.2.0/gems/ffi-1.16.3/lib/ffi_c.so +0 -0
  53. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +3 -3
  54. data/vendor/bundle/ruby/3.2.0/gems/jaro_winkler-1.5.4/lib/jaro_winkler/jaro_winkler_ext.so +0 -0
  55. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/ext/psych/Makefile +3 -3
  56. data/vendor/bundle/ruby/3.2.0/gems/psych-4.0.4/lib/psych.so +0 -0
  57. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/ext/stringio/Makefile +3 -3
  58. data/vendor/bundle/ruby/3.2.0/gems/stringio-3.0.2/lib/stringio.so +0 -0
  59. metadata +172 -156
@@ -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
@@ -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
@@ -33,6 +33,8 @@ module MuxRuby
33
33
  # The time in seconds a live stream may be continuously active before being disconnected. Defaults to 12 hours.
34
34
  attr_accessor :max_continuous_duration
35
35
 
36
+ attr_accessor :new_asset_settings
37
+
36
38
  class EnumAttributeValidator
37
39
  attr_reader :datatype
38
40
  attr_reader :allowable_values
@@ -63,7 +65,8 @@ module MuxRuby
63
65
  :'reconnect_window' => :'reconnect_window',
64
66
  :'use_slate_for_standard_latency' => :'use_slate_for_standard_latency',
65
67
  :'reconnect_slate_url' => :'reconnect_slate_url',
66
- :'max_continuous_duration' => :'max_continuous_duration'
68
+ :'max_continuous_duration' => :'max_continuous_duration',
69
+ :'new_asset_settings' => :'new_asset_settings'
67
70
  }
68
71
  end
69
72
 
@@ -80,7 +83,8 @@ module MuxRuby
80
83
  :'reconnect_window' => :'Float',
81
84
  :'use_slate_for_standard_latency' => :'Boolean',
82
85
  :'reconnect_slate_url' => :'String',
83
- :'max_continuous_duration' => :'Integer'
86
+ :'max_continuous_duration' => :'Integer',
87
+ :'new_asset_settings' => :'UpdateLiveStreamNewAssetSettings'
84
88
  }
85
89
  end
86
90
 
@@ -134,6 +138,10 @@ module MuxRuby
134
138
  else
135
139
  self.max_continuous_duration = 43200
136
140
  end
141
+
142
+ if attributes.key?(:'new_asset_settings')
143
+ self.new_asset_settings = attributes[:'new_asset_settings']
144
+ end
137
145
  end
138
146
 
139
147
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -219,7 +227,8 @@ module MuxRuby
219
227
  reconnect_window == o.reconnect_window &&
220
228
  use_slate_for_standard_latency == o.use_slate_for_standard_latency &&
221
229
  reconnect_slate_url == o.reconnect_slate_url &&
222
- max_continuous_duration == o.max_continuous_duration
230
+ max_continuous_duration == o.max_continuous_duration &&
231
+ new_asset_settings == o.new_asset_settings
223
232
  end
224
233
 
225
234
  # @see the `==` method
@@ -231,7 +240,7 @@ module MuxRuby
231
240
  # Calculates hash code according to all attributes.
232
241
  # @return [Integer] Hash code
233
242
  def hash
234
- [passthrough, latency_mode, reconnect_window, use_slate_for_standard_latency, reconnect_slate_url, max_continuous_duration].hash
243
+ [passthrough, latency_mode, reconnect_window, use_slate_for_standard_latency, reconnect_slate_url, max_continuous_duration, new_asset_settings].hash
235
244
  end
236
245
 
237
246
  # Builds the object from hash
@@ -0,0 +1,233 @@
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 UpdateUserAgentRestrictionRequest
18
+ # Whether or not to allow views without a `User-Agent` HTTP request header.
19
+ attr_accessor :allow_no_user_agent
20
+
21
+ # Whether or not to allow high risk user agents. The high risk user agents are defined by Mux.
22
+ attr_accessor :allow_high_risk_user_agent
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'allow_no_user_agent' => :'allow_no_user_agent',
28
+ :'allow_high_risk_user_agent' => :'allow_high_risk_user_agent'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'allow_no_user_agent' => :'Boolean',
41
+ :'allow_high_risk_user_agent' => :'Boolean'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::UpdateUserAgentRestrictionRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::UpdateUserAgentRestrictionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'allow_no_user_agent')
67
+ self.allow_no_user_agent = attributes[:'allow_no_user_agent']
68
+ else
69
+ self.allow_no_user_agent = true
70
+ end
71
+
72
+ if attributes.key?(:'allow_high_risk_user_agent')
73
+ self.allow_high_risk_user_agent = attributes[:'allow_high_risk_user_agent']
74
+ else
75
+ self.allow_high_risk_user_agent = true
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ allow_no_user_agent == o.allow_no_user_agent &&
98
+ allow_high_risk_user_agent == o.allow_high_risk_user_agent
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [allow_no_user_agent, allow_high_risk_user_agent].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.openapi_types.each_pair do |key, type|
126
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
127
+ self.send("#{key}=", nil)
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
+ end
137
+ end
138
+
139
+ self
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :Time
149
+ Time.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ # models (e.g. Pet) or oneOf
180
+ klass = MuxRuby.const_get(type)
181
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+
233
+ end