repull 0.2.25 → 0.2.26

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.
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## 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`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ # Payload for `connect.session.completed`. A user finished a Connect session, on any channel or PMS. Use `state` (your token from session creation) or `sessionId` to tie the connection to your own user; the account it names is keyed the same way as every other event's `account` block.
18
+ class ConnectSessionCompletedPayload < ApiModelBase
19
+ attr_accessor :session_id
20
+
21
+ # The `state` you passed when creating the session.
22
+ attr_accessor :state
23
+
24
+ # Channel or PMS: airbnb, booking, booking_extranet, vrbo, plumguide, hostaway, …
25
+ attr_accessor :provider
26
+
27
+ # The provider's own account id — Airbnb host id, Booking.com hotel id, Vrbo account id, or the PMS account.
28
+ attr_accessor :external_account_id
29
+
30
+ # Repull connection id, when the account has one (the `X-Account-Id` value).
31
+ attr_accessor :connection_id
32
+
33
+ attr_accessor :purpose
34
+
35
+ attr_accessor :completed_at
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'session_id' => :'sessionId',
41
+ :'state' => :'state',
42
+ :'provider' => :'provider',
43
+ :'external_account_id' => :'externalAccountId',
44
+ :'connection_id' => :'connectionId',
45
+ :'purpose' => :'purpose',
46
+ :'completed_at' => :'completedAt'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'session_id' => :'String',
64
+ :'state' => :'String',
65
+ :'provider' => :'String',
66
+ :'external_account_id' => :'String',
67
+ :'connection_id' => :'Integer',
68
+ :'purpose' => :'String',
69
+ :'completed_at' => :'Time'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'state',
77
+ :'provider',
78
+ :'external_account_id',
79
+ :'connection_id',
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectSessionCompletedPayload` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectSessionCompletedPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'session_id')
100
+ self.session_id = attributes[:'session_id']
101
+ end
102
+
103
+ if attributes.key?(:'state')
104
+ self.state = attributes[:'state']
105
+ end
106
+
107
+ if attributes.key?(:'provider')
108
+ self.provider = attributes[:'provider']
109
+ end
110
+
111
+ if attributes.key?(:'external_account_id')
112
+ self.external_account_id = attributes[:'external_account_id']
113
+ end
114
+
115
+ if attributes.key?(:'connection_id')
116
+ self.connection_id = attributes[:'connection_id']
117
+ end
118
+
119
+ if attributes.key?(:'purpose')
120
+ self.purpose = attributes[:'purpose']
121
+ end
122
+
123
+ if attributes.key?(:'completed_at')
124
+ self.completed_at = attributes[:'completed_at']
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ warn '[DEPRECATED] the `valid?` method is obsolete'
140
+ true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ session_id == o.session_id &&
149
+ state == o.state &&
150
+ provider == o.provider &&
151
+ external_account_id == o.external_account_id &&
152
+ connection_id == o.connection_id &&
153
+ purpose == o.purpose &&
154
+ completed_at == o.completed_at
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [session_id, state, provider, external_account_id, connection_id, purpose, completed_at].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ transformed_hash = {}
176
+ openapi_types.each_pair do |key, type|
177
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[attribute_map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
+ end
185
+ elsif !attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
+ end
188
+ end
189
+ new(transformed_hash)
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ end
209
+
210
+ end
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Repull
17
17
  # Channel-agnostic message thread between the host workspace and a guest. Returned by `GET /v1/conversations`. The `id` is the internal Repull thread id (integer) — pass it back as the `{id}` path param on detail / messages calls.
18
18
  class Conversation < ApiModelBase
19
+ # The connected account this conversation belongs to. List endpoint.
20
+ attr_accessor :account
21
+
19
22
  attr_accessor :id
20
23
 
21
24
  attr_accessor :platform
@@ -49,6 +52,7 @@ module Repull
49
52
  # Attribute mapping from ruby-style variable name to JSON key.
50
53
  def self.attribute_map
51
54
  {
55
+ :'account' => :'account',
52
56
  :'id' => :'id',
53
57
  :'platform' => :'platform',
54
58
  :'external_thread_id' => :'externalThreadId',
@@ -78,6 +82,7 @@ module Repull
78
82
  # Attribute type mapping.
79
83
  def self.openapi_types
80
84
  {
85
+ :'account' => :'RecordAccount',
81
86
  :'id' => :'String',
82
87
  :'platform' => :'String',
83
88
  :'external_thread_id' => :'String',
@@ -97,6 +102,7 @@ module Repull
97
102
  # List of attributes with nullable: true
98
103
  def self.openapi_nullable
99
104
  Set.new([
105
+ :'account',
100
106
  :'platform',
101
107
  :'external_thread_id',
102
108
  :'guest_id',
@@ -124,6 +130,10 @@ module Repull
124
130
  h[k.to_sym] = v
125
131
  }
126
132
 
133
+ if attributes.key?(:'account')
134
+ self.account = attributes[:'account']
135
+ end
136
+
127
137
  if attributes.key?(:'id')
128
138
  self.id = attributes[:'id']
129
139
  end
@@ -197,6 +207,7 @@ module Repull
197
207
  def ==(o)
198
208
  return true if self.equal?(o)
199
209
  self.class == o.class &&
210
+ account == o.account &&
200
211
  id == o.id &&
201
212
  platform == o.platform &&
202
213
  external_thread_id == o.external_thread_id &&
@@ -221,7 +232,7 @@ module Repull
221
232
  # Calculates hash code according to all attributes.
222
233
  # @return [Integer] Hash code
223
234
  def hash
224
- [id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at].hash
235
+ [account, id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at].hash
225
236
  end
226
237
 
227
238
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Repull
17
17
  # Returned by `GET /v1/conversations/{id}`. Extends the list-row `Conversation` shape with expanded `host` + `guest` blocks so SDK consumers can render thread headers without an extra round-trip.
18
18
  class ConversationDetail < ApiModelBase
19
+ # The connected account this conversation belongs to. List endpoint.
20
+ attr_accessor :account
21
+
19
22
  attr_accessor :id
20
23
 
21
24
  attr_accessor :platform
@@ -55,6 +58,7 @@ module Repull
55
58
  # Attribute mapping from ruby-style variable name to JSON key.
56
59
  def self.attribute_map
57
60
  {
61
+ :'account' => :'account',
58
62
  :'id' => :'id',
59
63
  :'platform' => :'platform',
60
64
  :'external_thread_id' => :'externalThreadId',
@@ -87,6 +91,7 @@ module Repull
87
91
  # Attribute type mapping.
88
92
  def self.openapi_types
89
93
  {
94
+ :'account' => :'RecordAccount',
90
95
  :'id' => :'String',
91
96
  :'platform' => :'String',
92
97
  :'external_thread_id' => :'String',
@@ -109,6 +114,7 @@ module Repull
109
114
  # List of attributes with nullable: true
110
115
  def self.openapi_nullable
111
116
  Set.new([
117
+ :'account',
112
118
  :'platform',
113
119
  :'external_thread_id',
114
120
  :'guest_id',
@@ -145,6 +151,10 @@ module Repull
145
151
  h[k.to_sym] = v
146
152
  }
147
153
 
154
+ if attributes.key?(:'account')
155
+ self.account = attributes[:'account']
156
+ end
157
+
148
158
  if attributes.key?(:'id')
149
159
  self.id = attributes[:'id']
150
160
  end
@@ -230,6 +240,7 @@ module Repull
230
240
  def ==(o)
231
241
  return true if self.equal?(o)
232
242
  self.class == o.class &&
243
+ account == o.account &&
233
244
  id == o.id &&
234
245
  platform == o.platform &&
235
246
  external_thread_id == o.external_thread_id &&
@@ -257,7 +268,7 @@ module Repull
257
268
  # Calculates hash code according to all attributes.
258
269
  # @return [Integer] Hash code
259
270
  def hash
260
- [id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at, host, guest, capabilities].hash
271
+ [account, id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at, host, guest, capabilities].hash
261
272
  end
262
273
 
263
274
  # Builds the object from hash
@@ -18,7 +18,7 @@ module Repull
18
18
  # Where to send the user after they finish (or cancel). Status query params are appended.
19
19
  attr_accessor :redirect_url
20
20
 
21
- # Opaque pass-through correlation token. Echoed back in the response.
21
+ # Your own correlation token, e.g. your user id (at most 500 characters). Echoed in this response, on the redirect back (`&state=`), in the popup message, and in the `connect.session.completed` webhook.
22
22
  attr_accessor :state
23
23
 
24
24
  # What the connection may do. Airbnb: the OAuth scope tier. Vrbo: `messaging` (or `read_only`) imports bookings and messages and never pushes the calendar; `full_access` also pushes prices and availability. Setting it locks the choice; omit it to let the host choose on the hosted page (default `full_access`).
@@ -22,8 +22,8 @@ module Repull
22
22
  # Airbnb only — selects the OAuth scope set. 'read_only' grants read-only scopes; 'messaging' grants read scopes plus message read/send but NOT property management, so it can coexist with another app (e.g. an existing PMS) that already holds property management on the same Airbnb account; 'full_access' (default) grants full host scopes including the exclusive property management (only one app per Airbnb account can hold it). The hosted consent screen normally lets the host pick a tier; passing `accessType` explicitly fixes the tier and hides that choice, so the host can only continue with the tier you requested. Omit it to let the host choose.
23
23
  attr_accessor :access_type
24
24
 
25
- # PMS providers — API key.
26
- attr_accessor :api_key
25
+ # Airbnb + Booking.com — your own correlation token, e.g. your user id (at most 500 characters). Echoed on the redirect back (`&state=`) and in the `connect.session.completed` webhook.
26
+ attr_accessor :state
27
27
 
28
28
  # Plumguide — client ID.
29
29
  attr_accessor :client_id
@@ -61,7 +61,7 @@ module Repull
61
61
  {
62
62
  :'redirect_url' => :'redirectUrl',
63
63
  :'access_type' => :'accessType',
64
- :'api_key' => :'apiKey',
64
+ :'state' => :'state',
65
65
  :'client_id' => :'clientId',
66
66
  :'client_secret' => :'clientSecret',
67
67
  :'locale' => :'locale'
@@ -83,7 +83,7 @@ module Repull
83
83
  {
84
84
  :'redirect_url' => :'String',
85
85
  :'access_type' => :'String',
86
- :'api_key' => :'String',
86
+ :'state' => :'String',
87
87
  :'client_id' => :'String',
88
88
  :'client_secret' => :'String',
89
89
  :'locale' => :'String'
@@ -123,8 +123,8 @@ module Repull
123
123
  self.access_type = 'full_access'
124
124
  end
125
125
 
126
- if attributes.key?(:'api_key')
127
- self.api_key = attributes[:'api_key']
126
+ if attributes.key?(:'state')
127
+ self.state = attributes[:'state']
128
128
  end
129
129
 
130
130
  if attributes.key?(:'client_id')
@@ -174,7 +174,7 @@ module Repull
174
174
  self.class == o.class &&
175
175
  redirect_url == o.redirect_url &&
176
176
  access_type == o.access_type &&
177
- api_key == o.api_key &&
177
+ state == o.state &&
178
178
  client_id == o.client_id &&
179
179
  client_secret == o.client_secret &&
180
180
  locale == o.locale
@@ -189,7 +189,7 @@ module Repull
189
189
  # Calculates hash code according to all attributes.
190
190
  # @return [Integer] Hash code
191
191
  def hash
192
- [redirect_url, access_type, api_key, client_id, client_secret, locale].hash
192
+ [redirect_url, access_type, state, client_id, client_secret, locale].hash
193
193
  end
194
194
 
195
195
  # Builds the object from hash
@@ -14,8 +14,11 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # A vacation rental property in your Repull workspace. Backed by the core `listings` row — enriched per-PMS fields (bedrooms, property type, provider id, etc.) live in provider-specific detail tables and are NOT returned here. Field availability differs by endpoint: - `channels` is returned by the list endpoint (`GET /v1/properties`) only. - `latitude`, `longitude`, `createdAt`, and `amenities` are returned by the detail endpoint (`GET /v1/properties/{id}`) only. `amenities` requires `?include=amenities`. An **inactive** property (`status: inactive`) appears only in the list endpoint, and only when `?status=inactive|all` asks for it. Such a row carries identity fields only — `id`, `name`, `status`, `lifecycleStatus`, `channels`, `updatedAt` — so every other field is absent until the property is activated. Every other endpoint answers `403 listing_inactive` for it.
17
+ # A vacation rental property in your Repull workspace. Backed by the core `listings` row — enriched per-PMS fields (bedrooms, property type, provider id, etc.) live in provider-specific detail tables and are NOT returned here. Field availability differs by endpoint: - `channels` is returned by the list endpoint (`GET /v1/properties`) only. - `latitude`, `longitude`, `createdAt`, and `amenities` are returned by the detail endpoint (`GET /v1/properties/{id}`) only. `amenities` requires `?include=amenities`. An **inactive** property (`status: inactive`) appears only in the list endpoint, and only when `?status=inactive|all` asks for it. Such a row carries identity fields only — `id`, `name`, `status`, `lifecycleStatus`, `channels`, `accounts`, `updatedAt` — so every other field is absent until the property is activated. Every other endpoint answers `403 listing_inactive` for it.
18
18
  class Property < ApiModelBase
19
+ # The connected account the property belongs to on each channel it is on. List endpoint.
20
+ attr_accessor :accounts
21
+
19
22
  # Internal Repull property ID. Equal to the listing id (`listings.id`); the same integer is used as `listingId` on reservations and `propertyId` on availability.
20
23
  attr_accessor :id
21
24
 
@@ -57,6 +60,7 @@ module Repull
57
60
  # Attribute mapping from ruby-style variable name to JSON key.
58
61
  def self.attribute_map
59
62
  {
63
+ :'accounts' => :'accounts',
60
64
  :'id' => :'id',
61
65
  :'name' => :'name',
62
66
  :'address' => :'address',
@@ -86,6 +90,7 @@ module Repull
86
90
  # Attribute type mapping.
87
91
  def self.openapi_types
88
92
  {
93
+ :'accounts' => :'Array<RecordAccount>',
89
94
  :'id' => :'String',
90
95
  :'name' => :'String',
91
96
  :'address' => :'String',
@@ -130,6 +135,12 @@ module Repull
130
135
  h[k.to_sym] = v
131
136
  }
132
137
 
138
+ if attributes.key?(:'accounts')
139
+ if (value = attributes[:'accounts']).is_a?(Array)
140
+ self.accounts = value
141
+ end
142
+ end
143
+
133
144
  if attributes.key?(:'id')
134
145
  self.id = attributes[:'id']
135
146
  end
@@ -207,6 +218,7 @@ module Repull
207
218
  def ==(o)
208
219
  return true if self.equal?(o)
209
220
  self.class == o.class &&
221
+ accounts == o.accounts &&
210
222
  id == o.id &&
211
223
  name == o.name &&
212
224
  address == o.address &&
@@ -231,7 +243,7 @@ module Repull
231
243
  # Calculates hash code according to all attributes.
232
244
  # @return [Integer] Hash code
233
245
  def hash
234
- [id, name, address, city, latitude, longitude, currency, status, lifecycle_status, created_at, updated_at, channels, amenities].hash
246
+ [accounts, id, name, address, city, latitude, longitude, currency, status, lifecycle_status, created_at, updated_at, channels, amenities].hash
235
247
  end
236
248
 
237
249
  # Builds the object from hash
@@ -0,0 +1,170 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## 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`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
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
+ # The connected account a record belongs to — keyed exactly like the webhook `account` block and `connect.session.completed`, so one `provider:externalAccountId` key routes reads and events to the same user. `null` when it cannot be resolved (never guessed).
18
+ class RecordAccount < ApiModelBase
19
+ # airbnb, booking, booking_extranet, vrbo, or the PMS id (hostaway, cloudbeds, …).
20
+ attr_accessor :provider
21
+
22
+ # The provider's own account id — Airbnb host id, Booking.com hotel id, Extranet login, Vrbo account, or the PMS account.
23
+ attr_accessor :external_account_id
24
+
25
+ # Repull connection id (`X-Account-Id`), when the account has one. A string, like every id in API responses.
26
+ attr_accessor :connection_id
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'provider' => :'provider',
32
+ :'external_account_id' => :'externalAccountId',
33
+ :'connection_id' => :'connectionId'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'provider' => :'String',
51
+ :'external_account_id' => :'String',
52
+ :'connection_id' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'connection_id'
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::RecordAccount` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::RecordAccount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'provider')
80
+ self.provider = attributes[:'provider']
81
+ end
82
+
83
+ if attributes.key?(:'external_account_id')
84
+ self.external_account_id = attributes[:'external_account_id']
85
+ end
86
+
87
+ if attributes.key?(:'connection_id')
88
+ self.connection_id = attributes[:'connection_id']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ provider == o.provider &&
113
+ external_account_id == o.external_account_id &&
114
+ connection_id == o.connection_id
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [provider, external_account_id, connection_id].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ attributes = attributes.transform_keys(&:to_sym)
135
+ transformed_hash = {}
136
+ openapi_types.each_pair do |key, type|
137
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
138
+ transformed_hash["#{key}"] = nil
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[attribute_map[key]].is_a?(Array)
143
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
144
+ end
145
+ elsif !attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
147
+ end
148
+ end
149
+ new(transformed_hash)
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = self.send(attr)
158
+ if value.nil?
159
+ is_nullable = self.class.openapi_nullable.include?(attr)
160
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
161
+ end
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ end
169
+
170
+ end