repull 0.2.32 → 0.2.33
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/README.md +1 -1
- data/lib/repull/api/connections_api.rb +77 -0
- data/lib/repull/api/resolutions_api.rb +236 -0
- data/lib/repull/api/transactions_api.rb +73 -0
- data/lib/repull/models/account_import.rb +237 -0
- data/lib/repull/models/account_import_completed_event.rb +282 -0
- data/lib/repull/models/account_import_counts.rb +193 -0
- data/lib/repull/models/account_import_failed_event.rb +282 -0
- data/lib/repull/models/account_import_finished_payload.rb +224 -0
- data/lib/repull/models/account_import_stage.rb +177 -0
- data/lib/repull/models/account_import_started_event.rb +282 -0
- data/lib/repull/models/account_import_started_payload.rb +177 -0
- data/lib/repull/models/connection.rb +16 -5
- data/lib/repull/models/list_airbnb_resolutions200_response.rb +192 -0
- data/lib/repull/models/list_connection_imports200_response.rb +158 -0
- data/lib/repull/models/refresh_airbnb_resolutions200_response.rb +219 -0
- data/lib/repull/models/refresh_airbnb_resolutions200_response_accounts_inner.rb +200 -0
- data/lib/repull/models/refresh_airbnb_resolutions200_response_accounts_inner_error.rb +156 -0
- data/lib/repull/models/refresh_airbnb_resolutions_request.rb +192 -0
- data/lib/repull/models/resolution.rb +329 -0
- data/lib/repull/models/transaction_payout.rb +17 -6
- data/lib/repull/models/webhook_event.rb +6 -0
- data/lib/repull/models/webhook_event_type.rb +4 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +16 -0
- data/openapi/v1.json +845 -78
- data/scripts/regen.sh +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcd09671d587b3a558ca474b37832304e42231f117d9b9e2b150fa552ce49838
|
|
4
|
+
data.tar.gz: 18287ddb63189f862bd47555b1a7a401fc0c277e5017f7ec6c8b06c634cb4d52
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b12ac60809e465da6d06fb88a086e6dc8fe927f20c97ac89e4a0cbd96b930137d36a3542e1b783d389c724b5f392fe3eb16fcb72fd3f0eb841e2da55c29db978
|
|
7
|
+
data.tar.gz: ac40bf824c0d645b5402b264b08f44a2014365ec9ba1aa17c171c672bd4ee6c341d91d6ffb64203efcb230d56088f3f9481d82d852e81c4fda203b34af0cc573
|
data/README.md
CHANGED
|
@@ -163,6 +163,83 @@ module Repull
|
|
|
163
163
|
return data, status_code, headers
|
|
164
164
|
end
|
|
165
165
|
|
|
166
|
+
# List a connection's imports
|
|
167
|
+
# The import runs of one connected account, newest first: the first sync after connecting, a room or unit mapped later, a reconnect, a re-sync. Each run says where it stands (`running`, `completed`, `failed`), its stages and what it imported. To know when an account's first sync is done, wait for the `account.import.completed` webhook, or poll this endpoint (or `GET /v1/connect`, whose connections carry their latest `import`) until the newest run is no longer `running`. Auth: a Repull API key, or a Connect session token (`sessionId`).
|
|
168
|
+
# @param id [String] Connection handle `{provider}:{externalAccountId}`, e.g. `booking_extranet:36`, `vrbo:12`, `airbnb:1234567`, `hostaway:27434` — the `provider` and `externalAccountId` of a connection on `GET /v1/connect`, or the account of an `account.*` webhook.
|
|
169
|
+
# @param [Hash] opts the optional parameters
|
|
170
|
+
# @option opts [Integer] :limit How many runs to return, newest first. (default to 20)
|
|
171
|
+
# @option opts [String] :session_id The Connect session ID (capability token).
|
|
172
|
+
# @return [ListConnectionImports200Response]
|
|
173
|
+
def list_connection_imports(id, opts = {})
|
|
174
|
+
data, _status_code, _headers = list_connection_imports_with_http_info(id, opts)
|
|
175
|
+
data
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# List a connection's imports
|
|
179
|
+
# The import runs of one connected account, newest first: the first sync after connecting, a room or unit mapped later, a reconnect, a re-sync. Each run says where it stands (`running`, `completed`, `failed`), its stages and what it imported. To know when an account's first sync is done, wait for the `account.import.completed` webhook, or poll this endpoint (or `GET /v1/connect`, whose connections carry their latest `import`) until the newest run is no longer `running`. Auth: a Repull API key, or a Connect session token (`sessionId`).
|
|
180
|
+
# @param id [String] Connection handle `{provider}:{externalAccountId}`, e.g. `booking_extranet:36`, `vrbo:12`, `airbnb:1234567`, `hostaway:27434` — the `provider` and `externalAccountId` of a connection on `GET /v1/connect`, or the account of an `account.*` webhook.
|
|
181
|
+
# @param [Hash] opts the optional parameters
|
|
182
|
+
# @option opts [Integer] :limit How many runs to return, newest first. (default to 20)
|
|
183
|
+
# @option opts [String] :session_id The Connect session ID (capability token).
|
|
184
|
+
# @return [Array<(ListConnectionImports200Response, Integer, Hash)>] ListConnectionImports200Response data, response status code and response headers
|
|
185
|
+
def list_connection_imports_with_http_info(id, opts = {})
|
|
186
|
+
if @api_client.config.debugging
|
|
187
|
+
@api_client.config.logger.debug 'Calling API: ConnectionsApi.list_connection_imports ...'
|
|
188
|
+
end
|
|
189
|
+
# verify the required parameter 'id' is set
|
|
190
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
191
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ConnectionsApi.list_connection_imports"
|
|
192
|
+
end
|
|
193
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
194
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConnectionsApi.list_connection_imports, must be smaller than or equal to 100.'
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
198
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ConnectionsApi.list_connection_imports, must be greater than or equal to 1.'
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# resource path
|
|
202
|
+
local_var_path = '/v1/connections/{id}/imports'.sub('{id}', CGI.escape(id.to_s))
|
|
203
|
+
|
|
204
|
+
# query parameters
|
|
205
|
+
query_params = opts[:query_params] || {}
|
|
206
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
207
|
+
query_params[:'sessionId'] = opts[:'session_id'] if !opts[:'session_id'].nil?
|
|
208
|
+
|
|
209
|
+
# header parameters
|
|
210
|
+
header_params = opts[:header_params] || {}
|
|
211
|
+
# HTTP header 'Accept' (if needed)
|
|
212
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
213
|
+
|
|
214
|
+
# form parameters
|
|
215
|
+
form_params = opts[:form_params] || {}
|
|
216
|
+
|
|
217
|
+
# http body (model)
|
|
218
|
+
post_body = opts[:debug_body]
|
|
219
|
+
|
|
220
|
+
# return_type
|
|
221
|
+
return_type = opts[:debug_return_type] || 'ListConnectionImports200Response'
|
|
222
|
+
|
|
223
|
+
# auth_names
|
|
224
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
225
|
+
|
|
226
|
+
new_options = opts.merge(
|
|
227
|
+
:operation => :"ConnectionsApi.list_connection_imports",
|
|
228
|
+
:header_params => header_params,
|
|
229
|
+
:query_params => query_params,
|
|
230
|
+
:form_params => form_params,
|
|
231
|
+
:body => post_body,
|
|
232
|
+
:auth_names => auth_names,
|
|
233
|
+
:return_type => return_type
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
237
|
+
if @api_client.config.debugging
|
|
238
|
+
@api_client.config.logger.debug "API called: ConnectionsApi#list_connection_imports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
239
|
+
end
|
|
240
|
+
return data, status_code, headers
|
|
241
|
+
end
|
|
242
|
+
|
|
166
243
|
# List a connection's mappable units
|
|
167
244
|
# 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
245
|
# @param id [String] Connection handle `{channel}:{externalAccountId}`, e.g. `vrbo:12` or `booking_extranet:36`.
|
|
@@ -0,0 +1,236 @@
|
|
|
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` | unlimited (10 included, then billed per listing) | | `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 ResolutionsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get an Airbnb Resolution Center case
|
|
23
|
+
# One Airbnb Resolution Center case. `{id}` is the Airbnb resolution id (the `resolutionId` from the list, also a transaction's `reference`). Read-only (see the list endpoint). The amounts moved are in the transactions ledger — join `resolutionId` to a transaction's `reference`. 404 when it isn't in this workspace (POST the list endpoint to refresh first).
|
|
24
|
+
# @param id [String] The Airbnb resolution id.
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
27
|
+
# @return [Resolution]
|
|
28
|
+
def get_airbnb_resolution(id, opts = {})
|
|
29
|
+
data, _status_code, _headers = get_airbnb_resolution_with_http_info(id, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Get an Airbnb Resolution Center case
|
|
34
|
+
# One Airbnb Resolution Center case. `{id}` is the Airbnb resolution id (the `resolutionId` from the list, also a transaction's `reference`). Read-only (see the list endpoint). The amounts moved are in the transactions ledger — join `resolutionId` to a transaction's `reference`. 404 when it isn't in this workspace (POST the list endpoint to refresh first).
|
|
35
|
+
# @param id [String] The Airbnb resolution id.
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
38
|
+
# @return [Array<(Resolution, Integer, Hash)>] Resolution data, response status code and response headers
|
|
39
|
+
def get_airbnb_resolution_with_http_info(id, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: ResolutionsApi.get_airbnb_resolution ...'
|
|
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 ResolutionsApi.get_airbnb_resolution"
|
|
46
|
+
end
|
|
47
|
+
# resource path
|
|
48
|
+
local_var_path = '/v1/channels/airbnb/resolutions/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
49
|
+
|
|
50
|
+
# query parameters
|
|
51
|
+
query_params = opts[:query_params] || {}
|
|
52
|
+
|
|
53
|
+
# header parameters
|
|
54
|
+
header_params = opts[:header_params] || {}
|
|
55
|
+
# HTTP header 'Accept' (if needed)
|
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
57
|
+
header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body]
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'Resolution'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"ResolutionsApi.get_airbnb_resolution",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: ResolutionsApi#get_airbnb_resolution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# List Airbnb Resolution Center cases
|
|
89
|
+
# The host's Airbnb Resolution Center cases (AirCover / damage, extra-guest, refund and change requests), open and closed. Served from the database; `POST` this path to refresh from Airbnb. READ-ONLY upstream — Airbnb's Resolutions API is read-only; a claim is created, evidence added and status changed only in Airbnb's Resolution Center UI, not via API. Use this for visibility and action tracking (`suggestedActionText`). The money a resolution moved is in the transactions ledger as `Resolution Payout` / `Resolution Adjustment` rows sharing the same reference — join on `resolutionId`. Cursor-paginated, newest first.
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
92
|
+
# @option opts [String] :status Filter by lifecycle: `open` (still needs action) or `closed` (settled). Omit for all.
|
|
93
|
+
# @option opts [Integer] :limit Page size (default 50, max 200).
|
|
94
|
+
# @option opts [String] :cursor Opaque pagination cursor from a previous `pagination.nextCursor`.
|
|
95
|
+
# @return [ListAirbnbResolutions200Response]
|
|
96
|
+
def list_airbnb_resolutions(opts = {})
|
|
97
|
+
data, _status_code, _headers = list_airbnb_resolutions_with_http_info(opts)
|
|
98
|
+
data
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# List Airbnb Resolution Center cases
|
|
102
|
+
# The host's Airbnb Resolution Center cases (AirCover / damage, extra-guest, refund and change requests), open and closed. Served from the database; `POST` this path to refresh from Airbnb. READ-ONLY upstream — Airbnb's Resolutions API is read-only; a claim is created, evidence added and status changed only in Airbnb's Resolution Center UI, not via API. Use this for visibility and action tracking (`suggestedActionText`). The money a resolution moved is in the transactions ledger as `Resolution Payout` / `Resolution Adjustment` rows sharing the same reference — join on `resolutionId`. Cursor-paginated, newest first.
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
105
|
+
# @option opts [String] :status Filter by lifecycle: `open` (still needs action) or `closed` (settled). Omit for all.
|
|
106
|
+
# @option opts [Integer] :limit Page size (default 50, max 200).
|
|
107
|
+
# @option opts [String] :cursor Opaque pagination cursor from a previous `pagination.nextCursor`.
|
|
108
|
+
# @return [Array<(ListAirbnbResolutions200Response, Integer, Hash)>] ListAirbnbResolutions200Response data, response status code and response headers
|
|
109
|
+
def list_airbnb_resolutions_with_http_info(opts = {})
|
|
110
|
+
if @api_client.config.debugging
|
|
111
|
+
@api_client.config.logger.debug 'Calling API: ResolutionsApi.list_airbnb_resolutions ...'
|
|
112
|
+
end
|
|
113
|
+
allowable_values = ["open", "closed"]
|
|
114
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
|
115
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
|
116
|
+
end
|
|
117
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
|
|
118
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ResolutionsApi.list_airbnb_resolutions, must be smaller than or equal to 200.'
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
122
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ResolutionsApi.list_airbnb_resolutions, must be greater than or equal to 1.'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# resource path
|
|
126
|
+
local_var_path = '/v1/channels/airbnb/resolutions'
|
|
127
|
+
|
|
128
|
+
# query parameters
|
|
129
|
+
query_params = opts[:query_params] || {}
|
|
130
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
131
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
132
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
133
|
+
|
|
134
|
+
# header parameters
|
|
135
|
+
header_params = opts[:header_params] || {}
|
|
136
|
+
# HTTP header 'Accept' (if needed)
|
|
137
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
138
|
+
header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
|
|
139
|
+
|
|
140
|
+
# form parameters
|
|
141
|
+
form_params = opts[:form_params] || {}
|
|
142
|
+
|
|
143
|
+
# http body (model)
|
|
144
|
+
post_body = opts[:debug_body]
|
|
145
|
+
|
|
146
|
+
# return_type
|
|
147
|
+
return_type = opts[:debug_return_type] || 'ListAirbnbResolutions200Response'
|
|
148
|
+
|
|
149
|
+
# auth_names
|
|
150
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
151
|
+
|
|
152
|
+
new_options = opts.merge(
|
|
153
|
+
:operation => :"ResolutionsApi.list_airbnb_resolutions",
|
|
154
|
+
:header_params => header_params,
|
|
155
|
+
:query_params => query_params,
|
|
156
|
+
:form_params => form_params,
|
|
157
|
+
:body => post_body,
|
|
158
|
+
:auth_names => auth_names,
|
|
159
|
+
:return_type => return_type
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
163
|
+
if @api_client.config.debugging
|
|
164
|
+
@api_client.config.logger.debug "API called: ResolutionsApi#list_airbnb_resolutions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
165
|
+
end
|
|
166
|
+
return data, status_code, headers
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Refresh Airbnb resolutions from Airbnb
|
|
170
|
+
# Pulls the latest Resolution Center cases from Airbnb (read-only) and stores them, then read with GET. Optionally scope to one `account_id` and/or `status`.
|
|
171
|
+
# @param [Hash] opts the optional parameters
|
|
172
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
173
|
+
# @option opts [RefreshAirbnbResolutionsRequest] :refresh_airbnb_resolutions_request
|
|
174
|
+
# @return [RefreshAirbnbResolutions200Response]
|
|
175
|
+
def refresh_airbnb_resolutions(opts = {})
|
|
176
|
+
data, _status_code, _headers = refresh_airbnb_resolutions_with_http_info(opts)
|
|
177
|
+
data
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Refresh Airbnb resolutions from Airbnb
|
|
181
|
+
# Pulls the latest Resolution Center cases from Airbnb (read-only) and stores them, then read with GET. Optionally scope to one `account_id` and/or `status`.
|
|
182
|
+
# @param [Hash] opts the optional parameters
|
|
183
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
184
|
+
# @option opts [RefreshAirbnbResolutionsRequest] :refresh_airbnb_resolutions_request
|
|
185
|
+
# @return [Array<(RefreshAirbnbResolutions200Response, Integer, Hash)>] RefreshAirbnbResolutions200Response data, response status code and response headers
|
|
186
|
+
def refresh_airbnb_resolutions_with_http_info(opts = {})
|
|
187
|
+
if @api_client.config.debugging
|
|
188
|
+
@api_client.config.logger.debug 'Calling API: ResolutionsApi.refresh_airbnb_resolutions ...'
|
|
189
|
+
end
|
|
190
|
+
# resource path
|
|
191
|
+
local_var_path = '/v1/channels/airbnb/resolutions'
|
|
192
|
+
|
|
193
|
+
# query parameters
|
|
194
|
+
query_params = opts[:query_params] || {}
|
|
195
|
+
|
|
196
|
+
# header parameters
|
|
197
|
+
header_params = opts[:header_params] || {}
|
|
198
|
+
# HTTP header 'Accept' (if needed)
|
|
199
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
200
|
+
# HTTP header 'Content-Type'
|
|
201
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
202
|
+
if !content_type.nil?
|
|
203
|
+
header_params['Content-Type'] = content_type
|
|
204
|
+
end
|
|
205
|
+
header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
|
|
206
|
+
|
|
207
|
+
# form parameters
|
|
208
|
+
form_params = opts[:form_params] || {}
|
|
209
|
+
|
|
210
|
+
# http body (model)
|
|
211
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'refresh_airbnb_resolutions_request'])
|
|
212
|
+
|
|
213
|
+
# return_type
|
|
214
|
+
return_type = opts[:debug_return_type] || 'RefreshAirbnbResolutions200Response'
|
|
215
|
+
|
|
216
|
+
# auth_names
|
|
217
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
218
|
+
|
|
219
|
+
new_options = opts.merge(
|
|
220
|
+
:operation => :"ResolutionsApi.refresh_airbnb_resolutions",
|
|
221
|
+
:header_params => header_params,
|
|
222
|
+
:query_params => query_params,
|
|
223
|
+
:form_params => form_params,
|
|
224
|
+
:body => post_body,
|
|
225
|
+
:auth_names => auth_names,
|
|
226
|
+
:return_type => return_type
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
230
|
+
if @api_client.config.debugging
|
|
231
|
+
@api_client.config.logger.debug "API called: ResolutionsApi#refresh_airbnb_resolutions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
232
|
+
end
|
|
233
|
+
return data, status_code, headers
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
end
|
|
@@ -19,6 +19,79 @@ module Repull
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
+
# Download the original payout statement
|
|
23
|
+
# Downloads the channel's ORIGINAL payout statement — the authoritative settlement record a host reconciles against — for a payout transaction. `{id}` is the payout `transactionId` (e.g. `booking_payout_5463377687_bank_transfer`). Repull serves the stored bytes itself (no channel session), so unlike the channel's own link it never expires or leaks a session. PDF by default; pass `?format=csv` for the CSV remittance. Returns `404` when no statement was captured for the payout (e.g. an upcoming payout, or a channel that has none).
|
|
24
|
+
# @param id [String] The payout transaction id (`transactionId`).
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
27
|
+
# @option opts [String] :format Statement format. (default to 'pdf')
|
|
28
|
+
# @return [File]
|
|
29
|
+
def get_transaction_statement(id, opts = {})
|
|
30
|
+
data, _status_code, _headers = get_transaction_statement_with_http_info(id, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Download the original payout statement
|
|
35
|
+
# Downloads the channel's ORIGINAL payout statement — the authoritative settlement record a host reconciles against — for a payout transaction. `{id}` is the payout `transactionId` (e.g. `booking_payout_5463377687_bank_transfer`). Repull serves the stored bytes itself (no channel session), so unlike the channel's own link it never expires or leaks a session. PDF by default; pass `?format=csv` for the CSV remittance. Returns `404` when no statement was captured for the payout (e.g. an upcoming payout, or a channel that has none).
|
|
36
|
+
# @param id [String] The payout transaction id (`transactionId`).
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: `native` (default), `calry`, `calry-v1`. Custom: any schema name created via `POST /v1/schema/custom`. Unknown / inactive schema names fall back to `native`.
|
|
39
|
+
# @option opts [String] :format Statement format. (default to 'pdf')
|
|
40
|
+
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
|
41
|
+
def get_transaction_statement_with_http_info(id, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: TransactionsApi.get_transaction_statement ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'id' is set
|
|
46
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling TransactionsApi.get_transaction_statement"
|
|
48
|
+
end
|
|
49
|
+
allowable_values = ["pdf", "csv"]
|
|
50
|
+
if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format'])
|
|
51
|
+
fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
|
|
52
|
+
end
|
|
53
|
+
# resource path
|
|
54
|
+
local_var_path = '/v1/transactions/{id}/statement'.sub('{id}', CGI.escape(id.to_s))
|
|
55
|
+
|
|
56
|
+
# query parameters
|
|
57
|
+
query_params = opts[:query_params] || {}
|
|
58
|
+
query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
|
|
59
|
+
|
|
60
|
+
# header parameters
|
|
61
|
+
header_params = opts[:header_params] || {}
|
|
62
|
+
# HTTP header 'Accept' (if needed)
|
|
63
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'text/csv', 'application/json']) unless header_params['Accept']
|
|
64
|
+
header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
|
|
65
|
+
|
|
66
|
+
# form parameters
|
|
67
|
+
form_params = opts[:form_params] || {}
|
|
68
|
+
|
|
69
|
+
# http body (model)
|
|
70
|
+
post_body = opts[:debug_body]
|
|
71
|
+
|
|
72
|
+
# return_type
|
|
73
|
+
return_type = opts[:debug_return_type] || 'File'
|
|
74
|
+
|
|
75
|
+
# auth_names
|
|
76
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
77
|
+
|
|
78
|
+
new_options = opts.merge(
|
|
79
|
+
:operation => :"TransactionsApi.get_transaction_statement",
|
|
80
|
+
:header_params => header_params,
|
|
81
|
+
:query_params => query_params,
|
|
82
|
+
:form_params => form_params,
|
|
83
|
+
:body => post_body,
|
|
84
|
+
:auth_names => auth_names,
|
|
85
|
+
:return_type => return_type
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
89
|
+
if @api_client.config.debugging
|
|
90
|
+
@api_client.config.logger.debug "API called: TransactionsApi#get_transaction_statement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
91
|
+
end
|
|
92
|
+
return data, status_code, headers
|
|
93
|
+
end
|
|
94
|
+
|
|
22
95
|
# List transactions & payments (unified ledger)
|
|
23
96
|
# Every channel's money in one ledger: payouts that reached the host, reservation charges, refunds and adjustments, across Airbnb, Booking.com and Vrbo. Each row carries a normalized `platform` — `booking` always means Booking.com however the account was connected (official API or extranet); there is no `booking_extranet`, and `?platform=booking` matches all of them. A payout row's `amount` is the net the host received; `grossAmount` is what the guest paid and `fees` the deductions (commission, payments service fee, processing fee). Cursor-paginated, newest first.
|
|
24
97
|
# @param [Hash] opts the optional parameters
|