seatschart 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +162 -15
- data/lib/seatschart/api/audit_api.rb +2 -2
- data/lib/seatschart/api/charts_api.rb +799 -66
- data/lib/seatschart/api/embed_api.rb +5 -5
- data/lib/seatschart/api/embed_origins_api.rb +63 -2
- data/lib/seatschart/api/event_log_api.rb +2 -2
- data/lib/seatschart/api/events_api.rb +1471 -155
- data/lib/seatschart/api/health_api.rb +244 -0
- data/lib/seatschart/api/map_designer_api.rb +11 -9
- data/lib/seatschart/api/public_api.rb +350 -0
- data/lib/seatschart/api/sandboxes_api.rb +672 -0
- data/lib/seatschart/api/seasons_api.rb +344 -36
- data/lib/seatschart/api/seats_api.rb +10 -10
- data/lib/seatschart/api/usage_api.rb +18 -15
- data/lib/seatschart/api/webhooks_api.rb +2 -2
- data/lib/seatschart/api/workspace_api.rb +306 -20
- data/lib/seatschart/models/api_error.rb +4 -4
- data/lib/seatschart/models/delete_api_sandboxes_by_sandbox_id200_response.rb +255 -0
- data/lib/seatschart/models/get_api_monitoring_requests200_response.rb +62 -4
- data/lib/seatschart/models/get_api_monitoring_requests200_response_points_inner.rb +21 -4
- data/lib/seatschart/models/get_api_sandboxes200_response.rb +239 -0
- data/lib/seatschart/models/get_api_sandboxes200_response_items_inner.rb +431 -0
- data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_rate_limits.rb +270 -0
- data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_usage.rb +287 -0
- data/lib/seatschart/models/get_api_status200_response.rb +387 -0
- data/lib/seatschart/models/get_api_status200_response_components_inner.rb +330 -0
- data/lib/seatschart/models/get_api_status200_response_components_inner_days_inner.rb +301 -0
- data/lib/seatschart/models/get_api_status200_response_incidents_inner.rb +374 -0
- data/lib/seatschart/models/get_api_status200_response_maintenance_inner.rb +350 -0
- data/lib/seatschart/models/get_api_status503_response.rb +271 -0
- data/lib/seatschart/models/get_api_workspace_buyer_extra_data200_response.rb +241 -0
- data/lib/seatschart/models/get_api_workspace_defaults200_response.rb +254 -0
- data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer.rb +246 -0
- data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer_built_in.rb +270 -0
- data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +34 -5
- data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +16 -6
- data/lib/seatschart/models/patch_api_seasons_by_season_id_request.rb +15 -5
- data/lib/seatschart/models/patch_api_workspace_chart_validation_request_severities.rb +25 -4
- data/lib/seatschart/models/patch_api_workspace_defaults_request.rb +224 -0
- data/lib/seatschart/models/patch_api_workspace_defaults_request_renderer.rb +249 -0
- data/lib/seatschart/models/patch_api_workspace_settings_request.rb +6 -6
- data/lib/seatschart/models/post_api_charts_by_chart_id_actions_copy_to_workspace_request.rb +39 -1
- data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request.rb +1 -0
- data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish422_response_issues_inner.rb +64 -6
- data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish_request.rb +1 -1
- data/lib/seatschart/models/post_api_embed_tokens_request.rb +18 -15
- data/lib/seatschart/models/post_api_embed_tokens_request_safe_mode_options.rb +226 -0
- data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request.rb +251 -0
- data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request_events_inner.rb +322 -0
- data/lib/seatschart/models/post_api_events_bulk_request_events_inner.rb +42 -1
- data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request.rb +277 -0
- data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request_for_sale_inner.rb +319 -0
- data/lib/seatschart/models/post_api_events_by_event_id_map_publish_request.rb +215 -0
- data/lib/seatschart/models/post_api_events_request.rb +42 -1
- data/lib/seatschart/models/{patch_api_events_by_event_id_request_categories_inner.rb → post_api_events_request_categories_inner.rb} +3 -3
- data/lib/seatschart/models/post_api_extract_seats200_response.rb +459 -0
- data/lib/seatschart/models/post_api_extract_seats200_response_seats_inner.rb +323 -0
- data/lib/seatschart/models/post_api_extract_seats200_response_suggested_inner.rb +320 -0
- data/lib/seatschart/models/post_api_extract_seats_request.rb +124 -4
- data/lib/seatschart/models/post_api_extract_seats_request_examples.rb +105 -0
- data/lib/seatschart/models/post_api_extract_seats_request_examples_any_of_inner.rb +293 -0
- data/lib/seatschart/models/post_api_extract_seats_request_negatives.rb +105 -0
- data/lib/seatschart/models/post_api_extract_seats_request_region.rb +105 -0
- data/lib/seatschart/models/post_api_extract_seats_request_region_any_of.rb +363 -0
- data/lib/seatschart/models/post_api_sandboxes201_response.rb +245 -0
- data/lib/seatschart/models/post_api_sandboxes201_response_admin_key.rb +286 -0
- data/lib/seatschart/models/post_api_sandboxes201_response_copied.rb +313 -0
- data/lib/seatschart/models/post_api_sandboxes201_response_copied_charts_inner.rb +281 -0
- data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_inner.rb +281 -0
- data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_with_own_map_inner.rb +265 -0
- data/lib/seatschart/models/post_api_sandboxes201_response_copied_key_conflicts_inner.rb +287 -0
- data/lib/seatschart/models/post_api_sandboxes201_response_copied_seasons_inner.rb +312 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production200_response.rb +313 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request.rb +255 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_join200_response.rb +271 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +268 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset_request.rb +225 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response.rb +253 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response_api_key.rb +286 -0
- data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key_request.rb +252 -0
- data/lib/seatschart/models/post_api_sandboxes_request.rb +319 -0
- data/lib/seatschart/models/post_api_seasons_request.rb +14 -4
- data/lib/seatschart/models/post_api_seats_confirm_request.rb +5 -5
- data/lib/seatschart/models/post_api_seats_release_request.rb +5 -5
- data/lib/seatschart/models/post_api_seats_reserve_request.rb +5 -5
- data/lib/seatschart/models/post_api_workspaces_request.rb +1 -1
- data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +1 -0
- data/lib/seatschart/models/put_api_workspace_buyer_extra_data_request.rb +260 -0
- data/lib/seatschart/models/put_internal_status_notices_request.rb +242 -0
- data/lib/seatschart/models/put_internal_status_notices_request_notices_inner.rb +445 -0
- data/lib/seatschart/retry.rb +106 -7
- data/lib/seatschart/version.rb +1 -1
- data/lib/seatschart.rb +53 -2
- metadata +55 -4
- data/lib/seatschart/api/default_api.rb +0 -763
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SeatsChart API
|
|
3
|
+
|
|
4
|
+
#Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.11.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module SeatsChart
|
|
17
|
+
class PostApiExtractSeats200Response
|
|
18
|
+
attr_accessor :width
|
|
19
|
+
|
|
20
|
+
attr_accessor :height
|
|
21
|
+
|
|
22
|
+
attr_accessor :seats
|
|
23
|
+
|
|
24
|
+
attr_accessor :mode
|
|
25
|
+
|
|
26
|
+
# `ok`; `low_resolution`: the seats are drawn too small to be read one by one; `no_individual_seats`: the plan shows sections or blocks, not seats. When not `ok`, every seat is `doubtful` and the count must not be trusted.
|
|
27
|
+
attr_accessor :legibility
|
|
28
|
+
|
|
29
|
+
# How many seats are flagged `doubtful`.
|
|
30
|
+
attr_accessor :review
|
|
31
|
+
|
|
32
|
+
# Only when a `vector` file was sent: `used` when its drawn geometry checked the seats, `unusable` when it held none (a scanned page, no seat-sized shapes, over the work budget) and the image alone was scanned.
|
|
33
|
+
attr_accessor :vector
|
|
34
|
+
|
|
35
|
+
# Auto and examples modes: places where a seat was probably missed (a gap in a row, the end of a row, a mark that looks like the clicked seats but scored below the threshold), best first. They are not part of `seats`; the designer offers them in the review, where one key adds one. Omitted when there are none.
|
|
36
|
+
attr_accessor :suggested
|
|
37
|
+
|
|
38
|
+
class EnumAttributeValidator
|
|
39
|
+
attr_reader :datatype
|
|
40
|
+
attr_reader :allowable_values
|
|
41
|
+
|
|
42
|
+
def initialize(datatype, allowable_values)
|
|
43
|
+
@allowable_values = allowable_values.map do |value|
|
|
44
|
+
case datatype.to_s
|
|
45
|
+
when /Integer/i
|
|
46
|
+
value.to_i
|
|
47
|
+
when /Float/i
|
|
48
|
+
value.to_f
|
|
49
|
+
else
|
|
50
|
+
value
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def valid?(value)
|
|
56
|
+
!value || allowable_values.include?(value)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
61
|
+
def self.attribute_map
|
|
62
|
+
{
|
|
63
|
+
:'width' => :'width',
|
|
64
|
+
:'height' => :'height',
|
|
65
|
+
:'seats' => :'seats',
|
|
66
|
+
:'mode' => :'mode',
|
|
67
|
+
:'legibility' => :'legibility',
|
|
68
|
+
:'review' => :'review',
|
|
69
|
+
:'vector' => :'vector',
|
|
70
|
+
:'suggested' => :'suggested'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Returns all the JSON keys this model knows about
|
|
75
|
+
def self.acceptable_attributes
|
|
76
|
+
attribute_map.values
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Attribute type mapping.
|
|
80
|
+
def self.openapi_types
|
|
81
|
+
{
|
|
82
|
+
:'width' => :'Integer',
|
|
83
|
+
:'height' => :'Integer',
|
|
84
|
+
:'seats' => :'Array<PostApiExtractSeats200ResponseSeatsInner>',
|
|
85
|
+
:'mode' => :'String',
|
|
86
|
+
:'legibility' => :'String',
|
|
87
|
+
:'review' => :'Integer',
|
|
88
|
+
:'vector' => :'String',
|
|
89
|
+
:'suggested' => :'Array<PostApiExtractSeats200ResponseSuggestedInner>'
|
|
90
|
+
}
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# List of attributes with nullable: true
|
|
94
|
+
def self.openapi_nullable
|
|
95
|
+
Set.new([
|
|
96
|
+
])
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Initializes the object
|
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
101
|
+
def initialize(attributes = {})
|
|
102
|
+
if (!attributes.is_a?(Hash))
|
|
103
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiExtractSeats200Response` initialize method"
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiExtractSeats200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
110
|
+
end
|
|
111
|
+
h[k.to_sym] = v
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'width')
|
|
115
|
+
self.width = attributes[:'width']
|
|
116
|
+
else
|
|
117
|
+
self.width = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'height')
|
|
121
|
+
self.height = attributes[:'height']
|
|
122
|
+
else
|
|
123
|
+
self.height = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'seats')
|
|
127
|
+
if (value = attributes[:'seats']).is_a?(Array)
|
|
128
|
+
self.seats = value
|
|
129
|
+
end
|
|
130
|
+
else
|
|
131
|
+
self.seats = nil
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'mode')
|
|
135
|
+
self.mode = attributes[:'mode']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'legibility')
|
|
139
|
+
self.legibility = attributes[:'legibility']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'review')
|
|
143
|
+
self.review = attributes[:'review']
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'vector')
|
|
147
|
+
self.vector = attributes[:'vector']
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'suggested')
|
|
151
|
+
if (value = attributes[:'suggested']).is_a?(Array)
|
|
152
|
+
self.suggested = value
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
158
|
+
# @return Array for valid properties with the reasons
|
|
159
|
+
def list_invalid_properties
|
|
160
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
161
|
+
invalid_properties = Array.new
|
|
162
|
+
if @width.nil?
|
|
163
|
+
invalid_properties.push('invalid value for "width", width cannot be nil.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if @width < 1
|
|
167
|
+
invalid_properties.push('invalid value for "width", must be greater than or equal to 1.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if @height.nil?
|
|
171
|
+
invalid_properties.push('invalid value for "height", height cannot be nil.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if @height < 1
|
|
175
|
+
invalid_properties.push('invalid value for "height", must be greater than or equal to 1.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if @seats.nil?
|
|
179
|
+
invalid_properties.push('invalid value for "seats", seats cannot be nil.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if @seats.length > 20000
|
|
183
|
+
invalid_properties.push('invalid value for "seats", number of items must be less than or equal to 20000.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if !@review.nil? && @review < 0
|
|
187
|
+
invalid_properties.push('invalid value for "review", must be greater than or equal to 0.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if !@suggested.nil? && @suggested.length > 20000
|
|
191
|
+
invalid_properties.push('invalid value for "suggested", number of items must be less than or equal to 20000.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
invalid_properties
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Check to see if the all the properties in the model are valid
|
|
198
|
+
# @return true if the model is valid
|
|
199
|
+
def valid?
|
|
200
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
201
|
+
return false if @width.nil?
|
|
202
|
+
return false if @width < 1
|
|
203
|
+
return false if @height.nil?
|
|
204
|
+
return false if @height < 1
|
|
205
|
+
return false if @seats.nil?
|
|
206
|
+
return false if @seats.length > 20000
|
|
207
|
+
mode_validator = EnumAttributeValidator.new('String', ["auto", "examples", "edges", "calibration", "profile"])
|
|
208
|
+
return false unless mode_validator.valid?(@mode)
|
|
209
|
+
legibility_validator = EnumAttributeValidator.new('String', ["ok", "low_resolution", "no_individual_seats"])
|
|
210
|
+
return false unless legibility_validator.valid?(@legibility)
|
|
211
|
+
return false if !@review.nil? && @review < 0
|
|
212
|
+
vector_validator = EnumAttributeValidator.new('String', ["used", "unusable"])
|
|
213
|
+
return false unless vector_validator.valid?(@vector)
|
|
214
|
+
return false if !@suggested.nil? && @suggested.length > 20000
|
|
215
|
+
true
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] width Value to be assigned
|
|
220
|
+
def width=(width)
|
|
221
|
+
if width.nil?
|
|
222
|
+
fail ArgumentError, 'width cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if width < 1
|
|
226
|
+
fail ArgumentError, 'invalid value for "width", must be greater than or equal to 1.'
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
@width = width
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Custom attribute writer method with validation
|
|
233
|
+
# @param [Object] height Value to be assigned
|
|
234
|
+
def height=(height)
|
|
235
|
+
if height.nil?
|
|
236
|
+
fail ArgumentError, 'height cannot be nil'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if height < 1
|
|
240
|
+
fail ArgumentError, 'invalid value for "height", must be greater than or equal to 1.'
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
@height = height
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Custom attribute writer method with validation
|
|
247
|
+
# @param [Object] seats Value to be assigned
|
|
248
|
+
def seats=(seats)
|
|
249
|
+
if seats.nil?
|
|
250
|
+
fail ArgumentError, 'seats cannot be nil'
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
if seats.length > 20000
|
|
254
|
+
fail ArgumentError, 'invalid value for "seats", number of items must be less than or equal to 20000.'
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
@seats = seats
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
261
|
+
# @param [Object] mode Object to be assigned
|
|
262
|
+
def mode=(mode)
|
|
263
|
+
validator = EnumAttributeValidator.new('String', ["auto", "examples", "edges", "calibration", "profile"])
|
|
264
|
+
unless validator.valid?(mode)
|
|
265
|
+
fail ArgumentError, "invalid value for \"mode\", must be one of #{validator.allowable_values}."
|
|
266
|
+
end
|
|
267
|
+
@mode = mode
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
271
|
+
# @param [Object] legibility Object to be assigned
|
|
272
|
+
def legibility=(legibility)
|
|
273
|
+
validator = EnumAttributeValidator.new('String', ["ok", "low_resolution", "no_individual_seats"])
|
|
274
|
+
unless validator.valid?(legibility)
|
|
275
|
+
fail ArgumentError, "invalid value for \"legibility\", must be one of #{validator.allowable_values}."
|
|
276
|
+
end
|
|
277
|
+
@legibility = legibility
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Custom attribute writer method with validation
|
|
281
|
+
# @param [Object] review Value to be assigned
|
|
282
|
+
def review=(review)
|
|
283
|
+
if review.nil?
|
|
284
|
+
fail ArgumentError, 'review cannot be nil'
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
if review < 0
|
|
288
|
+
fail ArgumentError, 'invalid value for "review", must be greater than or equal to 0.'
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
@review = review
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
295
|
+
# @param [Object] vector Object to be assigned
|
|
296
|
+
def vector=(vector)
|
|
297
|
+
validator = EnumAttributeValidator.new('String', ["used", "unusable"])
|
|
298
|
+
unless validator.valid?(vector)
|
|
299
|
+
fail ArgumentError, "invalid value for \"vector\", must be one of #{validator.allowable_values}."
|
|
300
|
+
end
|
|
301
|
+
@vector = vector
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Custom attribute writer method with validation
|
|
305
|
+
# @param [Object] suggested Value to be assigned
|
|
306
|
+
def suggested=(suggested)
|
|
307
|
+
if suggested.nil?
|
|
308
|
+
fail ArgumentError, 'suggested cannot be nil'
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
if suggested.length > 20000
|
|
312
|
+
fail ArgumentError, 'invalid value for "suggested", number of items must be less than or equal to 20000.'
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
@suggested = suggested
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Checks equality by comparing each attribute.
|
|
319
|
+
# @param [Object] Object to be compared
|
|
320
|
+
def ==(o)
|
|
321
|
+
return true if self.equal?(o)
|
|
322
|
+
self.class == o.class &&
|
|
323
|
+
width == o.width &&
|
|
324
|
+
height == o.height &&
|
|
325
|
+
seats == o.seats &&
|
|
326
|
+
mode == o.mode &&
|
|
327
|
+
legibility == o.legibility &&
|
|
328
|
+
review == o.review &&
|
|
329
|
+
vector == o.vector &&
|
|
330
|
+
suggested == o.suggested
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# @see the `==` method
|
|
334
|
+
# @param [Object] Object to be compared
|
|
335
|
+
def eql?(o)
|
|
336
|
+
self == o
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
# Calculates hash code according to all attributes.
|
|
340
|
+
# @return [Integer] Hash code
|
|
341
|
+
def hash
|
|
342
|
+
[width, height, seats, mode, legibility, review, vector, suggested].hash
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Builds the object from hash
|
|
346
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
347
|
+
# @return [Object] Returns the model itself
|
|
348
|
+
def self.build_from_hash(attributes)
|
|
349
|
+
return nil unless attributes.is_a?(Hash)
|
|
350
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
351
|
+
transformed_hash = {}
|
|
352
|
+
openapi_types.each_pair do |key, type|
|
|
353
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
354
|
+
transformed_hash["#{key}"] = nil
|
|
355
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
356
|
+
# check to ensure the input is an array given that the attribute
|
|
357
|
+
# is documented as an array but the input is not
|
|
358
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
359
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
360
|
+
end
|
|
361
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
362
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
new(transformed_hash)
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Deserializes the data based on type
|
|
369
|
+
# @param string type Data type
|
|
370
|
+
# @param string value Value to be deserialized
|
|
371
|
+
# @return [Object] Deserialized data
|
|
372
|
+
def self._deserialize(type, value)
|
|
373
|
+
case type.to_sym
|
|
374
|
+
when :Time
|
|
375
|
+
Time.parse(value)
|
|
376
|
+
when :Date
|
|
377
|
+
Date.parse(value)
|
|
378
|
+
when :String
|
|
379
|
+
value.to_s
|
|
380
|
+
when :Integer
|
|
381
|
+
value.to_i
|
|
382
|
+
when :Float
|
|
383
|
+
value.to_f
|
|
384
|
+
when :Boolean
|
|
385
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
386
|
+
true
|
|
387
|
+
else
|
|
388
|
+
false
|
|
389
|
+
end
|
|
390
|
+
when :Object
|
|
391
|
+
# generic object (usually a Hash), return directly
|
|
392
|
+
value
|
|
393
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
394
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
395
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
396
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
397
|
+
k_type = Regexp.last_match[:k_type]
|
|
398
|
+
v_type = Regexp.last_match[:v_type]
|
|
399
|
+
{}.tap do |hash|
|
|
400
|
+
value.each do |k, v|
|
|
401
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
402
|
+
end
|
|
403
|
+
end
|
|
404
|
+
else # model
|
|
405
|
+
# models (e.g. Pet) or oneOf
|
|
406
|
+
klass = SeatsChart.const_get(type)
|
|
407
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# Returns the string representation of the object
|
|
412
|
+
# @return [String] String presentation of the object
|
|
413
|
+
def to_s
|
|
414
|
+
to_hash.to_s
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
418
|
+
# @return [Hash] Returns the object in the form of hash
|
|
419
|
+
def to_body
|
|
420
|
+
to_hash
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# Returns the object in the form of hash
|
|
424
|
+
# @return [Hash] Returns the object in the form of hash
|
|
425
|
+
def to_hash
|
|
426
|
+
hash = {}
|
|
427
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
428
|
+
value = self.send(attr)
|
|
429
|
+
if value.nil?
|
|
430
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
431
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
hash[param] = _to_hash(value)
|
|
435
|
+
end
|
|
436
|
+
hash
|
|
437
|
+
end
|
|
438
|
+
|
|
439
|
+
# Outputs non-array value in the form of hash
|
|
440
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
441
|
+
# @param [Object] value Any valid value
|
|
442
|
+
# @return [Hash] Returns the value in the form of hash
|
|
443
|
+
def _to_hash(value)
|
|
444
|
+
if value.is_a?(Array)
|
|
445
|
+
value.compact.map { |v| _to_hash(v) }
|
|
446
|
+
elsif value.is_a?(Hash)
|
|
447
|
+
{}.tap do |hash|
|
|
448
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
449
|
+
end
|
|
450
|
+
elsif value.respond_to? :to_hash
|
|
451
|
+
value.to_hash
|
|
452
|
+
else
|
|
453
|
+
value
|
|
454
|
+
end
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
end
|
|
458
|
+
|
|
459
|
+
end
|