repull 0.2.24 → 0.2.25
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/connect_api.rb +617 -0
- data/lib/repull/api/connections_api.rb +312 -0
- data/lib/repull/api/conversations_api.rb +151 -18
- data/lib/repull/api/health_api.rb +5 -5
- data/lib/repull/api/listings_api.rb +67 -4
- data/lib/repull/api/reviews_api.rb +2 -2
- data/lib/repull/models/apply_connection_mappings200_response.rb +167 -0
- data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +184 -0
- data/lib/repull/models/apply_connection_mappings_request.rb +175 -0
- data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +193 -0
- data/lib/repull/models/auto_map_connection_units200_response.rb +176 -0
- data/lib/repull/models/auto_map_connection_units_request.rb +156 -0
- data/lib/repull/models/channel_market_state_item.rb +15 -4
- data/lib/repull/models/connect_status.rb +25 -5
- data/lib/repull/models/connect_status_accounts_inner.rb +71 -4
- data/lib/repull/models/conversation_capabilities.rb +260 -0
- data/lib/repull/models/conversation_detail.rb +14 -5
- data/lib/repull/models/create_connect_session_request.rb +23 -1
- data/lib/repull/models/create_conversation_special_offer201_response.rb +127 -4
- data/lib/repull/models/create_conversation_special_offer201_response_fees_inner.rb +166 -0
- data/lib/repull/models/create_conversation_special_offer201_response_lines_inner.rb +157 -0
- data/lib/repull/models/create_conversation_special_offer_request.rb +91 -52
- data/lib/repull/models/create_conversation_special_offer_request_fees_inner.rb +199 -0
- data/lib/repull/models/get_booking_extranet_login_config200_response.rb +147 -0
- data/lib/repull/models/get_booking_extranet_login_status200_response.rb +192 -0
- data/lib/repull/models/get_channel_health200_response.rb +190 -0
- data/lib/repull/models/get_channel_health200_response_vrbo.rb +197 -0
- data/lib/repull/models/get_connect_write_policy200_response.rb +166 -0
- data/lib/repull/models/get_listing_calendar_sync200_response.rb +192 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +331 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_problems_inner.rb +157 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue.rb +212 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue_last_push.rb +268 -0
- data/lib/repull/models/invite_booking_extranet_user200_response.rb +174 -0
- data/lib/repull/models/invite_booking_extranet_user_request.rb +173 -0
- data/lib/repull/models/list_connection_units200_response.rb +242 -0
- data/lib/repull/models/list_connection_units200_response_listing_options_inner.rb +165 -0
- data/lib/repull/models/list_connection_units200_response_units_inner.rb +194 -0
- data/lib/repull/models/listing_publish_status_connection.rb +34 -1
- data/lib/repull/models/pms_write_policy.rb +191 -0
- data/lib/repull/models/pms_write_policy_calendar.rb +219 -0
- data/lib/repull/models/pms_write_policy_reservations.rb +219 -0
- data/lib/repull/models/preapprove_conversation201_response.rb +47 -6
- data/lib/repull/models/preapprove_conversation_request.rb +34 -5
- data/lib/repull/models/preview_conversation_special_offer_request.rb +231 -0
- data/lib/repull/models/preview_conversation_special_offer_request_fees_inner.rb +199 -0
- data/lib/repull/models/preview_conversation_special_offer_request_guests.rb +250 -0
- data/lib/repull/models/reply_to_review_request.rb +33 -4
- data/lib/repull/models/search_connect_session_listing_options200_response.rb +158 -0
- data/lib/repull/models/search_connect_session_listing_options200_response_data_inner.rb +166 -0
- data/lib/repull/models/search_connection_listing_options200_response.rb +159 -0
- data/lib/repull/models/send_message_request.rb +1 -1
- data/lib/repull/models/start_booking_extranet_login200_response.rb +174 -0
- data/lib/repull/models/start_booking_extranet_login_request.rb +225 -0
- data/lib/repull/models/submit_cloudbeds_credentials200_response.rb +10 -1
- data/lib/repull/models/submit_cloudbeds_credentials_request.rb +11 -1
- data/lib/repull/models/submit_mews_credentials200_response.rb +10 -1
- data/lib/repull/models/submit_mews_credentials_request.rb +11 -1
- data/lib/repull/models/update_connect_write_policy_request.rb +157 -0
- data/lib/repull/models/update_connect_write_policy_request_calendar.rb +165 -0
- data/lib/repull/models/update_connect_write_policy_request_reservations.rb +165 -0
- data/lib/repull/models/vrbo_import_status.rb +249 -0
- data/lib/repull/models/vrbo_login200_response.rb +235 -0
- data/lib/repull/models/vrbo_login_request.rb +271 -0
- data/lib/repull/models/withdraw_conversation_preapproval200_response.rb +226 -0
- data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +29 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +44 -0
- data/openapi/v1.json +4693 -2114
- data/scripts/regen.sh +1 -1
- metadata +46 -2
|
@@ -0,0 +1,260 @@
|
|
|
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
|
+
# What the inquiry actions can do on this conversation right now — one set of endpoints for every channel, so an app shows the right actions instead of learning from a `422`. All `false` / `null` when nothing applies (a booked or closed inquiry, Booking.com, direct, an Airbnb inquiry relayed by a PMS).
|
|
18
|
+
class ConversationCapabilities < ApiModelBase
|
|
19
|
+
# `POST /v1/conversations/{id}/pre-approval` would pre-approve the open inquiry (Airbnb connected directly, VRBO).
|
|
20
|
+
attr_accessor :can_pre_approve
|
|
21
|
+
|
|
22
|
+
# A pre-approval or offer is live and can be withdrawn — `DELETE /v1/conversations/{id}/pre-approval` (VRBO) or `DELETE …/special-offers/{offerId}` (Airbnb).
|
|
23
|
+
attr_accessor :can_withdraw
|
|
24
|
+
|
|
25
|
+
# `POST /v1/conversations/{id}/special-offers` would send an offer.
|
|
26
|
+
attr_accessor :can_send_offer
|
|
27
|
+
|
|
28
|
+
# How an offer is priced here: `total` — one `totalPrice` for the stay (Airbnb); `breakdown` — `rentalAmount`, `fees`, `damageDeposit`, and the channel computes the guest total (VRBO).
|
|
29
|
+
attr_accessor :offer_price
|
|
30
|
+
|
|
31
|
+
# `POST /v1/conversations/{id}/special-offers/preview` returns the channel’s recalculated offer (VRBO).
|
|
32
|
+
attr_accessor :can_preview_offer
|
|
33
|
+
|
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
35
|
+
def self.attribute_map
|
|
36
|
+
{
|
|
37
|
+
:'can_pre_approve' => :'canPreApprove',
|
|
38
|
+
:'can_withdraw' => :'canWithdraw',
|
|
39
|
+
:'can_send_offer' => :'canSendOffer',
|
|
40
|
+
:'offer_price' => :'offerPrice',
|
|
41
|
+
:'can_preview_offer' => :'canPreviewOffer'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns all the JSON keys this model knows about
|
|
51
|
+
def self.acceptable_attributes
|
|
52
|
+
acceptable_attribute_map.values
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute type mapping.
|
|
56
|
+
def self.openapi_types
|
|
57
|
+
{
|
|
58
|
+
:'can_pre_approve' => :'Boolean',
|
|
59
|
+
:'can_withdraw' => :'Boolean',
|
|
60
|
+
:'can_send_offer' => :'Boolean',
|
|
61
|
+
:'offer_price' => :'String',
|
|
62
|
+
:'can_preview_offer' => :'Boolean'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
:'offer_price',
|
|
70
|
+
])
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Initializes the object
|
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
75
|
+
def initialize(attributes = {})
|
|
76
|
+
if (!attributes.is_a?(Hash))
|
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConversationCapabilities` initialize method"
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
81
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
82
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
83
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConversationCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
85
|
+
end
|
|
86
|
+
h[k.to_sym] = v
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'can_pre_approve')
|
|
90
|
+
self.can_pre_approve = attributes[:'can_pre_approve']
|
|
91
|
+
else
|
|
92
|
+
self.can_pre_approve = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'can_withdraw')
|
|
96
|
+
self.can_withdraw = attributes[:'can_withdraw']
|
|
97
|
+
else
|
|
98
|
+
self.can_withdraw = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'can_send_offer')
|
|
102
|
+
self.can_send_offer = attributes[:'can_send_offer']
|
|
103
|
+
else
|
|
104
|
+
self.can_send_offer = nil
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'offer_price')
|
|
108
|
+
self.offer_price = attributes[:'offer_price']
|
|
109
|
+
else
|
|
110
|
+
self.offer_price = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'can_preview_offer')
|
|
114
|
+
self.can_preview_offer = attributes[:'can_preview_offer']
|
|
115
|
+
else
|
|
116
|
+
self.can_preview_offer = nil
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
121
|
+
# @return Array for valid properties with the reasons
|
|
122
|
+
def list_invalid_properties
|
|
123
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
124
|
+
invalid_properties = Array.new
|
|
125
|
+
if @can_pre_approve.nil?
|
|
126
|
+
invalid_properties.push('invalid value for "can_pre_approve", can_pre_approve cannot be nil.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if @can_withdraw.nil?
|
|
130
|
+
invalid_properties.push('invalid value for "can_withdraw", can_withdraw cannot be nil.')
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if @can_send_offer.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "can_send_offer", can_send_offer cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if @can_preview_offer.nil?
|
|
138
|
+
invalid_properties.push('invalid value for "can_preview_offer", can_preview_offer cannot be nil.')
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
invalid_properties
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Check to see if the all the properties in the model are valid
|
|
145
|
+
# @return true if the model is valid
|
|
146
|
+
def valid?
|
|
147
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
148
|
+
return false if @can_pre_approve.nil?
|
|
149
|
+
return false if @can_withdraw.nil?
|
|
150
|
+
return false if @can_send_offer.nil?
|
|
151
|
+
return false if @can_preview_offer.nil?
|
|
152
|
+
true
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] can_pre_approve Value to be assigned
|
|
157
|
+
def can_pre_approve=(can_pre_approve)
|
|
158
|
+
if can_pre_approve.nil?
|
|
159
|
+
fail ArgumentError, 'can_pre_approve cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
@can_pre_approve = can_pre_approve
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Custom attribute writer method with validation
|
|
166
|
+
# @param [Object] can_withdraw Value to be assigned
|
|
167
|
+
def can_withdraw=(can_withdraw)
|
|
168
|
+
if can_withdraw.nil?
|
|
169
|
+
fail ArgumentError, 'can_withdraw cannot be nil'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
@can_withdraw = can_withdraw
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Custom attribute writer method with validation
|
|
176
|
+
# @param [Object] can_send_offer Value to be assigned
|
|
177
|
+
def can_send_offer=(can_send_offer)
|
|
178
|
+
if can_send_offer.nil?
|
|
179
|
+
fail ArgumentError, 'can_send_offer cannot be nil'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
@can_send_offer = can_send_offer
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] can_preview_offer Value to be assigned
|
|
187
|
+
def can_preview_offer=(can_preview_offer)
|
|
188
|
+
if can_preview_offer.nil?
|
|
189
|
+
fail ArgumentError, 'can_preview_offer cannot be nil'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
@can_preview_offer = can_preview_offer
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Checks equality by comparing each attribute.
|
|
196
|
+
# @param [Object] Object to be compared
|
|
197
|
+
def ==(o)
|
|
198
|
+
return true if self.equal?(o)
|
|
199
|
+
self.class == o.class &&
|
|
200
|
+
can_pre_approve == o.can_pre_approve &&
|
|
201
|
+
can_withdraw == o.can_withdraw &&
|
|
202
|
+
can_send_offer == o.can_send_offer &&
|
|
203
|
+
offer_price == o.offer_price &&
|
|
204
|
+
can_preview_offer == o.can_preview_offer
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# @see the `==` method
|
|
208
|
+
# @param [Object] Object to be compared
|
|
209
|
+
def eql?(o)
|
|
210
|
+
self == o
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Calculates hash code according to all attributes.
|
|
214
|
+
# @return [Integer] Hash code
|
|
215
|
+
def hash
|
|
216
|
+
[can_pre_approve, can_withdraw, can_send_offer, offer_price, can_preview_offer].hash
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Builds the object from hash
|
|
220
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
221
|
+
# @return [Object] Returns the model itself
|
|
222
|
+
def self.build_from_hash(attributes)
|
|
223
|
+
return nil unless attributes.is_a?(Hash)
|
|
224
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
225
|
+
transformed_hash = {}
|
|
226
|
+
openapi_types.each_pair do |key, type|
|
|
227
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
228
|
+
transformed_hash["#{key}"] = nil
|
|
229
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
230
|
+
# check to ensure the input is an array given that the attribute
|
|
231
|
+
# is documented as an array but the input is not
|
|
232
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
233
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
234
|
+
end
|
|
235
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
236
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
new(transformed_hash)
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Returns the object in the form of hash
|
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
|
244
|
+
def to_hash
|
|
245
|
+
hash = {}
|
|
246
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
247
|
+
value = self.send(attr)
|
|
248
|
+
if value.nil?
|
|
249
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
250
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
hash[param] = _to_hash(value)
|
|
254
|
+
end
|
|
255
|
+
hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
end
|
|
@@ -50,6 +50,8 @@ module Repull
|
|
|
50
50
|
|
|
51
51
|
attr_accessor :guest
|
|
52
52
|
|
|
53
|
+
attr_accessor :capabilities
|
|
54
|
+
|
|
53
55
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
54
56
|
def self.attribute_map
|
|
55
57
|
{
|
|
@@ -67,7 +69,8 @@ module Repull
|
|
|
67
69
|
:'created_at' => :'createdAt',
|
|
68
70
|
:'updated_at' => :'updatedAt',
|
|
69
71
|
:'host' => :'host',
|
|
70
|
-
:'guest' => :'guest'
|
|
72
|
+
:'guest' => :'guest',
|
|
73
|
+
:'capabilities' => :'capabilities'
|
|
71
74
|
}
|
|
72
75
|
end
|
|
73
76
|
|
|
@@ -98,7 +101,8 @@ module Repull
|
|
|
98
101
|
:'created_at' => :'Time',
|
|
99
102
|
:'updated_at' => :'Time',
|
|
100
103
|
:'host' => :'ConversationHost',
|
|
101
|
-
:'guest' => :'ConversationGuest'
|
|
104
|
+
:'guest' => :'ConversationGuest',
|
|
105
|
+
:'capabilities' => :'ConversationCapabilities'
|
|
102
106
|
}
|
|
103
107
|
end
|
|
104
108
|
|
|
@@ -114,7 +118,7 @@ module Repull
|
|
|
114
118
|
:'last_message_at',
|
|
115
119
|
:'last_message_preview',
|
|
116
120
|
:'host',
|
|
117
|
-
:'guest'
|
|
121
|
+
:'guest',
|
|
118
122
|
])
|
|
119
123
|
end
|
|
120
124
|
|
|
@@ -200,6 +204,10 @@ module Repull
|
|
|
200
204
|
if attributes.key?(:'guest')
|
|
201
205
|
self.guest = attributes[:'guest']
|
|
202
206
|
end
|
|
207
|
+
|
|
208
|
+
if attributes.key?(:'capabilities')
|
|
209
|
+
self.capabilities = attributes[:'capabilities']
|
|
210
|
+
end
|
|
203
211
|
end
|
|
204
212
|
|
|
205
213
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -236,7 +244,8 @@ module Repull
|
|
|
236
244
|
created_at == o.created_at &&
|
|
237
245
|
updated_at == o.updated_at &&
|
|
238
246
|
host == o.host &&
|
|
239
|
-
guest == o.guest
|
|
247
|
+
guest == o.guest &&
|
|
248
|
+
capabilities == o.capabilities
|
|
240
249
|
end
|
|
241
250
|
|
|
242
251
|
# @see the `==` method
|
|
@@ -248,7 +257,7 @@ module Repull
|
|
|
248
257
|
# Calculates hash code according to all attributes.
|
|
249
258
|
# @return [Integer] Hash code
|
|
250
259
|
def hash
|
|
251
|
-
[id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at, host, guest].hash
|
|
260
|
+
[id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at, host, guest, capabilities].hash
|
|
252
261
|
end
|
|
253
262
|
|
|
254
263
|
# Builds the object from hash
|
|
@@ -21,6 +21,9 @@ module Repull
|
|
|
21
21
|
# Opaque pass-through correlation token. Echoed back in the response.
|
|
22
22
|
attr_accessor :state
|
|
23
23
|
|
|
24
|
+
# What the connection may do. Airbnb: the OAuth scope tier. Vrbo: `messaging` (or `read_only`) imports bookings and messages and never pushes the calendar; `full_access` also pushes prices and availability. Setting it locks the choice; omit it to let the host choose on the hosted page (default `full_access`).
|
|
25
|
+
attr_accessor :access_type
|
|
26
|
+
|
|
24
27
|
# Optional whitelist of provider IDs the picker should expose. Omit to show every channel in the registry.
|
|
25
28
|
attr_accessor :allowed_providers
|
|
26
29
|
|
|
@@ -64,6 +67,7 @@ module Repull
|
|
|
64
67
|
{
|
|
65
68
|
:'redirect_url' => :'redirectUrl',
|
|
66
69
|
:'state' => :'state',
|
|
70
|
+
:'access_type' => :'accessType',
|
|
67
71
|
:'allowed_providers' => :'allowedProviders',
|
|
68
72
|
:'locale' => :'locale',
|
|
69
73
|
:'purpose' => :'purpose',
|
|
@@ -88,6 +92,7 @@ module Repull
|
|
|
88
92
|
{
|
|
89
93
|
:'redirect_url' => :'String',
|
|
90
94
|
:'state' => :'String',
|
|
95
|
+
:'access_type' => :'String',
|
|
91
96
|
:'allowed_providers' => :'Array<String>',
|
|
92
97
|
:'locale' => :'String',
|
|
93
98
|
:'purpose' => :'String',
|
|
@@ -132,6 +137,10 @@ module Repull
|
|
|
132
137
|
self.state = attributes[:'state']
|
|
133
138
|
end
|
|
134
139
|
|
|
140
|
+
if attributes.key?(:'access_type')
|
|
141
|
+
self.access_type = attributes[:'access_type']
|
|
142
|
+
end
|
|
143
|
+
|
|
135
144
|
if attributes.key?(:'allowed_providers')
|
|
136
145
|
if (value = attributes[:'allowed_providers']).is_a?(Array)
|
|
137
146
|
self.allowed_providers = value
|
|
@@ -180,6 +189,8 @@ module Repull
|
|
|
180
189
|
def valid?
|
|
181
190
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
182
191
|
return false if @redirect_url.nil?
|
|
192
|
+
access_type_validator = EnumAttributeValidator.new('String', ["full_access", "messaging", "read_only"])
|
|
193
|
+
return false unless access_type_validator.valid?(@access_type)
|
|
183
194
|
purpose_validator = EnumAttributeValidator.new('String', ["connect", "migrate"])
|
|
184
195
|
return false unless purpose_validator.valid?(@purpose)
|
|
185
196
|
true
|
|
@@ -195,6 +206,16 @@ module Repull
|
|
|
195
206
|
@redirect_url = redirect_url
|
|
196
207
|
end
|
|
197
208
|
|
|
209
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
210
|
+
# @param [Object] access_type Object to be assigned
|
|
211
|
+
def access_type=(access_type)
|
|
212
|
+
validator = EnumAttributeValidator.new('String', ["full_access", "messaging", "read_only"])
|
|
213
|
+
unless validator.valid?(access_type)
|
|
214
|
+
fail ArgumentError, "invalid value for \"access_type\", must be one of #{validator.allowable_values}."
|
|
215
|
+
end
|
|
216
|
+
@access_type = access_type
|
|
217
|
+
end
|
|
218
|
+
|
|
198
219
|
# Custom attribute writer method checking allowed values (enum).
|
|
199
220
|
# @param [Object] purpose Object to be assigned
|
|
200
221
|
def purpose=(purpose)
|
|
@@ -212,6 +233,7 @@ module Repull
|
|
|
212
233
|
self.class == o.class &&
|
|
213
234
|
redirect_url == o.redirect_url &&
|
|
214
235
|
state == o.state &&
|
|
236
|
+
access_type == o.access_type &&
|
|
215
237
|
allowed_providers == o.allowed_providers &&
|
|
216
238
|
locale == o.locale &&
|
|
217
239
|
purpose == o.purpose &&
|
|
@@ -229,7 +251,7 @@ module Repull
|
|
|
229
251
|
# Calculates hash code according to all attributes.
|
|
230
252
|
# @return [Integer] Hash code
|
|
231
253
|
def hash
|
|
232
|
-
[redirect_url, state, allowed_providers, locale, purpose, workspace, copy, scope].hash
|
|
254
|
+
[redirect_url, state, access_type, allowed_providers, locale, purpose, workspace, copy, scope].hash
|
|
233
255
|
end
|
|
234
256
|
|
|
235
257
|
# Builds the object from hash
|
|
@@ -15,13 +15,16 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
17
|
class CreateConversationSpecialOffer201Response < ApiModelBase
|
|
18
|
-
#
|
|
18
|
+
# The offer id — use it to read or withdraw the offer. Airbnb’s special-offer id; on VRBO, where a conversation has one live offer, `current`.
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
21
|
# Repull conversation id the offer was sent on.
|
|
22
22
|
attr_accessor :conversation_id
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# The channel the offer is on.
|
|
25
|
+
attr_accessor :channel
|
|
26
|
+
|
|
27
|
+
# Airbnb: its status for the offer — `active` (the guest can book it), `accepted`, `declined`, `expired` or `voided` (withdrawn). VRBO: `sent` (just sent), `current` (the live offer) or `preview` (recalculated, not sent).
|
|
25
28
|
attr_accessor :status
|
|
26
29
|
|
|
27
30
|
# Repull listing id, when known.
|
|
@@ -38,19 +41,63 @@ module Repull
|
|
|
38
41
|
|
|
39
42
|
attr_accessor :guests
|
|
40
43
|
|
|
41
|
-
#
|
|
44
|
+
# What the guest pays for the stay. Airbnb: the total you set. VRBO: VRBO’s own total, including its taxes and service fee.
|
|
42
45
|
attr_accessor :total_price
|
|
43
46
|
|
|
47
|
+
# Currency of the amounts, when the channel states it (VRBO).
|
|
48
|
+
attr_accessor :currency
|
|
49
|
+
|
|
50
|
+
# VRBO: rent for the stay, excluding fees and taxes. Null on Airbnb (priced by one total).
|
|
51
|
+
attr_accessor :rental_amount
|
|
52
|
+
|
|
53
|
+
# VRBO: its automatic stay discount on the rent, when the offer carries one.
|
|
54
|
+
attr_accessor :discount
|
|
55
|
+
|
|
56
|
+
# VRBO: the offer’s fees by type. Empty on Airbnb.
|
|
57
|
+
attr_accessor :fees
|
|
58
|
+
|
|
59
|
+
# VRBO: refundable damage deposit; null for none.
|
|
60
|
+
attr_accessor :damage_deposit
|
|
61
|
+
|
|
62
|
+
# VRBO: its offer summary line by line, in VRBO’s words (nights, fees, taxes, total traveler payment, payout).
|
|
63
|
+
attr_accessor :lines
|
|
64
|
+
|
|
65
|
+
# The message sent to the guest with the offer (VRBO).
|
|
66
|
+
attr_accessor :message
|
|
67
|
+
|
|
44
68
|
attr_accessor :created_at
|
|
45
69
|
|
|
46
70
|
# When the guest can no longer book the offer (Airbnb gives them 24 hours).
|
|
47
71
|
attr_accessor :expires_at
|
|
48
72
|
|
|
73
|
+
class EnumAttributeValidator
|
|
74
|
+
attr_reader :datatype
|
|
75
|
+
attr_reader :allowable_values
|
|
76
|
+
|
|
77
|
+
def initialize(datatype, allowable_values)
|
|
78
|
+
@allowable_values = allowable_values.map do |value|
|
|
79
|
+
case datatype.to_s
|
|
80
|
+
when /Integer/i
|
|
81
|
+
value.to_i
|
|
82
|
+
when /Float/i
|
|
83
|
+
value.to_f
|
|
84
|
+
else
|
|
85
|
+
value
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def valid?(value)
|
|
91
|
+
!value || allowable_values.include?(value)
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
49
95
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
96
|
def self.attribute_map
|
|
51
97
|
{
|
|
52
98
|
:'id' => :'id',
|
|
53
99
|
:'conversation_id' => :'conversationId',
|
|
100
|
+
:'channel' => :'channel',
|
|
54
101
|
:'status' => :'status',
|
|
55
102
|
:'listing_id' => :'listingId',
|
|
56
103
|
:'airbnb_listing_id' => :'airbnbListingId',
|
|
@@ -59,6 +106,13 @@ module Repull
|
|
|
59
106
|
:'nights' => :'nights',
|
|
60
107
|
:'guests' => :'guests',
|
|
61
108
|
:'total_price' => :'totalPrice',
|
|
109
|
+
:'currency' => :'currency',
|
|
110
|
+
:'rental_amount' => :'rentalAmount',
|
|
111
|
+
:'discount' => :'discount',
|
|
112
|
+
:'fees' => :'fees',
|
|
113
|
+
:'damage_deposit' => :'damageDeposit',
|
|
114
|
+
:'lines' => :'lines',
|
|
115
|
+
:'message' => :'message',
|
|
62
116
|
:'created_at' => :'createdAt',
|
|
63
117
|
:'expires_at' => :'expiresAt'
|
|
64
118
|
}
|
|
@@ -79,6 +133,7 @@ module Repull
|
|
|
79
133
|
{
|
|
80
134
|
:'id' => :'String',
|
|
81
135
|
:'conversation_id' => :'String',
|
|
136
|
+
:'channel' => :'String',
|
|
82
137
|
:'status' => :'String',
|
|
83
138
|
:'listing_id' => :'String',
|
|
84
139
|
:'airbnb_listing_id' => :'String',
|
|
@@ -87,6 +142,13 @@ module Repull
|
|
|
87
142
|
:'nights' => :'Integer',
|
|
88
143
|
:'guests' => :'CreateConversationSpecialOffer201ResponseGuests',
|
|
89
144
|
:'total_price' => :'Float',
|
|
145
|
+
:'currency' => :'String',
|
|
146
|
+
:'rental_amount' => :'Float',
|
|
147
|
+
:'discount' => :'Float',
|
|
148
|
+
:'fees' => :'Array<CreateConversationSpecialOffer201ResponseFeesInner>',
|
|
149
|
+
:'damage_deposit' => :'Float',
|
|
150
|
+
:'lines' => :'Array<CreateConversationSpecialOffer201ResponseLinesInner>',
|
|
151
|
+
:'message' => :'String',
|
|
90
152
|
:'created_at' => :'Time',
|
|
91
153
|
:'expires_at' => :'Time'
|
|
92
154
|
}
|
|
@@ -104,6 +166,11 @@ module Repull
|
|
|
104
166
|
:'nights',
|
|
105
167
|
:'guests',
|
|
106
168
|
:'total_price',
|
|
169
|
+
:'currency',
|
|
170
|
+
:'rental_amount',
|
|
171
|
+
:'discount',
|
|
172
|
+
:'damage_deposit',
|
|
173
|
+
:'message',
|
|
107
174
|
:'created_at',
|
|
108
175
|
:'expires_at'
|
|
109
176
|
])
|
|
@@ -137,6 +204,10 @@ module Repull
|
|
|
137
204
|
self.conversation_id = nil
|
|
138
205
|
end
|
|
139
206
|
|
|
207
|
+
if attributes.key?(:'channel')
|
|
208
|
+
self.channel = attributes[:'channel']
|
|
209
|
+
end
|
|
210
|
+
|
|
140
211
|
if attributes.key?(:'status')
|
|
141
212
|
self.status = attributes[:'status']
|
|
142
213
|
else
|
|
@@ -179,6 +250,38 @@ module Repull
|
|
|
179
250
|
self.total_price = nil
|
|
180
251
|
end
|
|
181
252
|
|
|
253
|
+
if attributes.key?(:'currency')
|
|
254
|
+
self.currency = attributes[:'currency']
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if attributes.key?(:'rental_amount')
|
|
258
|
+
self.rental_amount = attributes[:'rental_amount']
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if attributes.key?(:'discount')
|
|
262
|
+
self.discount = attributes[:'discount']
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if attributes.key?(:'fees')
|
|
266
|
+
if (value = attributes[:'fees']).is_a?(Array)
|
|
267
|
+
self.fees = value
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
if attributes.key?(:'damage_deposit')
|
|
272
|
+
self.damage_deposit = attributes[:'damage_deposit']
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
if attributes.key?(:'lines')
|
|
276
|
+
if (value = attributes[:'lines']).is_a?(Array)
|
|
277
|
+
self.lines = value
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if attributes.key?(:'message')
|
|
282
|
+
self.message = attributes[:'message']
|
|
283
|
+
end
|
|
284
|
+
|
|
182
285
|
if attributes.key?(:'created_at')
|
|
183
286
|
self.created_at = attributes[:'created_at']
|
|
184
287
|
end
|
|
@@ -205,6 +308,8 @@ module Repull
|
|
|
205
308
|
def valid?
|
|
206
309
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
207
310
|
return false if @conversation_id.nil?
|
|
311
|
+
channel_validator = EnumAttributeValidator.new('String', ["airbnb", "vrbo"])
|
|
312
|
+
return false unless channel_validator.valid?(@channel)
|
|
208
313
|
true
|
|
209
314
|
end
|
|
210
315
|
|
|
@@ -218,6 +323,16 @@ module Repull
|
|
|
218
323
|
@conversation_id = conversation_id
|
|
219
324
|
end
|
|
220
325
|
|
|
326
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
327
|
+
# @param [Object] channel Object to be assigned
|
|
328
|
+
def channel=(channel)
|
|
329
|
+
validator = EnumAttributeValidator.new('String', ["airbnb", "vrbo"])
|
|
330
|
+
unless validator.valid?(channel)
|
|
331
|
+
fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
|
|
332
|
+
end
|
|
333
|
+
@channel = channel
|
|
334
|
+
end
|
|
335
|
+
|
|
221
336
|
# Checks equality by comparing each attribute.
|
|
222
337
|
# @param [Object] Object to be compared
|
|
223
338
|
def ==(o)
|
|
@@ -225,6 +340,7 @@ module Repull
|
|
|
225
340
|
self.class == o.class &&
|
|
226
341
|
id == o.id &&
|
|
227
342
|
conversation_id == o.conversation_id &&
|
|
343
|
+
channel == o.channel &&
|
|
228
344
|
status == o.status &&
|
|
229
345
|
listing_id == o.listing_id &&
|
|
230
346
|
airbnb_listing_id == o.airbnb_listing_id &&
|
|
@@ -233,6 +349,13 @@ module Repull
|
|
|
233
349
|
nights == o.nights &&
|
|
234
350
|
guests == o.guests &&
|
|
235
351
|
total_price == o.total_price &&
|
|
352
|
+
currency == o.currency &&
|
|
353
|
+
rental_amount == o.rental_amount &&
|
|
354
|
+
discount == o.discount &&
|
|
355
|
+
fees == o.fees &&
|
|
356
|
+
damage_deposit == o.damage_deposit &&
|
|
357
|
+
lines == o.lines &&
|
|
358
|
+
message == o.message &&
|
|
236
359
|
created_at == o.created_at &&
|
|
237
360
|
expires_at == o.expires_at
|
|
238
361
|
end
|
|
@@ -246,7 +369,7 @@ module Repull
|
|
|
246
369
|
# Calculates hash code according to all attributes.
|
|
247
370
|
# @return [Integer] Hash code
|
|
248
371
|
def hash
|
|
249
|
-
[id, conversation_id, status, listing_id, airbnb_listing_id, check_in, check_out, nights, guests, total_price, created_at, expires_at].hash
|
|
372
|
+
[id, conversation_id, channel, status, listing_id, airbnb_listing_id, check_in, check_out, nights, guests, total_price, currency, rental_amount, discount, fees, damage_deposit, lines, message, created_at, expires_at].hash
|
|
250
373
|
end
|
|
251
374
|
|
|
252
375
|
# Builds the object from hash
|