repull 0.2.49 → 0.2.50
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/connections_api.rb +2 -2
- data/lib/repull/models/account_calendar_access_changed_event.rb +282 -0
- data/lib/repull/models/account_calendar_access_changed_payload.rb +268 -0
- data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +1 -1
- data/lib/repull/models/connect_status_accounts_inner.rb +12 -1
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +33 -1
- data/lib/repull/models/list_connection_units200_response.rb +10 -1
- data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -1
- data/lib/repull/models/start_connection_import_request.rb +1 -1
- data/lib/repull/models/vrbo_calendar_access.rb +204 -0
- data/lib/repull/models/webhook_event.rb +2 -0
- data/lib/repull/models/webhook_event_type.rb +2 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +3 -0
- data/openapi/v1.json +150 -4
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37c8ef9bf141629f320c34c1e2e69f91ec81e772327853a2af4f4712593e9f21
|
|
4
|
+
data.tar.gz: a3d6e2721cd74840082c811150cfeb16ed130cc83538c0682f8b8c11508ba537
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aca88b65b8853044c096ebd6502b931a3c2bca8ee945b55c19be19e1dd9e964ef8fe3f11368826382ffc6681003f918b169bbc1894c3c5792d4514b6eb809ef4
|
|
7
|
+
data.tar.gz: 33aad9c51366b324a3602c7561b6977d9023069f59bbe61be37ff5eded99e777a41f66b8b8809171e091d1c36c7c69444f221e1af050a0fdef3328d35292c7ff
|
|
@@ -387,7 +387,7 @@ module Repull
|
|
|
387
387
|
end
|
|
388
388
|
|
|
389
389
|
# Refresh a connection's listings
|
|
390
|
-
# Refresh listings: picks up listings you've added on Airbnb since you connected. Re-reads the connected account's listings
|
|
390
|
+
# Refresh listings: picks up listings you've added on Airbnb since you connected. Re-reads the connected account's listings now: a new property comes in as a new listing, together with its calendar (pricing and availability), and existing listings are refreshed. On a full-access connection Repull is the source of your calendars, so the calendars of listings already in Repull are not re-read from Airbnb; on read-only and messaging connections they are. Nothing else is re-imported: no reservations, conversations, reviews or payouts. The same import runs on its own once a day for every connected Airbnb account, and when the host reconnects. Call this when you know a property was just added and do not want to wait. New listings obey your plan's active-listing limit: past it, and when the property is unlisted on Airbnb, they arrive inactive. Existing listings keep their status. The import runs in the background (`202`). It is recorded like any other import (trigger `resync`, one `listings` stage): follow it on `GET /v1/connections/{id}/imports` or wait for `account.import.completed`, then read the new listings with `GET /v1/listings`. Airbnb connections only for now. Returns `409 conflict` while a listings import of the account is already running, and `409 connection_reauth_required` when the account is disconnected.
|
|
391
391
|
# @param id [String] Airbnb connection handle `airbnb:{hostId}` — the `provider` and `externalAccountId` of an Airbnb connection on `GET /v1/connect`, or the account of an `account.*` webhook.
|
|
392
392
|
# @param [Hash] opts the optional parameters
|
|
393
393
|
# @option opts [StartConnectionImportRequest] :start_connection_import_request
|
|
@@ -398,7 +398,7 @@ module Repull
|
|
|
398
398
|
end
|
|
399
399
|
|
|
400
400
|
# Refresh a connection's listings
|
|
401
|
-
# Refresh listings: picks up listings you've added on Airbnb since you connected. Re-reads the connected account's listings
|
|
401
|
+
# Refresh listings: picks up listings you've added on Airbnb since you connected. Re-reads the connected account's listings now: a new property comes in as a new listing, together with its calendar (pricing and availability), and existing listings are refreshed. On a full-access connection Repull is the source of your calendars, so the calendars of listings already in Repull are not re-read from Airbnb; on read-only and messaging connections they are. Nothing else is re-imported: no reservations, conversations, reviews or payouts. The same import runs on its own once a day for every connected Airbnb account, and when the host reconnects. Call this when you know a property was just added and do not want to wait. New listings obey your plan's active-listing limit: past it, and when the property is unlisted on Airbnb, they arrive inactive. Existing listings keep their status. The import runs in the background (`202`). It is recorded like any other import (trigger `resync`, one `listings` stage): follow it on `GET /v1/connections/{id}/imports` or wait for `account.import.completed`, then read the new listings with `GET /v1/listings`. Airbnb connections only for now. Returns `409 conflict` while a listings import of the account is already running, and `409 connection_reauth_required` when the account is disconnected.
|
|
402
402
|
# @param id [String] Airbnb connection handle `airbnb:{hostId}` — the `provider` and `externalAccountId` of an Airbnb connection on `GET /v1/connect`, or the account of an `account.*` webhook.
|
|
403
403
|
# @param [Hash] opts the optional parameters
|
|
404
404
|
# @option opts [StartConnectionImportRequest] :start_connection_import_request
|
|
@@ -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
|
+
# Another tool (such as a PMS) started or stopped managing a Vrbo account's calendar. Started: calendar sync is now off for every unit of the account. Stopped: nothing is switched back on; turn it on with `POST /v1/connections/{id}/mappings` (`calendarSync: true`).
|
|
18
|
+
class AccountCalendarAccessChangedEvent < 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' => :'AccountCalendarAccessChangedPayload'
|
|
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::AccountCalendarAccessChangedEvent` 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::AccountCalendarAccessChangedEvent`. 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
|
|
@@ -0,0 +1,268 @@
|
|
|
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 AccountCalendarAccessChangedPayload < ApiModelBase
|
|
18
|
+
attr_accessor :workspace_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :provider
|
|
21
|
+
|
|
22
|
+
# Vrbo's account number (`accounts[].externalAccountId` on `GET /v1/connect/vrbo-login`).
|
|
23
|
+
attr_accessor :account_id
|
|
24
|
+
|
|
25
|
+
# The workspace's Vrbo connection record.
|
|
26
|
+
attr_accessor :connection_id
|
|
27
|
+
|
|
28
|
+
attr_accessor :calendar
|
|
29
|
+
|
|
30
|
+
attr_accessor :changed_at
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'workspace_id' => :'workspaceId',
|
|
36
|
+
:'provider' => :'provider',
|
|
37
|
+
:'account_id' => :'accountId',
|
|
38
|
+
:'connection_id' => :'connectionId',
|
|
39
|
+
:'calendar' => :'calendar',
|
|
40
|
+
:'changed_at' => :'changedAt'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns attribute mapping this model knows about
|
|
45
|
+
def self.acceptable_attribute_map
|
|
46
|
+
attribute_map
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns all the JSON keys this model knows about
|
|
50
|
+
def self.acceptable_attributes
|
|
51
|
+
acceptable_attribute_map.values
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute type mapping.
|
|
55
|
+
def self.openapi_types
|
|
56
|
+
{
|
|
57
|
+
:'workspace_id' => :'Integer',
|
|
58
|
+
:'provider' => :'String',
|
|
59
|
+
:'account_id' => :'String',
|
|
60
|
+
:'connection_id' => :'Integer',
|
|
61
|
+
:'calendar' => :'VrboCalendarAccess',
|
|
62
|
+
:'changed_at' => :'Time'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
:'account_id',
|
|
70
|
+
:'connection_id',
|
|
71
|
+
])
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Initializes the object
|
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
76
|
+
def initialize(attributes = {})
|
|
77
|
+
if (!attributes.is_a?(Hash))
|
|
78
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AccountCalendarAccessChangedPayload` initialize method"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
82
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
83
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
84
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
85
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AccountCalendarAccessChangedPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
86
|
+
end
|
|
87
|
+
h[k.to_sym] = v
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'workspace_id')
|
|
91
|
+
self.workspace_id = attributes[:'workspace_id']
|
|
92
|
+
else
|
|
93
|
+
self.workspace_id = nil
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'provider')
|
|
97
|
+
self.provider = attributes[:'provider']
|
|
98
|
+
else
|
|
99
|
+
self.provider = nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'account_id')
|
|
103
|
+
self.account_id = attributes[:'account_id']
|
|
104
|
+
else
|
|
105
|
+
self.account_id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'connection_id')
|
|
109
|
+
self.connection_id = attributes[:'connection_id']
|
|
110
|
+
else
|
|
111
|
+
self.connection_id = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'calendar')
|
|
115
|
+
self.calendar = attributes[:'calendar']
|
|
116
|
+
else
|
|
117
|
+
self.calendar = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'changed_at')
|
|
121
|
+
self.changed_at = attributes[:'changed_at']
|
|
122
|
+
else
|
|
123
|
+
self.changed_at = nil
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
128
|
+
# @return Array for valid properties with the reasons
|
|
129
|
+
def list_invalid_properties
|
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
131
|
+
invalid_properties = Array.new
|
|
132
|
+
if @workspace_id.nil?
|
|
133
|
+
invalid_properties.push('invalid value for "workspace_id", workspace_id cannot be nil.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @provider.nil?
|
|
137
|
+
invalid_properties.push('invalid value for "provider", provider cannot be nil.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if @calendar.nil?
|
|
141
|
+
invalid_properties.push('invalid value for "calendar", calendar cannot be nil.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if @changed_at.nil?
|
|
145
|
+
invalid_properties.push('invalid value for "changed_at", changed_at cannot be nil.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
invalid_properties
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Check to see if the all the properties in the model are valid
|
|
152
|
+
# @return true if the model is valid
|
|
153
|
+
def valid?
|
|
154
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
155
|
+
return false if @workspace_id.nil?
|
|
156
|
+
return false if @provider.nil?
|
|
157
|
+
return false if @calendar.nil?
|
|
158
|
+
return false if @changed_at.nil?
|
|
159
|
+
true
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Custom attribute writer method with validation
|
|
163
|
+
# @param [Object] workspace_id Value to be assigned
|
|
164
|
+
def workspace_id=(workspace_id)
|
|
165
|
+
if workspace_id.nil?
|
|
166
|
+
fail ArgumentError, 'workspace_id cannot be nil'
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
@workspace_id = workspace_id
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method with validation
|
|
173
|
+
# @param [Object] provider Value to be assigned
|
|
174
|
+
def provider=(provider)
|
|
175
|
+
if provider.nil?
|
|
176
|
+
fail ArgumentError, 'provider cannot be nil'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
@provider = provider
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] calendar Value to be assigned
|
|
184
|
+
def calendar=(calendar)
|
|
185
|
+
if calendar.nil?
|
|
186
|
+
fail ArgumentError, 'calendar cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@calendar = calendar
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] changed_at Value to be assigned
|
|
194
|
+
def changed_at=(changed_at)
|
|
195
|
+
if changed_at.nil?
|
|
196
|
+
fail ArgumentError, 'changed_at cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@changed_at = changed_at
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Checks equality by comparing each attribute.
|
|
203
|
+
# @param [Object] Object to be compared
|
|
204
|
+
def ==(o)
|
|
205
|
+
return true if self.equal?(o)
|
|
206
|
+
self.class == o.class &&
|
|
207
|
+
workspace_id == o.workspace_id &&
|
|
208
|
+
provider == o.provider &&
|
|
209
|
+
account_id == o.account_id &&
|
|
210
|
+
connection_id == o.connection_id &&
|
|
211
|
+
calendar == o.calendar &&
|
|
212
|
+
changed_at == o.changed_at
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# @see the `==` method
|
|
216
|
+
# @param [Object] Object to be compared
|
|
217
|
+
def eql?(o)
|
|
218
|
+
self == o
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Calculates hash code according to all attributes.
|
|
222
|
+
# @return [Integer] Hash code
|
|
223
|
+
def hash
|
|
224
|
+
[workspace_id, provider, account_id, connection_id, calendar, changed_at].hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Builds the object from hash
|
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
229
|
+
# @return [Object] Returns the model itself
|
|
230
|
+
def self.build_from_hash(attributes)
|
|
231
|
+
return nil unless attributes.is_a?(Hash)
|
|
232
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
233
|
+
transformed_hash = {}
|
|
234
|
+
openapi_types.each_pair do |key, type|
|
|
235
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
236
|
+
transformed_hash["#{key}"] = nil
|
|
237
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
238
|
+
# check to ensure the input is an array given that the attribute
|
|
239
|
+
# is documented as an array but the input is not
|
|
240
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
241
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
242
|
+
end
|
|
243
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
244
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
new(transformed_hash)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Returns the object in the form of hash
|
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
|
252
|
+
def to_hash
|
|
253
|
+
hash = {}
|
|
254
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
255
|
+
value = self.send(attr)
|
|
256
|
+
if value.nil?
|
|
257
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
258
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
hash[param] = _to_hash(value)
|
|
262
|
+
end
|
|
263
|
+
hash
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
end
|
|
@@ -21,7 +21,7 @@ module Repull
|
|
|
21
21
|
|
|
22
22
|
attr_accessor :create
|
|
23
23
|
|
|
24
|
-
# Vrbo: push this listing's prices and availability to Vrbo. Omit to follow the connection's access type (`messaging` = off, `full_access` = on). A new listing (`create`) always follows the access type. Other channels ignore it.
|
|
24
|
+
# Vrbo: push this listing's prices and availability to Vrbo. Omit to follow the connection's access type (`messaging` = off, `full_access` = on). A new listing (`create`) always follows the access type. Other channels ignore it. `true` returns `409 calendar_managed_elsewhere` while Vrbo says another tool (such as a PMS) manages the account's calendar (`calendar.managedBy` on `GET /v1/connect/vrbo-login`); see https://repull.dev/docs/channels/vrbo/calendar-managed-elsewhere.
|
|
25
25
|
attr_accessor :calendar_sync
|
|
26
26
|
|
|
27
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -45,6 +45,9 @@ module Repull
|
|
|
45
45
|
# Vrbo only. When Vrbo's first notification reached `notificationEmail`, i.e. the host added it with notifications on. `null` until then.
|
|
46
46
|
attr_accessor :notification_received_at
|
|
47
47
|
|
|
48
|
+
# Vrbo only. Whether another tool (such as a PMS) manages this account's calendar; while `calendar.managedBy` is set, calendar sync is off for all its units.
|
|
49
|
+
attr_accessor :calendar
|
|
50
|
+
|
|
48
51
|
# Vrbo only. The address the host can add on Vrbo as a secondary email (with message and reservation notifications on) so new bookings, inquiries and messages arrive within a minute instead of at the scheduled check. Ask every host to add it: notifications are how Vrbo updates reach Repull, the scheduled check is the backup. Hosted Connect shows it on its mapping screen; show it in your own app when you create sessions with `mapping: \"api\"`.
|
|
49
52
|
attr_accessor :notification_email
|
|
50
53
|
|
|
@@ -87,6 +90,7 @@ module Repull
|
|
|
87
90
|
:'action' => :'action',
|
|
88
91
|
:'fix_url' => :'fixUrl',
|
|
89
92
|
:'notification_received_at' => :'notificationReceivedAt',
|
|
93
|
+
:'calendar' => :'calendar',
|
|
90
94
|
:'notification_email' => :'notificationEmail',
|
|
91
95
|
:'import' => :'import'
|
|
92
96
|
}
|
|
@@ -116,6 +120,7 @@ module Repull
|
|
|
116
120
|
:'action' => :'Object',
|
|
117
121
|
:'fix_url' => :'String',
|
|
118
122
|
:'notification_received_at' => :'Time',
|
|
123
|
+
:'calendar' => :'VrboCalendarAccess',
|
|
119
124
|
:'notification_email' => :'String',
|
|
120
125
|
:'import' => :'VrboImportStatus'
|
|
121
126
|
}
|
|
@@ -134,6 +139,7 @@ module Repull
|
|
|
134
139
|
:'action',
|
|
135
140
|
:'fix_url',
|
|
136
141
|
:'notification_received_at',
|
|
142
|
+
:'calendar',
|
|
137
143
|
:'notification_email',
|
|
138
144
|
:'import'
|
|
139
145
|
])
|
|
@@ -199,6 +205,10 @@ module Repull
|
|
|
199
205
|
self.notification_received_at = attributes[:'notification_received_at']
|
|
200
206
|
end
|
|
201
207
|
|
|
208
|
+
if attributes.key?(:'calendar')
|
|
209
|
+
self.calendar = attributes[:'calendar']
|
|
210
|
+
end
|
|
211
|
+
|
|
202
212
|
if attributes.key?(:'notification_email')
|
|
203
213
|
self.notification_email = attributes[:'notification_email']
|
|
204
214
|
end
|
|
@@ -239,6 +249,7 @@ module Repull
|
|
|
239
249
|
action == o.action &&
|
|
240
250
|
fix_url == o.fix_url &&
|
|
241
251
|
notification_received_at == o.notification_received_at &&
|
|
252
|
+
calendar == o.calendar &&
|
|
242
253
|
notification_email == o.notification_email &&
|
|
243
254
|
import == o.import
|
|
244
255
|
end
|
|
@@ -252,7 +263,7 @@ module Repull
|
|
|
252
263
|
# Calculates hash code according to all attributes.
|
|
253
264
|
# @return [Integer] Hash code
|
|
254
265
|
def hash
|
|
255
|
-
[external_account_id, connection_id, name, picture_url, status, connected, email, access_type, action, fix_url, notification_received_at, notification_email, import].hash
|
|
266
|
+
[external_account_id, connection_id, name, picture_url, status, connected, email, access_type, action, fix_url, notification_received_at, calendar, notification_email, import].hash
|
|
256
267
|
end
|
|
257
268
|
|
|
258
269
|
# Builds the object from hash
|