repull 0.2.61 → 0.2.62

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +200 -0
  3. data/lib/repull/api/listings_api.rb +70 -0
  4. data/lib/repull/api/properties_api.rb +3 -3
  5. data/lib/repull/api/tiket_api.rb +885 -0
  6. data/lib/repull/models/listing_publish_tiket_response.rb +165 -0
  7. data/lib/repull/models/listing_publish_tiket_response_result.rb +182 -0
  8. data/lib/repull/models/map_tiket_connect_rooms_request.rb +201 -0
  9. data/lib/repull/models/map_tiket_connect_rooms_request_mappings_inner.rb +184 -0
  10. data/lib/repull/models/publish_listing_tiket_request.rb +148 -0
  11. data/lib/repull/models/reservation.rb +1 -1
  12. data/lib/repull/models/sync_tiket_request.rb +160 -0
  13. data/lib/repull/models/tiket_ari_day.rb +347 -0
  14. data/lib/repull/models/tiket_ari_mismatch.rb +198 -0
  15. data/lib/repull/models/tiket_ari_update.rb +468 -0
  16. data/lib/repull/models/tiket_ari_write_response.rb +357 -0
  17. data/lib/repull/models/tiket_availability_response.rb +269 -0
  18. data/lib/repull/models/tiket_availability_update_request.rb +241 -0
  19. data/lib/repull/models/tiket_child_price.rb +217 -0
  20. data/lib/repull/models/tiket_connect_claim_response.rb +216 -0
  21. data/lib/repull/models/tiket_connect_map_rooms_response.rb +204 -0
  22. data/lib/repull/models/tiket_connect_rooms_response.rb +295 -0
  23. data/lib/repull/models/tiket_connect_rooms_response_rooms_inner.rb +199 -0
  24. data/lib/repull/models/tiket_content_response.rb +202 -0
  25. data/lib/repull/models/tiket_content_response_objects_inner.rb +237 -0
  26. data/lib/repull/models/tiket_listing_pricing_response.rb +321 -0
  27. data/lib/repull/models/tiket_listing_pricing_update_request.rb +209 -0
  28. data/lib/repull/models/tiket_map_listings_request.rb +202 -0
  29. data/lib/repull/models/tiket_map_listings_request_mappings_inner.rb +186 -0
  30. data/lib/repull/models/tiket_map_listings_response.rb +169 -0
  31. data/lib/repull/models/tiket_map_listings_response_results_inner.rb +176 -0
  32. data/lib/repull/models/tiket_occupancy_price.rb +201 -0
  33. data/lib/repull/models/tiket_property.rb +278 -0
  34. data/lib/repull/models/tiket_property_list_response.rb +166 -0
  35. data/lib/repull/models/tiket_property_listings_inner.rb +175 -0
  36. data/lib/repull/models/tiket_property_rooms_response.rb +192 -0
  37. data/lib/repull/models/tiket_rate_plan.rb +178 -0
  38. data/lib/repull/models/tiket_reservation.rb +421 -0
  39. data/lib/repull/models/tiket_reservation_list_response.rb +192 -0
  40. data/lib/repull/models/tiket_reservation_list_response_pagination.rb +165 -0
  41. data/lib/repull/models/tiket_room.rb +232 -0
  42. data/lib/repull/models/tiket_setup_request.rb +469 -0
  43. data/lib/repull/models/tiket_setup_request_contacts_inner.rb +192 -0
  44. data/lib/repull/models/tiket_setup_request_properties_inner.rb +174 -0
  45. data/lib/repull/models/tiket_setup_response.rb +159 -0
  46. data/lib/repull/models/tiket_sync_response.rb +167 -0
  47. data/lib/repull/models/tiket_sync_response_results_inner.rb +239 -0
  48. data/lib/repull/models/verify_tiket_claim_request.rb +212 -0
  49. data/lib/repull/version.rb +1 -1
  50. data/lib/repull.rb +43 -0
  51. data/openapi/v1.json +8050 -5448
  52. data/spec/api/tiket_api_spec.rb +56 -0
  53. metadata +47 -2
@@ -0,0 +1,468 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ # One date range for one room type (and, for `rates` and `restrictions`, one rate plan). Which fields apply depends on the request's `type`.
18
+ class TiketAriUpdate < ApiModelBase
19
+ # tiket.com room type id. Required on `PUT /v1/channels/tiket/availability`; on the listing route it is always the listing's room.
20
+ attr_accessor :room_type_code
21
+
22
+ # tiket.com rate plan id. Required for `rates` and `restrictions` on `PUT /v1/channels/tiket/availability`; on the listing route it defaults to every rate plan of the room selected for pushes.
23
+ attr_accessor :rate_plan_code
24
+
25
+ # First night. tiket.com accepts today up to 500 days ahead.
26
+ attr_accessor :start
27
+
28
+ # Last night, inclusive.
29
+ attr_accessor :_end
30
+
31
+ # `availability`: rooms to sell.
32
+ attr_accessor :available_rooms
33
+
34
+ # `rates` on a Room Based property: price per night, tax included. Greater than 0.
35
+ attr_accessor :price
36
+
37
+ # `rates` on an Occupancy Based property. Send `price` or `occupancyPrices`, not both.
38
+ attr_accessor :occupancy_prices
39
+
40
+ # Children prices. **Children rates are paused.** tiket.com has asked every channel manager not to send children rates until it fixes an issue on its side, so a write that includes `childPrices` is refused with `422 invalid_params` and nothing is sent. Children rates set in the tiket.com extranet still apply. Send `price` or `occupancyPrices` without `childPrices`.
41
+ attr_accessor :child_prices
42
+
43
+ # ISO 4217. Defaults to the property currency.
44
+ attr_accessor :currency
45
+
46
+ # `restrictions`: minimum nights.
47
+ attr_accessor :min_stay
48
+
49
+ # `restrictions`: maximum nights.
50
+ attr_accessor :max_stay
51
+
52
+ # `restrictions`: close (`true`) or open (`false`) the rate plan. With `availability` and a `ratePlanCode`, also closes that rate plan.
53
+ attr_accessor :stop_sell
54
+
55
+ # `restrictions`.
56
+ attr_accessor :closed_to_arrival
57
+
58
+ # `restrictions`.
59
+ attr_accessor :closed_to_departure
60
+
61
+ # `restrictions`: minimum days between booking and arrival.
62
+ attr_accessor :min_advance_days
63
+
64
+ # `restrictions`: maximum days between booking and arrival.
65
+ attr_accessor :max_advance_days
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'room_type_code' => :'roomTypeCode',
71
+ :'rate_plan_code' => :'ratePlanCode',
72
+ :'start' => :'start',
73
+ :'_end' => :'end',
74
+ :'available_rooms' => :'availableRooms',
75
+ :'price' => :'price',
76
+ :'occupancy_prices' => :'occupancyPrices',
77
+ :'child_prices' => :'childPrices',
78
+ :'currency' => :'currency',
79
+ :'min_stay' => :'minStay',
80
+ :'max_stay' => :'maxStay',
81
+ :'stop_sell' => :'stopSell',
82
+ :'closed_to_arrival' => :'closedToArrival',
83
+ :'closed_to_departure' => :'closedToDeparture',
84
+ :'min_advance_days' => :'minAdvanceDays',
85
+ :'max_advance_days' => :'maxAdvanceDays'
86
+ }
87
+ end
88
+
89
+ # Returns attribute mapping this model knows about
90
+ def self.acceptable_attribute_map
91
+ attribute_map
92
+ end
93
+
94
+ # Returns all the JSON keys this model knows about
95
+ def self.acceptable_attributes
96
+ acceptable_attribute_map.values
97
+ end
98
+
99
+ # Attribute type mapping.
100
+ def self.openapi_types
101
+ {
102
+ :'room_type_code' => :'String',
103
+ :'rate_plan_code' => :'String',
104
+ :'start' => :'Date',
105
+ :'_end' => :'Date',
106
+ :'available_rooms' => :'Integer',
107
+ :'price' => :'Float',
108
+ :'occupancy_prices' => :'Array<TiketOccupancyPrice>',
109
+ :'child_prices' => :'Array<TiketChildPrice>',
110
+ :'currency' => :'String',
111
+ :'min_stay' => :'Integer',
112
+ :'max_stay' => :'Integer',
113
+ :'stop_sell' => :'Boolean',
114
+ :'closed_to_arrival' => :'Boolean',
115
+ :'closed_to_departure' => :'Boolean',
116
+ :'min_advance_days' => :'Integer',
117
+ :'max_advance_days' => :'Integer'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ ])
125
+ end
126
+
127
+ # Initializes the object
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ def initialize(attributes = {})
130
+ if (!attributes.is_a?(Hash))
131
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketAriUpdate` initialize method"
132
+ end
133
+
134
+ # check to see if the attribute exists and convert string to symbol for hash key
135
+ acceptable_attribute_map = self.class.acceptable_attribute_map
136
+ attributes = attributes.each_with_object({}) { |(k, v), h|
137
+ if (!acceptable_attribute_map.key?(k.to_sym))
138
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketAriUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
139
+ end
140
+ h[k.to_sym] = v
141
+ }
142
+
143
+ if attributes.key?(:'room_type_code')
144
+ self.room_type_code = attributes[:'room_type_code']
145
+ end
146
+
147
+ if attributes.key?(:'rate_plan_code')
148
+ self.rate_plan_code = attributes[:'rate_plan_code']
149
+ end
150
+
151
+ if attributes.key?(:'start')
152
+ self.start = attributes[:'start']
153
+ else
154
+ self.start = nil
155
+ end
156
+
157
+ if attributes.key?(:'_end')
158
+ self._end = attributes[:'_end']
159
+ else
160
+ self._end = nil
161
+ end
162
+
163
+ if attributes.key?(:'available_rooms')
164
+ self.available_rooms = attributes[:'available_rooms']
165
+ end
166
+
167
+ if attributes.key?(:'price')
168
+ self.price = attributes[:'price']
169
+ end
170
+
171
+ if attributes.key?(:'occupancy_prices')
172
+ if (value = attributes[:'occupancy_prices']).is_a?(Array)
173
+ self.occupancy_prices = value
174
+ end
175
+ end
176
+
177
+ if attributes.key?(:'child_prices')
178
+ if (value = attributes[:'child_prices']).is_a?(Array)
179
+ self.child_prices = value
180
+ end
181
+ end
182
+
183
+ if attributes.key?(:'currency')
184
+ self.currency = attributes[:'currency']
185
+ end
186
+
187
+ if attributes.key?(:'min_stay')
188
+ self.min_stay = attributes[:'min_stay']
189
+ end
190
+
191
+ if attributes.key?(:'max_stay')
192
+ self.max_stay = attributes[:'max_stay']
193
+ end
194
+
195
+ if attributes.key?(:'stop_sell')
196
+ self.stop_sell = attributes[:'stop_sell']
197
+ end
198
+
199
+ if attributes.key?(:'closed_to_arrival')
200
+ self.closed_to_arrival = attributes[:'closed_to_arrival']
201
+ end
202
+
203
+ if attributes.key?(:'closed_to_departure')
204
+ self.closed_to_departure = attributes[:'closed_to_departure']
205
+ end
206
+
207
+ if attributes.key?(:'min_advance_days')
208
+ self.min_advance_days = attributes[:'min_advance_days']
209
+ end
210
+
211
+ if attributes.key?(:'max_advance_days')
212
+ self.max_advance_days = attributes[:'max_advance_days']
213
+ end
214
+ end
215
+
216
+ # Show invalid properties with the reasons. Usually used together with valid?
217
+ # @return Array for valid properties with the reasons
218
+ def list_invalid_properties
219
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
220
+ invalid_properties = Array.new
221
+ if @start.nil?
222
+ invalid_properties.push('invalid value for "start", start cannot be nil.')
223
+ end
224
+
225
+ if @_end.nil?
226
+ invalid_properties.push('invalid value for "_end", _end cannot be nil.')
227
+ end
228
+
229
+ if !@available_rooms.nil? && @available_rooms < 0
230
+ invalid_properties.push('invalid value for "available_rooms", must be greater than or equal to 0.')
231
+ end
232
+
233
+ if !@min_stay.nil? && @min_stay > 365
234
+ invalid_properties.push('invalid value for "min_stay", must be smaller than or equal to 365.')
235
+ end
236
+
237
+ if !@min_stay.nil? && @min_stay < 0
238
+ invalid_properties.push('invalid value for "min_stay", must be greater than or equal to 0.')
239
+ end
240
+
241
+ if !@max_stay.nil? && @max_stay > 365
242
+ invalid_properties.push('invalid value for "max_stay", must be smaller than or equal to 365.')
243
+ end
244
+
245
+ if !@max_stay.nil? && @max_stay < 0
246
+ invalid_properties.push('invalid value for "max_stay", must be greater than or equal to 0.')
247
+ end
248
+
249
+ if !@min_advance_days.nil? && @min_advance_days > 500
250
+ invalid_properties.push('invalid value for "min_advance_days", must be smaller than or equal to 500.')
251
+ end
252
+
253
+ if !@min_advance_days.nil? && @min_advance_days < 0
254
+ invalid_properties.push('invalid value for "min_advance_days", must be greater than or equal to 0.')
255
+ end
256
+
257
+ if !@max_advance_days.nil? && @max_advance_days > 500
258
+ invalid_properties.push('invalid value for "max_advance_days", must be smaller than or equal to 500.')
259
+ end
260
+
261
+ if !@max_advance_days.nil? && @max_advance_days < 0
262
+ invalid_properties.push('invalid value for "max_advance_days", must be greater than or equal to 0.')
263
+ end
264
+
265
+ invalid_properties
266
+ end
267
+
268
+ # Check to see if the all the properties in the model are valid
269
+ # @return true if the model is valid
270
+ def valid?
271
+ warn '[DEPRECATED] the `valid?` method is obsolete'
272
+ return false if @start.nil?
273
+ return false if @_end.nil?
274
+ return false if !@available_rooms.nil? && @available_rooms < 0
275
+ return false if !@min_stay.nil? && @min_stay > 365
276
+ return false if !@min_stay.nil? && @min_stay < 0
277
+ return false if !@max_stay.nil? && @max_stay > 365
278
+ return false if !@max_stay.nil? && @max_stay < 0
279
+ return false if !@min_advance_days.nil? && @min_advance_days > 500
280
+ return false if !@min_advance_days.nil? && @min_advance_days < 0
281
+ return false if !@max_advance_days.nil? && @max_advance_days > 500
282
+ return false if !@max_advance_days.nil? && @max_advance_days < 0
283
+ true
284
+ end
285
+
286
+ # Custom attribute writer method with validation
287
+ # @param [Object] start Value to be assigned
288
+ def start=(start)
289
+ if start.nil?
290
+ fail ArgumentError, 'start cannot be nil'
291
+ end
292
+
293
+ @start = start
294
+ end
295
+
296
+ # Custom attribute writer method with validation
297
+ # @param [Object] _end Value to be assigned
298
+ def _end=(_end)
299
+ if _end.nil?
300
+ fail ArgumentError, '_end cannot be nil'
301
+ end
302
+
303
+ @_end = _end
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] available_rooms Value to be assigned
308
+ def available_rooms=(available_rooms)
309
+ if available_rooms.nil?
310
+ fail ArgumentError, 'available_rooms cannot be nil'
311
+ end
312
+
313
+ if available_rooms < 0
314
+ fail ArgumentError, 'invalid value for "available_rooms", must be greater than or equal to 0.'
315
+ end
316
+
317
+ @available_rooms = available_rooms
318
+ end
319
+
320
+ # Custom attribute writer method with validation
321
+ # @param [Object] min_stay Value to be assigned
322
+ def min_stay=(min_stay)
323
+ if min_stay.nil?
324
+ fail ArgumentError, 'min_stay cannot be nil'
325
+ end
326
+
327
+ if min_stay > 365
328
+ fail ArgumentError, 'invalid value for "min_stay", must be smaller than or equal to 365.'
329
+ end
330
+
331
+ if min_stay < 0
332
+ fail ArgumentError, 'invalid value for "min_stay", must be greater than or equal to 0.'
333
+ end
334
+
335
+ @min_stay = min_stay
336
+ end
337
+
338
+ # Custom attribute writer method with validation
339
+ # @param [Object] max_stay Value to be assigned
340
+ def max_stay=(max_stay)
341
+ if max_stay.nil?
342
+ fail ArgumentError, 'max_stay cannot be nil'
343
+ end
344
+
345
+ if max_stay > 365
346
+ fail ArgumentError, 'invalid value for "max_stay", must be smaller than or equal to 365.'
347
+ end
348
+
349
+ if max_stay < 0
350
+ fail ArgumentError, 'invalid value for "max_stay", must be greater than or equal to 0.'
351
+ end
352
+
353
+ @max_stay = max_stay
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] min_advance_days Value to be assigned
358
+ def min_advance_days=(min_advance_days)
359
+ if min_advance_days.nil?
360
+ fail ArgumentError, 'min_advance_days cannot be nil'
361
+ end
362
+
363
+ if min_advance_days > 500
364
+ fail ArgumentError, 'invalid value for "min_advance_days", must be smaller than or equal to 500.'
365
+ end
366
+
367
+ if min_advance_days < 0
368
+ fail ArgumentError, 'invalid value for "min_advance_days", must be greater than or equal to 0.'
369
+ end
370
+
371
+ @min_advance_days = min_advance_days
372
+ end
373
+
374
+ # Custom attribute writer method with validation
375
+ # @param [Object] max_advance_days Value to be assigned
376
+ def max_advance_days=(max_advance_days)
377
+ if max_advance_days.nil?
378
+ fail ArgumentError, 'max_advance_days cannot be nil'
379
+ end
380
+
381
+ if max_advance_days > 500
382
+ fail ArgumentError, 'invalid value for "max_advance_days", must be smaller than or equal to 500.'
383
+ end
384
+
385
+ if max_advance_days < 0
386
+ fail ArgumentError, 'invalid value for "max_advance_days", must be greater than or equal to 0.'
387
+ end
388
+
389
+ @max_advance_days = max_advance_days
390
+ end
391
+
392
+ # Checks equality by comparing each attribute.
393
+ # @param [Object] Object to be compared
394
+ def ==(o)
395
+ return true if self.equal?(o)
396
+ self.class == o.class &&
397
+ room_type_code == o.room_type_code &&
398
+ rate_plan_code == o.rate_plan_code &&
399
+ start == o.start &&
400
+ _end == o._end &&
401
+ available_rooms == o.available_rooms &&
402
+ price == o.price &&
403
+ occupancy_prices == o.occupancy_prices &&
404
+ child_prices == o.child_prices &&
405
+ currency == o.currency &&
406
+ min_stay == o.min_stay &&
407
+ max_stay == o.max_stay &&
408
+ stop_sell == o.stop_sell &&
409
+ closed_to_arrival == o.closed_to_arrival &&
410
+ closed_to_departure == o.closed_to_departure &&
411
+ min_advance_days == o.min_advance_days &&
412
+ max_advance_days == o.max_advance_days
413
+ end
414
+
415
+ # @see the `==` method
416
+ # @param [Object] Object to be compared
417
+ def eql?(o)
418
+ self == o
419
+ end
420
+
421
+ # Calculates hash code according to all attributes.
422
+ # @return [Integer] Hash code
423
+ def hash
424
+ [room_type_code, rate_plan_code, start, _end, available_rooms, price, occupancy_prices, child_prices, currency, min_stay, max_stay, stop_sell, closed_to_arrival, closed_to_departure, min_advance_days, max_advance_days].hash
425
+ end
426
+
427
+ # Builds the object from hash
428
+ # @param [Hash] attributes Model attributes in the form of hash
429
+ # @return [Object] Returns the model itself
430
+ def self.build_from_hash(attributes)
431
+ return nil unless attributes.is_a?(Hash)
432
+ attributes = attributes.transform_keys(&:to_sym)
433
+ transformed_hash = {}
434
+ openapi_types.each_pair do |key, type|
435
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
436
+ transformed_hash["#{key}"] = nil
437
+ elsif type =~ /\AArray<(.*)>/i
438
+ # check to ensure the input is an array given that the attribute
439
+ # is documented as an array but the input is not
440
+ if attributes[attribute_map[key]].is_a?(Array)
441
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
442
+ end
443
+ elsif !attributes[attribute_map[key]].nil?
444
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
445
+ end
446
+ end
447
+ new(transformed_hash)
448
+ end
449
+
450
+ # Returns the object in the form of hash
451
+ # @return [Hash] Returns the object in the form of hash
452
+ def to_hash
453
+ hash = {}
454
+ self.class.attribute_map.each_pair do |attr, param|
455
+ value = self.send(attr)
456
+ if value.nil?
457
+ is_nullable = self.class.openapi_nullable.include?(attr)
458
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
459
+ end
460
+
461
+ hash[param] = _to_hash(value)
462
+ end
463
+ hash
464
+ end
465
+
466
+ end
467
+
468
+ end