repull 0.2.16 → 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.
- checksums.yaml +4 -4
- data/lib/repull/api/airbnb_api.rb +6 -6
- data/lib/repull/api/booking_com_api.rb +86 -2
- data/lib/repull/api/conversations_api.rb +8 -8
- data/lib/repull/api/listings_api.rb +182 -12
- data/lib/repull/api/reservations_api.rb +4 -4
- data/lib/repull/models/airbnb_publish_result.rb +41 -2
- data/lib/repull/models/booking_property_action_request.rb +176 -0
- data/lib/repull/models/booking_property_action_response.rb +281 -0
- data/lib/repull/models/booking_publish_result.rb +245 -0
- data/lib/repull/models/booking_publish_section_error.rb +220 -0
- data/lib/repull/models/booking_setup_request.rb +44 -5
- data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -0
- data/lib/repull/models/channel_market_state_item.rb +291 -0
- data/lib/repull/models/error_error.rb +11 -1
- data/lib/repull/models/inquiry_updated_payload.rb +1 -1
- data/lib/repull/models/list_inquiries200_response_data_inner.rb +1 -1
- data/lib/repull/models/listing_address_readiness.rb +171 -0
- data/lib/repull/models/listing_content_update_request_address.rb +40 -3
- data/lib/repull/models/listing_create_request.rb +48 -2
- data/lib/repull/models/listing_market_state_request.rb +149 -0
- data/lib/repull/models/listing_market_state_response.rb +221 -0
- data/lib/repull/models/listing_publish_booking_request.rb +149 -0
- data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
- data/lib/repull/models/listing_publish_status_channel.rb +32 -1
- data/lib/repull/models/listing_publish_status_connection.rb +17 -5
- data/lib/repull/models/listing_publish_status_response.rb +13 -1
- data/lib/repull/models/reservation_request_updated_payload.rb +1 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +11 -1
- data/openapi/v1.json +855 -72
- data/scripts/regen.sh +1 -1
- metadata +13 -3
|
@@ -0,0 +1,235 @@
|
|
|
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
|
+
# Used by `create-property` ONLY when this workspace has no legal entity yet — one is registered with Booking.com from these details and used for the property. Ignored when the workspace already has one, so a second is never registered.
|
|
18
|
+
class BookingSetupRequestLegalEntity < ApiModelBase
|
|
19
|
+
attr_accessor :company_name
|
|
20
|
+
|
|
21
|
+
attr_accessor :legal_contact_name
|
|
22
|
+
|
|
23
|
+
attr_accessor :legal_contact_email
|
|
24
|
+
|
|
25
|
+
attr_accessor :country
|
|
26
|
+
|
|
27
|
+
attr_accessor :city
|
|
28
|
+
|
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
|
+
def self.attribute_map
|
|
31
|
+
{
|
|
32
|
+
:'company_name' => :'company_name',
|
|
33
|
+
:'legal_contact_name' => :'legal_contact_name',
|
|
34
|
+
:'legal_contact_email' => :'legal_contact_email',
|
|
35
|
+
:'country' => :'country',
|
|
36
|
+
:'city' => :'city'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'company_name' => :'String',
|
|
54
|
+
:'legal_contact_name' => :'String',
|
|
55
|
+
:'legal_contact_email' => :'String',
|
|
56
|
+
:'country' => :'String',
|
|
57
|
+
:'city' => :'String'
|
|
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::BookingSetupRequestLegalEntity` 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::BookingSetupRequestLegalEntity`. 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?(:'company_name')
|
|
84
|
+
self.company_name = attributes[:'company_name']
|
|
85
|
+
else
|
|
86
|
+
self.company_name = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'legal_contact_name')
|
|
90
|
+
self.legal_contact_name = attributes[:'legal_contact_name']
|
|
91
|
+
else
|
|
92
|
+
self.legal_contact_name = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'legal_contact_email')
|
|
96
|
+
self.legal_contact_email = attributes[:'legal_contact_email']
|
|
97
|
+
else
|
|
98
|
+
self.legal_contact_email = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'country')
|
|
102
|
+
self.country = attributes[:'country']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'city')
|
|
106
|
+
self.city = attributes[:'city']
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
111
|
+
# @return Array for valid properties with the reasons
|
|
112
|
+
def list_invalid_properties
|
|
113
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
114
|
+
invalid_properties = Array.new
|
|
115
|
+
if @company_name.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "company_name", company_name cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if @legal_contact_name.nil?
|
|
120
|
+
invalid_properties.push('invalid value for "legal_contact_name", legal_contact_name cannot be nil.')
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if @legal_contact_email.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "legal_contact_email", legal_contact_email cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
invalid_properties
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Check to see if the all the properties in the model are valid
|
|
131
|
+
# @return true if the model is valid
|
|
132
|
+
def valid?
|
|
133
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
134
|
+
return false if @company_name.nil?
|
|
135
|
+
return false if @legal_contact_name.nil?
|
|
136
|
+
return false if @legal_contact_email.nil?
|
|
137
|
+
true
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Custom attribute writer method with validation
|
|
141
|
+
# @param [Object] company_name Value to be assigned
|
|
142
|
+
def company_name=(company_name)
|
|
143
|
+
if company_name.nil?
|
|
144
|
+
fail ArgumentError, 'company_name cannot be nil'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
@company_name = company_name
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Custom attribute writer method with validation
|
|
151
|
+
# @param [Object] legal_contact_name Value to be assigned
|
|
152
|
+
def legal_contact_name=(legal_contact_name)
|
|
153
|
+
if legal_contact_name.nil?
|
|
154
|
+
fail ArgumentError, 'legal_contact_name cannot be nil'
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
@legal_contact_name = legal_contact_name
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Custom attribute writer method with validation
|
|
161
|
+
# @param [Object] legal_contact_email Value to be assigned
|
|
162
|
+
def legal_contact_email=(legal_contact_email)
|
|
163
|
+
if legal_contact_email.nil?
|
|
164
|
+
fail ArgumentError, 'legal_contact_email cannot be nil'
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
@legal_contact_email = legal_contact_email
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Checks equality by comparing each attribute.
|
|
171
|
+
# @param [Object] Object to be compared
|
|
172
|
+
def ==(o)
|
|
173
|
+
return true if self.equal?(o)
|
|
174
|
+
self.class == o.class &&
|
|
175
|
+
company_name == o.company_name &&
|
|
176
|
+
legal_contact_name == o.legal_contact_name &&
|
|
177
|
+
legal_contact_email == o.legal_contact_email &&
|
|
178
|
+
country == o.country &&
|
|
179
|
+
city == o.city
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# @see the `==` method
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def eql?(o)
|
|
185
|
+
self == o
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Calculates hash code according to all attributes.
|
|
189
|
+
# @return [Integer] Hash code
|
|
190
|
+
def hash
|
|
191
|
+
[company_name, legal_contact_name, legal_contact_email, country, city].hash
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Builds the object from hash
|
|
195
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
196
|
+
# @return [Object] Returns the model itself
|
|
197
|
+
def self.build_from_hash(attributes)
|
|
198
|
+
return nil unless attributes.is_a?(Hash)
|
|
199
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
200
|
+
transformed_hash = {}
|
|
201
|
+
openapi_types.each_pair do |key, type|
|
|
202
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
203
|
+
transformed_hash["#{key}"] = nil
|
|
204
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
205
|
+
# check to ensure the input is an array given that the attribute
|
|
206
|
+
# is documented as an array but the input is not
|
|
207
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
208
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
209
|
+
end
|
|
210
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
211
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
new(transformed_hash)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Returns the object in the form of hash
|
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
|
219
|
+
def to_hash
|
|
220
|
+
hash = {}
|
|
221
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
222
|
+
value = self.send(attr)
|
|
223
|
+
if value.nil?
|
|
224
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
225
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
hash[param] = _to_hash(value)
|
|
229
|
+
end
|
|
230
|
+
hash
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
end
|
|
@@ -0,0 +1,291 @@
|
|
|
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
|
+
# What happened on ONE channel item — one Airbnb connection, or one Booking.com property. A listing can carry several Airbnb connections (a re-list, or a move between host accounts) and each gets its own entry.
|
|
18
|
+
class ChannelMarketStateItem < ApiModelBase
|
|
19
|
+
attr_accessor :channel
|
|
20
|
+
|
|
21
|
+
# **What is now true of this item**, not what you asked for. `offline` — it is off the market. `online` — it is back on. `unchanged` — nothing was sent, or what was sent did not take; `code` and `message` say why. `unchanged` never means \"it was already like that\": it means we did not put it there, and it is still in whatever state it was in before the call.
|
|
22
|
+
attr_accessor :state
|
|
23
|
+
|
|
24
|
+
# True only when the channel confirmed the change.
|
|
25
|
+
attr_accessor :ok
|
|
26
|
+
|
|
27
|
+
# Airbnb connection row id — the `id` from `GET /v1/channels/airbnb/listings/{id}`. Present on Airbnb items.
|
|
28
|
+
attr_accessor :connection_id
|
|
29
|
+
|
|
30
|
+
# The Booking.com property acted on. Present on Booking.com items; null when the property could not be resolved.
|
|
31
|
+
attr_accessor :hotel_id
|
|
32
|
+
|
|
33
|
+
# Error code when `ok` is false — the SAME code the channel-specific endpoint returns for this failure, so one vocabulary covers both surfaces. Absent when `ok` is true. The channel codes come in pairs, and the pair is the retryable split — the most useful bit in the whole item: - `airbnb_rejected` / `booking_rejected` — the channel refused the request AS SENT. `message` carries its own reason. Correct it and send again; resending the same thing is refused again. - `airbnb_error` / `booking_error` — the channel did not complete the request (outage, timeout, server error). Nothing about the request needs to change: retry with backoff. Plus `ambiguous_booking_mapping` (name the property with `hotelId`) and `payment_required` (a billing refusal, which keeps its own code rather than being buried under a channel one).
|
|
34
|
+
attr_accessor :code
|
|
35
|
+
|
|
36
|
+
# The `code` this item used to carry, for callers still branching on the old string. A migration aid with a deprecation window — **`code` is canonical.** This fan-out reaches Airbnb through an internal hop that flattens a refusal into its own 500, so an unambiguous Airbnb 400 (\"Please specify a valid room type\") was reported as `airbnb_error` — whose published advice is to retry with backoff, forever, for something Airbnb will never accept. It now reads Airbnb's real status and answers `airbnb_rejected`, and the classification covers the whole 4xx range rather than only `400`. Items whose code changed carry `previousCode`. **Removed in v2.**
|
|
37
|
+
attr_accessor :previous_code
|
|
38
|
+
|
|
39
|
+
# The channel's own reason, verbatim. Absent when `ok` is true.
|
|
40
|
+
attr_accessor :message
|
|
41
|
+
|
|
42
|
+
# What to do about it, phrased for the direction you asked for — \"still live and taking bookings\" and \"still down\" call for different reactions. Absent when `ok` is true.
|
|
43
|
+
attr_accessor :fix
|
|
44
|
+
|
|
45
|
+
# Airbnb only, and only when going offline: the listing was READ BACK after the deactivation and confirmed down. Airbnb accepts a deactivation and leaves some listings live, so \"we sent the request\" is a weaker claim than this one and is never reported as success.
|
|
46
|
+
attr_accessor :verified
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'channel' => :'channel',
|
|
52
|
+
:'state' => :'state',
|
|
53
|
+
:'ok' => :'ok',
|
|
54
|
+
:'connection_id' => :'connectionId',
|
|
55
|
+
:'hotel_id' => :'hotelId',
|
|
56
|
+
:'code' => :'code',
|
|
57
|
+
:'previous_code' => :'previousCode',
|
|
58
|
+
:'message' => :'message',
|
|
59
|
+
:'fix' => :'fix',
|
|
60
|
+
:'verified' => :'verified'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns attribute mapping this model knows about
|
|
65
|
+
def self.acceptable_attribute_map
|
|
66
|
+
attribute_map
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns all the JSON keys this model knows about
|
|
70
|
+
def self.acceptable_attributes
|
|
71
|
+
acceptable_attribute_map.values
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Attribute type mapping.
|
|
75
|
+
def self.openapi_types
|
|
76
|
+
{
|
|
77
|
+
:'channel' => :'String',
|
|
78
|
+
:'state' => :'String',
|
|
79
|
+
:'ok' => :'Boolean',
|
|
80
|
+
:'connection_id' => :'String',
|
|
81
|
+
:'hotel_id' => :'String',
|
|
82
|
+
:'code' => :'String',
|
|
83
|
+
:'previous_code' => :'String',
|
|
84
|
+
:'message' => :'String',
|
|
85
|
+
:'fix' => :'String',
|
|
86
|
+
:'verified' => :'Boolean'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List of attributes with nullable: true
|
|
91
|
+
def self.openapi_nullable
|
|
92
|
+
Set.new([
|
|
93
|
+
:'connection_id',
|
|
94
|
+
:'hotel_id',
|
|
95
|
+
])
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Initializes the object
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
def initialize(attributes = {})
|
|
101
|
+
if (!attributes.is_a?(Hash))
|
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ChannelMarketStateItem` initialize method"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
106
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ChannelMarketStateItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
110
|
+
end
|
|
111
|
+
h[k.to_sym] = v
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'channel')
|
|
115
|
+
self.channel = attributes[:'channel']
|
|
116
|
+
else
|
|
117
|
+
self.channel = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'state')
|
|
121
|
+
self.state = attributes[:'state']
|
|
122
|
+
else
|
|
123
|
+
self.state = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'ok')
|
|
127
|
+
self.ok = attributes[:'ok']
|
|
128
|
+
else
|
|
129
|
+
self.ok = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'connection_id')
|
|
133
|
+
self.connection_id = attributes[:'connection_id']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'hotel_id')
|
|
137
|
+
self.hotel_id = attributes[:'hotel_id']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'code')
|
|
141
|
+
self.code = attributes[:'code']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'previous_code')
|
|
145
|
+
self.previous_code = attributes[:'previous_code']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'message')
|
|
149
|
+
self.message = attributes[:'message']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'fix')
|
|
153
|
+
self.fix = attributes[:'fix']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'verified')
|
|
157
|
+
self.verified = attributes[:'verified']
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
162
|
+
# @return Array for valid properties with the reasons
|
|
163
|
+
def list_invalid_properties
|
|
164
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
165
|
+
invalid_properties = Array.new
|
|
166
|
+
if @channel.nil?
|
|
167
|
+
invalid_properties.push('invalid value for "channel", channel cannot be nil.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if @state.nil?
|
|
171
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if @ok.nil?
|
|
175
|
+
invalid_properties.push('invalid value for "ok", ok cannot be nil.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
invalid_properties
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Check to see if the all the properties in the model are valid
|
|
182
|
+
# @return true if the model is valid
|
|
183
|
+
def valid?
|
|
184
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
185
|
+
return false if @channel.nil?
|
|
186
|
+
return false if @state.nil?
|
|
187
|
+
return false if @ok.nil?
|
|
188
|
+
true
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] channel Value to be assigned
|
|
193
|
+
def channel=(channel)
|
|
194
|
+
if channel.nil?
|
|
195
|
+
fail ArgumentError, 'channel cannot be nil'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@channel = channel
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] state Value to be assigned
|
|
203
|
+
def state=(state)
|
|
204
|
+
if state.nil?
|
|
205
|
+
fail ArgumentError, 'state cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@state = state
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] ok Value to be assigned
|
|
213
|
+
def ok=(ok)
|
|
214
|
+
if ok.nil?
|
|
215
|
+
fail ArgumentError, 'ok cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@ok = ok
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Checks equality by comparing each attribute.
|
|
222
|
+
# @param [Object] Object to be compared
|
|
223
|
+
def ==(o)
|
|
224
|
+
return true if self.equal?(o)
|
|
225
|
+
self.class == o.class &&
|
|
226
|
+
channel == o.channel &&
|
|
227
|
+
state == o.state &&
|
|
228
|
+
ok == o.ok &&
|
|
229
|
+
connection_id == o.connection_id &&
|
|
230
|
+
hotel_id == o.hotel_id &&
|
|
231
|
+
code == o.code &&
|
|
232
|
+
previous_code == o.previous_code &&
|
|
233
|
+
message == o.message &&
|
|
234
|
+
fix == o.fix &&
|
|
235
|
+
verified == o.verified
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# @see the `==` method
|
|
239
|
+
# @param [Object] Object to be compared
|
|
240
|
+
def eql?(o)
|
|
241
|
+
self == o
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Calculates hash code according to all attributes.
|
|
245
|
+
# @return [Integer] Hash code
|
|
246
|
+
def hash
|
|
247
|
+
[channel, state, ok, connection_id, hotel_id, code, previous_code, message, fix, verified].hash
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Builds the object from hash
|
|
251
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
252
|
+
# @return [Object] Returns the model itself
|
|
253
|
+
def self.build_from_hash(attributes)
|
|
254
|
+
return nil unless attributes.is_a?(Hash)
|
|
255
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
256
|
+
transformed_hash = {}
|
|
257
|
+
openapi_types.each_pair do |key, type|
|
|
258
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
259
|
+
transformed_hash["#{key}"] = nil
|
|
260
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
261
|
+
# check to ensure the input is an array given that the attribute
|
|
262
|
+
# is documented as an array but the input is not
|
|
263
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
264
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
265
|
+
end
|
|
266
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
267
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
new(transformed_hash)
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Returns the object in the form of hash
|
|
274
|
+
# @return [Hash] Returns the object in the form of hash
|
|
275
|
+
def to_hash
|
|
276
|
+
hash = {}
|
|
277
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
278
|
+
value = self.send(attr)
|
|
279
|
+
if value.nil?
|
|
280
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
281
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
hash[param] = _to_hash(value)
|
|
285
|
+
end
|
|
286
|
+
hash
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
end
|
|
@@ -48,6 +48,9 @@ module Repull
|
|
|
48
48
|
# Suggestion for typos and near-matches. Present when the server can guess the intent.
|
|
49
49
|
attr_accessor :did_you_mean
|
|
50
50
|
|
|
51
|
+
# The `code` THIS response used to carry, for callers whose branch still matches the old string. A migration aid with a deprecation window — **`code` is canonical, always match on that.** Present only where an endpoint's classification actually changed, never as a permanent synonym, and it disappears from a response as soon as the canonical code and the old one agree. The live case: the reviews, messaging, check-in-guide, alteration-answer and Airbnb-pull endpoints used to report EVERY Airbnb failure as `500 airbnb_error`, including refusals Airbnb will repeat forever. They now classify the same way every other Airbnb write does — an Airbnb 4xx is `422 airbnb_rejected` (fix the request), 5xx and timeouts stay `502 airbnb_error` (retry with backoff), and a dead grant is `403 connection_reauth_required`. Those responses carry `previous_code: \"airbnb_error\"`. **Removed in v2** — migrate your branches to `code` before then.
|
|
52
|
+
attr_accessor :previous_code
|
|
53
|
+
|
|
51
54
|
# Every inactive listing the request involved. Present on `code: \"listing_inactive\"` (HTTP 403) — activate these ids and retry.
|
|
52
55
|
attr_accessor :listing_ids
|
|
53
56
|
|
|
@@ -79,6 +82,7 @@ module Repull
|
|
|
79
82
|
:'valid_params' => :'validParams',
|
|
80
83
|
:'endpoint' => :'endpoint',
|
|
81
84
|
:'did_you_mean' => :'did_you_mean',
|
|
85
|
+
:'previous_code' => :'previous_code',
|
|
82
86
|
:'listing_ids' => :'listing_ids',
|
|
83
87
|
:'listing_id' => :'listing_id',
|
|
84
88
|
:'airbnb_listing_id' => :'airbnb_listing_id',
|
|
@@ -112,6 +116,7 @@ module Repull
|
|
|
112
116
|
:'valid_params' => :'Array<String>',
|
|
113
117
|
:'endpoint' => :'String',
|
|
114
118
|
:'did_you_mean' => :'String',
|
|
119
|
+
:'previous_code' => :'String',
|
|
115
120
|
:'listing_ids' => :'Array<String>',
|
|
116
121
|
:'listing_id' => :'String',
|
|
117
122
|
:'airbnb_listing_id' => :'String',
|
|
@@ -202,6 +207,10 @@ module Repull
|
|
|
202
207
|
self.did_you_mean = attributes[:'did_you_mean']
|
|
203
208
|
end
|
|
204
209
|
|
|
210
|
+
if attributes.key?(:'previous_code')
|
|
211
|
+
self.previous_code = attributes[:'previous_code']
|
|
212
|
+
end
|
|
213
|
+
|
|
205
214
|
if attributes.key?(:'listing_ids')
|
|
206
215
|
if (value = attributes[:'listing_ids']).is_a?(Array)
|
|
207
216
|
self.listing_ids = value
|
|
@@ -335,6 +344,7 @@ module Repull
|
|
|
335
344
|
valid_params == o.valid_params &&
|
|
336
345
|
endpoint == o.endpoint &&
|
|
337
346
|
did_you_mean == o.did_you_mean &&
|
|
347
|
+
previous_code == o.previous_code &&
|
|
338
348
|
listing_ids == o.listing_ids &&
|
|
339
349
|
listing_id == o.listing_id &&
|
|
340
350
|
airbnb_listing_id == o.airbnb_listing_id &&
|
|
@@ -352,7 +362,7 @@ module Repull
|
|
|
352
362
|
# Calculates hash code according to all attributes.
|
|
353
363
|
# @return [Integer] Hash code
|
|
354
364
|
def hash
|
|
355
|
-
[code, message, fix, docs_url, request_id, field, value_received, valid_values, valid_params, endpoint, did_you_mean, listing_ids, listing_id, airbnb_listing_id, sync_category, retry_after, support].hash
|
|
365
|
+
[code, message, fix, docs_url, request_id, field, value_received, valid_values, valid_params, endpoint, did_you_mean, previous_code, listing_ids, listing_id, airbnb_listing_id, sync_category, retry_after, support].hash
|
|
356
366
|
end
|
|
357
367
|
|
|
358
368
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
# Payload for `inquiry.updated`. The inquiry's status, dates, guest count or the reservation it became changed. `previousAttributes` holds only what moved, with prior values. Fires whether the host acted through the API,
|
|
17
|
+
# Payload for `inquiry.updated`. The inquiry's status, dates, guest count or the reservation it became changed. `previousAttributes` holds only what moved, with prior values. Fires whether the host acted through the API, a connected app or the Airbnb app. An inquiry whose dates simply pass is `expired` in `GET /v1/inquiries` but fires no event unless the channel reports it.
|
|
18
18
|
class InquiryUpdatedPayload < ApiModelBase
|
|
19
19
|
attr_accessor :object
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ module Repull
|
|
|
25
25
|
|
|
26
26
|
attr_accessor :channel
|
|
27
27
|
|
|
28
|
-
# `open` — nobody has answered and the stay is still ahead; `pre_approved`; `special_offer_sent` (from the API,
|
|
28
|
+
# `open` — nobody has answered and the stay is still ahead; `pre_approved`; `special_offer_sent` (from the API, a connected app, or Airbnb’s own app); `booked` — the guest booked (`reservationId`); `expired` — the stay has started or Airbnb expired it; `declined`; `not_possible` — Airbnb says the dates cannot be booked.
|
|
29
29
|
attr_accessor :status
|
|
30
30
|
|
|
31
31
|
attr_accessor :check_in
|