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
@@ -17,13 +17,27 @@ module SeatsChart
17
17
  class GetApiMonitoringRequests200Response
18
18
  attr_accessor :range
19
19
 
20
- # 60 for 10m/1h, 900 for 24h, 3600 for 7d.
20
+ # 60 for 10m/1h, 900 for 24h, 3600 for 7d, 86400 for 30d.
21
21
  attr_accessor :bucket_seconds
22
22
 
23
+ # Window start (first bucket).
23
24
  attr_accessor :from
24
25
 
26
+ # Window end: now for the live window, else the (exclusive) `before`.
25
27
  attr_accessor :to
26
28
 
29
+ # Aligned cursor of this window; null for the live window.
30
+ attr_accessor :before
31
+
32
+ # `before` of the previous (older) window; null when nothing older is kept.
33
+ attr_accessor :previous_before
34
+
35
+ # `before` of the next (newer) window; null when the next window is the live one (omit `before`) or this is the live window.
36
+ attr_accessor :next_before
37
+
38
+ # Oldest instant kept at this window size (24 hours of minutes, 31 days of hours and days).
39
+ attr_accessor :retention_start
40
+
27
41
  # Plan whose limits apply (a test workspace uses its production workspace plan).
28
42
  attr_accessor :plan
29
43
 
@@ -34,6 +48,8 @@ module SeatsChart
34
48
 
35
49
  attr_accessor :lanes
36
50
 
51
+ attr_accessor :concurrency
52
+
37
53
  attr_accessor :points
38
54
 
39
55
  class EnumAttributeValidator
@@ -65,10 +81,15 @@ module SeatsChart
65
81
  :'bucket_seconds' => :'bucketSeconds',
66
82
  :'from' => :'from',
67
83
  :'to' => :'to',
84
+ :'before' => :'before',
85
+ :'previous_before' => :'previousBefore',
86
+ :'next_before' => :'nextBefore',
87
+ :'retention_start' => :'retentionStart',
68
88
  :'plan' => :'plan',
69
89
  :'is_test' => :'isTest',
70
90
  :'window_seconds' => :'windowSeconds',
71
91
  :'lanes' => :'lanes',
92
+ :'concurrency' => :'concurrency',
72
93
  :'points' => :'points'
73
94
  }
74
95
  end
@@ -85,10 +106,15 @@ module SeatsChart
85
106
  :'bucket_seconds' => :'Integer',
86
107
  :'from' => :'Time',
87
108
  :'to' => :'Time',
109
+ :'before' => :'Time',
110
+ :'previous_before' => :'Time',
111
+ :'next_before' => :'Time',
112
+ :'retention_start' => :'Time',
88
113
  :'plan' => :'String',
89
114
  :'is_test' => :'Boolean',
90
115
  :'window_seconds' => :'Integer',
91
116
  :'lanes' => :'GetApiMonitoringRequests200ResponseLanes',
117
+ :'concurrency' => :'GetApiMonitoringRequests200ResponseConcurrency',
92
118
  :'points' => :'Array<GetApiMonitoringRequests200ResponsePointsInner>'
93
119
  }
94
120
  end
@@ -96,6 +122,9 @@ module SeatsChart
96
122
  # List of attributes with nullable: true
97
123
  def self.openapi_nullable
98
124
  Set.new([
125
+ :'before',
126
+ :'previous_before',
127
+ :'next_before',
99
128
  ])
100
129
  end
101
130
 
@@ -138,6 +167,30 @@ module SeatsChart
138
167
  self.to = nil
139
168
  end
140
169
 
170
+ if attributes.key?(:'before')
171
+ self.before = attributes[:'before']
172
+ else
173
+ self.before = nil
174
+ end
175
+
176
+ if attributes.key?(:'previous_before')
177
+ self.previous_before = attributes[:'previous_before']
178
+ else
179
+ self.previous_before = nil
180
+ end
181
+
182
+ if attributes.key?(:'next_before')
183
+ self.next_before = attributes[:'next_before']
184
+ else
185
+ self.next_before = nil
186
+ end
187
+
188
+ if attributes.key?(:'retention_start')
189
+ self.retention_start = attributes[:'retention_start']
190
+ else
191
+ self.retention_start = nil
192
+ end
193
+
141
194
  if attributes.key?(:'plan')
142
195
  self.plan = attributes[:'plan']
143
196
  else
@@ -162,6 +215,12 @@ module SeatsChart
162
215
  self.lanes = nil
163
216
  end
164
217
 
218
+ if attributes.key?(:'concurrency')
219
+ self.concurrency = attributes[:'concurrency']
220
+ else
221
+ self.concurrency = nil
222
+ end
223
+
165
224
  if attributes.key?(:'points')
166
225
  if (value = attributes[:'points']).is_a?(Array)
167
226
  self.points = value
@@ -192,6 +251,10 @@ module SeatsChart
192
251
  invalid_properties.push('invalid value for "to", to cannot be nil.')
193
252
  end
194
253
 
254
+ if @retention_start.nil?
255
+ invalid_properties.push('invalid value for "retention_start", retention_start cannot be nil.')
256
+ end
257
+
195
258
  if @plan.nil?
196
259
  invalid_properties.push('invalid value for "plan", plan cannot be nil.')
197
260
  end
@@ -208,6 +271,10 @@ module SeatsChart
208
271
  invalid_properties.push('invalid value for "lanes", lanes cannot be nil.')
209
272
  end
210
273
 
274
+ if @concurrency.nil?
275
+ invalid_properties.push('invalid value for "concurrency", concurrency cannot be nil.')
276
+ end
277
+
211
278
  if @points.nil?
212
279
  invalid_properties.push('invalid value for "points", points cannot be nil.')
213
280
  end
@@ -220,15 +287,17 @@ module SeatsChart
220
287
  def valid?
221
288
  warn '[DEPRECATED] the `valid?` method is obsolete'
222
289
  return false if @range.nil?
223
- range_validator = EnumAttributeValidator.new('String', ["10m", "1h", "24h", "7d"])
290
+ range_validator = EnumAttributeValidator.new('String', ["10m", "1h", "24h", "7d", "30d"])
224
291
  return false unless range_validator.valid?(@range)
225
292
  return false if @bucket_seconds.nil?
226
293
  return false if @from.nil?
227
294
  return false if @to.nil?
295
+ return false if @retention_start.nil?
228
296
  return false if @plan.nil?
229
297
  return false if @is_test.nil?
230
298
  return false if @window_seconds.nil?
231
299
  return false if @lanes.nil?
300
+ return false if @concurrency.nil?
232
301
  return false if @points.nil?
233
302
  true
234
303
  end
@@ -236,7 +305,7 @@ module SeatsChart
236
305
  # Custom attribute writer method checking allowed values (enum).
237
306
  # @param [Object] range Object to be assigned
238
307
  def range=(range)
239
- validator = EnumAttributeValidator.new('String', ["10m", "1h", "24h", "7d"])
308
+ validator = EnumAttributeValidator.new('String', ["10m", "1h", "24h", "7d", "30d"])
240
309
  unless validator.valid?(range)
241
310
  fail ArgumentError, "invalid value for \"range\", must be one of #{validator.allowable_values}."
242
311
  end
@@ -252,10 +321,15 @@ module SeatsChart
252
321
  bucket_seconds == o.bucket_seconds &&
253
322
  from == o.from &&
254
323
  to == o.to &&
324
+ before == o.before &&
325
+ previous_before == o.previous_before &&
326
+ next_before == o.next_before &&
327
+ retention_start == o.retention_start &&
255
328
  plan == o.plan &&
256
329
  is_test == o.is_test &&
257
330
  window_seconds == o.window_seconds &&
258
331
  lanes == o.lanes &&
332
+ concurrency == o.concurrency &&
259
333
  points == o.points
260
334
  end
261
335
 
@@ -268,7 +342,7 @@ module SeatsChart
268
342
  # Calculates hash code according to all attributes.
269
343
  # @return [Integer] Hash code
270
344
  def hash
271
- [range, bucket_seconds, from, to, plan, is_test, window_seconds, lanes, points].hash
345
+ [range, bucket_seconds, from, to, before, previous_before, next_before, retention_start, plan, is_test, window_seconds, lanes, concurrency, points].hash
272
346
  end
273
347
 
274
348
  # Builds the object from hash
@@ -0,0 +1,318 @@
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 GetApiMonitoringRequests200ResponseConcurrency
18
+ # Workspace requests in flight now on the API instance that answered (this request excluded).
19
+ attr_accessor :current
20
+
21
+ # Highest concurrent requests in any minute of the last hour.
22
+ attr_accessor :peak_last_hour
23
+
24
+ # Start of the minute (hour for the day) of the peak.
25
+ attr_accessor :peak_last_hour_at
26
+
27
+ # Highest concurrent requests in any hour of the last 24 hours.
28
+ attr_accessor :peak_last_day
29
+
30
+ # Start of the minute (hour for the day) of the peak.
31
+ attr_accessor :peak_last_day_at
32
+
33
+ # API instances that reported in-flight peaks in the last 24 hours (peaks are summed across them).
34
+ attr_accessor :instances
35
+
36
+ # Per API key, busiest first (keys without traffic in the last 24 hours are omitted).
37
+ attr_accessor :api_keys
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'current' => :'current',
43
+ :'peak_last_hour' => :'peakLastHour',
44
+ :'peak_last_hour_at' => :'peakLastHourAt',
45
+ :'peak_last_day' => :'peakLastDay',
46
+ :'peak_last_day_at' => :'peakLastDayAt',
47
+ :'instances' => :'instances',
48
+ :'api_keys' => :'apiKeys'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'current' => :'Integer',
61
+ :'peak_last_hour' => :'Integer',
62
+ :'peak_last_hour_at' => :'Time',
63
+ :'peak_last_day' => :'Integer',
64
+ :'peak_last_day_at' => :'Time',
65
+ :'instances' => :'Integer',
66
+ :'api_keys' => :'Array<GetApiMonitoringRequests200ResponseConcurrencyApiKeysInner>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ :'peak_last_hour_at',
74
+ :'peak_last_day_at',
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::GetApiMonitoringRequests200ResponseConcurrency` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::GetApiMonitoringRequests200ResponseConcurrency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'current')
94
+ self.current = attributes[:'current']
95
+ else
96
+ self.current = nil
97
+ end
98
+
99
+ if attributes.key?(:'peak_last_hour')
100
+ self.peak_last_hour = attributes[:'peak_last_hour']
101
+ else
102
+ self.peak_last_hour = nil
103
+ end
104
+
105
+ if attributes.key?(:'peak_last_hour_at')
106
+ self.peak_last_hour_at = attributes[:'peak_last_hour_at']
107
+ else
108
+ self.peak_last_hour_at = nil
109
+ end
110
+
111
+ if attributes.key?(:'peak_last_day')
112
+ self.peak_last_day = attributes[:'peak_last_day']
113
+ else
114
+ self.peak_last_day = nil
115
+ end
116
+
117
+ if attributes.key?(:'peak_last_day_at')
118
+ self.peak_last_day_at = attributes[:'peak_last_day_at']
119
+ else
120
+ self.peak_last_day_at = nil
121
+ end
122
+
123
+ if attributes.key?(:'instances')
124
+ self.instances = attributes[:'instances']
125
+ else
126
+ self.instances = nil
127
+ end
128
+
129
+ if attributes.key?(:'api_keys')
130
+ if (value = attributes[:'api_keys']).is_a?(Array)
131
+ self.api_keys = value
132
+ end
133
+ else
134
+ self.api_keys = nil
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
+ invalid_properties = Array.new
143
+ if @current.nil?
144
+ invalid_properties.push('invalid value for "current", current cannot be nil.')
145
+ end
146
+
147
+ if @peak_last_hour.nil?
148
+ invalid_properties.push('invalid value for "peak_last_hour", peak_last_hour cannot be nil.')
149
+ end
150
+
151
+ if @peak_last_day.nil?
152
+ invalid_properties.push('invalid value for "peak_last_day", peak_last_day cannot be nil.')
153
+ end
154
+
155
+ if @instances.nil?
156
+ invalid_properties.push('invalid value for "instances", instances cannot be nil.')
157
+ end
158
+
159
+ if @api_keys.nil?
160
+ invalid_properties.push('invalid value for "api_keys", api_keys cannot be nil.')
161
+ end
162
+
163
+ invalid_properties
164
+ end
165
+
166
+ # Check to see if the all the properties in the model are valid
167
+ # @return true if the model is valid
168
+ def valid?
169
+ warn '[DEPRECATED] the `valid?` method is obsolete'
170
+ return false if @current.nil?
171
+ return false if @peak_last_hour.nil?
172
+ return false if @peak_last_day.nil?
173
+ return false if @instances.nil?
174
+ return false if @api_keys.nil?
175
+ true
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ current == o.current &&
184
+ peak_last_hour == o.peak_last_hour &&
185
+ peak_last_hour_at == o.peak_last_hour_at &&
186
+ peak_last_day == o.peak_last_day &&
187
+ peak_last_day_at == o.peak_last_day_at &&
188
+ instances == o.instances &&
189
+ api_keys == o.api_keys
190
+ end
191
+
192
+ # @see the `==` method
193
+ # @param [Object] Object to be compared
194
+ def eql?(o)
195
+ self == o
196
+ end
197
+
198
+ # Calculates hash code according to all attributes.
199
+ # @return [Integer] Hash code
200
+ def hash
201
+ [current, peak_last_hour, peak_last_hour_at, peak_last_day, peak_last_day_at, instances, api_keys].hash
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def self.build_from_hash(attributes)
208
+ return nil unless attributes.is_a?(Hash)
209
+ attributes = attributes.transform_keys(&:to_sym)
210
+ transformed_hash = {}
211
+ openapi_types.each_pair do |key, type|
212
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
213
+ transformed_hash["#{key}"] = nil
214
+ elsif type =~ /\AArray<(.*)>/i
215
+ # check to ensure the input is an array given that the attribute
216
+ # is documented as an array but the input is not
217
+ if attributes[attribute_map[key]].is_a?(Array)
218
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
219
+ end
220
+ elsif !attributes[attribute_map[key]].nil?
221
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
222
+ end
223
+ end
224
+ new(transformed_hash)
225
+ end
226
+
227
+ # Deserializes the data based on type
228
+ # @param string type Data type
229
+ # @param string value Value to be deserialized
230
+ # @return [Object] Deserialized data
231
+ def self._deserialize(type, value)
232
+ case type.to_sym
233
+ when :Time
234
+ Time.parse(value)
235
+ when :Date
236
+ Date.parse(value)
237
+ when :String
238
+ value.to_s
239
+ when :Integer
240
+ value.to_i
241
+ when :Float
242
+ value.to_f
243
+ when :Boolean
244
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
245
+ true
246
+ else
247
+ false
248
+ end
249
+ when :Object
250
+ # generic object (usually a Hash), return directly
251
+ value
252
+ when /\AArray<(?<inner_type>.+)>\z/
253
+ inner_type = Regexp.last_match[:inner_type]
254
+ value.map { |v| _deserialize(inner_type, v) }
255
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
256
+ k_type = Regexp.last_match[:k_type]
257
+ v_type = Regexp.last_match[:v_type]
258
+ {}.tap do |hash|
259
+ value.each do |k, v|
260
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
261
+ end
262
+ end
263
+ else # model
264
+ # models (e.g. Pet) or oneOf
265
+ klass = SeatsChart.const_get(type)
266
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
267
+ end
268
+ end
269
+
270
+ # Returns the string representation of the object
271
+ # @return [String] String presentation of the object
272
+ def to_s
273
+ to_hash.to_s
274
+ end
275
+
276
+ # to_body is an alias to to_hash (backward compatibility)
277
+ # @return [Hash] Returns the object in the form of hash
278
+ def to_body
279
+ to_hash
280
+ end
281
+
282
+ # Returns the object in the form of hash
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_hash
285
+ hash = {}
286
+ self.class.attribute_map.each_pair do |attr, param|
287
+ value = self.send(attr)
288
+ if value.nil?
289
+ is_nullable = self.class.openapi_nullable.include?(attr)
290
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
291
+ end
292
+
293
+ hash[param] = _to_hash(value)
294
+ end
295
+ hash
296
+ end
297
+
298
+ # Outputs non-array value in the form of hash
299
+ # For object, use to_hash. Otherwise, just return the value
300
+ # @param [Object] value Any valid value
301
+ # @return [Hash] Returns the value in the form of hash
302
+ def _to_hash(value)
303
+ if value.is_a?(Array)
304
+ value.compact.map { |v| _to_hash(v) }
305
+ elsif value.is_a?(Hash)
306
+ {}.tap do |hash|
307
+ value.each { |k, v| hash[k] = _to_hash(v) }
308
+ end
309
+ elsif value.respond_to? :to_hash
310
+ value.to_hash
311
+ else
312
+ value
313
+ end
314
+ end
315
+
316
+ end
317
+
318
+ end