repull 0.2.25 → 0.2.27

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +38 -23
  3. data/lib/repull/api/booking_com_api.rb +9 -2
  4. data/lib/repull/api/connect_api.rb +6 -6
  5. data/lib/repull/api/conversations_api.rb +3 -0
  6. data/lib/repull/api/listings_api.rb +2 -2
  7. data/lib/repull/api/properties_api.rb +5 -2
  8. data/lib/repull/api/reservations_api.rb +96 -6
  9. data/lib/repull/api/reviews_api.rb +3 -0
  10. data/lib/repull/api/vrbo_api.rb +11 -4
  11. data/lib/repull/models/airbnb_listing.rb +13 -2
  12. data/lib/repull/models/airbnb_listing_details_write_request.rb +109 -5
  13. data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +1 -1
  14. data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +2 -2
  15. data/lib/repull/models/airbnb_pricing_write_request.rb +30 -2
  16. data/lib/repull/models/airbnb_pricing_write_request_fees_inner.rb +291 -0
  17. data/lib/repull/models/booking_property_listings_inner.rb +57 -1
  18. data/lib/repull/models/cancel_reservation200_response.rb +1 -1
  19. data/lib/repull/models/connect_session_completed_event.rb +281 -0
  20. data/lib/repull/models/connect_session_completed_payload.rb +210 -0
  21. data/lib/repull/models/connect_status.rb +35 -4
  22. data/lib/repull/models/connect_status_capabilities.rb +148 -0
  23. data/lib/repull/models/connection.rb +28 -5
  24. data/lib/repull/models/connection_action.rb +188 -0
  25. data/lib/repull/models/conversation.rb +12 -1
  26. data/lib/repull/models/conversation_detail.rb +12 -1
  27. data/lib/repull/models/create_connect_session_request.rb +40 -2
  28. data/lib/repull/models/create_connection_request.rb +46 -8
  29. data/lib/repull/models/error_error.rb +13 -1
  30. data/lib/repull/models/{cancel_reservation200_response_pms.rb → error_error_listings_inner.rb} +36 -30
  31. data/lib/repull/models/get_booking_extranet_login_status200_response.rb +2 -1
  32. data/lib/repull/models/list_listing_units200_response.rb +2 -1
  33. data/lib/repull/models/listing.rb +23 -2
  34. data/lib/repull/models/listing_capabilities.rb +148 -0
  35. data/lib/repull/models/property.rb +26 -3
  36. data/lib/repull/models/record_account.rb +170 -0
  37. data/lib/repull/models/reservation.rb +12 -1
  38. data/lib/repull/models/reservation_capabilities.rb +230 -0
  39. data/lib/repull/models/reservation_create_request.rb +172 -33
  40. data/lib/repull/models/reservation_create_response.rb +6 -6
  41. data/lib/repull/models/reservation_create_response_unit.rb +1 -1
  42. data/lib/repull/models/{reservation_create_response_pms.rb → reservation_pms_outcome.rb} +38 -8
  43. data/lib/repull/models/reservation_pms_outcome_quote.rb +168 -0
  44. data/lib/repull/models/{cancel_reservation200_response_pms_errors_inner.rb → reservation_pms_section_error.rb} +16 -16
  45. data/lib/repull/models/reservation_quote_request.rb +312 -0
  46. data/lib/repull/models/reservation_quote_response.rb +228 -0
  47. data/lib/repull/models/reservation_quote_response_breakdown.rb +175 -0
  48. data/lib/repull/models/reservation_update_response.rb +16 -6
  49. data/lib/repull/models/review.rb +12 -1
  50. data/lib/repull/models/submit_smoobu_credentials_request.rb +2 -5
  51. data/lib/repull/models/submit_smoobu_credentials_request_credentials.rb +193 -0
  52. data/lib/repull/models/update_airbnb_checkin_guide200_response.rb +147 -0
  53. data/lib/repull/models/update_airbnb_checkin_guide200_response_data.rb +177 -0
  54. data/lib/repull/models/{airbnb_permits_write_request_permits_inner_answers_value.rb → update_airbnb_checkin_guide200_response_data_steps_inner.rb} +24 -43
  55. data/lib/repull/models/update_airbnb_checkin_guide_request.rb +186 -0
  56. data/lib/repull/models/update_airbnb_checkin_guide_request_steps_inner.rb +182 -0
  57. data/lib/repull/models/webhook_event.rb +2 -0
  58. data/lib/repull/models/webhook_event_type.rb +2 -1
  59. data/lib/repull/version.rb +1 -1
  60. data/lib/repull.rb +21 -4
  61. data/openapi/v1.json +2221 -340
  62. data/scripts/regen.sh +1 -1
  63. metadata +23 -6
@@ -18,8 +18,18 @@ module Repull
18
18
  # Repull listing id — what `/v1/channels/booking/properties/{id}` and `/v1/channels/booking/listings/{id}/pricing` take.
19
19
  attr_accessor :listing_id
20
20
 
21
+ # The host's internal nickname for the listing.
21
22
  attr_accessor :name
22
23
 
24
+ # The title guests see on the channel; show this to end users.
25
+ attr_accessor :public_name
26
+
27
+ # Inactive listings appear only with `?status=inactive|all`, with identity fields only.
28
+ attr_accessor :status
29
+
30
+ # On inactive listings only: why it is inactive.
31
+ attr_accessor :inactive_reason
32
+
23
33
  attr_accessor :city
24
34
 
25
35
  # Repull-side room row id, as used by `POST /v1/connect/booking/map-rooms`.
@@ -60,6 +70,9 @@ module Repull
60
70
  {
61
71
  :'listing_id' => :'listingId',
62
72
  :'name' => :'name',
73
+ :'public_name' => :'publicName',
74
+ :'status' => :'status',
75
+ :'inactive_reason' => :'inactiveReason',
63
76
  :'city' => :'city',
64
77
  :'room_id' => :'roomId',
65
78
  :'room_booking_id' => :'roomBookingId',
@@ -83,6 +96,9 @@ module Repull
83
96
  {
84
97
  :'listing_id' => :'String',
85
98
  :'name' => :'String',
99
+ :'public_name' => :'String',
100
+ :'status' => :'String',
101
+ :'inactive_reason' => :'String',
86
102
  :'city' => :'String',
87
103
  :'room_id' => :'String',
88
104
  :'room_booking_id' => :'String',
@@ -95,6 +111,7 @@ module Repull
95
111
  def self.openapi_nullable
96
112
  Set.new([
97
113
  :'name',
114
+ :'public_name',
98
115
  :'city',
99
116
  :'room_id',
100
117
  :'room_booking_id',
@@ -126,6 +143,18 @@ module Repull
126
143
  self.name = attributes[:'name']
127
144
  end
128
145
 
146
+ if attributes.key?(:'public_name')
147
+ self.public_name = attributes[:'public_name']
148
+ end
149
+
150
+ if attributes.key?(:'status')
151
+ self.status = attributes[:'status']
152
+ end
153
+
154
+ if attributes.key?(:'inactive_reason')
155
+ self.inactive_reason = attributes[:'inactive_reason']
156
+ end
157
+
129
158
  if attributes.key?(:'city')
130
159
  self.city = attributes[:'city']
131
160
  end
@@ -159,11 +188,35 @@ module Repull
159
188
  # @return true if the model is valid
160
189
  def valid?
161
190
  warn '[DEPRECATED] the `valid?` method is obsolete'
191
+ status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
192
+ return false unless status_validator.valid?(@status)
193
+ inactive_reason_validator = EnumAttributeValidator.new('String', ["plan_limit", "unlisted_on_airbnb", "deactivated"])
194
+ return false unless inactive_reason_validator.valid?(@inactive_reason)
162
195
  mapped_via_validator = EnumAttributeValidator.new('String', ["room", "property"])
163
196
  return false unless mapped_via_validator.valid?(@mapped_via)
164
197
  true
165
198
  end
166
199
 
200
+ # Custom attribute writer method checking allowed values (enum).
201
+ # @param [Object] status Object to be assigned
202
+ def status=(status)
203
+ validator = EnumAttributeValidator.new('String', ["active", "inactive"])
204
+ unless validator.valid?(status)
205
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
206
+ end
207
+ @status = status
208
+ end
209
+
210
+ # Custom attribute writer method checking allowed values (enum).
211
+ # @param [Object] inactive_reason Object to be assigned
212
+ def inactive_reason=(inactive_reason)
213
+ validator = EnumAttributeValidator.new('String', ["plan_limit", "unlisted_on_airbnb", "deactivated"])
214
+ unless validator.valid?(inactive_reason)
215
+ fail ArgumentError, "invalid value for \"inactive_reason\", must be one of #{validator.allowable_values}."
216
+ end
217
+ @inactive_reason = inactive_reason
218
+ end
219
+
167
220
  # Custom attribute writer method checking allowed values (enum).
168
221
  # @param [Object] mapped_via Object to be assigned
169
222
  def mapped_via=(mapped_via)
@@ -181,6 +234,9 @@ module Repull
181
234
  self.class == o.class &&
182
235
  listing_id == o.listing_id &&
183
236
  name == o.name &&
237
+ public_name == o.public_name &&
238
+ status == o.status &&
239
+ inactive_reason == o.inactive_reason &&
184
240
  city == o.city &&
185
241
  room_id == o.room_id &&
186
242
  room_booking_id == o.room_booking_id &&
@@ -197,7 +253,7 @@ module Repull
197
253
  # Calculates hash code according to all attributes.
198
254
  # @return [Integer] Hash code
199
255
  def hash
200
- [listing_id, name, city, room_id, room_booking_id, room_name, mapped_via].hash
256
+ [listing_id, name, public_name, status, inactive_reason, city, room_id, room_booking_id, room_name, mapped_via].hash
201
257
  end
202
258
 
203
259
  # Builds the object from hash
@@ -92,7 +92,7 @@ module Repull
92
92
  :'check_out' => :'Date',
93
93
  :'updated_at' => :'String',
94
94
  :'already_cancelled' => :'Boolean',
95
- :'pms' => :'CancelReservation200ResponsePms'
95
+ :'pms' => :'ReservationPmsOutcome'
96
96
  }
97
97
  end
98
98
 
@@ -0,0 +1,281 @@
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
+ class ConnectSessionCompletedEvent < ApiModelBase
18
+ # The event name. This field is `event`, not `type`.
19
+ attr_accessor :event
20
+
21
+ # Stable across every delivery and replay of this logical event — dedupe on it.
22
+ attr_accessor :event_id
23
+
24
+ attr_accessor :api_version
25
+
26
+ # When this delivery was built.
27
+ attr_accessor :timestamp
28
+
29
+ attr_accessor :account
30
+
31
+ attr_accessor :data
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'event' => :'event',
37
+ :'event_id' => :'eventId',
38
+ :'api_version' => :'apiVersion',
39
+ :'timestamp' => :'timestamp',
40
+ :'account' => :'account',
41
+ :'data' => :'data'
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
+ :'event' => :'String',
59
+ :'event_id' => :'String',
60
+ :'api_version' => :'String',
61
+ :'timestamp' => :'Time',
62
+ :'account' => :'WebhookEventAccount',
63
+ :'data' => :'ConnectSessionCompletedPayload'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ :'account',
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectSessionCompletedEvent` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ acceptable_attribute_map = self.class.acceptable_attribute_map
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!acceptable_attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectSessionCompletedEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'event')
91
+ self.event = attributes[:'event']
92
+ else
93
+ self.event = nil
94
+ end
95
+
96
+ if attributes.key?(:'event_id')
97
+ self.event_id = attributes[:'event_id']
98
+ else
99
+ self.event_id = nil
100
+ end
101
+
102
+ if attributes.key?(:'api_version')
103
+ self.api_version = attributes[:'api_version']
104
+ else
105
+ self.api_version = nil
106
+ end
107
+
108
+ if attributes.key?(:'timestamp')
109
+ self.timestamp = attributes[:'timestamp']
110
+ else
111
+ self.timestamp = nil
112
+ end
113
+
114
+ if attributes.key?(:'account')
115
+ self.account = attributes[:'account']
116
+ end
117
+
118
+ if attributes.key?(:'data')
119
+ self.data = attributes[:'data']
120
+ else
121
+ self.data = nil
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @event.nil?
131
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
132
+ end
133
+
134
+ if @event_id.nil?
135
+ invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
136
+ end
137
+
138
+ if @api_version.nil?
139
+ invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
140
+ end
141
+
142
+ if @timestamp.nil?
143
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
144
+ end
145
+
146
+ if @data.nil?
147
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if @event.nil?
158
+ return false if @event_id.nil?
159
+ return false if @api_version.nil?
160
+ return false if @timestamp.nil?
161
+ return false if @data.nil?
162
+ true
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] event Value to be assigned
167
+ def event=(event)
168
+ if event.nil?
169
+ fail ArgumentError, 'event cannot be nil'
170
+ end
171
+
172
+ @event = event
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] event_id Value to be assigned
177
+ def event_id=(event_id)
178
+ if event_id.nil?
179
+ fail ArgumentError, 'event_id cannot be nil'
180
+ end
181
+
182
+ @event_id = event_id
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] api_version Value to be assigned
187
+ def api_version=(api_version)
188
+ if api_version.nil?
189
+ fail ArgumentError, 'api_version cannot be nil'
190
+ end
191
+
192
+ @api_version = api_version
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] timestamp Value to be assigned
197
+ def timestamp=(timestamp)
198
+ if timestamp.nil?
199
+ fail ArgumentError, 'timestamp cannot be nil'
200
+ end
201
+
202
+ @timestamp = timestamp
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] data Value to be assigned
207
+ def data=(data)
208
+ if data.nil?
209
+ fail ArgumentError, 'data cannot be nil'
210
+ end
211
+
212
+ @data = data
213
+ end
214
+
215
+ # Checks equality by comparing each attribute.
216
+ # @param [Object] Object to be compared
217
+ def ==(o)
218
+ return true if self.equal?(o)
219
+ self.class == o.class &&
220
+ event == o.event &&
221
+ event_id == o.event_id &&
222
+ api_version == o.api_version &&
223
+ timestamp == o.timestamp &&
224
+ account == o.account &&
225
+ data == o.data
226
+ end
227
+
228
+ # @see the `==` method
229
+ # @param [Object] Object to be compared
230
+ def eql?(o)
231
+ self == o
232
+ end
233
+
234
+ # Calculates hash code according to all attributes.
235
+ # @return [Integer] Hash code
236
+ def hash
237
+ [event, event_id, api_version, timestamp, account, data].hash
238
+ end
239
+
240
+ # Builds the object from hash
241
+ # @param [Hash] attributes Model attributes in the form of hash
242
+ # @return [Object] Returns the model itself
243
+ def self.build_from_hash(attributes)
244
+ return nil unless attributes.is_a?(Hash)
245
+ attributes = attributes.transform_keys(&:to_sym)
246
+ transformed_hash = {}
247
+ openapi_types.each_pair do |key, type|
248
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
249
+ transformed_hash["#{key}"] = nil
250
+ elsif type =~ /\AArray<(.*)>/i
251
+ # check to ensure the input is an array given that the attribute
252
+ # is documented as an array but the input is not
253
+ if attributes[attribute_map[key]].is_a?(Array)
254
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
255
+ end
256
+ elsif !attributes[attribute_map[key]].nil?
257
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
258
+ end
259
+ end
260
+ new(transformed_hash)
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -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