repull 0.2.15 → 0.2.16

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 (126) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +147 -52
  3. data/lib/repull/api/billing_api.rb +4 -4
  4. data/lib/repull/api/booking_com_api.rb +36 -27
  5. data/lib/repull/api/conversations_api.rb +398 -4
  6. data/lib/repull/api/guests_api.rb +2 -2
  7. data/lib/repull/api/listings_api.rb +4 -4
  8. data/lib/repull/api/reservations_api.rb +157 -6
  9. data/lib/repull/api/webhooks_api.rb +10 -3
  10. data/lib/repull/models/accept_reservation_request200_response.rb +321 -0
  11. data/lib/repull/models/account_created_event.rb +95 -31
  12. data/lib/repull/models/account_disconnected_event.rb +95 -31
  13. data/lib/repull/models/ai_operation_completed_event.rb +95 -31
  14. data/lib/repull/models/ai_operation_failed_event.rb +95 -31
  15. data/lib/repull/models/airbnb_reservation_action200_response.rb +157 -0
  16. data/lib/repull/models/airbnb_reservation_action_request.rb +248 -0
  17. data/lib/repull/models/booking_availability_update.rb +4 -20
  18. data/lib/repull/models/booking_availability_update_date_range.rb +193 -0
  19. data/lib/repull/models/booking_availability_update_request.rb +14 -3
  20. data/lib/repull/models/booking_pricing_rate_update.rb +32 -4
  21. data/lib/repull/models/booking_pricing_rate_update_date_range.rb +3 -0
  22. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +10 -10
  23. data/lib/repull/models/booking_pricing_response.rb +16 -4
  24. data/lib/repull/models/booking_pricing_update_response.rb +82 -18
  25. data/lib/repull/models/booking_property.rb +107 -36
  26. data/lib/repull/models/booking_property_listings_inner.rb +244 -0
  27. data/lib/repull/models/booking_rate_write_occupancy.rb +187 -0
  28. data/lib/repull/models/booking_rate_write_price_half.rb +188 -0
  29. data/lib/repull/models/booking_rate_write_restriction_half.rb +212 -0
  30. data/lib/repull/models/booking_rate_write_verification.rb +200 -0
  31. data/lib/repull/models/booking_rate_write_verification_row.rb +196 -0
  32. data/lib/repull/models/booking_restriction_request_row.rb +199 -0
  33. data/lib/repull/models/booking_restriction_verification.rb +208 -0
  34. data/lib/repull/models/booking_restriction_verification_row.rb +203 -0
  35. data/lib/repull/models/booking_restriction_verification_row_booking_value.rb +105 -0
  36. data/lib/repull/models/booking_restriction_verification_row_expected.rb +105 -0
  37. data/lib/repull/models/booking_rooms_rates_response.rb +41 -7
  38. data/lib/repull/models/booking_rooms_rates_response_rooms_inner.rb +12 -1
  39. data/lib/repull/models/booking_rooms_rates_response_rooms_inner_rates_inner.rb +1 -0
  40. data/lib/repull/models/booking_upstream_failure.rb +204 -0
  41. data/lib/repull/models/calendar_updated_event.rb +95 -31
  42. data/lib/repull/models/conversation_message_attachment.rb +28 -1
  43. data/lib/repull/models/create_airbnb_offer_request.rb +93 -8
  44. data/lib/repull/models/create_airbnb_offer_request_guest_details.rb +279 -0
  45. data/lib/repull/models/create_conversation_special_offer201_response.rb +293 -0
  46. data/lib/repull/models/create_conversation_special_offer201_response_guests.rb +189 -0
  47. data/lib/repull/models/create_conversation_special_offer_request.rb +263 -0
  48. data/lib/repull/models/create_conversation_special_offer_request_guests.rb +263 -0
  49. data/lib/repull/models/decline_reservation_request_request.rb +234 -0
  50. data/lib/repull/models/get_airbnb_offer200_response.rb +289 -0
  51. data/lib/repull/models/get_usage_summary200_response.rb +10 -1
  52. data/lib/repull/models/get_usage_summary200_response_limits.rb +11 -1
  53. data/lib/repull/models/get_usage_summary200_response_remaining.rb +11 -1
  54. data/lib/repull/models/get_usage_summary200_response_used.rb +10 -1
  55. data/lib/repull/models/get_usage_tier200_response.rb +10 -1
  56. data/lib/repull/models/get_usage_tier200_response_limits.rb +11 -1
  57. data/lib/repull/models/get_usage_tier200_response_remaining.rb +11 -1
  58. data/lib/repull/models/get_usage_tier200_response_used.rb +10 -1
  59. data/lib/repull/models/inquiry_created_event.rb +281 -0
  60. data/lib/repull/models/inquiry_created_payload.rb +185 -0
  61. data/lib/repull/models/inquiry_updated_event.rb +281 -0
  62. data/lib/repull/models/inquiry_updated_payload.rb +213 -0
  63. data/lib/repull/models/inquiry_webhook_object.rb +323 -0
  64. data/lib/repull/models/inquiry_webhook_object_expected_payout.rb +158 -0
  65. data/lib/repull/models/inquiry_webhook_object_guests.rb +188 -0
  66. data/lib/repull/models/list_airbnb_thread_messages200_response.rb +170 -0
  67. data/lib/repull/models/list_airbnb_thread_messages200_response_data_inner.rb +274 -0
  68. data/lib/repull/models/list_airbnb_thread_messages200_response_pagination.rb +158 -0
  69. data/lib/repull/models/list_inquiries200_response.rb +192 -0
  70. data/lib/repull/models/list_inquiries200_response_data_inner.rb +418 -0
  71. data/lib/repull/models/list_inquiries200_response_data_inner_expected_payout.rb +159 -0
  72. data/lib/repull/models/list_inquiries200_response_data_inner_guests.rb +188 -0
  73. data/lib/repull/models/listing_created_event.rb +95 -31
  74. data/lib/repull/models/listing_deleted_event.rb +95 -31
  75. data/lib/repull/models/listing_deleted_payload.rb +55 -21
  76. data/lib/repull/models/listing_reactivated_event.rb +281 -0
  77. data/lib/repull/models/listing_suspended_event.rb +281 -0
  78. data/lib/repull/models/listing_suspension_payload.rb +202 -0
  79. data/lib/repull/models/listing_updated_event.rb +95 -31
  80. data/lib/repull/models/listing_updated_payload.rb +50 -22
  81. data/lib/repull/models/listing_webhook_object.rb +291 -0
  82. data/lib/repull/models/listing_webhook_object_address.rb +168 -0
  83. data/lib/repull/models/listing_webhook_object_channels_inner.rb +184 -0
  84. data/lib/repull/models/message.rb +1 -0
  85. data/lib/repull/models/payment_completed_event.rb +95 -31
  86. data/lib/repull/models/payment_completed_payload.rb +46 -44
  87. data/lib/repull/models/payment_refunded_event.rb +95 -31
  88. data/lib/repull/models/payment_refunded_payload.rb +46 -44
  89. data/lib/repull/models/payment_webhook_object.rb +351 -0
  90. data/lib/repull/models/preapprove_conversation201_response.rb +253 -0
  91. data/lib/repull/models/preapprove_conversation_request.rb +150 -0
  92. data/lib/repull/models/replay_webhook_delivery_request.rb +150 -0
  93. data/lib/repull/models/repull_ping_event.rb +95 -31
  94. data/lib/repull/models/reservation.rb +22 -2
  95. data/lib/repull/models/reservation_alteration_created_event.rb +95 -31
  96. data/lib/repull/models/reservation_alteration_responded_event.rb +95 -31
  97. data/lib/repull/models/reservation_cancelled_event.rb +95 -31
  98. data/lib/repull/models/reservation_created_event.rb +95 -32
  99. data/lib/repull/models/reservation_message_received_event.rb +95 -31
  100. data/lib/repull/models/reservation_message_received_payload.rb +17 -4
  101. data/lib/repull/models/reservation_request_created_event.rb +281 -0
  102. data/lib/repull/models/reservation_request_created_payload.rb +224 -0
  103. data/lib/repull/models/reservation_request_updated_event.rb +281 -0
  104. data/lib/repull/models/reservation_request_updated_payload.rb +251 -0
  105. data/lib/repull/models/reservation_updated_event.rb +95 -31
  106. data/lib/repull/models/review_created_event.rb +95 -31
  107. data/lib/repull/models/review_responded_event.rb +95 -31
  108. data/lib/repull/models/send_airbnb_message201_response.rb +104 -0
  109. data/lib/repull/models/send_airbnb_message_request.rb +4 -20
  110. data/lib/repull/models/send_message_attachment.rb +225 -0
  111. data/lib/repull/models/send_message_part.rb +201 -0
  112. data/lib/repull/models/send_message_request.rb +44 -19
  113. data/lib/repull/models/send_message_response.rb +29 -5
  114. data/lib/repull/models/sent_attachment.rb +196 -0
  115. data/lib/repull/models/usage_quota_warning_event.rb +281 -0
  116. data/lib/repull/models/usage_quota_warning_payload.rb +224 -0
  117. data/lib/repull/models/usage_quota_warning_payload_top_operation.rb +167 -0
  118. data/lib/repull/models/webhook_event.rb +17 -3
  119. data/lib/repull/models/webhook_event_account.rb +171 -0
  120. data/lib/repull/models/webhook_event_type.rb +8 -1
  121. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +240 -0
  122. data/lib/repull/version.rb +1 -1
  123. data/lib/repull.rb +60 -0
  124. data/openapi/v1.json +19295 -13620
  125. data/scripts/regen.sh +1 -1
  126. metadata +62 -2
@@ -0,0 +1,234 @@
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 DeclineReservationRequestRequest < ApiModelBase
18
+ # Airbnb’s decline reason, verbatim. `dates_not_available` — the dates are taken; `not_comfortable` — you are not comfortable with the booking; `listing_not_ready` — the listing cannot be booked right now; `different_dates_needed` — you want different dates; `spam` — the request is spam; `other` — anything else (explain in `message`).
19
+ attr_accessor :reason
20
+
21
+ # Sent to the guest by Airbnb with the decline.
22
+ attr_accessor :message
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'reason' => :'reason',
50
+ :'message' => :'message'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'reason' => :'String',
68
+ :'message' => :'String'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::DeclineReservationRequestRequest` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::DeclineReservationRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'reason')
95
+ self.reason = attributes[:'reason']
96
+ else
97
+ self.reason = nil
98
+ end
99
+
100
+ if attributes.key?(:'message')
101
+ self.message = attributes[:'message']
102
+ else
103
+ self.message = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @reason.nil?
113
+ invalid_properties.push('invalid value for "reason", reason cannot be nil.')
114
+ end
115
+
116
+ if @message.nil?
117
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
118
+ end
119
+
120
+ if @message.to_s.length > 500
121
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 500.')
122
+ end
123
+
124
+ if @message.to_s.length < 1
125
+ invalid_properties.push('invalid value for "message", the character length must be greater than or equal to 1.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @reason.nil?
136
+ reason_validator = EnumAttributeValidator.new('String', ["dates_not_available", "not_comfortable", "listing_not_ready", "different_dates_needed", "spam", "other"])
137
+ return false unless reason_validator.valid?(@reason)
138
+ return false if @message.nil?
139
+ return false if @message.to_s.length > 500
140
+ return false if @message.to_s.length < 1
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] reason Object to be assigned
146
+ def reason=(reason)
147
+ validator = EnumAttributeValidator.new('String', ["dates_not_available", "not_comfortable", "listing_not_ready", "different_dates_needed", "spam", "other"])
148
+ unless validator.valid?(reason)
149
+ fail ArgumentError, "invalid value for \"reason\", must be one of #{validator.allowable_values}."
150
+ end
151
+ @reason = reason
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] message Value to be assigned
156
+ def message=(message)
157
+ if message.nil?
158
+ fail ArgumentError, 'message cannot be nil'
159
+ end
160
+
161
+ if message.to_s.length > 500
162
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 500.'
163
+ end
164
+
165
+ if message.to_s.length < 1
166
+ fail ArgumentError, 'invalid value for "message", the character length must be greater than or equal to 1.'
167
+ end
168
+
169
+ @message = message
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ reason == o.reason &&
178
+ message == o.message
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [reason, message].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ attributes = attributes.transform_keys(&:to_sym)
199
+ transformed_hash = {}
200
+ openapi_types.each_pair do |key, type|
201
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = nil
203
+ elsif type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[attribute_map[key]].is_a?(Array)
207
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
+ end
209
+ elsif !attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
211
+ end
212
+ end
213
+ new(transformed_hash)
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -0,0 +1,289 @@
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
+ # Airbnb’s special-offer object as Airbnb returns it (keys camelCased). Fields vary by `offerType`; a pre-approval carries only the thread, status and expiry.
18
+ class GetAirbnbOffer200Response < ApiModelBase
19
+ # Airbnb special-offer id.
20
+ attr_accessor :id
21
+
22
+ # Airbnb thread id the offer was sent on.
23
+ attr_accessor :thread_id
24
+
25
+ attr_accessor :offer_type
26
+
27
+ attr_accessor :status
28
+
29
+ # Airbnb listing id (special offers only).
30
+ attr_accessor :listing_id
31
+
32
+ attr_accessor :start_date
33
+
34
+ attr_accessor :nights
35
+
36
+ attr_accessor :total_price
37
+
38
+ attr_accessor :guest_details
39
+
40
+ attr_accessor :created_at
41
+
42
+ attr_accessor :expires_at
43
+
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'id' => :'id',
70
+ :'thread_id' => :'threadId',
71
+ :'offer_type' => :'offerType',
72
+ :'status' => :'status',
73
+ :'listing_id' => :'listingId',
74
+ :'start_date' => :'startDate',
75
+ :'nights' => :'nights',
76
+ :'total_price' => :'totalPrice',
77
+ :'guest_details' => :'guestDetails',
78
+ :'created_at' => :'createdAt',
79
+ :'expires_at' => :'expiresAt'
80
+ }
81
+ end
82
+
83
+ # Returns attribute mapping this model knows about
84
+ def self.acceptable_attribute_map
85
+ attribute_map
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ acceptable_attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'id' => :'String',
97
+ :'thread_id' => :'String',
98
+ :'offer_type' => :'String',
99
+ :'status' => :'String',
100
+ :'listing_id' => :'String',
101
+ :'start_date' => :'Date',
102
+ :'nights' => :'Integer',
103
+ :'total_price' => :'Float',
104
+ :'guest_details' => :'Hash<String, Object>',
105
+ :'created_at' => :'Time',
106
+ :'expires_at' => :'Time'
107
+ }
108
+ end
109
+
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetAirbnbOffer200Response` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ acceptable_attribute_map = self.class.acceptable_attribute_map
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!acceptable_attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetAirbnbOffer200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'id')
133
+ self.id = attributes[:'id']
134
+ end
135
+
136
+ if attributes.key?(:'thread_id')
137
+ self.thread_id = attributes[:'thread_id']
138
+ end
139
+
140
+ if attributes.key?(:'offer_type')
141
+ self.offer_type = attributes[:'offer_type']
142
+ end
143
+
144
+ if attributes.key?(:'status')
145
+ self.status = attributes[:'status']
146
+ end
147
+
148
+ if attributes.key?(:'listing_id')
149
+ self.listing_id = attributes[:'listing_id']
150
+ end
151
+
152
+ if attributes.key?(:'start_date')
153
+ self.start_date = attributes[:'start_date']
154
+ end
155
+
156
+ if attributes.key?(:'nights')
157
+ self.nights = attributes[:'nights']
158
+ end
159
+
160
+ if attributes.key?(:'total_price')
161
+ self.total_price = attributes[:'total_price']
162
+ end
163
+
164
+ if attributes.key?(:'guest_details')
165
+ if (value = attributes[:'guest_details']).is_a?(Hash)
166
+ self.guest_details = value
167
+ end
168
+ end
169
+
170
+ if attributes.key?(:'created_at')
171
+ self.created_at = attributes[:'created_at']
172
+ end
173
+
174
+ if attributes.key?(:'expires_at')
175
+ self.expires_at = attributes[:'expires_at']
176
+ end
177
+ end
178
+
179
+ # Show invalid properties with the reasons. Usually used together with valid?
180
+ # @return Array for valid properties with the reasons
181
+ def list_invalid_properties
182
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
183
+ invalid_properties = Array.new
184
+ invalid_properties
185
+ end
186
+
187
+ # Check to see if the all the properties in the model are valid
188
+ # @return true if the model is valid
189
+ def valid?
190
+ warn '[DEPRECATED] the `valid?` method is obsolete'
191
+ offer_type_validator = EnumAttributeValidator.new('String', ["preapproval", "special_offer"])
192
+ return false unless offer_type_validator.valid?(@offer_type)
193
+ status_validator = EnumAttributeValidator.new('String', ["active", "pending", "accepted", "declined", "expired", "voided"])
194
+ return false unless status_validator.valid?(@status)
195
+ true
196
+ end
197
+
198
+ # Custom attribute writer method checking allowed values (enum).
199
+ # @param [Object] offer_type Object to be assigned
200
+ def offer_type=(offer_type)
201
+ validator = EnumAttributeValidator.new('String', ["preapproval", "special_offer"])
202
+ unless validator.valid?(offer_type)
203
+ fail ArgumentError, "invalid value for \"offer_type\", must be one of #{validator.allowable_values}."
204
+ end
205
+ @offer_type = offer_type
206
+ end
207
+
208
+ # Custom attribute writer method checking allowed values (enum).
209
+ # @param [Object] status Object to be assigned
210
+ def status=(status)
211
+ validator = EnumAttributeValidator.new('String', ["active", "pending", "accepted", "declined", "expired", "voided"])
212
+ unless validator.valid?(status)
213
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
214
+ end
215
+ @status = status
216
+ end
217
+
218
+ # Checks equality by comparing each attribute.
219
+ # @param [Object] Object to be compared
220
+ def ==(o)
221
+ return true if self.equal?(o)
222
+ self.class == o.class &&
223
+ id == o.id &&
224
+ thread_id == o.thread_id &&
225
+ offer_type == o.offer_type &&
226
+ status == o.status &&
227
+ listing_id == o.listing_id &&
228
+ start_date == o.start_date &&
229
+ nights == o.nights &&
230
+ total_price == o.total_price &&
231
+ guest_details == o.guest_details &&
232
+ created_at == o.created_at &&
233
+ expires_at == o.expires_at
234
+ end
235
+
236
+ # @see the `==` method
237
+ # @param [Object] Object to be compared
238
+ def eql?(o)
239
+ self == o
240
+ end
241
+
242
+ # Calculates hash code according to all attributes.
243
+ # @return [Integer] Hash code
244
+ def hash
245
+ [id, thread_id, offer_type, status, listing_id, start_date, nights, total_price, guest_details, created_at, expires_at].hash
246
+ end
247
+
248
+ # Builds the object from hash
249
+ # @param [Hash] attributes Model attributes in the form of hash
250
+ # @return [Object] Returns the model itself
251
+ def self.build_from_hash(attributes)
252
+ return nil unless attributes.is_a?(Hash)
253
+ attributes = attributes.transform_keys(&:to_sym)
254
+ transformed_hash = {}
255
+ openapi_types.each_pair do |key, type|
256
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
257
+ transformed_hash["#{key}"] = nil
258
+ elsif type =~ /\AArray<(.*)>/i
259
+ # check to ensure the input is an array given that the attribute
260
+ # is documented as an array but the input is not
261
+ if attributes[attribute_map[key]].is_a?(Array)
262
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
263
+ end
264
+ elsif !attributes[attribute_map[key]].nil?
265
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
266
+ end
267
+ end
268
+ new(transformed_hash)
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {}
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ if value.nil?
278
+ is_nullable = self.class.openapi_nullable.include?(attr)
279
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
280
+ end
281
+
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ end
288
+
289
+ end
@@ -23,6 +23,8 @@ module Repull
23
23
 
24
24
  attr_accessor :remaining
25
25
 
26
+ attr_accessor :daily_resets_at
27
+
26
28
  attr_accessor :resets_at
27
29
 
28
30
  attr_accessor :breakdown
@@ -42,6 +44,7 @@ module Repull
42
44
  :'limits' => :'limits',
43
45
  :'used' => :'used',
44
46
  :'remaining' => :'remaining',
47
+ :'daily_resets_at' => :'dailyResetsAt',
45
48
  :'resets_at' => :'resetsAt',
46
49
  :'breakdown' => :'breakdown',
47
50
  :'timeline' => :'timeline',
@@ -68,6 +71,7 @@ module Repull
68
71
  :'limits' => :'GetUsageSummary200ResponseLimits',
69
72
  :'used' => :'GetUsageSummary200ResponseUsed',
70
73
  :'remaining' => :'GetUsageSummary200ResponseRemaining',
74
+ :'daily_resets_at' => :'Time',
71
75
  :'resets_at' => :'Time',
72
76
  :'breakdown' => :'Array<GetUsageSummary200ResponseBreakdownInner>',
73
77
  :'timeline' => :'Array<GetUsageSummary200ResponseTimelineInner>',
@@ -115,6 +119,10 @@ module Repull
115
119
  self.remaining = attributes[:'remaining']
116
120
  end
117
121
 
122
+ if attributes.key?(:'daily_resets_at')
123
+ self.daily_resets_at = attributes[:'daily_resets_at']
124
+ end
125
+
118
126
  if attributes.key?(:'resets_at')
119
127
  self.resets_at = attributes[:'resets_at']
120
128
  end
@@ -168,6 +176,7 @@ module Repull
168
176
  limits == o.limits &&
169
177
  used == o.used &&
170
178
  remaining == o.remaining &&
179
+ daily_resets_at == o.daily_resets_at &&
171
180
  resets_at == o.resets_at &&
172
181
  breakdown == o.breakdown &&
173
182
  timeline == o.timeline &&
@@ -185,7 +194,7 @@ module Repull
185
194
  # Calculates hash code according to all attributes.
186
195
  # @return [Integer] Hash code
187
196
  def hash
188
- [tier, limits, used, remaining, resets_at, breakdown, timeline, status_distribution, totals, range].hash
197
+ [tier, limits, used, remaining, daily_resets_at, resets_at, breakdown, timeline, status_distribution, totals, range].hash
189
198
  end
190
199
 
191
200
  # Builds the object from hash
@@ -17,12 +17,15 @@ module Repull
17
17
  class GetUsageSummary200ResponseLimits < ApiModelBase
18
18
  attr_accessor :monthly_requests
19
19
 
20
+ attr_accessor :daily_requests
21
+
20
22
  attr_accessor :daily_ai_requests
21
23
 
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
23
25
  def self.attribute_map
24
26
  {
25
27
  :'monthly_requests' => :'monthlyRequests',
28
+ :'daily_requests' => :'dailyRequests',
26
29
  :'daily_ai_requests' => :'dailyAiRequests'
27
30
  }
28
31
  end
@@ -41,6 +44,7 @@ module Repull
41
44
  def self.openapi_types
42
45
  {
43
46
  :'monthly_requests' => :'Integer',
47
+ :'daily_requests' => :'Integer',
44
48
  :'daily_ai_requests' => :'Integer'
45
49
  }
46
50
  end
@@ -49,6 +53,7 @@ module Repull
49
53
  def self.openapi_nullable
50
54
  Set.new([
51
55
  :'monthly_requests',
56
+ :'daily_requests',
52
57
  :'daily_ai_requests'
53
58
  ])
54
59
  end
@@ -73,6 +78,10 @@ module Repull
73
78
  self.monthly_requests = attributes[:'monthly_requests']
74
79
  end
75
80
 
81
+ if attributes.key?(:'daily_requests')
82
+ self.daily_requests = attributes[:'daily_requests']
83
+ end
84
+
76
85
  if attributes.key?(:'daily_ai_requests')
77
86
  self.daily_ai_requests = attributes[:'daily_ai_requests']
78
87
  end
@@ -99,6 +108,7 @@ module Repull
99
108
  return true if self.equal?(o)
100
109
  self.class == o.class &&
101
110
  monthly_requests == o.monthly_requests &&
111
+ daily_requests == o.daily_requests &&
102
112
  daily_ai_requests == o.daily_ai_requests
103
113
  end
104
114
 
@@ -111,7 +121,7 @@ module Repull
111
121
  # Calculates hash code according to all attributes.
112
122
  # @return [Integer] Hash code
113
123
  def hash
114
- [monthly_requests, daily_ai_requests].hash
124
+ [monthly_requests, daily_requests, daily_ai_requests].hash
115
125
  end
116
126
 
117
127
  # Builds the object from hash