mux_ruby 1.9.0 → 2.0.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (268) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +26 -37
  4. data/README.md +36 -13
  5. data/docs/AbridgedVideoView.md +33 -13
  6. data/docs/Asset.md +57 -26
  7. data/docs/AssetErrors.md +15 -4
  8. data/docs/AssetMaster.md +15 -4
  9. data/docs/AssetNonStandardInputReasons.md +29 -11
  10. data/docs/AssetRecordingTimes.md +15 -4
  11. data/docs/AssetResponse.md +13 -3
  12. data/docs/AssetStaticRenditions.md +15 -4
  13. data/docs/AssetStaticRenditionsFiles.md +23 -8
  14. data/docs/AssetsApi.md +387 -160
  15. data/docs/BreakdownValue.md +21 -7
  16. data/docs/CreateAssetRequest.md +27 -10
  17. data/docs/CreateLiveStreamRequest.md +25 -9
  18. data/docs/CreatePlaybackIDRequest.md +13 -3
  19. data/docs/CreatePlaybackIDResponse.md +13 -3
  20. data/docs/CreateSimulcastTargetRequest.md +17 -5
  21. data/docs/CreateTrackRequest.md +25 -9
  22. data/docs/CreateTrackResponse.md +13 -3
  23. data/docs/CreateUploadRequest.md +19 -6
  24. data/docs/DeliveryReport.md +27 -9
  25. data/docs/DeliveryUsageApi.md +40 -22
  26. data/docs/DimensionValue.md +15 -4
  27. data/docs/DimensionsApi.md +72 -34
  28. data/docs/DirectUploadsApi.md +131 -56
  29. data/docs/DisableLiveStreamResponse.md +13 -3
  30. data/docs/EnableLiveStreamResponse.md +13 -3
  31. data/docs/Error.md +27 -10
  32. data/docs/ErrorsApi.md +37 -19
  33. data/docs/ExportsApi.md +32 -13
  34. data/docs/FilterValue.md +15 -4
  35. data/docs/FiltersApi.md +71 -33
  36. data/docs/GetAssetInputInfoResponse.md +13 -3
  37. data/docs/GetAssetOrLiveStreamIdResponse.md +13 -3
  38. data/docs/GetAssetOrLiveStreamIdResponseData.md +17 -5
  39. data/docs/GetAssetOrLiveStreamIdResponseDataObject.md +15 -4
  40. data/docs/GetAssetPlaybackIDResponse.md +13 -3
  41. data/docs/GetMetricTimeseriesDataResponse.md +17 -5
  42. data/docs/GetOverallValuesResponse.md +17 -5
  43. data/docs/GetRealTimeBreakdownResponse.md +17 -5
  44. data/docs/GetRealTimeHistogramTimeseriesResponse.md +19 -6
  45. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +13 -3
  46. data/docs/GetRealTimeTimeseriesResponse.md +17 -5
  47. data/docs/Incident.md +53 -23
  48. data/docs/IncidentBreakdown.md +17 -5
  49. data/docs/IncidentNotification.md +17 -5
  50. data/docs/IncidentNotificationRule.md +21 -7
  51. data/docs/IncidentResponse.md +15 -4
  52. data/docs/IncidentsApi.md +115 -59
  53. data/docs/InputFile.md +15 -4
  54. data/docs/InputInfo.md +15 -4
  55. data/docs/InputSettings.md +31 -12
  56. data/docs/InputSettingsOverlaySettings.md +25 -9
  57. data/docs/InputTrack.md +29 -11
  58. data/docs/Insight.md +23 -8
  59. data/docs/ListAllMetricValuesResponse.md +17 -5
  60. data/docs/ListAssetsResponse.md +13 -3
  61. data/docs/ListBreakdownValuesResponse.md +17 -5
  62. data/docs/ListDeliveryUsageResponse.md +19 -6
  63. data/docs/ListDimensionValuesResponse.md +17 -5
  64. data/docs/ListDimensionsResponse.md +17 -5
  65. data/docs/ListErrorsResponse.md +17 -5
  66. data/docs/ListExportsResponse.md +17 -5
  67. data/docs/ListFilterValuesResponse.md +17 -5
  68. data/docs/ListFiltersResponse.md +17 -5
  69. data/docs/ListFiltersResponseData.md +15 -4
  70. data/docs/ListIncidentsResponse.md +17 -5
  71. data/docs/ListInsightsResponse.md +17 -5
  72. data/docs/ListLiveStreamsResponse.md +13 -3
  73. data/docs/ListRealTimeDimensionsResponse.md +17 -5
  74. data/docs/ListRealTimeDimensionsResponseData.md +15 -4
  75. data/docs/ListRealTimeMetricsResponse.md +17 -5
  76. data/docs/ListRelatedIncidentsResponse.md +17 -5
  77. data/docs/ListSigningKeysResponse.md +13 -3
  78. data/docs/ListUploadsResponse.md +13 -3
  79. data/docs/ListVideoViewsResponse.md +17 -5
  80. data/docs/LiveStream.md +37 -15
  81. data/docs/LiveStreamResponse.md +13 -3
  82. data/docs/LiveStreamsApi.md +418 -170
  83. data/docs/Metric.md +21 -7
  84. data/docs/MetricsApi.md +206 -112
  85. data/docs/NotificationRule.md +17 -5
  86. data/docs/OverallValues.md +19 -6
  87. data/docs/PlaybackID.md +15 -4
  88. data/docs/PlaybackIDApi.md +34 -16
  89. data/docs/PlaybackPolicy.md +10 -2
  90. data/docs/RealTimeApi.md +172 -76
  91. data/docs/RealTimeBreakdownValue.md +21 -7
  92. data/docs/RealTimeHistogramTimeseriesBucket.md +15 -4
  93. data/docs/RealTimeHistogramTimeseriesBucketValues.md +15 -4
  94. data/docs/RealTimeHistogramTimeseriesDatapoint.md +25 -9
  95. data/docs/RealTimeTimeseriesDatapoint.md +17 -5
  96. data/docs/Score.md +23 -8
  97. data/docs/SignalLiveStreamCompleteResponse.md +13 -3
  98. data/docs/SigningKey.md +17 -5
  99. data/docs/SigningKeyResponse.md +13 -3
  100. data/docs/SimulcastTarget.md +21 -7
  101. data/docs/SimulcastTargetResponse.md +13 -3
  102. data/docs/Track.md +37 -15
  103. data/docs/URLSigningKeysApi.md +127 -51
  104. data/docs/UpdateAssetMP4SupportRequest.md +13 -3
  105. data/docs/UpdateAssetMasterAccessRequest.md +13 -3
  106. data/docs/Upload.md +29 -11
  107. data/docs/UploadError.md +15 -4
  108. data/docs/UploadResponse.md +13 -3
  109. data/docs/VideoView.md +235 -114
  110. data/docs/VideoViewEvent.md +19 -6
  111. data/docs/VideoViewResponse.md +15 -4
  112. data/docs/VideoViewsApi.md +76 -39
  113. data/gen/.gitignore +7 -0
  114. data/gen/Makefile +31 -0
  115. data/gen/generator-config.json +11 -0
  116. data/gen/openapitools.json +7 -0
  117. data/gen/package.json +17 -0
  118. data/gen/templates/Gemfile.mustache +11 -0
  119. data/gen/templates/README.mustache +158 -0
  120. data/gen/templates/Rakefile.mustache +10 -0
  121. data/gen/templates/api.mustache +206 -0
  122. data/gen/templates/api_client.mustache +264 -0
  123. data/gen/templates/api_client_faraday_partial.mustache +138 -0
  124. data/gen/templates/api_client_spec.mustache +220 -0
  125. data/gen/templates/api_client_typhoeus_partial.mustache +183 -0
  126. data/gen/templates/api_doc.mustache +118 -0
  127. data/gen/templates/api_error.mustache +67 -0
  128. data/gen/templates/api_info.mustache +12 -0
  129. data/gen/templates/api_test.mustache +47 -0
  130. data/gen/templates/base_object.mustache +120 -0
  131. data/gen/templates/configuration.mustache +349 -0
  132. data/gen/templates/configuration_spec.mustache +34 -0
  133. data/gen/templates/configuration_tls_faraday_partial.mustache +29 -0
  134. data/gen/templates/configuration_tls_typhoeus_partial.mustache +34 -0
  135. data/gen/templates/gem.mustache +40 -0
  136. data/gen/templates/gemspec.mustache +35 -0
  137. data/gen/templates/gitignore.mustache +39 -0
  138. data/gen/templates/model.mustache +26 -0
  139. data/gen/templates/model_doc.mustache +12 -0
  140. data/gen/templates/model_test.mustache +77 -0
  141. data/gen/templates/partial_model_enum_class.mustache +20 -0
  142. data/gen/templates/partial_model_generic.mustache +371 -0
  143. data/gen/templates/partial_model_generic_doc.mustache +28 -0
  144. data/gen/templates/partial_oneof_module.mustache +137 -0
  145. data/gen/templates/partial_oneof_module_doc.mustache +92 -0
  146. data/gen/templates/rspec.mustache +2 -0
  147. data/gen/templates/rubocop.mustache +148 -0
  148. data/gen/templates/spec_helper.mustache +103 -0
  149. data/gen/templates/version.mustache +7 -0
  150. data/gen/yarn.lock +1878 -0
  151. data/lib/mux_ruby.rb +9 -2
  152. data/lib/mux_ruby/api/assets_api.rb +279 -150
  153. data/lib/mux_ruby/api/delivery_usage_api.rb +28 -12
  154. data/lib/mux_ruby/api/dimensions_api.rb +55 -29
  155. data/lib/mux_ruby/api/direct_uploads_api.rb +90 -44
  156. data/lib/mux_ruby/api/errors_api.rb +32 -16
  157. data/lib/mux_ruby/api/exports_api.rb +28 -12
  158. data/lib/mux_ruby/api/filters_api.rb +53 -27
  159. data/lib/mux_ruby/api/incidents_api.rb +88 -46
  160. data/lib/mux_ruby/api/live_streams_api.rb +299 -157
  161. data/lib/mux_ruby/api/metrics_api.rb +175 -104
  162. data/lib/mux_ruby/api/playback_id_api.rb +31 -15
  163. data/lib/mux_ruby/api/real_time_api.rb +139 -77
  164. data/lib/mux_ruby/api/url_signing_keys_api.rb +89 -42
  165. data/lib/mux_ruby/api/video_views_api.rb +56 -29
  166. data/lib/mux_ruby/api_client.rb +94 -79
  167. data/lib/mux_ruby/api_error.rb +35 -7
  168. data/lib/mux_ruby/configuration.rb +50 -14
  169. data/lib/mux_ruby/models/abridged_video_view.rb +58 -24
  170. data/lib/mux_ruby/models/asset.rb +88 -61
  171. data/lib/mux_ruby/models/asset_errors.rb +50 -15
  172. data/lib/mux_ruby/models/asset_master.rb +52 -17
  173. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +70 -35
  174. data/lib/mux_ruby/models/asset_recording_times.rb +50 -16
  175. data/lib/mux_ruby/models/asset_response.rb +48 -14
  176. data/lib/mux_ruby/models/asset_static_renditions.rb +53 -17
  177. data/lib/mux_ruby/models/asset_static_renditions_files.rb +58 -23
  178. data/lib/mux_ruby/models/breakdown_value.rb +52 -18
  179. data/lib/mux_ruby/models/create_asset_request.rb +64 -30
  180. data/lib/mux_ruby/models/create_live_stream_request.rb +57 -22
  181. data/lib/mux_ruby/models/create_playback_id_request.rb +48 -14
  182. data/lib/mux_ruby/models/create_playback_id_response.rb +48 -14
  183. data/lib/mux_ruby/models/create_simulcast_target_request.rb +50 -16
  184. data/lib/mux_ruby/models/create_track_request.rb +59 -25
  185. data/lib/mux_ruby/models/create_track_response.rb +48 -14
  186. data/lib/mux_ruby/models/create_upload_request.rb +52 -18
  187. data/lib/mux_ruby/models/delivery_report.rb +106 -21
  188. data/lib/mux_ruby/models/dimension_value.rb +49 -15
  189. data/lib/mux_ruby/models/disable_live_stream_response.rb +48 -14
  190. data/lib/mux_ruby/models/enable_live_stream_response.rb +48 -14
  191. data/lib/mux_ruby/models/error.rb +63 -21
  192. data/lib/mux_ruby/models/filter_value.rb +49 -15
  193. data/lib/mux_ruby/models/get_asset_input_info_response.rb +48 -14
  194. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response.rb +48 -14
  195. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data.rb +50 -16
  196. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data_object.rb +51 -17
  197. data/lib/mux_ruby/models/get_asset_playback_id_response.rb +48 -14
  198. data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +50 -16
  199. data/lib/mux_ruby/models/get_overall_values_response.rb +50 -16
  200. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +50 -16
  201. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +51 -17
  202. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +48 -14
  203. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +50 -16
  204. data/lib/mux_ruby/models/incident.rb +68 -34
  205. data/lib/mux_ruby/models/incident_breakdown.rb +50 -16
  206. data/lib/mux_ruby/models/incident_notification.rb +50 -16
  207. data/lib/mux_ruby/models/incident_notification_rule.rb +52 -18
  208. data/lib/mux_ruby/models/incident_response.rb +49 -15
  209. data/lib/mux_ruby/models/input_file.rb +49 -15
  210. data/lib/mux_ruby/models/input_info.rb +49 -15
  211. data/lib/mux_ruby/models/input_settings.rb +64 -30
  212. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +58 -24
  213. data/lib/mux_ruby/models/input_track.rb +56 -22
  214. data/lib/mux_ruby/models/insight.rb +53 -19
  215. data/lib/mux_ruby/models/list_all_metric_values_response.rb +50 -16
  216. data/lib/mux_ruby/models/list_assets_response.rb +48 -14
  217. data/lib/mux_ruby/models/list_breakdown_values_response.rb +50 -16
  218. data/lib/mux_ruby/models/list_delivery_usage_response.rb +51 -17
  219. data/lib/mux_ruby/models/list_dimension_values_response.rb +50 -16
  220. data/lib/mux_ruby/models/list_dimensions_response.rb +50 -16
  221. data/lib/mux_ruby/models/list_errors_response.rb +50 -16
  222. data/lib/mux_ruby/models/list_exports_response.rb +50 -16
  223. data/lib/mux_ruby/models/list_filter_values_response.rb +50 -16
  224. data/lib/mux_ruby/models/list_filters_response.rb +50 -16
  225. data/lib/mux_ruby/models/list_filters_response_data.rb +49 -15
  226. data/lib/mux_ruby/models/list_incidents_response.rb +50 -16
  227. data/lib/mux_ruby/models/list_insights_response.rb +50 -16
  228. data/lib/mux_ruby/models/list_live_streams_response.rb +48 -14
  229. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +50 -16
  230. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +49 -15
  231. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +50 -16
  232. data/lib/mux_ruby/models/list_related_incidents_response.rb +50 -16
  233. data/lib/mux_ruby/models/list_signing_keys_response.rb +48 -14
  234. data/lib/mux_ruby/models/list_uploads_response.rb +48 -14
  235. data/lib/mux_ruby/models/list_video_views_response.rb +50 -16
  236. data/lib/mux_ruby/models/live_stream.rb +110 -28
  237. data/lib/mux_ruby/models/live_stream_response.rb +48 -14
  238. data/lib/mux_ruby/models/metric.rb +52 -18
  239. data/lib/mux_ruby/models/notification_rule.rb +50 -16
  240. data/lib/mux_ruby/models/overall_values.rb +51 -17
  241. data/lib/mux_ruby/models/playback_id.rb +49 -15
  242. data/lib/mux_ruby/models/playback_policy.rb +12 -6
  243. data/lib/mux_ruby/models/real_time_breakdown_value.rb +52 -18
  244. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +50 -16
  245. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +49 -15
  246. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +54 -20
  247. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +50 -16
  248. data/lib/mux_ruby/models/score.rb +53 -19
  249. data/lib/mux_ruby/models/signal_live_stream_complete_response.rb +48 -14
  250. data/lib/mux_ruby/models/signing_key.rb +53 -16
  251. data/lib/mux_ruby/models/signing_key_response.rb +48 -14
  252. data/lib/mux_ruby/models/simulcast_target.rb +54 -20
  253. data/lib/mux_ruby/models/simulcast_target_response.rb +48 -14
  254. data/lib/mux_ruby/models/track.rb +67 -33
  255. data/lib/mux_ruby/models/update_asset_master_access_request.rb +50 -16
  256. data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +50 -16
  257. data/lib/mux_ruby/models/upload.rb +61 -25
  258. data/lib/mux_ruby/models/upload_error.rb +51 -15
  259. data/lib/mux_ruby/models/upload_response.rb +48 -14
  260. data/lib/mux_ruby/models/video_view.rb +166 -132
  261. data/lib/mux_ruby/models/video_view_event.rb +51 -17
  262. data/lib/mux_ruby/models/video_view_response.rb +49 -15
  263. data/lib/mux_ruby/version.rb +10 -3
  264. data/mux_ruby.gemspec +15 -17
  265. data/spec/api_client_spec.rb +10 -3
  266. data/spec/configuration_spec.rb +9 -2
  267. data/spec/spec_helper.rb +9 -2
  268. metadata +139 -242
@@ -1,9 +1,17 @@
1
1
  =begin
2
- # Mux Ruby - Copyright 2019 Mux Inc.
3
- # NOTE: This file is auto generated. Do not edit this file manually.
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
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
4
11
  =end
5
12
 
6
13
  require 'date'
14
+ require 'time'
7
15
 
8
16
  module MuxRuby
9
17
  class UploadResponse
@@ -16,6 +24,11 @@ module MuxRuby
16
24
  }
17
25
  end
18
26
 
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
19
32
  # Attribute type mapping.
20
33
  def self.openapi_types
21
34
  {
@@ -23,15 +36,28 @@ module MuxRuby
23
36
  }
24
37
  end
25
38
 
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
26
45
  # Initializes the object
27
46
  # @param [Hash] attributes Model attributes in the form of hash
28
47
  def initialize(attributes = {})
29
- return unless attributes.is_a?(Hash)
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::UploadResponse` initialize method"
50
+ end
30
51
 
31
- # convert string to symbol for hash key
32
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::UploadResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
33
59
 
34
- if attributes.has_key?(:'data')
60
+ if attributes.key?(:'data')
35
61
  self.data = attributes[:'data']
36
62
  end
37
63
  end
@@ -64,7 +90,7 @@ module MuxRuby
64
90
  end
65
91
 
66
92
  # Calculates hash code according to all attributes.
67
- # @return [Fixnum] Hash code
93
+ # @return [Integer] Hash code
68
94
  def hash
69
95
  [data].hash
70
96
  end
@@ -82,7 +108,9 @@ module MuxRuby
82
108
  def build_from_hash(attributes)
83
109
  return nil unless attributes.is_a?(Hash)
84
110
  self.class.openapi_types.each_pair do |key, type|
85
- if type =~ /\AArray<(.*)>/i
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
86
114
  # check to ensure the input is an array given that the attribute
87
115
  # is documented as an array but the input is not
88
116
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -90,7 +118,7 @@ module MuxRuby
90
118
  end
91
119
  elsif !attributes[self.class.attribute_map[key]].nil?
92
120
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
93
- end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
94
122
  end
95
123
 
96
124
  self
@@ -102,8 +130,8 @@ module MuxRuby
102
130
  # @return [Object] Deserialized data
103
131
  def _deserialize(type, value)
104
132
  case type.to_sym
105
- when :DateTime
106
- DateTime.parse(value)
133
+ when :Time
134
+ Time.parse(value)
107
135
  when :Date
108
136
  Date.parse(value)
109
137
  when :String
@@ -112,7 +140,7 @@ module MuxRuby
112
140
  value.to_i
113
141
  when :Float
114
142
  value.to_f
115
- when :BOOLEAN
143
+ when :Boolean
116
144
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
145
  true
118
146
  else
@@ -133,7 +161,9 @@ module MuxRuby
133
161
  end
134
162
  end
135
163
  else # model
136
- MuxRuby.const_get(type).build_from_hash(value)
164
+ # models (e.g. Pet) or oneOf
165
+ klass = MuxRuby.const_get(type)
166
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
137
167
  end
138
168
  end
139
169
 
@@ -155,7 +185,11 @@ module MuxRuby
155
185
  hash = {}
156
186
  self.class.attribute_map.each_pair do |attr, param|
157
187
  value = self.send(attr)
158
- next if value.nil?
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
159
193
  hash[param] = _to_hash(value)
160
194
  end
161
195
  hash
@@ -1,9 +1,17 @@
1
1
  =begin
2
- # Mux Ruby - Copyright 2019 Mux Inc.
3
- # NOTE: This file is auto generated. Do not edit this file manually.
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
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1
10
+
4
11
  =end
5
12
 
6
13
  require 'date'
14
+ require 'time'
7
15
 
8
16
  module MuxRuby
9
17
  class VideoView
@@ -349,6 +357,11 @@ module MuxRuby
349
357
  }
350
358
  end
351
359
 
360
+ # Returns all the JSON keys this model knows about
361
+ def self.acceptable_attributes
362
+ attribute_map.values
363
+ end
364
+
352
365
  # Attribute type mapping.
353
366
  def self.openapi_types
354
367
  {
@@ -357,7 +370,7 @@ module MuxRuby
357
370
  :'player_source_domain' => :'String',
358
371
  :'region' => :'String',
359
372
  :'viewer_user_agent' => :'String',
360
- :'preroll_requested' => :'BOOLEAN',
373
+ :'preroll_requested' => :'Boolean',
361
374
  :'page_type' => :'String',
362
375
  :'startup_score' => :'String',
363
376
  :'view_seek_duration' => :'Integer',
@@ -382,7 +395,7 @@ module MuxRuby
382
395
  :'player_source_width' => :'Integer',
383
396
  :'player_error_message' => :'String',
384
397
  :'player_mux_plugin_version' => :'String',
385
- :'watched' => :'BOOLEAN',
398
+ :'watched' => :'Boolean',
386
399
  :'playback_score' => :'String',
387
400
  :'page_url' => :'String',
388
401
  :'metro' => :'String',
@@ -406,7 +419,7 @@ module MuxRuby
406
419
  :'rebuffering_score' => :'String',
407
420
  :'experiment_name' => :'String',
408
421
  :'viewer_os_version' => :'String',
409
- :'player_preload' => :'BOOLEAN',
422
+ :'player_preload' => :'Boolean',
410
423
  :'buffering_duration' => :'Integer',
411
424
  :'player_view_count' => :'Integer',
412
425
  :'player_software' => :'String',
@@ -418,7 +431,7 @@ module MuxRuby
418
431
  :'viewer_experience_score' => :'String',
419
432
  :'view_error_id' => :'Integer',
420
433
  :'video_variant_name' => :'String',
421
- :'preroll_played' => :'BOOLEAN',
434
+ :'preroll_played' => :'Boolean',
422
435
  :'viewer_application_engine' => :'String',
423
436
  :'viewer_os_architecture' => :'String',
424
437
  :'player_error_code' => :'String',
@@ -433,7 +446,7 @@ module MuxRuby
433
446
  :'video_id' => :'String',
434
447
  :'continent_code' => :'String',
435
448
  :'session_id' => :'String',
436
- :'exit_before_video_start' => :'BOOLEAN',
449
+ :'exit_before_video_start' => :'Boolean',
437
450
  :'video_content_type' => :'String',
438
451
  :'viewer_os_family' => :'String',
439
452
  :'player_poster' => :'String',
@@ -454,10 +467,10 @@ module MuxRuby
454
467
  :'view_max_downscale_percentage' => :'String',
455
468
  :'view_max_upscale_percentage' => :'String',
456
469
  :'country_code' => :'String',
457
- :'used_fullscreen' => :'BOOLEAN',
470
+ :'used_fullscreen' => :'Boolean',
458
471
  :'isp' => :'String',
459
472
  :'property_id' => :'Integer',
460
- :'player_autoplay' => :'BOOLEAN',
473
+ :'player_autoplay' => :'Boolean',
461
474
  :'player_height' => :'Integer',
462
475
  :'asn' => :'Integer',
463
476
  :'asn_name' => :'String',
@@ -467,461 +480,474 @@ module MuxRuby
467
480
  }
468
481
  end
469
482
 
483
+ # List of attributes with nullable: true
484
+ def self.openapi_nullable
485
+ Set.new([
486
+ ])
487
+ end
488
+
470
489
  # Initializes the object
471
490
  # @param [Hash] attributes Model attributes in the form of hash
472
491
  def initialize(attributes = {})
473
- return unless attributes.is_a?(Hash)
492
+ if (!attributes.is_a?(Hash))
493
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::VideoView` initialize method"
494
+ end
474
495
 
475
- # convert string to symbol for hash key
476
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
496
+ # check to see if the attribute exists and convert string to symbol for hash key
497
+ attributes = attributes.each_with_object({}) { |(k, v), h|
498
+ if (!self.class.attribute_map.key?(k.to_sym))
499
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::VideoView`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
500
+ end
501
+ h[k.to_sym] = v
502
+ }
477
503
 
478
- if attributes.has_key?(:'view_total_upscaling')
504
+ if attributes.key?(:'view_total_upscaling')
479
505
  self.view_total_upscaling = attributes[:'view_total_upscaling']
480
506
  end
481
507
 
482
- if attributes.has_key?(:'preroll_ad_asset_hostname')
508
+ if attributes.key?(:'preroll_ad_asset_hostname')
483
509
  self.preroll_ad_asset_hostname = attributes[:'preroll_ad_asset_hostname']
484
510
  end
485
511
 
486
- if attributes.has_key?(:'player_source_domain')
512
+ if attributes.key?(:'player_source_domain')
487
513
  self.player_source_domain = attributes[:'player_source_domain']
488
514
  end
489
515
 
490
- if attributes.has_key?(:'region')
516
+ if attributes.key?(:'region')
491
517
  self.region = attributes[:'region']
492
518
  end
493
519
 
494
- if attributes.has_key?(:'viewer_user_agent')
520
+ if attributes.key?(:'viewer_user_agent')
495
521
  self.viewer_user_agent = attributes[:'viewer_user_agent']
496
522
  end
497
523
 
498
- if attributes.has_key?(:'preroll_requested')
524
+ if attributes.key?(:'preroll_requested')
499
525
  self.preroll_requested = attributes[:'preroll_requested']
500
526
  end
501
527
 
502
- if attributes.has_key?(:'page_type')
528
+ if attributes.key?(:'page_type')
503
529
  self.page_type = attributes[:'page_type']
504
530
  end
505
531
 
506
- if attributes.has_key?(:'startup_score')
532
+ if attributes.key?(:'startup_score')
507
533
  self.startup_score = attributes[:'startup_score']
508
534
  end
509
535
 
510
- if attributes.has_key?(:'view_seek_duration')
536
+ if attributes.key?(:'view_seek_duration')
511
537
  self.view_seek_duration = attributes[:'view_seek_duration']
512
538
  end
513
539
 
514
- if attributes.has_key?(:'country_name')
540
+ if attributes.key?(:'country_name')
515
541
  self.country_name = attributes[:'country_name']
516
542
  end
517
543
 
518
- if attributes.has_key?(:'player_source_height')
544
+ if attributes.key?(:'player_source_height')
519
545
  self.player_source_height = attributes[:'player_source_height']
520
546
  end
521
547
 
522
- if attributes.has_key?(:'longitude')
548
+ if attributes.key?(:'longitude')
523
549
  self.longitude = attributes[:'longitude']
524
550
  end
525
551
 
526
- if attributes.has_key?(:'buffering_count')
552
+ if attributes.key?(:'buffering_count')
527
553
  self.buffering_count = attributes[:'buffering_count']
528
554
  end
529
555
 
530
- if attributes.has_key?(:'video_duration')
556
+ if attributes.key?(:'video_duration')
531
557
  self.video_duration = attributes[:'video_duration']
532
558
  end
533
559
 
534
- if attributes.has_key?(:'player_source_type')
560
+ if attributes.key?(:'player_source_type')
535
561
  self.player_source_type = attributes[:'player_source_type']
536
562
  end
537
563
 
538
- if attributes.has_key?(:'city')
564
+ if attributes.key?(:'city')
539
565
  self.city = attributes[:'city']
540
566
  end
541
567
 
542
- if attributes.has_key?(:'view_id')
568
+ if attributes.key?(:'view_id')
543
569
  self.view_id = attributes[:'view_id']
544
570
  end
545
571
 
546
- if attributes.has_key?(:'platform_description')
572
+ if attributes.key?(:'platform_description')
547
573
  self.platform_description = attributes[:'platform_description']
548
574
  end
549
575
 
550
- if attributes.has_key?(:'video_startup_preroll_request_time')
576
+ if attributes.key?(:'video_startup_preroll_request_time')
551
577
  self.video_startup_preroll_request_time = attributes[:'video_startup_preroll_request_time']
552
578
  end
553
579
 
554
- if attributes.has_key?(:'viewer_device_name')
580
+ if attributes.key?(:'viewer_device_name')
555
581
  self.viewer_device_name = attributes[:'viewer_device_name']
556
582
  end
557
583
 
558
- if attributes.has_key?(:'video_series')
584
+ if attributes.key?(:'video_series')
559
585
  self.video_series = attributes[:'video_series']
560
586
  end
561
587
 
562
- if attributes.has_key?(:'viewer_application_name')
588
+ if attributes.key?(:'viewer_application_name')
563
589
  self.viewer_application_name = attributes[:'viewer_application_name']
564
590
  end
565
591
 
566
- if attributes.has_key?(:'updated_at')
592
+ if attributes.key?(:'updated_at')
567
593
  self.updated_at = attributes[:'updated_at']
568
594
  end
569
595
 
570
- if attributes.has_key?(:'view_total_content_playback_time')
596
+ if attributes.key?(:'view_total_content_playback_time')
571
597
  self.view_total_content_playback_time = attributes[:'view_total_content_playback_time']
572
598
  end
573
599
 
574
- if attributes.has_key?(:'cdn')
600
+ if attributes.key?(:'cdn')
575
601
  self.cdn = attributes[:'cdn']
576
602
  end
577
603
 
578
- if attributes.has_key?(:'player_instance_id')
604
+ if attributes.key?(:'player_instance_id')
579
605
  self.player_instance_id = attributes[:'player_instance_id']
580
606
  end
581
607
 
582
- if attributes.has_key?(:'video_language')
608
+ if attributes.key?(:'video_language')
583
609
  self.video_language = attributes[:'video_language']
584
610
  end
585
611
 
586
- if attributes.has_key?(:'player_source_width')
612
+ if attributes.key?(:'player_source_width')
587
613
  self.player_source_width = attributes[:'player_source_width']
588
614
  end
589
615
 
590
- if attributes.has_key?(:'player_error_message')
616
+ if attributes.key?(:'player_error_message')
591
617
  self.player_error_message = attributes[:'player_error_message']
592
618
  end
593
619
 
594
- if attributes.has_key?(:'player_mux_plugin_version')
620
+ if attributes.key?(:'player_mux_plugin_version')
595
621
  self.player_mux_plugin_version = attributes[:'player_mux_plugin_version']
596
622
  end
597
623
 
598
- if attributes.has_key?(:'watched')
624
+ if attributes.key?(:'watched')
599
625
  self.watched = attributes[:'watched']
600
626
  end
601
627
 
602
- if attributes.has_key?(:'playback_score')
628
+ if attributes.key?(:'playback_score')
603
629
  self.playback_score = attributes[:'playback_score']
604
630
  end
605
631
 
606
- if attributes.has_key?(:'page_url')
632
+ if attributes.key?(:'page_url')
607
633
  self.page_url = attributes[:'page_url']
608
634
  end
609
635
 
610
- if attributes.has_key?(:'metro')
636
+ if attributes.key?(:'metro')
611
637
  self.metro = attributes[:'metro']
612
638
  end
613
639
 
614
- if attributes.has_key?(:'view_max_request_latency')
640
+ if attributes.key?(:'view_max_request_latency')
615
641
  self.view_max_request_latency = attributes[:'view_max_request_latency']
616
642
  end
617
643
 
618
- if attributes.has_key?(:'requests_for_first_preroll')
644
+ if attributes.key?(:'requests_for_first_preroll')
619
645
  self.requests_for_first_preroll = attributes[:'requests_for_first_preroll']
620
646
  end
621
647
 
622
- if attributes.has_key?(:'view_total_downscaling')
648
+ if attributes.key?(:'view_total_downscaling')
623
649
  self.view_total_downscaling = attributes[:'view_total_downscaling']
624
650
  end
625
651
 
626
- if attributes.has_key?(:'latitude')
652
+ if attributes.key?(:'latitude')
627
653
  self.latitude = attributes[:'latitude']
628
654
  end
629
655
 
630
- if attributes.has_key?(:'player_source_host_name')
656
+ if attributes.key?(:'player_source_host_name')
631
657
  self.player_source_host_name = attributes[:'player_source_host_name']
632
658
  end
633
659
 
634
- if attributes.has_key?(:'inserted_at')
660
+ if attributes.key?(:'inserted_at')
635
661
  self.inserted_at = attributes[:'inserted_at']
636
662
  end
637
663
 
638
- if attributes.has_key?(:'view_end')
664
+ if attributes.key?(:'view_end')
639
665
  self.view_end = attributes[:'view_end']
640
666
  end
641
667
 
642
- if attributes.has_key?(:'mux_embed_version')
668
+ if attributes.key?(:'mux_embed_version')
643
669
  self.mux_embed_version = attributes[:'mux_embed_version']
644
670
  end
645
671
 
646
- if attributes.has_key?(:'player_language')
672
+ if attributes.key?(:'player_language')
647
673
  self.player_language = attributes[:'player_language']
648
674
  end
649
675
 
650
- if attributes.has_key?(:'page_load_time')
676
+ if attributes.key?(:'page_load_time')
651
677
  self.page_load_time = attributes[:'page_load_time']
652
678
  end
653
679
 
654
- if attributes.has_key?(:'viewer_device_category')
680
+ if attributes.key?(:'viewer_device_category')
655
681
  self.viewer_device_category = attributes[:'viewer_device_category']
656
682
  end
657
683
 
658
- if attributes.has_key?(:'video_startup_preroll_load_time')
684
+ if attributes.key?(:'video_startup_preroll_load_time')
659
685
  self.video_startup_preroll_load_time = attributes[:'video_startup_preroll_load_time']
660
686
  end
661
687
 
662
- if attributes.has_key?(:'player_version')
688
+ if attributes.key?(:'player_version')
663
689
  self.player_version = attributes[:'player_version']
664
690
  end
665
691
 
666
- if attributes.has_key?(:'watch_time')
692
+ if attributes.key?(:'watch_time')
667
693
  self.watch_time = attributes[:'watch_time']
668
694
  end
669
695
 
670
- if attributes.has_key?(:'player_source_stream_type')
696
+ if attributes.key?(:'player_source_stream_type')
671
697
  self.player_source_stream_type = attributes[:'player_source_stream_type']
672
698
  end
673
699
 
674
- if attributes.has_key?(:'preroll_ad_tag_hostname')
700
+ if attributes.key?(:'preroll_ad_tag_hostname')
675
701
  self.preroll_ad_tag_hostname = attributes[:'preroll_ad_tag_hostname']
676
702
  end
677
703
 
678
- if attributes.has_key?(:'viewer_device_manufacturer')
704
+ if attributes.key?(:'viewer_device_manufacturer')
679
705
  self.viewer_device_manufacturer = attributes[:'viewer_device_manufacturer']
680
706
  end
681
707
 
682
- if attributes.has_key?(:'rebuffering_score')
708
+ if attributes.key?(:'rebuffering_score')
683
709
  self.rebuffering_score = attributes[:'rebuffering_score']
684
710
  end
685
711
 
686
- if attributes.has_key?(:'experiment_name')
712
+ if attributes.key?(:'experiment_name')
687
713
  self.experiment_name = attributes[:'experiment_name']
688
714
  end
689
715
 
690
- if attributes.has_key?(:'viewer_os_version')
716
+ if attributes.key?(:'viewer_os_version')
691
717
  self.viewer_os_version = attributes[:'viewer_os_version']
692
718
  end
693
719
 
694
- if attributes.has_key?(:'player_preload')
720
+ if attributes.key?(:'player_preload')
695
721
  self.player_preload = attributes[:'player_preload']
696
722
  end
697
723
 
698
- if attributes.has_key?(:'buffering_duration')
724
+ if attributes.key?(:'buffering_duration')
699
725
  self.buffering_duration = attributes[:'buffering_duration']
700
726
  end
701
727
 
702
- if attributes.has_key?(:'player_view_count')
728
+ if attributes.key?(:'player_view_count')
703
729
  self.player_view_count = attributes[:'player_view_count']
704
730
  end
705
731
 
706
- if attributes.has_key?(:'player_software')
732
+ if attributes.key?(:'player_software')
707
733
  self.player_software = attributes[:'player_software']
708
734
  end
709
735
 
710
- if attributes.has_key?(:'player_load_time')
736
+ if attributes.key?(:'player_load_time')
711
737
  self.player_load_time = attributes[:'player_load_time']
712
738
  end
713
739
 
714
- if attributes.has_key?(:'platform_summary')
740
+ if attributes.key?(:'platform_summary')
715
741
  self.platform_summary = attributes[:'platform_summary']
716
742
  end
717
743
 
718
- if attributes.has_key?(:'video_encoding_variant')
744
+ if attributes.key?(:'video_encoding_variant')
719
745
  self.video_encoding_variant = attributes[:'video_encoding_variant']
720
746
  end
721
747
 
722
- if attributes.has_key?(:'player_width')
748
+ if attributes.key?(:'player_width')
723
749
  self.player_width = attributes[:'player_width']
724
750
  end
725
751
 
726
- if attributes.has_key?(:'view_seek_count')
752
+ if attributes.key?(:'view_seek_count')
727
753
  self.view_seek_count = attributes[:'view_seek_count']
728
754
  end
729
755
 
730
- if attributes.has_key?(:'viewer_experience_score')
756
+ if attributes.key?(:'viewer_experience_score')
731
757
  self.viewer_experience_score = attributes[:'viewer_experience_score']
732
758
  end
733
759
 
734
- if attributes.has_key?(:'view_error_id')
760
+ if attributes.key?(:'view_error_id')
735
761
  self.view_error_id = attributes[:'view_error_id']
736
762
  end
737
763
 
738
- if attributes.has_key?(:'video_variant_name')
764
+ if attributes.key?(:'video_variant_name')
739
765
  self.video_variant_name = attributes[:'video_variant_name']
740
766
  end
741
767
 
742
- if attributes.has_key?(:'preroll_played')
768
+ if attributes.key?(:'preroll_played')
743
769
  self.preroll_played = attributes[:'preroll_played']
744
770
  end
745
771
 
746
- if attributes.has_key?(:'viewer_application_engine')
772
+ if attributes.key?(:'viewer_application_engine')
747
773
  self.viewer_application_engine = attributes[:'viewer_application_engine']
748
774
  end
749
775
 
750
- if attributes.has_key?(:'viewer_os_architecture')
776
+ if attributes.key?(:'viewer_os_architecture')
751
777
  self.viewer_os_architecture = attributes[:'viewer_os_architecture']
752
778
  end
753
779
 
754
- if attributes.has_key?(:'player_error_code')
780
+ if attributes.key?(:'player_error_code')
755
781
  self.player_error_code = attributes[:'player_error_code']
756
782
  end
757
783
 
758
- if attributes.has_key?(:'buffering_rate')
784
+ if attributes.key?(:'buffering_rate')
759
785
  self.buffering_rate = attributes[:'buffering_rate']
760
786
  end
761
787
 
762
- if attributes.has_key?(:'events')
788
+ if attributes.key?(:'events')
763
789
  if (value = attributes[:'events']).is_a?(Array)
764
790
  self.events = value
765
791
  end
766
792
  end
767
793
 
768
- if attributes.has_key?(:'player_name')
794
+ if attributes.key?(:'player_name')
769
795
  self.player_name = attributes[:'player_name']
770
796
  end
771
797
 
772
- if attributes.has_key?(:'view_start')
798
+ if attributes.key?(:'view_start')
773
799
  self.view_start = attributes[:'view_start']
774
800
  end
775
801
 
776
- if attributes.has_key?(:'view_average_request_throughput')
802
+ if attributes.key?(:'view_average_request_throughput')
777
803
  self.view_average_request_throughput = attributes[:'view_average_request_throughput']
778
804
  end
779
805
 
780
- if attributes.has_key?(:'video_producer')
806
+ if attributes.key?(:'video_producer')
781
807
  self.video_producer = attributes[:'video_producer']
782
808
  end
783
809
 
784
- if attributes.has_key?(:'error_type_id')
810
+ if attributes.key?(:'error_type_id')
785
811
  self.error_type_id = attributes[:'error_type_id']
786
812
  end
787
813
 
788
- if attributes.has_key?(:'mux_viewer_id')
814
+ if attributes.key?(:'mux_viewer_id')
789
815
  self.mux_viewer_id = attributes[:'mux_viewer_id']
790
816
  end
791
817
 
792
- if attributes.has_key?(:'video_id')
818
+ if attributes.key?(:'video_id')
793
819
  self.video_id = attributes[:'video_id']
794
820
  end
795
821
 
796
- if attributes.has_key?(:'continent_code')
822
+ if attributes.key?(:'continent_code')
797
823
  self.continent_code = attributes[:'continent_code']
798
824
  end
799
825
 
800
- if attributes.has_key?(:'session_id')
826
+ if attributes.key?(:'session_id')
801
827
  self.session_id = attributes[:'session_id']
802
828
  end
803
829
 
804
- if attributes.has_key?(:'exit_before_video_start')
830
+ if attributes.key?(:'exit_before_video_start')
805
831
  self.exit_before_video_start = attributes[:'exit_before_video_start']
806
832
  end
807
833
 
808
- if attributes.has_key?(:'video_content_type')
834
+ if attributes.key?(:'video_content_type')
809
835
  self.video_content_type = attributes[:'video_content_type']
810
836
  end
811
837
 
812
- if attributes.has_key?(:'viewer_os_family')
838
+ if attributes.key?(:'viewer_os_family')
813
839
  self.viewer_os_family = attributes[:'viewer_os_family']
814
840
  end
815
841
 
816
- if attributes.has_key?(:'player_poster')
842
+ if attributes.key?(:'player_poster')
817
843
  self.player_poster = attributes[:'player_poster']
818
844
  end
819
845
 
820
- if attributes.has_key?(:'view_average_request_latency')
846
+ if attributes.key?(:'view_average_request_latency')
821
847
  self.view_average_request_latency = attributes[:'view_average_request_latency']
822
848
  end
823
849
 
824
- if attributes.has_key?(:'video_variant_id')
850
+ if attributes.key?(:'video_variant_id')
825
851
  self.video_variant_id = attributes[:'video_variant_id']
826
852
  end
827
853
 
828
- if attributes.has_key?(:'player_source_duration')
854
+ if attributes.key?(:'player_source_duration')
829
855
  self.player_source_duration = attributes[:'player_source_duration']
830
856
  end
831
857
 
832
- if attributes.has_key?(:'player_source_url')
858
+ if attributes.key?(:'player_source_url')
833
859
  self.player_source_url = attributes[:'player_source_url']
834
860
  end
835
861
 
836
- if attributes.has_key?(:'mux_api_version')
862
+ if attributes.key?(:'mux_api_version')
837
863
  self.mux_api_version = attributes[:'mux_api_version']
838
864
  end
839
865
 
840
- if attributes.has_key?(:'video_title')
866
+ if attributes.key?(:'video_title')
841
867
  self.video_title = attributes[:'video_title']
842
868
  end
843
869
 
844
- if attributes.has_key?(:'id')
870
+ if attributes.key?(:'id')
845
871
  self.id = attributes[:'id']
846
872
  end
847
873
 
848
- if attributes.has_key?(:'short_time')
874
+ if attributes.key?(:'short_time')
849
875
  self.short_time = attributes[:'short_time']
850
876
  end
851
877
 
852
- if attributes.has_key?(:'rebuffer_percentage')
878
+ if attributes.key?(:'rebuffer_percentage')
853
879
  self.rebuffer_percentage = attributes[:'rebuffer_percentage']
854
880
  end
855
881
 
856
- if attributes.has_key?(:'time_to_first_frame')
882
+ if attributes.key?(:'time_to_first_frame')
857
883
  self.time_to_first_frame = attributes[:'time_to_first_frame']
858
884
  end
859
885
 
860
- if attributes.has_key?(:'viewer_user_id')
886
+ if attributes.key?(:'viewer_user_id')
861
887
  self.viewer_user_id = attributes[:'viewer_user_id']
862
888
  end
863
889
 
864
- if attributes.has_key?(:'video_stream_type')
890
+ if attributes.key?(:'video_stream_type')
865
891
  self.video_stream_type = attributes[:'video_stream_type']
866
892
  end
867
893
 
868
- if attributes.has_key?(:'player_startup_time')
894
+ if attributes.key?(:'player_startup_time')
869
895
  self.player_startup_time = attributes[:'player_startup_time']
870
896
  end
871
897
 
872
- if attributes.has_key?(:'viewer_application_version')
898
+ if attributes.key?(:'viewer_application_version')
873
899
  self.viewer_application_version = attributes[:'viewer_application_version']
874
900
  end
875
901
 
876
- if attributes.has_key?(:'view_max_downscale_percentage')
902
+ if attributes.key?(:'view_max_downscale_percentage')
877
903
  self.view_max_downscale_percentage = attributes[:'view_max_downscale_percentage']
878
904
  end
879
905
 
880
- if attributes.has_key?(:'view_max_upscale_percentage')
906
+ if attributes.key?(:'view_max_upscale_percentage')
881
907
  self.view_max_upscale_percentage = attributes[:'view_max_upscale_percentage']
882
908
  end
883
909
 
884
- if attributes.has_key?(:'country_code')
910
+ if attributes.key?(:'country_code')
885
911
  self.country_code = attributes[:'country_code']
886
912
  end
887
913
 
888
- if attributes.has_key?(:'used_fullscreen')
914
+ if attributes.key?(:'used_fullscreen')
889
915
  self.used_fullscreen = attributes[:'used_fullscreen']
890
916
  end
891
917
 
892
- if attributes.has_key?(:'isp')
918
+ if attributes.key?(:'isp')
893
919
  self.isp = attributes[:'isp']
894
920
  end
895
921
 
896
- if attributes.has_key?(:'property_id')
922
+ if attributes.key?(:'property_id')
897
923
  self.property_id = attributes[:'property_id']
898
924
  end
899
925
 
900
- if attributes.has_key?(:'player_autoplay')
926
+ if attributes.key?(:'player_autoplay')
901
927
  self.player_autoplay = attributes[:'player_autoplay']
902
928
  end
903
929
 
904
- if attributes.has_key?(:'player_height')
930
+ if attributes.key?(:'player_height')
905
931
  self.player_height = attributes[:'player_height']
906
932
  end
907
933
 
908
- if attributes.has_key?(:'asn')
934
+ if attributes.key?(:'asn')
909
935
  self.asn = attributes[:'asn']
910
936
  end
911
937
 
912
- if attributes.has_key?(:'asn_name')
938
+ if attributes.key?(:'asn_name')
913
939
  self.asn_name = attributes[:'asn_name']
914
940
  end
915
941
 
916
- if attributes.has_key?(:'quality_score')
942
+ if attributes.key?(:'quality_score')
917
943
  self.quality_score = attributes[:'quality_score']
918
944
  end
919
945
 
920
- if attributes.has_key?(:'player_software_version')
946
+ if attributes.key?(:'player_software_version')
921
947
  self.player_software_version = attributes[:'player_software_version']
922
948
  end
923
949
 
924
- if attributes.has_key?(:'player_mux_plugin_name')
950
+ if attributes.key?(:'player_mux_plugin_name')
925
951
  self.player_mux_plugin_name = attributes[:'player_mux_plugin_name']
926
952
  end
927
953
  end
@@ -1065,7 +1091,7 @@ module MuxRuby
1065
1091
  end
1066
1092
 
1067
1093
  # Calculates hash code according to all attributes.
1068
- # @return [Fixnum] Hash code
1094
+ # @return [Integer] Hash code
1069
1095
  def hash
1070
1096
  [view_total_upscaling, preroll_ad_asset_hostname, player_source_domain, region, viewer_user_agent, preroll_requested, page_type, startup_score, view_seek_duration, country_name, player_source_height, longitude, buffering_count, video_duration, player_source_type, city, view_id, platform_description, video_startup_preroll_request_time, viewer_device_name, video_series, viewer_application_name, updated_at, view_total_content_playback_time, cdn, player_instance_id, video_language, player_source_width, player_error_message, player_mux_plugin_version, watched, playback_score, page_url, metro, view_max_request_latency, requests_for_first_preroll, view_total_downscaling, latitude, player_source_host_name, inserted_at, view_end, mux_embed_version, player_language, page_load_time, viewer_device_category, video_startup_preroll_load_time, player_version, watch_time, player_source_stream_type, preroll_ad_tag_hostname, viewer_device_manufacturer, rebuffering_score, experiment_name, viewer_os_version, player_preload, buffering_duration, player_view_count, player_software, player_load_time, platform_summary, video_encoding_variant, player_width, view_seek_count, viewer_experience_score, view_error_id, video_variant_name, preroll_played, viewer_application_engine, viewer_os_architecture, player_error_code, buffering_rate, events, player_name, view_start, view_average_request_throughput, video_producer, error_type_id, mux_viewer_id, video_id, continent_code, session_id, exit_before_video_start, video_content_type, viewer_os_family, player_poster, view_average_request_latency, video_variant_id, player_source_duration, player_source_url, mux_api_version, video_title, id, short_time, rebuffer_percentage, time_to_first_frame, viewer_user_id, video_stream_type, player_startup_time, viewer_application_version, view_max_downscale_percentage, view_max_upscale_percentage, country_code, used_fullscreen, isp, property_id, player_autoplay, player_height, asn, asn_name, quality_score, player_software_version, player_mux_plugin_name].hash
1071
1097
  end
@@ -1083,7 +1109,9 @@ module MuxRuby
1083
1109
  def build_from_hash(attributes)
1084
1110
  return nil unless attributes.is_a?(Hash)
1085
1111
  self.class.openapi_types.each_pair do |key, type|
1086
- if type =~ /\AArray<(.*)>/i
1112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
1113
+ self.send("#{key}=", nil)
1114
+ elsif type =~ /\AArray<(.*)>/i
1087
1115
  # check to ensure the input is an array given that the attribute
1088
1116
  # is documented as an array but the input is not
1089
1117
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -1091,7 +1119,7 @@ module MuxRuby
1091
1119
  end
1092
1120
  elsif !attributes[self.class.attribute_map[key]].nil?
1093
1121
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1094
- end # or else data not found in attributes(hash), not an issue as the data can be optional
1122
+ end
1095
1123
  end
1096
1124
 
1097
1125
  self
@@ -1103,8 +1131,8 @@ module MuxRuby
1103
1131
  # @return [Object] Deserialized data
1104
1132
  def _deserialize(type, value)
1105
1133
  case type.to_sym
1106
- when :DateTime
1107
- DateTime.parse(value)
1134
+ when :Time
1135
+ Time.parse(value)
1108
1136
  when :Date
1109
1137
  Date.parse(value)
1110
1138
  when :String
@@ -1113,7 +1141,7 @@ module MuxRuby
1113
1141
  value.to_i
1114
1142
  when :Float
1115
1143
  value.to_f
1116
- when :BOOLEAN
1144
+ when :Boolean
1117
1145
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1118
1146
  true
1119
1147
  else
@@ -1134,7 +1162,9 @@ module MuxRuby
1134
1162
  end
1135
1163
  end
1136
1164
  else # model
1137
- MuxRuby.const_get(type).build_from_hash(value)
1165
+ # models (e.g. Pet) or oneOf
1166
+ klass = MuxRuby.const_get(type)
1167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1138
1168
  end
1139
1169
  end
1140
1170
 
@@ -1156,7 +1186,11 @@ module MuxRuby
1156
1186
  hash = {}
1157
1187
  self.class.attribute_map.each_pair do |attr, param|
1158
1188
  value = self.send(attr)
1159
- next if value.nil?
1189
+ if value.nil?
1190
+ is_nullable = self.class.openapi_nullable.include?(attr)
1191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1192
+ end
1193
+
1160
1194
  hash[param] = _to_hash(value)
1161
1195
  end
1162
1196
  hash