repull 0.2.51 → 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/listings_api.rb +63 -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/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/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/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 +6 -0
- data/openapi/v1.json +263 -1
- metadata +8 -2
|
@@ -0,0 +1,285 @@
|
|
|
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 GetListingIcal200ResponseVrboInner < ApiModelBase
|
|
18
|
+
# The Vrbo listing number (`unitId` on `GET /v1/connections/{id}/units`).
|
|
19
|
+
attr_accessor :unit_id
|
|
20
|
+
|
|
21
|
+
# Calendar sync is on for the unit.
|
|
22
|
+
attr_accessor :calendar_sync
|
|
23
|
+
|
|
24
|
+
# `imported`: Vrbo imports the feed. `pending`: calendar sync is on and Repull has not checked the unit yet — it adds the feed itself. `failed`: Vrbo did not take it; ask the host to add `url` in Vrbo → Calendar → Import calendar, named \"Repull\". `not_imported`: checked, not there, and not added (for example, the feed is turned off). `off`: calendar sync is off, so Repull leaves the unit's imported calendars alone.
|
|
25
|
+
attr_accessor :status
|
|
26
|
+
|
|
27
|
+
# Names of other calendars the unit still imports, as Vrbo shows them.
|
|
28
|
+
attr_accessor :other_feeds
|
|
29
|
+
|
|
30
|
+
# When Repull last read the unit's imported calendars.
|
|
31
|
+
attr_accessor :checked_at
|
|
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
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'unit_id' => :'unitId',
|
|
59
|
+
:'calendar_sync' => :'calendarSync',
|
|
60
|
+
:'status' => :'status',
|
|
61
|
+
:'other_feeds' => :'otherFeeds',
|
|
62
|
+
:'checked_at' => :'checkedAt'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'unit_id' => :'String',
|
|
80
|
+
:'calendar_sync' => :'Boolean',
|
|
81
|
+
:'status' => :'String',
|
|
82
|
+
:'other_feeds' => :'Array<String>',
|
|
83
|
+
:'checked_at' => :'Time'
|
|
84
|
+
}
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# List of attributes with nullable: true
|
|
88
|
+
def self.openapi_nullable
|
|
89
|
+
Set.new([
|
|
90
|
+
:'checked_at'
|
|
91
|
+
])
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Initializes the object
|
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
96
|
+
def initialize(attributes = {})
|
|
97
|
+
if (!attributes.is_a?(Hash))
|
|
98
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetListingIcal200ResponseVrboInner` initialize method"
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
103
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
104
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetListingIcal200ResponseVrboInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
106
|
+
end
|
|
107
|
+
h[k.to_sym] = v
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'unit_id')
|
|
111
|
+
self.unit_id = attributes[:'unit_id']
|
|
112
|
+
else
|
|
113
|
+
self.unit_id = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'calendar_sync')
|
|
117
|
+
self.calendar_sync = attributes[:'calendar_sync']
|
|
118
|
+
else
|
|
119
|
+
self.calendar_sync = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'status')
|
|
123
|
+
self.status = attributes[:'status']
|
|
124
|
+
else
|
|
125
|
+
self.status = nil
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'other_feeds')
|
|
129
|
+
if (value = attributes[:'other_feeds']).is_a?(Array)
|
|
130
|
+
self.other_feeds = value
|
|
131
|
+
end
|
|
132
|
+
else
|
|
133
|
+
self.other_feeds = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'checked_at')
|
|
137
|
+
self.checked_at = attributes[:'checked_at']
|
|
138
|
+
else
|
|
139
|
+
self.checked_at = nil
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
144
|
+
# @return Array for valid properties with the reasons
|
|
145
|
+
def list_invalid_properties
|
|
146
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
147
|
+
invalid_properties = Array.new
|
|
148
|
+
if @unit_id.nil?
|
|
149
|
+
invalid_properties.push('invalid value for "unit_id", unit_id cannot be nil.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if @calendar_sync.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "calendar_sync", calendar_sync cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if @status.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @other_feeds.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "other_feeds", other_feeds cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
invalid_properties
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Check to see if the all the properties in the model are valid
|
|
168
|
+
# @return true if the model is valid
|
|
169
|
+
def valid?
|
|
170
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
171
|
+
return false if @unit_id.nil?
|
|
172
|
+
return false if @calendar_sync.nil?
|
|
173
|
+
return false if @status.nil?
|
|
174
|
+
status_validator = EnumAttributeValidator.new('String', ["imported", "pending", "failed", "not_imported", "off"])
|
|
175
|
+
return false unless status_validator.valid?(@status)
|
|
176
|
+
return false if @other_feeds.nil?
|
|
177
|
+
true
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Custom attribute writer method with validation
|
|
181
|
+
# @param [Object] unit_id Value to be assigned
|
|
182
|
+
def unit_id=(unit_id)
|
|
183
|
+
if unit_id.nil?
|
|
184
|
+
fail ArgumentError, 'unit_id cannot be nil'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@unit_id = unit_id
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Custom attribute writer method with validation
|
|
191
|
+
# @param [Object] calendar_sync Value to be assigned
|
|
192
|
+
def calendar_sync=(calendar_sync)
|
|
193
|
+
if calendar_sync.nil?
|
|
194
|
+
fail ArgumentError, 'calendar_sync cannot be nil'
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
@calendar_sync = calendar_sync
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
201
|
+
# @param [Object] status Object to be assigned
|
|
202
|
+
def status=(status)
|
|
203
|
+
validator = EnumAttributeValidator.new('String', ["imported", "pending", "failed", "not_imported", "off"])
|
|
204
|
+
unless validator.valid?(status)
|
|
205
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
206
|
+
end
|
|
207
|
+
@status = status
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Custom attribute writer method with validation
|
|
211
|
+
# @param [Object] other_feeds Value to be assigned
|
|
212
|
+
def other_feeds=(other_feeds)
|
|
213
|
+
if other_feeds.nil?
|
|
214
|
+
fail ArgumentError, 'other_feeds cannot be nil'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@other_feeds = other_feeds
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Checks equality by comparing each attribute.
|
|
221
|
+
# @param [Object] Object to be compared
|
|
222
|
+
def ==(o)
|
|
223
|
+
return true if self.equal?(o)
|
|
224
|
+
self.class == o.class &&
|
|
225
|
+
unit_id == o.unit_id &&
|
|
226
|
+
calendar_sync == o.calendar_sync &&
|
|
227
|
+
status == o.status &&
|
|
228
|
+
other_feeds == o.other_feeds &&
|
|
229
|
+
checked_at == o.checked_at
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# @see the `==` method
|
|
233
|
+
# @param [Object] Object to be compared
|
|
234
|
+
def eql?(o)
|
|
235
|
+
self == o
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Calculates hash code according to all attributes.
|
|
239
|
+
# @return [Integer] Hash code
|
|
240
|
+
def hash
|
|
241
|
+
[unit_id, calendar_sync, status, other_feeds, checked_at].hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Builds the object from hash
|
|
245
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
246
|
+
# @return [Object] Returns the model itself
|
|
247
|
+
def self.build_from_hash(attributes)
|
|
248
|
+
return nil unless attributes.is_a?(Hash)
|
|
249
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
250
|
+
transformed_hash = {}
|
|
251
|
+
openapi_types.each_pair do |key, type|
|
|
252
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
253
|
+
transformed_hash["#{key}"] = nil
|
|
254
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
255
|
+
# check to ensure the input is an array given that the attribute
|
|
256
|
+
# is documented as an array but the input is not
|
|
257
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
258
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
259
|
+
end
|
|
260
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
261
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
new(transformed_hash)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Returns the object in the form of hash
|
|
268
|
+
# @return [Hash] Returns the object in the form of hash
|
|
269
|
+
def to_hash
|
|
270
|
+
hash = {}
|
|
271
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
272
|
+
value = self.send(attr)
|
|
273
|
+
if value.nil?
|
|
274
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
275
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
hash[param] = _to_hash(value)
|
|
279
|
+
end
|
|
280
|
+
hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|
|
@@ -39,6 +39,9 @@ module Repull
|
|
|
39
39
|
|
|
40
40
|
attr_accessor :error_code
|
|
41
41
|
|
|
42
|
+
# The repull.dev dashboard page this call was run from (`keys`, `playground`, `quickstart`, `connect`, `settings/connect`), or null for a call your own code made. Dashboard calls don't count toward your plan's request quota.
|
|
43
|
+
attr_accessor :dashboard_surface
|
|
44
|
+
|
|
42
45
|
attr_accessor :created_at
|
|
43
46
|
|
|
44
47
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -56,6 +59,7 @@ module Repull
|
|
|
56
59
|
:'ip_address' => :'ipAddress',
|
|
57
60
|
:'user_agent' => :'userAgent',
|
|
58
61
|
:'error_code' => :'errorCode',
|
|
62
|
+
:'dashboard_surface' => :'dashboardSurface',
|
|
59
63
|
:'created_at' => :'createdAt'
|
|
60
64
|
}
|
|
61
65
|
end
|
|
@@ -85,6 +89,7 @@ module Repull
|
|
|
85
89
|
:'ip_address' => :'String',
|
|
86
90
|
:'user_agent' => :'String',
|
|
87
91
|
:'error_code' => :'String',
|
|
92
|
+
:'dashboard_surface' => :'String',
|
|
88
93
|
:'created_at' => :'Time'
|
|
89
94
|
}
|
|
90
95
|
end
|
|
@@ -101,6 +106,7 @@ module Repull
|
|
|
101
106
|
:'ip_address',
|
|
102
107
|
:'user_agent',
|
|
103
108
|
:'error_code',
|
|
109
|
+
:'dashboard_surface',
|
|
104
110
|
])
|
|
105
111
|
end
|
|
106
112
|
|
|
@@ -168,6 +174,10 @@ module Repull
|
|
|
168
174
|
self.error_code = attributes[:'error_code']
|
|
169
175
|
end
|
|
170
176
|
|
|
177
|
+
if attributes.key?(:'dashboard_surface')
|
|
178
|
+
self.dashboard_surface = attributes[:'dashboard_surface']
|
|
179
|
+
end
|
|
180
|
+
|
|
171
181
|
if attributes.key?(:'created_at')
|
|
172
182
|
self.created_at = attributes[:'created_at']
|
|
173
183
|
end
|
|
@@ -205,6 +215,7 @@ module Repull
|
|
|
205
215
|
ip_address == o.ip_address &&
|
|
206
216
|
user_agent == o.user_agent &&
|
|
207
217
|
error_code == o.error_code &&
|
|
218
|
+
dashboard_surface == o.dashboard_surface &&
|
|
208
219
|
created_at == o.created_at
|
|
209
220
|
end
|
|
210
221
|
|
|
@@ -217,7 +228,7 @@ module Repull
|
|
|
217
228
|
# Calculates hash code according to all attributes.
|
|
218
229
|
# @return [Integer] Hash code
|
|
219
230
|
def hash
|
|
220
|
-
[id, request_id, method, path, operation_id, status_code, latency_ms, request_bytes, response_bytes, ip_address, user_agent, error_code, created_at].hash
|
|
231
|
+
[id, request_id, method, path, operation_id, status_code, latency_ms, request_bytes, response_bytes, ip_address, user_agent, error_code, dashboard_surface, created_at].hash
|
|
221
232
|
end
|
|
222
233
|
|
|
223
234
|
# 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
|