repull 0.2.26 → 0.2.27
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 +38 -23
- data/lib/repull/api/booking_com_api.rb +9 -2
- data/lib/repull/api/connect_api.rb +4 -4
- data/lib/repull/api/listings_api.rb +2 -2
- data/lib/repull/api/properties_api.rb +2 -2
- data/lib/repull/api/reservations_api.rb +93 -6
- data/lib/repull/api/vrbo_api.rb +9 -2
- data/lib/repull/models/airbnb_listing.rb +13 -2
- data/lib/repull/models/airbnb_listing_details_write_request.rb +109 -5
- data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +1 -1
- data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +2 -2
- data/lib/repull/models/airbnb_pricing_write_request.rb +30 -2
- data/lib/repull/models/airbnb_pricing_write_request_fees_inner.rb +291 -0
- data/lib/repull/models/booking_property_listings_inner.rb +57 -1
- data/lib/repull/models/cancel_reservation200_response.rb +1 -1
- data/lib/repull/models/connect_status.rb +35 -4
- data/lib/repull/models/connect_status_capabilities.rb +148 -0
- data/lib/repull/models/connection.rb +28 -5
- data/lib/repull/models/connection_action.rb +188 -0
- data/lib/repull/models/create_connect_session_request.rb +39 -1
- data/lib/repull/models/create_connection_request.rb +39 -1
- data/lib/repull/models/error_error.rb +13 -1
- data/lib/repull/models/{cancel_reservation200_response_pms.rb → error_error_listings_inner.rb} +36 -30
- data/lib/repull/models/get_booking_extranet_login_status200_response.rb +2 -1
- data/lib/repull/models/list_listing_units200_response.rb +2 -1
- data/lib/repull/models/listing.rb +23 -2
- data/lib/repull/models/listing_capabilities.rb +148 -0
- data/lib/repull/models/property.rb +14 -3
- data/lib/repull/models/reservation_capabilities.rb +230 -0
- data/lib/repull/models/reservation_create_request.rb +172 -33
- data/lib/repull/models/reservation_create_response.rb +6 -6
- data/lib/repull/models/reservation_create_response_unit.rb +1 -1
- data/lib/repull/models/{reservation_create_response_pms.rb → reservation_pms_outcome.rb} +38 -8
- data/lib/repull/models/reservation_pms_outcome_quote.rb +168 -0
- data/lib/repull/models/{cancel_reservation200_response_pms_errors_inner.rb → reservation_pms_section_error.rb} +16 -16
- data/lib/repull/models/reservation_quote_request.rb +312 -0
- data/lib/repull/models/reservation_quote_response.rb +228 -0
- data/lib/repull/models/reservation_quote_response_breakdown.rb +175 -0
- data/lib/repull/models/reservation_update_response.rb +16 -6
- data/lib/repull/models/submit_smoobu_credentials_request.rb +2 -5
- data/lib/repull/models/submit_smoobu_credentials_request_credentials.rb +193 -0
- data/lib/repull/models/update_airbnb_checkin_guide200_response.rb +147 -0
- data/lib/repull/models/update_airbnb_checkin_guide200_response_data.rb +177 -0
- data/lib/repull/models/{airbnb_permits_write_request_permits_inner_answers_value.rb → update_airbnb_checkin_guide200_response_data_steps_inner.rb} +24 -43
- data/lib/repull/models/update_airbnb_checkin_guide_request.rb +186 -0
- data/lib/repull/models/update_airbnb_checkin_guide_request_steps_inner.rb +182 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +18 -4
- data/openapi/v1.json +2059 -335
- data/scripts/regen.sh +1 -1
- metadata +20 -6
|
@@ -24,9 +24,12 @@ module Repull
|
|
|
24
24
|
# Required when `type: \"model\"` — the pricing-availability model to switch the listing to.
|
|
25
25
|
attr_accessor :model_type
|
|
26
26
|
|
|
27
|
-
# Required for `type: \"standard\" | \"rate-plan\"
|
|
27
|
+
# Required for `type: \"standard\" | \"rate-plan\"` — the pricing-settings object to PUT. With `type: \"fees\"` it is the raw alternative to `fees`: `{\"standard_fees\": [...]}` **replaces every fee** on the listing (Airbnb does not merge), so send the complete list. Prefer `fees`.
|
|
28
28
|
attr_accessor :settings
|
|
29
29
|
|
|
30
|
+
# With `type: \"fees\"` — the fee changes to apply. **Merged by `fee_type`**: fees you do not mention are kept, the ones you send are set, and `amount: null` removes that fee. (Airbnb itself replaces the whole fee list on every write, so Repull reads the listing's current fees, applies your changes and writes the full set.) The response is the listing's fees as Airbnb holds them afterwards. **Units — the same as `GET …/pricing` returns:** a `flat` fee is the amount in the listing currency × 1,000,000 (`160000000` = 160.00); a `percent` fee is a whole percent of the rent (`10` = 10%). Example — add a 10% management fee and keep everything else: `{\"type\":\"fees\",\"fees\":[{\"fee_type\":\"PASS_THROUGH_MANAGEMENT_FEE\",\"amount\":10,\"amount_type\":\"percent\"}]}`. Remove the pet fee: `{\"type\":\"fees\",\"fees\":[{\"fee_type\":\"PASS_THROUGH_PET_FEE\",\"amount\":null}]}`.
|
|
31
|
+
attr_accessor :fees
|
|
32
|
+
|
|
30
33
|
# Required for `type: \"los\"` — length-of-stay records.
|
|
31
34
|
attr_accessor :records
|
|
32
35
|
|
|
@@ -43,6 +46,7 @@ module Repull
|
|
|
43
46
|
:'operations' => :'operations',
|
|
44
47
|
:'model_type' => :'modelType',
|
|
45
48
|
:'settings' => :'settings',
|
|
49
|
+
:'fees' => :'fees',
|
|
46
50
|
:'records' => :'records',
|
|
47
51
|
:'currency' => :'currency',
|
|
48
52
|
:'rule' => :'rule'
|
|
@@ -66,6 +70,7 @@ module Repull
|
|
|
66
70
|
:'operations' => :'Array<AirbnbCalendarOperation>',
|
|
67
71
|
:'model_type' => :'String',
|
|
68
72
|
:'settings' => :'Hash<String, Object>',
|
|
73
|
+
:'fees' => :'Array<AirbnbPricingWriteRequestFeesInner>',
|
|
69
74
|
:'records' => :'Array<AirbnbPricingWriteRequestRecordsInner>',
|
|
70
75
|
:'currency' => :'String',
|
|
71
76
|
:'rule' => :'Hash<String, Object>'
|
|
@@ -77,6 +82,7 @@ module Repull
|
|
|
77
82
|
Set.new([
|
|
78
83
|
:'model_type',
|
|
79
84
|
:'settings',
|
|
85
|
+
:'fees',
|
|
80
86
|
:'records',
|
|
81
87
|
:'currency',
|
|
82
88
|
:'rule'
|
|
@@ -121,6 +127,12 @@ module Repull
|
|
|
121
127
|
end
|
|
122
128
|
end
|
|
123
129
|
|
|
130
|
+
if attributes.key?(:'fees')
|
|
131
|
+
if (value = attributes[:'fees']).is_a?(Array)
|
|
132
|
+
self.fees = value
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
124
136
|
if attributes.key?(:'records')
|
|
125
137
|
if (value = attributes[:'records']).is_a?(Array)
|
|
126
138
|
self.records = value
|
|
@@ -151,6 +163,10 @@ module Repull
|
|
|
151
163
|
invalid_properties.push('invalid value for "operations", number of items must be greater than or equal to 1.')
|
|
152
164
|
end
|
|
153
165
|
|
|
166
|
+
if !@fees.nil? && @fees.length < 1
|
|
167
|
+
invalid_properties.push('invalid value for "fees", number of items must be greater than or equal to 1.')
|
|
168
|
+
end
|
|
169
|
+
|
|
154
170
|
if !@records.nil? && @records.length < 1
|
|
155
171
|
invalid_properties.push('invalid value for "records", number of items must be greater than or equal to 1.')
|
|
156
172
|
end
|
|
@@ -169,6 +185,7 @@ module Repull
|
|
|
169
185
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
170
186
|
return false if @type.nil?
|
|
171
187
|
return false if !@operations.nil? && @operations.length < 1
|
|
188
|
+
return false if !@fees.nil? && @fees.length < 1
|
|
172
189
|
return false if !@records.nil? && @records.length < 1
|
|
173
190
|
return false if !@currency.nil? && @currency !~ Regexp.new(/^[A-Z]{3}$/)
|
|
174
191
|
true
|
|
@@ -198,6 +215,16 @@ module Repull
|
|
|
198
215
|
@operations = operations
|
|
199
216
|
end
|
|
200
217
|
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] fees Value to be assigned
|
|
220
|
+
def fees=(fees)
|
|
221
|
+
if !fees.nil? && fees.length < 1
|
|
222
|
+
fail ArgumentError, 'invalid value for "fees", number of items must be greater than or equal to 1.'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@fees = fees
|
|
226
|
+
end
|
|
227
|
+
|
|
201
228
|
# Custom attribute writer method with validation
|
|
202
229
|
# @param [Object] records Value to be assigned
|
|
203
230
|
def records=(records)
|
|
@@ -228,6 +255,7 @@ module Repull
|
|
|
228
255
|
operations == o.operations &&
|
|
229
256
|
model_type == o.model_type &&
|
|
230
257
|
settings == o.settings &&
|
|
258
|
+
fees == o.fees &&
|
|
231
259
|
records == o.records &&
|
|
232
260
|
currency == o.currency &&
|
|
233
261
|
rule == o.rule
|
|
@@ -242,7 +270,7 @@ module Repull
|
|
|
242
270
|
# Calculates hash code according to all attributes.
|
|
243
271
|
# @return [Integer] Hash code
|
|
244
272
|
def hash
|
|
245
|
-
[type, operations, model_type, settings, records, currency, rule].hash
|
|
273
|
+
[type, operations, model_type, settings, fees, records, currency, rule].hash
|
|
246
274
|
end
|
|
247
275
|
|
|
248
276
|
# Builds the object from hash
|
|
@@ -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
|
+
|
|
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 AirbnbPricingWriteRequestFeesInner < ApiModelBase
|
|
18
|
+
# Airbnb fee type: `PASS_THROUGH_CLEANING_FEE`, `PASS_THROUGH_SHORT_TERM_CLEANING_FEE`, `PASS_THROUGH_PET_FEE`, `PASS_THROUGH_SECURITY_DEPOSIT`, `PASS_THROUGH_MANAGEMENT_FEE`, `PASS_THROUGH_RESORT_FEE`, `PASS_THROUGH_COMMUNITY_FEE`, `PASS_THROUGH_LINEN_FEE`.
|
|
19
|
+
attr_accessor :fee_type
|
|
20
|
+
|
|
21
|
+
# `null` removes the fee. Flat: currency × 1,000,000. Percent: whole percent.
|
|
22
|
+
attr_accessor :amount
|
|
23
|
+
|
|
24
|
+
# Defaults to the existing fee's, else `flat`. Percent is accepted for management and resort fees.
|
|
25
|
+
attr_accessor :amount_type
|
|
26
|
+
|
|
27
|
+
# Who it is charged per. Defaults to the existing fee's, else `PER_GROUP`.
|
|
28
|
+
attr_accessor :charge_type
|
|
29
|
+
|
|
30
|
+
# Once per booking or per night. Defaults to the existing fee's, else `PER_BOOKING`.
|
|
31
|
+
attr_accessor :charge_period
|
|
32
|
+
|
|
33
|
+
# Collected offline by the host rather than through Airbnb. Default `false`.
|
|
34
|
+
attr_accessor :offline
|
|
35
|
+
|
|
36
|
+
class EnumAttributeValidator
|
|
37
|
+
attr_reader :datatype
|
|
38
|
+
attr_reader :allowable_values
|
|
39
|
+
|
|
40
|
+
def initialize(datatype, allowable_values)
|
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
|
42
|
+
case datatype.to_s
|
|
43
|
+
when /Integer/i
|
|
44
|
+
value.to_i
|
|
45
|
+
when /Float/i
|
|
46
|
+
value.to_f
|
|
47
|
+
else
|
|
48
|
+
value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def valid?(value)
|
|
54
|
+
!value || allowable_values.include?(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
59
|
+
def self.attribute_map
|
|
60
|
+
{
|
|
61
|
+
:'fee_type' => :'fee_type',
|
|
62
|
+
:'amount' => :'amount',
|
|
63
|
+
:'amount_type' => :'amount_type',
|
|
64
|
+
:'charge_type' => :'charge_type',
|
|
65
|
+
:'charge_period' => :'charge_period',
|
|
66
|
+
:'offline' => :'offline'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns attribute mapping this model knows about
|
|
71
|
+
def self.acceptable_attribute_map
|
|
72
|
+
attribute_map
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
|
76
|
+
def self.acceptable_attributes
|
|
77
|
+
acceptable_attribute_map.values
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Attribute type mapping.
|
|
81
|
+
def self.openapi_types
|
|
82
|
+
{
|
|
83
|
+
:'fee_type' => :'String',
|
|
84
|
+
:'amount' => :'Float',
|
|
85
|
+
:'amount_type' => :'String',
|
|
86
|
+
:'charge_type' => :'String',
|
|
87
|
+
:'charge_period' => :'String',
|
|
88
|
+
:'offline' => :'Boolean'
|
|
89
|
+
}
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# List of attributes with nullable: true
|
|
93
|
+
def self.openapi_nullable
|
|
94
|
+
Set.new([
|
|
95
|
+
:'amount',
|
|
96
|
+
])
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Initializes the object
|
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
101
|
+
def initialize(attributes = {})
|
|
102
|
+
if (!attributes.is_a?(Hash))
|
|
103
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbPricingWriteRequestFeesInner` initialize method"
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
107
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
108
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
109
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
110
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbPricingWriteRequestFeesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
111
|
+
end
|
|
112
|
+
h[k.to_sym] = v
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'fee_type')
|
|
116
|
+
self.fee_type = attributes[:'fee_type']
|
|
117
|
+
else
|
|
118
|
+
self.fee_type = nil
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'amount')
|
|
122
|
+
self.amount = attributes[:'amount']
|
|
123
|
+
else
|
|
124
|
+
self.amount = nil
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'amount_type')
|
|
128
|
+
self.amount_type = attributes[:'amount_type']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'charge_type')
|
|
132
|
+
self.charge_type = attributes[:'charge_type']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'charge_period')
|
|
136
|
+
self.charge_period = attributes[:'charge_period']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'offline')
|
|
140
|
+
self.offline = attributes[:'offline']
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
145
|
+
# @return Array for valid properties with the reasons
|
|
146
|
+
def list_invalid_properties
|
|
147
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
148
|
+
invalid_properties = Array.new
|
|
149
|
+
if @fee_type.nil?
|
|
150
|
+
invalid_properties.push('invalid value for "fee_type", fee_type cannot be nil.')
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if @amount < 0
|
|
154
|
+
invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
invalid_properties
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Check to see if the all the properties in the model are valid
|
|
161
|
+
# @return true if the model is valid
|
|
162
|
+
def valid?
|
|
163
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
164
|
+
return false if @fee_type.nil?
|
|
165
|
+
return false if @amount < 0
|
|
166
|
+
amount_type_validator = EnumAttributeValidator.new('String', ["flat", "percent"])
|
|
167
|
+
return false unless amount_type_validator.valid?(@amount_type)
|
|
168
|
+
charge_type_validator = EnumAttributeValidator.new('String', ["PER_GROUP", "PER_PERSON", "PER_PET"])
|
|
169
|
+
return false unless charge_type_validator.valid?(@charge_type)
|
|
170
|
+
charge_period_validator = EnumAttributeValidator.new('String', ["PER_BOOKING", "PER_NIGHT"])
|
|
171
|
+
return false unless charge_period_validator.valid?(@charge_period)
|
|
172
|
+
true
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Custom attribute writer method with validation
|
|
176
|
+
# @param [Object] fee_type Value to be assigned
|
|
177
|
+
def fee_type=(fee_type)
|
|
178
|
+
if fee_type.nil?
|
|
179
|
+
fail ArgumentError, 'fee_type cannot be nil'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
@fee_type = fee_type
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] amount Value to be assigned
|
|
187
|
+
def amount=(amount)
|
|
188
|
+
if !amount.nil? && amount < 0
|
|
189
|
+
fail ArgumentError, 'invalid value for "amount", must be greater than or equal to 0.'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
@amount = amount
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
196
|
+
# @param [Object] amount_type Object to be assigned
|
|
197
|
+
def amount_type=(amount_type)
|
|
198
|
+
validator = EnumAttributeValidator.new('String', ["flat", "percent"])
|
|
199
|
+
unless validator.valid?(amount_type)
|
|
200
|
+
fail ArgumentError, "invalid value for \"amount_type\", must be one of #{validator.allowable_values}."
|
|
201
|
+
end
|
|
202
|
+
@amount_type = amount_type
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
206
|
+
# @param [Object] charge_type Object to be assigned
|
|
207
|
+
def charge_type=(charge_type)
|
|
208
|
+
validator = EnumAttributeValidator.new('String', ["PER_GROUP", "PER_PERSON", "PER_PET"])
|
|
209
|
+
unless validator.valid?(charge_type)
|
|
210
|
+
fail ArgumentError, "invalid value for \"charge_type\", must be one of #{validator.allowable_values}."
|
|
211
|
+
end
|
|
212
|
+
@charge_type = charge_type
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
216
|
+
# @param [Object] charge_period Object to be assigned
|
|
217
|
+
def charge_period=(charge_period)
|
|
218
|
+
validator = EnumAttributeValidator.new('String', ["PER_BOOKING", "PER_NIGHT"])
|
|
219
|
+
unless validator.valid?(charge_period)
|
|
220
|
+
fail ArgumentError, "invalid value for \"charge_period\", must be one of #{validator.allowable_values}."
|
|
221
|
+
end
|
|
222
|
+
@charge_period = charge_period
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Checks equality by comparing each attribute.
|
|
226
|
+
# @param [Object] Object to be compared
|
|
227
|
+
def ==(o)
|
|
228
|
+
return true if self.equal?(o)
|
|
229
|
+
self.class == o.class &&
|
|
230
|
+
fee_type == o.fee_type &&
|
|
231
|
+
amount == o.amount &&
|
|
232
|
+
amount_type == o.amount_type &&
|
|
233
|
+
charge_type == o.charge_type &&
|
|
234
|
+
charge_period == o.charge_period &&
|
|
235
|
+
offline == o.offline
|
|
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
|
+
[fee_type, amount, amount_type, charge_type, charge_period, offline].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
|
|
@@ -18,8 +18,18 @@ module Repull
|
|
|
18
18
|
# Repull listing id — what `/v1/channels/booking/properties/{id}` and `/v1/channels/booking/listings/{id}/pricing` take.
|
|
19
19
|
attr_accessor :listing_id
|
|
20
20
|
|
|
21
|
+
# The host's internal nickname for the listing.
|
|
21
22
|
attr_accessor :name
|
|
22
23
|
|
|
24
|
+
# The title guests see on the channel; show this to end users.
|
|
25
|
+
attr_accessor :public_name
|
|
26
|
+
|
|
27
|
+
# Inactive listings appear only with `?status=inactive|all`, with identity fields only.
|
|
28
|
+
attr_accessor :status
|
|
29
|
+
|
|
30
|
+
# On inactive listings only: why it is inactive.
|
|
31
|
+
attr_accessor :inactive_reason
|
|
32
|
+
|
|
23
33
|
attr_accessor :city
|
|
24
34
|
|
|
25
35
|
# Repull-side room row id, as used by `POST /v1/connect/booking/map-rooms`.
|
|
@@ -60,6 +70,9 @@ module Repull
|
|
|
60
70
|
{
|
|
61
71
|
:'listing_id' => :'listingId',
|
|
62
72
|
:'name' => :'name',
|
|
73
|
+
:'public_name' => :'publicName',
|
|
74
|
+
:'status' => :'status',
|
|
75
|
+
:'inactive_reason' => :'inactiveReason',
|
|
63
76
|
:'city' => :'city',
|
|
64
77
|
:'room_id' => :'roomId',
|
|
65
78
|
:'room_booking_id' => :'roomBookingId',
|
|
@@ -83,6 +96,9 @@ module Repull
|
|
|
83
96
|
{
|
|
84
97
|
:'listing_id' => :'String',
|
|
85
98
|
:'name' => :'String',
|
|
99
|
+
:'public_name' => :'String',
|
|
100
|
+
:'status' => :'String',
|
|
101
|
+
:'inactive_reason' => :'String',
|
|
86
102
|
:'city' => :'String',
|
|
87
103
|
:'room_id' => :'String',
|
|
88
104
|
:'room_booking_id' => :'String',
|
|
@@ -95,6 +111,7 @@ module Repull
|
|
|
95
111
|
def self.openapi_nullable
|
|
96
112
|
Set.new([
|
|
97
113
|
:'name',
|
|
114
|
+
:'public_name',
|
|
98
115
|
:'city',
|
|
99
116
|
:'room_id',
|
|
100
117
|
:'room_booking_id',
|
|
@@ -126,6 +143,18 @@ module Repull
|
|
|
126
143
|
self.name = attributes[:'name']
|
|
127
144
|
end
|
|
128
145
|
|
|
146
|
+
if attributes.key?(:'public_name')
|
|
147
|
+
self.public_name = attributes[:'public_name']
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'status')
|
|
151
|
+
self.status = attributes[:'status']
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'inactive_reason')
|
|
155
|
+
self.inactive_reason = attributes[:'inactive_reason']
|
|
156
|
+
end
|
|
157
|
+
|
|
129
158
|
if attributes.key?(:'city')
|
|
130
159
|
self.city = attributes[:'city']
|
|
131
160
|
end
|
|
@@ -159,11 +188,35 @@ module Repull
|
|
|
159
188
|
# @return true if the model is valid
|
|
160
189
|
def valid?
|
|
161
190
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
191
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "inactive"])
|
|
192
|
+
return false unless status_validator.valid?(@status)
|
|
193
|
+
inactive_reason_validator = EnumAttributeValidator.new('String', ["plan_limit", "unlisted_on_airbnb", "deactivated"])
|
|
194
|
+
return false unless inactive_reason_validator.valid?(@inactive_reason)
|
|
162
195
|
mapped_via_validator = EnumAttributeValidator.new('String', ["room", "property"])
|
|
163
196
|
return false unless mapped_via_validator.valid?(@mapped_via)
|
|
164
197
|
true
|
|
165
198
|
end
|
|
166
199
|
|
|
200
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
201
|
+
# @param [Object] status Object to be assigned
|
|
202
|
+
def status=(status)
|
|
203
|
+
validator = EnumAttributeValidator.new('String', ["active", "inactive"])
|
|
204
|
+
unless validator.valid?(status)
|
|
205
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
206
|
+
end
|
|
207
|
+
@status = status
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
211
|
+
# @param [Object] inactive_reason Object to be assigned
|
|
212
|
+
def inactive_reason=(inactive_reason)
|
|
213
|
+
validator = EnumAttributeValidator.new('String', ["plan_limit", "unlisted_on_airbnb", "deactivated"])
|
|
214
|
+
unless validator.valid?(inactive_reason)
|
|
215
|
+
fail ArgumentError, "invalid value for \"inactive_reason\", must be one of #{validator.allowable_values}."
|
|
216
|
+
end
|
|
217
|
+
@inactive_reason = inactive_reason
|
|
218
|
+
end
|
|
219
|
+
|
|
167
220
|
# Custom attribute writer method checking allowed values (enum).
|
|
168
221
|
# @param [Object] mapped_via Object to be assigned
|
|
169
222
|
def mapped_via=(mapped_via)
|
|
@@ -181,6 +234,9 @@ module Repull
|
|
|
181
234
|
self.class == o.class &&
|
|
182
235
|
listing_id == o.listing_id &&
|
|
183
236
|
name == o.name &&
|
|
237
|
+
public_name == o.public_name &&
|
|
238
|
+
status == o.status &&
|
|
239
|
+
inactive_reason == o.inactive_reason &&
|
|
184
240
|
city == o.city &&
|
|
185
241
|
room_id == o.room_id &&
|
|
186
242
|
room_booking_id == o.room_booking_id &&
|
|
@@ -197,7 +253,7 @@ module Repull
|
|
|
197
253
|
# Calculates hash code according to all attributes.
|
|
198
254
|
# @return [Integer] Hash code
|
|
199
255
|
def hash
|
|
200
|
-
[listing_id, name, city, room_id, room_booking_id, room_name, mapped_via].hash
|
|
256
|
+
[listing_id, name, public_name, status, inactive_reason, city, room_id, room_booking_id, room_name, mapped_via].hash
|
|
201
257
|
end
|
|
202
258
|
|
|
203
259
|
# Builds the object from hash
|
|
@@ -39,9 +39,17 @@ module Repull
|
|
|
39
39
|
# PMS connections only: what the app may change in the PMS. Change it with `PATCH /v1/connect/{provider}/write-policy`.
|
|
40
40
|
attr_accessor :write_policy
|
|
41
41
|
|
|
42
|
+
attr_accessor :capabilities
|
|
43
|
+
|
|
42
44
|
# Vrbo only: the same freshness envelope the Airbnb read endpoints return, per account and in aggregate. Its reason is never_synced until a mapping is confirmed and importing while upcoming bookings come in.
|
|
43
45
|
attr_accessor :data_freshness
|
|
44
46
|
|
|
47
|
+
# Smoobu only: set to `{ required: true, reason: \"reauth_required\", message }` when the connection still uses a legacy single API key, which Smoobu stops accepting on October 31, 2026. `null` once it is on an API key + secret.
|
|
48
|
+
attr_accessor :action
|
|
49
|
+
|
|
50
|
+
# Smoobu only: durable link to the hosted Smoobu form where the host pastes a new API key + secret. Submitting it updates this same connection (`id` unchanged). Present only when `action.required` is true.
|
|
51
|
+
attr_accessor :fix_url
|
|
52
|
+
|
|
45
53
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
54
|
def self.attribute_map
|
|
47
55
|
{
|
|
@@ -54,7 +62,10 @@ module Repull
|
|
|
54
62
|
:'host' => :'host',
|
|
55
63
|
:'accounts' => :'accounts',
|
|
56
64
|
:'write_policy' => :'writePolicy',
|
|
57
|
-
:'
|
|
65
|
+
:'capabilities' => :'capabilities',
|
|
66
|
+
:'data_freshness' => :'dataFreshness',
|
|
67
|
+
:'action' => :'action',
|
|
68
|
+
:'fix_url' => :'fixUrl'
|
|
58
69
|
}
|
|
59
70
|
end
|
|
60
71
|
|
|
@@ -80,7 +91,10 @@ module Repull
|
|
|
80
91
|
:'host' => :'ConnectHost',
|
|
81
92
|
:'accounts' => :'Array<ConnectStatusAccountsInner>',
|
|
82
93
|
:'write_policy' => :'PmsWritePolicy',
|
|
83
|
-
:'
|
|
94
|
+
:'capabilities' => :'ConnectStatusCapabilities',
|
|
95
|
+
:'data_freshness' => :'Object',
|
|
96
|
+
:'action' => :'ConnectionAction',
|
|
97
|
+
:'fix_url' => :'String'
|
|
84
98
|
}
|
|
85
99
|
end
|
|
86
100
|
|
|
@@ -89,6 +103,8 @@ module Repull
|
|
|
89
103
|
Set.new([
|
|
90
104
|
:'external_account_id',
|
|
91
105
|
:'host',
|
|
106
|
+
:'action',
|
|
107
|
+
:'fix_url'
|
|
92
108
|
])
|
|
93
109
|
end
|
|
94
110
|
|
|
@@ -146,9 +162,21 @@ module Repull
|
|
|
146
162
|
self.write_policy = attributes[:'write_policy']
|
|
147
163
|
end
|
|
148
164
|
|
|
165
|
+
if attributes.key?(:'capabilities')
|
|
166
|
+
self.capabilities = attributes[:'capabilities']
|
|
167
|
+
end
|
|
168
|
+
|
|
149
169
|
if attributes.key?(:'data_freshness')
|
|
150
170
|
self.data_freshness = attributes[:'data_freshness']
|
|
151
171
|
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'action')
|
|
174
|
+
self.action = attributes[:'action']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'fix_url')
|
|
178
|
+
self.fix_url = attributes[:'fix_url']
|
|
179
|
+
end
|
|
152
180
|
end
|
|
153
181
|
|
|
154
182
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -180,7 +208,10 @@ module Repull
|
|
|
180
208
|
host == o.host &&
|
|
181
209
|
accounts == o.accounts &&
|
|
182
210
|
write_policy == o.write_policy &&
|
|
183
|
-
|
|
211
|
+
capabilities == o.capabilities &&
|
|
212
|
+
data_freshness == o.data_freshness &&
|
|
213
|
+
action == o.action &&
|
|
214
|
+
fix_url == o.fix_url
|
|
184
215
|
end
|
|
185
216
|
|
|
186
217
|
# @see the `==` method
|
|
@@ -192,7 +223,7 @@ module Repull
|
|
|
192
223
|
# Calculates hash code according to all attributes.
|
|
193
224
|
# @return [Integer] Hash code
|
|
194
225
|
def hash
|
|
195
|
-
[connected, provider, id, status, external_account_id, created_at, host, accounts, write_policy, data_freshness].hash
|
|
226
|
+
[connected, provider, id, status, external_account_id, created_at, host, accounts, write_policy, capabilities, data_freshness, action, fix_url].hash
|
|
196
227
|
end
|
|
197
228
|
|
|
198
229
|
# Builds the object from hash
|