repull 0.2.8 → 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.
- checksums.yaml +4 -4
- data/lib/repull/api/airbnb_api.rb +1443 -182
- data/lib/repull/api/availability_api.rb +24 -92
- data/lib/repull/api/billing_api.rb +186 -15
- data/lib/repull/api/booking_com_api.rb +532 -41
- data/lib/repull/api/listings_api.rb +74 -0
- data/lib/repull/api/plumguide_api.rb +245 -0
- data/lib/repull/api/reservations_api.rb +0 -197
- data/lib/repull/api/sandbox_api.rb +136 -0
- data/lib/repull/api/vrbo_api.rb +0 -126
- data/lib/repull/models/acknowledge_booking_reservations_request.rb +176 -0
- data/lib/repull/models/{create_studio_project201_response_data.rb → airbnb_alteration.rb} +44 -52
- data/lib/repull/models/airbnb_amenity.rb +171 -0
- data/lib/repull/models/{get_studio_deployment200_response.rb → airbnb_availability_write_request.rb} +52 -10
- data/lib/repull/models/airbnb_calendar_operation.rb +250 -0
- data/lib/repull/models/airbnb_listing_action_request.rb +198 -0
- data/lib/repull/models/{update_availability_request.rb → airbnb_pricing_write_request.rb} +100 -11
- data/lib/repull/models/booking_availability_update.rb +276 -0
- data/lib/repull/models/booking_availability_update_request.rb +230 -0
- data/lib/repull/models/{generate_studio_completion_request_project_id.rb → booking_availability_update_request_property_id.rb} +2 -2
- data/lib/repull/models/booking_availability_update_request_updates_inner.rb +104 -0
- data/lib/repull/models/booking_pricing_rate_update.rb +1 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +65 -6
- data/lib/repull/models/booking_setup_request.rb +220 -0
- data/lib/repull/models/create_airbnb_alteration_request.rb +195 -0
- data/lib/repull/models/{create_studio_deployment201_response_data.rb → create_airbnb_offer_request.rb} +42 -30
- data/lib/repull/models/{create_studio_project_request.rb → create_booking_webhook_request.rb} +36 -47
- data/lib/repull/models/{generate_studio_completion200_response.rb → delete_airbnb_listing_photo200_response.rb} +10 -10
- data/lib/repull/models/{delete_studio_project200_response.rb → get_airbnb_alteration200_response.rb} +50 -7
- data/lib/repull/models/{delete_studio_project_file200_response.rb → get_airbnb_listing_quality200_response.rb} +37 -7
- data/lib/repull/models/{create_studio_project_generation201_response.rb → get_airbnb_listing_settings200_response.rb} +37 -7
- data/lib/repull/models/{delete_studio_deployment200_response.rb → get_airbnb_thread200_response.rb} +50 -7
- data/lib/repull/models/{list_studio_deployments200_response.rb → get_usage_logs200_response.rb} +17 -8
- data/lib/repull/models/get_usage_logs200_response_data_inner.rb +264 -0
- data/lib/repull/models/{create_studio_deployment201_response.rb → get_usage_logs200_response_pagination.rb} +29 -10
- data/lib/repull/models/get_usage_summary200_response.rb +232 -0
- data/lib/repull/models/get_usage_summary200_response_breakdown_inner.rb +183 -0
- data/lib/repull/models/{delete_studio_deployment200_response_data.rb → get_usage_summary200_response_limits.rb} +18 -16
- data/lib/repull/models/{delete_studio_project200_response_data.rb → get_usage_summary200_response_remaining.rb} +18 -16
- data/lib/repull/models/{create_studio_project_generation201_response_data.rb → get_usage_summary200_response_status_distribution.rb} +31 -22
- data/lib/repull/models/{upsert_studio_project_file_request.rb → get_usage_summary200_response_timeline_inner.rb} +28 -28
- data/lib/repull/models/{create_studio_project_generation_request.rb → get_usage_summary200_response_totals.rb} +28 -28
- data/lib/repull/models/{create_studio_project201_response.rb → get_usage_summary200_response_used.rb} +19 -10
- data/lib/repull/models/get_usage_tier200_response.rb +183 -0
- data/lib/repull/models/{list_studio_projects200_response.rb → get_usage_tier200_response_limits.rb} +31 -12
- data/lib/repull/models/{update_reservation_request.rb → get_usage_tier200_response_remaining.rb} +25 -31
- data/lib/repull/models/{get_studio_project200_response.rb → get_usage_tier200_response_used.rb} +28 -10
- data/lib/repull/models/list_airbnb_alterations200_response.rb +192 -0
- data/lib/repull/models/list_airbnb_listing_amenities200_response.rb +190 -0
- data/lib/repull/models/{create_studio_deployment_request.rb → list_airbnb_listing_amenities200_response_data.rb} +23 -28
- data/lib/repull/models/{list_studio_project_files200_response.rb → list_airbnb_transactions200_response.rb} +50 -7
- data/lib/repull/models/listing_content_update_request.rb +243 -0
- data/lib/repull/models/{upsert_studio_project_file200_response.rb → listing_content_update_request_address.rb} +53 -10
- data/lib/repull/models/listing_content_update_request_amenities.rb +105 -0
- data/lib/repull/models/listing_content_update_request_amenities_one_of_inner.rb +196 -0
- data/lib/repull/models/listing_content_update_request_occupancy.rb +179 -0
- data/lib/repull/{api/ai_api.rb → models/listing_content_update_request_photos_inner.rb} +77 -59
- data/lib/repull/models/{generate_studio_completion200_response_data.rb → listing_content_update_request_photos_inner_one_of.rb} +81 -66
- data/lib/repull/models/listing_content_update_request_policies.rb +253 -0
- data/lib/repull/models/{create_ai_operation200_response.rb → listing_content_update_response.rb} +32 -16
- data/lib/repull/models/map_airbnb_listing_request.rb +215 -0
- data/lib/repull/models/{create_reservation_request.rb → map_airbnb_listing_response.rb} +137 -116
- data/lib/repull/models/property.rb +42 -69
- data/lib/repull/models/property_availability.rb +222 -0
- data/lib/repull/models/property_availability_day.rb +247 -0
- data/lib/repull/models/reservation.rb +28 -1
- data/lib/repull/models/sandbox_fixture_ref.rb +193 -0
- data/lib/repull/models/{delete_studio_project_file200_response_data.rb → sandbox_reset_result.rb} +72 -11
- data/lib/repull/models/sandbox_reset_result_deleted.rb +216 -0
- data/lib/repull/models/sandbox_seed_result.rb +278 -0
- data/lib/repull/models/{update_studio_project_request.rb → update_airbnb_message_request.rb} +43 -24
- data/lib/repull/models/update_booking_charges_request.rb +194 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +59 -34
- data/openapi/v1.json +3956 -2522
- metadata +61 -36
- data/lib/repull/api/studio_api.rb +0 -1094
- data/lib/repull/models/generate_studio_completion_request.rb +0 -305
- data/lib/repull/models/upsert_studio_project_file200_response_data.rb +0 -147
|
@@ -0,0 +1,222 @@
|
|
|
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
|
+
# Channel-agnostic availability calendar for a property over the requested window. Every date in `[from, to]` (inclusive) is present in `days`; dates with no explicit calendar row fall back to available at the default price.
|
|
18
|
+
class PropertyAvailability < ApiModelBase
|
|
19
|
+
# Repull property id (equal to `listings.id`), emitted as a string like every other id in the API.
|
|
20
|
+
attr_accessor :property_id
|
|
21
|
+
|
|
22
|
+
# ISO 4217 currency code for the nightly prices in `days`.
|
|
23
|
+
attr_accessor :currency
|
|
24
|
+
|
|
25
|
+
# Dense per-date calendar for the requested window (capped at 366 days), ordered ascending by date.
|
|
26
|
+
attr_accessor :days
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'property_id' => :'propertyId',
|
|
32
|
+
:'currency' => :'currency',
|
|
33
|
+
:'days' => :'days'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'property_id' => :'String',
|
|
51
|
+
:'currency' => :'String',
|
|
52
|
+
:'days' => :'Array<PropertyAvailabilityDay>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PropertyAvailability` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PropertyAvailability`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'property_id')
|
|
79
|
+
self.property_id = attributes[:'property_id']
|
|
80
|
+
else
|
|
81
|
+
self.property_id = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'currency')
|
|
85
|
+
self.currency = attributes[:'currency']
|
|
86
|
+
else
|
|
87
|
+
self.currency = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'days')
|
|
91
|
+
if (value = attributes[:'days']).is_a?(Array)
|
|
92
|
+
self.days = value
|
|
93
|
+
end
|
|
94
|
+
else
|
|
95
|
+
self.days = nil
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
100
|
+
# @return Array for valid properties with the reasons
|
|
101
|
+
def list_invalid_properties
|
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
103
|
+
invalid_properties = Array.new
|
|
104
|
+
if @property_id.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "property_id", property_id cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @currency.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @days.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "days", days cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
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
|
+
return false if @property_id.nil?
|
|
124
|
+
return false if @currency.nil?
|
|
125
|
+
return false if @days.nil?
|
|
126
|
+
true
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] property_id Value to be assigned
|
|
131
|
+
def property_id=(property_id)
|
|
132
|
+
if property_id.nil?
|
|
133
|
+
fail ArgumentError, 'property_id cannot be nil'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
@property_id = property_id
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] currency Value to be assigned
|
|
141
|
+
def currency=(currency)
|
|
142
|
+
if currency.nil?
|
|
143
|
+
fail ArgumentError, 'currency cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@currency = currency
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] days Value to be assigned
|
|
151
|
+
def days=(days)
|
|
152
|
+
if days.nil?
|
|
153
|
+
fail ArgumentError, 'days cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@days = days
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Checks equality by comparing each attribute.
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def ==(o)
|
|
162
|
+
return true if self.equal?(o)
|
|
163
|
+
self.class == o.class &&
|
|
164
|
+
property_id == o.property_id &&
|
|
165
|
+
currency == o.currency &&
|
|
166
|
+
days == o.days
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# @see the `==` method
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def eql?(o)
|
|
172
|
+
self == o
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Calculates hash code according to all attributes.
|
|
176
|
+
# @return [Integer] Hash code
|
|
177
|
+
def hash
|
|
178
|
+
[property_id, currency, days].hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Builds the object from hash
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
# @return [Object] Returns the model itself
|
|
184
|
+
def self.build_from_hash(attributes)
|
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
|
186
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
187
|
+
transformed_hash = {}
|
|
188
|
+
openapi_types.each_pair do |key, type|
|
|
189
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = nil
|
|
191
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
192
|
+
# check to ensure the input is an array given that the attribute
|
|
193
|
+
# is documented as an array but the input is not
|
|
194
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
195
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
196
|
+
end
|
|
197
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
198
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
new(transformed_hash)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the object in the form of hash
|
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
|
206
|
+
def to_hash
|
|
207
|
+
hash = {}
|
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
209
|
+
value = self.send(attr)
|
|
210
|
+
if value.nil?
|
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
hash[param] = _to_hash(value)
|
|
216
|
+
end
|
|
217
|
+
hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
@@ -0,0 +1,247 @@
|
|
|
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
|
+
# One calendar day in the availability window.
|
|
18
|
+
class PropertyAvailabilityDay < ApiModelBase
|
|
19
|
+
# The calendar date, ISO `YYYY-MM-DD`.
|
|
20
|
+
attr_accessor :date
|
|
21
|
+
|
|
22
|
+
# Whether the property is bookable on this date. `false` when the channel calendar marks the date unavailable (stop-sell / blocked).
|
|
23
|
+
attr_accessor :available
|
|
24
|
+
|
|
25
|
+
# Nightly price for this date in the property currency. Falls back to the property's default nightly price for dates with no explicit calendar override.
|
|
26
|
+
attr_accessor :price
|
|
27
|
+
|
|
28
|
+
# Minimum-stay requirement for a stay starting on this date.
|
|
29
|
+
attr_accessor :min_nights
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'date' => :'date',
|
|
35
|
+
:'available' => :'available',
|
|
36
|
+
:'price' => :'price',
|
|
37
|
+
:'min_nights' => :'minNights'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns attribute mapping this model knows about
|
|
42
|
+
def self.acceptable_attribute_map
|
|
43
|
+
attribute_map
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns all the JSON keys this model knows about
|
|
47
|
+
def self.acceptable_attributes
|
|
48
|
+
acceptable_attribute_map.values
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.openapi_types
|
|
53
|
+
{
|
|
54
|
+
:'date' => :'Date',
|
|
55
|
+
:'available' => :'Boolean',
|
|
56
|
+
:'price' => :'Float',
|
|
57
|
+
:'min_nights' => :'Integer'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PropertyAvailabilityDay` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PropertyAvailabilityDay`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'date')
|
|
84
|
+
self.date = attributes[:'date']
|
|
85
|
+
else
|
|
86
|
+
self.date = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'available')
|
|
90
|
+
self.available = attributes[:'available']
|
|
91
|
+
else
|
|
92
|
+
self.available = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'price')
|
|
96
|
+
self.price = attributes[:'price']
|
|
97
|
+
else
|
|
98
|
+
self.price = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'min_nights')
|
|
102
|
+
self.min_nights = attributes[:'min_nights']
|
|
103
|
+
else
|
|
104
|
+
self.min_nights = nil
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
109
|
+
# @return Array for valid properties with the reasons
|
|
110
|
+
def list_invalid_properties
|
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
if @date.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "date", date cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @available.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "available", available cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @price.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "price", price cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if @min_nights.nil?
|
|
126
|
+
invalid_properties.push('invalid value for "min_nights", min_nights cannot be nil.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
invalid_properties
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Check to see if the all the properties in the model are valid
|
|
133
|
+
# @return true if the model is valid
|
|
134
|
+
def valid?
|
|
135
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
|
+
return false if @date.nil?
|
|
137
|
+
return false if @available.nil?
|
|
138
|
+
return false if @price.nil?
|
|
139
|
+
return false if @min_nights.nil?
|
|
140
|
+
true
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] date Value to be assigned
|
|
145
|
+
def date=(date)
|
|
146
|
+
if date.nil?
|
|
147
|
+
fail ArgumentError, 'date cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@date = date
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Custom attribute writer method with validation
|
|
154
|
+
# @param [Object] available Value to be assigned
|
|
155
|
+
def available=(available)
|
|
156
|
+
if available.nil?
|
|
157
|
+
fail ArgumentError, 'available cannot be nil'
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
@available = available
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Custom attribute writer method with validation
|
|
164
|
+
# @param [Object] price Value to be assigned
|
|
165
|
+
def price=(price)
|
|
166
|
+
if price.nil?
|
|
167
|
+
fail ArgumentError, 'price cannot be nil'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
@price = price
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] min_nights Value to be assigned
|
|
175
|
+
def min_nights=(min_nights)
|
|
176
|
+
if min_nights.nil?
|
|
177
|
+
fail ArgumentError, 'min_nights cannot be nil'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
@min_nights = min_nights
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Checks equality by comparing each attribute.
|
|
184
|
+
# @param [Object] Object to be compared
|
|
185
|
+
def ==(o)
|
|
186
|
+
return true if self.equal?(o)
|
|
187
|
+
self.class == o.class &&
|
|
188
|
+
date == o.date &&
|
|
189
|
+
available == o.available &&
|
|
190
|
+
price == o.price &&
|
|
191
|
+
min_nights == o.min_nights
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# @see the `==` method
|
|
195
|
+
# @param [Object] Object to be compared
|
|
196
|
+
def eql?(o)
|
|
197
|
+
self == o
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Calculates hash code according to all attributes.
|
|
201
|
+
# @return [Integer] Hash code
|
|
202
|
+
def hash
|
|
203
|
+
[date, available, price, min_nights].hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Builds the object from hash
|
|
207
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
208
|
+
# @return [Object] Returns the model itself
|
|
209
|
+
def self.build_from_hash(attributes)
|
|
210
|
+
return nil unless attributes.is_a?(Hash)
|
|
211
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
212
|
+
transformed_hash = {}
|
|
213
|
+
openapi_types.each_pair do |key, type|
|
|
214
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
215
|
+
transformed_hash["#{key}"] = nil
|
|
216
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
217
|
+
# check to ensure the input is an array given that the attribute
|
|
218
|
+
# is documented as an array but the input is not
|
|
219
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
220
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
221
|
+
end
|
|
222
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
223
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
new(transformed_hash)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Returns the object in the form of hash
|
|
230
|
+
# @return [Hash] Returns the object in the form of hash
|
|
231
|
+
def to_hash
|
|
232
|
+
hash = {}
|
|
233
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
234
|
+
value = self.send(attr)
|
|
235
|
+
if value.nil?
|
|
236
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
237
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
hash[param] = _to_hash(value)
|
|
241
|
+
end
|
|
242
|
+
hash
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
end
|
|
@@ -62,6 +62,9 @@ module Repull
|
|
|
62
62
|
# When the reservation row was created in Repull (not the booking-on-channel timestamp).
|
|
63
63
|
attr_accessor :created_at
|
|
64
64
|
|
|
65
|
+
# Last time this reservation was modified (dates, status, price, or guest details). Advances on every amendment or cancellation — poll or compare this value to reconcile changes instead of fingerprinting individual fields.
|
|
66
|
+
attr_accessor :updated_at
|
|
67
|
+
|
|
65
68
|
# When the booking was made on the source channel (when reported by the channel).
|
|
66
69
|
attr_accessor :booked_at
|
|
67
70
|
|
|
@@ -87,6 +90,7 @@ module Repull
|
|
|
87
90
|
:'currency' => :'currency',
|
|
88
91
|
:'guest_details' => :'guestDetails',
|
|
89
92
|
:'created_at' => :'createdAt',
|
|
93
|
+
:'updated_at' => :'updatedAt',
|
|
90
94
|
:'booked_at' => :'bookedAt',
|
|
91
95
|
:'guest_name' => :'guestName'
|
|
92
96
|
}
|
|
@@ -121,6 +125,7 @@ module Repull
|
|
|
121
125
|
:'currency' => :'String',
|
|
122
126
|
:'guest_details' => :'Hash<String, Object>',
|
|
123
127
|
:'created_at' => :'Time',
|
|
128
|
+
:'updated_at' => :'Time',
|
|
124
129
|
:'booked_at' => :'Time',
|
|
125
130
|
:'guest_name' => :'String'
|
|
126
131
|
}
|
|
@@ -232,6 +237,12 @@ module Repull
|
|
|
232
237
|
self.created_at = nil
|
|
233
238
|
end
|
|
234
239
|
|
|
240
|
+
if attributes.key?(:'updated_at')
|
|
241
|
+
self.updated_at = attributes[:'updated_at']
|
|
242
|
+
else
|
|
243
|
+
self.updated_at = nil
|
|
244
|
+
end
|
|
245
|
+
|
|
235
246
|
if attributes.key?(:'booked_at')
|
|
236
247
|
self.booked_at = attributes[:'booked_at']
|
|
237
248
|
end
|
|
@@ -274,6 +285,10 @@ module Repull
|
|
|
274
285
|
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
275
286
|
end
|
|
276
287
|
|
|
288
|
+
if @updated_at.nil?
|
|
289
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
290
|
+
end
|
|
291
|
+
|
|
277
292
|
invalid_properties
|
|
278
293
|
end
|
|
279
294
|
|
|
@@ -288,6 +303,7 @@ module Repull
|
|
|
288
303
|
return false if @status.nil?
|
|
289
304
|
return false if @confirmation_code.nil?
|
|
290
305
|
return false if @created_at.nil?
|
|
306
|
+
return false if @updated_at.nil?
|
|
291
307
|
true
|
|
292
308
|
end
|
|
293
309
|
|
|
@@ -361,6 +377,16 @@ module Repull
|
|
|
361
377
|
@created_at = created_at
|
|
362
378
|
end
|
|
363
379
|
|
|
380
|
+
# Custom attribute writer method with validation
|
|
381
|
+
# @param [Object] updated_at Value to be assigned
|
|
382
|
+
def updated_at=(updated_at)
|
|
383
|
+
if updated_at.nil?
|
|
384
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
@updated_at = updated_at
|
|
388
|
+
end
|
|
389
|
+
|
|
364
390
|
# Checks equality by comparing each attribute.
|
|
365
391
|
# @param [Object] Object to be compared
|
|
366
392
|
def ==(o)
|
|
@@ -382,6 +408,7 @@ module Repull
|
|
|
382
408
|
currency == o.currency &&
|
|
383
409
|
guest_details == o.guest_details &&
|
|
384
410
|
created_at == o.created_at &&
|
|
411
|
+
updated_at == o.updated_at &&
|
|
385
412
|
booked_at == o.booked_at &&
|
|
386
413
|
guest_name == o.guest_name
|
|
387
414
|
end
|
|
@@ -395,7 +422,7 @@ module Repull
|
|
|
395
422
|
# Calculates hash code according to all attributes.
|
|
396
423
|
# @return [Integer] Hash code
|
|
397
424
|
def hash
|
|
398
|
-
[id, listing_id, guest_id, check_in, check_out, status, source, platform, confirmation_code, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, booked_at, guest_name].hash
|
|
425
|
+
[id, listing_id, guest_id, check_in, check_out, status, source, platform, confirmation_code, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
|
|
399
426
|
end
|
|
400
427
|
|
|
401
428
|
# Builds the object from hash
|