repull 0.2.59 → 0.2.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +17 -17
  3. data/lib/repull/api/connect_api.rb +10 -10
  4. data/lib/repull/api/connections_api.rb +4 -4
  5. data/lib/repull/api/reviews_api.rb +4 -4
  6. data/lib/repull/models/account_import.rb +1 -1
  7. data/lib/repull/models/airbnb_data_freshness.rb +1 -1
  8. data/lib/repull/models/airbnb_reservation.rb +346 -6
  9. data/lib/repull/models/airbnb_reservation_detail.rb +679 -0
  10. data/lib/repull/models/airbnb_reservation_detail_response.rb +173 -0
  11. data/lib/repull/models/airbnb_transaction.rb +1 -1
  12. data/lib/repull/models/airbnb_transaction_payout.rb +2 -2
  13. data/lib/repull/models/connect_provider_session.rb +266 -0
  14. data/lib/repull/models/connect_status.rb +12 -1
  15. data/lib/repull/models/connection.rb +16 -5
  16. data/lib/repull/models/create_connect_session_request.rb +2 -2
  17. data/lib/repull/models/create_connection_request.rb +3 -2
  18. data/lib/repull/models/create_price_labs_key201_response.rb +12 -1
  19. data/lib/repull/models/guest.rb +4 -2
  20. data/lib/repull/models/hospitable_webhook.rb +218 -0
  21. data/lib/repull/models/review.rb +1 -1
  22. data/lib/repull/models/start_connection_import202_response_data.rb +32 -6
  23. data/lib/repull/models/start_connection_import_request.rb +3 -5
  24. data/lib/repull/models/submit_hospitable_credentials200_response.rb +169 -0
  25. data/lib/repull/models/sync_airbnb_transactions200_response_accounts_inner.rb +1 -1
  26. data/lib/repull/models/sync_airbnb_transactions_request.rb +1 -1
  27. data/lib/repull/version.rb +1 -1
  28. data/lib/repull.rb +5 -0
  29. data/openapi/v1.json +569 -41
  30. metadata +6 -1
@@ -63,6 +63,9 @@ module Repull
63
63
  # Apps only: how the app is doing on this connection. `null` once disconnected.
64
64
  attr_accessor :health
65
65
 
66
+ # Hospitable only: the webhook URL the host pastes into Hospitable (Apps → Webhooks → + Add new) and whether deliveries are arriving. Show it in your own UI so the host can set it up. Absent for other providers.
67
+ attr_accessor :webhook
68
+
66
69
  # The key to paste into PriceLabs. Returned only here.
67
70
  attr_accessor :key
68
71
 
@@ -110,6 +113,7 @@ module Repull
110
113
  :'label' => :'label',
111
114
  :'disconnected_at' => :'disconnectedAt',
112
115
  :'health' => :'health',
116
+ :'webhook' => :'webhook',
113
117
  :'key' => :'key',
114
118
  :'instructions' => :'instructions'
115
119
  }
@@ -145,6 +149,7 @@ module Repull
145
149
  :'label' => :'String',
146
150
  :'disconnected_at' => :'Time',
147
151
  :'health' => :'AppConnectionHealth',
152
+ :'webhook' => :'HospitableWebhook',
148
153
  :'key' => :'String',
149
154
  :'instructions' => :'CreatePriceLabsKey201ResponseAllOfInstructions'
150
155
  }
@@ -163,6 +168,7 @@ module Repull
163
168
  :'label',
164
169
  :'disconnected_at',
165
170
  :'health',
171
+ :'webhook',
166
172
  ])
167
173
  end
168
174
 
@@ -259,6 +265,10 @@ module Repull
259
265
  self.health = attributes[:'health']
260
266
  end
261
267
 
268
+ if attributes.key?(:'webhook')
269
+ self.webhook = attributes[:'webhook']
270
+ end
271
+
262
272
  if attributes.key?(:'key')
263
273
  self.key = attributes[:'key']
264
274
  else
@@ -339,6 +349,7 @@ module Repull
339
349
  label == o.label &&
340
350
  disconnected_at == o.disconnected_at &&
341
351
  health == o.health &&
352
+ webhook == o.webhook &&
342
353
  key == o.key &&
343
354
  instructions == o.instructions
344
355
  end
@@ -352,7 +363,7 @@ module Repull
352
363
  # Calculates hash code according to all attributes.
353
364
  # @return [Integer] Hash code
354
365
  def hash
355
- [id, provider, status, external_account_id, access_type, created_at, host, action, fix_url, import, scope, listing_ids, listing_count, key_masked, label, disconnected_at, health, key, instructions].hash
366
+ [id, provider, status, external_account_id, access_type, created_at, host, action, fix_url, import, scope, listing_ids, listing_count, key_masked, label, disconnected_at, health, webhook, key, instructions].hash
356
367
  end
357
368
 
358
369
  # Builds the object from hash
@@ -45,8 +45,10 @@ module Repull
45
45
  # Decimal-as-string to preserve precision across mixed-currency totals.
46
46
  attr_accessor :total_revenue
47
47
 
48
+ # Check-out date of the guest's most recent stay (YYYY-MM-DD).
48
49
  attr_accessor :last_stayed_at
49
50
 
51
+ # Check-in date of the guest's first stay (YYYY-MM-DD).
50
52
  attr_accessor :first_stayed_at
51
53
 
52
54
  attr_accessor :created_at
@@ -115,8 +117,8 @@ module Repull
115
117
  :'email' => :'String',
116
118
  :'total_reservations' => :'Integer',
117
119
  :'total_revenue' => :'String',
118
- :'last_stayed_at' => :'Time',
119
- :'first_stayed_at' => :'Time',
120
+ :'last_stayed_at' => :'Date',
121
+ :'first_stayed_at' => :'Date',
120
122
  :'created_at' => :'Time'
121
123
  }
122
124
  end
@@ -0,0 +1,218 @@
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
+ # Hospitable only. Hospitable has no API to subscribe webhooks, so the host adds one in Hospitable: **Apps → Webhooks → + Add new**, pastes `url`, ticks Reservations, Messages, Properties and Reviews, and saves (Hospitable's **Test** button sends a sample right away). Each connection has its own `url`; a reconnect keeps it. Every delivery is checked against Hospitable's signature before it is used. **Polling.** While `status` is `receiving` the connection is updated from the webhooks alone and is not polled. When it is `not_configured` or `stale` it is polled every minute, and the first poll after going stale re-reads the whole silent window, so nothing is lost. A quiet account (no bookings or messages for a day) can read `stale` while its webhook still works; the next delivery flips it back to `receiving`.
18
+ class HospitableWebhook < ApiModelBase
19
+ # The webhook URL to paste into Hospitable. Unique to this connection.
20
+ attr_accessor :url
21
+
22
+ # `not_configured`: no delivery yet (the host has not added the URL). `receiving`: a delivery arrived in the last 24 hours. `stale`: deliveries arrived before, none in the last 24 hours.
23
+ attr_accessor :status
24
+
25
+ # When the last verified delivery arrived; `null` before the first.
26
+ attr_accessor :last_received_at
27
+
28
+ # The webhook types to tick in Hospitable.
29
+ attr_accessor :events
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'url' => :'url',
35
+ :'status' => :'status',
36
+ :'last_received_at' => :'lastReceivedAt',
37
+ :'events' => :'events'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'url' => :'String',
55
+ :'status' => :'String',
56
+ :'last_received_at' => :'Time',
57
+ :'events' => :'Array<String>'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'last_received_at',
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::HospitableWebhook` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::HospitableWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'url')
85
+ self.url = attributes[:'url']
86
+ else
87
+ self.url = nil
88
+ end
89
+
90
+ if attributes.key?(:'status')
91
+ self.status = attributes[:'status']
92
+ else
93
+ self.status = nil
94
+ end
95
+
96
+ if attributes.key?(:'last_received_at')
97
+ self.last_received_at = attributes[:'last_received_at']
98
+ else
99
+ self.last_received_at = nil
100
+ end
101
+
102
+ if attributes.key?(:'events')
103
+ if (value = attributes[:'events']).is_a?(Array)
104
+ self.events = value
105
+ end
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ if @url.nil?
115
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
116
+ end
117
+
118
+ if @status.nil?
119
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
120
+ end
121
+
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
129
+ return false if @url.nil?
130
+ return false if @status.nil?
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] url Value to be assigned
136
+ def url=(url)
137
+ if url.nil?
138
+ fail ArgumentError, 'url cannot be nil'
139
+ end
140
+
141
+ @url = url
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] status Value to be assigned
146
+ def status=(status)
147
+ if status.nil?
148
+ fail ArgumentError, 'status cannot be nil'
149
+ end
150
+
151
+ @status = status
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ url == o.url &&
160
+ status == o.status &&
161
+ last_received_at == o.last_received_at &&
162
+ events == o.events
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [url, status, last_received_at, events].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ transformed_hash = {}
184
+ openapi_types.each_pair do |key, type|
185
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = nil
187
+ elsif type =~ /\AArray<(.*)>/i
188
+ # check to ensure the input is an array given that the attribute
189
+ # is documented as an array but the input is not
190
+ if attributes[attribute_map[key]].is_a?(Array)
191
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
192
+ end
193
+ elsif !attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
195
+ end
196
+ end
197
+ new(transformed_hash)
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -27,7 +27,7 @@ module Repull
27
27
 
28
28
  attr_accessor :platform
29
29
 
30
- # The PMS this review was read from (`guesty`, `hostaway`, …) when it came through one — `platform` is still the channel the guest wrote it on. A reply (`POST /v1/reviews/{id}/reply`) goes through this PMS; `GET /v1/connect/{provider}` → `capabilities.pms.reviews.reply` says whether it can. `null` for a review from a directly connected channel.
30
+ # The PMS this review was read from (`guesty`, `hostaway`, `hospitable`, …) when it came through one — `platform` is still the channel the guest wrote it on, and `reservationId` / `reservationConfirmationCode` point at the stay. A review that also arrives from a directly connected channel is returned once, as the channel's copy (`pms: null`). A reply (`POST /v1/reviews/{id}/reply`) goes through this PMS; `GET /v1/connect/{provider}` → `capabilities.pms.reviews.reply` says whether it can. `null` for a review from a directly connected channel.
31
31
  attr_accessor :pms
32
32
 
33
33
  # Internal Repull listing id the review is attached to.
@@ -24,6 +24,12 @@ module Repull
24
24
 
25
25
  attr_accessor :queued_at
26
26
 
27
+ # The import's id on `GET /v1/connections/{id}/imports` and in the `account.import.*` webhooks.
28
+ attr_accessor :import_id
29
+
30
+ # `full` only: an earlier import of this account that no worker had picked up, closed as `failed` (`did_not_start`) and replaced by this one.
31
+ attr_accessor :replaced_import_id
32
+
27
33
  class EnumAttributeValidator
28
34
  attr_reader :datatype
29
35
  attr_reader :allowable_values
@@ -52,7 +58,9 @@ module Repull
52
58
  :'connection' => :'connection',
53
59
  :'scope' => :'scope',
54
60
  :'status' => :'status',
55
- :'queued_at' => :'queuedAt'
61
+ :'queued_at' => :'queuedAt',
62
+ :'import_id' => :'importId',
63
+ :'replaced_import_id' => :'replacedImportId'
56
64
  }
57
65
  end
58
66
 
@@ -72,13 +80,17 @@ module Repull
72
80
  :'connection' => :'String',
73
81
  :'scope' => :'String',
74
82
  :'status' => :'String',
75
- :'queued_at' => :'Time'
83
+ :'queued_at' => :'Time',
84
+ :'import_id' => :'String',
85
+ :'replaced_import_id' => :'String'
76
86
  }
77
87
  end
78
88
 
79
89
  # List of attributes with nullable: true
80
90
  def self.openapi_nullable
81
91
  Set.new([
92
+ :'import_id',
93
+ :'replaced_import_id'
82
94
  ])
83
95
  end
84
96
 
@@ -121,6 +133,18 @@ module Repull
121
133
  else
122
134
  self.queued_at = nil
123
135
  end
136
+
137
+ if attributes.key?(:'import_id')
138
+ self.import_id = attributes[:'import_id']
139
+ else
140
+ self.import_id = nil
141
+ end
142
+
143
+ if attributes.key?(:'replaced_import_id')
144
+ self.replaced_import_id = attributes[:'replaced_import_id']
145
+ else
146
+ self.replaced_import_id = nil
147
+ end
124
148
  end
125
149
 
126
150
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -153,7 +177,7 @@ module Repull
153
177
  warn '[DEPRECATED] the `valid?` method is obsolete'
154
178
  return false if @connection.nil?
155
179
  return false if @scope.nil?
156
- scope_validator = EnumAttributeValidator.new('String', ["listings"])
180
+ scope_validator = EnumAttributeValidator.new('String', ["listings", "full"])
157
181
  return false unless scope_validator.valid?(@scope)
158
182
  return false if @status.nil?
159
183
  status_validator = EnumAttributeValidator.new('String', ["queued"])
@@ -175,7 +199,7 @@ module Repull
175
199
  # Custom attribute writer method checking allowed values (enum).
176
200
  # @param [Object] scope Object to be assigned
177
201
  def scope=(scope)
178
- validator = EnumAttributeValidator.new('String', ["listings"])
202
+ validator = EnumAttributeValidator.new('String', ["listings", "full"])
179
203
  unless validator.valid?(scope)
180
204
  fail ArgumentError, "invalid value for \"scope\", must be one of #{validator.allowable_values}."
181
205
  end
@@ -210,7 +234,9 @@ module Repull
210
234
  connection == o.connection &&
211
235
  scope == o.scope &&
212
236
  status == o.status &&
213
- queued_at == o.queued_at
237
+ queued_at == o.queued_at &&
238
+ import_id == o.import_id &&
239
+ replaced_import_id == o.replaced_import_id
214
240
  end
215
241
 
216
242
  # @see the `==` method
@@ -222,7 +248,7 @@ module Repull
222
248
  # Calculates hash code according to all attributes.
223
249
  # @return [Integer] Hash code
224
250
  def hash
225
- [connection, scope, status, queued_at].hash
251
+ [connection, scope, status, queued_at, import_id, replaced_import_id].hash
226
252
  end
227
253
 
228
254
  # Builds the object from hash
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Repull
17
17
  class StartConnectionImportRequest < ApiModelBase
18
- # What to import. `listings` = the account's listings. New listings come in with their calendar (pricing and availability); on a full-access connection, calendars of listings already in Repull are not re-read. The only scope; the full import runs when an account is connected.
18
+ # What to import. `full` = the first-connect import again (listings, calendars, reservations, payouts, reviews, conversations), for an account that has never fully imported. `listings` = the account's listings with their calendars. Omit to let Repull choose: `full` for an account that has never fully imported, else `listings`.
19
19
  attr_accessor :scope
20
20
 
21
21
  class EnumAttributeValidator
@@ -88,8 +88,6 @@ module Repull
88
88
 
89
89
  if attributes.key?(:'scope')
90
90
  self.scope = attributes[:'scope']
91
- else
92
- self.scope = 'listings'
93
91
  end
94
92
  end
95
93
 
@@ -105,7 +103,7 @@ module Repull
105
103
  # @return true if the model is valid
106
104
  def valid?
107
105
  warn '[DEPRECATED] the `valid?` method is obsolete'
108
- scope_validator = EnumAttributeValidator.new('String', ["listings"])
106
+ scope_validator = EnumAttributeValidator.new('String', ["listings", "full"])
109
107
  return false unless scope_validator.valid?(@scope)
110
108
  true
111
109
  end
@@ -113,7 +111,7 @@ module Repull
113
111
  # Custom attribute writer method checking allowed values (enum).
114
112
  # @param [Object] scope Object to be assigned
115
113
  def scope=(scope)
116
- validator = EnumAttributeValidator.new('String', ["listings"])
114
+ validator = EnumAttributeValidator.new('String', ["listings", "full"])
117
115
  unless validator.valid?(scope)
118
116
  fail ArgumentError, "invalid value for \"scope\", must be one of #{validator.allowable_values}."
119
117
  end
@@ -0,0 +1,169 @@
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 SubmitHospitableCredentials200Response < ApiModelBase
18
+ attr_accessor :ok
19
+
20
+ attr_accessor :account_info
21
+
22
+ # The webhook URL to show the host: in Hospitable, Apps → Webhooks → + Add new, paste it, tick Reservations, Messages, Properties and Reviews. Optional — without it the connection is polled every minute. `null` if it could not be set up.
23
+ attr_accessor :webhook
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'ok' => :'ok',
29
+ :'account_info' => :'accountInfo',
30
+ :'webhook' => :'webhook'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'ok' => :'Boolean',
48
+ :'account_info' => :'Hash<String, Object>',
49
+ :'webhook' => :'HospitableWebhook'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ :'webhook'
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::SubmitHospitableCredentials200Response` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ acceptable_attribute_map = self.class.acceptable_attribute_map
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!acceptable_attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::SubmitHospitableCredentials200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'ok')
77
+ self.ok = attributes[:'ok']
78
+ end
79
+
80
+ if attributes.key?(:'account_info')
81
+ if (value = attributes[:'account_info']).is_a?(Hash)
82
+ self.account_info = value
83
+ end
84
+ end
85
+
86
+ if attributes.key?(:'webhook')
87
+ self.webhook = attributes[:'webhook']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ ok == o.ok &&
112
+ account_info == o.account_info &&
113
+ webhook == o.webhook
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [ok, account_info, webhook].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ self.class.attribute_map.each_pair do |attr, param|
156
+ value = self.send(attr)
157
+ if value.nil?
158
+ is_nullable = self.class.openapi_nullable.include?(attr)
159
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
160
+ end
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ end
168
+
169
+ end
@@ -23,7 +23,7 @@ module Repull
23
23
  # Payouts in the refreshed window.
24
24
  attr_accessor :payouts
25
25
 
26
- # UPCOMING lines Airbnb no longer lists (paid out or cancelled) and were removed.
26
+ # Unpaid (RELEASED / UPCOMING) lines Airbnb no longer lists (paid out or cancelled) and were removed.
27
27
  attr_accessor :upcoming_removed
28
28
 
29
29
  attr_accessor :error
@@ -21,7 +21,7 @@ module Repull
21
21
  # Inclusive upper bound (YYYY-MM-DD).
22
22
  attr_accessor :end_date
23
23
 
24
- # Refresh only settled or only upcoming lines. Both when omitted.
24
+ # Airbnb's two buckets: `COMPLETED` refreshes paid-out lines only, `UPCOMING` every unpaid line (`RELEASED` and `UPCOMING`). Both when omitted.
25
25
  attr_accessor :transaction_type
26
26
 
27
27
  class EnumAttributeValidator
@@ -11,5 +11,5 @@ Generator version: 7.22.0
11
11
  =end
12
12
 
13
13
  module Repull
14
- VERSION = '0.2.59'
14
+ VERSION = '0.2.61'
15
15
  end