repull 0.2.46 → 0.2.47

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,264 @@
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
+ # What happened to one Booking.com property when its listing was activated. Repull opens a Booking.com property automatically only while every listing mapped to it is active. Keep a listing that is not ready inactive and its property is never opened; activate it and Repull opens the property, provided Booking.com's own readiness check passes.
18
+ class BookingPropertyOpenResult < ApiModelBase
19
+ # The Booking.com property (hotel id).
20
+ attr_accessor :hotel_id
21
+
22
+ # The listings in this request that are mapped to the property.
23
+ attr_accessor :listing_ids
24
+
25
+ # `opened`: Booking.com's check passed and the property is now open. `refused`: Booking.com's check did not pass — `blockers` has its own reasons — and nothing changed. `not_needed`: Booking.com already has the property past its build stage (open, or closed by you), so it was left alone; use the `open` action on `POST /v1/channels/booking/properties/{id}` to reopen a closed property. `listing_inactive`: another listing on the same property is still inactive. `no_listing`: no listing is mapped to the property. `failed`: Booking.com did not answer; nothing changed — send the request again.
26
+ attr_accessor :outcome
27
+
28
+ # Booking.com's status for the property before anything was sent, e.g. `XML: Ready to open`, when it was read.
29
+ attr_accessor :booking_status
30
+
31
+ # Booking.com's own reasons it will not open the property, e.g. \"Room 1554900501 does not have kitchen or kitchenette\". Empty unless `outcome` is `refused`.
32
+ attr_accessor :blockers
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'hotel_id' => :'hotelId',
38
+ :'listing_ids' => :'listingIds',
39
+ :'outcome' => :'outcome',
40
+ :'booking_status' => :'bookingStatus',
41
+ :'blockers' => :'blockers'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'hotel_id' => :'String',
59
+ :'listing_ids' => :'Array<String>',
60
+ :'outcome' => :'String',
61
+ :'booking_status' => :'String',
62
+ :'blockers' => :'Array<String>'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ :'booking_status',
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingPropertyOpenResult` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingPropertyOpenResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'hotel_id')
90
+ self.hotel_id = attributes[:'hotel_id']
91
+ else
92
+ self.hotel_id = nil
93
+ end
94
+
95
+ if attributes.key?(:'listing_ids')
96
+ if (value = attributes[:'listing_ids']).is_a?(Array)
97
+ self.listing_ids = value
98
+ end
99
+ else
100
+ self.listing_ids = nil
101
+ end
102
+
103
+ if attributes.key?(:'outcome')
104
+ self.outcome = attributes[:'outcome']
105
+ else
106
+ self.outcome = nil
107
+ end
108
+
109
+ if attributes.key?(:'booking_status')
110
+ self.booking_status = attributes[:'booking_status']
111
+ else
112
+ self.booking_status = nil
113
+ end
114
+
115
+ if attributes.key?(:'blockers')
116
+ if (value = attributes[:'blockers']).is_a?(Array)
117
+ self.blockers = value
118
+ end
119
+ else
120
+ self.blockers = nil
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ if @hotel_id.nil?
130
+ invalid_properties.push('invalid value for "hotel_id", hotel_id cannot be nil.')
131
+ end
132
+
133
+ if @listing_ids.nil?
134
+ invalid_properties.push('invalid value for "listing_ids", listing_ids cannot be nil.')
135
+ end
136
+
137
+ if @outcome.nil?
138
+ invalid_properties.push('invalid value for "outcome", outcome cannot be nil.')
139
+ end
140
+
141
+ if @blockers.nil?
142
+ invalid_properties.push('invalid value for "blockers", blockers cannot be nil.')
143
+ end
144
+
145
+ invalid_properties
146
+ end
147
+
148
+ # Check to see if the all the properties in the model are valid
149
+ # @return true if the model is valid
150
+ def valid?
151
+ warn '[DEPRECATED] the `valid?` method is obsolete'
152
+ return false if @hotel_id.nil?
153
+ return false if @listing_ids.nil?
154
+ return false if @outcome.nil?
155
+ return false if @blockers.nil?
156
+ true
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] hotel_id Value to be assigned
161
+ def hotel_id=(hotel_id)
162
+ if hotel_id.nil?
163
+ fail ArgumentError, 'hotel_id cannot be nil'
164
+ end
165
+
166
+ @hotel_id = hotel_id
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] listing_ids Value to be assigned
171
+ def listing_ids=(listing_ids)
172
+ if listing_ids.nil?
173
+ fail ArgumentError, 'listing_ids cannot be nil'
174
+ end
175
+
176
+ @listing_ids = listing_ids
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] outcome Value to be assigned
181
+ def outcome=(outcome)
182
+ if outcome.nil?
183
+ fail ArgumentError, 'outcome cannot be nil'
184
+ end
185
+
186
+ @outcome = outcome
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] blockers Value to be assigned
191
+ def blockers=(blockers)
192
+ if blockers.nil?
193
+ fail ArgumentError, 'blockers cannot be nil'
194
+ end
195
+
196
+ @blockers = blockers
197
+ end
198
+
199
+ # Checks equality by comparing each attribute.
200
+ # @param [Object] Object to be compared
201
+ def ==(o)
202
+ return true if self.equal?(o)
203
+ self.class == o.class &&
204
+ hotel_id == o.hotel_id &&
205
+ listing_ids == o.listing_ids &&
206
+ outcome == o.outcome &&
207
+ booking_status == o.booking_status &&
208
+ blockers == o.blockers
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Integer] Hash code
219
+ def hash
220
+ [hotel_id, listing_ids, outcome, booking_status, blockers].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ return nil unless attributes.is_a?(Hash)
228
+ attributes = attributes.transform_keys(&:to_sym)
229
+ transformed_hash = {}
230
+ openapi_types.each_pair do |key, type|
231
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
232
+ transformed_hash["#{key}"] = nil
233
+ elsif type =~ /\AArray<(.*)>/i
234
+ # check to ensure the input is an array given that the attribute
235
+ # is documented as an array but the input is not
236
+ if attributes[attribute_map[key]].is_a?(Array)
237
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
238
+ end
239
+ elsif !attributes[attribute_map[key]].nil?
240
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
241
+ end
242
+ end
243
+ new(transformed_hash)
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ end
263
+
264
+ end
@@ -33,9 +33,15 @@ module Repull
33
33
  # The last error the user hit on the Connect page, e.g. `invalid_credentials`, `awaiting_designation`.
34
34
  attr_accessor :last_error_code
35
35
 
36
- # Booking.com: the Hotel ID the user entered while waiting for the Extranet approval.
36
+ # Booking.com: the Hotel ID the user entered while waiting for the Extranet approval. Booking.com Extranet in `awaiting_room_mapping`: the Booking.com account id of the connected login.
37
37
  attr_accessor :external_account_id
38
38
 
39
+ # Booking.com Extranet in `awaiting_room_mapping`: the connection record of the connected login (the `X-Account-Id`). Absent otherwise.
40
+ attr_accessor :connection_id
41
+
42
+ # Booking.com Extranet in `awaiting_room_mapping`: a durable link that reopens Connect on the room-mapping step for this login. Send the host there to finish. `null` when there is nothing to resume.
43
+ attr_accessor :fix_url
44
+
39
45
  # What to tell the user, in plain English.
40
46
  attr_accessor :next_step
41
47
 
@@ -53,6 +59,8 @@ module Repull
53
59
  :'reason' => :'reason',
54
60
  :'last_error_code' => :'lastErrorCode',
55
61
  :'external_account_id' => :'externalAccountId',
62
+ :'connection_id' => :'connectionId',
63
+ :'fix_url' => :'fixUrl',
56
64
  :'next_step' => :'nextStep',
57
65
  :'created_at' => :'createdAt',
58
66
  :'last_activity_at' => :'lastActivityAt'
@@ -79,6 +87,8 @@ module Repull
79
87
  :'reason' => :'String',
80
88
  :'last_error_code' => :'String',
81
89
  :'external_account_id' => :'String',
90
+ :'connection_id' => :'String',
91
+ :'fix_url' => :'String',
82
92
  :'next_step' => :'String',
83
93
  :'created_at' => :'Time',
84
94
  :'last_activity_at' => :'Time'
@@ -92,6 +102,8 @@ module Repull
92
102
  :'provider',
93
103
  :'last_error_code',
94
104
  :'external_account_id',
105
+ :'connection_id',
106
+ :'fix_url',
95
107
  ])
96
108
  end
97
109
 
@@ -139,6 +151,14 @@ module Repull
139
151
  self.external_account_id = attributes[:'external_account_id']
140
152
  end
141
153
 
154
+ if attributes.key?(:'connection_id')
155
+ self.connection_id = attributes[:'connection_id']
156
+ end
157
+
158
+ if attributes.key?(:'fix_url')
159
+ self.fix_url = attributes[:'fix_url']
160
+ end
161
+
142
162
  if attributes.key?(:'next_step')
143
163
  self.next_step = attributes[:'next_step']
144
164
  end
@@ -179,6 +199,8 @@ module Repull
179
199
  reason == o.reason &&
180
200
  last_error_code == o.last_error_code &&
181
201
  external_account_id == o.external_account_id &&
202
+ connection_id == o.connection_id &&
203
+ fix_url == o.fix_url &&
182
204
  next_step == o.next_step &&
183
205
  created_at == o.created_at &&
184
206
  last_activity_at == o.last_activity_at
@@ -193,7 +215,7 @@ module Repull
193
215
  # Calculates hash code according to all attributes.
194
216
  # @return [Integer] Hash code
195
217
  def hash
196
- [session_id, state, provider, status, reason, last_error_code, external_account_id, next_step, created_at, last_activity_at].hash
218
+ [session_id, state, provider, status, reason, last_error_code, external_account_id, connection_id, fix_url, next_step, created_at, last_activity_at].hash
197
219
  end
198
220
 
199
221
  # Builds the object from hash
@@ -21,11 +21,15 @@ module Repull
21
21
  # The resulting active state after the toggle.
22
22
  attr_accessor :active
23
23
 
24
+ # Only when activating: what happened to the Booking.com properties this listing is mapped to. Activating a listing opens its Booking.com property if Booking.com still has it in a build stage. Empty when the listing has no Booking.com property.
25
+ attr_accessor :booking_properties
26
+
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
  :'id' => :'id',
28
- :'active' => :'active'
31
+ :'active' => :'active',
32
+ :'booking_properties' => :'bookingProperties'
29
33
  }
30
34
  end
31
35
 
@@ -43,7 +47,8 @@ module Repull
43
47
  def self.openapi_types
44
48
  {
45
49
  :'id' => :'String',
46
- :'active' => :'Boolean'
50
+ :'active' => :'Boolean',
51
+ :'booking_properties' => :'Array<BookingPropertyOpenResult>'
47
52
  }
48
53
  end
49
54
 
@@ -76,6 +81,12 @@ module Repull
76
81
  if attributes.key?(:'active')
77
82
  self.active = attributes[:'active']
78
83
  end
84
+
85
+ if attributes.key?(:'booking_properties')
86
+ if (value = attributes[:'booking_properties']).is_a?(Array)
87
+ self.booking_properties = value
88
+ end
89
+ end
79
90
  end
80
91
 
81
92
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -99,7 +110,8 @@ module Repull
99
110
  return true if self.equal?(o)
100
111
  self.class == o.class &&
101
112
  id == o.id &&
102
- active == o.active
113
+ active == o.active &&
114
+ booking_properties == o.booking_properties
103
115
  end
104
116
 
105
117
  # @see the `==` method
@@ -111,7 +123,7 @@ module Repull
111
123
  # Calculates hash code according to all attributes.
112
124
  # @return [Integer] Hash code
113
125
  def hash
114
- [id, active].hash
126
+ [id, active, booking_properties].hash
115
127
  end
116
128
 
117
129
  # Builds the object from hash
@@ -24,12 +24,16 @@ module Repull
24
24
  # Listing ids that were already in the requested state, in request order.
25
25
  attr_accessor :unchanged
26
26
 
27
+ # Only when `active` is true: one entry per Booking.com property the listings in the request are mapped to, saying whether it was opened. Every listing in the request counts, including those in `unchanged`, so sending `active: true` again retries an open Booking.com refused. Empty when none of the listings has a Booking.com property.
28
+ attr_accessor :booking_properties
29
+
27
30
  # Attribute mapping from ruby-style variable name to JSON key.
28
31
  def self.attribute_map
29
32
  {
30
33
  :'active' => :'active',
31
34
  :'updated' => :'updated',
32
- :'unchanged' => :'unchanged'
35
+ :'unchanged' => :'unchanged',
36
+ :'booking_properties' => :'bookingProperties'
33
37
  }
34
38
  end
35
39
 
@@ -48,7 +52,8 @@ module Repull
48
52
  {
49
53
  :'active' => :'Boolean',
50
54
  :'updated' => :'Array<String>',
51
- :'unchanged' => :'Array<String>'
55
+ :'unchanged' => :'Array<String>',
56
+ :'booking_properties' => :'Array<BookingPropertyOpenResult>'
52
57
  }
53
58
  end
54
59
 
@@ -95,6 +100,12 @@ module Repull
95
100
  else
96
101
  self.unchanged = nil
97
102
  end
103
+
104
+ if attributes.key?(:'booking_properties')
105
+ if (value = attributes[:'booking_properties']).is_a?(Array)
106
+ self.booking_properties = value
107
+ end
108
+ end
98
109
  end
99
110
 
100
111
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -164,7 +175,8 @@ module Repull
164
175
  self.class == o.class &&
165
176
  active == o.active &&
166
177
  updated == o.updated &&
167
- unchanged == o.unchanged
178
+ unchanged == o.unchanged &&
179
+ booking_properties == o.booking_properties
168
180
  end
169
181
 
170
182
  # @see the `==` method
@@ -176,7 +188,7 @@ module Repull
176
188
  # Calculates hash code according to all attributes.
177
189
  # @return [Integer] Hash code
178
190
  def hash
179
- [active, updated, unchanged].hash
191
+ [active, updated, unchanged, booking_properties].hash
180
192
  end
181
193
 
182
194
  # Builds the object from hash
@@ -18,7 +18,7 @@ module Repull
18
18
  class MapConnectBookingRoomsResponsePropertyStatus < ApiModelBase
19
19
  attr_accessor :property_id
20
20
 
21
- # `opened`: it was being built and is now open. `not_needed`: it was already past that stage. `blocked`: Booking.com will not open it yet — see `blockers`. `status_unknown`: its status could not be read. `failed`: Booking.com did not answer the open request.
21
+ # `opened`: it was being built and is now open. `not_needed`: it was already past that stage. `blocked`: Booking.com will not open it yet — see `blockers`. `status_unknown`: its status could not be read. `failed`: Booking.com did not answer the open request. `listing_inactive`: a listing mapped to the property is inactive, so it was not opened — activate it when it is ready and Repull opens the property. `no_listing`: no listing is mapped to it.
22
22
  attr_accessor :outcome
23
23
 
24
24
  # Booking.com's status for the property before this step, e.g. `XML: Being built`.
@@ -143,7 +143,7 @@ module Repull
143
143
  # @return true if the model is valid
144
144
  def valid?
145
145
  warn '[DEPRECATED] the `valid?` method is obsolete'
146
- outcome_validator = EnumAttributeValidator.new('String', ["opened", "blocked", "not_needed", "status_unknown", "failed"])
146
+ outcome_validator = EnumAttributeValidator.new('String', ["opened", "blocked", "not_needed", "status_unknown", "failed", "listing_inactive", "no_listing"])
147
147
  return false unless outcome_validator.valid?(@outcome)
148
148
  true
149
149
  end
@@ -151,7 +151,7 @@ module Repull
151
151
  # Custom attribute writer method checking allowed values (enum).
152
152
  # @param [Object] outcome Object to be assigned
153
153
  def outcome=(outcome)
154
- validator = EnumAttributeValidator.new('String', ["opened", "blocked", "not_needed", "status_unknown", "failed"])
154
+ validator = EnumAttributeValidator.new('String', ["opened", "blocked", "not_needed", "status_unknown", "failed", "listing_inactive", "no_listing"])
155
155
  unless validator.valid?(outcome)
156
156
  fail ArgumentError, "invalid value for \"outcome\", must be one of #{validator.allowable_values}."
157
157
  end
@@ -0,0 +1,147 @@
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 StartConnectionImport202Response < ApiModelBase
18
+ attr_accessor :data
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'data' => :'StartConnectionImport202ResponseData'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::StartConnectionImport202Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::StartConnectionImport202Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'data')
67
+ self.data = attributes[:'data']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ data == o.data
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [data].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ transformed_hash = {}
113
+ openapi_types.each_pair do |key, type|
114
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
+ transformed_hash["#{key}"] = nil
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
+ end
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
+ end
125
+ end
126
+ new(transformed_hash)
127
+ end
128
+
129
+ # Returns the object in the form of hash
130
+ # @return [Hash] Returns the object in the form of hash
131
+ def to_hash
132
+ hash = {}
133
+ self.class.attribute_map.each_pair do |attr, param|
134
+ value = self.send(attr)
135
+ if value.nil?
136
+ is_nullable = self.class.openapi_nullable.include?(attr)
137
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
138
+ end
139
+
140
+ hash[param] = _to_hash(value)
141
+ end
142
+ hash
143
+ end
144
+
145
+ end
146
+
147
+ end