repull 0.2.24 → 0.2.26
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 +619 -2
- data/lib/repull/api/connections_api.rb +312 -0
- data/lib/repull/api/conversations_api.rb +154 -18
- data/lib/repull/api/health_api.rb +5 -5
- data/lib/repull/api/listings_api.rb +67 -4
- data/lib/repull/api/properties_api.rb +3 -0
- data/lib/repull/api/reservations_api.rb +3 -0
- data/lib/repull/api/reviews_api.rb +5 -2
- data/lib/repull/api/vrbo_api.rb +4 -4
- 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_session_completed_event.rb +281 -0
- data/lib/repull/models/connect_session_completed_payload.rb +210 -0
- 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.rb +12 -1
- data/lib/repull/models/conversation_capabilities.rb +260 -0
- data/lib/repull/models/conversation_detail.rb +25 -5
- data/lib/repull/models/create_connect_session_request.rb +24 -2
- data/lib/repull/models/create_connection_request.rb +8 -8
- 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/property.rb +14 -2
- data/lib/repull/models/record_account.rb +170 -0
- data/lib/repull/models/reply_to_review_request.rb +33 -4
- data/lib/repull/models/reservation.rb +12 -1
- data/lib/repull/models/review.rb +12 -1
- 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/webhook_event.rb +2 -0
- data/lib/repull/models/webhook_event_type.rb +2 -1
- 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 +47 -0
- data/openapi/v1.json +2810 -74
- data/scripts/regen.sh +1 -1
- metadata +49 -2
|
@@ -27,6 +27,37 @@ module Repull
|
|
|
27
27
|
# True while the account is active and its authorization is usable.
|
|
28
28
|
attr_accessor :connected
|
|
29
29
|
|
|
30
|
+
# Vrbo only: the account email.
|
|
31
|
+
attr_accessor :email
|
|
32
|
+
|
|
33
|
+
# Vrbo only.
|
|
34
|
+
attr_accessor :access_type
|
|
35
|
+
|
|
36
|
+
# Vrbo only: where the account import stands.
|
|
37
|
+
attr_accessor :import
|
|
38
|
+
|
|
39
|
+
class EnumAttributeValidator
|
|
40
|
+
attr_reader :datatype
|
|
41
|
+
attr_reader :allowable_values
|
|
42
|
+
|
|
43
|
+
def initialize(datatype, allowable_values)
|
|
44
|
+
@allowable_values = allowable_values.map do |value|
|
|
45
|
+
case datatype.to_s
|
|
46
|
+
when /Integer/i
|
|
47
|
+
value.to_i
|
|
48
|
+
when /Float/i
|
|
49
|
+
value.to_f
|
|
50
|
+
else
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def valid?(value)
|
|
57
|
+
!value || allowable_values.include?(value)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
30
61
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
62
|
def self.attribute_map
|
|
32
63
|
{
|
|
@@ -34,7 +65,10 @@ module Repull
|
|
|
34
65
|
:'name' => :'name',
|
|
35
66
|
:'picture_url' => :'pictureUrl',
|
|
36
67
|
:'status' => :'status',
|
|
37
|
-
:'connected' => :'connected'
|
|
68
|
+
:'connected' => :'connected',
|
|
69
|
+
:'email' => :'email',
|
|
70
|
+
:'access_type' => :'accessType',
|
|
71
|
+
:'import' => :'import'
|
|
38
72
|
}
|
|
39
73
|
end
|
|
40
74
|
|
|
@@ -55,7 +89,10 @@ module Repull
|
|
|
55
89
|
:'name' => :'String',
|
|
56
90
|
:'picture_url' => :'String',
|
|
57
91
|
:'status' => :'String',
|
|
58
|
-
:'connected' => :'Boolean'
|
|
92
|
+
:'connected' => :'Boolean',
|
|
93
|
+
:'email' => :'String',
|
|
94
|
+
:'access_type' => :'String',
|
|
95
|
+
:'import' => :'VrboImportStatus'
|
|
59
96
|
}
|
|
60
97
|
end
|
|
61
98
|
|
|
@@ -65,6 +102,9 @@ module Repull
|
|
|
65
102
|
:'name',
|
|
66
103
|
:'picture_url',
|
|
67
104
|
:'status',
|
|
105
|
+
:'email',
|
|
106
|
+
:'access_type',
|
|
107
|
+
:'import'
|
|
68
108
|
])
|
|
69
109
|
end
|
|
70
110
|
|
|
@@ -103,6 +143,18 @@ module Repull
|
|
|
103
143
|
if attributes.key?(:'connected')
|
|
104
144
|
self.connected = attributes[:'connected']
|
|
105
145
|
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'email')
|
|
148
|
+
self.email = attributes[:'email']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'access_type')
|
|
152
|
+
self.access_type = attributes[:'access_type']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'import')
|
|
156
|
+
self.import = attributes[:'import']
|
|
157
|
+
end
|
|
106
158
|
end
|
|
107
159
|
|
|
108
160
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -117,9 +169,21 @@ module Repull
|
|
|
117
169
|
# @return true if the model is valid
|
|
118
170
|
def valid?
|
|
119
171
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
172
|
+
access_type_validator = EnumAttributeValidator.new('String', ["messaging", "full_access"])
|
|
173
|
+
return false unless access_type_validator.valid?(@access_type)
|
|
120
174
|
true
|
|
121
175
|
end
|
|
122
176
|
|
|
177
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
178
|
+
# @param [Object] access_type Object to be assigned
|
|
179
|
+
def access_type=(access_type)
|
|
180
|
+
validator = EnumAttributeValidator.new('String', ["messaging", "full_access"])
|
|
181
|
+
unless validator.valid?(access_type)
|
|
182
|
+
fail ArgumentError, "invalid value for \"access_type\", must be one of #{validator.allowable_values}."
|
|
183
|
+
end
|
|
184
|
+
@access_type = access_type
|
|
185
|
+
end
|
|
186
|
+
|
|
123
187
|
# Checks equality by comparing each attribute.
|
|
124
188
|
# @param [Object] Object to be compared
|
|
125
189
|
def ==(o)
|
|
@@ -129,7 +193,10 @@ module Repull
|
|
|
129
193
|
name == o.name &&
|
|
130
194
|
picture_url == o.picture_url &&
|
|
131
195
|
status == o.status &&
|
|
132
|
-
connected == o.connected
|
|
196
|
+
connected == o.connected &&
|
|
197
|
+
email == o.email &&
|
|
198
|
+
access_type == o.access_type &&
|
|
199
|
+
import == o.import
|
|
133
200
|
end
|
|
134
201
|
|
|
135
202
|
# @see the `==` method
|
|
@@ -141,7 +208,7 @@ module Repull
|
|
|
141
208
|
# Calculates hash code according to all attributes.
|
|
142
209
|
# @return [Integer] Hash code
|
|
143
210
|
def hash
|
|
144
|
-
[external_account_id, name, picture_url, status, connected].hash
|
|
211
|
+
[external_account_id, name, picture_url, status, connected, email, access_type, import].hash
|
|
145
212
|
end
|
|
146
213
|
|
|
147
214
|
# Builds the object from hash
|
|
@@ -16,6 +16,9 @@ require 'time'
|
|
|
16
16
|
module Repull
|
|
17
17
|
# Channel-agnostic message thread between the host workspace and a guest. Returned by `GET /v1/conversations`. The `id` is the internal Repull thread id (integer) — pass it back as the `{id}` path param on detail / messages calls.
|
|
18
18
|
class Conversation < ApiModelBase
|
|
19
|
+
# The connected account this conversation belongs to. List endpoint.
|
|
20
|
+
attr_accessor :account
|
|
21
|
+
|
|
19
22
|
attr_accessor :id
|
|
20
23
|
|
|
21
24
|
attr_accessor :platform
|
|
@@ -49,6 +52,7 @@ module Repull
|
|
|
49
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
53
|
def self.attribute_map
|
|
51
54
|
{
|
|
55
|
+
:'account' => :'account',
|
|
52
56
|
:'id' => :'id',
|
|
53
57
|
:'platform' => :'platform',
|
|
54
58
|
:'external_thread_id' => :'externalThreadId',
|
|
@@ -78,6 +82,7 @@ module Repull
|
|
|
78
82
|
# Attribute type mapping.
|
|
79
83
|
def self.openapi_types
|
|
80
84
|
{
|
|
85
|
+
:'account' => :'RecordAccount',
|
|
81
86
|
:'id' => :'String',
|
|
82
87
|
:'platform' => :'String',
|
|
83
88
|
:'external_thread_id' => :'String',
|
|
@@ -97,6 +102,7 @@ module Repull
|
|
|
97
102
|
# List of attributes with nullable: true
|
|
98
103
|
def self.openapi_nullable
|
|
99
104
|
Set.new([
|
|
105
|
+
:'account',
|
|
100
106
|
:'platform',
|
|
101
107
|
:'external_thread_id',
|
|
102
108
|
:'guest_id',
|
|
@@ -124,6 +130,10 @@ module Repull
|
|
|
124
130
|
h[k.to_sym] = v
|
|
125
131
|
}
|
|
126
132
|
|
|
133
|
+
if attributes.key?(:'account')
|
|
134
|
+
self.account = attributes[:'account']
|
|
135
|
+
end
|
|
136
|
+
|
|
127
137
|
if attributes.key?(:'id')
|
|
128
138
|
self.id = attributes[:'id']
|
|
129
139
|
end
|
|
@@ -197,6 +207,7 @@ module Repull
|
|
|
197
207
|
def ==(o)
|
|
198
208
|
return true if self.equal?(o)
|
|
199
209
|
self.class == o.class &&
|
|
210
|
+
account == o.account &&
|
|
200
211
|
id == o.id &&
|
|
201
212
|
platform == o.platform &&
|
|
202
213
|
external_thread_id == o.external_thread_id &&
|
|
@@ -221,7 +232,7 @@ module Repull
|
|
|
221
232
|
# Calculates hash code according to all attributes.
|
|
222
233
|
# @return [Integer] Hash code
|
|
223
234
|
def hash
|
|
224
|
-
[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].hash
|
|
235
|
+
[account, 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].hash
|
|
225
236
|
end
|
|
226
237
|
|
|
227
238
|
# Builds the object from hash
|
|
@@ -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
|
|
@@ -16,6 +16,9 @@ require 'time'
|
|
|
16
16
|
module Repull
|
|
17
17
|
# Returned by `GET /v1/conversations/{id}`. Extends the list-row `Conversation` shape with expanded `host` + `guest` blocks so SDK consumers can render thread headers without an extra round-trip.
|
|
18
18
|
class ConversationDetail < ApiModelBase
|
|
19
|
+
# The connected account this conversation belongs to. List endpoint.
|
|
20
|
+
attr_accessor :account
|
|
21
|
+
|
|
19
22
|
attr_accessor :id
|
|
20
23
|
|
|
21
24
|
attr_accessor :platform
|
|
@@ -50,9 +53,12 @@ module Repull
|
|
|
50
53
|
|
|
51
54
|
attr_accessor :guest
|
|
52
55
|
|
|
56
|
+
attr_accessor :capabilities
|
|
57
|
+
|
|
53
58
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
54
59
|
def self.attribute_map
|
|
55
60
|
{
|
|
61
|
+
:'account' => :'account',
|
|
56
62
|
:'id' => :'id',
|
|
57
63
|
:'platform' => :'platform',
|
|
58
64
|
:'external_thread_id' => :'externalThreadId',
|
|
@@ -67,7 +73,8 @@ module Repull
|
|
|
67
73
|
:'created_at' => :'createdAt',
|
|
68
74
|
:'updated_at' => :'updatedAt',
|
|
69
75
|
:'host' => :'host',
|
|
70
|
-
:'guest' => :'guest'
|
|
76
|
+
:'guest' => :'guest',
|
|
77
|
+
:'capabilities' => :'capabilities'
|
|
71
78
|
}
|
|
72
79
|
end
|
|
73
80
|
|
|
@@ -84,6 +91,7 @@ module Repull
|
|
|
84
91
|
# Attribute type mapping.
|
|
85
92
|
def self.openapi_types
|
|
86
93
|
{
|
|
94
|
+
:'account' => :'RecordAccount',
|
|
87
95
|
:'id' => :'String',
|
|
88
96
|
:'platform' => :'String',
|
|
89
97
|
:'external_thread_id' => :'String',
|
|
@@ -98,13 +106,15 @@ module Repull
|
|
|
98
106
|
:'created_at' => :'Time',
|
|
99
107
|
:'updated_at' => :'Time',
|
|
100
108
|
:'host' => :'ConversationHost',
|
|
101
|
-
:'guest' => :'ConversationGuest'
|
|
109
|
+
:'guest' => :'ConversationGuest',
|
|
110
|
+
:'capabilities' => :'ConversationCapabilities'
|
|
102
111
|
}
|
|
103
112
|
end
|
|
104
113
|
|
|
105
114
|
# List of attributes with nullable: true
|
|
106
115
|
def self.openapi_nullable
|
|
107
116
|
Set.new([
|
|
117
|
+
:'account',
|
|
108
118
|
:'platform',
|
|
109
119
|
:'external_thread_id',
|
|
110
120
|
:'guest_id',
|
|
@@ -114,7 +124,7 @@ module Repull
|
|
|
114
124
|
:'last_message_at',
|
|
115
125
|
:'last_message_preview',
|
|
116
126
|
:'host',
|
|
117
|
-
:'guest'
|
|
127
|
+
:'guest',
|
|
118
128
|
])
|
|
119
129
|
end
|
|
120
130
|
|
|
@@ -141,6 +151,10 @@ module Repull
|
|
|
141
151
|
h[k.to_sym] = v
|
|
142
152
|
}
|
|
143
153
|
|
|
154
|
+
if attributes.key?(:'account')
|
|
155
|
+
self.account = attributes[:'account']
|
|
156
|
+
end
|
|
157
|
+
|
|
144
158
|
if attributes.key?(:'id')
|
|
145
159
|
self.id = attributes[:'id']
|
|
146
160
|
end
|
|
@@ -200,6 +214,10 @@ module Repull
|
|
|
200
214
|
if attributes.key?(:'guest')
|
|
201
215
|
self.guest = attributes[:'guest']
|
|
202
216
|
end
|
|
217
|
+
|
|
218
|
+
if attributes.key?(:'capabilities')
|
|
219
|
+
self.capabilities = attributes[:'capabilities']
|
|
220
|
+
end
|
|
203
221
|
end
|
|
204
222
|
|
|
205
223
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -222,6 +240,7 @@ module Repull
|
|
|
222
240
|
def ==(o)
|
|
223
241
|
return true if self.equal?(o)
|
|
224
242
|
self.class == o.class &&
|
|
243
|
+
account == o.account &&
|
|
225
244
|
id == o.id &&
|
|
226
245
|
platform == o.platform &&
|
|
227
246
|
external_thread_id == o.external_thread_id &&
|
|
@@ -236,7 +255,8 @@ module Repull
|
|
|
236
255
|
created_at == o.created_at &&
|
|
237
256
|
updated_at == o.updated_at &&
|
|
238
257
|
host == o.host &&
|
|
239
|
-
guest == o.guest
|
|
258
|
+
guest == o.guest &&
|
|
259
|
+
capabilities == o.capabilities
|
|
240
260
|
end
|
|
241
261
|
|
|
242
262
|
# @see the `==` method
|
|
@@ -248,7 +268,7 @@ module Repull
|
|
|
248
268
|
# Calculates hash code according to all attributes.
|
|
249
269
|
# @return [Integer] Hash code
|
|
250
270
|
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
|
|
271
|
+
[account, 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
272
|
end
|
|
253
273
|
|
|
254
274
|
# Builds the object from hash
|
|
@@ -18,9 +18,12 @@ module Repull
|
|
|
18
18
|
# Where to send the user after they finish (or cancel). Status query params are appended.
|
|
19
19
|
attr_accessor :redirect_url
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Your own correlation token, e.g. your user id (at most 500 characters). Echoed in this response, on the redirect back (`&state=`), in the popup message, and in the `connect.session.completed` webhook.
|
|
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
|