repull 0.2.9 → 0.2.10

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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +1391 -117
  3. data/lib/repull/api/availability_api.rb +99 -0
  4. data/lib/repull/api/billing_api.rb +226 -0
  5. data/lib/repull/api/booking_com_api.rb +590 -0
  6. data/lib/repull/api/plumguide_api.rb +245 -0
  7. data/lib/repull/models/acknowledge_booking_reservations_request.rb +176 -0
  8. data/lib/repull/models/airbnb_alteration.rb +191 -0
  9. data/lib/repull/models/airbnb_amenity.rb +171 -0
  10. data/lib/repull/models/booking_setup_request.rb +220 -0
  11. data/lib/repull/models/create_airbnb_alteration_request.rb +195 -0
  12. data/lib/repull/models/create_airbnb_offer_request.rb +211 -0
  13. data/lib/repull/models/create_booking_webhook_request.rb +192 -0
  14. data/lib/repull/models/delete_airbnb_listing_photo200_response.rb +147 -0
  15. data/lib/repull/models/get_airbnb_alteration200_response.rb +190 -0
  16. data/lib/repull/models/get_airbnb_listing_quality200_response.rb +177 -0
  17. data/lib/repull/models/get_airbnb_listing_settings200_response.rb +177 -0
  18. data/lib/repull/models/get_airbnb_thread200_response.rb +190 -0
  19. data/lib/repull/models/get_usage_logs200_response.rb +167 -0
  20. data/lib/repull/models/get_usage_logs200_response_data_inner.rb +264 -0
  21. data/lib/repull/models/get_usage_logs200_response_pagination.rb +166 -0
  22. data/lib/repull/models/get_usage_summary200_response.rb +232 -0
  23. data/lib/repull/models/get_usage_summary200_response_breakdown_inner.rb +183 -0
  24. data/lib/repull/models/get_usage_summary200_response_limits.rb +158 -0
  25. data/lib/repull/models/get_usage_summary200_response_remaining.rb +158 -0
  26. data/lib/repull/models/get_usage_summary200_response_status_distribution.rb +174 -0
  27. data/lib/repull/models/get_usage_summary200_response_timeline_inner.rb +165 -0
  28. data/lib/repull/models/get_usage_summary200_response_totals.rb +165 -0
  29. data/lib/repull/models/get_usage_summary200_response_used.rb +156 -0
  30. data/lib/repull/models/get_usage_tier200_response.rb +183 -0
  31. data/lib/repull/models/get_usage_tier200_response_limits.rb +168 -0
  32. data/lib/repull/models/get_usage_tier200_response_remaining.rb +168 -0
  33. data/lib/repull/models/get_usage_tier200_response_used.rb +165 -0
  34. data/lib/repull/models/list_airbnb_alterations200_response.rb +192 -0
  35. data/lib/repull/models/list_airbnb_listing_amenities200_response.rb +190 -0
  36. data/lib/repull/models/list_airbnb_listing_amenities200_response_data.rb +160 -0
  37. data/lib/repull/models/list_airbnb_transactions200_response.rb +192 -0
  38. data/lib/repull/models/property_availability.rb +222 -0
  39. data/lib/repull/models/property_availability_day.rb +247 -0
  40. data/lib/repull/models/update_airbnb_message_request.rb +209 -0
  41. data/lib/repull/models/update_booking_charges_request.rb +194 -0
  42. data/lib/repull/version.rb +1 -1
  43. data/lib/repull.rb +36 -0
  44. data/openapi/v1.json +3297 -1000
  45. metadata +37 -1
@@ -19,6 +19,63 @@ module Repull
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Remove Plumguide webhook config
23
+ # Delete the Plumguide webhook configuration for this workspace. Plumguide stops delivering webhooks until a new config is set.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def delete_plumguide_webhooks(opts = {})
27
+ delete_plumguide_webhooks_with_http_info(opts)
28
+ nil
29
+ end
30
+
31
+ # Remove Plumguide webhook config
32
+ # Delete the Plumguide webhook configuration for this workspace. Plumguide stops delivering webhooks until a new config is set.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
35
+ def delete_plumguide_webhooks_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.delete_plumguide_webhooks ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v1/channels/plumguide/webhooks'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type]
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"PlumguideApi.delete_plumguide_webhooks",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: PlumguideApi#delete_plumguide_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
22
79
  # Get Plumguide availability
23
80
  # Read the per-day availability calendar for a Plumguide listing. Returns the same row shape as Airbnb availability for SDK convenience.
24
81
  # @param [Hash] opts the optional parameters
@@ -129,6 +186,126 @@ module Repull
129
186
  return data, status_code, headers
130
187
  end
131
188
 
189
+ # Get Plumguide webhook config
190
+ # Read the current Plumguide webhook configuration for this workspace.
191
+ # @param [Hash] opts the optional parameters
192
+ # @return [nil]
193
+ def get_plumguide_webhooks(opts = {})
194
+ get_plumguide_webhooks_with_http_info(opts)
195
+ nil
196
+ end
197
+
198
+ # Get Plumguide webhook config
199
+ # Read the current Plumguide webhook configuration for this workspace.
200
+ # @param [Hash] opts the optional parameters
201
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
202
+ def get_plumguide_webhooks_with_http_info(opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.get_plumguide_webhooks ...'
205
+ end
206
+ # resource path
207
+ local_var_path = '/v1/channels/plumguide/webhooks'
208
+
209
+ # query parameters
210
+ query_params = opts[:query_params] || {}
211
+
212
+ # header parameters
213
+ header_params = opts[:header_params] || {}
214
+ # HTTP header 'Accept' (if needed)
215
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
216
+
217
+ # form parameters
218
+ form_params = opts[:form_params] || {}
219
+
220
+ # http body (model)
221
+ post_body = opts[:debug_body]
222
+
223
+ # return_type
224
+ return_type = opts[:debug_return_type]
225
+
226
+ # auth_names
227
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
228
+
229
+ new_options = opts.merge(
230
+ :operation => :"PlumguideApi.get_plumguide_webhooks",
231
+ :header_params => header_params,
232
+ :query_params => query_params,
233
+ :form_params => form_params,
234
+ :body => post_body,
235
+ :auth_names => auth_names,
236
+ :return_type => return_type
237
+ )
238
+
239
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug "API called: PlumguideApi#get_plumguide_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
242
+ end
243
+ return data, status_code, headers
244
+ end
245
+
246
+ # List Plumguide bookings
247
+ # List Plumguide bookings. Default returns all bookings; pass `listing_id` to filter to one listing, or `booking_code` to fetch a single booking.
248
+ # @param [Hash] opts the optional parameters
249
+ # @option opts [Integer] :listing_id Filter to a single Plumguide listing.
250
+ # @option opts [String] :booking_code Fetch a single booking by its Plumguide booking code.
251
+ # @return [nil]
252
+ def list_plumguide_bookings(opts = {})
253
+ list_plumguide_bookings_with_http_info(opts)
254
+ nil
255
+ end
256
+
257
+ # List Plumguide bookings
258
+ # List Plumguide bookings. Default returns all bookings; pass &#x60;listing_id&#x60; to filter to one listing, or &#x60;booking_code&#x60; to fetch a single booking.
259
+ # @param [Hash] opts the optional parameters
260
+ # @option opts [Integer] :listing_id Filter to a single Plumguide listing.
261
+ # @option opts [String] :booking_code Fetch a single booking by its Plumguide booking code.
262
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
263
+ def list_plumguide_bookings_with_http_info(opts = {})
264
+ if @api_client.config.debugging
265
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.list_plumguide_bookings ...'
266
+ end
267
+ # resource path
268
+ local_var_path = '/v1/channels/plumguide/bookings'
269
+
270
+ # query parameters
271
+ query_params = opts[:query_params] || {}
272
+ query_params[:'listing_id'] = opts[:'listing_id'] if !opts[:'listing_id'].nil?
273
+ query_params[:'booking_code'] = opts[:'booking_code'] if !opts[:'booking_code'].nil?
274
+
275
+ # header parameters
276
+ header_params = opts[:header_params] || {}
277
+ # HTTP header 'Accept' (if needed)
278
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
279
+
280
+ # form parameters
281
+ form_params = opts[:form_params] || {}
282
+
283
+ # http body (model)
284
+ post_body = opts[:debug_body]
285
+
286
+ # return_type
287
+ return_type = opts[:debug_return_type]
288
+
289
+ # auth_names
290
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
291
+
292
+ new_options = opts.merge(
293
+ :operation => :"PlumguideApi.list_plumguide_bookings",
294
+ :header_params => header_params,
295
+ :query_params => query_params,
296
+ :form_params => form_params,
297
+ :body => post_body,
298
+ :auth_names => auth_names,
299
+ :return_type => return_type
300
+ )
301
+
302
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
303
+ if @api_client.config.debugging
304
+ @api_client.config.logger.debug "API called: PlumguideApi#list_plumguide_bookings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
305
+ end
306
+ return data, status_code, headers
307
+ end
308
+
132
309
  # List Plumguide listings
133
310
  # List Plumguide listings this workspace has access to. Plumguide is approval-based — listings appear once Plumguide has accepted them.
134
311
  # @param [Hash] opts the optional parameters
@@ -295,5 +472,73 @@ module Repull
295
472
  end
296
473
  return data, status_code, headers
297
474
  end
475
+
476
+ # Replace Plumguide webhook config
477
+ # Replace the Plumguide webhook configuration. The body carries the full webhook config payload — this is a full replacement, not a patch.
478
+ # @param request_body [Hash<String, Object>]
479
+ # @param [Hash] opts the optional parameters
480
+ # @return [nil]
481
+ def update_plumguide_webhooks(request_body, opts = {})
482
+ update_plumguide_webhooks_with_http_info(request_body, opts)
483
+ nil
484
+ end
485
+
486
+ # Replace Plumguide webhook config
487
+ # Replace the Plumguide webhook configuration. The body carries the full webhook config payload — this is a full replacement, not a patch.
488
+ # @param request_body [Hash<String, Object>]
489
+ # @param [Hash] opts the optional parameters
490
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
491
+ def update_plumguide_webhooks_with_http_info(request_body, opts = {})
492
+ if @api_client.config.debugging
493
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.update_plumguide_webhooks ...'
494
+ end
495
+ # verify the required parameter 'request_body' is set
496
+ if @api_client.config.client_side_validation && request_body.nil?
497
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling PlumguideApi.update_plumguide_webhooks"
498
+ end
499
+ # resource path
500
+ local_var_path = '/v1/channels/plumguide/webhooks'
501
+
502
+ # query parameters
503
+ query_params = opts[:query_params] || {}
504
+
505
+ # header parameters
506
+ header_params = opts[:header_params] || {}
507
+ # HTTP header 'Accept' (if needed)
508
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
509
+ # HTTP header 'Content-Type'
510
+ content_type = @api_client.select_header_content_type(['application/json'])
511
+ if !content_type.nil?
512
+ header_params['Content-Type'] = content_type
513
+ end
514
+
515
+ # form parameters
516
+ form_params = opts[:form_params] || {}
517
+
518
+ # http body (model)
519
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
520
+
521
+ # return_type
522
+ return_type = opts[:debug_return_type]
523
+
524
+ # auth_names
525
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
526
+
527
+ new_options = opts.merge(
528
+ :operation => :"PlumguideApi.update_plumguide_webhooks",
529
+ :header_params => header_params,
530
+ :query_params => query_params,
531
+ :form_params => form_params,
532
+ :body => post_body,
533
+ :auth_names => auth_names,
534
+ :return_type => return_type
535
+ )
536
+
537
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
538
+ if @api_client.config.debugging
539
+ @api_client.config.logger.debug "API called: PlumguideApi#update_plumguide_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
540
+ end
541
+ return data, status_code, headers
542
+ end
298
543
  end
299
544
  end
@@ -0,0 +1,176 @@
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_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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 `resets_at` 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 AcknowledgeBookingReservationsRequest < ApiModelBase
18
+ # Booking.com reservation ids to acknowledge.
19
+ attr_accessor :reservation_ids
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'reservation_ids' => :'reservation_ids'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'reservation_ids' => :'Array<String>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AcknowledgeBookingReservationsRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AcknowledgeBookingReservationsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'reservation_ids')
68
+ if (value = attributes[:'reservation_ids']).is_a?(Array)
69
+ self.reservation_ids = value
70
+ end
71
+ else
72
+ self.reservation_ids = nil
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ if @reservation_ids.nil?
82
+ invalid_properties.push('invalid value for "reservation_ids", reservation_ids cannot be nil.')
83
+ end
84
+
85
+ if @reservation_ids.length < 1
86
+ invalid_properties.push('invalid value for "reservation_ids", number of items must be greater than or equal to 1.')
87
+ end
88
+
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ warn '[DEPRECATED] the `valid?` method is obsolete'
96
+ return false if @reservation_ids.nil?
97
+ return false if @reservation_ids.length < 1
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] reservation_ids Value to be assigned
103
+ def reservation_ids=(reservation_ids)
104
+ if reservation_ids.nil?
105
+ fail ArgumentError, 'reservation_ids cannot be nil'
106
+ end
107
+
108
+ if reservation_ids.length < 1
109
+ fail ArgumentError, 'invalid value for "reservation_ids", number of items must be greater than or equal to 1.'
110
+ end
111
+
112
+ @reservation_ids = reservation_ids
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ reservation_ids == o.reservation_ids
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [reservation_ids].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ if value.nil?
165
+ is_nullable = self.class.openapi_nullable.include?(attr)
166
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
167
+ end
168
+
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ end
175
+
176
+ end
@@ -0,0 +1,191 @@
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_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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 `resets_at` 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
+ # An Airbnb reservation alteration request (date change, guest-count change, or price change), mirrored locally in `reservation_alterations`. Additional Airbnb-side fields may be present.
18
+ class AirbnbAlteration < ApiModelBase
19
+ # Airbnb alteration id.
20
+ attr_accessor :alteration_id
21
+
22
+ # Repull reservation id the alteration belongs to.
23
+ attr_accessor :reservation_id
24
+
25
+ attr_accessor :platform
26
+
27
+ # Alteration status (e.g. `pending`).
28
+ attr_accessor :status
29
+
30
+ attr_accessor :created_at
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'alteration_id' => :'alterationId',
36
+ :'reservation_id' => :'reservationId',
37
+ :'platform' => :'platform',
38
+ :'status' => :'status',
39
+ :'created_at' => :'createdAt'
40
+ }
41
+ end
42
+
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ acceptable_attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'alteration_id' => :'String',
57
+ :'reservation_id' => :'Integer',
58
+ :'platform' => :'String',
59
+ :'status' => :'String',
60
+ :'created_at' => :'Time'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'alteration_id',
68
+ :'reservation_id',
69
+ :'status',
70
+ :'created_at'
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::AirbnbAlteration` 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::AirbnbAlteration`. 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?(:'alteration_id')
91
+ self.alteration_id = attributes[:'alteration_id']
92
+ end
93
+
94
+ if attributes.key?(:'reservation_id')
95
+ self.reservation_id = attributes[:'reservation_id']
96
+ end
97
+
98
+ if attributes.key?(:'platform')
99
+ self.platform = attributes[:'platform']
100
+ end
101
+
102
+ if attributes.key?(:'status')
103
+ self.status = attributes[:'status']
104
+ end
105
+
106
+ if attributes.key?(:'created_at')
107
+ self.created_at = attributes[:'created_at']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ alteration_id == o.alteration_id &&
132
+ reservation_id == o.reservation_id &&
133
+ platform == o.platform &&
134
+ status == o.status &&
135
+ created_at == o.created_at
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [alteration_id, reservation_id, platform, status, created_at].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
165
+ end
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
169
+ end
170
+ new(transformed_hash)
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ end
190
+
191
+ end