repull 0.2.50 → 0.2.52
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.
- checksums.yaml +4 -4
- data/lib/repull/api/airbnb_api.rb +2 -2
- data/lib/repull/api/conversations_api.rb +2 -2
- data/lib/repull/api/listings_api.rb +63 -0
- data/lib/repull/models/account_notifications_missing_event.rb +282 -0
- data/lib/repull/models/account_notifications_missing_payload.rb +278 -0
- data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +14 -4
- data/lib/repull/models/auto_map_connection_units200_response.rb +1 -1
- data/lib/repull/models/auto_map_connection_units200_response_results_inner.rb +184 -0
- data/lib/repull/models/connect_status_accounts_inner.rb +12 -2
- data/lib/repull/models/conversation_message_status_changed_event.rb +282 -0
- data/lib/repull/models/conversation_message_status_changed_payload.rb +233 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_advance_notice.rb +14 -3
- data/lib/repull/models/get_listing_ical200_response.rb +298 -0
- data/lib/repull/models/get_listing_ical200_response_vrbo_inner.rb +285 -0
- data/lib/repull/models/get_usage_logs200_response_data_inner.rb +12 -1
- data/lib/repull/models/guest.rb +35 -2
- data/lib/repull/models/guest_contact.rb +37 -5
- data/lib/repull/models/guest_phone_type.rb +40 -0
- data/lib/repull/models/guest_profile.rb +35 -1
- data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -1
- data/lib/repull/models/listing_ical_feed_changed_event.rb +282 -0
- data/lib/repull/models/listing_ical_feed_changed_payload.rb +355 -0
- data/lib/repull/models/listing_ical_feed_changed_payload_feed.rb +159 -0
- data/lib/repull/models/message.rb +2 -2
- data/lib/repull/models/reservation.rb +11 -1
- data/lib/repull/models/reservation_primary_guest.rb +45 -2
- data/lib/repull/models/send_message_response.rb +1 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_advance_notice.rb +56 -17
- data/lib/repull/models/vrbo_notifications.rb +192 -0
- data/lib/repull/models/webhook_event.rb +6 -0
- data/lib/repull/models/webhook_event_type.rb +4 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +12 -0
- data/openapi/v1.json +606 -18
- metadata +14 -2
data/lib/repull/models/guest.rb
CHANGED
|
@@ -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
|
|
@@ -25,7 +25,7 @@ module Repull
|
|
|
25
25
|
|
|
26
26
|
attr_accessor :suggested_listing_id
|
|
27
27
|
|
|
28
|
-
# Channel details that identify the unit. Booking.com Extranet: `hotel` (property name), `hotelId` (Booking.com property ID), `roomId` (Booking.com room ID), `city`. Vrbo: `headline`, `address`, `vrboStatus`, `calendarSync` (whether the unit's prices and availability are pushed to Vrbo) and, while Vrbo says another tool manages the account's calendar, `calendarSyncBlocked: \"calendar_managed_elsewhere\"`; the Vrbo listing ID is `unit_id`.
|
|
28
|
+
# Channel details that identify the unit. Booking.com Extranet: `hotel` (property name), `hotelId` (Booking.com property ID), `roomId` (Booking.com room ID), `city`. Vrbo: `headline`, `address`, `vrboStatus`, `calendarSync` (whether the unit's prices and availability are pushed to Vrbo) and, while Vrbo says another tool manages the account's calendar, `calendarSyncBlocked: \"calendar_managed_elsewhere\"`, and for a mapped unit `icalBackup`: `{ feedUrl, status, otherFeeds }` — the listing's Repull iCal backup feed and whether Vrbo imports it (`status` as on `GET /v1/listings/{id}/ical`: `imported`, `pending`, `failed`, `not_imported`, `off`; Repull adds it itself, so only on `failed` does the host add `feedUrl` in Vrbo → Calendar → Import calendar, named \"Repull\"); the Vrbo listing ID is `unit_id`.
|
|
29
29
|
attr_accessor :meta
|
|
30
30
|
|
|
31
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -0,0 +1,282 @@
|
|
|
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
|
+
# Repull added its iCal backup feed to a Vrbo unit, removed another tool's imported feed, or could not. On a `*_failed` action, show the host what to change on Vrbo.
|
|
18
|
+
class ListingIcalFeedChangedEvent < ApiModelBase
|
|
19
|
+
# The event name. This field is `event`, not `type`.
|
|
20
|
+
attr_accessor :event
|
|
21
|
+
|
|
22
|
+
# Stable across every delivery and replay of this logical event — dedupe on it.
|
|
23
|
+
attr_accessor :event_id
|
|
24
|
+
|
|
25
|
+
attr_accessor :api_version
|
|
26
|
+
|
|
27
|
+
# When this delivery was built.
|
|
28
|
+
attr_accessor :timestamp
|
|
29
|
+
|
|
30
|
+
attr_accessor :account
|
|
31
|
+
|
|
32
|
+
attr_accessor :data
|
|
33
|
+
|
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
35
|
+
def self.attribute_map
|
|
36
|
+
{
|
|
37
|
+
:'event' => :'event',
|
|
38
|
+
:'event_id' => :'eventId',
|
|
39
|
+
:'api_version' => :'apiVersion',
|
|
40
|
+
:'timestamp' => :'timestamp',
|
|
41
|
+
:'account' => :'account',
|
|
42
|
+
:'data' => :'data'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns attribute mapping this model knows about
|
|
47
|
+
def self.acceptable_attribute_map
|
|
48
|
+
attribute_map
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Returns all the JSON keys this model knows about
|
|
52
|
+
def self.acceptable_attributes
|
|
53
|
+
acceptable_attribute_map.values
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Attribute type mapping.
|
|
57
|
+
def self.openapi_types
|
|
58
|
+
{
|
|
59
|
+
:'event' => :'String',
|
|
60
|
+
:'event_id' => :'String',
|
|
61
|
+
:'api_version' => :'String',
|
|
62
|
+
:'timestamp' => :'Time',
|
|
63
|
+
:'account' => :'WebhookEventAccount',
|
|
64
|
+
:'data' => :'ListingIcalFeedChangedPayload'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# List of attributes with nullable: true
|
|
69
|
+
def self.openapi_nullable
|
|
70
|
+
Set.new([
|
|
71
|
+
:'account',
|
|
72
|
+
])
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Initializes the object
|
|
76
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
77
|
+
def initialize(attributes = {})
|
|
78
|
+
if (!attributes.is_a?(Hash))
|
|
79
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingIcalFeedChangedEvent` initialize method"
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
83
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingIcalFeedChangedEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
87
|
+
end
|
|
88
|
+
h[k.to_sym] = v
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'event')
|
|
92
|
+
self.event = attributes[:'event']
|
|
93
|
+
else
|
|
94
|
+
self.event = nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'event_id')
|
|
98
|
+
self.event_id = attributes[:'event_id']
|
|
99
|
+
else
|
|
100
|
+
self.event_id = nil
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'api_version')
|
|
104
|
+
self.api_version = attributes[:'api_version']
|
|
105
|
+
else
|
|
106
|
+
self.api_version = nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'timestamp')
|
|
110
|
+
self.timestamp = attributes[:'timestamp']
|
|
111
|
+
else
|
|
112
|
+
self.timestamp = nil
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'account')
|
|
116
|
+
self.account = attributes[:'account']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'data')
|
|
120
|
+
self.data = attributes[:'data']
|
|
121
|
+
else
|
|
122
|
+
self.data = nil
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
|
+
# @return Array for valid properties with the reasons
|
|
128
|
+
def list_invalid_properties
|
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
130
|
+
invalid_properties = Array.new
|
|
131
|
+
if @event.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "event", event cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if @event_id.nil?
|
|
136
|
+
invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if @api_version.nil?
|
|
140
|
+
invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if @timestamp.nil?
|
|
144
|
+
invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if @data.nil?
|
|
148
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
invalid_properties
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Check to see if the all the properties in the model are valid
|
|
155
|
+
# @return true if the model is valid
|
|
156
|
+
def valid?
|
|
157
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
158
|
+
return false if @event.nil?
|
|
159
|
+
return false if @event_id.nil?
|
|
160
|
+
return false if @api_version.nil?
|
|
161
|
+
return false if @timestamp.nil?
|
|
162
|
+
return false if @data.nil?
|
|
163
|
+
true
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Custom attribute writer method with validation
|
|
167
|
+
# @param [Object] event Value to be assigned
|
|
168
|
+
def event=(event)
|
|
169
|
+
if event.nil?
|
|
170
|
+
fail ArgumentError, 'event cannot be nil'
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
@event = event
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Custom attribute writer method with validation
|
|
177
|
+
# @param [Object] event_id Value to be assigned
|
|
178
|
+
def event_id=(event_id)
|
|
179
|
+
if event_id.nil?
|
|
180
|
+
fail ArgumentError, 'event_id cannot be nil'
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
@event_id = event_id
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Custom attribute writer method with validation
|
|
187
|
+
# @param [Object] api_version Value to be assigned
|
|
188
|
+
def api_version=(api_version)
|
|
189
|
+
if api_version.nil?
|
|
190
|
+
fail ArgumentError, 'api_version cannot be nil'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
@api_version = api_version
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method with validation
|
|
197
|
+
# @param [Object] timestamp Value to be assigned
|
|
198
|
+
def timestamp=(timestamp)
|
|
199
|
+
if timestamp.nil?
|
|
200
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@timestamp = timestamp
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Custom attribute writer method with validation
|
|
207
|
+
# @param [Object] data Value to be assigned
|
|
208
|
+
def data=(data)
|
|
209
|
+
if data.nil?
|
|
210
|
+
fail ArgumentError, 'data cannot be nil'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
@data = data
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Checks equality by comparing each attribute.
|
|
217
|
+
# @param [Object] Object to be compared
|
|
218
|
+
def ==(o)
|
|
219
|
+
return true if self.equal?(o)
|
|
220
|
+
self.class == o.class &&
|
|
221
|
+
event == o.event &&
|
|
222
|
+
event_id == o.event_id &&
|
|
223
|
+
api_version == o.api_version &&
|
|
224
|
+
timestamp == o.timestamp &&
|
|
225
|
+
account == o.account &&
|
|
226
|
+
data == o.data
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# @see the `==` method
|
|
230
|
+
# @param [Object] Object to be compared
|
|
231
|
+
def eql?(o)
|
|
232
|
+
self == o
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Calculates hash code according to all attributes.
|
|
236
|
+
# @return [Integer] Hash code
|
|
237
|
+
def hash
|
|
238
|
+
[event, event_id, api_version, timestamp, account, data].hash
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Builds the object from hash
|
|
242
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
243
|
+
# @return [Object] Returns the model itself
|
|
244
|
+
def self.build_from_hash(attributes)
|
|
245
|
+
return nil unless attributes.is_a?(Hash)
|
|
246
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
247
|
+
transformed_hash = {}
|
|
248
|
+
openapi_types.each_pair do |key, type|
|
|
249
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
250
|
+
transformed_hash["#{key}"] = nil
|
|
251
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
252
|
+
# check to ensure the input is an array given that the attribute
|
|
253
|
+
# is documented as an array but the input is not
|
|
254
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
255
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
256
|
+
end
|
|
257
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
258
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
new(transformed_hash)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Returns the object in the form of hash
|
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
|
266
|
+
def to_hash
|
|
267
|
+
hash = {}
|
|
268
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
269
|
+
value = self.send(attr)
|
|
270
|
+
if value.nil?
|
|
271
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
272
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
hash[param] = _to_hash(value)
|
|
276
|
+
end
|
|
277
|
+
hash
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
end
|