repull 0.2.15 → 0.2.17

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +149 -54
  3. data/lib/repull/api/billing_api.rb +4 -4
  4. data/lib/repull/api/booking_com_api.rb +122 -29
  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 +186 -16
  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_publish_result.rb +41 -2
  16. data/lib/repull/models/airbnb_reservation_action200_response.rb +157 -0
  17. data/lib/repull/models/airbnb_reservation_action_request.rb +248 -0
  18. data/lib/repull/models/booking_availability_update.rb +4 -20
  19. data/lib/repull/models/booking_availability_update_date_range.rb +193 -0
  20. data/lib/repull/models/booking_availability_update_request.rb +14 -3
  21. data/lib/repull/models/booking_pricing_rate_update.rb +32 -4
  22. data/lib/repull/models/booking_pricing_rate_update_date_range.rb +3 -0
  23. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +10 -10
  24. data/lib/repull/models/booking_pricing_response.rb +16 -4
  25. data/lib/repull/models/booking_pricing_update_response.rb +82 -18
  26. data/lib/repull/models/booking_property.rb +107 -36
  27. data/lib/repull/models/booking_property_action_request.rb +176 -0
  28. data/lib/repull/models/booking_property_action_response.rb +281 -0
  29. data/lib/repull/models/booking_property_listings_inner.rb +244 -0
  30. data/lib/repull/models/booking_publish_result.rb +245 -0
  31. data/lib/repull/models/booking_publish_section_error.rb +220 -0
  32. data/lib/repull/models/booking_rate_write_occupancy.rb +187 -0
  33. data/lib/repull/models/booking_rate_write_price_half.rb +188 -0
  34. data/lib/repull/models/booking_rate_write_restriction_half.rb +212 -0
  35. data/lib/repull/models/booking_rate_write_verification.rb +200 -0
  36. data/lib/repull/models/booking_rate_write_verification_row.rb +196 -0
  37. data/lib/repull/models/booking_restriction_request_row.rb +199 -0
  38. data/lib/repull/models/booking_restriction_verification.rb +208 -0
  39. data/lib/repull/models/booking_restriction_verification_row.rb +203 -0
  40. data/lib/repull/models/booking_restriction_verification_row_booking_value.rb +105 -0
  41. data/lib/repull/models/booking_restriction_verification_row_expected.rb +105 -0
  42. data/lib/repull/models/booking_rooms_rates_response.rb +41 -7
  43. data/lib/repull/models/booking_rooms_rates_response_rooms_inner.rb +12 -1
  44. data/lib/repull/models/booking_rooms_rates_response_rooms_inner_rates_inner.rb +1 -0
  45. data/lib/repull/models/booking_setup_request.rb +44 -5
  46. data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -0
  47. data/lib/repull/models/booking_upstream_failure.rb +204 -0
  48. data/lib/repull/models/calendar_updated_event.rb +95 -31
  49. data/lib/repull/models/channel_market_state_item.rb +291 -0
  50. data/lib/repull/models/conversation_message_attachment.rb +28 -1
  51. data/lib/repull/models/create_airbnb_offer_request.rb +93 -8
  52. data/lib/repull/models/create_airbnb_offer_request_guest_details.rb +279 -0
  53. data/lib/repull/models/create_conversation_special_offer201_response.rb +293 -0
  54. data/lib/repull/models/create_conversation_special_offer201_response_guests.rb +189 -0
  55. data/lib/repull/models/create_conversation_special_offer_request.rb +263 -0
  56. data/lib/repull/models/create_conversation_special_offer_request_guests.rb +263 -0
  57. data/lib/repull/models/decline_reservation_request_request.rb +234 -0
  58. data/lib/repull/models/error_error.rb +11 -1
  59. data/lib/repull/models/get_airbnb_offer200_response.rb +289 -0
  60. data/lib/repull/models/get_usage_summary200_response.rb +10 -1
  61. data/lib/repull/models/get_usage_summary200_response_limits.rb +11 -1
  62. data/lib/repull/models/get_usage_summary200_response_remaining.rb +11 -1
  63. data/lib/repull/models/get_usage_summary200_response_used.rb +10 -1
  64. data/lib/repull/models/get_usage_tier200_response.rb +10 -1
  65. data/lib/repull/models/get_usage_tier200_response_limits.rb +11 -1
  66. data/lib/repull/models/get_usage_tier200_response_remaining.rb +11 -1
  67. data/lib/repull/models/get_usage_tier200_response_used.rb +10 -1
  68. data/lib/repull/models/inquiry_created_event.rb +281 -0
  69. data/lib/repull/models/inquiry_created_payload.rb +185 -0
  70. data/lib/repull/models/inquiry_updated_event.rb +281 -0
  71. data/lib/repull/models/inquiry_updated_payload.rb +213 -0
  72. data/lib/repull/models/inquiry_webhook_object.rb +323 -0
  73. data/lib/repull/models/inquiry_webhook_object_expected_payout.rb +158 -0
  74. data/lib/repull/models/inquiry_webhook_object_guests.rb +188 -0
  75. data/lib/repull/models/list_airbnb_thread_messages200_response.rb +170 -0
  76. data/lib/repull/models/list_airbnb_thread_messages200_response_data_inner.rb +274 -0
  77. data/lib/repull/models/list_airbnb_thread_messages200_response_pagination.rb +158 -0
  78. data/lib/repull/models/list_inquiries200_response.rb +192 -0
  79. data/lib/repull/models/list_inquiries200_response_data_inner.rb +418 -0
  80. data/lib/repull/models/list_inquiries200_response_data_inner_expected_payout.rb +159 -0
  81. data/lib/repull/models/list_inquiries200_response_data_inner_guests.rb +188 -0
  82. data/lib/repull/models/listing_address_readiness.rb +171 -0
  83. data/lib/repull/models/listing_content_update_request_address.rb +40 -3
  84. data/lib/repull/models/listing_create_request.rb +48 -2
  85. data/lib/repull/models/listing_created_event.rb +95 -31
  86. data/lib/repull/models/listing_deleted_event.rb +95 -31
  87. data/lib/repull/models/listing_deleted_payload.rb +55 -21
  88. data/lib/repull/models/listing_market_state_request.rb +149 -0
  89. data/lib/repull/models/listing_market_state_response.rb +221 -0
  90. data/lib/repull/models/listing_publish_booking_request.rb +149 -0
  91. data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
  92. data/lib/repull/models/listing_publish_status_channel.rb +32 -1
  93. data/lib/repull/models/listing_publish_status_connection.rb +17 -5
  94. data/lib/repull/models/listing_publish_status_response.rb +13 -1
  95. data/lib/repull/models/listing_reactivated_event.rb +281 -0
  96. data/lib/repull/models/listing_suspended_event.rb +281 -0
  97. data/lib/repull/models/listing_suspension_payload.rb +202 -0
  98. data/lib/repull/models/listing_updated_event.rb +95 -31
  99. data/lib/repull/models/listing_updated_payload.rb +50 -22
  100. data/lib/repull/models/listing_webhook_object.rb +291 -0
  101. data/lib/repull/models/listing_webhook_object_address.rb +168 -0
  102. data/lib/repull/models/listing_webhook_object_channels_inner.rb +184 -0
  103. data/lib/repull/models/message.rb +1 -0
  104. data/lib/repull/models/payment_completed_event.rb +95 -31
  105. data/lib/repull/models/payment_completed_payload.rb +46 -44
  106. data/lib/repull/models/payment_refunded_event.rb +95 -31
  107. data/lib/repull/models/payment_refunded_payload.rb +46 -44
  108. data/lib/repull/models/payment_webhook_object.rb +351 -0
  109. data/lib/repull/models/preapprove_conversation201_response.rb +253 -0
  110. data/lib/repull/models/preapprove_conversation_request.rb +150 -0
  111. data/lib/repull/models/replay_webhook_delivery_request.rb +150 -0
  112. data/lib/repull/models/repull_ping_event.rb +95 -31
  113. data/lib/repull/models/reservation.rb +22 -2
  114. data/lib/repull/models/reservation_alteration_created_event.rb +95 -31
  115. data/lib/repull/models/reservation_alteration_responded_event.rb +95 -31
  116. data/lib/repull/models/reservation_cancelled_event.rb +95 -31
  117. data/lib/repull/models/reservation_created_event.rb +95 -32
  118. data/lib/repull/models/reservation_message_received_event.rb +95 -31
  119. data/lib/repull/models/reservation_message_received_payload.rb +17 -4
  120. data/lib/repull/models/reservation_request_created_event.rb +281 -0
  121. data/lib/repull/models/reservation_request_created_payload.rb +224 -0
  122. data/lib/repull/models/reservation_request_updated_event.rb +281 -0
  123. data/lib/repull/models/reservation_request_updated_payload.rb +251 -0
  124. data/lib/repull/models/reservation_updated_event.rb +95 -31
  125. data/lib/repull/models/review_created_event.rb +95 -31
  126. data/lib/repull/models/review_responded_event.rb +95 -31
  127. data/lib/repull/models/send_airbnb_message201_response.rb +104 -0
  128. data/lib/repull/models/send_airbnb_message_request.rb +4 -20
  129. data/lib/repull/models/send_message_attachment.rb +225 -0
  130. data/lib/repull/models/send_message_part.rb +201 -0
  131. data/lib/repull/models/send_message_request.rb +44 -19
  132. data/lib/repull/models/send_message_response.rb +29 -5
  133. data/lib/repull/models/sent_attachment.rb +196 -0
  134. data/lib/repull/models/usage_quota_warning_event.rb +281 -0
  135. data/lib/repull/models/usage_quota_warning_payload.rb +224 -0
  136. data/lib/repull/models/usage_quota_warning_payload_top_operation.rb +167 -0
  137. data/lib/repull/models/webhook_event.rb +17 -3
  138. data/lib/repull/models/webhook_event_account.rb +171 -0
  139. data/lib/repull/models/webhook_event_type.rb +8 -1
  140. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +240 -0
  141. data/lib/repull/version.rb +1 -1
  142. data/lib/repull.rb +71 -1
  143. data/openapi/v1.json +19706 -13248
  144. data/scripts/regen.sh +1 -1
  145. metadata +73 -3
@@ -0,0 +1,248 @@
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 AirbnbReservationActionRequest < ApiModelBase
18
+ attr_accessor :action
19
+
20
+ # Required for `decline` and `cancel`; not accepted for `accept`. `decline` takes `dates_not_available`, `not_comfortable`, `listing_not_ready`, `different_dates_needed`, `spam` or `other`. `cancel` takes `calendar_conflict`, `maintenance_issue`, `unable_to_host` or `other`.
21
+ attr_accessor :reason
22
+
23
+ # Required for `decline` only: sent to the guest by Airbnb.
24
+ attr_accessor :message
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'action' => :'action',
52
+ :'reason' => :'reason',
53
+ :'message' => :'message'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'action' => :'String',
71
+ :'reason' => :'String',
72
+ :'message' => :'String'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbReservationActionRequest` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbReservationActionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'action')
99
+ self.action = attributes[:'action']
100
+ else
101
+ self.action = nil
102
+ end
103
+
104
+ if attributes.key?(:'reason')
105
+ self.reason = attributes[:'reason']
106
+ end
107
+
108
+ if attributes.key?(:'message')
109
+ self.message = attributes[:'message']
110
+ end
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
117
+ invalid_properties = Array.new
118
+ if @action.nil?
119
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
120
+ end
121
+
122
+ if !@message.nil? && @message.to_s.length > 500
123
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 500.')
124
+ end
125
+
126
+ if !@message.nil? && @message.to_s.length < 1
127
+ invalid_properties.push('invalid value for "message", the character length must be greater than or equal to 1.')
128
+ end
129
+
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
+ return false if @action.nil?
138
+ action_validator = EnumAttributeValidator.new('String', ["accept", "decline", "cancel"])
139
+ return false unless action_validator.valid?(@action)
140
+ reason_validator = EnumAttributeValidator.new('String', ["dates_not_available", "not_comfortable", "listing_not_ready", "different_dates_needed", "spam", "calendar_conflict", "maintenance_issue", "unable_to_host", "other"])
141
+ return false unless reason_validator.valid?(@reason)
142
+ return false if !@message.nil? && @message.to_s.length > 500
143
+ return false if !@message.nil? && @message.to_s.length < 1
144
+ true
145
+ end
146
+
147
+ # Custom attribute writer method checking allowed values (enum).
148
+ # @param [Object] action Object to be assigned
149
+ def action=(action)
150
+ validator = EnumAttributeValidator.new('String', ["accept", "decline", "cancel"])
151
+ unless validator.valid?(action)
152
+ fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
153
+ end
154
+ @action = action
155
+ end
156
+
157
+ # Custom attribute writer method checking allowed values (enum).
158
+ # @param [Object] reason Object to be assigned
159
+ def reason=(reason)
160
+ validator = EnumAttributeValidator.new('String', ["dates_not_available", "not_comfortable", "listing_not_ready", "different_dates_needed", "spam", "calendar_conflict", "maintenance_issue", "unable_to_host", "other"])
161
+ unless validator.valid?(reason)
162
+ fail ArgumentError, "invalid value for \"reason\", must be one of #{validator.allowable_values}."
163
+ end
164
+ @reason = reason
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] message Value to be assigned
169
+ def message=(message)
170
+ if message.nil?
171
+ fail ArgumentError, 'message cannot be nil'
172
+ end
173
+
174
+ if message.to_s.length > 500
175
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 500.'
176
+ end
177
+
178
+ if message.to_s.length < 1
179
+ fail ArgumentError, 'invalid value for "message", the character length must be greater than or equal to 1.'
180
+ end
181
+
182
+ @message = message
183
+ end
184
+
185
+ # Checks equality by comparing each attribute.
186
+ # @param [Object] Object to be compared
187
+ def ==(o)
188
+ return true if self.equal?(o)
189
+ self.class == o.class &&
190
+ action == o.action &&
191
+ reason == o.reason &&
192
+ message == o.message
193
+ end
194
+
195
+ # @see the `==` method
196
+ # @param [Object] Object to be compared
197
+ def eql?(o)
198
+ self == o
199
+ end
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Integer] Hash code
203
+ def hash
204
+ [action, reason, message].hash
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def self.build_from_hash(attributes)
211
+ return nil unless attributes.is_a?(Hash)
212
+ attributes = attributes.transform_keys(&:to_sym)
213
+ transformed_hash = {}
214
+ openapi_types.each_pair do |key, type|
215
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
216
+ transformed_hash["#{key}"] = nil
217
+ elsif type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[attribute_map[key]].is_a?(Array)
221
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
222
+ end
223
+ elsif !attributes[attribute_map[key]].nil?
224
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
225
+ end
226
+ end
227
+ new(transformed_hash)
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.openapi_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ end
247
+
248
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # One (room, rate-plan, date-range) availability update. Carries inventory (`availableRooms`), the dedicated stop-sell flag (`closed`), and the same length-of-stay / arrival restrictions as a rate update.
17
+ # One (room, rate-plan, date-range) availability update. Carries inventory (`availableRooms`), the dedicated stop-sell flag (`closed`), and length-of-stay / arrival restrictions. Omit `availableRooms` and `closed` for a restriction-only write — inventory is then left untouched.
18
18
  class BookingAvailabilityUpdate < ApiModelBase
19
19
  # Booking.com room id.
20
20
  attr_accessor :room_id
@@ -24,7 +24,7 @@ module Repull
24
24
 
25
25
  attr_accessor :date_range
26
26
 
27
- # Rooms to sell (`roomstosell`). `0` blocks the room for the range.
27
+ # Rooms to sell (`roomstosell`). `0` blocks the room for the range. Omit it to leave inventory alone — `0` is a stop-sell, not a no-op.
28
28
  attr_accessor :available_rooms
29
29
 
30
30
  attr_accessor :status
@@ -62,7 +62,7 @@ module Repull
62
62
  {
63
63
  :'room_id' => :'String',
64
64
  :'rate_id' => :'String',
65
- :'date_range' => :'BookingPricingRateUpdateDateRange',
65
+ :'date_range' => :'BookingAvailabilityUpdateDateRange',
66
66
  :'available_rooms' => :'Integer',
67
67
  :'status' => :'String',
68
68
  :'closed' => :'Boolean',
@@ -73,6 +73,7 @@ module Repull
73
73
  # List of attributes with nullable: true
74
74
  def self.openapi_nullable
75
75
  Set.new([
76
+ :'available_rooms',
76
77
  :'status',
77
78
  :'closed',
78
79
  ])
@@ -114,8 +115,6 @@ module Repull
114
115
 
115
116
  if attributes.key?(:'available_rooms')
116
117
  self.available_rooms = attributes[:'available_rooms']
117
- else
118
- self.available_rooms = nil
119
118
  end
120
119
 
121
120
  if attributes.key?(:'status')
@@ -148,10 +147,6 @@ module Repull
148
147
  invalid_properties.push('invalid value for "date_range", date_range cannot be nil.')
149
148
  end
150
149
 
151
- if @available_rooms.nil?
152
- invalid_properties.push('invalid value for "available_rooms", available_rooms cannot be nil.')
153
- end
154
-
155
150
  invalid_properties
156
151
  end
157
152
 
@@ -162,7 +157,6 @@ module Repull
162
157
  return false if @room_id.nil?
163
158
  return false if @rate_id.nil?
164
159
  return false if @date_range.nil?
165
- return false if @available_rooms.nil?
166
160
  true
167
161
  end
168
162
 
@@ -196,16 +190,6 @@ module Repull
196
190
  @date_range = date_range
197
191
  end
198
192
 
199
- # Custom attribute writer method with validation
200
- # @param [Object] available_rooms Value to be assigned
201
- def available_rooms=(available_rooms)
202
- if available_rooms.nil?
203
- fail ArgumentError, 'available_rooms cannot be nil'
204
- end
205
-
206
- @available_rooms = available_rooms
207
- end
208
-
209
193
  # Checks equality by comparing each attribute.
210
194
  # @param [Object] Object to be compared
211
195
  def ==(o)
@@ -0,0 +1,193 @@
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
+ # The nights this update applies to. **Both ends are inclusive** — `start` equal to `end` is one night.
18
+ class BookingAvailabilityUpdateDateRange < ApiModelBase
19
+ # First night, YYYY-MM-DD.
20
+ attr_accessor :start
21
+
22
+ # Last night, YYYY-MM-DD, inclusive.
23
+ attr_accessor :_end
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'start' => :'start',
29
+ :'_end' => :'end'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'start' => :'Date',
47
+ :'_end' => :'Date'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingAvailabilityUpdateDateRange` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingAvailabilityUpdateDateRange`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'start')
74
+ self.start = attributes[:'start']
75
+ else
76
+ self.start = nil
77
+ end
78
+
79
+ if attributes.key?(:'_end')
80
+ self._end = attributes[:'_end']
81
+ else
82
+ self._end = nil
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @start.nil?
92
+ invalid_properties.push('invalid value for "start", start cannot be nil.')
93
+ end
94
+
95
+ if @_end.nil?
96
+ invalid_properties.push('invalid value for "_end", _end cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @start.nil?
107
+ return false if @_end.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] start Value to be assigned
113
+ def start=(start)
114
+ if start.nil?
115
+ fail ArgumentError, 'start cannot be nil'
116
+ end
117
+
118
+ @start = start
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] _end Value to be assigned
123
+ def _end=(_end)
124
+ if _end.nil?
125
+ fail ArgumentError, '_end cannot be nil'
126
+ end
127
+
128
+ @_end = _end
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ start == o.start &&
137
+ _end == o._end
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [start, _end].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ end
@@ -14,11 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Body for `PUT /v1/channels/booking/availability`. Selects one of Booking's three ARI write paths via `type` and forwards `updates` verbatim to the connector.
17
+ # Body for `PUT /v1/channels/booking/availability`. `type` selects which of Booking.com's writes to perform. Date ranges are inclusive at both ends everywhere in this body.
18
18
  class BookingAvailabilityUpdateRequest < ApiModelBase
19
- # `rates` → price + restrictions (`updateRates`); `availability` → inventory + stop-sell + restrictions (`updateAvailability`); `derived-pricing` → occupancy-derived pricing rules (`updateDerivedPricing`).
19
+ # `rates` → nightly prices (+ any restrictions sent with them), written at an explicit `occupancy`; `availability` → inventory, stop-sell and restrictions; `derived-pricing` → occupancy-derived pricing rules. A rates update may not carry `roomsToSell`: inventory is an `availability` write.
20
20
  attr_accessor :type
21
21
 
22
+ # Only for `type: \"rates\"`. Default `true`: after the write the affected nights are read back off Booking.com so `applied` can say `verified` or `mismatch`. Send `false` to skip the read (one fewer Booking.com call); the response then reports `applied: \"unverified\"`.
23
+ attr_accessor :verify
24
+
22
25
  attr_accessor :property_id
23
26
 
24
27
  # For `type: \"rates\"` each item is a `BookingPricingRateUpdate`; for `type: \"availability\"` a `BookingAvailabilityUpdate`; for `type: \"derived-pricing\"` a derived-price rule set.
@@ -28,6 +31,7 @@ module Repull
28
31
  def self.attribute_map
29
32
  {
30
33
  :'type' => :'type',
34
+ :'verify' => :'verify',
31
35
  :'property_id' => :'property_id',
32
36
  :'updates' => :'updates'
33
37
  }
@@ -47,6 +51,7 @@ module Repull
47
51
  def self.openapi_types
48
52
  {
49
53
  :'type' => :'String',
54
+ :'verify' => :'Boolean',
50
55
  :'property_id' => :'BookingAvailabilityUpdateRequestPropertyId',
51
56
  :'updates' => :'Array<BookingAvailabilityUpdateRequestUpdatesInner>'
52
57
  }
@@ -55,6 +60,7 @@ module Repull
55
60
  # List of attributes with nullable: true
56
61
  def self.openapi_nullable
57
62
  Set.new([
63
+ :'verify',
58
64
  ])
59
65
  end
60
66
 
@@ -80,6 +86,10 @@ module Repull
80
86
  self.type = nil
81
87
  end
82
88
 
89
+ if attributes.key?(:'verify')
90
+ self.verify = attributes[:'verify']
91
+ end
92
+
83
93
  if attributes.key?(:'property_id')
84
94
  self.property_id = attributes[:'property_id']
85
95
  else
@@ -170,6 +180,7 @@ module Repull
170
180
  return true if self.equal?(o)
171
181
  self.class == o.class &&
172
182
  type == o.type &&
183
+ verify == o.verify &&
173
184
  property_id == o.property_id &&
174
185
  updates == o.updates
175
186
  end
@@ -183,7 +194,7 @@ module Repull
183
194
  # Calculates hash code according to all attributes.
184
195
  # @return [Integer] Hash code
185
196
  def hash
186
- [type, property_id, updates].hash
197
+ [type, verify, property_id, updates].hash
187
198
  end
188
199
 
189
200
  # Builds the object from hash