repull 0.2.16 → 0.2.18

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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +10 -10
  3. data/lib/repull/api/booking_com_api.rb +86 -2
  4. data/lib/repull/api/conversations_api.rb +8 -8
  5. data/lib/repull/api/health_api.rb +0 -57
  6. data/lib/repull/api/listings_api.rb +182 -12
  7. data/lib/repull/api/migrate_api.rb +552 -0
  8. data/lib/repull/api/reservations_api.rb +6 -6
  9. data/lib/repull/models/airbnb_permits_response.rb +1 -1
  10. data/lib/repull/models/airbnb_permits_write_request.rb +1 -1
  11. data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +43 -4
  12. data/lib/repull/models/{airbnb_permits_write_request_permits_inner_answers_inner.rb → airbnb_permits_write_request_permits_inner_answers_value.rb} +22 -34
  13. data/lib/repull/models/airbnb_publish_result.rb +41 -2
  14. data/lib/repull/models/booking_property_action_request.rb +176 -0
  15. data/lib/repull/models/booking_property_action_response.rb +281 -0
  16. data/lib/repull/models/booking_publish_result.rb +245 -0
  17. data/lib/repull/models/booking_publish_section_error.rb +220 -0
  18. data/lib/repull/models/booking_setup_request.rb +44 -5
  19. data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -0
  20. data/lib/repull/models/channel_market_state_item.rb +291 -0
  21. data/lib/repull/models/check_migration_cutover200_response.rb +147 -0
  22. data/lib/repull/models/check_migration_cutover_request.rb +175 -0
  23. data/lib/repull/models/check_migration_cutover_request_reservations_inner.rb +216 -0
  24. data/lib/repull/models/connect_provider.rb +18 -5
  25. data/lib/repull/models/connect_session.rb +25 -5
  26. data/lib/repull/models/create_connect_session_request.rb +81 -5
  27. data/lib/repull/models/create_connect_session_request_copy.rb +251 -0
  28. data/lib/repull/models/create_connect_session_request_workspace.rb +196 -0
  29. data/lib/repull/models/delete_migration200_response.rb +147 -0
  30. data/lib/repull/models/delete_migration200_response_data.rb +165 -0
  31. data/lib/repull/models/error_error.rb +11 -1
  32. data/lib/repull/models/get_migration200_response.rb +147 -0
  33. data/lib/repull/models/get_migration_channel_map200_response.rb +147 -0
  34. data/lib/repull/models/get_migration_report200_response.rb +147 -0
  35. data/lib/repull/models/inquiry_updated_payload.rb +1 -1
  36. data/lib/repull/models/list_inquiries200_response_data_inner.rb +1 -1
  37. data/lib/repull/models/list_migrations200_response.rb +158 -0
  38. data/lib/repull/models/listing_address_readiness.rb +171 -0
  39. data/lib/repull/models/listing_content_update_request.rb +10 -1
  40. data/lib/repull/models/listing_content_update_request_address.rb +40 -3
  41. data/lib/repull/models/listing_content_update_request_pricing.rb +235 -0
  42. data/lib/repull/models/listing_content_update_response.rb +1 -1
  43. data/lib/repull/models/listing_create_request.rb +71 -2
  44. data/lib/repull/models/listing_create_response.rb +14 -4
  45. data/lib/repull/models/listing_market_state_request.rb +149 -0
  46. data/lib/repull/models/listing_market_state_response.rb +221 -0
  47. data/lib/repull/models/listing_publish_booking_request.rb +149 -0
  48. data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
  49. data/lib/repull/models/listing_publish_status_channel.rb +32 -1
  50. data/lib/repull/models/listing_publish_status_connection.rb +17 -5
  51. data/lib/repull/models/listing_publish_status_response.rb +13 -1
  52. data/lib/repull/models/migration.rb +303 -0
  53. data/lib/repull/models/migration_channel_map.rb +169 -0
  54. data/lib/repull/models/migration_channel_map_listings_inner.rb +208 -0
  55. data/lib/repull/models/migration_channel_map_listings_inner_airbnb.rb +156 -0
  56. data/lib/repull/models/migration_channel_map_listings_inner_booking.rb +156 -0
  57. data/lib/repull/models/migration_channel_map_sources_inner.rb +167 -0
  58. data/lib/repull/models/migration_completed_event.rb +309 -0
  59. data/lib/repull/models/migration_connections_inner.rb +195 -0
  60. data/lib/repull/models/migration_counts.rb +183 -0
  61. data/lib/repull/models/migration_cutover_check.rb +200 -0
  62. data/lib/repull/models/migration_cutover_check_mismatched_inner.rb +156 -0
  63. data/lib/repull/models/migration_failed_event.rb +309 -0
  64. data/lib/repull/models/migration_import_payload.rb +225 -0
  65. data/lib/repull/models/migration_import_payload_results_inner.rb +165 -0
  66. data/lib/repull/models/migration_import_run.rb +202 -0
  67. data/lib/repull/models/migration_import_run_results_inner.rb +165 -0
  68. data/lib/repull/models/migration_report.rb +179 -0
  69. data/lib/repull/models/migration_report_issues_inner.rb +229 -0
  70. data/lib/repull/models/migration_reservation_ref.rb +184 -0
  71. data/lib/repull/models/reservation.rb +12 -2
  72. data/lib/repull/models/reservation_request_updated_payload.rb +1 -1
  73. data/lib/repull/models/run_migration_import202_response.rb +147 -0
  74. data/lib/repull/models/run_migration_import202_response_data.rb +158 -0
  75. data/lib/repull/models/run_migration_import202_response_data_queued_inner.rb +174 -0
  76. data/lib/repull/models/run_migration_import_request.rb +182 -0
  77. data/lib/repull/models/webhook_event.rb +4 -0
  78. data/lib/repull/models/webhook_event_type.rb +3 -1
  79. data/lib/repull/version.rb +1 -1
  80. data/lib/repull.rb +48 -2
  81. data/openapi/v1.json +2398 -433
  82. data/scripts/regen.sh +1 -1
  83. metadata +50 -4
@@ -0,0 +1,291 @@
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
+ Contact: ivan@vanio.ai
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 on ONE channel item — one Airbnb connection, or one Booking.com property. A listing can carry several Airbnb connections (a re-list, or a move between host accounts) and each gets its own entry.
18
+ class ChannelMarketStateItem < ApiModelBase
19
+ attr_accessor :channel
20
+
21
+ # **What is now true of this item**, not what you asked for. `offline` — it is off the market. `online` — it is back on. `unchanged` — nothing was sent, or what was sent did not take; `code` and `message` say why. `unchanged` never means \"it was already like that\": it means we did not put it there, and it is still in whatever state it was in before the call.
22
+ attr_accessor :state
23
+
24
+ # True only when the channel confirmed the change.
25
+ attr_accessor :ok
26
+
27
+ # Airbnb connection row id — the `id` from `GET /v1/channels/airbnb/listings/{id}`. Present on Airbnb items.
28
+ attr_accessor :connection_id
29
+
30
+ # The Booking.com property acted on. Present on Booking.com items; null when the property could not be resolved.
31
+ attr_accessor :hotel_id
32
+
33
+ # Error code when `ok` is false — the SAME code the channel-specific endpoint returns for this failure, so one vocabulary covers both surfaces. Absent when `ok` is true. The channel codes come in pairs, and the pair is the retryable split — the most useful bit in the whole item: - `airbnb_rejected` / `booking_rejected` — the channel refused the request AS SENT. `message` carries its own reason. Correct it and send again; resending the same thing is refused again. - `airbnb_error` / `booking_error` — the channel did not complete the request (outage, timeout, server error). Nothing about the request needs to change: retry with backoff. Plus `ambiguous_booking_mapping` (name the property with `hotelId`) and `payment_required` (a billing refusal, which keeps its own code rather than being buried under a channel one).
34
+ attr_accessor :code
35
+
36
+ # The `code` this item used to carry, for callers still branching on the old string. A migration aid with a deprecation window — **`code` is canonical.** This fan-out reaches Airbnb through an internal hop that flattens a refusal into its own 500, so an unambiguous Airbnb 400 (\"Please specify a valid room type\") was reported as `airbnb_error` — whose published advice is to retry with backoff, forever, for something Airbnb will never accept. It now reads Airbnb's real status and answers `airbnb_rejected`, and the classification covers the whole 4xx range rather than only `400`. Items whose code changed carry `previousCode`. **Removed in v2.**
37
+ attr_accessor :previous_code
38
+
39
+ # The channel's own reason, verbatim. Absent when `ok` is true.
40
+ attr_accessor :message
41
+
42
+ # What to do about it, phrased for the direction you asked for — \"still live and taking bookings\" and \"still down\" call for different reactions. Absent when `ok` is true.
43
+ attr_accessor :fix
44
+
45
+ # Airbnb only, and only when going offline: the listing was READ BACK after the deactivation and confirmed down. Airbnb accepts a deactivation and leaves some listings live, so \"we sent the request\" is a weaker claim than this one and is never reported as success.
46
+ attr_accessor :verified
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'channel' => :'channel',
52
+ :'state' => :'state',
53
+ :'ok' => :'ok',
54
+ :'connection_id' => :'connectionId',
55
+ :'hotel_id' => :'hotelId',
56
+ :'code' => :'code',
57
+ :'previous_code' => :'previousCode',
58
+ :'message' => :'message',
59
+ :'fix' => :'fix',
60
+ :'verified' => :'verified'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'channel' => :'String',
78
+ :'state' => :'String',
79
+ :'ok' => :'Boolean',
80
+ :'connection_id' => :'String',
81
+ :'hotel_id' => :'String',
82
+ :'code' => :'String',
83
+ :'previous_code' => :'String',
84
+ :'message' => :'String',
85
+ :'fix' => :'String',
86
+ :'verified' => :'Boolean'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ :'connection_id',
94
+ :'hotel_id',
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ChannelMarketStateItem` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ acceptable_attribute_map = self.class.acceptable_attribute_map
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!acceptable_attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ChannelMarketStateItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'channel')
115
+ self.channel = attributes[:'channel']
116
+ else
117
+ self.channel = nil
118
+ end
119
+
120
+ if attributes.key?(:'state')
121
+ self.state = attributes[:'state']
122
+ else
123
+ self.state = nil
124
+ end
125
+
126
+ if attributes.key?(:'ok')
127
+ self.ok = attributes[:'ok']
128
+ else
129
+ self.ok = nil
130
+ end
131
+
132
+ if attributes.key?(:'connection_id')
133
+ self.connection_id = attributes[:'connection_id']
134
+ end
135
+
136
+ if attributes.key?(:'hotel_id')
137
+ self.hotel_id = attributes[:'hotel_id']
138
+ end
139
+
140
+ if attributes.key?(:'code')
141
+ self.code = attributes[:'code']
142
+ end
143
+
144
+ if attributes.key?(:'previous_code')
145
+ self.previous_code = attributes[:'previous_code']
146
+ end
147
+
148
+ if attributes.key?(:'message')
149
+ self.message = attributes[:'message']
150
+ end
151
+
152
+ if attributes.key?(:'fix')
153
+ self.fix = attributes[:'fix']
154
+ end
155
+
156
+ if attributes.key?(:'verified')
157
+ self.verified = attributes[:'verified']
158
+ end
159
+ end
160
+
161
+ # Show invalid properties with the reasons. Usually used together with valid?
162
+ # @return Array for valid properties with the reasons
163
+ def list_invalid_properties
164
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
165
+ invalid_properties = Array.new
166
+ if @channel.nil?
167
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
168
+ end
169
+
170
+ if @state.nil?
171
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
172
+ end
173
+
174
+ if @ok.nil?
175
+ invalid_properties.push('invalid value for "ok", ok cannot be nil.')
176
+ end
177
+
178
+ invalid_properties
179
+ end
180
+
181
+ # Check to see if the all the properties in the model are valid
182
+ # @return true if the model is valid
183
+ def valid?
184
+ warn '[DEPRECATED] the `valid?` method is obsolete'
185
+ return false if @channel.nil?
186
+ return false if @state.nil?
187
+ return false if @ok.nil?
188
+ true
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] channel Value to be assigned
193
+ def channel=(channel)
194
+ if channel.nil?
195
+ fail ArgumentError, 'channel cannot be nil'
196
+ end
197
+
198
+ @channel = channel
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] state Value to be assigned
203
+ def state=(state)
204
+ if state.nil?
205
+ fail ArgumentError, 'state cannot be nil'
206
+ end
207
+
208
+ @state = state
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] ok Value to be assigned
213
+ def ok=(ok)
214
+ if ok.nil?
215
+ fail ArgumentError, 'ok cannot be nil'
216
+ end
217
+
218
+ @ok = ok
219
+ end
220
+
221
+ # Checks equality by comparing each attribute.
222
+ # @param [Object] Object to be compared
223
+ def ==(o)
224
+ return true if self.equal?(o)
225
+ self.class == o.class &&
226
+ channel == o.channel &&
227
+ state == o.state &&
228
+ ok == o.ok &&
229
+ connection_id == o.connection_id &&
230
+ hotel_id == o.hotel_id &&
231
+ code == o.code &&
232
+ previous_code == o.previous_code &&
233
+ message == o.message &&
234
+ fix == o.fix &&
235
+ verified == o.verified
236
+ end
237
+
238
+ # @see the `==` method
239
+ # @param [Object] Object to be compared
240
+ def eql?(o)
241
+ self == o
242
+ end
243
+
244
+ # Calculates hash code according to all attributes.
245
+ # @return [Integer] Hash code
246
+ def hash
247
+ [channel, state, ok, connection_id, hotel_id, code, previous_code, message, fix, verified].hash
248
+ end
249
+
250
+ # Builds the object from hash
251
+ # @param [Hash] attributes Model attributes in the form of hash
252
+ # @return [Object] Returns the model itself
253
+ def self.build_from_hash(attributes)
254
+ return nil unless attributes.is_a?(Hash)
255
+ attributes = attributes.transform_keys(&:to_sym)
256
+ transformed_hash = {}
257
+ openapi_types.each_pair do |key, type|
258
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
259
+ transformed_hash["#{key}"] = nil
260
+ elsif type =~ /\AArray<(.*)>/i
261
+ # check to ensure the input is an array given that the attribute
262
+ # is documented as an array but the input is not
263
+ if attributes[attribute_map[key]].is_a?(Array)
264
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
265
+ end
266
+ elsif !attributes[attribute_map[key]].nil?
267
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
268
+ end
269
+ end
270
+ new(transformed_hash)
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ end
290
+
291
+ end
@@ -0,0 +1,147 @@
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
+ Contact: ivan@vanio.ai
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 CheckMigrationCutover200Response < 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' => :'MigrationCutoverCheck'
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::CheckMigrationCutover200Response` 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::CheckMigrationCutover200Response`. 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
@@ -0,0 +1,175 @@
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
+ Contact: ivan@vanio.ai
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 CheckMigrationCutoverRequest < ApiModelBase
18
+ attr_accessor :reservations
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'reservations' => :'reservations'
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
+ :'reservations' => :'Array<CheckMigrationCutoverRequestReservationsInner>'
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::CheckMigrationCutoverRequest` 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::CheckMigrationCutoverRequest`. 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?(:'reservations')
67
+ if (value = attributes[:'reservations']).is_a?(Array)
68
+ self.reservations = value
69
+ end
70
+ else
71
+ self.reservations = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @reservations.nil?
81
+ invalid_properties.push('invalid value for "reservations", reservations cannot be nil.')
82
+ end
83
+
84
+ if @reservations.length > 10000
85
+ invalid_properties.push('invalid value for "reservations", number of items must be less than or equal to 10000.')
86
+ end
87
+
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ warn '[DEPRECATED] the `valid?` method is obsolete'
95
+ return false if @reservations.nil?
96
+ return false if @reservations.length > 10000
97
+ true
98
+ end
99
+
100
+ # Custom attribute writer method with validation
101
+ # @param [Object] reservations Value to be assigned
102
+ def reservations=(reservations)
103
+ if reservations.nil?
104
+ fail ArgumentError, 'reservations cannot be nil'
105
+ end
106
+
107
+ if reservations.length > 10000
108
+ fail ArgumentError, 'invalid value for "reservations", number of items must be less than or equal to 10000.'
109
+ end
110
+
111
+ @reservations = reservations
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ reservations == o.reservations
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [reservations].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
153
+ end
154
+ new(transformed_hash)
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ if value.nil?
164
+ is_nullable = self.class.openapi_nullable.include?(attr)
165
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
166
+ end
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ end
174
+
175
+ end