repull 0.2.39 → 0.2.41
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 +2 -2
- data/lib/repull/api/conversations_api.rb +2 -2
- data/lib/repull/models/airbnb_access.rb +179 -0
- data/lib/repull/models/airbnb_access_accounts_inner.rb +268 -0
- data/lib/repull/models/conversation.rb +13 -2
- data/lib/repull/models/conversation_detail.rb +13 -2
- data/lib/repull/models/listing.rb +33 -1
- data/lib/repull/models/send_message_request.rb +32 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +2 -0
- data/openapi/v1.json +132 -6
- data/scripts/regen.sh +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b161df1a676b2c2822685ae6e4ccc32ee62df5117dfefca311c6767a83ac14a
|
|
4
|
+
data.tar.gz: '0592ec0359f211a31f4545c336439ce3150d5cfe4df1f84f4e4a98c11f6ab858'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e655b78f70916ade2b2499135fd51974fed83bd4bfd5c8a6fe491be79dc5449182d7fd35c4559357ec2795146e0e6cc988744a5ccfab95449859e28ee2c2f288
|
|
7
|
+
data.tar.gz: e713c78ba5e30944635817330dff6ded69d27872f6e9f7bb1eb33669ce73c10c16f546731cef0e248d09e77df14ad48e106e12a23399b445d677aa9ccb33afc7
|
|
@@ -809,7 +809,7 @@ module Repull
|
|
|
809
809
|
end
|
|
810
810
|
|
|
811
811
|
# List PMS/OTA connections
|
|
812
|
-
# Returns every PMS and OTA connection in the workspace, each with its `status`. **Spot connections that need attention.** A connection whose `status` is not `active` may need the host to do something before it works — most commonly a Booking.com Extranet connection where the invited user was granted only partial access (`status: \"needs_permissions\"`). A Smoobu connection still on a legacy single API key carries `action.reason: \"reauth_required\"` while its `status` is `active`: Smoobu stops accepting those keys on October 31, 2026, and `fixUrl` opens the form for a new API key + secret (the connection id stays the same). These connections carry two extra fields: - `action` — `{ required: true, reason, message }`. `reason` is a stable machine code (e.g. `needs_permissions`); `message` is a host-facing one-liner describing what to do. - `fixUrl` — a durable link that reopens the hosted Connect flow **bound to that account, on the fix screen** (e.g. \"grant full access\" + a Re-check button). It is safe to store and show in your own dashboard. **Self-serve repair:** when `action.required` is true, surface a \"Fix\" button that opens `fixUrl` in a new tab (or embed it). The host resolves the issue (e.g. grants the user full access in Booking.com) and clicks Re-check; the import finishes on its own and the connection flips back to `active` — no re-invite, no support ticket. Poll this endpoint (or read it after the host returns) to confirm `action` has cleared.
|
|
812
|
+
# Returns every PMS and OTA connection in the workspace, each with its `status`. **One entry per Booking.com Extranet hotel login.** Each hotel that invites the Repull user connects as its own login, with its own `externalAccountId` (handle `booking_extranet:{externalAccountId}`). A new hotel adds an entry next to the existing ones and never replaces them; the entries share the workspace's Extranet `id`, and each hotel's listings, reservations, conversations and reviews stay under its own login (filter them with `?account=booking_extranet:{externalAccountId}`). **Spot connections that need attention.** A connection whose `status` is not `active` may need the host to do something before it works — most commonly a Booking.com Extranet connection where the invited user was granted only partial access (`status: \"needs_permissions\"`). A Smoobu connection still on a legacy single API key carries `action.reason: \"reauth_required\"` while its `status` is `active`: Smoobu stops accepting those keys on October 31, 2026, and `fixUrl` opens the form for a new API key + secret (the connection id stays the same). These connections carry two extra fields: - `action` — `{ required: true, reason, message }`. `reason` is a stable machine code (e.g. `needs_permissions`); `message` is a host-facing one-liner describing what to do. - `fixUrl` — a durable link that reopens the hosted Connect flow **bound to that account, on the fix screen** (e.g. \"grant full access\" + a Re-check button). It is safe to store and show in your own dashboard. **Self-serve repair:** when `action.required` is true, surface a \"Fix\" button that opens `fixUrl` in a new tab (or embed it). The host resolves the issue (e.g. grants the user full access in Booking.com) and clicks Re-check; the import finishes on its own and the connection flips back to `active` — no re-invite, no support ticket. Poll this endpoint (or read it after the host returns) to confirm `action` has cleared.
|
|
813
813
|
# @param [Hash] opts the optional parameters
|
|
814
814
|
# @return [ConnectionListResponse]
|
|
815
815
|
def list_connections(opts = {})
|
|
@@ -818,7 +818,7 @@ module Repull
|
|
|
818
818
|
end
|
|
819
819
|
|
|
820
820
|
# List PMS/OTA connections
|
|
821
|
-
# Returns every PMS and OTA connection in the workspace, each with its `status`. **Spot connections that need attention.** A connection whose `status` is not `active` may need the host to do something before it works — most commonly a Booking.com Extranet connection where the invited user was granted only partial access (`status: \"needs_permissions\"`). A Smoobu connection still on a legacy single API key carries `action.reason: \"reauth_required\"` while its `status` is `active`: Smoobu stops accepting those keys on October 31, 2026, and `fixUrl` opens the form for a new API key + secret (the connection id stays the same). These connections carry two extra fields: - `action` — `{ required: true, reason, message }`. `reason` is a stable machine code (e.g. `needs_permissions`); `message` is a host-facing one-liner describing what to do. - `fixUrl` — a durable link that reopens the hosted Connect flow **bound to that account, on the fix screen** (e.g. \"grant full access\" + a Re-check button). It is safe to store and show in your own dashboard. **Self-serve repair:** when `action.required` is true, surface a \"Fix\" button that opens `fixUrl` in a new tab (or embed it). The host resolves the issue (e.g. grants the user full access in Booking.com) and clicks Re-check; the import finishes on its own and the connection flips back to `active` — no re-invite, no support ticket. Poll this endpoint (or read it after the host returns) to confirm `action` has cleared.
|
|
821
|
+
# Returns every PMS and OTA connection in the workspace, each with its `status`. **One entry per Booking.com Extranet hotel login.** Each hotel that invites the Repull user connects as its own login, with its own `externalAccountId` (handle `booking_extranet:{externalAccountId}`). A new hotel adds an entry next to the existing ones and never replaces them; the entries share the workspace's Extranet `id`, and each hotel's listings, reservations, conversations and reviews stay under its own login (filter them with `?account=booking_extranet:{externalAccountId}`). **Spot connections that need attention.** A connection whose `status` is not `active` may need the host to do something before it works — most commonly a Booking.com Extranet connection where the invited user was granted only partial access (`status: \"needs_permissions\"`). A Smoobu connection still on a legacy single API key carries `action.reason: \"reauth_required\"` while its `status` is `active`: Smoobu stops accepting those keys on October 31, 2026, and `fixUrl` opens the form for a new API key + secret (the connection id stays the same). These connections carry two extra fields: - `action` — `{ required: true, reason, message }`. `reason` is a stable machine code (e.g. `needs_permissions`); `message` is a host-facing one-liner describing what to do. - `fixUrl` — a durable link that reopens the hosted Connect flow **bound to that account, on the fix screen** (e.g. \"grant full access\" + a Re-check button). It is safe to store and show in your own dashboard. **Self-serve repair:** when `action.required` is true, surface a \"Fix\" button that opens `fixUrl` in a new tab (or embed it). The host resolves the issue (e.g. grants the user full access in Booking.com) and clicks Re-check; the import finishes on its own and the connection flips back to `active` — no re-invite, no support ticket. Poll this endpoint (or read it after the host returns) to confirm `action` has cleared.
|
|
822
822
|
# @param [Hash] opts the optional parameters
|
|
823
823
|
# @return [Array<(ConnectionListResponse, Integer, Hash)>] ConnectionListResponse data, response status code and response headers
|
|
824
824
|
def list_connections_with_http_info(opts = {})
|
|
@@ -684,7 +684,7 @@ module Repull
|
|
|
684
684
|
end
|
|
685
685
|
|
|
686
686
|
# Send a message to the guest
|
|
687
|
-
# 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.
|
|
687
|
+
# 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`. `message_not_sent` only ever means the channel refused: a fault on Repull's side (a dropped database connection, a timeout) is `503 internal_error` with `sent: false` when nothing was delivered — retry it unchanged with the same `Idempotency-Key`. 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.
|
|
688
688
|
# @param id [Integer] Internal Repull thread id.
|
|
689
689
|
# @param send_message_request [SendMessageRequest]
|
|
690
690
|
# @param [Hash] opts the optional parameters
|
|
@@ -696,7 +696,7 @@ module Repull
|
|
|
696
696
|
end
|
|
697
697
|
|
|
698
698
|
# Send a message to the guest
|
|
699
|
-
# 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.
|
|
699
|
+
# 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`. `message_not_sent` only ever means the channel refused: a fault on Repull's side (a dropped database connection, a timeout) is `503 internal_error` with `sent: false` when nothing was delivered — retry it unchanged with the same `Idempotency-Key`. 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.
|
|
700
700
|
# @param id [Integer] Internal Repull thread id.
|
|
701
701
|
# @param send_message_request [SendMessageRequest]
|
|
702
702
|
# @param [Hash] opts the optional parameters
|
|
@@ -0,0 +1,179 @@
|
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
class AirbnbAccess < ApiModelBase
|
|
18
|
+
# The account that acts when none is named: the conversation's own account while connected, else the listing's owner, else a connected co-host. Null when none is connected.
|
|
19
|
+
attr_accessor :default_account
|
|
20
|
+
|
|
21
|
+
attr_accessor :accounts
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'default_account' => :'defaultAccount',
|
|
27
|
+
:'accounts' => :'accounts'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'default_account' => :'String',
|
|
45
|
+
:'accounts' => :'Array<AirbnbAccessAccountsInner>'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
:'default_account',
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbAccess` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbAccess`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'default_account')
|
|
73
|
+
self.default_account = attributes[:'default_account']
|
|
74
|
+
else
|
|
75
|
+
self.default_account = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'accounts')
|
|
79
|
+
if (value = attributes[:'accounts']).is_a?(Array)
|
|
80
|
+
self.accounts = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.accounts = nil
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
88
|
+
# @return Array for valid properties with the reasons
|
|
89
|
+
def list_invalid_properties
|
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
91
|
+
invalid_properties = Array.new
|
|
92
|
+
if @accounts.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "accounts", accounts cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @accounts.nil?
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Custom attribute writer method with validation
|
|
108
|
+
# @param [Object] accounts Value to be assigned
|
|
109
|
+
def accounts=(accounts)
|
|
110
|
+
if accounts.nil?
|
|
111
|
+
fail ArgumentError, 'accounts cannot be nil'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
@accounts = accounts
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
default_account == o.default_account &&
|
|
123
|
+
accounts == o.accounts
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# @see the `==` method
|
|
127
|
+
# @param [Object] Object to be compared
|
|
128
|
+
def eql?(o)
|
|
129
|
+
self == o
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Calculates hash code according to all attributes.
|
|
133
|
+
# @return [Integer] Hash code
|
|
134
|
+
def hash
|
|
135
|
+
[default_account, accounts].hash
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Builds the object from hash
|
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
140
|
+
# @return [Object] Returns the model itself
|
|
141
|
+
def self.build_from_hash(attributes)
|
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
|
143
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
144
|
+
transformed_hash = {}
|
|
145
|
+
openapi_types.each_pair do |key, type|
|
|
146
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
147
|
+
transformed_hash["#{key}"] = nil
|
|
148
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
149
|
+
# check to ensure the input is an array given that the attribute
|
|
150
|
+
# is documented as an array but the input is not
|
|
151
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
152
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
153
|
+
end
|
|
154
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
155
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
new(transformed_hash)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Returns the object in the form of hash
|
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
|
163
|
+
def to_hash
|
|
164
|
+
hash = {}
|
|
165
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
166
|
+
value = self.send(attr)
|
|
167
|
+
if value.nil?
|
|
168
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
169
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
hash[param] = _to_hash(value)
|
|
173
|
+
end
|
|
174
|
+
hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
end
|
|
@@ -0,0 +1,268 @@
|
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
class AirbnbAccessAccountsInner < ApiModelBase
|
|
18
|
+
# What `account` on a send takes.
|
|
19
|
+
attr_accessor :account
|
|
20
|
+
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
23
|
+
attr_accessor :role
|
|
24
|
+
|
|
25
|
+
# `connected` can act now; `disconnected` was connected to this workspace; `never_connected` is on the listing but was never connected here.
|
|
26
|
+
attr_accessor :state
|
|
27
|
+
|
|
28
|
+
attr_accessor :disconnected_at
|
|
29
|
+
|
|
30
|
+
class EnumAttributeValidator
|
|
31
|
+
attr_reader :datatype
|
|
32
|
+
attr_reader :allowable_values
|
|
33
|
+
|
|
34
|
+
def initialize(datatype, allowable_values)
|
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
|
36
|
+
case datatype.to_s
|
|
37
|
+
when /Integer/i
|
|
38
|
+
value.to_i
|
|
39
|
+
when /Float/i
|
|
40
|
+
value.to_f
|
|
41
|
+
else
|
|
42
|
+
value
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def valid?(value)
|
|
48
|
+
!value || allowable_values.include?(value)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
|
+
def self.attribute_map
|
|
54
|
+
{
|
|
55
|
+
:'account' => :'account',
|
|
56
|
+
:'name' => :'name',
|
|
57
|
+
:'role' => :'role',
|
|
58
|
+
:'state' => :'state',
|
|
59
|
+
:'disconnected_at' => :'disconnectedAt'
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns attribute mapping this model knows about
|
|
64
|
+
def self.acceptable_attribute_map
|
|
65
|
+
attribute_map
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns all the JSON keys this model knows about
|
|
69
|
+
def self.acceptable_attributes
|
|
70
|
+
acceptable_attribute_map.values
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute type mapping.
|
|
74
|
+
def self.openapi_types
|
|
75
|
+
{
|
|
76
|
+
:'account' => :'String',
|
|
77
|
+
:'name' => :'String',
|
|
78
|
+
:'role' => :'String',
|
|
79
|
+
:'state' => :'String',
|
|
80
|
+
:'disconnected_at' => :'Time'
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# List of attributes with nullable: true
|
|
85
|
+
def self.openapi_nullable
|
|
86
|
+
Set.new([
|
|
87
|
+
:'name',
|
|
88
|
+
:'disconnected_at'
|
|
89
|
+
])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Initializes the object
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
def initialize(attributes = {})
|
|
95
|
+
if (!attributes.is_a?(Hash))
|
|
96
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbAccessAccountsInner` initialize method"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
100
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
102
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbAccessAccountsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
104
|
+
end
|
|
105
|
+
h[k.to_sym] = v
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'account')
|
|
109
|
+
self.account = attributes[:'account']
|
|
110
|
+
else
|
|
111
|
+
self.account = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'name')
|
|
115
|
+
self.name = attributes[:'name']
|
|
116
|
+
else
|
|
117
|
+
self.name = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'role')
|
|
121
|
+
self.role = attributes[:'role']
|
|
122
|
+
else
|
|
123
|
+
self.role = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'state')
|
|
127
|
+
self.state = attributes[:'state']
|
|
128
|
+
else
|
|
129
|
+
self.state = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'disconnected_at')
|
|
133
|
+
self.disconnected_at = attributes[:'disconnected_at']
|
|
134
|
+
else
|
|
135
|
+
self.disconnected_at = nil
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
140
|
+
# @return Array for valid properties with the reasons
|
|
141
|
+
def list_invalid_properties
|
|
142
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
143
|
+
invalid_properties = Array.new
|
|
144
|
+
if @account.nil?
|
|
145
|
+
invalid_properties.push('invalid value for "account", account cannot be nil.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if @role.nil?
|
|
149
|
+
invalid_properties.push('invalid value for "role", role cannot be nil.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if @state.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
invalid_properties
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Check to see if the all the properties in the model are valid
|
|
160
|
+
# @return true if the model is valid
|
|
161
|
+
def valid?
|
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
163
|
+
return false if @account.nil?
|
|
164
|
+
return false if @role.nil?
|
|
165
|
+
role_validator = EnumAttributeValidator.new('String', ["owner", "cohost", "unknown"])
|
|
166
|
+
return false unless role_validator.valid?(@role)
|
|
167
|
+
return false if @state.nil?
|
|
168
|
+
state_validator = EnumAttributeValidator.new('String', ["connected", "disconnected", "never_connected"])
|
|
169
|
+
return false unless state_validator.valid?(@state)
|
|
170
|
+
true
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] account Value to be assigned
|
|
175
|
+
def account=(account)
|
|
176
|
+
if account.nil?
|
|
177
|
+
fail ArgumentError, 'account cannot be nil'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
@account = account
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
184
|
+
# @param [Object] role Object to be assigned
|
|
185
|
+
def role=(role)
|
|
186
|
+
validator = EnumAttributeValidator.new('String', ["owner", "cohost", "unknown"])
|
|
187
|
+
unless validator.valid?(role)
|
|
188
|
+
fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
|
|
189
|
+
end
|
|
190
|
+
@role = role
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
194
|
+
# @param [Object] state Object to be assigned
|
|
195
|
+
def state=(state)
|
|
196
|
+
validator = EnumAttributeValidator.new('String', ["connected", "disconnected", "never_connected"])
|
|
197
|
+
unless validator.valid?(state)
|
|
198
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
|
199
|
+
end
|
|
200
|
+
@state = state
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Checks equality by comparing each attribute.
|
|
204
|
+
# @param [Object] Object to be compared
|
|
205
|
+
def ==(o)
|
|
206
|
+
return true if self.equal?(o)
|
|
207
|
+
self.class == o.class &&
|
|
208
|
+
account == o.account &&
|
|
209
|
+
name == o.name &&
|
|
210
|
+
role == o.role &&
|
|
211
|
+
state == o.state &&
|
|
212
|
+
disconnected_at == o.disconnected_at
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# @see the `==` method
|
|
216
|
+
# @param [Object] Object to be compared
|
|
217
|
+
def eql?(o)
|
|
218
|
+
self == o
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Calculates hash code according to all attributes.
|
|
222
|
+
# @return [Integer] Hash code
|
|
223
|
+
def hash
|
|
224
|
+
[account, name, role, state, disconnected_at].hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Builds the object from hash
|
|
228
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
229
|
+
# @return [Object] Returns the model itself
|
|
230
|
+
def self.build_from_hash(attributes)
|
|
231
|
+
return nil unless attributes.is_a?(Hash)
|
|
232
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
233
|
+
transformed_hash = {}
|
|
234
|
+
openapi_types.each_pair do |key, type|
|
|
235
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
236
|
+
transformed_hash["#{key}"] = nil
|
|
237
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
238
|
+
# check to ensure the input is an array given that the attribute
|
|
239
|
+
# is documented as an array but the input is not
|
|
240
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
241
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
242
|
+
end
|
|
243
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
244
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
new(transformed_hash)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Returns the object in the form of hash
|
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
|
252
|
+
def to_hash
|
|
253
|
+
hash = {}
|
|
254
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
255
|
+
value = self.send(attr)
|
|
256
|
+
if value.nil?
|
|
257
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
258
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
hash[param] = _to_hash(value)
|
|
262
|
+
end
|
|
263
|
+
hash
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
end
|
|
@@ -16,9 +16,12 @@ require 'time'
|
|
|
16
16
|
module Repull
|
|
17
17
|
# Channel-agnostic message thread between the host workspace and a guest. Returned by `GET /v1/conversations`. The `id` is the internal Repull thread id (integer) — pass it back as the `{id}` path param on detail / messages calls.
|
|
18
18
|
class Conversation < ApiModelBase
|
|
19
|
-
# The connected account this conversation belongs to.
|
|
19
|
+
# The connected account this conversation belongs to, the same block as the message webhooks. On the list and on `GET /v1/conversations/{id}`.
|
|
20
20
|
attr_accessor :account
|
|
21
21
|
|
|
22
|
+
# Airbnb conversations, on `GET /v1/conversations/{id}`: every account on the listing (owner and co-hosts) with its state, and `defaultAccount` — the one a send uses when `account` is not given. Pass any connected one as `account` on `POST /v1/conversations/{id}/messages` to send as it.
|
|
23
|
+
attr_accessor :airbnb_access
|
|
24
|
+
|
|
22
25
|
attr_accessor :id
|
|
23
26
|
|
|
24
27
|
attr_accessor :platform
|
|
@@ -53,6 +56,7 @@ module Repull
|
|
|
53
56
|
def self.attribute_map
|
|
54
57
|
{
|
|
55
58
|
:'account' => :'account',
|
|
59
|
+
:'airbnb_access' => :'airbnbAccess',
|
|
56
60
|
:'id' => :'id',
|
|
57
61
|
:'platform' => :'platform',
|
|
58
62
|
:'external_thread_id' => :'externalThreadId',
|
|
@@ -83,6 +87,7 @@ module Repull
|
|
|
83
87
|
def self.openapi_types
|
|
84
88
|
{
|
|
85
89
|
:'account' => :'RecordAccount',
|
|
90
|
+
:'airbnb_access' => :'AirbnbAccess',
|
|
86
91
|
:'id' => :'String',
|
|
87
92
|
:'platform' => :'String',
|
|
88
93
|
:'external_thread_id' => :'String',
|
|
@@ -103,6 +108,7 @@ module Repull
|
|
|
103
108
|
def self.openapi_nullable
|
|
104
109
|
Set.new([
|
|
105
110
|
:'account',
|
|
111
|
+
:'airbnb_access',
|
|
106
112
|
:'platform',
|
|
107
113
|
:'external_thread_id',
|
|
108
114
|
:'guest_id',
|
|
@@ -134,6 +140,10 @@ module Repull
|
|
|
134
140
|
self.account = attributes[:'account']
|
|
135
141
|
end
|
|
136
142
|
|
|
143
|
+
if attributes.key?(:'airbnb_access')
|
|
144
|
+
self.airbnb_access = attributes[:'airbnb_access']
|
|
145
|
+
end
|
|
146
|
+
|
|
137
147
|
if attributes.key?(:'id')
|
|
138
148
|
self.id = attributes[:'id']
|
|
139
149
|
end
|
|
@@ -208,6 +218,7 @@ module Repull
|
|
|
208
218
|
return true if self.equal?(o)
|
|
209
219
|
self.class == o.class &&
|
|
210
220
|
account == o.account &&
|
|
221
|
+
airbnb_access == o.airbnb_access &&
|
|
211
222
|
id == o.id &&
|
|
212
223
|
platform == o.platform &&
|
|
213
224
|
external_thread_id == o.external_thread_id &&
|
|
@@ -232,7 +243,7 @@ module Repull
|
|
|
232
243
|
# Calculates hash code according to all attributes.
|
|
233
244
|
# @return [Integer] Hash code
|
|
234
245
|
def hash
|
|
235
|
-
[account, id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at].hash
|
|
246
|
+
[account, airbnb_access, id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at].hash
|
|
236
247
|
end
|
|
237
248
|
|
|
238
249
|
# Builds the object from hash
|
|
@@ -16,9 +16,12 @@ require 'time'
|
|
|
16
16
|
module Repull
|
|
17
17
|
# Returned by `GET /v1/conversations/{id}`. Extends the list-row `Conversation` shape with expanded `host` + `guest` blocks so SDK consumers can render thread headers without an extra round-trip.
|
|
18
18
|
class ConversationDetail < ApiModelBase
|
|
19
|
-
# The connected account this conversation belongs to.
|
|
19
|
+
# The connected account this conversation belongs to, the same block as the message webhooks. On the list and on `GET /v1/conversations/{id}`.
|
|
20
20
|
attr_accessor :account
|
|
21
21
|
|
|
22
|
+
# Airbnb conversations, on `GET /v1/conversations/{id}`: every account on the listing (owner and co-hosts) with its state, and `defaultAccount` — the one a send uses when `account` is not given. Pass any connected one as `account` on `POST /v1/conversations/{id}/messages` to send as it.
|
|
23
|
+
attr_accessor :airbnb_access
|
|
24
|
+
|
|
22
25
|
attr_accessor :id
|
|
23
26
|
|
|
24
27
|
attr_accessor :platform
|
|
@@ -59,6 +62,7 @@ module Repull
|
|
|
59
62
|
def self.attribute_map
|
|
60
63
|
{
|
|
61
64
|
:'account' => :'account',
|
|
65
|
+
:'airbnb_access' => :'airbnbAccess',
|
|
62
66
|
:'id' => :'id',
|
|
63
67
|
:'platform' => :'platform',
|
|
64
68
|
:'external_thread_id' => :'externalThreadId',
|
|
@@ -92,6 +96,7 @@ module Repull
|
|
|
92
96
|
def self.openapi_types
|
|
93
97
|
{
|
|
94
98
|
:'account' => :'RecordAccount',
|
|
99
|
+
:'airbnb_access' => :'AirbnbAccess',
|
|
95
100
|
:'id' => :'String',
|
|
96
101
|
:'platform' => :'String',
|
|
97
102
|
:'external_thread_id' => :'String',
|
|
@@ -115,6 +120,7 @@ module Repull
|
|
|
115
120
|
def self.openapi_nullable
|
|
116
121
|
Set.new([
|
|
117
122
|
:'account',
|
|
123
|
+
:'airbnb_access',
|
|
118
124
|
:'platform',
|
|
119
125
|
:'external_thread_id',
|
|
120
126
|
:'guest_id',
|
|
@@ -155,6 +161,10 @@ module Repull
|
|
|
155
161
|
self.account = attributes[:'account']
|
|
156
162
|
end
|
|
157
163
|
|
|
164
|
+
if attributes.key?(:'airbnb_access')
|
|
165
|
+
self.airbnb_access = attributes[:'airbnb_access']
|
|
166
|
+
end
|
|
167
|
+
|
|
158
168
|
if attributes.key?(:'id')
|
|
159
169
|
self.id = attributes[:'id']
|
|
160
170
|
end
|
|
@@ -241,6 +251,7 @@ module Repull
|
|
|
241
251
|
return true if self.equal?(o)
|
|
242
252
|
self.class == o.class &&
|
|
243
253
|
account == o.account &&
|
|
254
|
+
airbnb_access == o.airbnb_access &&
|
|
244
255
|
id == o.id &&
|
|
245
256
|
platform == o.platform &&
|
|
246
257
|
external_thread_id == o.external_thread_id &&
|
|
@@ -268,7 +279,7 @@ module Repull
|
|
|
268
279
|
# Calculates hash code according to all attributes.
|
|
269
280
|
# @return [Integer] Hash code
|
|
270
281
|
def hash
|
|
271
|
-
[account, id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at, host, guest, capabilities].hash
|
|
282
|
+
[account, airbnb_access, id, platform, external_thread_id, guest_id, listing_id, reservation_id, subject, last_message_at, last_message_preview, unread_count, status, created_at, updated_at, host, guest, capabilities].hash
|
|
272
283
|
end
|
|
273
284
|
|
|
274
285
|
# Builds the object from hash
|
|
@@ -42,6 +42,12 @@ module Repull
|
|
|
42
42
|
|
|
43
43
|
attr_accessor :address
|
|
44
44
|
|
|
45
|
+
# `GET /v1/listings/{id}` only. Map pin latitude in decimal degrees, as a string; the same value as `GET /v1/properties/{id}`. Null when the listing has no coordinates.
|
|
46
|
+
attr_accessor :latitude
|
|
47
|
+
|
|
48
|
+
# `GET /v1/listings/{id}` only. Map pin longitude in decimal degrees, as a string; the same value as `GET /v1/properties/{id}`. Null when the listing has no coordinates.
|
|
49
|
+
attr_accessor :longitude
|
|
50
|
+
|
|
45
51
|
# Cover photo URL. Always present on an active listing. On an **inactive** one it is present only when the caller passes `?include=thumbnail`; `null` means the listing has no cover photo stored, absent means the expansion was not requested.
|
|
46
52
|
attr_accessor :thumbnail_url
|
|
47
53
|
|
|
@@ -50,6 +56,9 @@ module Repull
|
|
|
50
56
|
# Channels (Airbnb, Booking, VRBO, etc.) the listing is connected to.
|
|
51
57
|
attr_accessor :channels
|
|
52
58
|
|
|
59
|
+
# Airbnb listings: every account on the listing (owner and co-hosts), whether each is connected, and which one acts by default. `defaultAccount: null` means no connected account can reach the listing — connect one of `accounts`.
|
|
60
|
+
attr_accessor :airbnb_access
|
|
61
|
+
|
|
53
62
|
# Amenity rows for the listing. **Only present when the caller passes `?include=amenities`.** Empty array (`[]`) when the listing has no amenity rows.
|
|
54
63
|
attr_accessor :amenities
|
|
55
64
|
|
|
@@ -97,9 +106,12 @@ module Repull
|
|
|
97
106
|
:'name' => :'name',
|
|
98
107
|
:'public_name' => :'publicName',
|
|
99
108
|
:'address' => :'address',
|
|
109
|
+
:'latitude' => :'latitude',
|
|
110
|
+
:'longitude' => :'longitude',
|
|
100
111
|
:'thumbnail_url' => :'thumbnailUrl',
|
|
101
112
|
:'status' => :'status',
|
|
102
113
|
:'channels' => :'channels',
|
|
114
|
+
:'airbnb_access' => :'airbnbAccess',
|
|
103
115
|
:'amenities' => :'amenities',
|
|
104
116
|
:'content' => :'content',
|
|
105
117
|
:'details' => :'details',
|
|
@@ -138,9 +150,12 @@ module Repull
|
|
|
138
150
|
:'name' => :'String',
|
|
139
151
|
:'public_name' => :'String',
|
|
140
152
|
:'address' => :'ListingAddress',
|
|
153
|
+
:'latitude' => :'String',
|
|
154
|
+
:'longitude' => :'String',
|
|
141
155
|
:'thumbnail_url' => :'String',
|
|
142
156
|
:'status' => :'String',
|
|
143
157
|
:'channels' => :'Array<ListingChannel>',
|
|
158
|
+
:'airbnb_access' => :'AirbnbAccess',
|
|
144
159
|
:'amenities' => :'Array<ListingAmenity>',
|
|
145
160
|
:'content' => :'ListingContent',
|
|
146
161
|
:'details' => :'ListingDetails',
|
|
@@ -162,6 +177,8 @@ module Repull
|
|
|
162
177
|
:'parent',
|
|
163
178
|
:'hotel',
|
|
164
179
|
:'public_name',
|
|
180
|
+
:'latitude',
|
|
181
|
+
:'longitude',
|
|
165
182
|
:'thumbnail_url',
|
|
166
183
|
:'content',
|
|
167
184
|
:'details',
|
|
@@ -229,6 +246,14 @@ module Repull
|
|
|
229
246
|
self.address = attributes[:'address']
|
|
230
247
|
end
|
|
231
248
|
|
|
249
|
+
if attributes.key?(:'latitude')
|
|
250
|
+
self.latitude = attributes[:'latitude']
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
if attributes.key?(:'longitude')
|
|
254
|
+
self.longitude = attributes[:'longitude']
|
|
255
|
+
end
|
|
256
|
+
|
|
232
257
|
if attributes.key?(:'thumbnail_url')
|
|
233
258
|
self.thumbnail_url = attributes[:'thumbnail_url']
|
|
234
259
|
end
|
|
@@ -243,6 +268,10 @@ module Repull
|
|
|
243
268
|
end
|
|
244
269
|
end
|
|
245
270
|
|
|
271
|
+
if attributes.key?(:'airbnb_access')
|
|
272
|
+
self.airbnb_access = attributes[:'airbnb_access']
|
|
273
|
+
end
|
|
274
|
+
|
|
246
275
|
if attributes.key?(:'amenities')
|
|
247
276
|
if (value = attributes[:'amenities']).is_a?(Array)
|
|
248
277
|
self.amenities = value
|
|
@@ -351,9 +380,12 @@ module Repull
|
|
|
351
380
|
name == o.name &&
|
|
352
381
|
public_name == o.public_name &&
|
|
353
382
|
address == o.address &&
|
|
383
|
+
latitude == o.latitude &&
|
|
384
|
+
longitude == o.longitude &&
|
|
354
385
|
thumbnail_url == o.thumbnail_url &&
|
|
355
386
|
status == o.status &&
|
|
356
387
|
channels == o.channels &&
|
|
388
|
+
airbnb_access == o.airbnb_access &&
|
|
357
389
|
amenities == o.amenities &&
|
|
358
390
|
content == o.content &&
|
|
359
391
|
details == o.details &&
|
|
@@ -377,7 +409,7 @@ module Repull
|
|
|
377
409
|
# Calculates hash code according to all attributes.
|
|
378
410
|
# @return [Integer] Hash code
|
|
379
411
|
def hash
|
|
380
|
-
[capabilities, kind, parent, hotel, unit_count, units, id, name, public_name, address, thumbnail_url, status, channels, amenities, content, details, rooms, policies, rules, pricing, fees, taxes, photos, created_at, updated_at].hash
|
|
412
|
+
[capabilities, kind, parent, hotel, unit_count, units, id, name, public_name, address, latitude, longitude, thumbnail_url, status, channels, airbnb_access, amenities, content, details, rooms, policies, rules, pricing, fees, taxes, photos, created_at, updated_at].hash
|
|
381
413
|
end
|
|
382
414
|
|
|
383
415
|
# Builds the object from hash
|
|
@@ -22,6 +22,9 @@ module Repull
|
|
|
22
22
|
# Force a channel. Omit to send on whichever channel the conversation already uses, which is the right default. One of `airbnb`, `booking`, `vrbo`, `sms`, `email`, `website` — except on a conversation a connected PMS relays (Guesty, Hostaway, …), where the message is sent through the PMS and `channel` is passed to it: the PMS's own channel/module name (Guesty `airbnb2`, `bookingCom`, `email`, `sms`, …) or one of Repull's names, which the PMS maps. A PMS that cannot choose a channel returns `422 pms_write_unsupported`; `GET /v1/connect/{provider}` → `capabilities.pms.conversations.channelSelect` says so beforehand.
|
|
23
23
|
attr_accessor :channel
|
|
24
24
|
|
|
25
|
+
# Airbnb conversations: send as exactly this connected account — the listing's owner or one of its co-hosts — e.g. your team co-host. Never swapped for another account: if it is disconnected or not on the listing, nothing is sent and the error says why. Omit it and the conversation's own account sends while it is connected, otherwise the listing's owner, otherwise a connected co-host. Connected accounts are on `GET /v1/connect`.
|
|
26
|
+
attr_accessor :account
|
|
27
|
+
|
|
25
28
|
# Files to send. See the per-channel table above. On a conversation a connected PMS relays, files go through the PMS — `422 pms_write_unsupported` when its API cannot send them (`capabilities.pms.conversations.attachments` on `GET /v1/connect/{provider}`).
|
|
26
29
|
attr_accessor :attachments
|
|
27
30
|
|
|
@@ -30,6 +33,7 @@ module Repull
|
|
|
30
33
|
{
|
|
31
34
|
:'message' => :'message',
|
|
32
35
|
:'channel' => :'channel',
|
|
36
|
+
:'account' => :'account',
|
|
33
37
|
:'attachments' => :'attachments'
|
|
34
38
|
}
|
|
35
39
|
end
|
|
@@ -49,6 +53,7 @@ module Repull
|
|
|
49
53
|
{
|
|
50
54
|
:'message' => :'String',
|
|
51
55
|
:'channel' => :'String',
|
|
56
|
+
:'account' => :'String',
|
|
52
57
|
:'attachments' => :'Array<SendMessageAttachment>'
|
|
53
58
|
}
|
|
54
59
|
end
|
|
@@ -83,6 +88,10 @@ module Repull
|
|
|
83
88
|
self.channel = attributes[:'channel']
|
|
84
89
|
end
|
|
85
90
|
|
|
91
|
+
if attributes.key?(:'account')
|
|
92
|
+
self.account = attributes[:'account']
|
|
93
|
+
end
|
|
94
|
+
|
|
86
95
|
if attributes.key?(:'attachments')
|
|
87
96
|
if (value = attributes[:'attachments']).is_a?(Array)
|
|
88
97
|
self.attachments = value
|
|
@@ -99,6 +108,11 @@ module Repull
|
|
|
99
108
|
invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 4000.')
|
|
100
109
|
end
|
|
101
110
|
|
|
111
|
+
pattern = Regexp.new(/^airbnb:\d+$/)
|
|
112
|
+
if !@account.nil? && @account !~ pattern
|
|
113
|
+
invalid_properties.push("invalid value for \"account\", must conform to the pattern #{pattern}.")
|
|
114
|
+
end
|
|
115
|
+
|
|
102
116
|
if !@attachments.nil? && @attachments.length > 5
|
|
103
117
|
invalid_properties.push('invalid value for "attachments", number of items must be less than or equal to 5.')
|
|
104
118
|
end
|
|
@@ -115,6 +129,7 @@ module Repull
|
|
|
115
129
|
def valid?
|
|
116
130
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
131
|
return false if !@message.nil? && @message.to_s.length > 4000
|
|
132
|
+
return false if !@account.nil? && @account !~ Regexp.new(/^airbnb:\d+$/)
|
|
118
133
|
return false if !@attachments.nil? && @attachments.length > 5
|
|
119
134
|
return false if !@attachments.nil? && @attachments.length < 1
|
|
120
135
|
true
|
|
@@ -134,6 +149,21 @@ module Repull
|
|
|
134
149
|
@message = message
|
|
135
150
|
end
|
|
136
151
|
|
|
152
|
+
# Custom attribute writer method with validation
|
|
153
|
+
# @param [Object] account Value to be assigned
|
|
154
|
+
def account=(account)
|
|
155
|
+
if account.nil?
|
|
156
|
+
fail ArgumentError, 'account cannot be nil'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
pattern = Regexp.new(/^airbnb:\d+$/)
|
|
160
|
+
if account !~ pattern
|
|
161
|
+
fail ArgumentError, "invalid value for \"account\", must conform to the pattern #{pattern}."
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
@account = account
|
|
165
|
+
end
|
|
166
|
+
|
|
137
167
|
# Custom attribute writer method with validation
|
|
138
168
|
# @param [Object] attachments Value to be assigned
|
|
139
169
|
def attachments=(attachments)
|
|
@@ -159,6 +189,7 @@ module Repull
|
|
|
159
189
|
self.class == o.class &&
|
|
160
190
|
message == o.message &&
|
|
161
191
|
channel == o.channel &&
|
|
192
|
+
account == o.account &&
|
|
162
193
|
attachments == o.attachments
|
|
163
194
|
end
|
|
164
195
|
|
|
@@ -171,7 +202,7 @@ module Repull
|
|
|
171
202
|
# Calculates hash code according to all attributes.
|
|
172
203
|
# @return [Integer] Hash code
|
|
173
204
|
def hash
|
|
174
|
-
[message, channel, attachments].hash
|
|
205
|
+
[message, channel, account, attachments].hash
|
|
175
206
|
end
|
|
176
207
|
|
|
177
208
|
# Builds the object from hash
|
data/lib/repull/version.rb
CHANGED
data/lib/repull.rb
CHANGED
|
@@ -39,6 +39,8 @@ require 'repull/models/ai_operation_completed_payload'
|
|
|
39
39
|
require 'repull/models/ai_operation_failed_event'
|
|
40
40
|
require 'repull/models/ai_operation_failed_payload'
|
|
41
41
|
require 'repull/models/ai_operation_failed_payload_error'
|
|
42
|
+
require 'repull/models/airbnb_access'
|
|
43
|
+
require 'repull/models/airbnb_access_accounts_inner'
|
|
42
44
|
require 'repull/models/airbnb_account_freshness'
|
|
43
45
|
require 'repull/models/airbnb_alteration'
|
|
44
46
|
require 'repull/models/airbnb_alteration_create_request'
|
data/openapi/v1.json
CHANGED
|
@@ -1233,7 +1233,16 @@
|
|
|
1233
1233
|
"$ref": "#/components/schemas/RecordAccount"
|
|
1234
1234
|
}
|
|
1235
1235
|
],
|
|
1236
|
-
"description": "The connected account this conversation belongs to.
|
|
1236
|
+
"description": "The connected account this conversation belongs to, the same block as the message webhooks. On the list and on `GET /v1/conversations/{id}`."
|
|
1237
|
+
},
|
|
1238
|
+
"airbnbAccess": {
|
|
1239
|
+
"allOf": [
|
|
1240
|
+
{
|
|
1241
|
+
"$ref": "#/components/schemas/AirbnbAccess"
|
|
1242
|
+
}
|
|
1243
|
+
],
|
|
1244
|
+
"nullable": true,
|
|
1245
|
+
"description": "Airbnb conversations, on `GET /v1/conversations/{id}`: every account on the listing (owner and co-hosts) with its state, and `defaultAccount` \u2014 the one a send uses when `account` is not given. Pass any connected one as `account` on `POST /v1/conversations/{id}/messages` to send as it."
|
|
1237
1246
|
},
|
|
1238
1247
|
"id": {
|
|
1239
1248
|
"type": "string"
|
|
@@ -4391,6 +4400,68 @@
|
|
|
4391
4400
|
}
|
|
4392
4401
|
}
|
|
4393
4402
|
},
|
|
4403
|
+
"AirbnbAccess": {
|
|
4404
|
+
"type": "object",
|
|
4405
|
+
"required": [
|
|
4406
|
+
"defaultAccount",
|
|
4407
|
+
"accounts"
|
|
4408
|
+
],
|
|
4409
|
+
"properties": {
|
|
4410
|
+
"defaultAccount": {
|
|
4411
|
+
"type": "string",
|
|
4412
|
+
"nullable": true,
|
|
4413
|
+
"example": "airbnb:483175841",
|
|
4414
|
+
"description": "The account that acts when none is named: the conversation's own account while connected, else the listing's owner, else a connected co-host. Null when none is connected."
|
|
4415
|
+
},
|
|
4416
|
+
"accounts": {
|
|
4417
|
+
"type": "array",
|
|
4418
|
+
"items": {
|
|
4419
|
+
"type": "object",
|
|
4420
|
+
"required": [
|
|
4421
|
+
"account",
|
|
4422
|
+
"name",
|
|
4423
|
+
"role",
|
|
4424
|
+
"state",
|
|
4425
|
+
"disconnectedAt"
|
|
4426
|
+
],
|
|
4427
|
+
"properties": {
|
|
4428
|
+
"account": {
|
|
4429
|
+
"type": "string",
|
|
4430
|
+
"example": "airbnb:228981432",
|
|
4431
|
+
"description": "What `account` on a send takes."
|
|
4432
|
+
},
|
|
4433
|
+
"name": {
|
|
4434
|
+
"type": "string",
|
|
4435
|
+
"nullable": true,
|
|
4436
|
+
"example": "Team Co-Host"
|
|
4437
|
+
},
|
|
4438
|
+
"role": {
|
|
4439
|
+
"type": "string",
|
|
4440
|
+
"enum": [
|
|
4441
|
+
"owner",
|
|
4442
|
+
"cohost",
|
|
4443
|
+
"unknown"
|
|
4444
|
+
]
|
|
4445
|
+
},
|
|
4446
|
+
"state": {
|
|
4447
|
+
"type": "string",
|
|
4448
|
+
"enum": [
|
|
4449
|
+
"connected",
|
|
4450
|
+
"disconnected",
|
|
4451
|
+
"never_connected"
|
|
4452
|
+
],
|
|
4453
|
+
"description": "`connected` can act now; `disconnected` was connected to this workspace; `never_connected` is on the listing but was never connected here."
|
|
4454
|
+
},
|
|
4455
|
+
"disconnectedAt": {
|
|
4456
|
+
"type": "string",
|
|
4457
|
+
"format": "date-time",
|
|
4458
|
+
"nullable": true
|
|
4459
|
+
}
|
|
4460
|
+
}
|
|
4461
|
+
}
|
|
4462
|
+
}
|
|
4463
|
+
}
|
|
4464
|
+
},
|
|
4394
4465
|
"RecordAccount": {
|
|
4395
4466
|
"type": "object",
|
|
4396
4467
|
"nullable": true,
|
|
@@ -10482,6 +10553,18 @@
|
|
|
10482
10553
|
}
|
|
10483
10554
|
}
|
|
10484
10555
|
},
|
|
10556
|
+
"latitude": {
|
|
10557
|
+
"type": "string",
|
|
10558
|
+
"nullable": true,
|
|
10559
|
+
"description": "`GET /v1/listings/{id}` only. Map pin latitude in decimal degrees, as a string; the same value as `GET /v1/properties/{id}`. Null when the listing has no coordinates.",
|
|
10560
|
+
"example": "25.7617"
|
|
10561
|
+
},
|
|
10562
|
+
"longitude": {
|
|
10563
|
+
"type": "string",
|
|
10564
|
+
"nullable": true,
|
|
10565
|
+
"description": "`GET /v1/listings/{id}` only. Map pin longitude in decimal degrees, as a string; the same value as `GET /v1/properties/{id}`. Null when the listing has no coordinates.",
|
|
10566
|
+
"example": "-80.1918"
|
|
10567
|
+
},
|
|
10485
10568
|
"thumbnailUrl": {
|
|
10486
10569
|
"type": "string",
|
|
10487
10570
|
"format": "uri",
|
|
@@ -10498,6 +10581,14 @@
|
|
|
10498
10581
|
},
|
|
10499
10582
|
"description": "Channels (Airbnb, Booking, VRBO, etc.) the listing is connected to."
|
|
10500
10583
|
},
|
|
10584
|
+
"airbnbAccess": {
|
|
10585
|
+
"allOf": [
|
|
10586
|
+
{
|
|
10587
|
+
"$ref": "#/components/schemas/AirbnbAccess"
|
|
10588
|
+
}
|
|
10589
|
+
],
|
|
10590
|
+
"description": "Airbnb listings: every account on the listing (owner and co-hosts), whether each is connected, and which one acts by default. `defaultAccount: null` means no connected account can reach the listing \u2014 connect one of `accounts`."
|
|
10591
|
+
},
|
|
10501
10592
|
"amenities": {
|
|
10502
10593
|
"type": "array",
|
|
10503
10594
|
"items": {
|
|
@@ -14464,6 +14555,12 @@
|
|
|
14464
14555
|
"example": "email",
|
|
14465
14556
|
"description": "Force a channel. Omit to send on whichever channel the conversation already uses, which is the right default. One of `airbnb`, `booking`, `vrbo`, `sms`, `email`, `website` \u2014 except on a conversation a connected PMS relays (Guesty, Hostaway, \u2026), where the message is sent through the PMS and `channel` is passed to it: the PMS's own channel/module name (Guesty `airbnb2`, `bookingCom`, `email`, `sms`, \u2026) or one of Repull's names, which the PMS maps. A PMS that cannot choose a channel returns `422 pms_write_unsupported`; `GET /v1/connect/{provider}` \u2192 `capabilities.pms.conversations.channelSelect` says so beforehand."
|
|
14466
14557
|
},
|
|
14558
|
+
"account": {
|
|
14559
|
+
"type": "string",
|
|
14560
|
+
"pattern": "^airbnb:\\d+$",
|
|
14561
|
+
"example": "airbnb:483175841",
|
|
14562
|
+
"description": "Airbnb conversations: send as exactly this connected account \u2014 the listing's owner or one of its co-hosts \u2014 e.g. your team co-host. Never swapped for another account: if it is disconnected or not on the listing, nothing is sent and the error says why. Omit it and the conversation's own account sends while it is connected, otherwise the listing's owner, otherwise a connected co-host. Connected accounts are on `GET /v1/connect`."
|
|
14563
|
+
},
|
|
14467
14564
|
"attachments": {
|
|
14468
14565
|
"type": "array",
|
|
14469
14566
|
"minItems": 1,
|
|
@@ -18602,7 +18699,7 @@
|
|
|
18602
18699
|
"post": {
|
|
18603
18700
|
"operationId": "send_conversation_message",
|
|
18604
18701
|
"summary": "Send a message to the guest",
|
|
18605
|
-
"description": "Sends a message to the guest on this conversation and records it in the thread.\n\nOmit `channel` and the message goes out on whichever channel the conversation already uses (Airbnb, Booking.com, VRBO, SMS, email or the direct-booking site) \u2014 that is the right default. Pass `channel` only to force a specific one.\n\nThe message is attributed to the API: it is recorded with `aiGenerated` false so an API send is never counted as an automated reply.\n\n### Airbnb rewrites links \u2014 check `contentRewritten`\n\nAirbnb 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.\n\nWhen 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`.\n\nSend `Idempotency-Key` \u2014 without it, retrying after a network timeout sends the guest the same message twice.\n\n### Attachments\n\nSend files with `attachments: [{ url, contentType?, filename? }]` \u2014 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.\n\n| Channel | Accepted types | Text | How it arrives |\n|---|---|---|---|\n| Airbnb | JPEG, PNG, GIF, WebP (converted to JPEG), MP4, QuickTime | optional | each file as its own message, then the text as a separate message |\n| Booking.com | JPEG, PNG | **required** | one message carrying the text and every file |\n| VRBO, SMS, email, direct-booking site chat | \u2014 | \u2014 | `422 attachments_not_supported`, nothing sent |\n\nAirbnb 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 \u2014 that returns `422 message_partially_sent` with `parts` saying exactly which messages reached the guest; resend only the rest.\n\nThe 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`.\n\n**Inactive listings:** a conversation that belongs to an inactive listing returns `403 listing_inactive` and no message is sent. Activate the listing first.",
|
|
18702
|
+
"description": "Sends a message to the guest on this conversation and records it in the thread.\n\nOmit `channel` and the message goes out on whichever channel the conversation already uses (Airbnb, Booking.com, VRBO, SMS, email or the direct-booking site) \u2014 that is the right default. Pass `channel` only to force a specific one.\n\nThe message is attributed to the API: it is recorded with `aiGenerated` false so an API send is never counted as an automated reply.\n\n### Airbnb rewrites links \u2014 check `contentRewritten`\n\nAirbnb 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.\n\nWhen 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`. `message_not_sent` only ever means the channel refused: a fault on Repull's side (a dropped database connection, a timeout) is `503 internal_error` with `sent: false` when nothing was delivered \u2014 retry it unchanged with the same `Idempotency-Key`.\n\nSend `Idempotency-Key` \u2014 without it, retrying after a network timeout sends the guest the same message twice.\n\n### Attachments\n\nSend files with `attachments: [{ url, contentType?, filename? }]` \u2014 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.\n\n| Channel | Accepted types | Text | How it arrives |\n|---|---|---|---|\n| Airbnb | JPEG, PNG, GIF, WebP (converted to JPEG), MP4, QuickTime | optional | each file as its own message, then the text as a separate message |\n| Booking.com | JPEG, PNG | **required** | one message carrying the text and every file |\n| VRBO, SMS, email, direct-booking site chat | \u2014 | \u2014 | `422 attachments_not_supported`, nothing sent |\n\nAirbnb 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 \u2014 that returns `422 message_partially_sent` with `parts` saying exactly which messages reached the guest; resend only the rest.\n\nThe 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`.\n\n**Inactive listings:** a conversation that belongs to an inactive listing returns `403 listing_inactive` and no message is sent. Activate the listing first.",
|
|
18606
18703
|
"tags": [
|
|
18607
18704
|
"Conversations"
|
|
18608
18705
|
],
|
|
@@ -18723,7 +18820,7 @@
|
|
|
18723
18820
|
"$ref": "#/components/responses/Unauthorized"
|
|
18724
18821
|
},
|
|
18725
18822
|
"403": {
|
|
18726
|
-
"description": "`listing_inactive` \u2014 the conversation belongs to an inactive listing, so nothing was sent. The error names the listing.",
|
|
18823
|
+
"description": "`listing_inactive` \u2014 the conversation belongs to an inactive listing, so nothing was sent. The error names the listing. `connection_reauth_required` \u2014 no connected account can send on this conversation (`reconnectRequired: true`); nothing was sent and the text was not refused. On Airbnb the message names each account on the listing \u2014 owner and co-hosts \u2014 and its state (e.g. `Team Co-Host (228981432), co-host, was disconnected on 2026-09-30`). Connect one of them via `POST /v1/connect/{provider}`, or send as another connected account with `account`, then send again.",
|
|
18727
18824
|
"content": {
|
|
18728
18825
|
"application/json": {
|
|
18729
18826
|
"schema": {
|
|
@@ -18760,7 +18857,7 @@
|
|
|
18760
18857
|
}
|
|
18761
18858
|
},
|
|
18762
18859
|
"422": {
|
|
18763
|
-
"description": "Nothing was sent unless the code is `message_partially_sent`. Codes: `invalid_params` (malformed body, field named), `message_not_sent` (the channel refused \u2014 `statusReason` has its words), `attachments_not_supported`, `too_many_attachments`, `attachment_requires_message`, `attachment_url_not_allowed`, `attachment_unreachable`, `attachment_too_large`, `attachment_type_not_supported` (each names the file in `index`/`field` and the conversation's `channel`), and `message_partially_sent` (some channel messages were delivered \u2014 `parts` says which).",
|
|
18860
|
+
"description": "Nothing was sent unless the code is `message_partially_sent`. Codes: `invalid_params` (malformed body, field named), `message_not_sent` (the channel itself refused \u2014 `statusReason` has its words verbatim; a failure on Repull's side is never `message_not_sent`, it is `503 internal_error`), `attachments_not_supported`, `too_many_attachments`, `attachment_requires_message`, `attachment_url_not_allowed`, `attachment_unreachable`, `attachment_too_large`, `attachment_type_not_supported` (each names the file in `index`/`field` and the conversation's `channel`), and `message_partially_sent` (some channel messages were delivered \u2014 `parts` says which).",
|
|
18764
18861
|
"content": {
|
|
18765
18862
|
"application/json": {
|
|
18766
18863
|
"schema": {
|
|
@@ -18951,11 +19048,30 @@
|
|
|
18951
19048
|
}
|
|
18952
19049
|
},
|
|
18953
19050
|
"503": {
|
|
18954
|
-
"description": "
|
|
19051
|
+
"description": "A temporary fault on Repull's side \u2014 never a verdict on the message. `internal_error`: the send failed inside Repull (a dropped database connection, a timeout) before the channel refused anything. `sent` says whether the message reached the channel: with `messageId: null` and `sent: false` nothing was delivered or recorded, and retrying the same request with the same `Idempotency-Key` after `retry_after` seconds sends it once. With a `messageId`, check that message in `GET /v1/conversations/{id}/messages` before resending. `attachment_storage_failed`: a file could not be stored for delivery; nothing was sent, retry the same way. A 503 is never stored against the `Idempotency-Key`, so the retry runs for real. Do not edit the text: it was not refused.",
|
|
18955
19052
|
"content": {
|
|
18956
19053
|
"application/json": {
|
|
18957
19054
|
"schema": {
|
|
18958
19055
|
"$ref": "#/components/schemas/Error"
|
|
19056
|
+
},
|
|
19057
|
+
"examples": {
|
|
19058
|
+
"internalNotSent": {
|
|
19059
|
+
"summary": "Repull lost its database connection before the send reached Airbnb \u2014 not sent, retry with the same key",
|
|
19060
|
+
"value": {
|
|
19061
|
+
"error": {
|
|
19062
|
+
"code": "internal_error",
|
|
19063
|
+
"message": "The message was not sent: Repull hit a temporary fault on its side before the message reached Airbnb. Nothing was delivered to the guest and nothing was recorded in the conversation.",
|
|
19064
|
+
"fix": "Retry the same request with the same `Idempotency-Key` after `retry_after` seconds \u2014 this failure is not stored against the key, so the retry sends the message for real, once. Do not change the text: it was not refused.",
|
|
19065
|
+
"docs_url": "https://repull.dev/docs/errors/internal_error",
|
|
19066
|
+
"request_id": "req_01J5X7Y8Z9ABCDEF12345678",
|
|
19067
|
+
"retry_after": 5,
|
|
19068
|
+
"retryable": true,
|
|
19069
|
+
"sent": false,
|
|
19070
|
+
"channel": "airbnb",
|
|
19071
|
+
"messageId": null
|
|
19072
|
+
}
|
|
19073
|
+
}
|
|
19074
|
+
}
|
|
18959
19075
|
}
|
|
18960
19076
|
}
|
|
18961
19077
|
}
|
|
@@ -19197,7 +19313,7 @@
|
|
|
19197
19313
|
"get": {
|
|
19198
19314
|
"operationId": "list_connections",
|
|
19199
19315
|
"summary": "List PMS/OTA connections",
|
|
19200
|
-
"description": "Returns every PMS and OTA connection in the workspace, each with its `status`.\n\n**Spot connections that need attention.** A connection whose `status` is not `active` may need the host to do something before it works \u2014 most commonly a Booking.com Extranet connection where the invited user was granted only partial access (`status: \"needs_permissions\"`). A Smoobu connection still on a legacy single API key carries `action.reason: \"reauth_required\"` while its `status` is `active`: Smoobu stops accepting those keys on October 31, 2026, and `fixUrl` opens the form for a new API key + secret (the connection id stays the same). These connections carry two extra fields:\n\n- `action` \u2014 `{ required: true, reason, message }`. `reason` is a stable machine code (e.g. `needs_permissions`); `message` is a host-facing one-liner describing what to do.\n- `fixUrl` \u2014 a durable link that reopens the hosted Connect flow **bound to that account, on the fix screen** (e.g. \"grant full access\" + a Re-check button). It is safe to store and show in your own dashboard.\n\n**Self-serve repair:** when `action.required` is true, surface a \"Fix\" button that opens `fixUrl` in a new tab (or embed it). The host resolves the issue (e.g. grants the user full access in Booking.com) and clicks Re-check; the import finishes on its own and the connection flips back to `active` \u2014 no re-invite, no support ticket. Poll this endpoint (or read it after the host returns) to confirm `action` has cleared.",
|
|
19316
|
+
"description": "Returns every PMS and OTA connection in the workspace, each with its `status`.\n\n**One entry per Booking.com Extranet hotel login.** Each hotel that invites the Repull user connects as its own login, with its own `externalAccountId` (handle `booking_extranet:{externalAccountId}`). A new hotel adds an entry next to the existing ones and never replaces them; the entries share the workspace's Extranet `id`, and each hotel's listings, reservations, conversations and reviews stay under its own login (filter them with `?account=booking_extranet:{externalAccountId}`).\n\n**Spot connections that need attention.** A connection whose `status` is not `active` may need the host to do something before it works \u2014 most commonly a Booking.com Extranet connection where the invited user was granted only partial access (`status: \"needs_permissions\"`). A Smoobu connection still on a legacy single API key carries `action.reason: \"reauth_required\"` while its `status` is `active`: Smoobu stops accepting those keys on October 31, 2026, and `fixUrl` opens the form for a new API key + secret (the connection id stays the same). These connections carry two extra fields:\n\n- `action` \u2014 `{ required: true, reason, message }`. `reason` is a stable machine code (e.g. `needs_permissions`); `message` is a host-facing one-liner describing what to do.\n- `fixUrl` \u2014 a durable link that reopens the hosted Connect flow **bound to that account, on the fix screen** (e.g. \"grant full access\" + a Re-check button). It is safe to store and show in your own dashboard.\n\n**Self-serve repair:** when `action.required` is true, surface a \"Fix\" button that opens `fixUrl` in a new tab (or embed it). The host resolves the issue (e.g. grants the user full access in Booking.com) and clicks Re-check; the import finishes on its own and the connection flips back to `active` \u2014 no re-invite, no support ticket. Poll this endpoint (or read it after the host returns) to confirm `action` has cleared.",
|
|
19201
19317
|
"tags": [
|
|
19202
19318
|
"Connect"
|
|
19203
19319
|
],
|
|
@@ -22534,6 +22650,16 @@
|
|
|
22534
22650
|
},
|
|
22535
22651
|
"502": {
|
|
22536
22652
|
"$ref": "#/components/responses/AirbnbUpstreamError"
|
|
22653
|
+
},
|
|
22654
|
+
"503": {
|
|
22655
|
+
"description": "With `mediaUrl`: `internal_error` \u2014 the send failed on Repull's side (a dropped database connection, a timeout), not at Airbnb. With `sent: false` and `messageId: null` nothing reached the guest; retry the same request with the same `Idempotency-Key` after `retry_after` seconds. Never stored against the key. `message_not_sent` is reserved for Airbnb's own refusals.",
|
|
22656
|
+
"content": {
|
|
22657
|
+
"application/json": {
|
|
22658
|
+
"schema": {
|
|
22659
|
+
"$ref": "#/components/schemas/Error"
|
|
22660
|
+
}
|
|
22661
|
+
}
|
|
22662
|
+
}
|
|
22537
22663
|
}
|
|
22538
22664
|
}
|
|
22539
22665
|
}
|
data/scripts/regen.sh
CHANGED
|
@@ -73,7 +73,7 @@ npx --yes @openapitools/openapi-generator-cli@latest generate \
|
|
|
73
73
|
-i "$SPEC_PATH" \
|
|
74
74
|
-g ruby \
|
|
75
75
|
-o "$GEN_OUT" \
|
|
76
|
-
--additional-properties=gemName=repull,moduleName=Repull,gemVersion=0.2.
|
|
76
|
+
--additional-properties=gemName=repull,moduleName=Repull,gemVersion=0.2.41
|
|
77
77
|
|
|
78
78
|
echo "==> syncing lib/ + docs/"
|
|
79
79
|
rm -rf "$ROOT/lib/repull" "$ROOT/lib/repull.rb" "$ROOT/docs"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: repull
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.41
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ivan Nikolov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -119,6 +119,8 @@ files:
|
|
|
119
119
|
- lib/repull/models/ai_operation_failed_event.rb
|
|
120
120
|
- lib/repull/models/ai_operation_failed_payload.rb
|
|
121
121
|
- lib/repull/models/ai_operation_failed_payload_error.rb
|
|
122
|
+
- lib/repull/models/airbnb_access.rb
|
|
123
|
+
- lib/repull/models/airbnb_access_accounts_inner.rb
|
|
122
124
|
- lib/repull/models/airbnb_account_freshness.rb
|
|
123
125
|
- lib/repull/models/airbnb_alteration.rb
|
|
124
126
|
- lib/repull/models/airbnb_alteration_create_request.rb
|