seatschart 0.1.1 → 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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +191 -16
  3. data/lib/seatschart/api/audit_api.rb +2 -2
  4. data/lib/seatschart/api/charts_api.rb +808 -75
  5. data/lib/seatschart/api/embed_api.rb +18 -7
  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 +1594 -112
  9. data/lib/seatschart/api/health_api.rb +244 -0
  10. data/lib/seatschart/api/listings_api.rb +884 -0
  11. data/lib/seatschart/api/map_designer_api.rb +11 -9
  12. data/lib/seatschart/api/object_status_api.rb +2 -2
  13. data/lib/seatschart/api/public_api.rb +350 -0
  14. data/lib/seatschart/api/sandboxes_api.rb +672 -0
  15. data/lib/seatschart/api/seasons_api.rb +455 -42
  16. data/lib/seatschart/api/seats_api.rb +13 -32
  17. data/lib/seatschart/api/usage_api.rb +20 -17
  18. data/lib/seatschart/api/webhooks_api.rb +2 -2
  19. data/lib/seatschart/api/workspace_api.rb +306 -20
  20. data/lib/seatschart/models/api_error.rb +307 -0
  21. data/lib/seatschart/models/api_error_params_value.rb +105 -0
  22. data/lib/seatschart/models/delete_api_sandboxes_by_sandbox_id200_response.rb +255 -0
  23. data/lib/seatschart/models/get_api_monitoring_requests200_response.rb +78 -4
  24. data/lib/seatschart/models/get_api_monitoring_requests200_response_concurrency.rb +318 -0
  25. data/lib/seatschart/models/get_api_monitoring_requests200_response_concurrency_api_keys_inner.rb +297 -0
  26. data/lib/seatschart/models/get_api_monitoring_requests200_response_points_inner.rb +38 -4
  27. data/lib/seatschart/models/get_api_sandboxes200_response.rb +239 -0
  28. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner.rb +431 -0
  29. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_rate_limits.rb +270 -0
  30. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_usage.rb +287 -0
  31. data/lib/seatschart/models/get_api_status200_response.rb +387 -0
  32. data/lib/seatschart/models/get_api_status200_response_components_inner.rb +330 -0
  33. data/lib/seatschart/models/get_api_status200_response_components_inner_days_inner.rb +301 -0
  34. data/lib/seatschart/models/get_api_status200_response_incidents_inner.rb +374 -0
  35. data/lib/seatschart/models/get_api_status200_response_maintenance_inner.rb +350 -0
  36. data/lib/seatschart/models/get_api_status503_response.rb +271 -0
  37. data/lib/seatschart/models/get_api_workspace_buyer_extra_data200_response.rb +241 -0
  38. data/lib/seatschart/models/get_api_workspace_defaults200_response.rb +254 -0
  39. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer.rb +246 -0
  40. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer_built_in.rb +270 -0
  41. data/lib/seatschart/models/get_api_workspace_settings200_response_effective.rb +20 -4
  42. data/lib/seatschart/models/get_api_workspace_settings200_response_overrides.rb +13 -4
  43. data/lib/seatschart/models/get_api_workspace_settings200_response_sources.rb +32 -4
  44. data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +34 -5
  45. data/lib/seatschart/models/patch_api_events_by_event_id_listings_by_listing_id_request.rb +379 -0
  46. data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +16 -6
  47. data/lib/seatschart/models/patch_api_listing_types_by_key_request.rb +376 -0
  48. data/lib/seatschart/models/patch_api_seasons_by_season_id_partial_seasons_by_partial_season_id_request.rb +268 -0
  49. data/lib/seatschart/models/patch_api_seasons_by_season_id_request.rb +41 -5
  50. data/lib/seatschart/models/patch_api_webhooks_by_id_request.rb +1 -1
  51. data/lib/seatschart/models/patch_api_workspace_chart_validation_request_severities.rb +25 -4
  52. data/lib/seatschart/models/patch_api_workspace_defaults_request.rb +224 -0
  53. data/lib/seatschart/models/patch_api_workspace_defaults_request_renderer.rb +249 -0
  54. data/lib/seatschart/models/patch_api_workspace_settings_request.rb +18 -7
  55. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_copy_to_workspace_request.rb +39 -1
  56. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request.rb +1 -0
  57. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request_seats_inner_accessibility.rb +6 -6
  58. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish422_response_issues_inner.rb +64 -6
  59. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish_request.rb +1 -1
  60. data/lib/seatschart/models/post_api_embed_tokens_request.rb +18 -15
  61. data/lib/seatschart/models/post_api_embed_tokens_request_safe_mode_options.rb +226 -0
  62. data/lib/seatschart/models/post_api_events_actions_change_object_status_request_status_changes_inner.rb +0 -11
  63. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request.rb +251 -0
  64. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request_events_inner.rb +322 -0
  65. data/lib/seatschart/models/post_api_events_bulk_request_events_inner.rb +42 -1
  66. data/lib/seatschart/models/post_api_events_by_event_id_actions_change_object_status_request.rb +13 -26
  67. data/lib/seatschart/models/post_api_events_by_event_id_actions_change_object_status_request_listing.rb +392 -0
  68. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request.rb +277 -0
  69. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request_for_sale_inner.rb +319 -0
  70. data/lib/seatschart/models/post_api_events_by_event_id_actions_mark_everything_as_not_for_sale_request.rb +215 -0
  71. data/lib/seatschart/models/post_api_events_by_event_id_listings_by_listing_id_actions_mark_sold_request.rb +243 -0
  72. data/lib/seatschart/models/post_api_events_by_event_id_listings_request.rb +435 -0
  73. data/lib/seatschart/models/post_api_events_by_event_id_listings_request_objects_inner.rb +104 -0
  74. data/lib/seatschart/models/post_api_events_by_event_id_listings_request_objects_inner_any_of.rb +325 -0
  75. data/lib/seatschart/models/post_api_events_by_event_id_map_publish_request.rb +215 -0
  76. data/lib/seatschart/models/post_api_events_request.rb +42 -1
  77. data/lib/seatschart/models/{patch_api_events_by_event_id_request_categories_inner.rb → post_api_events_request_categories_inner.rb} +3 -3
  78. data/lib/seatschart/models/post_api_extract_seats200_response.rb +459 -0
  79. data/lib/seatschart/models/post_api_extract_seats200_response_seats_inner.rb +323 -0
  80. data/lib/seatschart/models/post_api_extract_seats200_response_suggested_inner.rb +320 -0
  81. data/lib/seatschart/models/post_api_extract_seats_request.rb +124 -4
  82. data/lib/seatschart/models/post_api_extract_seats_request_examples.rb +105 -0
  83. data/lib/seatschart/models/post_api_extract_seats_request_examples_any_of_inner.rb +293 -0
  84. data/lib/seatschart/models/post_api_extract_seats_request_negatives.rb +105 -0
  85. data/lib/seatschart/models/post_api_extract_seats_request_region.rb +105 -0
  86. data/lib/seatschart/models/post_api_extract_seats_request_region_any_of.rb +363 -0
  87. data/lib/seatschart/models/post_api_ga_confirm_request.rb +0 -44
  88. data/lib/seatschart/models/post_api_ga_release_request.rb +0 -11
  89. data/lib/seatschart/models/post_api_ga_reserve_request.rb +0 -33
  90. data/lib/seatschart/models/post_api_hold_tokens_request.rb +0 -22
  91. data/lib/seatschart/models/post_api_listing_types_request.rb +439 -0
  92. data/lib/seatschart/models/post_api_quotes_request.rb +0 -22
  93. data/lib/seatschart/models/post_api_sandboxes201_response.rb +245 -0
  94. data/lib/seatschart/models/post_api_sandboxes201_response_admin_key.rb +286 -0
  95. data/lib/seatschart/models/post_api_sandboxes201_response_copied.rb +313 -0
  96. data/lib/seatschart/models/post_api_sandboxes201_response_copied_charts_inner.rb +281 -0
  97. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_inner.rb +281 -0
  98. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_with_own_map_inner.rb +265 -0
  99. data/lib/seatschart/models/post_api_sandboxes201_response_copied_key_conflicts_inner.rb +287 -0
  100. data/lib/seatschart/models/post_api_sandboxes201_response_copied_seasons_inner.rb +312 -0
  101. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production200_response.rb +313 -0
  102. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request.rb +255 -0
  103. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_join200_response.rb +271 -0
  104. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +268 -0
  105. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset_request.rb +225 -0
  106. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response.rb +253 -0
  107. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response_api_key.rb +286 -0
  108. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key_request.rb +252 -0
  109. data/lib/seatschart/models/post_api_sandboxes_request.rb +319 -0
  110. data/lib/seatschart/models/post_api_seasons_by_season_id_partial_seasons_request.rb +27 -1
  111. data/lib/seatschart/models/post_api_seasons_request.rb +40 -4
  112. data/lib/seatschart/models/post_api_seats_best_available_request.rb +0 -11
  113. data/lib/seatschart/models/post_api_seats_confirm_request.rb +5 -49
  114. data/lib/seatschart/models/post_api_seats_release_request.rb +5 -16
  115. data/lib/seatschart/models/post_api_seats_reserve_request.rb +5 -27
  116. data/lib/seatschart/models/post_api_viewer_tokens_request.rb +0 -11
  117. data/lib/seatschart/models/post_api_webhooks_request.rb +1 -1
  118. data/lib/seatschart/models/post_api_workspaces_request.rb +1 -1
  119. data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +349 -0
  120. data/lib/seatschart/models/put_api_workspace_buyer_extra_data_request.rb +260 -0
  121. data/lib/seatschart/models/put_internal_status_notices_request.rb +242 -0
  122. data/lib/seatschart/models/put_internal_status_notices_request_notices_inner.rb +445 -0
  123. data/lib/seatschart/retry.rb +106 -7
  124. data/lib/seatschart/version.rb +1 -1
  125. data/lib/seatschart.rb +69 -2
  126. metadata +71 -4
  127. data/lib/seatschart/api/default_api.rb +0 -763
@@ -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
+ # JSON object `{\"x\",\"y\",\"width\",\"height\"}` in source-image pixels limiting the scan to that rectangle (leaves out a legend, title or stage text). Works with `auto` and `examples`; example points must lie inside it. Returned seats stay in whole-image coordinates.
18
+ module PostApiExtractSeatsRequestRegion
19
+ class << self
20
+ # List of class defined in anyOf (OpenAPI v3)
21
+ def openapi_any_of
22
+ [
23
+ :'PostApiExtractSeatsRequestRegionAnyOf',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of anyOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of anyOf items and attempt to identify the appropriate one.
33
+ # Note:
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_any_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_any_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_any_of) # nested anyOf 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
@@ -0,0 +1,363 @@
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 PostApiExtractSeatsRequestRegionAnyOf
18
+ attr_accessor :x
19
+
20
+ attr_accessor :y
21
+
22
+ attr_accessor :width
23
+
24
+ attr_accessor :height
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'x' => :'x',
30
+ :'y' => :'y',
31
+ :'width' => :'width',
32
+ :'height' => :'height'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'x' => :'Float',
45
+ :'y' => :'Float',
46
+ :'width' => :'Float',
47
+ :'height' => :'Float'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiExtractSeatsRequestRegionAnyOf` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiExtractSeatsRequestRegionAnyOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'x')
73
+ self.x = attributes[:'x']
74
+ else
75
+ self.x = nil
76
+ end
77
+
78
+ if attributes.key?(:'y')
79
+ self.y = attributes[:'y']
80
+ else
81
+ self.y = nil
82
+ end
83
+
84
+ if attributes.key?(:'width')
85
+ self.width = attributes[:'width']
86
+ else
87
+ self.width = nil
88
+ end
89
+
90
+ if attributes.key?(:'height')
91
+ self.height = attributes[:'height']
92
+ else
93
+ self.height = nil
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ if @x.nil?
103
+ invalid_properties.push('invalid value for "x", x cannot be nil.')
104
+ end
105
+
106
+ if @x > 16384
107
+ invalid_properties.push('invalid value for "x", must be smaller than or equal to 16384.')
108
+ end
109
+
110
+ if @x < 0
111
+ invalid_properties.push('invalid value for "x", must be greater than or equal to 0.')
112
+ end
113
+
114
+ if @y.nil?
115
+ invalid_properties.push('invalid value for "y", y cannot be nil.')
116
+ end
117
+
118
+ if @y > 16384
119
+ invalid_properties.push('invalid value for "y", must be smaller than or equal to 16384.')
120
+ end
121
+
122
+ if @y < 0
123
+ invalid_properties.push('invalid value for "y", must be greater than or equal to 0.')
124
+ end
125
+
126
+ if @width.nil?
127
+ invalid_properties.push('invalid value for "width", width cannot be nil.')
128
+ end
129
+
130
+ if @width > 16384
131
+ invalid_properties.push('invalid value for "width", must be smaller than or equal to 16384.')
132
+ end
133
+
134
+ if @height.nil?
135
+ invalid_properties.push('invalid value for "height", height cannot be nil.')
136
+ end
137
+
138
+ if @height > 16384
139
+ invalid_properties.push('invalid value for "height", must be smaller than or equal to 16384.')
140
+ end
141
+
142
+ invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+ warn '[DEPRECATED] the `valid?` method is obsolete'
149
+ return false if @x.nil?
150
+ return false if @x > 16384
151
+ return false if @x < 0
152
+ return false if @y.nil?
153
+ return false if @y > 16384
154
+ return false if @y < 0
155
+ return false if @width.nil?
156
+ return false if @width > 16384
157
+ return false if @height.nil?
158
+ return false if @height > 16384
159
+ true
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] x Value to be assigned
164
+ def x=(x)
165
+ if x.nil?
166
+ fail ArgumentError, 'x cannot be nil'
167
+ end
168
+
169
+ if x > 16384
170
+ fail ArgumentError, 'invalid value for "x", must be smaller than or equal to 16384.'
171
+ end
172
+
173
+ if x < 0
174
+ fail ArgumentError, 'invalid value for "x", must be greater than or equal to 0.'
175
+ end
176
+
177
+ @x = x
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] y Value to be assigned
182
+ def y=(y)
183
+ if y.nil?
184
+ fail ArgumentError, 'y cannot be nil'
185
+ end
186
+
187
+ if y > 16384
188
+ fail ArgumentError, 'invalid value for "y", must be smaller than or equal to 16384.'
189
+ end
190
+
191
+ if y < 0
192
+ fail ArgumentError, 'invalid value for "y", must be greater than or equal to 0.'
193
+ end
194
+
195
+ @y = y
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] width Value to be assigned
200
+ def width=(width)
201
+ if width.nil?
202
+ fail ArgumentError, 'width cannot be nil'
203
+ end
204
+
205
+ if width > 16384
206
+ fail ArgumentError, 'invalid value for "width", must be smaller than or equal to 16384.'
207
+ end
208
+
209
+ @width = width
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] height Value to be assigned
214
+ def height=(height)
215
+ if height.nil?
216
+ fail ArgumentError, 'height cannot be nil'
217
+ end
218
+
219
+ if height > 16384
220
+ fail ArgumentError, 'invalid value for "height", must be smaller than or equal to 16384.'
221
+ end
222
+
223
+ @height = height
224
+ end
225
+
226
+ # Checks equality by comparing each attribute.
227
+ # @param [Object] Object to be compared
228
+ def ==(o)
229
+ return true if self.equal?(o)
230
+ self.class == o.class &&
231
+ x == o.x &&
232
+ y == o.y &&
233
+ width == o.width &&
234
+ height == o.height
235
+ end
236
+
237
+ # @see the `==` method
238
+ # @param [Object] Object to be compared
239
+ def eql?(o)
240
+ self == o
241
+ end
242
+
243
+ # Calculates hash code according to all attributes.
244
+ # @return [Integer] Hash code
245
+ def hash
246
+ [x, y, width, height].hash
247
+ end
248
+
249
+ # Builds the object from hash
250
+ # @param [Hash] attributes Model attributes in the form of hash
251
+ # @return [Object] Returns the model itself
252
+ def self.build_from_hash(attributes)
253
+ return nil unless attributes.is_a?(Hash)
254
+ attributes = attributes.transform_keys(&:to_sym)
255
+ transformed_hash = {}
256
+ openapi_types.each_pair do |key, type|
257
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = nil
259
+ elsif type =~ /\AArray<(.*)>/i
260
+ # check to ensure the input is an array given that the attribute
261
+ # is documented as an array but the input is not
262
+ if attributes[attribute_map[key]].is_a?(Array)
263
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
264
+ end
265
+ elsif !attributes[attribute_map[key]].nil?
266
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
267
+ end
268
+ end
269
+ new(transformed_hash)
270
+ end
271
+
272
+ # Deserializes the data based on type
273
+ # @param string type Data type
274
+ # @param string value Value to be deserialized
275
+ # @return [Object] Deserialized data
276
+ def self._deserialize(type, value)
277
+ case type.to_sym
278
+ when :Time
279
+ Time.parse(value)
280
+ when :Date
281
+ Date.parse(value)
282
+ when :String
283
+ value.to_s
284
+ when :Integer
285
+ value.to_i
286
+ when :Float
287
+ value.to_f
288
+ when :Boolean
289
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
290
+ true
291
+ else
292
+ false
293
+ end
294
+ when :Object
295
+ # generic object (usually a Hash), return directly
296
+ value
297
+ when /\AArray<(?<inner_type>.+)>\z/
298
+ inner_type = Regexp.last_match[:inner_type]
299
+ value.map { |v| _deserialize(inner_type, v) }
300
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
301
+ k_type = Regexp.last_match[:k_type]
302
+ v_type = Regexp.last_match[:v_type]
303
+ {}.tap do |hash|
304
+ value.each do |k, v|
305
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
306
+ end
307
+ end
308
+ else # model
309
+ # models (e.g. Pet) or oneOf
310
+ klass = SeatsChart.const_get(type)
311
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
312
+ end
313
+ end
314
+
315
+ # Returns the string representation of the object
316
+ # @return [String] String presentation of the object
317
+ def to_s
318
+ to_hash.to_s
319
+ end
320
+
321
+ # to_body is an alias to to_hash (backward compatibility)
322
+ # @return [Hash] Returns the object in the form of hash
323
+ def to_body
324
+ to_hash
325
+ end
326
+
327
+ # Returns the object in the form of hash
328
+ # @return [Hash] Returns the object in the form of hash
329
+ def to_hash
330
+ hash = {}
331
+ self.class.attribute_map.each_pair do |attr, param|
332
+ value = self.send(attr)
333
+ if value.nil?
334
+ is_nullable = self.class.openapi_nullable.include?(attr)
335
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
336
+ end
337
+
338
+ hash[param] = _to_hash(value)
339
+ end
340
+ hash
341
+ end
342
+
343
+ # Outputs non-array value in the form of hash
344
+ # For object, use to_hash. Otherwise, just return the value
345
+ # @param [Object] value Any valid value
346
+ # @return [Hash] Returns the value in the form of hash
347
+ def _to_hash(value)
348
+ if value.is_a?(Array)
349
+ value.compact.map { |v| _to_hash(v) }
350
+ elsif value.is_a?(Hash)
351
+ {}.tap do |hash|
352
+ value.each { |k, v| hash[k] = _to_hash(v) }
353
+ end
354
+ elsif value.respond_to? :to_hash
355
+ value.to_hash
356
+ else
357
+ value
358
+ end
359
+ end
360
+
361
+ end
362
+
363
+ end
@@ -212,11 +212,6 @@ module SeatsChart
212
212
  invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.')
213
213
  end
214
214
 
215
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
216
- if @user_id !~ pattern
217
- invalid_properties.push("invalid value for \"user_id\", must conform to the pattern #{pattern}.")
218
- end
219
-
220
215
  if !@hold_token.nil? && @hold_token.to_s.length > 36
221
216
  invalid_properties.push('invalid value for "hold_token", the character length must be smaller than or equal to 36.')
222
217
  end
@@ -233,11 +228,6 @@ module SeatsChart
233
228
  invalid_properties.push('invalid value for "ticket_type_id", the character length must be great than or equal to 1.')
234
229
  end
235
230
 
236
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
237
- if !@ticket_type_id.nil? && @ticket_type_id !~ pattern
238
- invalid_properties.push("invalid value for \"ticket_type_id\", must conform to the pattern #{pattern}.")
239
- end
240
-
241
231
  if !@external_payment_id.nil? && @external_payment_id.to_s.length > 255
242
232
  invalid_properties.push('invalid value for "external_payment_id", the character length must be smaller than or equal to 255.')
243
233
  end
@@ -246,11 +236,6 @@ module SeatsChart
246
236
  invalid_properties.push('invalid value for "external_payment_id", the character length must be great than or equal to 1.')
247
237
  end
248
238
 
249
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
250
- if !@external_payment_id.nil? && @external_payment_id !~ pattern
251
- invalid_properties.push("invalid value for \"external_payment_id\", must conform to the pattern #{pattern}.")
252
- end
253
-
254
239
  if !@paid_amount_cents.nil? && @paid_amount_cents > 2147483647
255
240
  invalid_properties.push('invalid value for "paid_amount_cents", must be smaller than or equal to 2147483647.')
256
241
  end
@@ -280,11 +265,6 @@ module SeatsChart
280
265
  invalid_properties.push('invalid value for "ticket_buyer_id", the character length must be great than or equal to 1.')
281
266
  end
282
267
 
283
- pattern = Regexp.new(/^(?:[^\u0000-\u001F\u007F\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
284
- if !@ticket_buyer_id.nil? && @ticket_buyer_id !~ pattern
285
- invalid_properties.push("invalid value for \"ticket_buyer_id\", must conform to the pattern #{pattern}.")
286
- end
287
-
288
268
  invalid_properties
289
269
  end
290
270
 
@@ -304,15 +284,12 @@ module SeatsChart
304
284
  return false if @user_id.nil?
305
285
  return false if @user_id.to_s.length > 256
306
286
  return false if @user_id.to_s.length < 1
307
- return false if @user_id !~ Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
308
287
  return false if !@hold_token.nil? && @hold_token.to_s.length > 36
309
288
  return false if !@hold_token.nil? && @hold_token.to_s.length < 36
310
289
  return false if !@ticket_type_id.nil? && @ticket_type_id.to_s.length > 64
311
290
  return false if !@ticket_type_id.nil? && @ticket_type_id.to_s.length < 1
312
- return false if !@ticket_type_id.nil? && @ticket_type_id !~ Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
313
291
  return false if !@external_payment_id.nil? && @external_payment_id.to_s.length > 255
314
292
  return false if !@external_payment_id.nil? && @external_payment_id.to_s.length < 1
315
- return false if !@external_payment_id.nil? && @external_payment_id !~ Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
316
293
  return false if !@paid_amount_cents.nil? && @paid_amount_cents > 2147483647
317
294
  return false if !@paid_amount_cents.nil? && @paid_amount_cents < 0
318
295
  return false if !@paid_currency.nil? && @paid_currency !~ Regexp.new(/^[A-Z]{3}$/)
@@ -320,7 +297,6 @@ module SeatsChart
320
297
  return false if !@channel.nil? && @channel.to_s.length < 1
321
298
  return false if !@ticket_buyer_id.nil? && @ticket_buyer_id.to_s.length > 256
322
299
  return false if !@ticket_buyer_id.nil? && @ticket_buyer_id.to_s.length < 1
323
- return false if !@ticket_buyer_id.nil? && @ticket_buyer_id !~ Regexp.new(/^(?:[^\u0000-\u001F\u007F\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
324
300
  true
325
301
  end
326
302
 
@@ -393,11 +369,6 @@ module SeatsChart
393
369
  fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.'
394
370
  end
395
371
 
396
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
397
- if user_id !~ pattern
398
- fail ArgumentError, "invalid value for \"user_id\", must conform to the pattern #{pattern}."
399
- end
400
-
401
372
  @user_id = user_id
402
373
  end
403
374
 
@@ -434,11 +405,6 @@ module SeatsChart
434
405
  fail ArgumentError, 'invalid value for "ticket_type_id", the character length must be great than or equal to 1.'
435
406
  end
436
407
 
437
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
438
- if ticket_type_id !~ pattern
439
- fail ArgumentError, "invalid value for \"ticket_type_id\", must conform to the pattern #{pattern}."
440
- end
441
-
442
408
  @ticket_type_id = ticket_type_id
443
409
  end
444
410
 
@@ -457,11 +423,6 @@ module SeatsChart
457
423
  fail ArgumentError, 'invalid value for "external_payment_id", the character length must be great than or equal to 1.'
458
424
  end
459
425
 
460
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
461
- if external_payment_id !~ pattern
462
- fail ArgumentError, "invalid value for \"external_payment_id\", must conform to the pattern #{pattern}."
463
- end
464
-
465
426
  @external_payment_id = external_payment_id
466
427
  end
467
428
 
@@ -531,11 +492,6 @@ module SeatsChart
531
492
  fail ArgumentError, 'invalid value for "ticket_buyer_id", the character length must be great than or equal to 1.'
532
493
  end
533
494
 
534
- pattern = Regexp.new(/^(?:[^\u0000-\u001F\u007F\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
535
- if ticket_buyer_id !~ pattern
536
- fail ArgumentError, "invalid value for \"ticket_buyer_id\", must conform to the pattern #{pattern}."
537
- end
538
-
539
495
  @ticket_buyer_id = ticket_buyer_id
540
496
  end
541
497
 
@@ -133,11 +133,6 @@ module SeatsChart
133
133
  invalid_properties.push('invalid value for "user_id", the character length must be great than or equal to 1.')
134
134
  end
135
135
 
136
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
137
- if @user_id !~ pattern
138
- invalid_properties.push("invalid value for \"user_id\", must conform to the pattern #{pattern}.")
139
- end
140
-
141
136
  if !@hold_token.nil? && @hold_token.to_s.length > 36
142
137
  invalid_properties.push('invalid value for "hold_token", the character length must be smaller than or equal to 36.')
143
138
  end
@@ -162,7 +157,6 @@ module SeatsChart
162
157
  return false if @user_id.nil?
163
158
  return false if @user_id.to_s.length > 256
164
159
  return false if @user_id.to_s.length < 1
165
- return false if @user_id !~ Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
166
160
  return false if !@hold_token.nil? && @hold_token.to_s.length > 36
167
161
  return false if !@hold_token.nil? && @hold_token.to_s.length < 36
168
162
  true
@@ -219,11 +213,6 @@ module SeatsChart
219
213
  fail ArgumentError, 'invalid value for "user_id", the character length must be great than or equal to 1.'
220
214
  end
221
215
 
222
- pattern = Regexp.new(/^(?:[^\u0000\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])+$/)
223
- if user_id !~ pattern
224
- fail ArgumentError, "invalid value for \"user_id\", must conform to the pattern #{pattern}."
225
- end
226
-
227
216
  @user_id = user_id
228
217
  end
229
218