repull 0.2.14 → 0.2.15
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 +1265 -125
- data/lib/repull/api/availability_api.rb +2 -2
- data/lib/repull/api/connect_api.rb +4 -4
- data/lib/repull/api/listings_api.rb +97 -13
- data/lib/repull/models/airbnb_account_freshness.rb +239 -0
- data/lib/repull/models/airbnb_alteration.rb +46 -2
- data/lib/repull/models/airbnb_alteration_create_request.rb +264 -0
- data/lib/repull/models/airbnb_connection.rb +69 -2
- data/lib/repull/models/airbnb_connection_host.rb +1 -1
- data/lib/repull/models/airbnb_content_write_response.rb +275 -0
- data/lib/repull/models/airbnb_data_freshness.rb +22 -10
- data/lib/repull/models/{create_airbnb_alteration_request.rb → airbnb_description_write_request.rb} +44 -47
- data/lib/repull/models/airbnb_description_write_request_description.rb +365 -0
- data/lib/repull/models/airbnb_listing.rb +12 -1
- data/lib/repull/models/airbnb_listing_action200_response.rb +105 -0
- data/lib/repull/models/airbnb_listing_action200_response_one_of.rb +157 -0
- data/lib/repull/models/airbnb_listing_action200_response_one_of1.rb +175 -0
- data/lib/repull/models/airbnb_listing_action_request.rb +2 -2
- data/lib/repull/models/airbnb_listing_details_response.rb +284 -0
- data/lib/repull/models/airbnb_listing_details_write_request.rb +209 -0
- data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +214 -0
- data/lib/repull/models/airbnb_listing_details_write_request_quiet_hours_inner.rb +190 -0
- data/lib/repull/models/airbnb_listing_lifecycle_response.rb +196 -0
- data/lib/repull/models/airbnb_permits_response.rb +163 -0
- data/lib/repull/models/airbnb_permits_response_cached_inner.rb +200 -0
- data/lib/repull/models/airbnb_permits_write_request.rb +176 -0
- data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +228 -0
- data/lib/repull/models/airbnb_permits_write_request_permits_inner_answers_inner.rb +198 -0
- data/lib/repull/models/airbnb_photo_position.rb +159 -0
- data/lib/repull/models/airbnb_publish_result.rb +263 -0
- data/lib/repull/models/airbnb_reservation.rb +23 -1
- data/lib/repull/models/airbnb_reservation_list_response.rb +13 -4
- data/lib/repull/models/airbnb_review.rb +23 -1
- data/lib/repull/models/airbnb_review_list_response.rb +13 -4
- data/lib/repull/models/airbnb_safety_disclosure.rb +202 -0
- data/lib/repull/models/airbnb_safety_disclosures_response.rb +162 -0
- data/lib/repull/models/airbnb_safety_disclosures_write_request.rb +176 -0
- data/lib/repull/models/airbnb_thread.rb +23 -1
- data/lib/repull/models/airbnb_thread_list_response.rb +13 -4
- data/lib/repull/models/airbnb_transaction.rb +23 -1
- data/lib/repull/models/create_airbnb_listing_room_request.rb +315 -0
- data/lib/repull/models/delete_airbnb_listing_photo200_response.rb +14 -4
- data/lib/repull/models/delete_airbnb_listing_room200_response.rb +157 -0
- data/lib/repull/models/error_error.rb +31 -1
- data/lib/repull/models/get_airbnb_booking_settings200_response.rb +190 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data.rb +246 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_advance_notice.rb +172 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_booking_window.rb +160 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation.rb +203 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation_non_refundable.rb +218 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in.rb +159 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in_start.rb +104 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_out.rb +172 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_instant_book.rb +206 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_preparation_time.rb +173 -0
- data/lib/repull/models/get_airbnb_listing_details200_response.rb +192 -0
- data/lib/repull/models/list_airbnb_listing_permits200_response.rb +190 -0
- data/lib/repull/models/list_airbnb_listing_safety_disclosures200_response.rb +190 -0
- data/lib/repull/models/listing.rb +2 -1
- data/lib/repull/models/listing_content.rb +13 -2
- data/lib/repull/models/listing_content_update_request.rb +21 -2
- data/lib/repull/models/listing_content_update_request_details.rb +206 -0
- data/lib/repull/models/listing_content_update_request_policies.rb +95 -5
- data/lib/repull/models/listing_content_update_response.rb +1 -1
- data/lib/repull/models/listing_publish_airbnb_response.rb +165 -0
- data/lib/repull/models/listing_pull_airbnb_request.rb +149 -0
- data/lib/repull/models/listing_pull_response.rb +231 -0
- data/lib/repull/models/publish_section_error.rb +232 -0
- data/lib/repull/models/reorder_airbnb_listing_photos200_response.rb +191 -0
- data/lib/repull/models/reorder_airbnb_listing_photos200_response_data.rb +172 -0
- data/lib/repull/models/reorder_airbnb_listing_photos_request.rb +185 -0
- data/lib/repull/models/reservation.rb +23 -1
- data/lib/repull/models/reservation_webhook_object.rb +38 -5
- data/lib/repull/models/set_airbnb_listing_cover_photo200_response.rb +191 -0
- data/lib/repull/models/set_airbnb_listing_cover_photo200_response_data.rb +171 -0
- data/lib/repull/models/set_airbnb_listing_cover_photo_request.rb +165 -0
- data/lib/repull/models/update_airbnb_booking_settings200_response.rb +164 -0
- data/lib/repull/models/update_airbnb_booking_settings200_response_data.rb +205 -0
- data/lib/repull/models/update_airbnb_booking_settings_request.rb +202 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_advance_notice.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_booking_window.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_cancellation.rb +201 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_cancellation_non_refundable.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_check_in.rb +159 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_check_out.rb +182 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_instant_book.rb +203 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_preparation_time.rb +182 -0
- data/lib/repull/models/update_airbnb_listing_amenities200_response.rb +191 -0
- data/lib/repull/models/update_airbnb_listing_amenities200_response_data.rb +158 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request.rb +199 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request_accessibility_amenities_inner.rb +246 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request_amenities_inner.rb +218 -0
- data/lib/repull/models/update_airbnb_listing_permits200_response.rb +168 -0
- data/lib/repull/models/update_airbnb_listing_photo200_response.rb +194 -0
- data/lib/repull/models/update_airbnb_listing_photo_request.rb +242 -0
- data/lib/repull/models/update_airbnb_listing_room200_response.rb +194 -0
- data/lib/repull/models/update_airbnb_listing_room_request.rb +293 -0
- data/lib/repull/models/update_airbnb_listing_room_request_beds_inner.rb +209 -0
- data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner.rb +182 -0
- data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner_value.rb +105 -0
- data/lib/repull/models/update_airbnb_listing_safety_disclosures200_response.rb +180 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request.rb +184 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner.rb +305 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner_listing_id.rb +105 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +78 -1
- data/openapi/v1.json +4523 -1282
- data/scripts/regen.sh +1 -1
- metadata +80 -3
|
@@ -0,0 +1,172 @@
|
|
|
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 ReorderAirbnbListingPhotos200ResponseData < ApiModelBase
|
|
18
|
+
# The resulting tour order, including photos you did not name.
|
|
19
|
+
attr_accessor :order
|
|
20
|
+
|
|
21
|
+
# The photos this call actually moved.
|
|
22
|
+
attr_accessor :applied
|
|
23
|
+
|
|
24
|
+
# Photos that were already in the right position.
|
|
25
|
+
attr_accessor :unchanged
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'order' => :'order',
|
|
31
|
+
:'applied' => :'applied',
|
|
32
|
+
:'unchanged' => :'unchanged'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'order' => :'Array<AirbnbPhotoPosition>',
|
|
50
|
+
:'applied' => :'Array<AirbnbPhotoPosition>',
|
|
51
|
+
:'unchanged' => :'Integer'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ReorderAirbnbListingPhotos200ResponseData` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ReorderAirbnbListingPhotos200ResponseData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'order')
|
|
78
|
+
if (value = attributes[:'order']).is_a?(Array)
|
|
79
|
+
self.order = value
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'applied')
|
|
84
|
+
if (value = attributes[:'applied']).is_a?(Array)
|
|
85
|
+
self.applied = value
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'unchanged')
|
|
90
|
+
self.unchanged = attributes[:'unchanged']
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
95
|
+
# @return Array for valid properties with the reasons
|
|
96
|
+
def list_invalid_properties
|
|
97
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
98
|
+
invalid_properties = Array.new
|
|
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
|
+
true
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Checks equality by comparing each attribute.
|
|
110
|
+
# @param [Object] Object to be compared
|
|
111
|
+
def ==(o)
|
|
112
|
+
return true if self.equal?(o)
|
|
113
|
+
self.class == o.class &&
|
|
114
|
+
order == o.order &&
|
|
115
|
+
applied == o.applied &&
|
|
116
|
+
unchanged == o.unchanged
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# @see the `==` method
|
|
120
|
+
# @param [Object] Object to be compared
|
|
121
|
+
def eql?(o)
|
|
122
|
+
self == o
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Calculates hash code according to all attributes.
|
|
126
|
+
# @return [Integer] Hash code
|
|
127
|
+
def hash
|
|
128
|
+
[order, applied, unchanged].hash
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Builds the object from hash
|
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
133
|
+
# @return [Object] Returns the model itself
|
|
134
|
+
def self.build_from_hash(attributes)
|
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
|
136
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
137
|
+
transformed_hash = {}
|
|
138
|
+
openapi_types.each_pair do |key, type|
|
|
139
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
140
|
+
transformed_hash["#{key}"] = nil
|
|
141
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
142
|
+
# check to ensure the input is an array given that the attribute
|
|
143
|
+
# is documented as an array but the input is not
|
|
144
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
145
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
146
|
+
end
|
|
147
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
148
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
new(transformed_hash)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Returns the object in the form of hash
|
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
|
156
|
+
def to_hash
|
|
157
|
+
hash = {}
|
|
158
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
159
|
+
value = self.send(attr)
|
|
160
|
+
if value.nil?
|
|
161
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
162
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
hash[param] = _to_hash(value)
|
|
166
|
+
end
|
|
167
|
+
hash
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
end
|
|
@@ -0,0 +1,185 @@
|
|
|
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 ReorderAirbnbListingPhotosRequest < ApiModelBase
|
|
18
|
+
# Airbnb photo ids (`photoAirbnbId` from `GET /photos`) in display order, first photo first. No duplicates; every id must be on this listing.
|
|
19
|
+
attr_accessor :photo_ids
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'photo_ids' => :'photo_ids'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'photo_ids' => :'Array<String>'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ReorderAirbnbListingPhotosRequest` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ReorderAirbnbListingPhotosRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'photo_ids')
|
|
68
|
+
if (value = attributes[:'photo_ids']).is_a?(Array)
|
|
69
|
+
self.photo_ids = value
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
self.photo_ids = nil
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
77
|
+
# @return Array for valid properties with the reasons
|
|
78
|
+
def list_invalid_properties
|
|
79
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
80
|
+
invalid_properties = Array.new
|
|
81
|
+
if @photo_ids.nil?
|
|
82
|
+
invalid_properties.push('invalid value for "photo_ids", photo_ids cannot be nil.')
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if @photo_ids.length > 200
|
|
86
|
+
invalid_properties.push('invalid value for "photo_ids", number of items must be less than or equal to 200.')
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if @photo_ids.length < 1
|
|
90
|
+
invalid_properties.push('invalid value for "photo_ids", number of items must be greater than or equal to 1.')
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
invalid_properties
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Check to see if the all the properties in the model are valid
|
|
97
|
+
# @return true if the model is valid
|
|
98
|
+
def valid?
|
|
99
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
100
|
+
return false if @photo_ids.nil?
|
|
101
|
+
return false if @photo_ids.length > 200
|
|
102
|
+
return false if @photo_ids.length < 1
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Custom attribute writer method with validation
|
|
107
|
+
# @param [Object] photo_ids Value to be assigned
|
|
108
|
+
def photo_ids=(photo_ids)
|
|
109
|
+
if photo_ids.nil?
|
|
110
|
+
fail ArgumentError, 'photo_ids cannot be nil'
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if photo_ids.length > 200
|
|
114
|
+
fail ArgumentError, 'invalid value for "photo_ids", number of items must be less than or equal to 200.'
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if photo_ids.length < 1
|
|
118
|
+
fail ArgumentError, 'invalid value for "photo_ids", number of items must be greater than or equal to 1.'
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
@photo_ids = photo_ids
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Checks equality by comparing each attribute.
|
|
125
|
+
# @param [Object] Object to be compared
|
|
126
|
+
def ==(o)
|
|
127
|
+
return true if self.equal?(o)
|
|
128
|
+
self.class == o.class &&
|
|
129
|
+
photo_ids == o.photo_ids
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# @see the `==` method
|
|
133
|
+
# @param [Object] Object to be compared
|
|
134
|
+
def eql?(o)
|
|
135
|
+
self == o
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Calculates hash code according to all attributes.
|
|
139
|
+
# @return [Integer] Hash code
|
|
140
|
+
def hash
|
|
141
|
+
[photo_ids].hash
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Builds the object from hash
|
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
146
|
+
# @return [Object] Returns the model itself
|
|
147
|
+
def self.build_from_hash(attributes)
|
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
150
|
+
transformed_hash = {}
|
|
151
|
+
openapi_types.each_pair do |key, type|
|
|
152
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
153
|
+
transformed_hash["#{key}"] = nil
|
|
154
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
155
|
+
# check to ensure the input is an array given that the attribute
|
|
156
|
+
# is documented as an array but the input is not
|
|
157
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
158
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
159
|
+
end
|
|
160
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
new(transformed_hash)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Returns the object in the form of hash
|
|
168
|
+
# @return [Hash] Returns the object in the form of hash
|
|
169
|
+
def to_hash
|
|
170
|
+
hash = {}
|
|
171
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
172
|
+
value = self.send(attr)
|
|
173
|
+
if value.nil?
|
|
174
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
175
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
hash[param] = _to_hash(value)
|
|
179
|
+
end
|
|
180
|
+
hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
end
|
|
@@ -29,6 +29,12 @@ module Repull
|
|
|
29
29
|
|
|
30
30
|
attr_accessor :check_out
|
|
31
31
|
|
|
32
|
+
# Local check-in time for this stay, `HH:MM` on a 24-hour clock in the **property's own timezone** — not UTC. Usually inherited from the listing policy, overridden per reservation where an early check-in was agreed. `null` when unknown. This is the same field `PATCH /v1/reservations/{id}` writes.
|
|
33
|
+
attr_accessor :check_in_time
|
|
34
|
+
|
|
35
|
+
# Local check-out time for this stay, `HH:MM` on a 24-hour clock in the property's own timezone. Pair with `checkOut` to schedule the turnover clean. `null` when unknown. This is the same field `PATCH /v1/reservations/{id}` writes.
|
|
36
|
+
attr_accessor :check_out_time
|
|
37
|
+
|
|
32
38
|
# Lifecycle status. The API normalises a multi-decade internal taxonomy down to these four buckets, so the value you receive is always one of the enum constants. `completed` is derived from `checkOut < today`.
|
|
33
39
|
attr_accessor :status
|
|
34
40
|
|
|
@@ -79,6 +85,8 @@ module Repull
|
|
|
79
85
|
:'guest_id' => :'guestId',
|
|
80
86
|
:'check_in' => :'checkIn',
|
|
81
87
|
:'check_out' => :'checkOut',
|
|
88
|
+
:'check_in_time' => :'checkInTime',
|
|
89
|
+
:'check_out_time' => :'checkOutTime',
|
|
82
90
|
:'status' => :'status',
|
|
83
91
|
:'source' => :'source',
|
|
84
92
|
:'platform' => :'platform',
|
|
@@ -114,6 +122,8 @@ module Repull
|
|
|
114
122
|
:'guest_id' => :'String',
|
|
115
123
|
:'check_in' => :'Date',
|
|
116
124
|
:'check_out' => :'Date',
|
|
125
|
+
:'check_in_time' => :'String',
|
|
126
|
+
:'check_out_time' => :'String',
|
|
117
127
|
:'status' => :'String',
|
|
118
128
|
:'source' => :'String',
|
|
119
129
|
:'platform' => :'String',
|
|
@@ -134,6 +144,8 @@ module Repull
|
|
|
134
144
|
# List of attributes with nullable: true
|
|
135
145
|
def self.openapi_nullable
|
|
136
146
|
Set.new([
|
|
147
|
+
:'check_in_time',
|
|
148
|
+
:'check_out_time',
|
|
137
149
|
:'source',
|
|
138
150
|
:'platform',
|
|
139
151
|
:'booked_at',
|
|
@@ -185,6 +197,14 @@ module Repull
|
|
|
185
197
|
self.check_out = nil
|
|
186
198
|
end
|
|
187
199
|
|
|
200
|
+
if attributes.key?(:'check_in_time')
|
|
201
|
+
self.check_in_time = attributes[:'check_in_time']
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if attributes.key?(:'check_out_time')
|
|
205
|
+
self.check_out_time = attributes[:'check_out_time']
|
|
206
|
+
end
|
|
207
|
+
|
|
188
208
|
if attributes.key?(:'status')
|
|
189
209
|
self.status = attributes[:'status']
|
|
190
210
|
else
|
|
@@ -397,6 +417,8 @@ module Repull
|
|
|
397
417
|
guest_id == o.guest_id &&
|
|
398
418
|
check_in == o.check_in &&
|
|
399
419
|
check_out == o.check_out &&
|
|
420
|
+
check_in_time == o.check_in_time &&
|
|
421
|
+
check_out_time == o.check_out_time &&
|
|
400
422
|
status == o.status &&
|
|
401
423
|
source == o.source &&
|
|
402
424
|
platform == o.platform &&
|
|
@@ -422,7 +444,7 @@ module Repull
|
|
|
422
444
|
# Calculates hash code according to all attributes.
|
|
423
445
|
# @return [Integer] Hash code
|
|
424
446
|
def 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
|
|
447
|
+
[id, listing_id, guest_id, check_in, check_out, check_in_time, check_out_time, status, source, platform, confirmation_code, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
|
|
426
448
|
end
|
|
427
449
|
|
|
428
450
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
# Lightweight reservation snapshot delivered as `data.object` on every reservation webhook event. Stable across `reservation.created`, `reservation.updated`, and `reservation.cancelled`. Fetch the full reservation via `GET /v1/reservations/{id}` if you need pricing, guest contact info, or audit history — those are deliberately omitted to keep deliveries small.
|
|
17
|
+
# Lightweight reservation snapshot delivered as `data.object` on every reservation webhook event. Stable across `reservation.created`, `reservation.updated`, and `reservation.cancelled`. Fetch the full reservation via `GET /v1/reservations/{id}` if you need pricing, guest contact info, or audit history — those are deliberately omitted to keep deliveries small. **Stay terms are the one exception to that rule.** `cancellationPolicy`, `checkInTime` and `checkOutTime` ride on every delivery, because the decisions they drive — is a refund owed, when can housekeeping turn the unit over — are made at the moment the webhook lands, not on a follow-up fetch. They are operational parameters of the booking, not contact or payment data. Guest email, payment method and payment reference stay off the snapshot; see `GET /v1/reservations/{id}`. All three are `null` when the source channel did not supply them. They are never defaulted: a fabricated policy is worse than a missing one.
|
|
18
18
|
class ReservationWebhookObject < ApiModelBase
|
|
19
19
|
# Repull-internal reservation id. Pass to `GET /v1/reservations/{id}`.
|
|
20
20
|
attr_accessor :id
|
|
@@ -40,6 +40,15 @@ module Repull
|
|
|
40
40
|
# Lifecycle status — typically `confirmed`, `cancelled`, `pending`, `inquiry`.
|
|
41
41
|
attr_accessor :status
|
|
42
42
|
|
|
43
|
+
# Cancellation policy the booking was made under, **verbatim from the source channel** — not normalised, because the codes do not mean the same thing across channels. - Airbnb, Vrbo, direct and owner bookings carry a named code: `flexible`, `moderate`, `firm_14`, `strict_14_with_grace_period`, `better_strict_with_grace_period`, `super_strict_30`, `super_strict_60`, `tiered_pricing_non_refundable`, `long_term_flexible`, `flexible_new`. - **Booking.com carries its numeric policy id as a string** (`\"1\"`, `\"74\"`, `\"121\"`). It is not self-describing — resolve it against the property's policy set on Booking.com. `null` when the channel supplied none (iCal-imported bookings, some legacy direct rows).
|
|
44
|
+
attr_accessor :cancellation_policy
|
|
45
|
+
|
|
46
|
+
# Local check-in time, `HH:MM` on a 24-hour clock in the **property's own timezone** — not UTC, and not the subscriber's. Usually inherited from the listing policy, but per-reservation where the channel or an agreed early check-in overrides it. `null` when unknown.
|
|
47
|
+
attr_accessor :check_in_time
|
|
48
|
+
|
|
49
|
+
# Local check-out time, `HH:MM` on a 24-hour clock in the property's own timezone. Pair it with `checkoutDate` to schedule the turnover. `null` when unknown.
|
|
50
|
+
attr_accessor :check_out_time
|
|
51
|
+
|
|
43
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
53
|
def self.attribute_map
|
|
45
54
|
{
|
|
@@ -50,7 +59,10 @@ module Repull
|
|
|
50
59
|
:'customer_id' => :'customerId',
|
|
51
60
|
:'checkin_date' => :'checkinDate',
|
|
52
61
|
:'checkout_date' => :'checkoutDate',
|
|
53
|
-
:'status' => :'status'
|
|
62
|
+
:'status' => :'status',
|
|
63
|
+
:'cancellation_policy' => :'cancellationPolicy',
|
|
64
|
+
:'check_in_time' => :'checkInTime',
|
|
65
|
+
:'check_out_time' => :'checkOutTime'
|
|
54
66
|
}
|
|
55
67
|
end
|
|
56
68
|
|
|
@@ -74,13 +86,19 @@ module Repull
|
|
|
74
86
|
:'customer_id' => :'Integer',
|
|
75
87
|
:'checkin_date' => :'Date',
|
|
76
88
|
:'checkout_date' => :'Date',
|
|
77
|
-
:'status' => :'String'
|
|
89
|
+
:'status' => :'String',
|
|
90
|
+
:'cancellation_policy' => :'String',
|
|
91
|
+
:'check_in_time' => :'String',
|
|
92
|
+
:'check_out_time' => :'String'
|
|
78
93
|
}
|
|
79
94
|
end
|
|
80
95
|
|
|
81
96
|
# List of attributes with nullable: true
|
|
82
97
|
def self.openapi_nullable
|
|
83
98
|
Set.new([
|
|
99
|
+
:'cancellation_policy',
|
|
100
|
+
:'check_in_time',
|
|
101
|
+
:'check_out_time'
|
|
84
102
|
])
|
|
85
103
|
end
|
|
86
104
|
|
|
@@ -147,6 +165,18 @@ module Repull
|
|
|
147
165
|
else
|
|
148
166
|
self.status = nil
|
|
149
167
|
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'cancellation_policy')
|
|
170
|
+
self.cancellation_policy = attributes[:'cancellation_policy']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'check_in_time')
|
|
174
|
+
self.check_in_time = attributes[:'check_in_time']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'check_out_time')
|
|
178
|
+
self.check_out_time = attributes[:'check_out_time']
|
|
179
|
+
end
|
|
150
180
|
end
|
|
151
181
|
|
|
152
182
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -296,7 +326,10 @@ module Repull
|
|
|
296
326
|
customer_id == o.customer_id &&
|
|
297
327
|
checkin_date == o.checkin_date &&
|
|
298
328
|
checkout_date == o.checkout_date &&
|
|
299
|
-
status == o.status
|
|
329
|
+
status == o.status &&
|
|
330
|
+
cancellation_policy == o.cancellation_policy &&
|
|
331
|
+
check_in_time == o.check_in_time &&
|
|
332
|
+
check_out_time == o.check_out_time
|
|
300
333
|
end
|
|
301
334
|
|
|
302
335
|
# @see the `==` method
|
|
@@ -308,7 +341,7 @@ module Repull
|
|
|
308
341
|
# Calculates hash code according to all attributes.
|
|
309
342
|
# @return [Integer] Hash code
|
|
310
343
|
def hash
|
|
311
|
-
[id, uid, channel, listing_id, customer_id, checkin_date, checkout_date, status].hash
|
|
344
|
+
[id, uid, channel, listing_id, customer_id, checkin_date, checkout_date, status, cancellation_policy, check_in_time, check_out_time].hash
|
|
312
345
|
end
|
|
313
346
|
|
|
314
347
|
# Builds the object from hash
|