mux_ruby 1.4.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,195 @@
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 AssetRecordingTimes
10
+ # The time at which the recording for the live stream started. The time value is Unix epoch time represented in ISO 8601 format
11
+ attr_accessor :started_at
12
+
13
+ # The duration of the live stream recorded. The time value is in seconds
14
+ attr_accessor :duration
15
+
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ :'started_at' => :'started_at',
20
+ :'duration' => :'duration'
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.openapi_types
26
+ {
27
+ :'started_at' => :'DateTime',
28
+ :'duration' => :'Float'
29
+ }
30
+ end
31
+
32
+ # Initializes the object
33
+ # @param [Hash] attributes Model attributes in the form of hash
34
+ def initialize(attributes = {})
35
+ return unless attributes.is_a?(Hash)
36
+
37
+ # convert string to symbol for hash key
38
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
39
+
40
+ if attributes.has_key?(:'started_at')
41
+ self.started_at = attributes[:'started_at']
42
+ end
43
+
44
+ if attributes.has_key?(:'duration')
45
+ self.duration = attributes[:'duration']
46
+ end
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properties with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ true
60
+ end
61
+
62
+ # Checks equality by comparing each attribute.
63
+ # @param [Object] Object to be compared
64
+ def ==(o)
65
+ return true if self.equal?(o)
66
+ self.class == o.class &&
67
+ started_at == o.started_at &&
68
+ duration == o.duration
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] Object to be compared
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [started_at, duration].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def self.build_from_hash(attributes)
87
+ new.build_from_hash(attributes)
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.openapi_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ MuxRuby.const_get(type).build_from_hash(value)
148
+ end
149
+ end
150
+
151
+ # Returns the string representation of the object
152
+ # @return [String] String presentation of the object
153
+ def to_s
154
+ to_hash.to_s
155
+ end
156
+
157
+ # to_body is an alias to to_hash (backward compatibility)
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_body
160
+ to_hash
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ next if value.nil?
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+
193
+ end
194
+
195
+ end
@@ -112,9 +112,9 @@ module MuxRuby
112
112
  # Check to see if the all the properties in the model are valid
113
113
  # @return true if the model is valid
114
114
  def valid?
115
- name_validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4'])
115
+ name_validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4', 'audio.m4a'])
116
116
  return false unless name_validator.valid?(@name)
117
- ext_validator = EnumAttributeValidator.new('String', ['mp4'])
117
+ ext_validator = EnumAttributeValidator.new('String', ['mp4', 'm4a'])
118
118
  return false unless ext_validator.valid?(@ext)
119
119
  true
120
120
  end
@@ -122,7 +122,7 @@ module MuxRuby
122
122
  # Custom attribute writer method checking allowed values (enum).
123
123
  # @param [Object] name Object to be assigned
124
124
  def name=(name)
125
- validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4'])
125
+ validator = EnumAttributeValidator.new('String', ['low.mp4', 'medium.mp4', 'high.mp4', 'audio.m4a'])
126
126
  unless validator.valid?(name)
127
127
  fail ArgumentError, 'invalid value for "name", must be one of #{validator.allowable_values}.'
128
128
  end
@@ -132,7 +132,7 @@ module MuxRuby
132
132
  # Custom attribute writer method checking allowed values (enum).
133
133
  # @param [Object] ext Object to be assigned
134
134
  def ext=(ext)
135
- validator = EnumAttributeValidator.new('String', ['mp4'])
135
+ validator = EnumAttributeValidator.new('String', ['mp4', 'm4a'])
136
136
  unless validator.valid?(ext)
137
137
  fail ArgumentError, 'invalid value for "ext", must be one of #{validator.allowable_values}.'
138
138
  end
@@ -11,8 +11,6 @@ module MuxRuby
11
11
 
12
12
  attr_accessor :playback_policy
13
13
 
14
- attr_accessor :demo
15
-
16
14
  attr_accessor :per_title_encode
17
15
 
18
16
  attr_accessor :passthrough
@@ -24,6 +22,8 @@ module MuxRuby
24
22
 
25
23
  attr_accessor :master_access
26
24
 
25
+ attr_accessor :test
26
+
27
27
  class EnumAttributeValidator
28
28
  attr_reader :datatype
29
29
  attr_reader :allowable_values
@@ -51,12 +51,12 @@ module MuxRuby
51
51
  {
52
52
  :'input' => :'input',
53
53
  :'playback_policy' => :'playback_policy',
54
- :'demo' => :'demo',
55
54
  :'per_title_encode' => :'per_title_encode',
56
55
  :'passthrough' => :'passthrough',
57
56
  :'mp4_support' => :'mp4_support',
58
57
  :'normalize_audio' => :'normalize_audio',
59
- :'master_access' => :'master_access'
58
+ :'master_access' => :'master_access',
59
+ :'test' => :'test'
60
60
  }
61
61
  end
62
62
 
@@ -65,12 +65,12 @@ module MuxRuby
65
65
  {
66
66
  :'input' => :'Array<InputSettings>',
67
67
  :'playback_policy' => :'Array<PlaybackPolicy>',
68
- :'demo' => :'BOOLEAN',
69
68
  :'per_title_encode' => :'BOOLEAN',
70
69
  :'passthrough' => :'String',
71
70
  :'mp4_support' => :'String',
72
71
  :'normalize_audio' => :'BOOLEAN',
73
- :'master_access' => :'String'
72
+ :'master_access' => :'String',
73
+ :'test' => :'BOOLEAN'
74
74
  }
75
75
  end
76
76
 
@@ -94,10 +94,6 @@ module MuxRuby
94
94
  end
95
95
  end
96
96
 
97
- if attributes.has_key?(:'demo')
98
- self.demo = attributes[:'demo']
99
- end
100
-
101
97
  if attributes.has_key?(:'per_title_encode')
102
98
  self.per_title_encode = attributes[:'per_title_encode']
103
99
  end
@@ -119,6 +115,10 @@ module MuxRuby
119
115
  if attributes.has_key?(:'master_access')
120
116
  self.master_access = attributes[:'master_access']
121
117
  end
118
+
119
+ if attributes.has_key?(:'test')
120
+ self.test = attributes[:'test']
121
+ end
122
122
  end
123
123
 
124
124
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -165,12 +165,12 @@ module MuxRuby
165
165
  self.class == o.class &&
166
166
  input == o.input &&
167
167
  playback_policy == o.playback_policy &&
168
- demo == o.demo &&
169
168
  per_title_encode == o.per_title_encode &&
170
169
  passthrough == o.passthrough &&
171
170
  mp4_support == o.mp4_support &&
172
171
  normalize_audio == o.normalize_audio &&
173
- master_access == o.master_access
172
+ master_access == o.master_access &&
173
+ test == o.test
174
174
  end
175
175
 
176
176
  # @see the `==` method
@@ -182,7 +182,7 @@ module MuxRuby
182
182
  # Calculates hash code according to all attributes.
183
183
  # @return [Fixnum] Hash code
184
184
  def hash
185
- [input, playback_policy, demo, per_title_encode, passthrough, mp4_support, normalize_audio, master_access].hash
185
+ [input, playback_policy, per_title_encode, passthrough, mp4_support, normalize_audio, master_access, test].hash
186
186
  end
187
187
 
188
188
  # Builds the object from hash
@@ -19,6 +19,10 @@ module MuxRuby
19
19
  # Latency is the time from when the streamer does something in real life to when you see it happen in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/
20
20
  attr_accessor :reduced_latency
21
21
 
22
+ attr_accessor :test
23
+
24
+ attr_accessor :simulcast_targets
25
+
22
26
  # Attribute mapping from ruby-style variable name to JSON key.
23
27
  def self.attribute_map
24
28
  {
@@ -26,7 +30,9 @@ module MuxRuby
26
30
  :'new_asset_settings' => :'new_asset_settings',
27
31
  :'reconnect_window' => :'reconnect_window',
28
32
  :'passthrough' => :'passthrough',
29
- :'reduced_latency' => :'reduced_latency'
33
+ :'reduced_latency' => :'reduced_latency',
34
+ :'test' => :'test',
35
+ :'simulcast_targets' => :'simulcast_targets'
30
36
  }
31
37
  end
32
38
 
@@ -37,7 +43,9 @@ module MuxRuby
37
43
  :'new_asset_settings' => :'CreateAssetRequest',
38
44
  :'reconnect_window' => :'Float',
39
45
  :'passthrough' => :'String',
40
- :'reduced_latency' => :'BOOLEAN'
46
+ :'reduced_latency' => :'BOOLEAN',
47
+ :'test' => :'BOOLEAN',
48
+ :'simulcast_targets' => :'Array<CreateSimulcastTargetRequest>'
41
49
  }
42
50
  end
43
51
 
@@ -70,6 +78,16 @@ module MuxRuby
70
78
  if attributes.has_key?(:'reduced_latency')
71
79
  self.reduced_latency = attributes[:'reduced_latency']
72
80
  end
81
+
82
+ if attributes.has_key?(:'test')
83
+ self.test = attributes[:'test']
84
+ end
85
+
86
+ if attributes.has_key?(:'simulcast_targets')
87
+ if (value = attributes[:'simulcast_targets']).is_a?(Array)
88
+ self.simulcast_targets = value
89
+ end
90
+ end
73
91
  end
74
92
 
75
93
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -118,7 +136,9 @@ module MuxRuby
118
136
  new_asset_settings == o.new_asset_settings &&
119
137
  reconnect_window == o.reconnect_window &&
120
138
  passthrough == o.passthrough &&
121
- reduced_latency == o.reduced_latency
139
+ reduced_latency == o.reduced_latency &&
140
+ test == o.test &&
141
+ simulcast_targets == o.simulcast_targets
122
142
  end
123
143
 
124
144
  # @see the `==` method
@@ -130,7 +150,7 @@ module MuxRuby
130
150
  # Calculates hash code according to all attributes.
131
151
  # @return [Fixnum] Hash code
132
152
  def hash
133
- [playback_policy, new_asset_settings, reconnect_window, passthrough, reduced_latency].hash
153
+ [playback_policy, new_asset_settings, reconnect_window, passthrough, reduced_latency, test, simulcast_targets].hash
134
154
  end
135
155
 
136
156
  # Builds the object from hash
@@ -15,12 +15,15 @@ module MuxRuby
15
15
 
16
16
  attr_accessor :new_asset_settings
17
17
 
18
+ attr_accessor :test
19
+
18
20
  # Attribute mapping from ruby-style variable name to JSON key.
19
21
  def self.attribute_map
20
22
  {
21
23
  :'timeout' => :'timeout',
22
24
  :'cors_origin' => :'cors_origin',
23
- :'new_asset_settings' => :'new_asset_settings'
25
+ :'new_asset_settings' => :'new_asset_settings',
26
+ :'test' => :'test'
24
27
  }
25
28
  end
26
29
 
@@ -29,7 +32,8 @@ module MuxRuby
29
32
  {
30
33
  :'timeout' => :'Integer',
31
34
  :'cors_origin' => :'String',
32
- :'new_asset_settings' => :'CreateAssetRequest'
35
+ :'new_asset_settings' => :'CreateAssetRequest',
36
+ :'test' => :'BOOLEAN'
33
37
  }
34
38
  end
35
39
 
@@ -54,6 +58,10 @@ module MuxRuby
54
58
  if attributes.has_key?(:'new_asset_settings')
55
59
  self.new_asset_settings = attributes[:'new_asset_settings']
56
60
  end
61
+
62
+ if attributes.has_key?(:'test')
63
+ self.test = attributes[:'test']
64
+ end
57
65
  end
58
66
 
59
67
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,7 +113,8 @@ module MuxRuby
105
113
  self.class == o.class &&
106
114
  timeout == o.timeout &&
107
115
  cors_origin == o.cors_origin &&
108
- new_asset_settings == o.new_asset_settings
116
+ new_asset_settings == o.new_asset_settings &&
117
+ test == o.test
109
118
  end
110
119
 
111
120
  # @see the `==` method
@@ -117,7 +126,7 @@ module MuxRuby
117
126
  # Calculates hash code according to all attributes.
118
127
  # @return [Fixnum] Hash code
119
128
  def hash
120
- [timeout, cors_origin, new_asset_settings].hash
129
+ [timeout, cors_origin, new_asset_settings, test].hash
121
130
  end
122
131
 
123
132
  # Builds the object from hash
@@ -0,0 +1,193 @@
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 DimensionValue
10
+ attr_accessor :value
11
+
12
+ attr_accessor :total_count
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :'value' => :'value',
18
+ :'total_count' => :'total_count'
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.openapi_types
24
+ {
25
+ :'value' => :'String',
26
+ :'total_count' => :'Integer'
27
+ }
28
+ end
29
+
30
+ # Initializes the object
31
+ # @param [Hash] attributes Model attributes in the form of hash
32
+ def initialize(attributes = {})
33
+ return unless attributes.is_a?(Hash)
34
+
35
+ # convert string to symbol for hash key
36
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
37
+
38
+ if attributes.has_key?(:'value')
39
+ self.value = attributes[:'value']
40
+ end
41
+
42
+ if attributes.has_key?(:'total_count')
43
+ self.total_count = attributes[:'total_count']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ invalid_properties
52
+ end
53
+
54
+ # Check to see if the all the properties in the model are valid
55
+ # @return true if the model is valid
56
+ def valid?
57
+ true
58
+ end
59
+
60
+ # Checks equality by comparing each attribute.
61
+ # @param [Object] Object to be compared
62
+ def ==(o)
63
+ return true if self.equal?(o)
64
+ self.class == o.class &&
65
+ value == o.value &&
66
+ total_count == o.total_count
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [value, total_count].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def self.build_from_hash(attributes)
85
+ new.build_from_hash(attributes)
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.openapi_types.each_pair do |key, type|
94
+ if type =~ /\AArray<(.*)>/i
95
+ # check to ensure the input is an array given that the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ # Deserializes the data based on type
109
+ # @param string type Data type
110
+ # @param string value Value to be deserialized
111
+ # @return [Object] Deserialized data
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ MuxRuby.const_get(type).build_from_hash(value)
146
+ end
147
+ end
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # to_body is an alias to to_hash (backward compatibility)
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_body
158
+ to_hash
159
+ end
160
+
161
+ # Returns the object in the form of hash
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_hash
164
+ hash = {}
165
+ self.class.attribute_map.each_pair do |attr, param|
166
+ value = self.send(attr)
167
+ next if value.nil?
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map { |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+
191
+ end
192
+
193
+ end