mux_ruby 1.6.0 → 2.0.0.pre.rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +26 -37
  4. data/README.md +37 -13
  5. data/docs/AbridgedVideoView.md +33 -13
  6. data/docs/Asset.md +59 -23
  7. data/docs/AssetErrors.md +15 -4
  8. data/docs/AssetMaster.md +15 -4
  9. data/docs/AssetNonStandardInputReasons.md +34 -0
  10. data/docs/AssetRecordingTimes.md +20 -0
  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 +396 -161
  15. data/docs/BreakdownValue.md +21 -7
  16. data/docs/CreateAssetRequest.md +27 -10
  17. data/docs/CreateLiveStreamRequest.md +27 -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 +41 -23
  26. data/docs/DimensionValue.md +20 -0
  27. data/docs/DimensionsApi.md +156 -0
  28. data/docs/DirectUploadsApi.md +131 -56
  29. data/docs/DisableLiveStreamResponse.md +18 -0
  30. data/docs/EnableLiveStreamResponse.md +18 -0
  31. data/docs/Error.md +27 -10
  32. data/docs/ErrorsApi.md +38 -20
  33. data/docs/ExportsApi.md +33 -14
  34. data/docs/FilterValue.md +15 -4
  35. data/docs/FiltersApi.md +73 -35
  36. data/docs/GetAssetInputInfoResponse.md +13 -3
  37. data/docs/GetAssetOrLiveStreamIdResponse.md +18 -0
  38. data/docs/GetAssetOrLiveStreamIdResponseData.md +22 -0
  39. data/docs/GetAssetOrLiveStreamIdResponseDataObject.md +20 -0
  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 +22 -0
  44. data/docs/GetRealTimeHistogramTimeseriesResponse.md +24 -0
  45. data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +18 -0
  46. data/docs/GetRealTimeTimeseriesResponse.md +22 -0
  47. data/docs/Incident.md +58 -0
  48. data/docs/IncidentBreakdown.md +22 -0
  49. data/docs/IncidentNotification.md +22 -0
  50. data/docs/IncidentNotificationRule.md +26 -0
  51. data/docs/IncidentResponse.md +20 -0
  52. data/docs/IncidentsApi.md +242 -0
  53. data/docs/InputFile.md +15 -4
  54. data/docs/InputInfo.md +15 -4
  55. data/docs/InputSettings.md +31 -10
  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 +22 -0
  64. data/docs/ListDimensionsResponse.md +22 -0
  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 +22 -0
  71. data/docs/ListInsightsResponse.md +17 -5
  72. data/docs/ListLiveStreamsResponse.md +13 -3
  73. data/docs/ListRealTimeDimensionsResponse.md +22 -0
  74. data/docs/ListRealTimeDimensionsResponseData.md +20 -0
  75. data/docs/ListRealTimeMetricsResponse.md +22 -0
  76. data/docs/ListRelatedIncidentsResponse.md +22 -0
  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 +39 -15
  81. data/docs/LiveStreamResponse.md +13 -3
  82. data/docs/LiveStreamsApi.md +497 -145
  83. data/docs/Metric.md +21 -7
  84. data/docs/MetricsApi.md +211 -117
  85. data/docs/NotificationRule.md +22 -0
  86. data/docs/OverallValues.md +19 -6
  87. data/docs/PlaybackID.md +15 -4
  88. data/docs/PlaybackIDApi.md +78 -0
  89. data/docs/PlaybackPolicy.md +10 -2
  90. data/docs/RealTimeApi.md +376 -0
  91. data/docs/RealTimeBreakdownValue.md +26 -0
  92. data/docs/RealTimeHistogramTimeseriesBucket.md +20 -0
  93. data/docs/RealTimeHistogramTimeseriesBucketValues.md +20 -0
  94. data/docs/RealTimeHistogramTimeseriesDatapoint.md +30 -0
  95. data/docs/RealTimeTimeseriesDatapoint.md +22 -0
  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 +130 -54
  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 +251 -114
  110. data/docs/VideoViewEvent.md +19 -6
  111. data/docs/VideoViewResponse.md +15 -4
  112. data/docs/VideoViewsApi.md +78 -41
  113. data/examples/data/exercise-dimensions.rb +29 -0
  114. data/examples/data/exercise-incidents.rb +29 -0
  115. data/examples/data/exercise-realtime.rb +60 -0
  116. data/examples/video/exercise-assets.rb +21 -0
  117. data/examples/video/exercise-live-streams.rb +30 -0
  118. data/gen/.gitignore +7 -0
  119. data/gen/Makefile +31 -0
  120. data/gen/generator-config.json +11 -0
  121. data/gen/openapitools.json +7 -0
  122. data/gen/package.json +17 -0
  123. data/gen/templates/Gemfile.mustache +11 -0
  124. data/gen/templates/README.mustache +158 -0
  125. data/gen/templates/Rakefile.mustache +10 -0
  126. data/gen/templates/api.mustache +206 -0
  127. data/gen/templates/api_client.mustache +264 -0
  128. data/gen/templates/api_client_faraday_partial.mustache +138 -0
  129. data/gen/templates/api_client_spec.mustache +220 -0
  130. data/gen/templates/api_client_typhoeus_partial.mustache +183 -0
  131. data/gen/templates/api_doc.mustache +118 -0
  132. data/gen/templates/api_error.mustache +67 -0
  133. data/gen/templates/api_info.mustache +12 -0
  134. data/gen/templates/api_test.mustache +47 -0
  135. data/gen/templates/base_object.mustache +120 -0
  136. data/gen/templates/configuration.mustache +349 -0
  137. data/gen/templates/configuration_spec.mustache +34 -0
  138. data/gen/templates/configuration_tls_faraday_partial.mustache +29 -0
  139. data/gen/templates/configuration_tls_typhoeus_partial.mustache +34 -0
  140. data/gen/templates/gem.mustache +40 -0
  141. data/gen/templates/gemspec.mustache +35 -0
  142. data/gen/templates/gitignore.mustache +39 -0
  143. data/gen/templates/model.mustache +26 -0
  144. data/gen/templates/model_doc.mustache +12 -0
  145. data/gen/templates/model_test.mustache +77 -0
  146. data/gen/templates/partial_model_enum_class.mustache +20 -0
  147. data/gen/templates/partial_model_generic.mustache +371 -0
  148. data/gen/templates/partial_model_generic_doc.mustache +28 -0
  149. data/gen/templates/partial_oneof_module.mustache +137 -0
  150. data/gen/templates/partial_oneof_module_doc.mustache +92 -0
  151. data/gen/templates/rspec.mustache +2 -0
  152. data/gen/templates/rubocop.mustache +148 -0
  153. data/gen/templates/spec_helper.mustache +103 -0
  154. data/gen/templates/version.mustache +7 -0
  155. data/gen/yarn.lock +1878 -0
  156. data/lib/mux_ruby.rb +43 -2
  157. data/lib/mux_ruby/api/assets_api.rb +291 -152
  158. data/lib/mux_ruby/api/delivery_usage_api.rb +32 -16
  159. data/lib/mux_ruby/api/dimensions_api.rb +154 -0
  160. data/lib/mux_ruby/api/direct_uploads_api.rb +90 -44
  161. data/lib/mux_ruby/api/errors_api.rb +34 -18
  162. data/lib/mux_ruby/api/exports_api.rb +30 -14
  163. data/lib/mux_ruby/api/filters_api.rb +57 -31
  164. data/lib/mux_ruby/api/incidents_api.rb +259 -0
  165. data/lib/mux_ruby/api/live_streams_api.rb +381 -133
  166. data/lib/mux_ruby/api/metrics_api.rb +185 -114
  167. data/lib/mux_ruby/api/playback_id_api.rb +85 -0
  168. data/lib/mux_ruby/api/real_time_api.rb +373 -0
  169. data/lib/mux_ruby/api/url_signing_keys_api.rb +95 -48
  170. data/lib/mux_ruby/api/video_views_api.rb +60 -33
  171. data/lib/mux_ruby/api_client.rb +106 -91
  172. data/lib/mux_ruby/api_error.rb +35 -7
  173. data/lib/mux_ruby/configuration.rb +50 -14
  174. data/lib/mux_ruby/models/abridged_video_view.rb +58 -24
  175. data/lib/mux_ruby/models/asset.rb +157 -53
  176. data/lib/mux_ruby/models/asset_errors.rb +52 -15
  177. data/lib/mux_ruby/models/asset_master.rb +85 -15
  178. data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +370 -0
  179. data/lib/mux_ruby/models/asset_recording_times.rb +229 -0
  180. data/lib/mux_ruby/models/asset_response.rb +48 -14
  181. data/lib/mux_ruby/models/asset_static_renditions.rb +55 -19
  182. data/lib/mux_ruby/models/asset_static_renditions_files.rb +60 -25
  183. data/lib/mux_ruby/models/breakdown_value.rb +52 -18
  184. data/lib/mux_ruby/models/create_asset_request.rb +70 -30
  185. data/lib/mux_ruby/models/create_live_stream_request.rb +68 -23
  186. data/lib/mux_ruby/models/create_playback_id_request.rb +48 -14
  187. data/lib/mux_ruby/models/create_playback_id_response.rb +48 -14
  188. data/lib/mux_ruby/models/create_simulcast_target_request.rb +50 -16
  189. data/lib/mux_ruby/models/create_track_request.rb +65 -27
  190. data/lib/mux_ruby/models/create_track_response.rb +48 -14
  191. data/lib/mux_ruby/models/create_upload_request.rb +52 -18
  192. data/lib/mux_ruby/models/delivery_report.rb +106 -21
  193. data/lib/mux_ruby/models/dimension_value.rb +227 -0
  194. data/lib/mux_ruby/models/disable_live_stream_response.rb +218 -0
  195. data/lib/mux_ruby/models/enable_live_stream_response.rb +218 -0
  196. data/lib/mux_ruby/models/error.rb +63 -21
  197. data/lib/mux_ruby/models/filter_value.rb +49 -15
  198. data/lib/mux_ruby/models/get_asset_input_info_response.rb +48 -14
  199. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response.rb +218 -0
  200. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data.rb +237 -0
  201. data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data_object.rb +264 -0
  202. data/lib/mux_ruby/models/get_asset_playback_id_response.rb +48 -14
  203. data/lib/mux_ruby/models/get_metric_timeseries_data_response.rb +50 -16
  204. data/lib/mux_ruby/models/get_overall_values_response.rb +50 -16
  205. data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +240 -0
  206. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +249 -0
  207. data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +220 -0
  208. data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +240 -0
  209. data/lib/mux_ruby/models/incident.rb +404 -0
  210. data/lib/mux_ruby/models/incident_breakdown.rb +236 -0
  211. data/lib/mux_ruby/models/incident_notification.rb +236 -0
  212. data/lib/mux_ruby/models/incident_notification_rule.rb +256 -0
  213. data/lib/mux_ruby/models/incident_response.rb +229 -0
  214. data/lib/mux_ruby/models/input_file.rb +49 -15
  215. data/lib/mux_ruby/models/input_info.rb +49 -15
  216. data/lib/mux_ruby/models/input_settings.rb +91 -30
  217. data/lib/mux_ruby/models/input_settings_overlay_settings.rb +68 -26
  218. data/lib/mux_ruby/models/input_track.rb +56 -22
  219. data/lib/mux_ruby/models/insight.rb +53 -19
  220. data/lib/mux_ruby/models/list_all_metric_values_response.rb +50 -16
  221. data/lib/mux_ruby/models/list_assets_response.rb +48 -14
  222. data/lib/mux_ruby/models/list_breakdown_values_response.rb +50 -16
  223. data/lib/mux_ruby/models/list_delivery_usage_response.rb +51 -17
  224. data/lib/mux_ruby/models/list_dimension_values_response.rb +240 -0
  225. data/lib/mux_ruby/models/list_dimensions_response.rb +238 -0
  226. data/lib/mux_ruby/models/list_errors_response.rb +50 -16
  227. data/lib/mux_ruby/models/list_exports_response.rb +50 -16
  228. data/lib/mux_ruby/models/list_filter_values_response.rb +50 -16
  229. data/lib/mux_ruby/models/list_filters_response.rb +50 -16
  230. data/lib/mux_ruby/models/list_filters_response_data.rb +49 -15
  231. data/lib/mux_ruby/models/list_incidents_response.rb +240 -0
  232. data/lib/mux_ruby/models/list_insights_response.rb +50 -16
  233. data/lib/mux_ruby/models/list_live_streams_response.rb +48 -14
  234. data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +240 -0
  235. data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +227 -0
  236. data/lib/mux_ruby/models/list_real_time_metrics_response.rb +240 -0
  237. data/lib/mux_ruby/models/list_related_incidents_response.rb +240 -0
  238. data/lib/mux_ruby/models/list_signing_keys_response.rb +48 -14
  239. data/lib/mux_ruby/models/list_uploads_response.rb +48 -14
  240. data/lib/mux_ruby/models/list_video_views_response.rb +50 -16
  241. data/lib/mux_ruby/models/live_stream.rb +121 -29
  242. data/lib/mux_ruby/models/live_stream_response.rb +48 -14
  243. data/lib/mux_ruby/models/metric.rb +52 -18
  244. data/lib/mux_ruby/models/notification_rule.rb +236 -0
  245. data/lib/mux_ruby/models/overall_values.rb +51 -17
  246. data/lib/mux_ruby/models/playback_id.rb +50 -15
  247. data/lib/mux_ruby/models/playback_policy.rb +12 -6
  248. data/lib/mux_ruby/models/real_time_breakdown_value.rb +254 -0
  249. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +227 -0
  250. data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +227 -0
  251. data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +274 -0
  252. data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +236 -0
  253. data/lib/mux_ruby/models/score.rb +53 -19
  254. data/lib/mux_ruby/models/signal_live_stream_complete_response.rb +48 -14
  255. data/lib/mux_ruby/models/signing_key.rb +53 -16
  256. data/lib/mux_ruby/models/signing_key_response.rb +48 -14
  257. data/lib/mux_ruby/models/simulcast_target.rb +55 -21
  258. data/lib/mux_ruby/models/simulcast_target_response.rb +48 -14
  259. data/lib/mux_ruby/models/track.rb +92 -33
  260. data/lib/mux_ruby/models/update_asset_master_access_request.rb +51 -17
  261. data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +51 -17
  262. data/lib/mux_ruby/models/upload.rb +62 -26
  263. data/lib/mux_ruby/models/upload_error.rb +51 -15
  264. data/lib/mux_ruby/models/upload_response.rb +48 -14
  265. data/lib/mux_ruby/models/video_view.rb +242 -136
  266. data/lib/mux_ruby/models/video_view_event.rb +51 -17
  267. data/lib/mux_ruby/models/video_view_response.rb +49 -15
  268. data/lib/mux_ruby/version.rb +10 -3
  269. data/mux_ruby.gemspec +15 -15
  270. data/spec/api/assets_api_spec.rb +2 -0
  271. data/spec/api/dimensions_api_spec.rb +55 -0
  272. data/spec/api/filters_api_spec.rb +2 -2
  273. data/spec/api/incidents_api_spec.rb +73 -0
  274. data/spec/api/live_streams_api_spec.rb +24 -0
  275. data/spec/api/playback_id_api_spec.rb +40 -0
  276. data/spec/api/real_time_api_spec.rb +93 -0
  277. data/spec/api_client_spec.rb +10 -3
  278. data/spec/configuration_spec.rb +9 -2
  279. data/spec/models/asset_master_spec.rb +4 -0
  280. data/spec/models/asset_non_standard_input_reasons_spec.rb +98 -0
  281. data/spec/models/asset_recording_times_spec.rb +40 -0
  282. data/spec/models/asset_spec.rb +26 -0
  283. data/spec/models/dimension_value_spec.rb +40 -0
  284. data/spec/models/disable_live_stream_response_spec.rb +34 -0
  285. data/spec/models/enable_live_stream_response_spec.rb +34 -0
  286. data/spec/models/get_asset_or_live_stream_id_response_data_object_spec.rb +44 -0
  287. data/spec/models/get_asset_or_live_stream_id_response_data_spec.rb +46 -0
  288. data/spec/models/get_asset_or_live_stream_id_response_spec.rb +34 -0
  289. data/spec/models/get_real_time_breakdown_response_spec.rb +46 -0
  290. data/spec/models/get_real_time_histogram_timeseries_response_meta_spec.rb +34 -0
  291. data/spec/models/get_real_time_histogram_timeseries_response_spec.rb +52 -0
  292. data/spec/models/get_real_time_timeseries_response_spec.rb +46 -0
  293. data/spec/models/incident_breakdown_spec.rb +46 -0
  294. data/spec/models/incident_notification_rule_spec.rb +58 -0
  295. data/spec/models/incident_notification_spec.rb +46 -0
  296. data/spec/models/incident_response_spec.rb +40 -0
  297. data/spec/models/incident_spec.rb +154 -0
  298. data/spec/models/input_settings_spec.rb +12 -0
  299. data/spec/models/list_dimension_values_response_spec.rb +46 -0
  300. data/spec/models/list_dimensions_response_spec.rb +46 -0
  301. data/spec/models/list_incidents_response_spec.rb +46 -0
  302. data/spec/models/list_real_time_dimensions_response_data_spec.rb +40 -0
  303. data/spec/models/list_real_time_dimensions_response_spec.rb +46 -0
  304. data/spec/models/list_real_time_metrics_response_spec.rb +46 -0
  305. data/spec/models/list_related_incidents_response_spec.rb +46 -0
  306. data/spec/models/notification_rule_spec.rb +46 -0
  307. data/spec/models/real_time_breakdown_value_spec.rb +58 -0
  308. data/spec/models/real_time_histogram_timeseries_bucket_spec.rb +40 -0
  309. data/spec/models/real_time_histogram_timeseries_bucket_values_spec.rb +40 -0
  310. data/spec/models/real_time_histogram_timeseries_datapoint_spec.rb +70 -0
  311. data/spec/models/real_time_timeseries_datapoint_spec.rb +46 -0
  312. data/spec/models/track_spec.rb +4 -0
  313. data/spec/spec_helper.rb +9 -2
  314. metadata +246 -209
@@ -1,15 +1,25 @@
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
+ Contact: devex@mux.com
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
  # Only set if an error occurred during asset creation.
10
18
  class UploadError
19
+ # Label for the specific error
11
20
  attr_accessor :type
12
21
 
22
+ # Human readable error message
13
23
  attr_accessor :message
14
24
 
15
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -20,6 +30,11 @@ module MuxRuby
20
30
  }
21
31
  end
22
32
 
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
23
38
  # Attribute type mapping.
24
39
  def self.openapi_types
25
40
  {
@@ -28,19 +43,32 @@ module MuxRuby
28
43
  }
29
44
  end
30
45
 
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
31
52
  # Initializes the object
32
53
  # @param [Hash] attributes Model attributes in the form of hash
33
54
  def initialize(attributes = {})
34
- return unless attributes.is_a?(Hash)
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::UploadError` initialize method"
57
+ end
35
58
 
36
- # convert string to symbol for hash key
37
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::UploadError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
38
66
 
39
- if attributes.has_key?(:'type')
67
+ if attributes.key?(:'type')
40
68
  self.type = attributes[:'type']
41
69
  end
42
70
 
43
- if attributes.has_key?(:'message')
71
+ if attributes.key?(:'message')
44
72
  self.message = attributes[:'message']
45
73
  end
46
74
  end
@@ -74,7 +102,7 @@ module MuxRuby
74
102
  end
75
103
 
76
104
  # Calculates hash code according to all attributes.
77
- # @return [Fixnum] Hash code
105
+ # @return [Integer] Hash code
78
106
  def hash
79
107
  [type, message].hash
80
108
  end
@@ -92,7 +120,9 @@ module MuxRuby
92
120
  def build_from_hash(attributes)
93
121
  return nil unless attributes.is_a?(Hash)
94
122
  self.class.openapi_types.each_pair do |key, type|
95
- if type =~ /\AArray<(.*)>/i
123
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
+ self.send("#{key}=", nil)
125
+ elsif type =~ /\AArray<(.*)>/i
96
126
  # check to ensure the input is an array given that the attribute
97
127
  # is documented as an array but the input is not
98
128
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -100,7 +130,7 @@ module MuxRuby
100
130
  end
101
131
  elsif !attributes[self.class.attribute_map[key]].nil?
102
132
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
- end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
104
134
  end
105
135
 
106
136
  self
@@ -112,8 +142,8 @@ module MuxRuby
112
142
  # @return [Object] Deserialized data
113
143
  def _deserialize(type, value)
114
144
  case type.to_sym
115
- when :DateTime
116
- DateTime.parse(value)
145
+ when :Time
146
+ Time.parse(value)
117
147
  when :Date
118
148
  Date.parse(value)
119
149
  when :String
@@ -122,7 +152,7 @@ module MuxRuby
122
152
  value.to_i
123
153
  when :Float
124
154
  value.to_f
125
- when :BOOLEAN
155
+ when :Boolean
126
156
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
127
157
  true
128
158
  else
@@ -143,7 +173,9 @@ module MuxRuby
143
173
  end
144
174
  end
145
175
  else # model
146
- MuxRuby.const_get(type).build_from_hash(value)
176
+ # models (e.g. Pet) or oneOf
177
+ klass = MuxRuby.const_get(type)
178
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
147
179
  end
148
180
  end
149
181
 
@@ -165,7 +197,11 @@ module MuxRuby
165
197
  hash = {}
166
198
  self.class.attribute_map.each_pair do |attr, param|
167
199
  value = self.send(attr)
168
- next if value.nil?
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
169
205
  hash[param] = _to_hash(value)
170
206
  end
171
207
  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
+ Contact: devex@mux.com
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
+ Contact: devex@mux.com
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
@@ -231,6 +239,22 @@ module MuxRuby
231
239
 
232
240
  attr_accessor :player_mux_plugin_name
233
241
 
242
+ attr_accessor :sub_property_id
243
+
244
+ attr_accessor :player_remote_played
245
+
246
+ attr_accessor :view_max_playhead_position
247
+
248
+ attr_accessor :view_playing_time
249
+
250
+ attr_accessor :view_session_id
251
+
252
+ attr_accessor :viewer_connection_type
253
+
254
+ attr_accessor :viewer_device_model
255
+
256
+ attr_accessor :weighted_average_bitrate
257
+
234
258
  # Attribute mapping from ruby-style variable name to JSON key.
235
259
  def self.attribute_map
236
260
  {
@@ -345,10 +369,23 @@ module MuxRuby
345
369
  :'asn_name' => :'asn_name',
346
370
  :'quality_score' => :'quality_score',
347
371
  :'player_software_version' => :'player_software_version',
348
- :'player_mux_plugin_name' => :'player_mux_plugin_name'
372
+ :'player_mux_plugin_name' => :'player_mux_plugin_name',
373
+ :'sub_property_id' => :'sub_property_id',
374
+ :'player_remote_played' => :'player_remote_played',
375
+ :'view_max_playhead_position' => :'view_max_playhead_position',
376
+ :'view_playing_time' => :'view_playing_time',
377
+ :'view_session_id' => :'view_session_id',
378
+ :'viewer_connection_type' => :'viewer_connection_type',
379
+ :'viewer_device_model' => :'viewer_device_model',
380
+ :'weighted_average_bitrate' => :'weighted_average_bitrate'
349
381
  }
350
382
  end
351
383
 
384
+ # Returns all the JSON keys this model knows about
385
+ def self.acceptable_attributes
386
+ attribute_map.values
387
+ end
388
+
352
389
  # Attribute type mapping.
353
390
  def self.openapi_types
354
391
  {
@@ -357,7 +394,7 @@ module MuxRuby
357
394
  :'player_source_domain' => :'String',
358
395
  :'region' => :'String',
359
396
  :'viewer_user_agent' => :'String',
360
- :'preroll_requested' => :'BOOLEAN',
397
+ :'preroll_requested' => :'Boolean',
361
398
  :'page_type' => :'String',
362
399
  :'startup_score' => :'String',
363
400
  :'view_seek_duration' => :'Integer',
@@ -382,7 +419,7 @@ module MuxRuby
382
419
  :'player_source_width' => :'Integer',
383
420
  :'player_error_message' => :'String',
384
421
  :'player_mux_plugin_version' => :'String',
385
- :'watched' => :'BOOLEAN',
422
+ :'watched' => :'Boolean',
386
423
  :'playback_score' => :'String',
387
424
  :'page_url' => :'String',
388
425
  :'metro' => :'String',
@@ -406,7 +443,7 @@ module MuxRuby
406
443
  :'rebuffering_score' => :'String',
407
444
  :'experiment_name' => :'String',
408
445
  :'viewer_os_version' => :'String',
409
- :'player_preload' => :'BOOLEAN',
446
+ :'player_preload' => :'Boolean',
410
447
  :'buffering_duration' => :'Integer',
411
448
  :'player_view_count' => :'Integer',
412
449
  :'player_software' => :'String',
@@ -418,7 +455,7 @@ module MuxRuby
418
455
  :'viewer_experience_score' => :'String',
419
456
  :'view_error_id' => :'Integer',
420
457
  :'video_variant_name' => :'String',
421
- :'preroll_played' => :'BOOLEAN',
458
+ :'preroll_played' => :'Boolean',
422
459
  :'viewer_application_engine' => :'String',
423
460
  :'viewer_os_architecture' => :'String',
424
461
  :'player_error_code' => :'String',
@@ -433,7 +470,7 @@ module MuxRuby
433
470
  :'video_id' => :'String',
434
471
  :'continent_code' => :'String',
435
472
  :'session_id' => :'String',
436
- :'exit_before_video_start' => :'BOOLEAN',
473
+ :'exit_before_video_start' => :'Boolean',
437
474
  :'video_content_type' => :'String',
438
475
  :'viewer_os_family' => :'String',
439
476
  :'player_poster' => :'String',
@@ -454,476 +491,529 @@ module MuxRuby
454
491
  :'view_max_downscale_percentage' => :'String',
455
492
  :'view_max_upscale_percentage' => :'String',
456
493
  :'country_code' => :'String',
457
- :'used_fullscreen' => :'BOOLEAN',
494
+ :'used_fullscreen' => :'Boolean',
458
495
  :'isp' => :'String',
459
496
  :'property_id' => :'Integer',
460
- :'player_autoplay' => :'BOOLEAN',
497
+ :'player_autoplay' => :'Boolean',
461
498
  :'player_height' => :'Integer',
462
499
  :'asn' => :'Integer',
463
500
  :'asn_name' => :'String',
464
501
  :'quality_score' => :'String',
465
502
  :'player_software_version' => :'String',
466
- :'player_mux_plugin_name' => :'String'
503
+ :'player_mux_plugin_name' => :'String',
504
+ :'sub_property_id' => :'String',
505
+ :'player_remote_played' => :'Boolean',
506
+ :'view_max_playhead_position' => :'String',
507
+ :'view_playing_time' => :'String',
508
+ :'view_session_id' => :'String',
509
+ :'viewer_connection_type' => :'String',
510
+ :'viewer_device_model' => :'String',
511
+ :'weighted_average_bitrate' => :'Integer'
467
512
  }
468
513
  end
469
514
 
515
+ # List of attributes with nullable: true
516
+ def self.openapi_nullable
517
+ Set.new([
518
+ ])
519
+ end
520
+
470
521
  # Initializes the object
471
522
  # @param [Hash] attributes Model attributes in the form of hash
472
523
  def initialize(attributes = {})
473
- return unless attributes.is_a?(Hash)
524
+ if (!attributes.is_a?(Hash))
525
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::VideoView` initialize method"
526
+ end
474
527
 
475
- # convert string to symbol for hash key
476
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
528
+ # check to see if the attribute exists and convert string to symbol for hash key
529
+ attributes = attributes.each_with_object({}) { |(k, v), h|
530
+ if (!self.class.attribute_map.key?(k.to_sym))
531
+ 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
532
+ end
533
+ h[k.to_sym] = v
534
+ }
477
535
 
478
- if attributes.has_key?(:'view_total_upscaling')
536
+ if attributes.key?(:'view_total_upscaling')
479
537
  self.view_total_upscaling = attributes[:'view_total_upscaling']
480
538
  end
481
539
 
482
- if attributes.has_key?(:'preroll_ad_asset_hostname')
540
+ if attributes.key?(:'preroll_ad_asset_hostname')
483
541
  self.preroll_ad_asset_hostname = attributes[:'preroll_ad_asset_hostname']
484
542
  end
485
543
 
486
- if attributes.has_key?(:'player_source_domain')
544
+ if attributes.key?(:'player_source_domain')
487
545
  self.player_source_domain = attributes[:'player_source_domain']
488
546
  end
489
547
 
490
- if attributes.has_key?(:'region')
548
+ if attributes.key?(:'region')
491
549
  self.region = attributes[:'region']
492
550
  end
493
551
 
494
- if attributes.has_key?(:'viewer_user_agent')
552
+ if attributes.key?(:'viewer_user_agent')
495
553
  self.viewer_user_agent = attributes[:'viewer_user_agent']
496
554
  end
497
555
 
498
- if attributes.has_key?(:'preroll_requested')
556
+ if attributes.key?(:'preroll_requested')
499
557
  self.preroll_requested = attributes[:'preroll_requested']
500
558
  end
501
559
 
502
- if attributes.has_key?(:'page_type')
560
+ if attributes.key?(:'page_type')
503
561
  self.page_type = attributes[:'page_type']
504
562
  end
505
563
 
506
- if attributes.has_key?(:'startup_score')
564
+ if attributes.key?(:'startup_score')
507
565
  self.startup_score = attributes[:'startup_score']
508
566
  end
509
567
 
510
- if attributes.has_key?(:'view_seek_duration')
568
+ if attributes.key?(:'view_seek_duration')
511
569
  self.view_seek_duration = attributes[:'view_seek_duration']
512
570
  end
513
571
 
514
- if attributes.has_key?(:'country_name')
572
+ if attributes.key?(:'country_name')
515
573
  self.country_name = attributes[:'country_name']
516
574
  end
517
575
 
518
- if attributes.has_key?(:'player_source_height')
576
+ if attributes.key?(:'player_source_height')
519
577
  self.player_source_height = attributes[:'player_source_height']
520
578
  end
521
579
 
522
- if attributes.has_key?(:'longitude')
580
+ if attributes.key?(:'longitude')
523
581
  self.longitude = attributes[:'longitude']
524
582
  end
525
583
 
526
- if attributes.has_key?(:'buffering_count')
584
+ if attributes.key?(:'buffering_count')
527
585
  self.buffering_count = attributes[:'buffering_count']
528
586
  end
529
587
 
530
- if attributes.has_key?(:'video_duration')
588
+ if attributes.key?(:'video_duration')
531
589
  self.video_duration = attributes[:'video_duration']
532
590
  end
533
591
 
534
- if attributes.has_key?(:'player_source_type')
592
+ if attributes.key?(:'player_source_type')
535
593
  self.player_source_type = attributes[:'player_source_type']
536
594
  end
537
595
 
538
- if attributes.has_key?(:'city')
596
+ if attributes.key?(:'city')
539
597
  self.city = attributes[:'city']
540
598
  end
541
599
 
542
- if attributes.has_key?(:'view_id')
600
+ if attributes.key?(:'view_id')
543
601
  self.view_id = attributes[:'view_id']
544
602
  end
545
603
 
546
- if attributes.has_key?(:'platform_description')
604
+ if attributes.key?(:'platform_description')
547
605
  self.platform_description = attributes[:'platform_description']
548
606
  end
549
607
 
550
- if attributes.has_key?(:'video_startup_preroll_request_time')
608
+ if attributes.key?(:'video_startup_preroll_request_time')
551
609
  self.video_startup_preroll_request_time = attributes[:'video_startup_preroll_request_time']
552
610
  end
553
611
 
554
- if attributes.has_key?(:'viewer_device_name')
612
+ if attributes.key?(:'viewer_device_name')
555
613
  self.viewer_device_name = attributes[:'viewer_device_name']
556
614
  end
557
615
 
558
- if attributes.has_key?(:'video_series')
616
+ if attributes.key?(:'video_series')
559
617
  self.video_series = attributes[:'video_series']
560
618
  end
561
619
 
562
- if attributes.has_key?(:'viewer_application_name')
620
+ if attributes.key?(:'viewer_application_name')
563
621
  self.viewer_application_name = attributes[:'viewer_application_name']
564
622
  end
565
623
 
566
- if attributes.has_key?(:'updated_at')
624
+ if attributes.key?(:'updated_at')
567
625
  self.updated_at = attributes[:'updated_at']
568
626
  end
569
627
 
570
- if attributes.has_key?(:'view_total_content_playback_time')
628
+ if attributes.key?(:'view_total_content_playback_time')
571
629
  self.view_total_content_playback_time = attributes[:'view_total_content_playback_time']
572
630
  end
573
631
 
574
- if attributes.has_key?(:'cdn')
632
+ if attributes.key?(:'cdn')
575
633
  self.cdn = attributes[:'cdn']
576
634
  end
577
635
 
578
- if attributes.has_key?(:'player_instance_id')
636
+ if attributes.key?(:'player_instance_id')
579
637
  self.player_instance_id = attributes[:'player_instance_id']
580
638
  end
581
639
 
582
- if attributes.has_key?(:'video_language')
640
+ if attributes.key?(:'video_language')
583
641
  self.video_language = attributes[:'video_language']
584
642
  end
585
643
 
586
- if attributes.has_key?(:'player_source_width')
644
+ if attributes.key?(:'player_source_width')
587
645
  self.player_source_width = attributes[:'player_source_width']
588
646
  end
589
647
 
590
- if attributes.has_key?(:'player_error_message')
648
+ if attributes.key?(:'player_error_message')
591
649
  self.player_error_message = attributes[:'player_error_message']
592
650
  end
593
651
 
594
- if attributes.has_key?(:'player_mux_plugin_version')
652
+ if attributes.key?(:'player_mux_plugin_version')
595
653
  self.player_mux_plugin_version = attributes[:'player_mux_plugin_version']
596
654
  end
597
655
 
598
- if attributes.has_key?(:'watched')
656
+ if attributes.key?(:'watched')
599
657
  self.watched = attributes[:'watched']
600
658
  end
601
659
 
602
- if attributes.has_key?(:'playback_score')
660
+ if attributes.key?(:'playback_score')
603
661
  self.playback_score = attributes[:'playback_score']
604
662
  end
605
663
 
606
- if attributes.has_key?(:'page_url')
664
+ if attributes.key?(:'page_url')
607
665
  self.page_url = attributes[:'page_url']
608
666
  end
609
667
 
610
- if attributes.has_key?(:'metro')
668
+ if attributes.key?(:'metro')
611
669
  self.metro = attributes[:'metro']
612
670
  end
613
671
 
614
- if attributes.has_key?(:'view_max_request_latency')
672
+ if attributes.key?(:'view_max_request_latency')
615
673
  self.view_max_request_latency = attributes[:'view_max_request_latency']
616
674
  end
617
675
 
618
- if attributes.has_key?(:'requests_for_first_preroll')
676
+ if attributes.key?(:'requests_for_first_preroll')
619
677
  self.requests_for_first_preroll = attributes[:'requests_for_first_preroll']
620
678
  end
621
679
 
622
- if attributes.has_key?(:'view_total_downscaling')
680
+ if attributes.key?(:'view_total_downscaling')
623
681
  self.view_total_downscaling = attributes[:'view_total_downscaling']
624
682
  end
625
683
 
626
- if attributes.has_key?(:'latitude')
684
+ if attributes.key?(:'latitude')
627
685
  self.latitude = attributes[:'latitude']
628
686
  end
629
687
 
630
- if attributes.has_key?(:'player_source_host_name')
688
+ if attributes.key?(:'player_source_host_name')
631
689
  self.player_source_host_name = attributes[:'player_source_host_name']
632
690
  end
633
691
 
634
- if attributes.has_key?(:'inserted_at')
692
+ if attributes.key?(:'inserted_at')
635
693
  self.inserted_at = attributes[:'inserted_at']
636
694
  end
637
695
 
638
- if attributes.has_key?(:'view_end')
696
+ if attributes.key?(:'view_end')
639
697
  self.view_end = attributes[:'view_end']
640
698
  end
641
699
 
642
- if attributes.has_key?(:'mux_embed_version')
700
+ if attributes.key?(:'mux_embed_version')
643
701
  self.mux_embed_version = attributes[:'mux_embed_version']
644
702
  end
645
703
 
646
- if attributes.has_key?(:'player_language')
704
+ if attributes.key?(:'player_language')
647
705
  self.player_language = attributes[:'player_language']
648
706
  end
649
707
 
650
- if attributes.has_key?(:'page_load_time')
708
+ if attributes.key?(:'page_load_time')
651
709
  self.page_load_time = attributes[:'page_load_time']
652
710
  end
653
711
 
654
- if attributes.has_key?(:'viewer_device_category')
712
+ if attributes.key?(:'viewer_device_category')
655
713
  self.viewer_device_category = attributes[:'viewer_device_category']
656
714
  end
657
715
 
658
- if attributes.has_key?(:'video_startup_preroll_load_time')
716
+ if attributes.key?(:'video_startup_preroll_load_time')
659
717
  self.video_startup_preroll_load_time = attributes[:'video_startup_preroll_load_time']
660
718
  end
661
719
 
662
- if attributes.has_key?(:'player_version')
720
+ if attributes.key?(:'player_version')
663
721
  self.player_version = attributes[:'player_version']
664
722
  end
665
723
 
666
- if attributes.has_key?(:'watch_time')
724
+ if attributes.key?(:'watch_time')
667
725
  self.watch_time = attributes[:'watch_time']
668
726
  end
669
727
 
670
- if attributes.has_key?(:'player_source_stream_type')
728
+ if attributes.key?(:'player_source_stream_type')
671
729
  self.player_source_stream_type = attributes[:'player_source_stream_type']
672
730
  end
673
731
 
674
- if attributes.has_key?(:'preroll_ad_tag_hostname')
732
+ if attributes.key?(:'preroll_ad_tag_hostname')
675
733
  self.preroll_ad_tag_hostname = attributes[:'preroll_ad_tag_hostname']
676
734
  end
677
735
 
678
- if attributes.has_key?(:'viewer_device_manufacturer')
736
+ if attributes.key?(:'viewer_device_manufacturer')
679
737
  self.viewer_device_manufacturer = attributes[:'viewer_device_manufacturer']
680
738
  end
681
739
 
682
- if attributes.has_key?(:'rebuffering_score')
740
+ if attributes.key?(:'rebuffering_score')
683
741
  self.rebuffering_score = attributes[:'rebuffering_score']
684
742
  end
685
743
 
686
- if attributes.has_key?(:'experiment_name')
744
+ if attributes.key?(:'experiment_name')
687
745
  self.experiment_name = attributes[:'experiment_name']
688
746
  end
689
747
 
690
- if attributes.has_key?(:'viewer_os_version')
748
+ if attributes.key?(:'viewer_os_version')
691
749
  self.viewer_os_version = attributes[:'viewer_os_version']
692
750
  end
693
751
 
694
- if attributes.has_key?(:'player_preload')
752
+ if attributes.key?(:'player_preload')
695
753
  self.player_preload = attributes[:'player_preload']
696
754
  end
697
755
 
698
- if attributes.has_key?(:'buffering_duration')
756
+ if attributes.key?(:'buffering_duration')
699
757
  self.buffering_duration = attributes[:'buffering_duration']
700
758
  end
701
759
 
702
- if attributes.has_key?(:'player_view_count')
760
+ if attributes.key?(:'player_view_count')
703
761
  self.player_view_count = attributes[:'player_view_count']
704
762
  end
705
763
 
706
- if attributes.has_key?(:'player_software')
764
+ if attributes.key?(:'player_software')
707
765
  self.player_software = attributes[:'player_software']
708
766
  end
709
767
 
710
- if attributes.has_key?(:'player_load_time')
768
+ if attributes.key?(:'player_load_time')
711
769
  self.player_load_time = attributes[:'player_load_time']
712
770
  end
713
771
 
714
- if attributes.has_key?(:'platform_summary')
772
+ if attributes.key?(:'platform_summary')
715
773
  self.platform_summary = attributes[:'platform_summary']
716
774
  end
717
775
 
718
- if attributes.has_key?(:'video_encoding_variant')
776
+ if attributes.key?(:'video_encoding_variant')
719
777
  self.video_encoding_variant = attributes[:'video_encoding_variant']
720
778
  end
721
779
 
722
- if attributes.has_key?(:'player_width')
780
+ if attributes.key?(:'player_width')
723
781
  self.player_width = attributes[:'player_width']
724
782
  end
725
783
 
726
- if attributes.has_key?(:'view_seek_count')
784
+ if attributes.key?(:'view_seek_count')
727
785
  self.view_seek_count = attributes[:'view_seek_count']
728
786
  end
729
787
 
730
- if attributes.has_key?(:'viewer_experience_score')
788
+ if attributes.key?(:'viewer_experience_score')
731
789
  self.viewer_experience_score = attributes[:'viewer_experience_score']
732
790
  end
733
791
 
734
- if attributes.has_key?(:'view_error_id')
792
+ if attributes.key?(:'view_error_id')
735
793
  self.view_error_id = attributes[:'view_error_id']
736
794
  end
737
795
 
738
- if attributes.has_key?(:'video_variant_name')
796
+ if attributes.key?(:'video_variant_name')
739
797
  self.video_variant_name = attributes[:'video_variant_name']
740
798
  end
741
799
 
742
- if attributes.has_key?(:'preroll_played')
800
+ if attributes.key?(:'preroll_played')
743
801
  self.preroll_played = attributes[:'preroll_played']
744
802
  end
745
803
 
746
- if attributes.has_key?(:'viewer_application_engine')
804
+ if attributes.key?(:'viewer_application_engine')
747
805
  self.viewer_application_engine = attributes[:'viewer_application_engine']
748
806
  end
749
807
 
750
- if attributes.has_key?(:'viewer_os_architecture')
808
+ if attributes.key?(:'viewer_os_architecture')
751
809
  self.viewer_os_architecture = attributes[:'viewer_os_architecture']
752
810
  end
753
811
 
754
- if attributes.has_key?(:'player_error_code')
812
+ if attributes.key?(:'player_error_code')
755
813
  self.player_error_code = attributes[:'player_error_code']
756
814
  end
757
815
 
758
- if attributes.has_key?(:'buffering_rate')
816
+ if attributes.key?(:'buffering_rate')
759
817
  self.buffering_rate = attributes[:'buffering_rate']
760
818
  end
761
819
 
762
- if attributes.has_key?(:'events')
820
+ if attributes.key?(:'events')
763
821
  if (value = attributes[:'events']).is_a?(Array)
764
822
  self.events = value
765
823
  end
766
824
  end
767
825
 
768
- if attributes.has_key?(:'player_name')
826
+ if attributes.key?(:'player_name')
769
827
  self.player_name = attributes[:'player_name']
770
828
  end
771
829
 
772
- if attributes.has_key?(:'view_start')
830
+ if attributes.key?(:'view_start')
773
831
  self.view_start = attributes[:'view_start']
774
832
  end
775
833
 
776
- if attributes.has_key?(:'view_average_request_throughput')
834
+ if attributes.key?(:'view_average_request_throughput')
777
835
  self.view_average_request_throughput = attributes[:'view_average_request_throughput']
778
836
  end
779
837
 
780
- if attributes.has_key?(:'video_producer')
838
+ if attributes.key?(:'video_producer')
781
839
  self.video_producer = attributes[:'video_producer']
782
840
  end
783
841
 
784
- if attributes.has_key?(:'error_type_id')
842
+ if attributes.key?(:'error_type_id')
785
843
  self.error_type_id = attributes[:'error_type_id']
786
844
  end
787
845
 
788
- if attributes.has_key?(:'mux_viewer_id')
846
+ if attributes.key?(:'mux_viewer_id')
789
847
  self.mux_viewer_id = attributes[:'mux_viewer_id']
790
848
  end
791
849
 
792
- if attributes.has_key?(:'video_id')
850
+ if attributes.key?(:'video_id')
793
851
  self.video_id = attributes[:'video_id']
794
852
  end
795
853
 
796
- if attributes.has_key?(:'continent_code')
854
+ if attributes.key?(:'continent_code')
797
855
  self.continent_code = attributes[:'continent_code']
798
856
  end
799
857
 
800
- if attributes.has_key?(:'session_id')
858
+ if attributes.key?(:'session_id')
801
859
  self.session_id = attributes[:'session_id']
802
860
  end
803
861
 
804
- if attributes.has_key?(:'exit_before_video_start')
862
+ if attributes.key?(:'exit_before_video_start')
805
863
  self.exit_before_video_start = attributes[:'exit_before_video_start']
806
864
  end
807
865
 
808
- if attributes.has_key?(:'video_content_type')
866
+ if attributes.key?(:'video_content_type')
809
867
  self.video_content_type = attributes[:'video_content_type']
810
868
  end
811
869
 
812
- if attributes.has_key?(:'viewer_os_family')
870
+ if attributes.key?(:'viewer_os_family')
813
871
  self.viewer_os_family = attributes[:'viewer_os_family']
814
872
  end
815
873
 
816
- if attributes.has_key?(:'player_poster')
874
+ if attributes.key?(:'player_poster')
817
875
  self.player_poster = attributes[:'player_poster']
818
876
  end
819
877
 
820
- if attributes.has_key?(:'view_average_request_latency')
878
+ if attributes.key?(:'view_average_request_latency')
821
879
  self.view_average_request_latency = attributes[:'view_average_request_latency']
822
880
  end
823
881
 
824
- if attributes.has_key?(:'video_variant_id')
882
+ if attributes.key?(:'video_variant_id')
825
883
  self.video_variant_id = attributes[:'video_variant_id']
826
884
  end
827
885
 
828
- if attributes.has_key?(:'player_source_duration')
886
+ if attributes.key?(:'player_source_duration')
829
887
  self.player_source_duration = attributes[:'player_source_duration']
830
888
  end
831
889
 
832
- if attributes.has_key?(:'player_source_url')
890
+ if attributes.key?(:'player_source_url')
833
891
  self.player_source_url = attributes[:'player_source_url']
834
892
  end
835
893
 
836
- if attributes.has_key?(:'mux_api_version')
894
+ if attributes.key?(:'mux_api_version')
837
895
  self.mux_api_version = attributes[:'mux_api_version']
838
896
  end
839
897
 
840
- if attributes.has_key?(:'video_title')
898
+ if attributes.key?(:'video_title')
841
899
  self.video_title = attributes[:'video_title']
842
900
  end
843
901
 
844
- if attributes.has_key?(:'id')
902
+ if attributes.key?(:'id')
845
903
  self.id = attributes[:'id']
846
904
  end
847
905
 
848
- if attributes.has_key?(:'short_time')
906
+ if attributes.key?(:'short_time')
849
907
  self.short_time = attributes[:'short_time']
850
908
  end
851
909
 
852
- if attributes.has_key?(:'rebuffer_percentage')
910
+ if attributes.key?(:'rebuffer_percentage')
853
911
  self.rebuffer_percentage = attributes[:'rebuffer_percentage']
854
912
  end
855
913
 
856
- if attributes.has_key?(:'time_to_first_frame')
914
+ if attributes.key?(:'time_to_first_frame')
857
915
  self.time_to_first_frame = attributes[:'time_to_first_frame']
858
916
  end
859
917
 
860
- if attributes.has_key?(:'viewer_user_id')
918
+ if attributes.key?(:'viewer_user_id')
861
919
  self.viewer_user_id = attributes[:'viewer_user_id']
862
920
  end
863
921
 
864
- if attributes.has_key?(:'video_stream_type')
922
+ if attributes.key?(:'video_stream_type')
865
923
  self.video_stream_type = attributes[:'video_stream_type']
866
924
  end
867
925
 
868
- if attributes.has_key?(:'player_startup_time')
926
+ if attributes.key?(:'player_startup_time')
869
927
  self.player_startup_time = attributes[:'player_startup_time']
870
928
  end
871
929
 
872
- if attributes.has_key?(:'viewer_application_version')
930
+ if attributes.key?(:'viewer_application_version')
873
931
  self.viewer_application_version = attributes[:'viewer_application_version']
874
932
  end
875
933
 
876
- if attributes.has_key?(:'view_max_downscale_percentage')
934
+ if attributes.key?(:'view_max_downscale_percentage')
877
935
  self.view_max_downscale_percentage = attributes[:'view_max_downscale_percentage']
878
936
  end
879
937
 
880
- if attributes.has_key?(:'view_max_upscale_percentage')
938
+ if attributes.key?(:'view_max_upscale_percentage')
881
939
  self.view_max_upscale_percentage = attributes[:'view_max_upscale_percentage']
882
940
  end
883
941
 
884
- if attributes.has_key?(:'country_code')
942
+ if attributes.key?(:'country_code')
885
943
  self.country_code = attributes[:'country_code']
886
944
  end
887
945
 
888
- if attributes.has_key?(:'used_fullscreen')
946
+ if attributes.key?(:'used_fullscreen')
889
947
  self.used_fullscreen = attributes[:'used_fullscreen']
890
948
  end
891
949
 
892
- if attributes.has_key?(:'isp')
950
+ if attributes.key?(:'isp')
893
951
  self.isp = attributes[:'isp']
894
952
  end
895
953
 
896
- if attributes.has_key?(:'property_id')
954
+ if attributes.key?(:'property_id')
897
955
  self.property_id = attributes[:'property_id']
898
956
  end
899
957
 
900
- if attributes.has_key?(:'player_autoplay')
958
+ if attributes.key?(:'player_autoplay')
901
959
  self.player_autoplay = attributes[:'player_autoplay']
902
960
  end
903
961
 
904
- if attributes.has_key?(:'player_height')
962
+ if attributes.key?(:'player_height')
905
963
  self.player_height = attributes[:'player_height']
906
964
  end
907
965
 
908
- if attributes.has_key?(:'asn')
966
+ if attributes.key?(:'asn')
909
967
  self.asn = attributes[:'asn']
910
968
  end
911
969
 
912
- if attributes.has_key?(:'asn_name')
970
+ if attributes.key?(:'asn_name')
913
971
  self.asn_name = attributes[:'asn_name']
914
972
  end
915
973
 
916
- if attributes.has_key?(:'quality_score')
974
+ if attributes.key?(:'quality_score')
917
975
  self.quality_score = attributes[:'quality_score']
918
976
  end
919
977
 
920
- if attributes.has_key?(:'player_software_version')
978
+ if attributes.key?(:'player_software_version')
921
979
  self.player_software_version = attributes[:'player_software_version']
922
980
  end
923
981
 
924
- if attributes.has_key?(:'player_mux_plugin_name')
982
+ if attributes.key?(:'player_mux_plugin_name')
925
983
  self.player_mux_plugin_name = attributes[:'player_mux_plugin_name']
926
984
  end
985
+
986
+ if attributes.key?(:'sub_property_id')
987
+ self.sub_property_id = attributes[:'sub_property_id']
988
+ end
989
+
990
+ if attributes.key?(:'player_remote_played')
991
+ self.player_remote_played = attributes[:'player_remote_played']
992
+ end
993
+
994
+ if attributes.key?(:'view_max_playhead_position')
995
+ self.view_max_playhead_position = attributes[:'view_max_playhead_position']
996
+ end
997
+
998
+ if attributes.key?(:'view_playing_time')
999
+ self.view_playing_time = attributes[:'view_playing_time']
1000
+ end
1001
+
1002
+ if attributes.key?(:'view_session_id')
1003
+ self.view_session_id = attributes[:'view_session_id']
1004
+ end
1005
+
1006
+ if attributes.key?(:'viewer_connection_type')
1007
+ self.viewer_connection_type = attributes[:'viewer_connection_type']
1008
+ end
1009
+
1010
+ if attributes.key?(:'viewer_device_model')
1011
+ self.viewer_device_model = attributes[:'viewer_device_model']
1012
+ end
1013
+
1014
+ if attributes.key?(:'weighted_average_bitrate')
1015
+ self.weighted_average_bitrate = attributes[:'weighted_average_bitrate']
1016
+ end
927
1017
  end
928
1018
 
929
1019
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -1055,7 +1145,15 @@ module MuxRuby
1055
1145
  asn_name == o.asn_name &&
1056
1146
  quality_score == o.quality_score &&
1057
1147
  player_software_version == o.player_software_version &&
1058
- player_mux_plugin_name == o.player_mux_plugin_name
1148
+ player_mux_plugin_name == o.player_mux_plugin_name &&
1149
+ sub_property_id == o.sub_property_id &&
1150
+ player_remote_played == o.player_remote_played &&
1151
+ view_max_playhead_position == o.view_max_playhead_position &&
1152
+ view_playing_time == o.view_playing_time &&
1153
+ view_session_id == o.view_session_id &&
1154
+ viewer_connection_type == o.viewer_connection_type &&
1155
+ viewer_device_model == o.viewer_device_model &&
1156
+ weighted_average_bitrate == o.weighted_average_bitrate
1059
1157
  end
1060
1158
 
1061
1159
  # @see the `==` method
@@ -1065,9 +1163,9 @@ module MuxRuby
1065
1163
  end
1066
1164
 
1067
1165
  # Calculates hash code according to all attributes.
1068
- # @return [Fixnum] Hash code
1166
+ # @return [Integer] Hash code
1069
1167
  def hash
1070
- [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
1168
+ [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, sub_property_id, player_remote_played, view_max_playhead_position, view_playing_time, view_session_id, viewer_connection_type, viewer_device_model, weighted_average_bitrate].hash
1071
1169
  end
1072
1170
 
1073
1171
  # Builds the object from hash
@@ -1083,7 +1181,9 @@ module MuxRuby
1083
1181
  def build_from_hash(attributes)
1084
1182
  return nil unless attributes.is_a?(Hash)
1085
1183
  self.class.openapi_types.each_pair do |key, type|
1086
- if type =~ /\AArray<(.*)>/i
1184
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
1185
+ self.send("#{key}=", nil)
1186
+ elsif type =~ /\AArray<(.*)>/i
1087
1187
  # check to ensure the input is an array given that the attribute
1088
1188
  # is documented as an array but the input is not
1089
1189
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -1091,7 +1191,7 @@ module MuxRuby
1091
1191
  end
1092
1192
  elsif !attributes[self.class.attribute_map[key]].nil?
1093
1193
  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
1194
+ end
1095
1195
  end
1096
1196
 
1097
1197
  self
@@ -1103,8 +1203,8 @@ module MuxRuby
1103
1203
  # @return [Object] Deserialized data
1104
1204
  def _deserialize(type, value)
1105
1205
  case type.to_sym
1106
- when :DateTime
1107
- DateTime.parse(value)
1206
+ when :Time
1207
+ Time.parse(value)
1108
1208
  when :Date
1109
1209
  Date.parse(value)
1110
1210
  when :String
@@ -1113,7 +1213,7 @@ module MuxRuby
1113
1213
  value.to_i
1114
1214
  when :Float
1115
1215
  value.to_f
1116
- when :BOOLEAN
1216
+ when :Boolean
1117
1217
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1118
1218
  true
1119
1219
  else
@@ -1134,7 +1234,9 @@ module MuxRuby
1134
1234
  end
1135
1235
  end
1136
1236
  else # model
1137
- MuxRuby.const_get(type).build_from_hash(value)
1237
+ # models (e.g. Pet) or oneOf
1238
+ klass = MuxRuby.const_get(type)
1239
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1138
1240
  end
1139
1241
  end
1140
1242
 
@@ -1156,7 +1258,11 @@ module MuxRuby
1156
1258
  hash = {}
1157
1259
  self.class.attribute_map.each_pair do |attr, param|
1158
1260
  value = self.send(attr)
1159
- next if value.nil?
1261
+ if value.nil?
1262
+ is_nullable = self.class.openapi_nullable.include?(attr)
1263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1264
+ end
1265
+
1160
1266
  hash[param] = _to_hash(value)
1161
1267
  end
1162
1268
  hash