repull 0.2.49 → 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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +2 -2
  3. data/lib/repull/api/connections_api.rb +2 -2
  4. data/lib/repull/api/conversations_api.rb +2 -2
  5. data/lib/repull/models/account_calendar_access_changed_event.rb +282 -0
  6. data/lib/repull/models/account_calendar_access_changed_payload.rb +268 -0
  7. data/lib/repull/models/account_notifications_missing_event.rb +282 -0
  8. data/lib/repull/models/account_notifications_missing_payload.rb +278 -0
  9. data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +1 -1
  10. data/lib/repull/models/connect_status_accounts_inner.rb +23 -2
  11. data/lib/repull/models/conversation_message_status_changed_event.rb +282 -0
  12. data/lib/repull/models/conversation_message_status_changed_payload.rb +233 -0
  13. data/lib/repull/models/get_airbnb_booking_settings200_response_data_advance_notice.rb +14 -3
  14. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +33 -1
  15. data/lib/repull/models/guest.rb +35 -2
  16. data/lib/repull/models/guest_contact.rb +37 -5
  17. data/lib/repull/models/guest_phone_type.rb +40 -0
  18. data/lib/repull/models/guest_profile.rb +35 -1
  19. data/lib/repull/models/list_connection_units200_response.rb +10 -1
  20. data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -1
  21. data/lib/repull/models/message.rb +2 -2
  22. data/lib/repull/models/reservation.rb +11 -1
  23. data/lib/repull/models/reservation_primary_guest.rb +45 -2
  24. data/lib/repull/models/send_message_response.rb +1 -0
  25. data/lib/repull/models/start_connection_import_request.rb +1 -1
  26. data/lib/repull/models/update_airbnb_booking_settings_request_advance_notice.rb +56 -17
  27. data/lib/repull/models/vrbo_calendar_access.rb +204 -0
  28. data/lib/repull/models/vrbo_notifications.rb +192 -0
  29. data/lib/repull/models/webhook_event.rb +6 -0
  30. data/lib/repull/models/webhook_event_type.rb +4 -1
  31. data/lib/repull/version.rb +1 -1
  32. data/lib/repull.rb +9 -0
  33. data/openapi/v1.json +493 -21
  34. metadata +11 -2
@@ -0,0 +1,233 @@
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
+ # Payload for `conversation.message.status_changed`: a message you sent changed delivery status after the send call returned — a Vrbo reply accepted as `queued` (`202`) was delivered (`sent`) or gave up (`failed`).
18
+ class ConversationMessageStatusChangedPayload < ApiModelBase
19
+ # The conversation (`GET /v1/conversations/{id}`).
20
+ attr_accessor :conversation_id
21
+
22
+ # The message, as `id` on the send response and on `GET /v1/conversations/{id}/messages`.
23
+ attr_accessor :message_id
24
+
25
+ # The new delivery status.
26
+ attr_accessor :status
27
+
28
+ # Why it `failed`, in plain words. `null` when `sent`.
29
+ attr_accessor :status_reason
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'conversation_id' => :'conversationId',
35
+ :'message_id' => :'messageId',
36
+ :'status' => :'status',
37
+ :'status_reason' => :'statusReason'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'conversation_id' => :'String',
55
+ :'message_id' => :'String',
56
+ :'status' => :'String',
57
+ :'status_reason' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'status_reason'
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConversationMessageStatusChangedPayload` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConversationMessageStatusChangedPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'conversation_id')
85
+ self.conversation_id = attributes[:'conversation_id']
86
+ else
87
+ self.conversation_id = nil
88
+ end
89
+
90
+ if attributes.key?(:'message_id')
91
+ self.message_id = attributes[:'message_id']
92
+ else
93
+ self.message_id = nil
94
+ end
95
+
96
+ if attributes.key?(:'status')
97
+ self.status = attributes[:'status']
98
+ else
99
+ self.status = nil
100
+ end
101
+
102
+ if attributes.key?(:'status_reason')
103
+ self.status_reason = attributes[:'status_reason']
104
+ else
105
+ self.status_reason = nil
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ if @conversation_id.nil?
115
+ invalid_properties.push('invalid value for "conversation_id", conversation_id cannot be nil.')
116
+ end
117
+
118
+ if @message_id.nil?
119
+ invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
120
+ end
121
+
122
+ if @status.nil?
123
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ return false if @conversation_id.nil?
134
+ return false if @message_id.nil?
135
+ return false if @status.nil?
136
+ true
137
+ end
138
+
139
+ # Custom attribute writer method with validation
140
+ # @param [Object] conversation_id Value to be assigned
141
+ def conversation_id=(conversation_id)
142
+ if conversation_id.nil?
143
+ fail ArgumentError, 'conversation_id cannot be nil'
144
+ end
145
+
146
+ @conversation_id = conversation_id
147
+ end
148
+
149
+ # Custom attribute writer method with validation
150
+ # @param [Object] message_id Value to be assigned
151
+ def message_id=(message_id)
152
+ if message_id.nil?
153
+ fail ArgumentError, 'message_id cannot be nil'
154
+ end
155
+
156
+ @message_id = message_id
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] status Value to be assigned
161
+ def status=(status)
162
+ if status.nil?
163
+ fail ArgumentError, 'status cannot be nil'
164
+ end
165
+
166
+ @status = status
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ conversation_id == o.conversation_id &&
175
+ message_id == o.message_id &&
176
+ status == o.status &&
177
+ status_reason == o.status_reason
178
+ end
179
+
180
+ # @see the `==` method
181
+ # @param [Object] Object to be compared
182
+ def eql?(o)
183
+ self == o
184
+ end
185
+
186
+ # Calculates hash code according to all attributes.
187
+ # @return [Integer] Hash code
188
+ def hash
189
+ [conversation_id, message_id, status, status_reason].hash
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def self.build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ attributes = attributes.transform_keys(&:to_sym)
198
+ transformed_hash = {}
199
+ openapi_types.each_pair do |key, type|
200
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = nil
202
+ elsif type =~ /\AArray<(.*)>/i
203
+ # check to ensure the input is an array given that the attribute
204
+ # is documented as an array but the input is not
205
+ if attributes[attribute_map[key]].is_a?(Array)
206
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
207
+ end
208
+ elsif !attributes[attribute_map[key]].nil?
209
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
210
+ end
211
+ end
212
+ new(transformed_hash)
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ end
232
+
233
+ end
@@ -16,12 +16,15 @@ require 'time'
16
16
  module Repull
17
17
  # How much notice a booking needs.
18
18
  class GetAirbnbBookingSettings200ResponseDataAdvanceNotice < ApiModelBase
19
- # Whole hours of notice. `0` allows same-day bookings.
19
+ # Airbnb's advance notice: 0-24, 48, 72 or 168. Airbnb counts it back from 11:59 PM on the check-in day, in the listing's time zone, so 0-23 is a same-day cutoff: `0` = same-day bookings until midnight, `1` = until 11 PM, `3` = until 9 PM. `24` and above = no same-day bookings.
20
20
  attr_accessor :hours
21
21
 
22
- # Derived: `hours === 0`.
22
+ # Derived: `hours < 24`.
23
23
  attr_accessor :same_day_bookings_allowed
24
24
 
25
+ # Derived: the last time a same-day booking is accepted, `HH:mm` in the listing's time (`00:00` = midnight). `null` when same-day bookings are off.
26
+ attr_accessor :same_day_cutoff
27
+
25
28
  # Whether a guest may still REQUEST to book inside the notice window.
26
29
  attr_accessor :allow_request_to_book
27
30
 
@@ -30,6 +33,7 @@ module Repull
30
33
  {
31
34
  :'hours' => :'hours',
32
35
  :'same_day_bookings_allowed' => :'sameDayBookingsAllowed',
36
+ :'same_day_cutoff' => :'sameDayCutoff',
33
37
  :'allow_request_to_book' => :'allowRequestToBook'
34
38
  }
35
39
  end
@@ -49,6 +53,7 @@ module Repull
49
53
  {
50
54
  :'hours' => :'Integer',
51
55
  :'same_day_bookings_allowed' => :'Boolean',
56
+ :'same_day_cutoff' => :'String',
52
57
  :'allow_request_to_book' => :'Boolean'
53
58
  }
54
59
  end
@@ -58,6 +63,7 @@ module Repull
58
63
  Set.new([
59
64
  :'hours',
60
65
  :'same_day_bookings_allowed',
66
+ :'same_day_cutoff',
61
67
  :'allow_request_to_book'
62
68
  ])
63
69
  end
@@ -86,6 +92,10 @@ module Repull
86
92
  self.same_day_bookings_allowed = attributes[:'same_day_bookings_allowed']
87
93
  end
88
94
 
95
+ if attributes.key?(:'same_day_cutoff')
96
+ self.same_day_cutoff = attributes[:'same_day_cutoff']
97
+ end
98
+
89
99
  if attributes.key?(:'allow_request_to_book')
90
100
  self.allow_request_to_book = attributes[:'allow_request_to_book']
91
101
  end
@@ -113,6 +123,7 @@ module Repull
113
123
  self.class == o.class &&
114
124
  hours == o.hours &&
115
125
  same_day_bookings_allowed == o.same_day_bookings_allowed &&
126
+ same_day_cutoff == o.same_day_cutoff &&
116
127
  allow_request_to_book == o.allow_request_to_book
117
128
  end
118
129
 
@@ -125,7 +136,7 @@ module Repull
125
136
  # Calculates hash code according to all attributes.
126
137
  # @return [Integer] Hash code
127
138
  def hash
128
- [hours, same_day_bookings_allowed, allow_request_to_book].hash
139
+ [hours, same_day_bookings_allowed, same_day_cutoff, allow_request_to_book].hash
129
140
  end
130
141
 
131
142
  # Builds the object from hash
@@ -26,6 +26,12 @@ module Repull
26
26
  # `in_sync` — no future night has a problem; `problems` — see `problems`; `off` — calendar sync is off for this channel.
27
27
  attr_accessor :status
28
28
 
29
+ # Vrbo only, when Repull turned calendar sync off: Vrbo says another tool (such as a PMS) manages the account's calendar. Absent when the host turned it off.
30
+ attr_accessor :off_reason
31
+
32
+ # Explains `offReason` and how to turn calendar sync back on.
33
+ attr_accessor :docs_url
34
+
29
35
  # When a push last wrote to this listing's calendar.
30
36
  attr_accessor :last_sync_at
31
37
 
@@ -64,6 +70,8 @@ module Repull
64
70
  :'platform_id' => :'platformId',
65
71
  :'sync_enabled' => :'syncEnabled',
66
72
  :'status' => :'status',
73
+ :'off_reason' => :'offReason',
74
+ :'docs_url' => :'docsUrl',
67
75
  :'last_sync_at' => :'lastSyncAt',
68
76
  :'nights_with_problems' => :'nightsWithProblems',
69
77
  :'problems' => :'problems',
@@ -88,6 +96,8 @@ module Repull
88
96
  :'platform_id' => :'String',
89
97
  :'sync_enabled' => :'Boolean',
90
98
  :'status' => :'String',
99
+ :'off_reason' => :'String',
100
+ :'docs_url' => :'String',
91
101
  :'last_sync_at' => :'Time',
92
102
  :'nights_with_problems' => :'Integer',
93
103
  :'problems' => :'Array<GetListingCalendarSync200ResponseChannelsInnerProblemsInner>',
@@ -143,6 +153,14 @@ module Repull
143
153
  self.status = nil
144
154
  end
145
155
 
156
+ if attributes.key?(:'off_reason')
157
+ self.off_reason = attributes[:'off_reason']
158
+ end
159
+
160
+ if attributes.key?(:'docs_url')
161
+ self.docs_url = attributes[:'docs_url']
162
+ end
163
+
146
164
  if attributes.key?(:'last_sync_at')
147
165
  self.last_sync_at = attributes[:'last_sync_at']
148
166
  else
@@ -205,6 +223,8 @@ module Repull
205
223
  return false if @status.nil?
206
224
  status_validator = EnumAttributeValidator.new('String', ["in_sync", "problems", "off"])
207
225
  return false unless status_validator.valid?(@status)
226
+ off_reason_validator = EnumAttributeValidator.new('String', ["calendar_managed_elsewhere"])
227
+ return false unless off_reason_validator.valid?(@off_reason)
208
228
  return false if @nights_with_problems.nil?
209
229
  return false if @problems.nil?
210
230
  true
@@ -240,6 +260,16 @@ module Repull
240
260
  @status = status
241
261
  end
242
262
 
263
+ # Custom attribute writer method checking allowed values (enum).
264
+ # @param [Object] off_reason Object to be assigned
265
+ def off_reason=(off_reason)
266
+ validator = EnumAttributeValidator.new('String', ["calendar_managed_elsewhere"])
267
+ unless validator.valid?(off_reason)
268
+ fail ArgumentError, "invalid value for \"off_reason\", must be one of #{validator.allowable_values}."
269
+ end
270
+ @off_reason = off_reason
271
+ end
272
+
243
273
  # Custom attribute writer method with validation
244
274
  # @param [Object] nights_with_problems Value to be assigned
245
275
  def nights_with_problems=(nights_with_problems)
@@ -269,6 +299,8 @@ module Repull
269
299
  platform_id == o.platform_id &&
270
300
  sync_enabled == o.sync_enabled &&
271
301
  status == o.status &&
302
+ off_reason == o.off_reason &&
303
+ docs_url == o.docs_url &&
272
304
  last_sync_at == o.last_sync_at &&
273
305
  nights_with_problems == o.nights_with_problems &&
274
306
  problems == o.problems &&
@@ -284,7 +316,7 @@ module Repull
284
316
  # Calculates hash code according to all attributes.
285
317
  # @return [Integer] Hash code
286
318
  def hash
287
- [channel, platform_id, sync_enabled, status, last_sync_at, nights_with_problems, problems, queue].hash
319
+ [channel, platform_id, sync_enabled, status, off_reason, docs_url, last_sync_at, nights_with_problems, problems, queue].hash
288
320
  end
289
321
 
290
322
  # Builds the object from hash
@@ -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