seatschart 0.1.1 → 0.2.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -3
  3. data/lib/seatschart/api/charts_api.rb +9 -9
  4. data/lib/seatschart/api/embed_api.rb +13 -2
  5. data/lib/seatschart/api/event_log_api.rb +2 -2
  6. data/lib/seatschart/api/events_api.rb +186 -20
  7. data/lib/seatschart/api/listings_api.rb +884 -0
  8. data/lib/seatschart/api/object_status_api.rb +2 -2
  9. data/lib/seatschart/api/seasons_api.rb +113 -8
  10. data/lib/seatschart/api/seats_api.rb +3 -22
  11. data/lib/seatschart/api/usage_api.rb +4 -4
  12. data/lib/seatschart/api/webhooks_api.rb +2 -2
  13. data/lib/seatschart/api/workspace_api.rb +4 -4
  14. data/lib/seatschart/models/api_error.rb +307 -0
  15. data/lib/seatschart/models/api_error_params_value.rb +105 -0
  16. data/lib/seatschart/models/get_api_monitoring_requests200_response.rb +17 -1
  17. data/lib/seatschart/models/get_api_monitoring_requests200_response_concurrency.rb +318 -0
  18. data/lib/seatschart/models/get_api_monitoring_requests200_response_concurrency_api_keys_inner.rb +297 -0
  19. data/lib/seatschart/models/get_api_monitoring_requests200_response_points_inner.rb +21 -4
  20. data/lib/seatschart/models/get_api_workspace_settings200_response_effective.rb +20 -4
  21. data/lib/seatschart/models/get_api_workspace_settings200_response_overrides.rb +13 -4
  22. data/lib/seatschart/models/get_api_workspace_settings200_response_sources.rb +32 -4
  23. data/lib/seatschart/models/patch_api_events_by_event_id_listings_by_listing_id_request.rb +379 -0
  24. data/lib/seatschart/models/patch_api_listing_types_by_key_request.rb +376 -0
  25. data/lib/seatschart/models/patch_api_seasons_by_season_id_partial_seasons_by_partial_season_id_request.rb +268 -0
  26. data/lib/seatschart/models/patch_api_seasons_by_season_id_request.rb +27 -1
  27. data/lib/seatschart/models/patch_api_webhooks_by_id_request.rb +1 -1
  28. data/lib/seatschart/models/patch_api_workspace_settings_request.rb +12 -1
  29. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request_seats_inner_accessibility.rb +6 -6
  30. data/lib/seatschart/models/post_api_events_actions_change_object_status_request_status_changes_inner.rb +0 -11
  31. data/lib/seatschart/models/post_api_events_by_event_id_actions_change_object_status_request.rb +13 -26
  32. data/lib/seatschart/models/post_api_events_by_event_id_actions_change_object_status_request_listing.rb +392 -0
  33. data/lib/seatschart/models/post_api_events_by_event_id_actions_mark_everything_as_not_for_sale_request.rb +215 -0
  34. data/lib/seatschart/models/post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request.rb +243 -0
  35. data/lib/seatschart/models/post_api_events_by_event_id_listings_request.rb +435 -0
  36. data/lib/seatschart/models/post_api_events_by_event_id_listings_request_objects_inner.rb +104 -0
  37. data/lib/seatschart/models/post_api_events_by_event_id_listings_request_objects_inner_any_of.rb +325 -0
  38. data/lib/seatschart/models/post_api_ga_confirm_request.rb +0 -44
  39. data/lib/seatschart/models/post_api_ga_release_request.rb +0 -11
  40. data/lib/seatschart/models/post_api_ga_reserve_request.rb +0 -33
  41. data/lib/seatschart/models/post_api_hold_tokens_request.rb +0 -22
  42. data/lib/seatschart/models/post_api_listing_types_request.rb +439 -0
  43. data/lib/seatschart/models/post_api_quotes_request.rb +0 -22
  44. data/lib/seatschart/models/post_api_seasons_by_season_id_partial_seasons_request.rb +27 -1
  45. data/lib/seatschart/models/post_api_seasons_request.rb +27 -1
  46. data/lib/seatschart/models/post_api_seats_best_available_request.rb +0 -11
  47. data/lib/seatschart/models/post_api_seats_confirm_request.rb +0 -44
  48. data/lib/seatschart/models/post_api_seats_release_request.rb +0 -11
  49. data/lib/seatschart/models/post_api_seats_reserve_request.rb +0 -22
  50. data/lib/seatschart/models/post_api_viewer_tokens_request.rb +0 -11
  51. data/lib/seatschart/models/post_api_webhooks_request.rb +1 -1
  52. data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +348 -0
  53. data/lib/seatschart/version.rb +1 -1
  54. data/lib/seatschart.rb +16 -0
  55. metadata +17 -1
@@ -0,0 +1,307 @@
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
+ # Every error response. Match on `error` (stable catalog code, see docs ERROR_CODES.md); `code` is an optional detail code for localized messages; `message` is English text for logs. Kinds: validation (400/413/422), auth (401/403), not_found (404), conflict (409/410/412), payment (402), rate_limit (429), server (500/502/503). Deprecated aliases (no longer returned; normalize old comparisons): `validation` → `validation_error`. The `x-request-id` response header identifies the request for support.
18
+ class ApiError
19
+ # Stable machine-readable code (catalog).
20
+ attr_accessor :error
21
+
22
+ # Human-readable English message; never match on it.
23
+ attr_accessor :message
24
+
25
+ # Optional detail code (UPPER_SNAKE).
26
+ attr_accessor :code
27
+
28
+ attr_accessor :params
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'error' => :'error',
56
+ :'message' => :'message',
57
+ :'code' => :'code',
58
+ :'params' => :'params'
59
+ }
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'error' => :'String',
71
+ :'message' => :'String',
72
+ :'code' => :'String',
73
+ :'params' => :'Hash<String, ApiErrorParamsValue>'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::ApiError` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::ApiError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'error')
99
+ self.error = attributes[:'error']
100
+ else
101
+ self.error = nil
102
+ end
103
+
104
+ if attributes.key?(:'message')
105
+ self.message = attributes[:'message']
106
+ else
107
+ self.message = nil
108
+ end
109
+
110
+ if attributes.key?(:'code')
111
+ self.code = attributes[:'code']
112
+ end
113
+
114
+ if attributes.key?(:'params')
115
+ if (value = attributes[:'params']).is_a?(Hash)
116
+ self.params = value
117
+ end
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ if @error.nil?
127
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
128
+ end
129
+
130
+ if @message.nil?
131
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @error.nil?
142
+ error_validator = EnumAttributeValidator.new('String', ["ambiguous_label", "ambiguous_season_key", "bad_request", "booking_limit_exceeded", "buyer_limit_exceeded", "category_exists", "category_in_use", "channel_forbidden", "chart_archived", "chart_invalid", "chart_key_taken", "chart_not_published", "chart_switch_conflict", "checkout_failed", "checkout_not_complete", "confirm_failed", "conflict", "currency_mismatch", "draft_conflict", "draft_not_found", "empty_chart", "event_key_taken", "event_not_found", "event_sale", "extraction_failed", "forbidden", "ga_places_to_channels_disabled", "ga_table_whole", "geometry_not_published", "hold_token_conflict", "idempotency_conflict", "idempotency_key_required", "illegal_previous_status", "insufficient_free_places", "insufficient_inventory", "insufficient_scope", "internal_error", "invalid_body", "invalid_code", "invalid_order_id", "invalid_parameters", "invalid_signature", "inventory_conflict", "last_active_workspace", "limit_exceeded", "listing_closed", "listing_has_holds", "listing_incomplete", "listing_key_taken", "listing_object_conflict", "listing_type_exists", "listing_type_in_use", "lot_sold_out", "no_customer", "no_subscription", "not_found", "not_published", "not_season_member", "objects_not_found", "own_workspace", "partial_season_key_taken", "payload_too_large", "pending_sign_in_expired", "plan_limit_exceeded", "portal_failed", "price_mismatch", "price_table_missing", "quantity_required", "quota_exceeded", "quote_conflict", "quote_mismatch", "quote_required", "rate_limit_exceeded", "redis_unavailable", "scan_route_retired", "season_booked", "season_chart_mismatch", "season_has_no_chart", "season_key_taken", "season_source_event", "season_source_required", "season_status_conflict", "season_status_overridden", "service_draining", "service_unavailable", "setup_expired", "stripe_not_configured", "structural_mismatch", "test_workspace_not_billable", "ticket_buyer_id_required", "ticket_buyer_mismatch", "ticket_buyer_not_registered", "ticket_buyer_required", "ticket_type_required", "too_many_attempts", "too_many_events", "two_factor_already_enabled", "two_factor_enrollment_required", "two_factor_not_enabled", "two_factor_required_by_workspace", "unauthorized", "validation_error", "validation_failed", "webhook_handler_failed", "workspace_deactivated"])
143
+ return false unless error_validator.valid?(@error)
144
+ return false if @message.nil?
145
+ code_validator = EnumAttributeValidator.new('String', ["ERR_BAD_REQUEST", "ERR_NOT_FOUND", "ERR_UNAUTHORIZED", "ERR_FORBIDDEN", "ERR_CONFLICT", "ERR_VALIDATION", "ERR_SERVICE_UNAVAILABLE", "ERR_INTERNAL", "ERR_RATE_LIMIT", "ERR_PLAN_LIMIT", "ERR_IDEMPOTENCY_CONFLICT", "ERR_SEAT_LOCKED", "ERR_SEAT_UNAVAILABLE", "ERR_SEAT_SOLD", "ERR_SEAT_HOLD_REQUIRED", "SEAT_NOT_FOR_SALE", "SEAT_CHANNEL_FORBIDDEN", "BA_NO_HOLDABLE_WINDOW", "ERR_SEATS_NOT_FOUND", "ERR_EVENT_NOT_FOUND", "ERR_CHART_NOT_FOUND", "ERR_CHART_NOT_ARCHIVED", "ERR_CHART_HAS_EVENTS", "ERR_AUTO_PUBLISH_CHART_HAS_EVENTS", "ERR_CHART_TAG_INVALID", "ERR_CHART_TAG_LIMIT", "ERR_CHART_VERSION_NOT_FOUND", "ERR_MAP_VERSION_NOT_FOUND", "ERR_MAP_NEVER_PUBLISHED", "ERR_DRAFT_NOTHING_TO_DISCARD", "ERR_THUMBNAIL_EXISTS", "ERR_THUMBNAIL_INVALID", "ERR_NAME_EMPTY", "ERR_GA_HOLD_INVALID", "ERR_GA_HOLD_MISSING", "ERR_GA_CAPACITY", "ERR_GA_AREA_NOT_FOUND", "GA_NOT_FOR_SALE", "GA_CHANNEL_FORBIDDEN", "ERR_HOLD_SERVICE_UNAVAILABLE", "ERR_PUBSUB_FAILED", "ERR_CHANNEL_LIMIT", "SEASON_SOURCE_REQUIRED", "SEASON_CHART_MISMATCH", "SEASON_EVENT_ALREADY_MEMBER", "SEASON_MEMBER_CAP", "ERR_SEASON_NOT_FOUND", "ERR_PARTNER_SCOPE", "ERR_FORBIDDEN_ROLE"])
146
+ return false unless code_validator.valid?(@code)
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method checking allowed values (enum).
151
+ # @param [Object] error Object to be assigned
152
+ def error=(error)
153
+ validator = EnumAttributeValidator.new('String', ["ambiguous_label", "ambiguous_season_key", "bad_request", "booking_limit_exceeded", "buyer_limit_exceeded", "category_exists", "category_in_use", "channel_forbidden", "chart_archived", "chart_invalid", "chart_key_taken", "chart_not_published", "chart_switch_conflict", "checkout_failed", "checkout_not_complete", "confirm_failed", "conflict", "currency_mismatch", "draft_conflict", "draft_not_found", "empty_chart", "event_key_taken", "event_not_found", "event_sale", "extraction_failed", "forbidden", "ga_places_to_channels_disabled", "ga_table_whole", "geometry_not_published", "hold_token_conflict", "idempotency_conflict", "idempotency_key_required", "illegal_previous_status", "insufficient_free_places", "insufficient_inventory", "insufficient_scope", "internal_error", "invalid_body", "invalid_code", "invalid_order_id", "invalid_parameters", "invalid_signature", "inventory_conflict", "last_active_workspace", "limit_exceeded", "listing_closed", "listing_has_holds", "listing_incomplete", "listing_key_taken", "listing_object_conflict", "listing_type_exists", "listing_type_in_use", "lot_sold_out", "no_customer", "no_subscription", "not_found", "not_published", "not_season_member", "objects_not_found", "own_workspace", "partial_season_key_taken", "payload_too_large", "pending_sign_in_expired", "plan_limit_exceeded", "portal_failed", "price_mismatch", "price_table_missing", "quantity_required", "quota_exceeded", "quote_conflict", "quote_mismatch", "quote_required", "rate_limit_exceeded", "redis_unavailable", "scan_route_retired", "season_booked", "season_chart_mismatch", "season_has_no_chart", "season_key_taken", "season_source_event", "season_source_required", "season_status_conflict", "season_status_overridden", "service_draining", "service_unavailable", "setup_expired", "stripe_not_configured", "structural_mismatch", "test_workspace_not_billable", "ticket_buyer_id_required", "ticket_buyer_mismatch", "ticket_buyer_not_registered", "ticket_buyer_required", "ticket_type_required", "too_many_attempts", "too_many_events", "two_factor_already_enabled", "two_factor_enrollment_required", "two_factor_not_enabled", "two_factor_required_by_workspace", "unauthorized", "validation_error", "validation_failed", "webhook_handler_failed", "workspace_deactivated"])
154
+ unless validator.valid?(error)
155
+ fail ArgumentError, "invalid value for \"error\", must be one of #{validator.allowable_values}."
156
+ end
157
+ @error = error
158
+ end
159
+
160
+ # Custom attribute writer method checking allowed values (enum).
161
+ # @param [Object] code Object to be assigned
162
+ def code=(code)
163
+ validator = EnumAttributeValidator.new('String', ["ERR_BAD_REQUEST", "ERR_NOT_FOUND", "ERR_UNAUTHORIZED", "ERR_FORBIDDEN", "ERR_CONFLICT", "ERR_VALIDATION", "ERR_SERVICE_UNAVAILABLE", "ERR_INTERNAL", "ERR_RATE_LIMIT", "ERR_PLAN_LIMIT", "ERR_IDEMPOTENCY_CONFLICT", "ERR_SEAT_LOCKED", "ERR_SEAT_UNAVAILABLE", "ERR_SEAT_SOLD", "ERR_SEAT_HOLD_REQUIRED", "SEAT_NOT_FOR_SALE", "SEAT_CHANNEL_FORBIDDEN", "BA_NO_HOLDABLE_WINDOW", "ERR_SEATS_NOT_FOUND", "ERR_EVENT_NOT_FOUND", "ERR_CHART_NOT_FOUND", "ERR_CHART_NOT_ARCHIVED", "ERR_CHART_HAS_EVENTS", "ERR_AUTO_PUBLISH_CHART_HAS_EVENTS", "ERR_CHART_TAG_INVALID", "ERR_CHART_TAG_LIMIT", "ERR_CHART_VERSION_NOT_FOUND", "ERR_MAP_VERSION_NOT_FOUND", "ERR_MAP_NEVER_PUBLISHED", "ERR_DRAFT_NOTHING_TO_DISCARD", "ERR_THUMBNAIL_EXISTS", "ERR_THUMBNAIL_INVALID", "ERR_NAME_EMPTY", "ERR_GA_HOLD_INVALID", "ERR_GA_HOLD_MISSING", "ERR_GA_CAPACITY", "ERR_GA_AREA_NOT_FOUND", "GA_NOT_FOR_SALE", "GA_CHANNEL_FORBIDDEN", "ERR_HOLD_SERVICE_UNAVAILABLE", "ERR_PUBSUB_FAILED", "ERR_CHANNEL_LIMIT", "SEASON_SOURCE_REQUIRED", "SEASON_CHART_MISMATCH", "SEASON_EVENT_ALREADY_MEMBER", "SEASON_MEMBER_CAP", "ERR_SEASON_NOT_FOUND", "ERR_PARTNER_SCOPE", "ERR_FORBIDDEN_ROLE"])
164
+ unless validator.valid?(code)
165
+ fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
166
+ end
167
+ @code = code
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ error == o.error &&
176
+ message == o.message &&
177
+ code == o.code &&
178
+ params == o.params
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [error, message, code, params].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ attributes = attributes.transform_keys(&:to_sym)
199
+ transformed_hash = {}
200
+ openapi_types.each_pair do |key, type|
201
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = nil
203
+ elsif type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[attribute_map[key]].is_a?(Array)
207
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
+ end
209
+ elsif !attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
211
+ end
212
+ end
213
+ new(transformed_hash)
214
+ end
215
+
216
+ # Deserializes the data based on type
217
+ # @param string type Data type
218
+ # @param string value Value to be deserialized
219
+ # @return [Object] Deserialized data
220
+ def self._deserialize(type, value)
221
+ case type.to_sym
222
+ when :Time
223
+ Time.parse(value)
224
+ when :Date
225
+ Date.parse(value)
226
+ when :String
227
+ value.to_s
228
+ when :Integer
229
+ value.to_i
230
+ when :Float
231
+ value.to_f
232
+ when :Boolean
233
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
234
+ true
235
+ else
236
+ false
237
+ end
238
+ when :Object
239
+ # generic object (usually a Hash), return directly
240
+ value
241
+ when /\AArray<(?<inner_type>.+)>\z/
242
+ inner_type = Regexp.last_match[:inner_type]
243
+ value.map { |v| _deserialize(inner_type, v) }
244
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
245
+ k_type = Regexp.last_match[:k_type]
246
+ v_type = Regexp.last_match[:v_type]
247
+ {}.tap do |hash|
248
+ value.each do |k, v|
249
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
250
+ end
251
+ end
252
+ else # model
253
+ # models (e.g. Pet) or oneOf
254
+ klass = SeatsChart.const_get(type)
255
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
256
+ end
257
+ end
258
+
259
+ # Returns the string representation of the object
260
+ # @return [String] String presentation of the object
261
+ def to_s
262
+ to_hash.to_s
263
+ end
264
+
265
+ # to_body is an alias to to_hash (backward compatibility)
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_body
268
+ to_hash
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {}
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ if value.nil?
278
+ is_nullable = self.class.openapi_nullable.include?(attr)
279
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
280
+ end
281
+
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ # Outputs non-array value in the form of hash
288
+ # For object, use to_hash. Otherwise, just return the value
289
+ # @param [Object] value Any valid value
290
+ # @return [Hash] Returns the value in the form of hash
291
+ def _to_hash(value)
292
+ if value.is_a?(Array)
293
+ value.compact.map { |v| _to_hash(v) }
294
+ elsif value.is_a?(Hash)
295
+ {}.tap do |hash|
296
+ value.each { |k, v| hash[k] = _to_hash(v) }
297
+ end
298
+ elsif value.respond_to? :to_hash
299
+ value.to_hash
300
+ else
301
+ value
302
+ end
303
+ end
304
+
305
+ end
306
+
307
+ end
@@ -0,0 +1,105 @@
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
+ module ApiErrorParamsValue
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'Float',
23
+ :'String'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ typed_data = find_and_cast_into_type(klass, data)
42
+ return typed_data if typed_data
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_one_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.parse(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = SeatsChart.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+
105
+ end
@@ -34,6 +34,8 @@ module SeatsChart
34
34
 
35
35
  attr_accessor :lanes
36
36
 
37
+ attr_accessor :concurrency
38
+
37
39
  attr_accessor :points
38
40
 
39
41
  class EnumAttributeValidator
@@ -69,6 +71,7 @@ module SeatsChart
69
71
  :'is_test' => :'isTest',
70
72
  :'window_seconds' => :'windowSeconds',
71
73
  :'lanes' => :'lanes',
74
+ :'concurrency' => :'concurrency',
72
75
  :'points' => :'points'
73
76
  }
74
77
  end
@@ -89,6 +92,7 @@ module SeatsChart
89
92
  :'is_test' => :'Boolean',
90
93
  :'window_seconds' => :'Integer',
91
94
  :'lanes' => :'GetApiMonitoringRequests200ResponseLanes',
95
+ :'concurrency' => :'GetApiMonitoringRequests200ResponseConcurrency',
92
96
  :'points' => :'Array<GetApiMonitoringRequests200ResponsePointsInner>'
93
97
  }
94
98
  end
@@ -162,6 +166,12 @@ module SeatsChart
162
166
  self.lanes = nil
163
167
  end
164
168
 
169
+ if attributes.key?(:'concurrency')
170
+ self.concurrency = attributes[:'concurrency']
171
+ else
172
+ self.concurrency = nil
173
+ end
174
+
165
175
  if attributes.key?(:'points')
166
176
  if (value = attributes[:'points']).is_a?(Array)
167
177
  self.points = value
@@ -208,6 +218,10 @@ module SeatsChart
208
218
  invalid_properties.push('invalid value for "lanes", lanes cannot be nil.')
209
219
  end
210
220
 
221
+ if @concurrency.nil?
222
+ invalid_properties.push('invalid value for "concurrency", concurrency cannot be nil.')
223
+ end
224
+
211
225
  if @points.nil?
212
226
  invalid_properties.push('invalid value for "points", points cannot be nil.')
213
227
  end
@@ -229,6 +243,7 @@ module SeatsChart
229
243
  return false if @is_test.nil?
230
244
  return false if @window_seconds.nil?
231
245
  return false if @lanes.nil?
246
+ return false if @concurrency.nil?
232
247
  return false if @points.nil?
233
248
  true
234
249
  end
@@ -256,6 +271,7 @@ module SeatsChart
256
271
  is_test == o.is_test &&
257
272
  window_seconds == o.window_seconds &&
258
273
  lanes == o.lanes &&
274
+ concurrency == o.concurrency &&
259
275
  points == o.points
260
276
  end
261
277
 
@@ -268,7 +284,7 @@ module SeatsChart
268
284
  # Calculates hash code according to all attributes.
269
285
  # @return [Integer] Hash code
270
286
  def hash
271
- [range, bucket_seconds, from, to, plan, is_test, window_seconds, lanes, points].hash
287
+ [range, bucket_seconds, from, to, plan, is_test, window_seconds, lanes, concurrency, points].hash
272
288
  end
273
289
 
274
290
  # Builds the object from hash