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.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +162 -15
  3. data/lib/seatschart/api/audit_api.rb +2 -2
  4. data/lib/seatschart/api/charts_api.rb +799 -66
  5. data/lib/seatschart/api/embed_api.rb +5 -5
  6. data/lib/seatschart/api/embed_origins_api.rb +63 -2
  7. data/lib/seatschart/api/event_log_api.rb +2 -2
  8. data/lib/seatschart/api/events_api.rb +1471 -155
  9. data/lib/seatschart/api/health_api.rb +244 -0
  10. data/lib/seatschart/api/map_designer_api.rb +11 -9
  11. data/lib/seatschart/api/public_api.rb +350 -0
  12. data/lib/seatschart/api/sandboxes_api.rb +672 -0
  13. data/lib/seatschart/api/seasons_api.rb +344 -36
  14. data/lib/seatschart/api/seats_api.rb +10 -10
  15. data/lib/seatschart/api/usage_api.rb +18 -15
  16. data/lib/seatschart/api/webhooks_api.rb +2 -2
  17. data/lib/seatschart/api/workspace_api.rb +306 -20
  18. data/lib/seatschart/models/api_error.rb +4 -4
  19. data/lib/seatschart/models/delete_api_sandboxes_by_sandbox_id200_response.rb +255 -0
  20. data/lib/seatschart/models/get_api_monitoring_requests200_response.rb +62 -4
  21. data/lib/seatschart/models/get_api_monitoring_requests200_response_points_inner.rb +21 -4
  22. data/lib/seatschart/models/get_api_sandboxes200_response.rb +239 -0
  23. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner.rb +431 -0
  24. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_rate_limits.rb +270 -0
  25. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_usage.rb +287 -0
  26. data/lib/seatschart/models/get_api_status200_response.rb +387 -0
  27. data/lib/seatschart/models/get_api_status200_response_components_inner.rb +330 -0
  28. data/lib/seatschart/models/get_api_status200_response_components_inner_days_inner.rb +301 -0
  29. data/lib/seatschart/models/get_api_status200_response_incidents_inner.rb +374 -0
  30. data/lib/seatschart/models/get_api_status200_response_maintenance_inner.rb +350 -0
  31. data/lib/seatschart/models/get_api_status503_response.rb +271 -0
  32. data/lib/seatschart/models/get_api_workspace_buyer_extra_data200_response.rb +241 -0
  33. data/lib/seatschart/models/get_api_workspace_defaults200_response.rb +254 -0
  34. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer.rb +246 -0
  35. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer_built_in.rb +270 -0
  36. data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +34 -5
  37. data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +16 -6
  38. data/lib/seatschart/models/patch_api_seasons_by_season_id_request.rb +15 -5
  39. data/lib/seatschart/models/patch_api_workspace_chart_validation_request_severities.rb +25 -4
  40. data/lib/seatschart/models/patch_api_workspace_defaults_request.rb +224 -0
  41. data/lib/seatschart/models/patch_api_workspace_defaults_request_renderer.rb +249 -0
  42. data/lib/seatschart/models/patch_api_workspace_settings_request.rb +6 -6
  43. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_copy_to_workspace_request.rb +39 -1
  44. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request.rb +1 -0
  45. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish422_response_issues_inner.rb +64 -6
  46. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish_request.rb +1 -1
  47. data/lib/seatschart/models/post_api_embed_tokens_request.rb +18 -15
  48. data/lib/seatschart/models/post_api_embed_tokens_request_safe_mode_options.rb +226 -0
  49. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request.rb +251 -0
  50. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request_events_inner.rb +322 -0
  51. data/lib/seatschart/models/post_api_events_bulk_request_events_inner.rb +42 -1
  52. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request.rb +277 -0
  53. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request_for_sale_inner.rb +319 -0
  54. data/lib/seatschart/models/post_api_events_by_event_id_map_publish_request.rb +215 -0
  55. data/lib/seatschart/models/post_api_events_request.rb +42 -1
  56. data/lib/seatschart/models/{patch_api_events_by_event_id_request_categories_inner.rb → post_api_events_request_categories_inner.rb} +3 -3
  57. data/lib/seatschart/models/post_api_extract_seats200_response.rb +459 -0
  58. data/lib/seatschart/models/post_api_extract_seats200_response_seats_inner.rb +323 -0
  59. data/lib/seatschart/models/post_api_extract_seats200_response_suggested_inner.rb +320 -0
  60. data/lib/seatschart/models/post_api_extract_seats_request.rb +124 -4
  61. data/lib/seatschart/models/post_api_extract_seats_request_examples.rb +105 -0
  62. data/lib/seatschart/models/post_api_extract_seats_request_examples_any_of_inner.rb +293 -0
  63. data/lib/seatschart/models/post_api_extract_seats_request_negatives.rb +105 -0
  64. data/lib/seatschart/models/post_api_extract_seats_request_region.rb +105 -0
  65. data/lib/seatschart/models/post_api_extract_seats_request_region_any_of.rb +363 -0
  66. data/lib/seatschart/models/post_api_sandboxes201_response.rb +245 -0
  67. data/lib/seatschart/models/post_api_sandboxes201_response_admin_key.rb +286 -0
  68. data/lib/seatschart/models/post_api_sandboxes201_response_copied.rb +313 -0
  69. data/lib/seatschart/models/post_api_sandboxes201_response_copied_charts_inner.rb +281 -0
  70. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_inner.rb +281 -0
  71. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_with_own_map_inner.rb +265 -0
  72. data/lib/seatschart/models/post_api_sandboxes201_response_copied_key_conflicts_inner.rb +287 -0
  73. data/lib/seatschart/models/post_api_sandboxes201_response_copied_seasons_inner.rb +312 -0
  74. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production200_response.rb +313 -0
  75. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request.rb +255 -0
  76. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_join200_response.rb +271 -0
  77. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +268 -0
  78. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset_request.rb +225 -0
  79. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response.rb +253 -0
  80. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response_api_key.rb +286 -0
  81. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key_request.rb +252 -0
  82. data/lib/seatschart/models/post_api_sandboxes_request.rb +319 -0
  83. data/lib/seatschart/models/post_api_seasons_request.rb +14 -4
  84. data/lib/seatschart/models/post_api_seats_confirm_request.rb +5 -5
  85. data/lib/seatschart/models/post_api_seats_release_request.rb +5 -5
  86. data/lib/seatschart/models/post_api_seats_reserve_request.rb +5 -5
  87. data/lib/seatschart/models/post_api_workspaces_request.rb +1 -1
  88. data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +1 -0
  89. data/lib/seatschart/models/put_api_workspace_buyer_extra_data_request.rb +260 -0
  90. data/lib/seatschart/models/put_internal_status_notices_request.rb +242 -0
  91. data/lib/seatschart/models/put_internal_status_notices_request_notices_inner.rb +445 -0
  92. data/lib/seatschart/retry.rb +106 -7
  93. data/lib/seatschart/version.rb +1 -1
  94. data/lib/seatschart.rb +53 -2
  95. metadata +55 -4
  96. data/lib/seatschart/api/default_api.rb +0 -763
@@ -0,0 +1,312 @@
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 PostApiSandboxes201ResponseCopiedSeasonsInner
18
+ attr_accessor :source_season_id
19
+
20
+ attr_accessor :season_id
21
+
22
+ attr_accessor :name
23
+
24
+ # The season key, or null when the sandbox already uses `sourceKey` (copied without a key).
25
+ attr_accessor :key
26
+
27
+ attr_accessor :source_key
28
+
29
+ # Member events copied into the season.
30
+ attr_accessor :events
31
+
32
+ # Partial seasons copied with their copied member events.
33
+ attr_accessor :partial_seasons
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'source_season_id' => :'sourceSeasonId',
39
+ :'season_id' => :'seasonId',
40
+ :'name' => :'name',
41
+ :'key' => :'key',
42
+ :'source_key' => :'sourceKey',
43
+ :'events' => :'events',
44
+ :'partial_seasons' => :'partialSeasons'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'source_season_id' => :'String',
57
+ :'season_id' => :'String',
58
+ :'name' => :'String',
59
+ :'key' => :'String',
60
+ :'source_key' => :'String',
61
+ :'events' => :'Integer',
62
+ :'partial_seasons' => :'Integer'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ :'key',
70
+ :'source_key',
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiSandboxes201ResponseCopiedSeasonsInner` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!self.class.attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiSandboxes201ResponseCopiedSeasonsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'source_season_id')
90
+ self.source_season_id = attributes[:'source_season_id']
91
+ else
92
+ self.source_season_id = nil
93
+ end
94
+
95
+ if attributes.key?(:'season_id')
96
+ self.season_id = attributes[:'season_id']
97
+ else
98
+ self.season_id = nil
99
+ end
100
+
101
+ if attributes.key?(:'name')
102
+ self.name = attributes[:'name']
103
+ else
104
+ self.name = nil
105
+ end
106
+
107
+ if attributes.key?(:'key')
108
+ self.key = attributes[:'key']
109
+ else
110
+ self.key = nil
111
+ end
112
+
113
+ if attributes.key?(:'source_key')
114
+ self.source_key = attributes[:'source_key']
115
+ else
116
+ self.source_key = nil
117
+ end
118
+
119
+ if attributes.key?(:'events')
120
+ self.events = attributes[:'events']
121
+ else
122
+ self.events = nil
123
+ end
124
+
125
+ if attributes.key?(:'partial_seasons')
126
+ self.partial_seasons = attributes[:'partial_seasons']
127
+ else
128
+ self.partial_seasons = nil
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ if @source_season_id.nil?
138
+ invalid_properties.push('invalid value for "source_season_id", source_season_id cannot be nil.')
139
+ end
140
+
141
+ if @season_id.nil?
142
+ invalid_properties.push('invalid value for "season_id", season_id cannot be nil.')
143
+ end
144
+
145
+ if @name.nil?
146
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
147
+ end
148
+
149
+ if @events.nil?
150
+ invalid_properties.push('invalid value for "events", events cannot be nil.')
151
+ end
152
+
153
+ if @partial_seasons.nil?
154
+ invalid_properties.push('invalid value for "partial_seasons", partial_seasons cannot be nil.')
155
+ end
156
+
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ warn '[DEPRECATED] the `valid?` method is obsolete'
164
+ return false if @source_season_id.nil?
165
+ return false if @season_id.nil?
166
+ return false if @name.nil?
167
+ return false if @events.nil?
168
+ return false if @partial_seasons.nil?
169
+ true
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ source_season_id == o.source_season_id &&
178
+ season_id == o.season_id &&
179
+ name == o.name &&
180
+ key == o.key &&
181
+ source_key == o.source_key &&
182
+ events == o.events &&
183
+ partial_seasons == o.partial_seasons
184
+ end
185
+
186
+ # @see the `==` method
187
+ # @param [Object] Object to be compared
188
+ def eql?(o)
189
+ self == o
190
+ end
191
+
192
+ # Calculates hash code according to all attributes.
193
+ # @return [Integer] Hash code
194
+ def hash
195
+ [source_season_id, season_id, name, key, source_key, events, partial_seasons].hash
196
+ end
197
+
198
+ # Builds the object from hash
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @return [Object] Returns the model itself
201
+ def self.build_from_hash(attributes)
202
+ return nil unless attributes.is_a?(Hash)
203
+ attributes = attributes.transform_keys(&:to_sym)
204
+ transformed_hash = {}
205
+ openapi_types.each_pair do |key, type|
206
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = nil
208
+ elsif type =~ /\AArray<(.*)>/i
209
+ # check to ensure the input is an array given that the attribute
210
+ # is documented as an array but the input is not
211
+ if attributes[attribute_map[key]].is_a?(Array)
212
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
213
+ end
214
+ elsif !attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
216
+ end
217
+ end
218
+ new(transformed_hash)
219
+ end
220
+
221
+ # Deserializes the data based on type
222
+ # @param string type Data type
223
+ # @param string value Value to be deserialized
224
+ # @return [Object] Deserialized data
225
+ def self._deserialize(type, value)
226
+ case type.to_sym
227
+ when :Time
228
+ Time.parse(value)
229
+ when :Date
230
+ Date.parse(value)
231
+ when :String
232
+ value.to_s
233
+ when :Integer
234
+ value.to_i
235
+ when :Float
236
+ value.to_f
237
+ when :Boolean
238
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
239
+ true
240
+ else
241
+ false
242
+ end
243
+ when :Object
244
+ # generic object (usually a Hash), return directly
245
+ value
246
+ when /\AArray<(?<inner_type>.+)>\z/
247
+ inner_type = Regexp.last_match[:inner_type]
248
+ value.map { |v| _deserialize(inner_type, v) }
249
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
250
+ k_type = Regexp.last_match[:k_type]
251
+ v_type = Regexp.last_match[:v_type]
252
+ {}.tap do |hash|
253
+ value.each do |k, v|
254
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
255
+ end
256
+ end
257
+ else # model
258
+ # models (e.g. Pet) or oneOf
259
+ klass = SeatsChart.const_get(type)
260
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
261
+ end
262
+ end
263
+
264
+ # Returns the string representation of the object
265
+ # @return [String] String presentation of the object
266
+ def to_s
267
+ to_hash.to_s
268
+ end
269
+
270
+ # to_body is an alias to to_hash (backward compatibility)
271
+ # @return [Hash] Returns the object in the form of hash
272
+ def to_body
273
+ to_hash
274
+ end
275
+
276
+ # Returns the object in the form of hash
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_hash
279
+ hash = {}
280
+ self.class.attribute_map.each_pair do |attr, param|
281
+ value = self.send(attr)
282
+ if value.nil?
283
+ is_nullable = self.class.openapi_nullable.include?(attr)
284
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
285
+ end
286
+
287
+ hash[param] = _to_hash(value)
288
+ end
289
+ hash
290
+ end
291
+
292
+ # Outputs non-array value in the form of hash
293
+ # For object, use to_hash. Otherwise, just return the value
294
+ # @param [Object] value Any valid value
295
+ # @return [Hash] Returns the value in the form of hash
296
+ def _to_hash(value)
297
+ if value.is_a?(Array)
298
+ value.compact.map { |v| _to_hash(v) }
299
+ elsif value.is_a?(Hash)
300
+ {}.tap do |hash|
301
+ value.each { |k, v| hash[k] = _to_hash(v) }
302
+ end
303
+ elsif value.respond_to? :to_hash
304
+ value.to_hash
305
+ else
306
+ value
307
+ end
308
+ end
309
+
310
+ end
311
+
312
+ end
@@ -0,0 +1,313 @@
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 PostApiSandboxesBySandboxIdActionsCopyFromProduction200Response
18
+ attr_accessor :charts
19
+
20
+ attr_accessor :events
21
+
22
+ attr_accessor :key_conflicts
23
+
24
+ attr_accessor :truncated_events
25
+
26
+ # Events with their own map (no chart) copied with their event layout: only when every chart is copied (no `chartIds`) with `includeEvents`.
27
+ attr_accessor :events_with_own_map
28
+
29
+ # Seasons (with partial seasons) whose member events were copied (`includeEvents`), with fresh ids and remapped members.
30
+ attr_accessor :seasons
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'charts' => :'charts',
36
+ :'events' => :'events',
37
+ :'key_conflicts' => :'keyConflicts',
38
+ :'truncated_events' => :'truncatedEvents',
39
+ :'events_with_own_map' => :'eventsWithOwnMap',
40
+ :'seasons' => :'seasons'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'charts' => :'Array<PostApiSandboxes201ResponseCopiedChartsInner>',
53
+ :'events' => :'Array<PostApiSandboxes201ResponseCopiedEventsInner>',
54
+ :'key_conflicts' => :'Array<PostApiSandboxes201ResponseCopiedKeyConflictsInner>',
55
+ :'truncated_events' => :'Integer',
56
+ :'events_with_own_map' => :'Array<PostApiSandboxes201ResponseCopiedEventsWithOwnMapInner>',
57
+ :'seasons' => :'Array<PostApiSandboxes201ResponseCopiedSeasonsInner>'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiSandboxesBySandboxIdActionsCopyFromProduction200Response` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!self.class.attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiSandboxesBySandboxIdActionsCopyFromProduction200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'charts')
83
+ if (value = attributes[:'charts']).is_a?(Array)
84
+ self.charts = value
85
+ end
86
+ else
87
+ self.charts = nil
88
+ end
89
+
90
+ if attributes.key?(:'events')
91
+ if (value = attributes[:'events']).is_a?(Array)
92
+ self.events = value
93
+ end
94
+ else
95
+ self.events = nil
96
+ end
97
+
98
+ if attributes.key?(:'key_conflicts')
99
+ if (value = attributes[:'key_conflicts']).is_a?(Array)
100
+ self.key_conflicts = value
101
+ end
102
+ else
103
+ self.key_conflicts = nil
104
+ end
105
+
106
+ if attributes.key?(:'truncated_events')
107
+ self.truncated_events = attributes[:'truncated_events']
108
+ else
109
+ self.truncated_events = nil
110
+ end
111
+
112
+ if attributes.key?(:'events_with_own_map')
113
+ if (value = attributes[:'events_with_own_map']).is_a?(Array)
114
+ self.events_with_own_map = value
115
+ end
116
+ else
117
+ self.events_with_own_map = nil
118
+ end
119
+
120
+ if attributes.key?(:'seasons')
121
+ if (value = attributes[:'seasons']).is_a?(Array)
122
+ self.seasons = value
123
+ end
124
+ else
125
+ self.seasons = nil
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ if @charts.nil?
135
+ invalid_properties.push('invalid value for "charts", charts cannot be nil.')
136
+ end
137
+
138
+ if @events.nil?
139
+ invalid_properties.push('invalid value for "events", events cannot be nil.')
140
+ end
141
+
142
+ if @key_conflicts.nil?
143
+ invalid_properties.push('invalid value for "key_conflicts", key_conflicts cannot be nil.')
144
+ end
145
+
146
+ if @truncated_events.nil?
147
+ invalid_properties.push('invalid value for "truncated_events", truncated_events cannot be nil.')
148
+ end
149
+
150
+ if @events_with_own_map.nil?
151
+ invalid_properties.push('invalid value for "events_with_own_map", events_with_own_map cannot be nil.')
152
+ end
153
+
154
+ if @seasons.nil?
155
+ invalid_properties.push('invalid value for "seasons", seasons cannot be nil.')
156
+ end
157
+
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ warn '[DEPRECATED] the `valid?` method is obsolete'
165
+ return false if @charts.nil?
166
+ return false if @events.nil?
167
+ return false if @key_conflicts.nil?
168
+ return false if @truncated_events.nil?
169
+ return false if @events_with_own_map.nil?
170
+ return false if @seasons.nil?
171
+ true
172
+ end
173
+
174
+ # Checks equality by comparing each attribute.
175
+ # @param [Object] Object to be compared
176
+ def ==(o)
177
+ return true if self.equal?(o)
178
+ self.class == o.class &&
179
+ charts == o.charts &&
180
+ events == o.events &&
181
+ key_conflicts == o.key_conflicts &&
182
+ truncated_events == o.truncated_events &&
183
+ events_with_own_map == o.events_with_own_map &&
184
+ seasons == o.seasons
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [charts, events, key_conflicts, truncated_events, events_with_own_map, seasons].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ attributes = attributes.transform_keys(&:to_sym)
205
+ transformed_hash = {}
206
+ openapi_types.each_pair do |key, type|
207
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
208
+ transformed_hash["#{key}"] = nil
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[attribute_map[key]].is_a?(Array)
213
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
214
+ end
215
+ elsif !attributes[attribute_map[key]].nil?
216
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
217
+ end
218
+ end
219
+ new(transformed_hash)
220
+ end
221
+
222
+ # Deserializes the data based on type
223
+ # @param string type Data type
224
+ # @param string value Value to be deserialized
225
+ # @return [Object] Deserialized data
226
+ def self._deserialize(type, value)
227
+ case type.to_sym
228
+ when :Time
229
+ Time.parse(value)
230
+ when :Date
231
+ Date.parse(value)
232
+ when :String
233
+ value.to_s
234
+ when :Integer
235
+ value.to_i
236
+ when :Float
237
+ value.to_f
238
+ when :Boolean
239
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
240
+ true
241
+ else
242
+ false
243
+ end
244
+ when :Object
245
+ # generic object (usually a Hash), return directly
246
+ value
247
+ when /\AArray<(?<inner_type>.+)>\z/
248
+ inner_type = Regexp.last_match[:inner_type]
249
+ value.map { |v| _deserialize(inner_type, v) }
250
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
251
+ k_type = Regexp.last_match[:k_type]
252
+ v_type = Regexp.last_match[:v_type]
253
+ {}.tap do |hash|
254
+ value.each do |k, v|
255
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
256
+ end
257
+ end
258
+ else # model
259
+ # models (e.g. Pet) or oneOf
260
+ klass = SeatsChart.const_get(type)
261
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
262
+ end
263
+ end
264
+
265
+ # Returns the string representation of the object
266
+ # @return [String] String presentation of the object
267
+ def to_s
268
+ to_hash.to_s
269
+ end
270
+
271
+ # to_body is an alias to to_hash (backward compatibility)
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_body
274
+ to_hash
275
+ end
276
+
277
+ # Returns the object in the form of hash
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_hash
280
+ hash = {}
281
+ self.class.attribute_map.each_pair do |attr, param|
282
+ value = self.send(attr)
283
+ if value.nil?
284
+ is_nullable = self.class.openapi_nullable.include?(attr)
285
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
286
+ end
287
+
288
+ hash[param] = _to_hash(value)
289
+ end
290
+ hash
291
+ end
292
+
293
+ # Outputs non-array value in the form of hash
294
+ # For object, use to_hash. Otherwise, just return the value
295
+ # @param [Object] value Any valid value
296
+ # @return [Hash] Returns the value in the form of hash
297
+ def _to_hash(value)
298
+ if value.is_a?(Array)
299
+ value.compact.map { |v| _to_hash(v) }
300
+ elsif value.is_a?(Hash)
301
+ {}.tap do |hash|
302
+ value.each { |k, v| hash[k] = _to_hash(v) }
303
+ end
304
+ elsif value.respond_to? :to_hash
305
+ value.to_hash
306
+ else
307
+ value
308
+ end
309
+ end
310
+
311
+ end
312
+
313
+ end