repull 0.2.60 → 0.2.61

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.
@@ -0,0 +1,679 @@
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 Airbnb reservation: the unified reservation (the same record as `GET /v1/reservations/{reservationId}`, as stored), the connected account and payout, and `airbnb` — the row `GET /v1/channels/airbnb/reservations` returns for it.
18
+ class AirbnbReservationDetail < ApiModelBase
19
+ # The unified reservation id (same as `reservationId`).
20
+ attr_accessor :id
21
+
22
+ # The unified reservation id: `GET /v1/reservations/{id}`.
23
+ attr_accessor :reservation_id
24
+
25
+ attr_accessor :confirmation_code
26
+
27
+ # The Repull listing id.
28
+ attr_accessor :listing_id
29
+
30
+ # Airbnb's own listing id.
31
+ attr_accessor :airbnb_listing_id
32
+
33
+ # The connected Airbnb account (host id, as a string).
34
+ attr_accessor :account_id
35
+
36
+ attr_accessor :account_name
37
+
38
+ attr_accessor :guest_id
39
+
40
+ attr_accessor :platform
41
+
42
+ attr_accessor :pms_source
43
+
44
+ attr_accessor :booking_reservation_number
45
+
46
+ attr_accessor :unit_external_id
47
+
48
+ attr_accessor :unit_name
49
+
50
+ # Airbnb's status as stored on the reservation (`accept`, `cancelled`, `decline`, `pending_voided`, …). The normalised value is `airbnb.status`.
51
+ attr_accessor :status
52
+
53
+ attr_accessor :payment_status
54
+
55
+ attr_accessor :check_in
56
+
57
+ attr_accessor :check_out
58
+
59
+ # Guest counts: `numberOfGuests`, `numberOfAdults`, `numberOfChildren`, `numberOfInfants`, `numberOfPets`.
60
+ attr_accessor :guest_details
61
+
62
+ attr_accessor :guest_name
63
+
64
+ attr_accessor :guest_count
65
+
66
+ # Total as a decimal string, in `currency`.
67
+ attr_accessor :total_price
68
+
69
+ attr_accessor :currency
70
+
71
+ # What the host is expected to receive, in `payoutCurrency`.
72
+ attr_accessor :payout
73
+
74
+ attr_accessor :payout_currency
75
+
76
+ # Nightly rates, fees, taxes, discounts, `hostPayout`.
77
+ attr_accessor :price_breakdown
78
+
79
+ attr_accessor :custom_fields
80
+
81
+ attr_accessor :cancellation_policy
82
+
83
+ attr_accessor :cancellation_reason
84
+
85
+ attr_accessor :cancellation_date
86
+
87
+ attr_accessor :host_notes
88
+
89
+ attr_accessor :guest_notes
90
+
91
+ attr_accessor :internal_notes
92
+
93
+ attr_accessor :time_zone
94
+
95
+ attr_accessor :check_in_time
96
+
97
+ attr_accessor :check_out_time
98
+
99
+ attr_accessor :customer_id
100
+
101
+ # Use `accountId`.
102
+ attr_accessor :airbnb_host_id
103
+
104
+ attr_accessor :booked_at
105
+
106
+ # The Airbnb record, in the list endpoint's shape. Null only while it is still being imported.
107
+ attr_accessor :airbnb
108
+
109
+ # Attribute mapping from ruby-style variable name to JSON key.
110
+ def self.attribute_map
111
+ {
112
+ :'id' => :'id',
113
+ :'reservation_id' => :'reservationId',
114
+ :'confirmation_code' => :'confirmationCode',
115
+ :'listing_id' => :'listingId',
116
+ :'airbnb_listing_id' => :'airbnbListingId',
117
+ :'account_id' => :'accountId',
118
+ :'account_name' => :'accountName',
119
+ :'guest_id' => :'guestId',
120
+ :'platform' => :'platform',
121
+ :'pms_source' => :'pmsSource',
122
+ :'booking_reservation_number' => :'bookingReservationNumber',
123
+ :'unit_external_id' => :'unitExternalId',
124
+ :'unit_name' => :'unitName',
125
+ :'status' => :'status',
126
+ :'payment_status' => :'paymentStatus',
127
+ :'check_in' => :'checkIn',
128
+ :'check_out' => :'checkOut',
129
+ :'guest_details' => :'guestDetails',
130
+ :'guest_name' => :'guestName',
131
+ :'guest_count' => :'guestCount',
132
+ :'total_price' => :'totalPrice',
133
+ :'currency' => :'currency',
134
+ :'payout' => :'payout',
135
+ :'payout_currency' => :'payoutCurrency',
136
+ :'price_breakdown' => :'priceBreakdown',
137
+ :'custom_fields' => :'customFields',
138
+ :'cancellation_policy' => :'cancellationPolicy',
139
+ :'cancellation_reason' => :'cancellationReason',
140
+ :'cancellation_date' => :'cancellationDate',
141
+ :'host_notes' => :'hostNotes',
142
+ :'guest_notes' => :'guestNotes',
143
+ :'internal_notes' => :'internalNotes',
144
+ :'time_zone' => :'timeZone',
145
+ :'check_in_time' => :'checkInTime',
146
+ :'check_out_time' => :'checkOutTime',
147
+ :'customer_id' => :'customerId',
148
+ :'airbnb_host_id' => :'airbnbHostId',
149
+ :'booked_at' => :'bookedAt',
150
+ :'airbnb' => :'airbnb'
151
+ }
152
+ end
153
+
154
+ # Returns attribute mapping this model knows about
155
+ def self.acceptable_attribute_map
156
+ attribute_map
157
+ end
158
+
159
+ # Returns all the JSON keys this model knows about
160
+ def self.acceptable_attributes
161
+ acceptable_attribute_map.values
162
+ end
163
+
164
+ # Attribute type mapping.
165
+ def self.openapi_types
166
+ {
167
+ :'id' => :'String',
168
+ :'reservation_id' => :'String',
169
+ :'confirmation_code' => :'String',
170
+ :'listing_id' => :'String',
171
+ :'airbnb_listing_id' => :'String',
172
+ :'account_id' => :'String',
173
+ :'account_name' => :'String',
174
+ :'guest_id' => :'String',
175
+ :'platform' => :'String',
176
+ :'pms_source' => :'String',
177
+ :'booking_reservation_number' => :'String',
178
+ :'unit_external_id' => :'String',
179
+ :'unit_name' => :'String',
180
+ :'status' => :'String',
181
+ :'payment_status' => :'String',
182
+ :'check_in' => :'Date',
183
+ :'check_out' => :'Date',
184
+ :'guest_details' => :'Hash<String, Object>',
185
+ :'guest_name' => :'String',
186
+ :'guest_count' => :'Integer',
187
+ :'total_price' => :'String',
188
+ :'currency' => :'String',
189
+ :'payout' => :'Float',
190
+ :'payout_currency' => :'String',
191
+ :'price_breakdown' => :'Hash<String, Object>',
192
+ :'custom_fields' => :'Hash<String, Object>',
193
+ :'cancellation_policy' => :'String',
194
+ :'cancellation_reason' => :'String',
195
+ :'cancellation_date' => :'Time',
196
+ :'host_notes' => :'String',
197
+ :'guest_notes' => :'String',
198
+ :'internal_notes' => :'String',
199
+ :'time_zone' => :'String',
200
+ :'check_in_time' => :'String',
201
+ :'check_out_time' => :'String',
202
+ :'customer_id' => :'String',
203
+ :'airbnb_host_id' => :'String',
204
+ :'booked_at' => :'Time',
205
+ :'airbnb' => :'AirbnbReservation'
206
+ }
207
+ end
208
+
209
+ # List of attributes with nullable: true
210
+ def self.openapi_nullable
211
+ Set.new([
212
+ :'airbnb_listing_id',
213
+ :'account_id',
214
+ :'account_name',
215
+ :'guest_id',
216
+ :'platform',
217
+ :'pms_source',
218
+ :'booking_reservation_number',
219
+ :'unit_external_id',
220
+ :'unit_name',
221
+ :'payment_status',
222
+ :'guest_details',
223
+ :'guest_name',
224
+ :'guest_count',
225
+ :'total_price',
226
+ :'currency',
227
+ :'payout',
228
+ :'payout_currency',
229
+ :'price_breakdown',
230
+ :'custom_fields',
231
+ :'cancellation_policy',
232
+ :'cancellation_reason',
233
+ :'cancellation_date',
234
+ :'host_notes',
235
+ :'guest_notes',
236
+ :'internal_notes',
237
+ :'time_zone',
238
+ :'check_in_time',
239
+ :'check_out_time',
240
+ :'customer_id',
241
+ :'airbnb_host_id',
242
+ :'booked_at',
243
+ :'airbnb'
244
+ ])
245
+ end
246
+
247
+ # Initializes the object
248
+ # @param [Hash] attributes Model attributes in the form of hash
249
+ def initialize(attributes = {})
250
+ if (!attributes.is_a?(Hash))
251
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbReservationDetail` initialize method"
252
+ end
253
+
254
+ # check to see if the attribute exists and convert string to symbol for hash key
255
+ acceptable_attribute_map = self.class.acceptable_attribute_map
256
+ attributes = attributes.each_with_object({}) { |(k, v), h|
257
+ if (!acceptable_attribute_map.key?(k.to_sym))
258
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbReservationDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
259
+ end
260
+ h[k.to_sym] = v
261
+ }
262
+
263
+ if attributes.key?(:'id')
264
+ self.id = attributes[:'id']
265
+ else
266
+ self.id = nil
267
+ end
268
+
269
+ if attributes.key?(:'reservation_id')
270
+ self.reservation_id = attributes[:'reservation_id']
271
+ else
272
+ self.reservation_id = nil
273
+ end
274
+
275
+ if attributes.key?(:'confirmation_code')
276
+ self.confirmation_code = attributes[:'confirmation_code']
277
+ else
278
+ self.confirmation_code = nil
279
+ end
280
+
281
+ if attributes.key?(:'listing_id')
282
+ self.listing_id = attributes[:'listing_id']
283
+ else
284
+ self.listing_id = nil
285
+ end
286
+
287
+ if attributes.key?(:'airbnb_listing_id')
288
+ self.airbnb_listing_id = attributes[:'airbnb_listing_id']
289
+ else
290
+ self.airbnb_listing_id = nil
291
+ end
292
+
293
+ if attributes.key?(:'account_id')
294
+ self.account_id = attributes[:'account_id']
295
+ else
296
+ self.account_id = nil
297
+ end
298
+
299
+ if attributes.key?(:'account_name')
300
+ self.account_name = attributes[:'account_name']
301
+ else
302
+ self.account_name = nil
303
+ end
304
+
305
+ if attributes.key?(:'guest_id')
306
+ self.guest_id = attributes[:'guest_id']
307
+ end
308
+
309
+ if attributes.key?(:'platform')
310
+ self.platform = attributes[:'platform']
311
+ end
312
+
313
+ if attributes.key?(:'pms_source')
314
+ self.pms_source = attributes[:'pms_source']
315
+ end
316
+
317
+ if attributes.key?(:'booking_reservation_number')
318
+ self.booking_reservation_number = attributes[:'booking_reservation_number']
319
+ end
320
+
321
+ if attributes.key?(:'unit_external_id')
322
+ self.unit_external_id = attributes[:'unit_external_id']
323
+ end
324
+
325
+ if attributes.key?(:'unit_name')
326
+ self.unit_name = attributes[:'unit_name']
327
+ end
328
+
329
+ if attributes.key?(:'status')
330
+ self.status = attributes[:'status']
331
+ else
332
+ self.status = nil
333
+ end
334
+
335
+ if attributes.key?(:'payment_status')
336
+ self.payment_status = attributes[:'payment_status']
337
+ end
338
+
339
+ if attributes.key?(:'check_in')
340
+ self.check_in = attributes[:'check_in']
341
+ else
342
+ self.check_in = nil
343
+ end
344
+
345
+ if attributes.key?(:'check_out')
346
+ self.check_out = attributes[:'check_out']
347
+ else
348
+ self.check_out = nil
349
+ end
350
+
351
+ if attributes.key?(:'guest_details')
352
+ if (value = attributes[:'guest_details']).is_a?(Hash)
353
+ self.guest_details = value
354
+ end
355
+ end
356
+
357
+ if attributes.key?(:'guest_name')
358
+ self.guest_name = attributes[:'guest_name']
359
+ else
360
+ self.guest_name = nil
361
+ end
362
+
363
+ if attributes.key?(:'guest_count')
364
+ self.guest_count = attributes[:'guest_count']
365
+ else
366
+ self.guest_count = nil
367
+ end
368
+
369
+ if attributes.key?(:'total_price')
370
+ self.total_price = attributes[:'total_price']
371
+ else
372
+ self.total_price = nil
373
+ end
374
+
375
+ if attributes.key?(:'currency')
376
+ self.currency = attributes[:'currency']
377
+ else
378
+ self.currency = nil
379
+ end
380
+
381
+ if attributes.key?(:'payout')
382
+ self.payout = attributes[:'payout']
383
+ else
384
+ self.payout = nil
385
+ end
386
+
387
+ if attributes.key?(:'payout_currency')
388
+ self.payout_currency = attributes[:'payout_currency']
389
+ else
390
+ self.payout_currency = nil
391
+ end
392
+
393
+ if attributes.key?(:'price_breakdown')
394
+ if (value = attributes[:'price_breakdown']).is_a?(Hash)
395
+ self.price_breakdown = value
396
+ end
397
+ end
398
+
399
+ if attributes.key?(:'custom_fields')
400
+ if (value = attributes[:'custom_fields']).is_a?(Hash)
401
+ self.custom_fields = value
402
+ end
403
+ end
404
+
405
+ if attributes.key?(:'cancellation_policy')
406
+ self.cancellation_policy = attributes[:'cancellation_policy']
407
+ end
408
+
409
+ if attributes.key?(:'cancellation_reason')
410
+ self.cancellation_reason = attributes[:'cancellation_reason']
411
+ end
412
+
413
+ if attributes.key?(:'cancellation_date')
414
+ self.cancellation_date = attributes[:'cancellation_date']
415
+ end
416
+
417
+ if attributes.key?(:'host_notes')
418
+ self.host_notes = attributes[:'host_notes']
419
+ end
420
+
421
+ if attributes.key?(:'guest_notes')
422
+ self.guest_notes = attributes[:'guest_notes']
423
+ end
424
+
425
+ if attributes.key?(:'internal_notes')
426
+ self.internal_notes = attributes[:'internal_notes']
427
+ end
428
+
429
+ if attributes.key?(:'time_zone')
430
+ self.time_zone = attributes[:'time_zone']
431
+ end
432
+
433
+ if attributes.key?(:'check_in_time')
434
+ self.check_in_time = attributes[:'check_in_time']
435
+ end
436
+
437
+ if attributes.key?(:'check_out_time')
438
+ self.check_out_time = attributes[:'check_out_time']
439
+ end
440
+
441
+ if attributes.key?(:'customer_id')
442
+ self.customer_id = attributes[:'customer_id']
443
+ end
444
+
445
+ if attributes.key?(:'airbnb_host_id')
446
+ self.airbnb_host_id = attributes[:'airbnb_host_id']
447
+ end
448
+
449
+ if attributes.key?(:'booked_at')
450
+ self.booked_at = attributes[:'booked_at']
451
+ end
452
+
453
+ if attributes.key?(:'airbnb')
454
+ self.airbnb = attributes[:'airbnb']
455
+ else
456
+ self.airbnb = nil
457
+ end
458
+ end
459
+
460
+ # Show invalid properties with the reasons. Usually used together with valid?
461
+ # @return Array for valid properties with the reasons
462
+ def list_invalid_properties
463
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
464
+ invalid_properties = Array.new
465
+ if @id.nil?
466
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
467
+ end
468
+
469
+ if @reservation_id.nil?
470
+ invalid_properties.push('invalid value for "reservation_id", reservation_id cannot be nil.')
471
+ end
472
+
473
+ if @confirmation_code.nil?
474
+ invalid_properties.push('invalid value for "confirmation_code", confirmation_code cannot be nil.')
475
+ end
476
+
477
+ if @listing_id.nil?
478
+ invalid_properties.push('invalid value for "listing_id", listing_id cannot be nil.')
479
+ end
480
+
481
+ if @status.nil?
482
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
483
+ end
484
+
485
+ if @check_in.nil?
486
+ invalid_properties.push('invalid value for "check_in", check_in cannot be nil.')
487
+ end
488
+
489
+ if @check_out.nil?
490
+ invalid_properties.push('invalid value for "check_out", check_out cannot be nil.')
491
+ end
492
+
493
+ invalid_properties
494
+ end
495
+
496
+ # Check to see if the all the properties in the model are valid
497
+ # @return true if the model is valid
498
+ def valid?
499
+ warn '[DEPRECATED] the `valid?` method is obsolete'
500
+ return false if @id.nil?
501
+ return false if @reservation_id.nil?
502
+ return false if @confirmation_code.nil?
503
+ return false if @listing_id.nil?
504
+ return false if @status.nil?
505
+ return false if @check_in.nil?
506
+ return false if @check_out.nil?
507
+ true
508
+ end
509
+
510
+ # Custom attribute writer method with validation
511
+ # @param [Object] id Value to be assigned
512
+ def id=(id)
513
+ if id.nil?
514
+ fail ArgumentError, 'id cannot be nil'
515
+ end
516
+
517
+ @id = id
518
+ end
519
+
520
+ # Custom attribute writer method with validation
521
+ # @param [Object] reservation_id Value to be assigned
522
+ def reservation_id=(reservation_id)
523
+ if reservation_id.nil?
524
+ fail ArgumentError, 'reservation_id cannot be nil'
525
+ end
526
+
527
+ @reservation_id = reservation_id
528
+ end
529
+
530
+ # Custom attribute writer method with validation
531
+ # @param [Object] confirmation_code Value to be assigned
532
+ def confirmation_code=(confirmation_code)
533
+ if confirmation_code.nil?
534
+ fail ArgumentError, 'confirmation_code cannot be nil'
535
+ end
536
+
537
+ @confirmation_code = confirmation_code
538
+ end
539
+
540
+ # Custom attribute writer method with validation
541
+ # @param [Object] listing_id Value to be assigned
542
+ def listing_id=(listing_id)
543
+ if listing_id.nil?
544
+ fail ArgumentError, 'listing_id cannot be nil'
545
+ end
546
+
547
+ @listing_id = listing_id
548
+ end
549
+
550
+ # Custom attribute writer method with validation
551
+ # @param [Object] status Value to be assigned
552
+ def status=(status)
553
+ if status.nil?
554
+ fail ArgumentError, 'status cannot be nil'
555
+ end
556
+
557
+ @status = status
558
+ end
559
+
560
+ # Custom attribute writer method with validation
561
+ # @param [Object] check_in Value to be assigned
562
+ def check_in=(check_in)
563
+ if check_in.nil?
564
+ fail ArgumentError, 'check_in cannot be nil'
565
+ end
566
+
567
+ @check_in = check_in
568
+ end
569
+
570
+ # Custom attribute writer method with validation
571
+ # @param [Object] check_out Value to be assigned
572
+ def check_out=(check_out)
573
+ if check_out.nil?
574
+ fail ArgumentError, 'check_out cannot be nil'
575
+ end
576
+
577
+ @check_out = check_out
578
+ end
579
+
580
+ # Checks equality by comparing each attribute.
581
+ # @param [Object] Object to be compared
582
+ def ==(o)
583
+ return true if self.equal?(o)
584
+ self.class == o.class &&
585
+ id == o.id &&
586
+ reservation_id == o.reservation_id &&
587
+ confirmation_code == o.confirmation_code &&
588
+ listing_id == o.listing_id &&
589
+ airbnb_listing_id == o.airbnb_listing_id &&
590
+ account_id == o.account_id &&
591
+ account_name == o.account_name &&
592
+ guest_id == o.guest_id &&
593
+ platform == o.platform &&
594
+ pms_source == o.pms_source &&
595
+ booking_reservation_number == o.booking_reservation_number &&
596
+ unit_external_id == o.unit_external_id &&
597
+ unit_name == o.unit_name &&
598
+ status == o.status &&
599
+ payment_status == o.payment_status &&
600
+ check_in == o.check_in &&
601
+ check_out == o.check_out &&
602
+ guest_details == o.guest_details &&
603
+ guest_name == o.guest_name &&
604
+ guest_count == o.guest_count &&
605
+ total_price == o.total_price &&
606
+ currency == o.currency &&
607
+ payout == o.payout &&
608
+ payout_currency == o.payout_currency &&
609
+ price_breakdown == o.price_breakdown &&
610
+ custom_fields == o.custom_fields &&
611
+ cancellation_policy == o.cancellation_policy &&
612
+ cancellation_reason == o.cancellation_reason &&
613
+ cancellation_date == o.cancellation_date &&
614
+ host_notes == o.host_notes &&
615
+ guest_notes == o.guest_notes &&
616
+ internal_notes == o.internal_notes &&
617
+ time_zone == o.time_zone &&
618
+ check_in_time == o.check_in_time &&
619
+ check_out_time == o.check_out_time &&
620
+ customer_id == o.customer_id &&
621
+ airbnb_host_id == o.airbnb_host_id &&
622
+ booked_at == o.booked_at &&
623
+ airbnb == o.airbnb
624
+ end
625
+
626
+ # @see the `==` method
627
+ # @param [Object] Object to be compared
628
+ def eql?(o)
629
+ self == o
630
+ end
631
+
632
+ # Calculates hash code according to all attributes.
633
+ # @return [Integer] Hash code
634
+ def hash
635
+ [id, reservation_id, confirmation_code, listing_id, airbnb_listing_id, account_id, account_name, guest_id, platform, pms_source, booking_reservation_number, unit_external_id, unit_name, status, payment_status, check_in, check_out, guest_details, guest_name, guest_count, total_price, currency, payout, payout_currency, price_breakdown, custom_fields, cancellation_policy, cancellation_reason, cancellation_date, host_notes, guest_notes, internal_notes, time_zone, check_in_time, check_out_time, customer_id, airbnb_host_id, booked_at, airbnb].hash
636
+ end
637
+
638
+ # Builds the object from hash
639
+ # @param [Hash] attributes Model attributes in the form of hash
640
+ # @return [Object] Returns the model itself
641
+ def self.build_from_hash(attributes)
642
+ return nil unless attributes.is_a?(Hash)
643
+ attributes = attributes.transform_keys(&:to_sym)
644
+ transformed_hash = {}
645
+ openapi_types.each_pair do |key, type|
646
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
647
+ transformed_hash["#{key}"] = nil
648
+ elsif type =~ /\AArray<(.*)>/i
649
+ # check to ensure the input is an array given that the attribute
650
+ # is documented as an array but the input is not
651
+ if attributes[attribute_map[key]].is_a?(Array)
652
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
653
+ end
654
+ elsif !attributes[attribute_map[key]].nil?
655
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
656
+ end
657
+ end
658
+ new(transformed_hash)
659
+ end
660
+
661
+ # Returns the object in the form of hash
662
+ # @return [Hash] Returns the object in the form of hash
663
+ def to_hash
664
+ hash = {}
665
+ self.class.attribute_map.each_pair do |attr, param|
666
+ value = self.send(attr)
667
+ if value.nil?
668
+ is_nullable = self.class.openapi_nullable.include?(attr)
669
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
670
+ end
671
+
672
+ hash[param] = _to_hash(value)
673
+ end
674
+ hash
675
+ end
676
+
677
+ end
678
+
679
+ end