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,312 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Repull
|
|
16
|
+
class ConnectionsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Map, unmap or create listings for units
|
|
23
|
+
# One instruction per unit: `{unitId, listingId}` maps, `{unitId, listingId: null}` unmaps, `{unitId, create: true}` creates a listing. Answers per unit. Vrbo: nothing is imported when the account is signed in. Applying a mapping that maps at least one unit starts the import: upcoming bookings and the last 30 days of messages first, then the whole account history. Follow it on `GET /v1/connect/vrbo-login` (`accounts[].import`). Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
|
|
24
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
|
|
25
|
+
# @param apply_connection_mappings_request [ApplyConnectionMappingsRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [ApplyConnectionMappings200Response]
|
|
28
|
+
def apply_connection_mappings(id, apply_connection_mappings_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = apply_connection_mappings_with_http_info(id, apply_connection_mappings_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Map, unmap or create listings for units
|
|
34
|
+
# One instruction per unit: `{unitId, listingId}` maps, `{unitId, listingId: null}` unmaps, `{unitId, create: true}` creates a listing. Answers per unit. Vrbo: nothing is imported when the account is signed in. Applying a mapping that maps at least one unit starts the import: upcoming bookings and the last 30 days of messages first, then the whole account history. Follow it on `GET /v1/connect/vrbo-login` (`accounts[].import`). Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
|
|
35
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
|
|
36
|
+
# @param apply_connection_mappings_request [ApplyConnectionMappingsRequest]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(ApplyConnectionMappings200Response, Integer, Hash)>] ApplyConnectionMappings200Response data, response status code and response headers
|
|
39
|
+
def apply_connection_mappings_with_http_info(id, apply_connection_mappings_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.apply_connection_mappings ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.apply_connection_mappings"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'apply_connection_mappings_request' is set
|
|
48
|
+
if @api_client.config.client_side_validation && apply_connection_mappings_request.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'apply_connection_mappings_request' when calling ConnectionsApi.apply_connection_mappings"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/v1/connections/{id}/mappings'.sub('{id}', CGI.escape(id.to_s))
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(apply_connection_mappings_request)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'ApplyConnectionMappings200Response'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"ConnectionsApi.apply_connection_mappings",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#apply_connection_mappings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Auto-map units by exact name
|
|
97
|
+
# Proposes (or with `apply: true` applies) mappings where a unit's name exactly matches one listing. Never guesses on ambiguity. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
|
|
98
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @option opts [AutoMapConnectionUnitsRequest] :auto_map_connection_units_request
|
|
101
|
+
# @return [AutoMapConnectionUnits200Response]
|
|
102
|
+
def auto_map_connection_units(id, opts = {})
|
|
103
|
+
data, _status_code, _headers = auto_map_connection_units_with_http_info(id, opts)
|
|
104
|
+
data
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Auto-map units by exact name
|
|
108
|
+
# Proposes (or with `apply: true` applies) mappings where a unit's name exactly matches one listing. Never guesses on ambiguity. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
|
|
109
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
|
|
110
|
+
# @param [Hash] opts the optional parameters
|
|
111
|
+
# @option opts [AutoMapConnectionUnitsRequest] :auto_map_connection_units_request
|
|
112
|
+
# @return [Array<(AutoMapConnectionUnits200Response, Integer, Hash)>] AutoMapConnectionUnits200Response data, response status code and response headers
|
|
113
|
+
def auto_map_connection_units_with_http_info(id, opts = {})
|
|
114
|
+
if @api_client.config.debugging
|
|
115
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.auto_map_connection_units ...'
|
|
116
|
+
end
|
|
117
|
+
# verify the required parameter 'id' is set
|
|
118
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
119
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.auto_map_connection_units"
|
|
120
|
+
end
|
|
121
|
+
# resource path
|
|
122
|
+
local_var_path = '/v1/connections/{id}/mappings/automap'.sub('{id}', CGI.escape(id.to_s))
|
|
123
|
+
|
|
124
|
+
# query parameters
|
|
125
|
+
query_params = opts[:query_params] || {}
|
|
126
|
+
|
|
127
|
+
# header parameters
|
|
128
|
+
header_params = opts[:header_params] || {}
|
|
129
|
+
# HTTP header 'Accept' (if needed)
|
|
130
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
131
|
+
# HTTP header 'Content-Type'
|
|
132
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
133
|
+
if !content_type.nil?
|
|
134
|
+
header_params['Content-Type'] = content_type
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# form parameters
|
|
138
|
+
form_params = opts[:form_params] || {}
|
|
139
|
+
|
|
140
|
+
# http body (model)
|
|
141
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'auto_map_connection_units_request'])
|
|
142
|
+
|
|
143
|
+
# return_type
|
|
144
|
+
return_type = opts[:debug_return_type] || 'AutoMapConnectionUnits200Response'
|
|
145
|
+
|
|
146
|
+
# auth_names
|
|
147
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
148
|
+
|
|
149
|
+
new_options = opts.merge(
|
|
150
|
+
:operation => :"ConnectionsApi.auto_map_connection_units",
|
|
151
|
+
:header_params => header_params,
|
|
152
|
+
:query_params => query_params,
|
|
153
|
+
:form_params => form_params,
|
|
154
|
+
:body => post_body,
|
|
155
|
+
:auth_names => auth_names,
|
|
156
|
+
:return_type => return_type
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
160
|
+
if @api_client.config.debugging
|
|
161
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#auto_map_connection_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
162
|
+
end
|
|
163
|
+
return data, status_code, headers
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# List a connection's mappable units
|
|
167
|
+
# The units of a connected account with their current listing, a safe suggestion, and the workspace's listing options. `status: ready` with no units means the account has no properties. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping. `listing_options` carries only the listings the units already point at (mapped or suggested); `listing_options_total` says how many the workspace has. Search the rest with `GET /v1/connections/{id}/listing-options?q=`.
|
|
168
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
|
|
169
|
+
# @param [Hash] opts the optional parameters
|
|
170
|
+
# @option opts [String] :session_id The Connect session ID (capability token).
|
|
171
|
+
# @return [ListConnectionUnits200Response]
|
|
172
|
+
def list_connection_units(id, opts = {})
|
|
173
|
+
data, _status_code, _headers = list_connection_units_with_http_info(id, opts)
|
|
174
|
+
data
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# List a connection's mappable units
|
|
178
|
+
# The units of a connected account with their current listing, a safe suggestion, and the workspace's listing options. `status: ready` with no units means the account has no properties. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping. `listing_options` carries only the listings the units already point at (mapped or suggested); `listing_options_total` says how many the workspace has. Search the rest with `GET /v1/connections/{id}/listing-options?q=`.
|
|
179
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
|
|
180
|
+
# @param [Hash] opts the optional parameters
|
|
181
|
+
# @option opts [String] :session_id The Connect session ID (capability token).
|
|
182
|
+
# @return [Array<(ListConnectionUnits200Response, Integer, Hash)>] ListConnectionUnits200Response data, response status code and response headers
|
|
183
|
+
def list_connection_units_with_http_info(id, opts = {})
|
|
184
|
+
if @api_client.config.debugging
|
|
185
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.list_connection_units ...'
|
|
186
|
+
end
|
|
187
|
+
# verify the required parameter 'id' is set
|
|
188
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
189
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.list_connection_units"
|
|
190
|
+
end
|
|
191
|
+
# resource path
|
|
192
|
+
local_var_path = '/v1/connections/{id}/units'.sub('{id}', CGI.escape(id.to_s))
|
|
193
|
+
|
|
194
|
+
# query parameters
|
|
195
|
+
query_params = opts[:query_params] || {}
|
|
196
|
+
query_params[:'sessionId'] = opts[:'session_id'] if !opts[:'session_id'].nil?
|
|
197
|
+
|
|
198
|
+
# header parameters
|
|
199
|
+
header_params = opts[:header_params] || {}
|
|
200
|
+
# HTTP header 'Accept' (if needed)
|
|
201
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
202
|
+
|
|
203
|
+
# form parameters
|
|
204
|
+
form_params = opts[:form_params] || {}
|
|
205
|
+
|
|
206
|
+
# http body (model)
|
|
207
|
+
post_body = opts[:debug_body]
|
|
208
|
+
|
|
209
|
+
# return_type
|
|
210
|
+
return_type = opts[:debug_return_type] || 'ListConnectionUnits200Response'
|
|
211
|
+
|
|
212
|
+
# auth_names
|
|
213
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
214
|
+
|
|
215
|
+
new_options = opts.merge(
|
|
216
|
+
:operation => :"ConnectionsApi.list_connection_units",
|
|
217
|
+
:header_params => header_params,
|
|
218
|
+
:query_params => query_params,
|
|
219
|
+
:form_params => form_params,
|
|
220
|
+
:body => post_body,
|
|
221
|
+
:auth_names => auth_names,
|
|
222
|
+
:return_type => return_type
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
226
|
+
if @api_client.config.debugging
|
|
227
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#list_connection_units\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
228
|
+
end
|
|
229
|
+
return data, status_code, headers
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Search listings a unit can be mapped to
|
|
233
|
+
# Search the workspace's active listings by name, city or id, for a mapping picker. A workspace can hold tens of thousands of listings, so pickers search here as the user types rather than loading them all. Empty `q` returns the first `limit` listings by name. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
|
|
234
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`.
|
|
235
|
+
# @param [Hash] opts the optional parameters
|
|
236
|
+
# @option opts [String] :q Text to match (name, city or listing id).
|
|
237
|
+
# @option opts [Integer] :limit (default to 20)
|
|
238
|
+
# @option opts [String] :session_id
|
|
239
|
+
# @return [SearchConnectionListingOptions200Response]
|
|
240
|
+
def search_connection_listing_options(id, opts = {})
|
|
241
|
+
data, _status_code, _headers = search_connection_listing_options_with_http_info(id, opts)
|
|
242
|
+
data
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Search listings a unit can be mapped to
|
|
246
|
+
# Search the workspace's active listings by name, city or id, for a mapping picker. A workspace can hold tens of thousands of listings, so pickers search here as the user types rather than loading them all. Empty `q` returns the first `limit` listings by name. Auth: a Repull API key, or a Connect session token (`sessionId`) while the hosted flow is mapping.
|
|
247
|
+
# @param id [String] Connection handle `{channel}:{externalAccountId}`.
|
|
248
|
+
# @param [Hash] opts the optional parameters
|
|
249
|
+
# @option opts [String] :q Text to match (name, city or listing id).
|
|
250
|
+
# @option opts [Integer] :limit (default to 20)
|
|
251
|
+
# @option opts [String] :session_id
|
|
252
|
+
# @return [Array<(SearchConnectionListingOptions200Response, Integer, Hash)>] SearchConnectionListingOptions200Response data, response status code and response headers
|
|
253
|
+
def search_connection_listing_options_with_http_info(id, opts = {})
|
|
254
|
+
if @api_client.config.debugging
|
|
255
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.search_connection_listing_options ...'
|
|
256
|
+
end
|
|
257
|
+
# verify the required parameter 'id' is set
|
|
258
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
259
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.search_connection_listing_options"
|
|
260
|
+
end
|
|
261
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50
|
|
262
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConnectionsApi.search_connection_listing_options, must be smaller than or equal to 50.'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
266
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConnectionsApi.search_connection_listing_options, must be greater than or equal to 1.'
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# resource path
|
|
270
|
+
local_var_path = '/v1/connections/{id}/listing-options'.sub('{id}', CGI.escape(id.to_s))
|
|
271
|
+
|
|
272
|
+
# query parameters
|
|
273
|
+
query_params = opts[:query_params] || {}
|
|
274
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
|
275
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
276
|
+
query_params[:'sessionId'] = opts[:'session_id'] if !opts[:'session_id'].nil?
|
|
277
|
+
|
|
278
|
+
# header parameters
|
|
279
|
+
header_params = opts[:header_params] || {}
|
|
280
|
+
# HTTP header 'Accept' (if needed)
|
|
281
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
282
|
+
|
|
283
|
+
# form parameters
|
|
284
|
+
form_params = opts[:form_params] || {}
|
|
285
|
+
|
|
286
|
+
# http body (model)
|
|
287
|
+
post_body = opts[:debug_body]
|
|
288
|
+
|
|
289
|
+
# return_type
|
|
290
|
+
return_type = opts[:debug_return_type] || 'SearchConnectionListingOptions200Response'
|
|
291
|
+
|
|
292
|
+
# auth_names
|
|
293
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
294
|
+
|
|
295
|
+
new_options = opts.merge(
|
|
296
|
+
:operation => :"ConnectionsApi.search_connection_listing_options",
|
|
297
|
+
:header_params => header_params,
|
|
298
|
+
:query_params => query_params,
|
|
299
|
+
:form_params => form_params,
|
|
300
|
+
:body => post_body,
|
|
301
|
+
:auth_names => auth_names,
|
|
302
|
+
:return_type => return_type
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
306
|
+
if @api_client.config.debugging
|
|
307
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#search_connection_listing_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
308
|
+
end
|
|
309
|
+
return data, status_code, headers
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
end
|
|
@@ -19,8 +19,8 @@ module Repull
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
# Send a special offer
|
|
23
|
-
# Send the guest on this conversation
|
|
22
|
+
# Send a special offer (Airbnb, VRBO)
|
|
23
|
+
# Send the guest on this conversation a special offer: your own dates, guest count and price. One endpoint for every channel that has offers — **Airbnb** (connected directly) and **VRBO** (its “Edit quote”). Use it to answer an inquiry with different terms. To accept the guest’s own dates and price as they asked, pre-approve instead (`POST /v1/conversations/{id}/pre-approval`). **How the price is set depends on the channel** — `GET /v1/conversations/{id}` → `capabilities.offerPrice` says which: - `total` (Airbnb): send `totalPrice`, the whole stay in the listing’s Airbnb currency, with `checkIn`, `checkOut` and `guests`. - `breakdown` (VRBO): send the price’s parts — `rentalAmount` (rent, excluding fees), `fees` by VRBO fee type, `damageDeposit` — and VRBO computes the guest total, adding its taxes and service fee. Dates and party are optional (omitted → the inquiry’s own). Only what you send is changed. Preview the result first with `POST /v1/conversations/{id}/special-offers/preview`. Sending the other kind is `422 offer_price_total_required` / `offer_price_breakdown_required` naming the field; nothing is sent. A channel without offers (Booking.com, direct, an Airbnb inquiry relayed by a PMS) is `422 channel_not_supported`. `listingId` (Airbnb) is optional: omit it to offer the listing the guest asked about. It is a **Repull** listing id. `message` (VRBO) is sent to the guest with the offer. An offer the channel refuses is never a `201`: dates that are taken, a price below the channel’s minimum and the like are `422` with the channel’s own reason in `message`. Send `Idempotency-Key`: a repeat with the same key replays the first response instead of acting twice (a `409 idempotency_key_in_use` while the first is still running). A 5xx, a `429 airbnb_rate_limited` or a `403 connection_reauth_required` is not stored — nothing was done — so retrying with the same key reaches Airbnb again. Without it, a retry after a timeout can send the guest two offers. Read or withdraw the offer with `GET` / `DELETE /v1/conversations/{id}/special-offers/{offerId}` (VRBO: `offerId` = `current`).
|
|
24
24
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
25
25
|
# @param create_conversation_special_offer_request [CreateConversationSpecialOfferRequest]
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
@@ -31,8 +31,8 @@ module Repull
|
|
|
31
31
|
data
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
# Send a special offer
|
|
35
|
-
# Send the guest on this conversation
|
|
34
|
+
# Send a special offer (Airbnb, VRBO)
|
|
35
|
+
# Send the guest on this conversation a special offer: your own dates, guest count and price. One endpoint for every channel that has offers — **Airbnb** (connected directly) and **VRBO** (its “Edit quote”). Use it to answer an inquiry with different terms. To accept the guest’s own dates and price as they asked, pre-approve instead (`POST /v1/conversations/{id}/pre-approval`). **How the price is set depends on the channel** — `GET /v1/conversations/{id}` → `capabilities.offerPrice` says which: - `total` (Airbnb): send `totalPrice`, the whole stay in the listing’s Airbnb currency, with `checkIn`, `checkOut` and `guests`. - `breakdown` (VRBO): send the price’s parts — `rentalAmount` (rent, excluding fees), `fees` by VRBO fee type, `damageDeposit` — and VRBO computes the guest total, adding its taxes and service fee. Dates and party are optional (omitted → the inquiry’s own). Only what you send is changed. Preview the result first with `POST /v1/conversations/{id}/special-offers/preview`. Sending the other kind is `422 offer_price_total_required` / `offer_price_breakdown_required` naming the field; nothing is sent. A channel without offers (Booking.com, direct, an Airbnb inquiry relayed by a PMS) is `422 channel_not_supported`. `listingId` (Airbnb) is optional: omit it to offer the listing the guest asked about. It is a **Repull** listing id. `message` (VRBO) is sent to the guest with the offer. An offer the channel refuses is never a `201`: dates that are taken, a price below the channel’s minimum and the like are `422` with the channel’s own reason in `message`. Send `Idempotency-Key`: a repeat with the same key replays the first response instead of acting twice (a `409 idempotency_key_in_use` while the first is still running). A 5xx, a `429 airbnb_rate_limited` or a `403 connection_reauth_required` is not stored — nothing was done — so retrying with the same key reaches Airbnb again. Without it, a retry after a timeout can send the guest two offers. Read or withdraw the offer with `GET` / `DELETE /v1/conversations/{id}/special-offers/{offerId}` (VRBO: `offerId` = `current`).
|
|
36
36
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
37
37
|
# @param create_conversation_special_offer_request [CreateConversationSpecialOfferRequest]
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
@@ -167,9 +167,9 @@ module Repull
|
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
# Get a special offer
|
|
170
|
-
# Read a special offer on this conversation
|
|
170
|
+
# Read a special offer on this conversation — typically to check its `status`. Airbnb: read live with the conversation’s own Airbnb account (`active` until the guest books it, it expires, or you withdraw it). VRBO (`offerId` = `current`): the live offer as last synced from VRBO, priced by its parts with VRBO’s total.
|
|
171
171
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
172
|
-
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`.
|
|
172
|
+
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`. On VRBO, where a conversation has one live offer, `current`.
|
|
173
173
|
# @param [Hash] opts the optional parameters
|
|
174
174
|
# @return [CreateConversationSpecialOffer201Response]
|
|
175
175
|
def get_conversation_special_offer(id, offer_id, opts = {})
|
|
@@ -178,9 +178,9 @@ module Repull
|
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
# Get a special offer
|
|
181
|
-
# Read a special offer on this conversation
|
|
181
|
+
# Read a special offer on this conversation — typically to check its `status`. Airbnb: read live with the conversation’s own Airbnb account (`active` until the guest books it, it expires, or you withdraw it). VRBO (`offerId` = `current`): the live offer as last synced from VRBO, priced by its parts with VRBO’s total.
|
|
182
182
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
183
|
-
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`.
|
|
183
|
+
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`. On VRBO, where a conversation has one live offer, `current`.
|
|
184
184
|
# @param [Hash] opts the optional parameters
|
|
185
185
|
# @return [Array<(CreateConversationSpecialOffer201Response, Integer, Hash)>] CreateConversationSpecialOffer201Response data, response status code and response headers
|
|
186
186
|
def get_conversation_special_offer_with_http_info(id, offer_id, opts = {})
|
|
@@ -530,8 +530,8 @@ module Repull
|
|
|
530
530
|
return data, status_code, headers
|
|
531
531
|
end
|
|
532
532
|
|
|
533
|
-
# Pre-approve an inquiry
|
|
534
|
-
# Pre-approve the
|
|
533
|
+
# Pre-approve an inquiry (Airbnb, VRBO)
|
|
534
|
+
# Pre-approve the inquiry on this conversation: the guest who asked about dates may now book them at the listed price, without waiting on you. To change the dates, guests or price, send a special offer instead (`POST /v1/conversations/{id}/special-offers`). Find inquiries that need an answer with `GET /v1/inquiries` (default `status=open`); each carries the `conversationId` to use here. One endpoint for every channel with pre-approvals: **Airbnb** (listings connected directly) and **VRBO**. A Booking.com or direct-booking conversation, or an Airbnb one relayed through a PMS (Hostaway, Guesty), returns `422 channel_not_supported` and nothing is sent — `GET /v1/conversations/{id}` → `capabilities.canPreApprove` says where it works. `blockInstantBooking` is Airbnb only (VRBO has no such switch: `422 invalid_params`). `message` is sent to the guest with a VRBO pre-approval (a friendly default otherwise). The inquiry is marked `pre_approved` everywhere, the same as pre-approving on the channel. Withdraw it with `DELETE /v1/conversations/{id}/pre-approval` (VRBO). A channel’s refusal is never reported as a success: an inquiry that already moved on is `409 inquiry_no_longer_open`, an expired one `409 inquiry_expired`, a conversation that already has a booking `409 conversation_already_booked`. Send `Idempotency-Key`: a repeat with the same key replays the first response instead of acting twice (a `409 idempotency_key_in_use` while the first is still running). A 5xx, a `429 airbnb_rate_limited` or a `403 connection_reauth_required` is not stored — nothing was done — so retrying with the same key reaches Airbnb again.
|
|
535
535
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
536
536
|
# @param [Hash] opts the optional parameters
|
|
537
537
|
# @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged `Idempotency-Status: cached` — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → `409 idempotency_key_in_use`. - Same key with a DIFFERENT payload → `422 idempotency_key_reused`. Generate a new key per distinct request; reuse one only when retrying that exact request. - Retryable outcomes are deliberately not stored, so a retry with the same key runs for real: any status >= 500, `408`, `425` and `429`, and the refusals that happen before anything is done and tell you to fix something outside the request first — `connection_reauth_required`, `listing_inactive`, and the rate/daily limits. Every other answer, including a final refusal such as `422 airbnb_rejected`, is stored and replayed.
|
|
@@ -542,8 +542,8 @@ module Repull
|
|
|
542
542
|
data
|
|
543
543
|
end
|
|
544
544
|
|
|
545
|
-
# Pre-approve an inquiry
|
|
546
|
-
# Pre-approve the
|
|
545
|
+
# Pre-approve an inquiry (Airbnb, VRBO)
|
|
546
|
+
# Pre-approve the inquiry on this conversation: the guest who asked about dates may now book them at the listed price, without waiting on you. To change the dates, guests or price, send a special offer instead (`POST /v1/conversations/{id}/special-offers`). Find inquiries that need an answer with `GET /v1/inquiries` (default `status=open`); each carries the `conversationId` to use here. One endpoint for every channel with pre-approvals: **Airbnb** (listings connected directly) and **VRBO**. A Booking.com or direct-booking conversation, or an Airbnb one relayed through a PMS (Hostaway, Guesty), returns `422 channel_not_supported` and nothing is sent — `GET /v1/conversations/{id}` → `capabilities.canPreApprove` says where it works. `blockInstantBooking` is Airbnb only (VRBO has no such switch: `422 invalid_params`). `message` is sent to the guest with a VRBO pre-approval (a friendly default otherwise). The inquiry is marked `pre_approved` everywhere, the same as pre-approving on the channel. Withdraw it with `DELETE /v1/conversations/{id}/pre-approval` (VRBO). A channel’s refusal is never reported as a success: an inquiry that already moved on is `409 inquiry_no_longer_open`, an expired one `409 inquiry_expired`, a conversation that already has a booking `409 conversation_already_booked`. Send `Idempotency-Key`: a repeat with the same key replays the first response instead of acting twice (a `409 idempotency_key_in_use` while the first is still running). A 5xx, a `429 airbnb_rate_limited` or a `403 connection_reauth_required` is not stored — nothing was done — so retrying with the same key reaches Airbnb again.
|
|
547
547
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
548
548
|
# @param [Hash] opts the optional parameters
|
|
549
549
|
# @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged `Idempotency-Status: cached` — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → `409 idempotency_key_in_use`. - Same key with a DIFFERENT payload → `422 idempotency_key_reused`. Generate a new key per distinct request; reuse one only when retrying that exact request. - Retryable outcomes are deliberately not stored, so a retry with the same key runs for real: any status >= 500, `408`, `425` and `429`, and the refusals that happen before anything is done and tell you to fix something outside the request first — `connection_reauth_required`, `listing_inactive`, and the rate/daily limits. Every other answer, including a final refusal such as `422 airbnb_rejected`, is stored and replayed.
|
|
@@ -607,8 +607,78 @@ module Repull
|
|
|
607
607
|
return data, status_code, headers
|
|
608
608
|
end
|
|
609
609
|
|
|
610
|
+
# Preview a special offer
|
|
611
|
+
# See what a special offer would be — as the channel itself recalculates it, with its taxes, service fee and guest total — **without sending anything** to the guest. Same body as `POST /v1/conversations/{id}/special-offers`; the price may be omitted to see only a date or party change, and `{}` shows the current offer recalculated. **VRBO** (its “Edit quote” recalculation). A channel without a preview — Airbnb takes your total as it is — returns `422 preview_not_supported`; `GET /v1/conversations/{id}` → `capabilities.canPreviewOffer` says which. Read-only: safe to call as often as you need while a user edits an offer.
|
|
612
|
+
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
613
|
+
# @param [Hash] opts the optional parameters
|
|
614
|
+
# @option opts [PreviewConversationSpecialOfferRequest] :preview_conversation_special_offer_request
|
|
615
|
+
# @return [CreateConversationSpecialOffer201Response]
|
|
616
|
+
def preview_conversation_special_offer(id, opts = {})
|
|
617
|
+
data, _status_code, _headers = preview_conversation_special_offer_with_http_info(id, opts)
|
|
618
|
+
data
|
|
619
|
+
end
|
|
620
|
+
|
|
621
|
+
# Preview a special offer
|
|
622
|
+
# See what a special offer would be — as the channel itself recalculates it, with its taxes, service fee and guest total — **without sending anything** to the guest. Same body as `POST /v1/conversations/{id}/special-offers`; the price may be omitted to see only a date or party change, and `{}` shows the current offer recalculated. **VRBO** (its “Edit quote” recalculation). A channel without a preview — Airbnb takes your total as it is — returns `422 preview_not_supported`; `GET /v1/conversations/{id}` → `capabilities.canPreviewOffer` says which. Read-only: safe to call as often as you need while a user edits an offer.
|
|
623
|
+
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
624
|
+
# @param [Hash] opts the optional parameters
|
|
625
|
+
# @option opts [PreviewConversationSpecialOfferRequest] :preview_conversation_special_offer_request
|
|
626
|
+
# @return [Array<(CreateConversationSpecialOffer201Response, Integer, Hash)>] CreateConversationSpecialOffer201Response data, response status code and response headers
|
|
627
|
+
def preview_conversation_special_offer_with_http_info(id, opts = {})
|
|
628
|
+
if @api_client.config.debugging
|
|
629
|
+
@api_client.config.logger.debug 'Calling API: ConversationsApi.preview_conversation_special_offer ...'
|
|
630
|
+
end
|
|
631
|
+
# verify the required parameter 'id' is set
|
|
632
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
633
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConversationsApi.preview_conversation_special_offer"
|
|
634
|
+
end
|
|
635
|
+
# resource path
|
|
636
|
+
local_var_path = '/v1/conversations/{id}/special-offers/preview'.sub('{id}', CGI.escape(id.to_s))
|
|
637
|
+
|
|
638
|
+
# query parameters
|
|
639
|
+
query_params = opts[:query_params] || {}
|
|
640
|
+
|
|
641
|
+
# header parameters
|
|
642
|
+
header_params = opts[:header_params] || {}
|
|
643
|
+
# HTTP header 'Accept' (if needed)
|
|
644
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
645
|
+
# HTTP header 'Content-Type'
|
|
646
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
647
|
+
if !content_type.nil?
|
|
648
|
+
header_params['Content-Type'] = content_type
|
|
649
|
+
end
|
|
650
|
+
|
|
651
|
+
# form parameters
|
|
652
|
+
form_params = opts[:form_params] || {}
|
|
653
|
+
|
|
654
|
+
# http body (model)
|
|
655
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'preview_conversation_special_offer_request'])
|
|
656
|
+
|
|
657
|
+
# return_type
|
|
658
|
+
return_type = opts[:debug_return_type] || 'CreateConversationSpecialOffer201Response'
|
|
659
|
+
|
|
660
|
+
# auth_names
|
|
661
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
662
|
+
|
|
663
|
+
new_options = opts.merge(
|
|
664
|
+
:operation => :"ConversationsApi.preview_conversation_special_offer",
|
|
665
|
+
:header_params => header_params,
|
|
666
|
+
:query_params => query_params,
|
|
667
|
+
:form_params => form_params,
|
|
668
|
+
:body => post_body,
|
|
669
|
+
:auth_names => auth_names,
|
|
670
|
+
:return_type => return_type
|
|
671
|
+
)
|
|
672
|
+
|
|
673
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
674
|
+
if @api_client.config.debugging
|
|
675
|
+
@api_client.config.logger.debug "API called: ConversationsApi#preview_conversation_special_offer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
676
|
+
end
|
|
677
|
+
return data, status_code, headers
|
|
678
|
+
end
|
|
679
|
+
|
|
610
680
|
# Send a message to the guest
|
|
611
|
-
# Sends a message to the guest on this conversation and records it in the thread. Omit `channel` and the message goes out on whichever channel the conversation already uses (Airbnb, Booking.com, SMS, email or the direct-booking site) — that is the right default. Pass `channel` only to force a specific one. The message is attributed to the API: it is recorded with `aiGenerated` false so an API send is never counted as an automated reply. ### Airbnb rewrites links — check `contentRewritten` Airbnb rejects guest messages containing a link, an email address or a phone number, and names the offending text. When that happens the offending fragment is stripped and the remainder is re-sent once, which means **the guest receives a message that is not the one you wrote**. Reporting that as a plain success would be a lie, so every response carries `contentRewritten`; when it is `true`, `deliveredContent` is the text that actually reached the guest. Check it before assuming your message went out verbatim. When the text cannot be salvaged (the link is most of the message) nothing is delivered and the call returns `422 message_not_sent` with the channel's verbatim refusal in `statusReason`. Send `Idempotency-Key` — without it, retrying after a network timeout sends the guest the same message twice. ### Attachments Send files with `attachments: [{ url, contentType?, filename? }]` — public `https://` URLs, up to 5 per request, 10 MB each. `message` may be omitted when there are attachments (except on Booking.com). Repull downloads each file, reads its real type from the bytes, keeps a durable copy and delivers it through the channel's own file flow. **Every file is checked before anything is sent**: if one is unreachable, too large or of a type the channel refuses, the call returns 422 naming the file (`index`) and the guest receives nothing. | Channel | Accepted types | Text | How it arrives | |---|---|---|---| | Airbnb | JPEG, PNG, GIF, WebP (converted to JPEG), MP4, QuickTime | optional | each file as its own message, then the text as a separate message | | Booking.com | JPEG, PNG | **required** | one message carrying the text and every file | | SMS, email, direct-booking site chat | — | — | `422 attachments_not_supported`, nothing sent | Airbnb does not allow files in pre-booking (inquiry) conversations; that refusal comes back as `422 message_not_sent`. Because Airbnb delivers files one message at a time, a later file can be refused after earlier ones arrived — that returns `422 message_partially_sent` with `parts` saying exactly which messages reached the guest; resend only the rest. The response's `attachments` lists each file's durable `url`, and `parts` lists every channel message the send produced. Read-back (`GET /v1/conversations/{id}/messages`) shows the same files in each message's `attachments`. **Inactive listings:** a conversation that belongs to an inactive listing returns `403 listing_inactive` and no message is sent. Activate the listing first.
|
|
681
|
+
# Sends a message to the guest on this conversation and records it in the thread. Omit `channel` and the message goes out on whichever channel the conversation already uses (Airbnb, Booking.com, VRBO, SMS, email or the direct-booking site) — that is the right default. Pass `channel` only to force a specific one. The message is attributed to the API: it is recorded with `aiGenerated` false so an API send is never counted as an automated reply. ### Airbnb rewrites links — check `contentRewritten` Airbnb rejects guest messages containing a link, an email address or a phone number, and names the offending text. When that happens the offending fragment is stripped and the remainder is re-sent once, which means **the guest receives a message that is not the one you wrote**. Reporting that as a plain success would be a lie, so every response carries `contentRewritten`; when it is `true`, `deliveredContent` is the text that actually reached the guest. Check it before assuming your message went out verbatim. When the text cannot be salvaged (the link is most of the message) nothing is delivered and the call returns `422 message_not_sent` with the channel's verbatim refusal in `statusReason`. Send `Idempotency-Key` — without it, retrying after a network timeout sends the guest the same message twice. ### Attachments Send files with `attachments: [{ url, contentType?, filename? }]` — public `https://` URLs, up to 5 per request, 10 MB each. `message` may be omitted when there are attachments (except on Booking.com). Repull downloads each file, reads its real type from the bytes, keeps a durable copy and delivers it through the channel's own file flow. **Every file is checked before anything is sent**: if one is unreachable, too large or of a type the channel refuses, the call returns 422 naming the file (`index`) and the guest receives nothing. | Channel | Accepted types | Text | How it arrives | |---|---|---|---| | Airbnb | JPEG, PNG, GIF, WebP (converted to JPEG), MP4, QuickTime | optional | each file as its own message, then the text as a separate message | | Booking.com | JPEG, PNG | **required** | one message carrying the text and every file | | VRBO, SMS, email, direct-booking site chat | — | — | `422 attachments_not_supported`, nothing sent | Airbnb does not allow files in pre-booking (inquiry) conversations; that refusal comes back as `422 message_not_sent`. Because Airbnb delivers files one message at a time, a later file can be refused after earlier ones arrived — that returns `422 message_partially_sent` with `parts` saying exactly which messages reached the guest; resend only the rest. The response's `attachments` lists each file's durable `url`, and `parts` lists every channel message the send produced. Read-back (`GET /v1/conversations/{id}/messages`) shows the same files in each message's `attachments`. **Inactive listings:** a conversation that belongs to an inactive listing returns `403 listing_inactive` and no message is sent. Activate the listing first.
|
|
612
682
|
# @param id [Integer] Internal Repull thread id.
|
|
613
683
|
# @param send_message_request [SendMessageRequest]
|
|
614
684
|
# @param [Hash] opts the optional parameters
|
|
@@ -620,7 +690,7 @@ module Repull
|
|
|
620
690
|
end
|
|
621
691
|
|
|
622
692
|
# Send a message to the guest
|
|
623
|
-
# Sends a message to the guest on this conversation and records it in the thread. Omit `channel` and the message goes out on whichever channel the conversation already uses (Airbnb, Booking.com, SMS, email or the direct-booking site) — that is the right default. Pass `channel` only to force a specific one. The message is attributed to the API: it is recorded with `aiGenerated` false so an API send is never counted as an automated reply. ### Airbnb rewrites links — check `contentRewritten` Airbnb rejects guest messages containing a link, an email address or a phone number, and names the offending text. When that happens the offending fragment is stripped and the remainder is re-sent once, which means **the guest receives a message that is not the one you wrote**. Reporting that as a plain success would be a lie, so every response carries `contentRewritten`; when it is `true`, `deliveredContent` is the text that actually reached the guest. Check it before assuming your message went out verbatim. When the text cannot be salvaged (the link is most of the message) nothing is delivered and the call returns `422 message_not_sent` with the channel's verbatim refusal in `statusReason`. Send `Idempotency-Key` — without it, retrying after a network timeout sends the guest the same message twice. ### Attachments Send files with `attachments: [{ url, contentType?, filename? }]` — public `https://` URLs, up to 5 per request, 10 MB each. `message` may be omitted when there are attachments (except on Booking.com). Repull downloads each file, reads its real type from the bytes, keeps a durable copy and delivers it through the channel's own file flow. **Every file is checked before anything is sent**: if one is unreachable, too large or of a type the channel refuses, the call returns 422 naming the file (`index`) and the guest receives nothing. | Channel | Accepted types | Text | How it arrives | |---|---|---|---| | Airbnb | JPEG, PNG, GIF, WebP (converted to JPEG), MP4, QuickTime | optional | each file as its own message, then the text as a separate message | | Booking.com | JPEG, PNG | **required** | one message carrying the text and every file | | SMS, email, direct-booking site chat | — | — | `422 attachments_not_supported`, nothing sent | Airbnb does not allow files in pre-booking (inquiry) conversations; that refusal comes back as `422 message_not_sent`. Because Airbnb delivers files one message at a time, a later file can be refused after earlier ones arrived — that returns `422 message_partially_sent` with `parts` saying exactly which messages reached the guest; resend only the rest. The response's `attachments` lists each file's durable `url`, and `parts` lists every channel message the send produced. Read-back (`GET /v1/conversations/{id}/messages`) shows the same files in each message's `attachments`. **Inactive listings:** a conversation that belongs to an inactive listing returns `403 listing_inactive` and no message is sent. Activate the listing first.
|
|
693
|
+
# Sends a message to the guest on this conversation and records it in the thread. Omit `channel` and the message goes out on whichever channel the conversation already uses (Airbnb, Booking.com, VRBO, SMS, email or the direct-booking site) — that is the right default. Pass `channel` only to force a specific one. The message is attributed to the API: it is recorded with `aiGenerated` false so an API send is never counted as an automated reply. ### Airbnb rewrites links — check `contentRewritten` Airbnb rejects guest messages containing a link, an email address or a phone number, and names the offending text. When that happens the offending fragment is stripped and the remainder is re-sent once, which means **the guest receives a message that is not the one you wrote**. Reporting that as a plain success would be a lie, so every response carries `contentRewritten`; when it is `true`, `deliveredContent` is the text that actually reached the guest. Check it before assuming your message went out verbatim. When the text cannot be salvaged (the link is most of the message) nothing is delivered and the call returns `422 message_not_sent` with the channel's verbatim refusal in `statusReason`. Send `Idempotency-Key` — without it, retrying after a network timeout sends the guest the same message twice. ### Attachments Send files with `attachments: [{ url, contentType?, filename? }]` — public `https://` URLs, up to 5 per request, 10 MB each. `message` may be omitted when there are attachments (except on Booking.com). Repull downloads each file, reads its real type from the bytes, keeps a durable copy and delivers it through the channel's own file flow. **Every file is checked before anything is sent**: if one is unreachable, too large or of a type the channel refuses, the call returns 422 naming the file (`index`) and the guest receives nothing. | Channel | Accepted types | Text | How it arrives | |---|---|---|---| | Airbnb | JPEG, PNG, GIF, WebP (converted to JPEG), MP4, QuickTime | optional | each file as its own message, then the text as a separate message | | Booking.com | JPEG, PNG | **required** | one message carrying the text and every file | | VRBO, SMS, email, direct-booking site chat | — | — | `422 attachments_not_supported`, nothing sent | Airbnb does not allow files in pre-booking (inquiry) conversations; that refusal comes back as `422 message_not_sent`. Because Airbnb delivers files one message at a time, a later file can be refused after earlier ones arrived — that returns `422 message_partially_sent` with `parts` saying exactly which messages reached the guest; resend only the rest. The response's `attachments` lists each file's durable `url`, and `parts` lists every channel message the send produced. Read-back (`GET /v1/conversations/{id}/messages`) shows the same files in each message's `attachments`. **Inactive listings:** a conversation that belongs to an inactive listing returns `403 listing_inactive` and no message is sent. Activate the listing first.
|
|
624
694
|
# @param id [Integer] Internal Repull thread id.
|
|
625
695
|
# @param send_message_request [SendMessageRequest]
|
|
626
696
|
# @param [Hash] opts the optional parameters
|
|
@@ -688,10 +758,73 @@ module Repull
|
|
|
688
758
|
return data, status_code, headers
|
|
689
759
|
end
|
|
690
760
|
|
|
761
|
+
# Withdraw a pre-approval
|
|
762
|
+
# Withdraw the live pre-approval (or offer) on this conversation: the guest can no longer book on it, and the inquiry is open again. **VRBO**. On Airbnb a pre-approval is a special offer — withdraw it with `DELETE /v1/conversations/{id}/special-offers/{offerId}`; here it is `422 channel_not_supported`. `GET /v1/conversations/{id}` → `capabilities.canWithdraw` says whether there is something to withdraw.
|
|
763
|
+
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
764
|
+
# @param [Hash] opts the optional parameters
|
|
765
|
+
# @return [WithdrawConversationPreapproval200Response]
|
|
766
|
+
def withdraw_conversation_preapproval(id, opts = {})
|
|
767
|
+
data, _status_code, _headers = withdraw_conversation_preapproval_with_http_info(id, opts)
|
|
768
|
+
data
|
|
769
|
+
end
|
|
770
|
+
|
|
771
|
+
# Withdraw a pre-approval
|
|
772
|
+
# Withdraw the live pre-approval (or offer) on this conversation: the guest can no longer book on it, and the inquiry is open again. **VRBO**. On Airbnb a pre-approval is a special offer — withdraw it with `DELETE /v1/conversations/{id}/special-offers/{offerId}`; here it is `422 channel_not_supported`. `GET /v1/conversations/{id}` → `capabilities.canWithdraw` says whether there is something to withdraw.
|
|
773
|
+
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
774
|
+
# @param [Hash] opts the optional parameters
|
|
775
|
+
# @return [Array<(WithdrawConversationPreapproval200Response, Integer, Hash)>] WithdrawConversationPreapproval200Response data, response status code and response headers
|
|
776
|
+
def withdraw_conversation_preapproval_with_http_info(id, opts = {})
|
|
777
|
+
if @api_client.config.debugging
|
|
778
|
+
@api_client.config.logger.debug 'Calling API: ConversationsApi.withdraw_conversation_preapproval ...'
|
|
779
|
+
end
|
|
780
|
+
# verify the required parameter 'id' is set
|
|
781
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
782
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConversationsApi.withdraw_conversation_preapproval"
|
|
783
|
+
end
|
|
784
|
+
# resource path
|
|
785
|
+
local_var_path = '/v1/conversations/{id}/pre-approval'.sub('{id}', CGI.escape(id.to_s))
|
|
786
|
+
|
|
787
|
+
# query parameters
|
|
788
|
+
query_params = opts[:query_params] || {}
|
|
789
|
+
|
|
790
|
+
# header parameters
|
|
791
|
+
header_params = opts[:header_params] || {}
|
|
792
|
+
# HTTP header 'Accept' (if needed)
|
|
793
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
794
|
+
|
|
795
|
+
# form parameters
|
|
796
|
+
form_params = opts[:form_params] || {}
|
|
797
|
+
|
|
798
|
+
# http body (model)
|
|
799
|
+
post_body = opts[:debug_body]
|
|
800
|
+
|
|
801
|
+
# return_type
|
|
802
|
+
return_type = opts[:debug_return_type] || 'WithdrawConversationPreapproval200Response'
|
|
803
|
+
|
|
804
|
+
# auth_names
|
|
805
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
806
|
+
|
|
807
|
+
new_options = opts.merge(
|
|
808
|
+
:operation => :"ConversationsApi.withdraw_conversation_preapproval",
|
|
809
|
+
:header_params => header_params,
|
|
810
|
+
:query_params => query_params,
|
|
811
|
+
:form_params => form_params,
|
|
812
|
+
:body => post_body,
|
|
813
|
+
:auth_names => auth_names,
|
|
814
|
+
:return_type => return_type
|
|
815
|
+
)
|
|
816
|
+
|
|
817
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
818
|
+
if @api_client.config.debugging
|
|
819
|
+
@api_client.config.logger.debug "API called: ConversationsApi#withdraw_conversation_preapproval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
820
|
+
end
|
|
821
|
+
return data, status_code, headers
|
|
822
|
+
end
|
|
823
|
+
|
|
691
824
|
# Withdraw a special offer
|
|
692
|
-
# Withdraw a special offer the guest has not booked yet, so it can no longer be booked. An offer the guest already booked cannot be withdrawn —
|
|
825
|
+
# Withdraw a special offer the guest has not booked yet, so it can no longer be booked (VRBO: `offerId` = `current`, the same as `DELETE /v1/conversations/{id}/pre-approval`). An offer the guest already booked cannot be withdrawn — the channel refuses with `409 inquiry_no_longer_open`; cancel the booking instead.
|
|
693
826
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
694
|
-
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`.
|
|
827
|
+
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`. On VRBO, where a conversation has one live offer, `current`.
|
|
695
828
|
# @param [Hash] opts the optional parameters
|
|
696
829
|
# @return [WithdrawConversationSpecialOffer200Response]
|
|
697
830
|
def withdraw_conversation_special_offer(id, offer_id, opts = {})
|
|
@@ -700,9 +833,9 @@ module Repull
|
|
|
700
833
|
end
|
|
701
834
|
|
|
702
835
|
# Withdraw a special offer
|
|
703
|
-
# Withdraw a special offer the guest has not booked yet, so it can no longer be booked. An offer the guest already booked cannot be withdrawn —
|
|
836
|
+
# Withdraw a special offer the guest has not booked yet, so it can no longer be booked (VRBO: `offerId` = `current`, the same as `DELETE /v1/conversations/{id}/pre-approval`). An offer the guest already booked cannot be withdrawn — the channel refuses with `409 inquiry_no_longer_open`; cancel the booking instead.
|
|
704
837
|
# @param id [Integer] Repull conversation id (from `GET /v1/conversations` or `conversationId` on `GET /v1/inquiries`) — not the Airbnb thread id.
|
|
705
|
-
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`.
|
|
838
|
+
# @param offer_id [String] The special offer’s `id`, as returned by `POST /v1/conversations/{id}/special-offers`. On VRBO, where a conversation has one live offer, `current`.
|
|
706
839
|
# @param [Hash] opts the optional parameters
|
|
707
840
|
# @return [Array<(WithdrawConversationSpecialOffer200Response, Integer, Hash)>] WithdrawConversationSpecialOffer200Response data, response status code and response headers
|
|
708
841
|
def withdraw_conversation_special_offer_with_http_info(id, offer_id, opts = {})
|