mux_ruby 1.5.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +4 -1
- data/docs/Asset.md +15 -12
- data/docs/AssetErrors.md +2 -2
- data/docs/AssetNonStandardInputReasons.md +16 -0
- data/docs/AssetRecordingTimes.md +9 -0
- data/docs/AssetStaticRenditions.md +1 -1
- data/docs/AssetsApi.md +4 -0
- data/docs/CreateAssetRequest.md +6 -6
- data/docs/CreateLiveStreamRequest.md +1 -0
- data/docs/CreateTrackRequest.md +4 -4
- data/docs/DimensionValue.md +9 -0
- data/docs/DimensionsApi.md +118 -0
- data/docs/DisableLiveStreamResponse.md +8 -0
- data/docs/EnableLiveStreamResponse.md +8 -0
- data/docs/FiltersApi.md +2 -2
- data/docs/GetAssetOrLiveStreamIdResponse.md +8 -0
- data/docs/GetAssetOrLiveStreamIdResponseData.md +10 -0
- data/docs/GetAssetOrLiveStreamIdResponseDataObject.md +9 -0
- data/docs/GetRealTimeBreakdownResponse.md +10 -0
- data/docs/GetRealTimeHistogramTimeseriesResponse.md +11 -0
- data/docs/GetRealTimeHistogramTimeseriesResponseMeta.md +8 -0
- data/docs/GetRealTimeTimeseriesResponse.md +10 -0
- data/docs/Incident.md +28 -0
- data/docs/IncidentBreakdown.md +10 -0
- data/docs/IncidentNotification.md +10 -0
- data/docs/IncidentNotificationRule.md +12 -0
- data/docs/IncidentResponse.md +9 -0
- data/docs/IncidentsApi.md +186 -0
- data/docs/InputSettings.md +9 -7
- data/docs/InputSettingsOverlaySettings.md +7 -7
- data/docs/ListDimensionValuesResponse.md +10 -0
- data/docs/ListDimensionsResponse.md +10 -0
- data/docs/ListIncidentsResponse.md +10 -0
- data/docs/ListRealTimeDimensionsResponse.md +10 -0
- data/docs/ListRealTimeDimensionsResponseData.md +9 -0
- data/docs/ListRealTimeMetricsResponse.md +10 -0
- data/docs/ListRelatedIncidentsResponse.md +10 -0
- data/docs/LiveStream.md +1 -1
- data/docs/LiveStreamsApi.md +104 -0
- data/docs/NotificationRule.md +10 -0
- data/docs/PlaybackID.md +1 -1
- data/docs/PlaybackIDApi.md +60 -0
- data/docs/RealTimeApi.md +280 -0
- data/docs/RealTimeBreakdownValue.md +12 -0
- data/docs/RealTimeHistogramTimeseriesBucket.md +9 -0
- data/docs/RealTimeHistogramTimeseriesBucketValues.md +9 -0
- data/docs/RealTimeHistogramTimeseriesDatapoint.md +14 -0
- data/docs/RealTimeTimeseriesDatapoint.md +10 -0
- data/docs/Track.md +13 -13
- data/docs/VideoView.md +16 -14
- data/examples/data/exercise-dimensions.rb +29 -0
- data/examples/data/exercise-incidents.rb +29 -0
- data/examples/data/exercise-realtime.rb +60 -0
- data/examples/video/exercise-assets.rb +21 -0
- data/examples/video/exercise-live-streams.rb +30 -0
- data/lib/mux_ruby.rb +34 -0
- data/lib/mux_ruby/api/assets_api.rb +4 -0
- data/lib/mux_ruby/api/dimensions_api.rb +128 -0
- data/lib/mux_ruby/api/filters_api.rb +4 -4
- data/lib/mux_ruby/api/incidents_api.rb +217 -0
- data/lib/mux_ruby/api/live_streams_api.rb +106 -0
- data/lib/mux_ruby/api/playback_id_api.rb +69 -0
- data/lib/mux_ruby/api/real_time_api.rb +311 -0
- data/lib/mux_ruby/api_client.rb +13 -13
- data/lib/mux_ruby/configuration.rb +1 -4
- data/lib/mux_ruby/models/asset.rb +70 -3
- data/lib/mux_ruby/models/asset_errors.rb +2 -0
- data/lib/mux_ruby/models/asset_master.rb +35 -0
- data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +335 -0
- data/lib/mux_ruby/models/asset_recording_times.rb +195 -0
- data/lib/mux_ruby/models/asset_static_renditions.rb +2 -2
- data/lib/mux_ruby/models/asset_static_renditions_files.rb +6 -6
- data/lib/mux_ruby/models/create_asset_request.rb +8 -2
- data/lib/mux_ruby/models/create_live_stream_request.rb +15 -4
- data/lib/mux_ruby/models/create_track_request.rb +6 -2
- data/lib/mux_ruby/models/dimension_value.rb +193 -0
- data/lib/mux_ruby/models/disable_live_stream_response.rb +184 -0
- data/lib/mux_ruby/models/enable_live_stream_response.rb +184 -0
- data/lib/mux_ruby/models/get_asset_or_live_stream_id_response.rb +184 -0
- data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data.rb +203 -0
- data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data_object.rb +230 -0
- data/lib/mux_ruby/models/get_real_time_breakdown_response.rb +206 -0
- data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response.rb +215 -0
- data/lib/mux_ruby/models/get_real_time_histogram_timeseries_response_meta.rb +186 -0
- data/lib/mux_ruby/models/get_real_time_timeseries_response.rb +206 -0
- data/lib/mux_ruby/models/incident.rb +370 -0
- data/lib/mux_ruby/models/incident_breakdown.rb +202 -0
- data/lib/mux_ruby/models/incident_notification.rb +202 -0
- data/lib/mux_ruby/models/incident_notification_rule.rb +222 -0
- data/lib/mux_ruby/models/incident_response.rb +195 -0
- data/lib/mux_ruby/models/input_settings.rb +31 -4
- data/lib/mux_ruby/models/input_settings_overlay_settings.rb +10 -2
- data/lib/mux_ruby/models/list_dimension_values_response.rb +206 -0
- data/lib/mux_ruby/models/list_dimensions_response.rb +204 -0
- data/lib/mux_ruby/models/list_incidents_response.rb +206 -0
- data/lib/mux_ruby/models/list_real_time_dimensions_response.rb +206 -0
- data/lib/mux_ruby/models/list_real_time_dimensions_response_data.rb +193 -0
- data/lib/mux_ruby/models/list_real_time_metrics_response.rb +206 -0
- data/lib/mux_ruby/models/list_related_incidents_response.rb +206 -0
- data/lib/mux_ruby/models/live_stream.rb +1 -1
- data/lib/mux_ruby/models/notification_rule.rb +202 -0
- data/lib/mux_ruby/models/playback_id.rb +1 -0
- data/lib/mux_ruby/models/real_time_breakdown_value.rb +220 -0
- data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket.rb +193 -0
- data/lib/mux_ruby/models/real_time_histogram_timeseries_bucket_values.rb +193 -0
- data/lib/mux_ruby/models/real_time_histogram_timeseries_datapoint.rb +240 -0
- data/lib/mux_ruby/models/real_time_timeseries_datapoint.rb +202 -0
- data/lib/mux_ruby/models/simulcast_target.rb +1 -1
- data/lib/mux_ruby/models/track.rb +27 -2
- data/lib/mux_ruby/models/update_asset_master_access_request.rb +1 -1
- data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +1 -1
- data/lib/mux_ruby/models/upload.rb +1 -1
- data/lib/mux_ruby/models/video_view.rb +36 -18
- data/lib/mux_ruby/version.rb +1 -1
- data/mux_ruby.gemspec +2 -0
- data/spec/api/assets_api_spec.rb +2 -0
- data/spec/api/dimensions_api_spec.rb +55 -0
- data/spec/api/filters_api_spec.rb +2 -2
- data/spec/api/incidents_api_spec.rb +73 -0
- data/spec/api/live_streams_api_spec.rb +24 -0
- data/spec/api/playback_id_api_spec.rb +40 -0
- data/spec/api/real_time_api_spec.rb +93 -0
- data/spec/models/asset_master_spec.rb +4 -0
- data/spec/models/asset_non_standard_input_reasons_spec.rb +98 -0
- data/spec/models/asset_recording_times_spec.rb +40 -0
- data/spec/models/asset_spec.rb +26 -0
- data/spec/models/asset_static_renditions_files_spec.rb +2 -2
- data/spec/models/create_live_stream_request_spec.rb +6 -0
- data/spec/models/dimension_value_spec.rb +40 -0
- data/spec/models/disable_live_stream_response_spec.rb +34 -0
- data/spec/models/enable_live_stream_response_spec.rb +34 -0
- data/spec/models/get_asset_or_live_stream_id_response_data_object_spec.rb +44 -0
- data/spec/models/get_asset_or_live_stream_id_response_data_spec.rb +46 -0
- data/spec/models/get_asset_or_live_stream_id_response_spec.rb +34 -0
- data/spec/models/get_real_time_breakdown_response_spec.rb +46 -0
- data/spec/models/get_real_time_histogram_timeseries_response_meta_spec.rb +34 -0
- data/spec/models/get_real_time_histogram_timeseries_response_spec.rb +52 -0
- data/spec/models/get_real_time_timeseries_response_spec.rb +46 -0
- data/spec/models/incident_breakdown_spec.rb +46 -0
- data/spec/models/incident_notification_rule_spec.rb +58 -0
- data/spec/models/incident_notification_spec.rb +46 -0
- data/spec/models/incident_response_spec.rb +40 -0
- data/spec/models/incident_spec.rb +154 -0
- data/spec/models/input_settings_spec.rb +12 -0
- data/spec/models/list_dimension_values_response_spec.rb +46 -0
- data/spec/models/list_dimensions_response_spec.rb +46 -0
- data/spec/models/list_incidents_response_spec.rb +46 -0
- data/spec/models/list_real_time_dimensions_response_data_spec.rb +40 -0
- data/spec/models/list_real_time_dimensions_response_spec.rb +46 -0
- data/spec/models/list_real_time_metrics_response_spec.rb +46 -0
- data/spec/models/list_related_incidents_response_spec.rb +46 -0
- data/spec/models/notification_rule_spec.rb +46 -0
- data/spec/models/real_time_breakdown_value_spec.rb +58 -0
- data/spec/models/real_time_histogram_timeseries_bucket_spec.rb +40 -0
- data/spec/models/real_time_histogram_timeseries_bucket_values_spec.rb +40 -0
- data/spec/models/real_time_histogram_timeseries_datapoint_spec.rb +70 -0
- data/spec/models/real_time_timeseries_datapoint_spec.rb +46 -0
- data/spec/models/track_spec.rb +4 -0
- data/spec/models/video_view_spec.rb +12 -0
- metadata +200 -60
@@ -0,0 +1,370 @@
|
|
1
|
+
=begin
|
2
|
+
# Mux Ruby - Copyright 2019 Mux Inc.
|
3
|
+
# NOTE: This file is auto generated. Do not edit this file manually.
|
4
|
+
=end
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
|
8
|
+
module MuxRuby
|
9
|
+
class Incident
|
10
|
+
attr_accessor :threshold
|
11
|
+
|
12
|
+
attr_accessor :status
|
13
|
+
|
14
|
+
attr_accessor :started_at
|
15
|
+
|
16
|
+
attr_accessor :severity
|
17
|
+
|
18
|
+
attr_accessor :sample_size_unit
|
19
|
+
|
20
|
+
attr_accessor :sample_size
|
21
|
+
|
22
|
+
attr_accessor :resolved_at
|
23
|
+
|
24
|
+
attr_accessor :notifications
|
25
|
+
|
26
|
+
attr_accessor :notification_rules
|
27
|
+
|
28
|
+
attr_accessor :measurement
|
29
|
+
|
30
|
+
attr_accessor :measured_value_on_close
|
31
|
+
|
32
|
+
attr_accessor :measured_value
|
33
|
+
|
34
|
+
attr_accessor :incident_key
|
35
|
+
|
36
|
+
attr_accessor :impact
|
37
|
+
|
38
|
+
attr_accessor :id
|
39
|
+
|
40
|
+
attr_accessor :error_description
|
41
|
+
|
42
|
+
attr_accessor :description
|
43
|
+
|
44
|
+
attr_accessor :breakdowns
|
45
|
+
|
46
|
+
attr_accessor :affected_views_per_hour_on_open
|
47
|
+
|
48
|
+
attr_accessor :affected_views_per_hour
|
49
|
+
|
50
|
+
attr_accessor :affected_views
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
def self.attribute_map
|
54
|
+
{
|
55
|
+
:'threshold' => :'threshold',
|
56
|
+
:'status' => :'status',
|
57
|
+
:'started_at' => :'started_at',
|
58
|
+
:'severity' => :'severity',
|
59
|
+
:'sample_size_unit' => :'sample_size_unit',
|
60
|
+
:'sample_size' => :'sample_size',
|
61
|
+
:'resolved_at' => :'resolved_at',
|
62
|
+
:'notifications' => :'notifications',
|
63
|
+
:'notification_rules' => :'notification_rules',
|
64
|
+
:'measurement' => :'measurement',
|
65
|
+
:'measured_value_on_close' => :'measured_value_on_close',
|
66
|
+
:'measured_value' => :'measured_value',
|
67
|
+
:'incident_key' => :'incident_key',
|
68
|
+
:'impact' => :'impact',
|
69
|
+
:'id' => :'id',
|
70
|
+
:'error_description' => :'error_description',
|
71
|
+
:'description' => :'description',
|
72
|
+
:'breakdowns' => :'breakdowns',
|
73
|
+
:'affected_views_per_hour_on_open' => :'affected_views_per_hour_on_open',
|
74
|
+
:'affected_views_per_hour' => :'affected_views_per_hour',
|
75
|
+
:'affected_views' => :'affected_views'
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# Attribute type mapping.
|
80
|
+
def self.openapi_types
|
81
|
+
{
|
82
|
+
:'threshold' => :'Float',
|
83
|
+
:'status' => :'String',
|
84
|
+
:'started_at' => :'String',
|
85
|
+
:'severity' => :'String',
|
86
|
+
:'sample_size_unit' => :'String',
|
87
|
+
:'sample_size' => :'Integer',
|
88
|
+
:'resolved_at' => :'String',
|
89
|
+
:'notifications' => :'Array<IncidentNotification>',
|
90
|
+
:'notification_rules' => :'Array<IncidentNotificationRule>',
|
91
|
+
:'measurement' => :'String',
|
92
|
+
:'measured_value_on_close' => :'Float',
|
93
|
+
:'measured_value' => :'Float',
|
94
|
+
:'incident_key' => :'String',
|
95
|
+
:'impact' => :'String',
|
96
|
+
:'id' => :'String',
|
97
|
+
:'error_description' => :'String',
|
98
|
+
:'description' => :'String',
|
99
|
+
:'breakdowns' => :'Array<IncidentBreakdown>',
|
100
|
+
:'affected_views_per_hour_on_open' => :'Integer',
|
101
|
+
:'affected_views_per_hour' => :'Integer',
|
102
|
+
:'affected_views' => :'Integer'
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
# Initializes the object
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
def initialize(attributes = {})
|
109
|
+
return unless attributes.is_a?(Hash)
|
110
|
+
|
111
|
+
# convert string to symbol for hash key
|
112
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
113
|
+
|
114
|
+
if attributes.has_key?(:'threshold')
|
115
|
+
self.threshold = attributes[:'threshold']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'status')
|
119
|
+
self.status = attributes[:'status']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'started_at')
|
123
|
+
self.started_at = attributes[:'started_at']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.has_key?(:'severity')
|
127
|
+
self.severity = attributes[:'severity']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.has_key?(:'sample_size_unit')
|
131
|
+
self.sample_size_unit = attributes[:'sample_size_unit']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.has_key?(:'sample_size')
|
135
|
+
self.sample_size = attributes[:'sample_size']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.has_key?(:'resolved_at')
|
139
|
+
self.resolved_at = attributes[:'resolved_at']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.has_key?(:'notifications')
|
143
|
+
if (value = attributes[:'notifications']).is_a?(Array)
|
144
|
+
self.notifications = value
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.has_key?(:'notification_rules')
|
149
|
+
if (value = attributes[:'notification_rules']).is_a?(Array)
|
150
|
+
self.notification_rules = value
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
if attributes.has_key?(:'measurement')
|
155
|
+
self.measurement = attributes[:'measurement']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.has_key?(:'measured_value_on_close')
|
159
|
+
self.measured_value_on_close = attributes[:'measured_value_on_close']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.has_key?(:'measured_value')
|
163
|
+
self.measured_value = attributes[:'measured_value']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.has_key?(:'incident_key')
|
167
|
+
self.incident_key = attributes[:'incident_key']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.has_key?(:'impact')
|
171
|
+
self.impact = attributes[:'impact']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.has_key?(:'id')
|
175
|
+
self.id = attributes[:'id']
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.has_key?(:'error_description')
|
179
|
+
self.error_description = attributes[:'error_description']
|
180
|
+
end
|
181
|
+
|
182
|
+
if attributes.has_key?(:'description')
|
183
|
+
self.description = attributes[:'description']
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.has_key?(:'breakdowns')
|
187
|
+
if (value = attributes[:'breakdowns']).is_a?(Array)
|
188
|
+
self.breakdowns = value
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.has_key?(:'affected_views_per_hour_on_open')
|
193
|
+
self.affected_views_per_hour_on_open = attributes[:'affected_views_per_hour_on_open']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.has_key?(:'affected_views_per_hour')
|
197
|
+
self.affected_views_per_hour = attributes[:'affected_views_per_hour']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.has_key?(:'affected_views')
|
201
|
+
self.affected_views = attributes[:'affected_views']
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
206
|
+
# @return Array for valid properties with the reasons
|
207
|
+
def list_invalid_properties
|
208
|
+
invalid_properties = Array.new
|
209
|
+
invalid_properties
|
210
|
+
end
|
211
|
+
|
212
|
+
# Check to see if the all the properties in the model are valid
|
213
|
+
# @return true if the model is valid
|
214
|
+
def valid?
|
215
|
+
true
|
216
|
+
end
|
217
|
+
|
218
|
+
# Checks equality by comparing each attribute.
|
219
|
+
# @param [Object] Object to be compared
|
220
|
+
def ==(o)
|
221
|
+
return true if self.equal?(o)
|
222
|
+
self.class == o.class &&
|
223
|
+
threshold == o.threshold &&
|
224
|
+
status == o.status &&
|
225
|
+
started_at == o.started_at &&
|
226
|
+
severity == o.severity &&
|
227
|
+
sample_size_unit == o.sample_size_unit &&
|
228
|
+
sample_size == o.sample_size &&
|
229
|
+
resolved_at == o.resolved_at &&
|
230
|
+
notifications == o.notifications &&
|
231
|
+
notification_rules == o.notification_rules &&
|
232
|
+
measurement == o.measurement &&
|
233
|
+
measured_value_on_close == o.measured_value_on_close &&
|
234
|
+
measured_value == o.measured_value &&
|
235
|
+
incident_key == o.incident_key &&
|
236
|
+
impact == o.impact &&
|
237
|
+
id == o.id &&
|
238
|
+
error_description == o.error_description &&
|
239
|
+
description == o.description &&
|
240
|
+
breakdowns == o.breakdowns &&
|
241
|
+
affected_views_per_hour_on_open == o.affected_views_per_hour_on_open &&
|
242
|
+
affected_views_per_hour == o.affected_views_per_hour &&
|
243
|
+
affected_views == o.affected_views
|
244
|
+
end
|
245
|
+
|
246
|
+
# @see the `==` method
|
247
|
+
# @param [Object] Object to be compared
|
248
|
+
def eql?(o)
|
249
|
+
self == o
|
250
|
+
end
|
251
|
+
|
252
|
+
# Calculates hash code according to all attributes.
|
253
|
+
# @return [Fixnum] Hash code
|
254
|
+
def hash
|
255
|
+
[threshold, status, started_at, severity, sample_size_unit, sample_size, resolved_at, notifications, notification_rules, measurement, measured_value_on_close, measured_value, incident_key, impact, id, error_description, description, breakdowns, affected_views_per_hour_on_open, affected_views_per_hour, affected_views].hash
|
256
|
+
end
|
257
|
+
|
258
|
+
# Builds the object from hash
|
259
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
260
|
+
# @return [Object] Returns the model itself
|
261
|
+
def self.build_from_hash(attributes)
|
262
|
+
new.build_from_hash(attributes)
|
263
|
+
end
|
264
|
+
|
265
|
+
# Builds the object from hash
|
266
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
267
|
+
# @return [Object] Returns the model itself
|
268
|
+
def build_from_hash(attributes)
|
269
|
+
return nil unless attributes.is_a?(Hash)
|
270
|
+
self.class.openapi_types.each_pair do |key, type|
|
271
|
+
if type =~ /\AArray<(.*)>/i
|
272
|
+
# check to ensure the input is an array given that the attribute
|
273
|
+
# is documented as an array but the input is not
|
274
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
275
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
276
|
+
end
|
277
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
278
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
279
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
280
|
+
end
|
281
|
+
|
282
|
+
self
|
283
|
+
end
|
284
|
+
|
285
|
+
# Deserializes the data based on type
|
286
|
+
# @param string type Data type
|
287
|
+
# @param string value Value to be deserialized
|
288
|
+
# @return [Object] Deserialized data
|
289
|
+
def _deserialize(type, value)
|
290
|
+
case type.to_sym
|
291
|
+
when :DateTime
|
292
|
+
DateTime.parse(value)
|
293
|
+
when :Date
|
294
|
+
Date.parse(value)
|
295
|
+
when :String
|
296
|
+
value.to_s
|
297
|
+
when :Integer
|
298
|
+
value.to_i
|
299
|
+
when :Float
|
300
|
+
value.to_f
|
301
|
+
when :BOOLEAN
|
302
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
303
|
+
true
|
304
|
+
else
|
305
|
+
false
|
306
|
+
end
|
307
|
+
when :Object
|
308
|
+
# generic object (usually a Hash), return directly
|
309
|
+
value
|
310
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
311
|
+
inner_type = Regexp.last_match[:inner_type]
|
312
|
+
value.map { |v| _deserialize(inner_type, v) }
|
313
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
314
|
+
k_type = Regexp.last_match[:k_type]
|
315
|
+
v_type = Regexp.last_match[:v_type]
|
316
|
+
{}.tap do |hash|
|
317
|
+
value.each do |k, v|
|
318
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
319
|
+
end
|
320
|
+
end
|
321
|
+
else # model
|
322
|
+
MuxRuby.const_get(type).build_from_hash(value)
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
326
|
+
# Returns the string representation of the object
|
327
|
+
# @return [String] String presentation of the object
|
328
|
+
def to_s
|
329
|
+
to_hash.to_s
|
330
|
+
end
|
331
|
+
|
332
|
+
# to_body is an alias to to_hash (backward compatibility)
|
333
|
+
# @return [Hash] Returns the object in the form of hash
|
334
|
+
def to_body
|
335
|
+
to_hash
|
336
|
+
end
|
337
|
+
|
338
|
+
# Returns the object in the form of hash
|
339
|
+
# @return [Hash] Returns the object in the form of hash
|
340
|
+
def to_hash
|
341
|
+
hash = {}
|
342
|
+
self.class.attribute_map.each_pair do |attr, param|
|
343
|
+
value = self.send(attr)
|
344
|
+
next if value.nil?
|
345
|
+
hash[param] = _to_hash(value)
|
346
|
+
end
|
347
|
+
hash
|
348
|
+
end
|
349
|
+
|
350
|
+
# Outputs non-array value in the form of hash
|
351
|
+
# For object, use to_hash. Otherwise, just return the value
|
352
|
+
# @param [Object] value Any valid value
|
353
|
+
# @return [Hash] Returns the value in the form of hash
|
354
|
+
def _to_hash(value)
|
355
|
+
if value.is_a?(Array)
|
356
|
+
value.compact.map { |v| _to_hash(v) }
|
357
|
+
elsif value.is_a?(Hash)
|
358
|
+
{}.tap do |hash|
|
359
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
360
|
+
end
|
361
|
+
elsif value.respond_to? :to_hash
|
362
|
+
value.to_hash
|
363
|
+
else
|
364
|
+
value
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
end
|
369
|
+
|
370
|
+
end
|
@@ -0,0 +1,202 @@
|
|
1
|
+
=begin
|
2
|
+
# Mux Ruby - Copyright 2019 Mux Inc.
|
3
|
+
# NOTE: This file is auto generated. Do not edit this file manually.
|
4
|
+
=end
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
|
8
|
+
module MuxRuby
|
9
|
+
class IncidentBreakdown
|
10
|
+
attr_accessor :value
|
11
|
+
|
12
|
+
attr_accessor :name
|
13
|
+
|
14
|
+
attr_accessor :id
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:'value' => :'value',
|
20
|
+
:'name' => :'name',
|
21
|
+
:'id' => :'id'
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Attribute type mapping.
|
26
|
+
def self.openapi_types
|
27
|
+
{
|
28
|
+
:'value' => :'String',
|
29
|
+
:'name' => :'String',
|
30
|
+
:'id' => :'String'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Initializes the object
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
41
|
+
|
42
|
+
if attributes.has_key?(:'value')
|
43
|
+
self.value = attributes[:'value']
|
44
|
+
end
|
45
|
+
|
46
|
+
if attributes.has_key?(:'name')
|
47
|
+
self.name = attributes[:'name']
|
48
|
+
end
|
49
|
+
|
50
|
+
if attributes.has_key?(:'id')
|
51
|
+
self.id = attributes[:'id']
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
56
|
+
# @return Array for valid properties with the reasons
|
57
|
+
def list_invalid_properties
|
58
|
+
invalid_properties = Array.new
|
59
|
+
invalid_properties
|
60
|
+
end
|
61
|
+
|
62
|
+
# Check to see if the all the properties in the model are valid
|
63
|
+
# @return true if the model is valid
|
64
|
+
def valid?
|
65
|
+
true
|
66
|
+
end
|
67
|
+
|
68
|
+
# Checks equality by comparing each attribute.
|
69
|
+
# @param [Object] Object to be compared
|
70
|
+
def ==(o)
|
71
|
+
return true if self.equal?(o)
|
72
|
+
self.class == o.class &&
|
73
|
+
value == o.value &&
|
74
|
+
name == o.name &&
|
75
|
+
id == o.id
|
76
|
+
end
|
77
|
+
|
78
|
+
# @see the `==` method
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def eql?(o)
|
81
|
+
self == o
|
82
|
+
end
|
83
|
+
|
84
|
+
# Calculates hash code according to all attributes.
|
85
|
+
# @return [Fixnum] Hash code
|
86
|
+
def hash
|
87
|
+
[value, name, id].hash
|
88
|
+
end
|
89
|
+
|
90
|
+
# Builds the object from hash
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
# @return [Object] Returns the model itself
|
93
|
+
def self.build_from_hash(attributes)
|
94
|
+
new.build_from_hash(attributes)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def build_from_hash(attributes)
|
101
|
+
return nil unless attributes.is_a?(Hash)
|
102
|
+
self.class.openapi_types.each_pair do |key, type|
|
103
|
+
if type =~ /\AArray<(.*)>/i
|
104
|
+
# check to ensure the input is an array given that the attribute
|
105
|
+
# is documented as an array but the input is not
|
106
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
107
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
108
|
+
end
|
109
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
111
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
112
|
+
end
|
113
|
+
|
114
|
+
self
|
115
|
+
end
|
116
|
+
|
117
|
+
# Deserializes the data based on type
|
118
|
+
# @param string type Data type
|
119
|
+
# @param string value Value to be deserialized
|
120
|
+
# @return [Object] Deserialized data
|
121
|
+
def _deserialize(type, value)
|
122
|
+
case type.to_sym
|
123
|
+
when :DateTime
|
124
|
+
DateTime.parse(value)
|
125
|
+
when :Date
|
126
|
+
Date.parse(value)
|
127
|
+
when :String
|
128
|
+
value.to_s
|
129
|
+
when :Integer
|
130
|
+
value.to_i
|
131
|
+
when :Float
|
132
|
+
value.to_f
|
133
|
+
when :BOOLEAN
|
134
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
|
+
true
|
136
|
+
else
|
137
|
+
false
|
138
|
+
end
|
139
|
+
when :Object
|
140
|
+
# generic object (usually a Hash), return directly
|
141
|
+
value
|
142
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
143
|
+
inner_type = Regexp.last_match[:inner_type]
|
144
|
+
value.map { |v| _deserialize(inner_type, v) }
|
145
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
146
|
+
k_type = Regexp.last_match[:k_type]
|
147
|
+
v_type = Regexp.last_match[:v_type]
|
148
|
+
{}.tap do |hash|
|
149
|
+
value.each do |k, v|
|
150
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
else # model
|
154
|
+
MuxRuby.const_get(type).build_from_hash(value)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
# Returns the string representation of the object
|
159
|
+
# @return [String] String presentation of the object
|
160
|
+
def to_s
|
161
|
+
to_hash.to_s
|
162
|
+
end
|
163
|
+
|
164
|
+
# to_body is an alias to to_hash (backward compatibility)
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
166
|
+
def to_body
|
167
|
+
to_hash
|
168
|
+
end
|
169
|
+
|
170
|
+
# Returns the object in the form of hash
|
171
|
+
# @return [Hash] Returns the object in the form of hash
|
172
|
+
def to_hash
|
173
|
+
hash = {}
|
174
|
+
self.class.attribute_map.each_pair do |attr, param|
|
175
|
+
value = self.send(attr)
|
176
|
+
next if value.nil?
|
177
|
+
hash[param] = _to_hash(value)
|
178
|
+
end
|
179
|
+
hash
|
180
|
+
end
|
181
|
+
|
182
|
+
# Outputs non-array value in the form of hash
|
183
|
+
# For object, use to_hash. Otherwise, just return the value
|
184
|
+
# @param [Object] value Any valid value
|
185
|
+
# @return [Hash] Returns the value in the form of hash
|
186
|
+
def _to_hash(value)
|
187
|
+
if value.is_a?(Array)
|
188
|
+
value.compact.map { |v| _to_hash(v) }
|
189
|
+
elsif value.is_a?(Hash)
|
190
|
+
{}.tap do |hash|
|
191
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
192
|
+
end
|
193
|
+
elsif value.respond_to? :to_hash
|
194
|
+
value.to_hash
|
195
|
+
else
|
196
|
+
value
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
201
|
+
|
202
|
+
end
|