repull 0.2.50 → 0.2.51

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.
@@ -32,9 +32,12 @@ module Repull
32
32
  # Guest country (from profile metadata or address).
33
33
  attr_accessor :country
34
34
 
35
- # Primary phone contact (or first non-primary if no primary set).
35
+ # Primary phone contact (or first non-primary if no primary set). May be an Airbnb relay number — check `phoneType`.
36
36
  attr_accessor :phone
37
37
 
38
+ # `airbnb_relay` when `phone` is a temporary Airbnb relay number (SMS only, expires 48h after checkout, shared across hosts, never a guest identifier); `guest` otherwise; `null` when there is no phone.
39
+ attr_accessor :phone_type
40
+
38
41
  # Primary email contact.
39
42
  attr_accessor :email
40
43
 
@@ -50,6 +53,28 @@ module Repull
50
53
 
51
54
  attr_accessor :created_at
52
55
 
56
+ class EnumAttributeValidator
57
+ attr_reader :datatype
58
+ attr_reader :allowable_values
59
+
60
+ def initialize(datatype, allowable_values)
61
+ @allowable_values = allowable_values.map do |value|
62
+ case datatype.to_s
63
+ when /Integer/i
64
+ value.to_i
65
+ when /Float/i
66
+ value.to_f
67
+ else
68
+ value
69
+ end
70
+ end
71
+ end
72
+
73
+ def valid?(value)
74
+ !value || allowable_values.include?(value)
75
+ end
76
+ end
77
+
53
78
  # Attribute mapping from ruby-style variable name to JSON key.
54
79
  def self.attribute_map
55
80
  {
@@ -60,6 +85,7 @@ module Repull
60
85
  :'language' => :'language',
61
86
  :'country' => :'country',
62
87
  :'phone' => :'phone',
88
+ :'phone_type' => :'phoneType',
63
89
  :'email' => :'email',
64
90
  :'total_reservations' => :'totalReservations',
65
91
  :'total_revenue' => :'totalRevenue',
@@ -89,6 +115,7 @@ module Repull
89
115
  :'language' => :'String',
90
116
  :'country' => :'String',
91
117
  :'phone' => :'String',
118
+ :'phone_type' => :'GuestPhoneType',
92
119
  :'email' => :'String',
93
120
  :'total_reservations' => :'Integer',
94
121
  :'total_revenue' => :'String',
@@ -105,6 +132,7 @@ module Repull
105
132
  :'language',
106
133
  :'country',
107
134
  :'phone',
135
+ :'phone_type',
108
136
  :'email',
109
137
  :'last_stayed_at',
110
138
  :'first_stayed_at',
@@ -155,6 +183,10 @@ module Repull
155
183
  self.phone = attributes[:'phone']
156
184
  end
157
185
 
186
+ if attributes.key?(:'phone_type')
187
+ self.phone_type = attributes[:'phone_type']
188
+ end
189
+
158
190
  if attributes.key?(:'email')
159
191
  self.email = attributes[:'email']
160
192
  end
@@ -207,6 +239,7 @@ module Repull
207
239
  language == o.language &&
208
240
  country == o.country &&
209
241
  phone == o.phone &&
242
+ phone_type == o.phone_type &&
210
243
  email == o.email &&
211
244
  total_reservations == o.total_reservations &&
212
245
  total_revenue == o.total_revenue &&
@@ -224,7 +257,7 @@ module Repull
224
257
  # Calculates hash code according to all attributes.
225
258
  # @return [Integer] Hash code
226
259
  def hash
227
- [id, display_name, display_name_long, avatar_url, language, country, phone, email, total_reservations, total_revenue, last_stayed_at, first_stayed_at, created_at].hash
260
+ [id, display_name, display_name_long, avatar_url, language, country, phone, phone_type, email, total_reservations, total_revenue, last_stayed_at, first_stayed_at, created_at].hash
228
261
  end
229
262
 
230
263
  # Builds the object from hash
@@ -27,6 +27,31 @@ module Repull
27
27
 
28
28
  attr_accessor :last_used
29
29
 
30
+ # Phone contacts only: `airbnb_relay` when this is a temporary Airbnb relay number (SMS only, expires 48h after checkout, shared across hosts, never a guest identifier); `guest` otherwise.
31
+ attr_accessor :phone_type
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
30
55
  # Attribute mapping from ruby-style variable name to JSON key.
31
56
  def self.attribute_map
32
57
  {
@@ -34,7 +59,8 @@ module Repull
34
59
  :'value' => :'value',
35
60
  :'verified' => :'verified',
36
61
  :'is_primary' => :'isPrimary',
37
- :'last_used' => :'lastUsed'
62
+ :'last_used' => :'lastUsed',
63
+ :'phone_type' => :'phoneType'
38
64
  }
39
65
  end
40
66
 
@@ -55,14 +81,15 @@ module Repull
55
81
  :'value' => :'String',
56
82
  :'verified' => :'Boolean',
57
83
  :'is_primary' => :'Boolean',
58
- :'last_used' => :'Time'
84
+ :'last_used' => :'Time',
85
+ :'phone_type' => :'GuestPhoneType'
59
86
  }
60
87
  end
61
88
 
62
89
  # List of attributes with nullable: true
63
90
  def self.openapi_nullable
64
91
  Set.new([
65
- :'last_used'
92
+ :'last_used',
66
93
  ])
67
94
  end
68
95
 
@@ -101,6 +128,10 @@ module Repull
101
128
  if attributes.key?(:'last_used')
102
129
  self.last_used = attributes[:'last_used']
103
130
  end
131
+
132
+ if attributes.key?(:'phone_type')
133
+ self.phone_type = attributes[:'phone_type']
134
+ end
104
135
  end
105
136
 
106
137
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -127,7 +158,8 @@ module Repull
127
158
  value == o.value &&
128
159
  verified == o.verified &&
129
160
  is_primary == o.is_primary &&
130
- last_used == o.last_used
161
+ last_used == o.last_used &&
162
+ phone_type == o.phone_type
131
163
  end
132
164
 
133
165
  # @see the `==` method
@@ -139,7 +171,7 @@ module Repull
139
171
  # Calculates hash code according to all attributes.
140
172
  # @return [Integer] Hash code
141
173
  def hash
142
- [type, value, verified, is_primary, last_used].hash
174
+ [type, value, verified, is_primary, last_used, phone_type].hash
143
175
  end
144
176
 
145
177
  # Builds the object from hash
@@ -0,0 +1,40 @@
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
+ class GuestPhoneType
18
+ AIRBNB_RELAY = "airbnb_relay".freeze
19
+ GUEST = "guest".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [AIRBNB_RELAY, GUEST].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if GuestPhoneType.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #GuestPhoneType"
38
+ end
39
+ end
40
+ end
@@ -28,8 +28,12 @@ module Repull
28
28
 
29
29
  attr_accessor :country
30
30
 
31
+ # Primary phone contact. May be an Airbnb relay number — check `phoneType`.
31
32
  attr_accessor :phone
32
33
 
34
+ # `airbnb_relay` when `phone` is a temporary Airbnb relay number; `guest` otherwise; `null` when there is no phone.
35
+ attr_accessor :phone_type
36
+
33
37
  attr_accessor :email
34
38
 
35
39
  attr_accessor :total_reservations
@@ -58,6 +62,28 @@ module Repull
58
62
 
59
63
  attr_accessor :reservations_summary
60
64
 
65
+ class EnumAttributeValidator
66
+ attr_reader :datatype
67
+ attr_reader :allowable_values
68
+
69
+ def initialize(datatype, allowable_values)
70
+ @allowable_values = allowable_values.map do |value|
71
+ case datatype.to_s
72
+ when /Integer/i
73
+ value.to_i
74
+ when /Float/i
75
+ value.to_f
76
+ else
77
+ value
78
+ end
79
+ end
80
+ end
81
+
82
+ def valid?(value)
83
+ !value || allowable_values.include?(value)
84
+ end
85
+ end
86
+
61
87
  # Attribute mapping from ruby-style variable name to JSON key.
62
88
  def self.attribute_map
63
89
  {
@@ -68,6 +94,7 @@ module Repull
68
94
  :'language' => :'language',
69
95
  :'country' => :'country',
70
96
  :'phone' => :'phone',
97
+ :'phone_type' => :'phoneType',
71
98
  :'email' => :'email',
72
99
  :'total_reservations' => :'totalReservations',
73
100
  :'total_revenue' => :'totalRevenue',
@@ -104,6 +131,7 @@ module Repull
104
131
  :'language' => :'String',
105
132
  :'country' => :'String',
106
133
  :'phone' => :'String',
134
+ :'phone_type' => :'GuestPhoneType',
107
135
  :'email' => :'String',
108
136
  :'total_reservations' => :'Integer',
109
137
  :'total_revenue' => :'String',
@@ -127,6 +155,7 @@ module Repull
127
155
  :'language',
128
156
  :'country',
129
157
  :'phone',
158
+ :'phone_type',
130
159
  :'email',
131
160
  :'currency',
132
161
  :'blacklisted_reason',
@@ -180,6 +209,10 @@ module Repull
180
209
  self.phone = attributes[:'phone']
181
210
  end
182
211
 
212
+ if attributes.key?(:'phone_type')
213
+ self.phone_type = attributes[:'phone_type']
214
+ end
215
+
183
216
  if attributes.key?(:'email')
184
217
  self.email = attributes[:'email']
185
218
  end
@@ -266,6 +299,7 @@ module Repull
266
299
  language == o.language &&
267
300
  country == o.country &&
268
301
  phone == o.phone &&
302
+ phone_type == o.phone_type &&
269
303
  email == o.email &&
270
304
  total_reservations == o.total_reservations &&
271
305
  total_revenue == o.total_revenue &&
@@ -290,7 +324,7 @@ module Repull
290
324
  # Calculates hash code according to all attributes.
291
325
  # @return [Integer] Hash code
292
326
  def hash
293
- [id, display_name, display_name_long, avatar_url, language, country, phone, email, total_reservations, total_revenue, currency, is_blacklisted, blacklisted_reason, risk_level, verification_level, created_at, contacts, flags, notes, reservations_summary].hash
327
+ [id, display_name, display_name_long, avatar_url, language, country, phone, phone_type, email, total_reservations, total_revenue, currency, is_blacklisted, blacklisted_reason, risk_level, verification_level, created_at, contacts, flags, notes, reservations_summary].hash
294
328
  end
295
329
 
296
330
  # Builds the object from hash
@@ -23,10 +23,10 @@ module Repull
23
23
 
24
24
  attr_accessor :direction
25
25
 
26
- # Delivery state. Inbound messages are `received`. An outbound message is `sending` while it is queued to the channel, `sent` once the channel accepted it, or `failed`. Only `sent` (or `received`) means the guest can see it.
26
+ # Delivery state. Inbound messages are `received`. An outbound message is `sending` while it is handed to the channel, `queued` when the channel was busy and Repull is still delivering it in the background (Vrbo), `sent` once the channel accepted it, or `failed`. Only `sent` (or `received`) means the guest can see it. A change from `queued` is sent as `conversation.message.status_changed`.
27
27
  attr_accessor :status
28
28
 
29
- # Why a message is still `sending` or `failed`, in plain words. `null` otherwise.
29
+ # Why a message is still `sending` or `queued`, or why it `failed`, in plain words. `null` otherwise.
30
30
  attr_accessor :status_reason
31
31
 
32
32
  # Free-form sender role from the channel (e.g. `guest`, `host`, `system`, `airbnb`). Use `direction` for binary inbound/outbound logic.
@@ -82,6 +82,9 @@ module Repull
82
82
  # Door codes for the stay from the PMS's lock manager (today: Guesty Locks Manager), refreshed about every 30 minutes for stays checking in within 14 days that have not checked out. `null` when the reservation's codes are not read from a PMS. `[]` when they are and there is none yet, and for a cancelled stay.
83
83
  attr_accessor :access_codes
84
84
 
85
+ # Airbnb reservations only, when Airbnb sends it: the door code Airbnb suggests — the last 4 digits of the booker's verified phone number, or random digits when there is none. Use it instead of deriving a code from the guest's phone, which Airbnb no longer shares. Omitted on every other reservation.
86
+ attr_accessor :suggested_door_code
87
+
85
88
  # Inline guest summary. May be undefined for owner-blocks / pre-arrival rows.
86
89
  attr_accessor :primary_guest
87
90
 
@@ -138,6 +141,7 @@ module Repull
138
141
  :'unit' => :'unit',
139
142
  :'pms_reservation_id' => :'pmsReservationId',
140
143
  :'access_codes' => :'accessCodes',
144
+ :'suggested_door_code' => :'suggestedDoorCode',
141
145
  :'primary_guest' => :'primaryGuest',
142
146
  :'occupancy' => :'occupancy',
143
147
  :'financials' => :'financials',
@@ -187,6 +191,7 @@ module Repull
187
191
  :'unit' => :'ReservationUnit',
188
192
  :'pms_reservation_id' => :'String',
189
193
  :'access_codes' => :'Array<ReservationAccessCode>',
194
+ :'suggested_door_code' => :'String',
190
195
  :'primary_guest' => :'ReservationPrimaryGuest',
191
196
  :'occupancy' => :'ReservationOccupancy',
192
197
  :'financials' => :'ReservationFinancials',
@@ -343,6 +348,10 @@ module Repull
343
348
  end
344
349
  end
345
350
 
351
+ if attributes.key?(:'suggested_door_code')
352
+ self.suggested_door_code = attributes[:'suggested_door_code']
353
+ end
354
+
346
355
  if attributes.key?(:'primary_guest')
347
356
  self.primary_guest = attributes[:'primary_guest']
348
357
  end
@@ -553,6 +562,7 @@ module Repull
553
562
  unit == o.unit &&
554
563
  pms_reservation_id == o.pms_reservation_id &&
555
564
  access_codes == o.access_codes &&
565
+ suggested_door_code == o.suggested_door_code &&
556
566
  primary_guest == o.primary_guest &&
557
567
  occupancy == o.occupancy &&
558
568
  financials == o.financials &&
@@ -574,7 +584,7 @@ module Repull
574
584
  # Calculates hash code according to all attributes.
575
585
  # @return [Integer] Hash code
576
586
  def hash
577
- [account, id, listing_id, listing_name, guest_id, check_in, check_out, check_in_time, check_out_time, guest_notes, conversation_id, external_thread_id, inquiry_id, status, status_detail, pending_reason, respond_by, source, platform, confirmation_code, unit, pms_reservation_id, access_codes, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
587
+ [account, id, listing_id, listing_name, guest_id, check_in, check_out, check_in_time, check_out_time, guest_notes, conversation_id, external_thread_id, inquiry_id, status, status_detail, pending_reason, respond_by, source, platform, confirmation_code, unit, pms_reservation_id, access_codes, suggested_door_code, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
578
588
  end
579
589
 
580
590
  # Builds the object from hash
@@ -26,12 +26,40 @@ module Repull
26
26
  # Primary email contact (or first non-primary if no primary set).
27
27
  attr_accessor :email
28
28
 
29
- # Primary phone contact (or first non-primary if no primary set).
29
+ # Primary phone contact (or first non-primary if no primary set). For an Airbnb stay this may be an Airbnb relay number — check `phoneType`.
30
30
  attr_accessor :phone
31
31
 
32
+ # Present whenever `phone` is. `airbnb_relay` when `phone` is a temporary Airbnb relay number (SMS only, expires 48h after checkout, shared across hosts, never a guest identifier); `guest` otherwise.
33
+ attr_accessor :phone_type
34
+
35
+ # Only next to an Airbnb relay number: when it stops working (checkout + 48 hours). `null` when Airbnb did not give the checkout time with its offset. A cancelled reservation's relay number stops working at cancellation, whatever this says.
36
+ attr_accessor :phone_expires_at
37
+
32
38
  # Guest's preferred language (BCP-47 / ISO 639-1).
33
39
  attr_accessor :language
34
40
 
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
62
+
35
63
  # Attribute mapping from ruby-style variable name to JSON key.
36
64
  def self.attribute_map
37
65
  {
@@ -40,6 +68,8 @@ module Repull
40
68
  :'last_name' => :'lastName',
41
69
  :'email' => :'email',
42
70
  :'phone' => :'phone',
71
+ :'phone_type' => :'phoneType',
72
+ :'phone_expires_at' => :'phoneExpiresAt',
43
73
  :'language' => :'language'
44
74
  }
45
75
  end
@@ -62,6 +92,8 @@ module Repull
62
92
  :'last_name' => :'String',
63
93
  :'email' => :'String',
64
94
  :'phone' => :'String',
95
+ :'phone_type' => :'GuestPhoneType',
96
+ :'phone_expires_at' => :'Time',
65
97
  :'language' => :'String'
66
98
  }
67
99
  end
@@ -73,6 +105,7 @@ module Repull
73
105
  :'last_name',
74
106
  :'email',
75
107
  :'phone',
108
+ :'phone_expires_at',
76
109
  :'language'
77
110
  ])
78
111
  end
@@ -113,6 +146,14 @@ module Repull
113
146
  self.phone = attributes[:'phone']
114
147
  end
115
148
 
149
+ if attributes.key?(:'phone_type')
150
+ self.phone_type = attributes[:'phone_type']
151
+ end
152
+
153
+ if attributes.key?(:'phone_expires_at')
154
+ self.phone_expires_at = attributes[:'phone_expires_at']
155
+ end
156
+
116
157
  if attributes.key?(:'language')
117
158
  self.language = attributes[:'language']
118
159
  end
@@ -143,6 +184,8 @@ module Repull
143
184
  last_name == o.last_name &&
144
185
  email == o.email &&
145
186
  phone == o.phone &&
187
+ phone_type == o.phone_type &&
188
+ phone_expires_at == o.phone_expires_at &&
146
189
  language == o.language
147
190
  end
148
191
 
@@ -155,7 +198,7 @@ module Repull
155
198
  # Calculates hash code according to all attributes.
156
199
  # @return [Integer] Hash code
157
200
  def hash
158
- [id, first_name, last_name, email, phone, language].hash
201
+ [id, first_name, last_name, email, phone, phone_type, phone_expires_at, language].hash
159
202
  end
160
203
 
161
204
  # Builds the object from hash
@@ -26,6 +26,7 @@ module Repull
26
26
  # The channel the message actually went out on.
27
27
  attr_accessor :channel
28
28
 
29
+ # `sent`: delivered. `queued` (with HTTP `202`): recorded, and still being delivered in the background because the channel was busy (Vrbo) — do not resend; the outcome arrives as the message's `status` on `GET /v1/conversations/{id}/messages` and as `conversation.message.status_changed`.
29
30
  attr_accessor :status
30
31
 
31
32
  attr_accessor :direction
@@ -14,16 +14,43 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Send `hours`, `allowRequestToBook`, or both. The half you omit keeps the value Airbnb currently holds.
17
+ # Send `hours` (or `sameDayCutoff`), `allowRequestToBook`, or both. The half you omit keeps the value Airbnb currently holds. `hours` and `sameDayCutoff` are the same setting: send one.
18
18
  class UpdateAirbnbBookingSettingsRequestAdvanceNotice < ApiModelBase
19
+ # Counted back from 11:59 PM on the check-in day (listing time): `0` = same-day bookings until midnight, `1` = until 11 PM, `24` = no same-day bookings.
19
20
  attr_accessor :hours
20
21
 
22
+ # The last time a same-day booking is accepted, whole hours in the listing's time (`23:00` = 11 PM, `00:00` = midnight). Converted to `hours` (`23:00` = 1).
23
+ attr_accessor :same_day_cutoff
24
+
21
25
  attr_accessor :allow_request_to_book
22
26
 
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
23
49
  # Attribute mapping from ruby-style variable name to JSON key.
24
50
  def self.attribute_map
25
51
  {
26
52
  :'hours' => :'hours',
53
+ :'same_day_cutoff' => :'sameDayCutoff',
27
54
  :'allow_request_to_book' => :'allowRequestToBook'
28
55
  }
29
56
  end
@@ -42,6 +69,7 @@ module Repull
42
69
  def self.openapi_types
43
70
  {
44
71
  :'hours' => :'Integer',
72
+ :'same_day_cutoff' => :'String',
45
73
  :'allow_request_to_book' => :'Boolean'
46
74
  }
47
75
  end
@@ -50,6 +78,7 @@ module Repull
50
78
  def self.openapi_nullable
51
79
  Set.new([
52
80
  :'hours',
81
+ :'same_day_cutoff',
53
82
  :'allow_request_to_book'
54
83
  ])
55
84
  end
@@ -74,6 +103,10 @@ module Repull
74
103
  self.hours = attributes[:'hours']
75
104
  end
76
105
 
106
+ if attributes.key?(:'same_day_cutoff')
107
+ self.same_day_cutoff = attributes[:'same_day_cutoff']
108
+ end
109
+
77
110
  if attributes.key?(:'allow_request_to_book')
78
111
  self.allow_request_to_book = attributes[:'allow_request_to_book']
79
112
  end
@@ -84,12 +117,9 @@ module Repull
84
117
  def list_invalid_properties
85
118
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
119
  invalid_properties = Array.new
87
- if !@hours.nil? && @hours > 168
88
- invalid_properties.push('invalid value for "hours", must be smaller than or equal to 168.')
89
- end
90
-
91
- if !@hours.nil? && @hours < 0
92
- invalid_properties.push('invalid value for "hours", must be greater than or equal to 0.')
120
+ pattern = Regexp.new(/^([01][0-9]|2[0-3]):00$/)
121
+ if !@same_day_cutoff.nil? && @same_day_cutoff !~ pattern
122
+ invalid_properties.push("invalid value for \"same_day_cutoff\", must conform to the pattern #{pattern}.")
93
123
  end
94
124
 
95
125
  invalid_properties
@@ -99,23 +129,31 @@ module Repull
99
129
  # @return true if the model is valid
100
130
  def valid?
101
131
  warn '[DEPRECATED] the `valid?` method is obsolete'
102
- return false if !@hours.nil? && @hours > 168
103
- return false if !@hours.nil? && @hours < 0
132
+ hours_validator = EnumAttributeValidator.new('Integer', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 48, 72, 168])
133
+ return false unless hours_validator.valid?(@hours)
134
+ return false if !@same_day_cutoff.nil? && @same_day_cutoff !~ Regexp.new(/^([01][0-9]|2[0-3]):00$/)
104
135
  true
105
136
  end
106
137
 
107
- # Custom attribute writer method with validation
108
- # @param [Object] hours Value to be assigned
138
+ # Custom attribute writer method checking allowed values (enum).
139
+ # @param [Object] hours Object to be assigned
109
140
  def hours=(hours)
110
- if !hours.nil? && hours > 168
111
- fail ArgumentError, 'invalid value for "hours", must be smaller than or equal to 168.'
141
+ validator = EnumAttributeValidator.new('Integer', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 48, 72, 168])
142
+ unless validator.valid?(hours)
143
+ fail ArgumentError, "invalid value for \"hours\", must be one of #{validator.allowable_values}."
112
144
  end
145
+ @hours = hours
146
+ end
113
147
 
114
- if !hours.nil? && hours < 0
115
- fail ArgumentError, 'invalid value for "hours", must be greater than or equal to 0.'
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] same_day_cutoff Value to be assigned
150
+ def same_day_cutoff=(same_day_cutoff)
151
+ pattern = Regexp.new(/^([01][0-9]|2[0-3]):00$/)
152
+ if !same_day_cutoff.nil? && same_day_cutoff !~ pattern
153
+ fail ArgumentError, "invalid value for \"same_day_cutoff\", must conform to the pattern #{pattern}."
116
154
  end
117
155
 
118
- @hours = hours
156
+ @same_day_cutoff = same_day_cutoff
119
157
  end
120
158
 
121
159
  # Checks equality by comparing each attribute.
@@ -124,6 +162,7 @@ module Repull
124
162
  return true if self.equal?(o)
125
163
  self.class == o.class &&
126
164
  hours == o.hours &&
165
+ same_day_cutoff == o.same_day_cutoff &&
127
166
  allow_request_to_book == o.allow_request_to_book
128
167
  end
129
168
 
@@ -136,7 +175,7 @@ module Repull
136
175
  # Calculates hash code according to all attributes.
137
176
  # @return [Integer] Hash code
138
177
  def hash
139
- [hours, allow_request_to_book].hash
178
+ [hours, same_day_cutoff, allow_request_to_book].hash
140
179
  end
141
180
 
142
181
  # Builds the object from hash