repull 0.2.51 → 0.2.52
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/listings_api.rb +63 -0
- data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +14 -4
- data/lib/repull/models/auto_map_connection_units200_response.rb +1 -1
- data/lib/repull/models/auto_map_connection_units200_response_results_inner.rb +184 -0
- data/lib/repull/models/get_listing_ical200_response.rb +298 -0
- data/lib/repull/models/get_listing_ical200_response_vrbo_inner.rb +285 -0
- data/lib/repull/models/get_usage_logs200_response_data_inner.rb +12 -1
- data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -1
- data/lib/repull/models/listing_ical_feed_changed_event.rb +282 -0
- data/lib/repull/models/listing_ical_feed_changed_payload.rb +355 -0
- data/lib/repull/models/listing_ical_feed_changed_payload_feed.rb +159 -0
- data/lib/repull/models/webhook_event.rb +2 -0
- data/lib/repull/models/webhook_event_type.rb +2 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +6 -0
- data/openapi/v1.json +263 -1
- metadata +8 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f0e964efbc83f03b0e41dce233a06f00dbd89f017dcf6da7c635835f009b951
|
|
4
|
+
data.tar.gz: 97607d7f2eb6067a99ad49e0a041b81f52d69b3104d04cbfa6462ecec3599a0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a55e5e37b500a93bec9b879c840c609cfba1953a14dd111b4ac7ed92bf8645327c89f27638e521b68812b764e2c2fc63ccdd8c897214cd260adb5f08412b746
|
|
7
|
+
data.tar.gz: 070c1b67cfb7057fbd4e6c53db4b421eb0f139294be310ba2ea169ac7028c6be62ae6579356c8c7fdc750d1d7ddf2087bff7893dd22ac730e1bacb29ab3ef036
|
|
@@ -500,6 +500,69 @@ module Repull
|
|
|
500
500
|
return data, status_code, headers
|
|
501
501
|
end
|
|
502
502
|
|
|
503
|
+
# Repull iCal backup feed
|
|
504
|
+
# The listing's Repull iCal backup feed: an iCal calendar named \"Repull\" with the listing's bookings and blocks as all-day events, at an unguessable address on `api.repull.dev` (created on first request, one per listing). Channels that import iCal close those nights from it on their own schedule — availability only, never prices. **Vrbo:** Repull imports this feed into every calendar-synced Vrbo unit by itself, as a backup for the direct calendar push, and removes other tools' imported feeds while Repull is the unit's master calendar. `vrbo` says, per unit, whether Vrbo imports it (as last checked, once a day). When `status` is `failed`, ask the host to add `url` in Vrbo → Calendar → Import calendar, named \"Repull\". Changes arrive as `listing.ical_feed_changed`. The address is a credential: anyone with it can read the listing's booked dates (no guest details). Returns `403 listing_inactive` for an inactive listing.
|
|
505
|
+
# @param id [Integer] Repull listing id.
|
|
506
|
+
# @param [Hash] opts the optional parameters
|
|
507
|
+
# @return [GetListingIcal200Response]
|
|
508
|
+
def get_listing_ical(id, opts = {})
|
|
509
|
+
data, _status_code, _headers = get_listing_ical_with_http_info(id, opts)
|
|
510
|
+
data
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# Repull iCal backup feed
|
|
514
|
+
# The listing's Repull iCal backup feed: an iCal calendar named \"Repull\" with the listing's bookings and blocks as all-day events, at an unguessable address on `api.repull.dev` (created on first request, one per listing). Channels that import iCal close those nights from it on their own schedule — availability only, never prices. **Vrbo:** Repull imports this feed into every calendar-synced Vrbo unit by itself, as a backup for the direct calendar push, and removes other tools' imported feeds while Repull is the unit's master calendar. `vrbo` says, per unit, whether Vrbo imports it (as last checked, once a day). When `status` is `failed`, ask the host to add `url` in Vrbo → Calendar → Import calendar, named \"Repull\". Changes arrive as `listing.ical_feed_changed`. The address is a credential: anyone with it can read the listing's booked dates (no guest details). Returns `403 listing_inactive` for an inactive listing.
|
|
515
|
+
# @param id [Integer] Repull listing id.
|
|
516
|
+
# @param [Hash] opts the optional parameters
|
|
517
|
+
# @return [Array<(GetListingIcal200Response, Integer, Hash)>] GetListingIcal200Response data, response status code and response headers
|
|
518
|
+
def get_listing_ical_with_http_info(id, opts = {})
|
|
519
|
+
if @api_client.config.debugging
|
|
520
|
+
@api_client.config.logger.debug 'Calling API: ListingsApi.get_listing_ical ...'
|
|
521
|
+
end
|
|
522
|
+
# verify the required parameter 'id' is set
|
|
523
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
524
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ListingsApi.get_listing_ical"
|
|
525
|
+
end
|
|
526
|
+
# resource path
|
|
527
|
+
local_var_path = '/v1/listings/{id}/ical'.sub('{id}', CGI.escape(id.to_s))
|
|
528
|
+
|
|
529
|
+
# query parameters
|
|
530
|
+
query_params = opts[:query_params] || {}
|
|
531
|
+
|
|
532
|
+
# header parameters
|
|
533
|
+
header_params = opts[:header_params] || {}
|
|
534
|
+
# HTTP header 'Accept' (if needed)
|
|
535
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
536
|
+
|
|
537
|
+
# form parameters
|
|
538
|
+
form_params = opts[:form_params] || {}
|
|
539
|
+
|
|
540
|
+
# http body (model)
|
|
541
|
+
post_body = opts[:debug_body]
|
|
542
|
+
|
|
543
|
+
# return_type
|
|
544
|
+
return_type = opts[:debug_return_type] || 'GetListingIcal200Response'
|
|
545
|
+
|
|
546
|
+
# auth_names
|
|
547
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
548
|
+
|
|
549
|
+
new_options = opts.merge(
|
|
550
|
+
:operation => :"ListingsApi.get_listing_ical",
|
|
551
|
+
:header_params => header_params,
|
|
552
|
+
:query_params => query_params,
|
|
553
|
+
:form_params => form_params,
|
|
554
|
+
:body => post_body,
|
|
555
|
+
:auth_names => auth_names,
|
|
556
|
+
:return_type => return_type
|
|
557
|
+
)
|
|
558
|
+
|
|
559
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
560
|
+
if @api_client.config.debugging
|
|
561
|
+
@api_client.config.logger.debug "API called: ListingsApi#get_listing_ical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
562
|
+
end
|
|
563
|
+
return data, status_code, headers
|
|
564
|
+
end
|
|
565
|
+
|
|
503
566
|
# Get a listing's channel markups
|
|
504
567
|
# The markup each channel adds to this listing's price. A listing's price on a channel is its own nightly price plus the channel's markup: a $200 night with a 35% Airbnb markup is sent to Airbnb as $270. The calendar keeps the listing's own price (`GET /v1/availability/{propertyId}` returns it); the markup is added only when a price is sent to the channel. - **Airbnb** — one markup per listing. - **Booking.com** — one markup per **property**, shared by every listing priced through it (`listingIds` names them). - **Vrbo** — one markup per connected **Vrbo account**, shared by every listing linked on it (`listingIds` names them). Prices reach Vrbo through its calendar queue. Returns `404 not_found` for a listing that does not exist or is not in this workspace, and `403 listing_inactive` for an inactive one.
|
|
505
568
|
# @param id [String] Repull listing id.
|
|
@@ -25,6 +25,9 @@ module Repull
|
|
|
25
25
|
|
|
26
26
|
attr_accessor :error
|
|
27
27
|
|
|
28
|
+
# Vrbo, for a mapped unit: the listing's Repull iCal backup feed (`GET /v1/listings/{id}/ical`). With calendar sync on, Repull imports it into the Vrbo unit by itself (Vrbo → Calendar → Import calendar, named \"Repull\") and removes other tools' imported feeds; `listing.ical_feed_changed` reports it. Only if that fails does the host add it by hand.
|
|
29
|
+
attr_accessor :ical_feed_url
|
|
30
|
+
|
|
28
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
32
|
def self.attribute_map
|
|
30
33
|
{
|
|
@@ -32,7 +35,8 @@ module Repull
|
|
|
32
35
|
:'listing_id' => :'listing_id',
|
|
33
36
|
:'created' => :'created',
|
|
34
37
|
:'ok' => :'ok',
|
|
35
|
-
:'error' => :'error'
|
|
38
|
+
:'error' => :'error',
|
|
39
|
+
:'ical_feed_url' => :'ical_feed_url'
|
|
36
40
|
}
|
|
37
41
|
end
|
|
38
42
|
|
|
@@ -53,7 +57,8 @@ module Repull
|
|
|
53
57
|
:'listing_id' => :'Integer',
|
|
54
58
|
:'created' => :'Boolean',
|
|
55
59
|
:'ok' => :'Boolean',
|
|
56
|
-
:'error' => :'String'
|
|
60
|
+
:'error' => :'String',
|
|
61
|
+
:'ical_feed_url' => :'String'
|
|
57
62
|
}
|
|
58
63
|
end
|
|
59
64
|
|
|
@@ -99,6 +104,10 @@ module Repull
|
|
|
99
104
|
if attributes.key?(:'error')
|
|
100
105
|
self.error = attributes[:'error']
|
|
101
106
|
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'ical_feed_url')
|
|
109
|
+
self.ical_feed_url = attributes[:'ical_feed_url']
|
|
110
|
+
end
|
|
102
111
|
end
|
|
103
112
|
|
|
104
113
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -125,7 +134,8 @@ module Repull
|
|
|
125
134
|
listing_id == o.listing_id &&
|
|
126
135
|
created == o.created &&
|
|
127
136
|
ok == o.ok &&
|
|
128
|
-
error == o.error
|
|
137
|
+
error == o.error &&
|
|
138
|
+
ical_feed_url == o.ical_feed_url
|
|
129
139
|
end
|
|
130
140
|
|
|
131
141
|
# @see the `==` method
|
|
@@ -137,7 +147,7 @@ module Repull
|
|
|
137
147
|
# Calculates hash code according to all attributes.
|
|
138
148
|
# @return [Integer] Hash code
|
|
139
149
|
def hash
|
|
140
|
-
[unit_id, listing_id, created, ok, error].hash
|
|
150
|
+
[unit_id, listing_id, created, ok, error, ical_feed_url].hash
|
|
141
151
|
end
|
|
142
152
|
|
|
143
153
|
# Builds the object from hash
|
|
@@ -49,7 +49,7 @@ module Repull
|
|
|
49
49
|
:'connection_id' => :'String',
|
|
50
50
|
:'channel' => :'String',
|
|
51
51
|
:'applied' => :'Boolean',
|
|
52
|
-
:'results' => :'Array<
|
|
52
|
+
:'results' => :'Array<AutoMapConnectionUnits200ResponseResultsInner>'
|
|
53
53
|
}
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## 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`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
|
|
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 AutoMapConnectionUnits200ResponseResultsInner < ApiModelBase
|
|
18
|
+
attr_accessor :unit_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :listing_id
|
|
21
|
+
|
|
22
|
+
attr_accessor :created
|
|
23
|
+
|
|
24
|
+
attr_accessor :ok
|
|
25
|
+
|
|
26
|
+
attr_accessor :error
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'unit_id' => :'unit_id',
|
|
32
|
+
:'listing_id' => :'listing_id',
|
|
33
|
+
:'created' => :'created',
|
|
34
|
+
:'ok' => :'ok',
|
|
35
|
+
:'error' => :'error'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
acceptable_attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'unit_id' => :'String',
|
|
53
|
+
:'listing_id' => :'Integer',
|
|
54
|
+
:'created' => :'Boolean',
|
|
55
|
+
:'ok' => :'Boolean',
|
|
56
|
+
:'error' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
:'listing_id',
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AutoMapConnectionUnits200ResponseResultsInner` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AutoMapConnectionUnits200ResponseResultsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'unit_id')
|
|
84
|
+
self.unit_id = attributes[:'unit_id']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'listing_id')
|
|
88
|
+
self.listing_id = attributes[:'listing_id']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'created')
|
|
92
|
+
self.created = attributes[:'created']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'ok')
|
|
96
|
+
self.ok = attributes[:'ok']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'error')
|
|
100
|
+
self.error = attributes[:'error']
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
|
+
# @return Array for valid properties with the reasons
|
|
106
|
+
def list_invalid_properties
|
|
107
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
108
|
+
invalid_properties = Array.new
|
|
109
|
+
invalid_properties
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Check to see if the all the properties in the model are valid
|
|
113
|
+
# @return true if the model is valid
|
|
114
|
+
def valid?
|
|
115
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
116
|
+
true
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Checks equality by comparing each attribute.
|
|
120
|
+
# @param [Object] Object to be compared
|
|
121
|
+
def ==(o)
|
|
122
|
+
return true if self.equal?(o)
|
|
123
|
+
self.class == o.class &&
|
|
124
|
+
unit_id == o.unit_id &&
|
|
125
|
+
listing_id == o.listing_id &&
|
|
126
|
+
created == o.created &&
|
|
127
|
+
ok == o.ok &&
|
|
128
|
+
error == o.error
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# @see the `==` method
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def eql?(o)
|
|
134
|
+
self == o
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Calculates hash code according to all attributes.
|
|
138
|
+
# @return [Integer] Hash code
|
|
139
|
+
def hash
|
|
140
|
+
[unit_id, listing_id, created, ok, error].hash
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Builds the object from hash
|
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
145
|
+
# @return [Object] Returns the model itself
|
|
146
|
+
def self.build_from_hash(attributes)
|
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
149
|
+
transformed_hash = {}
|
|
150
|
+
openapi_types.each_pair do |key, type|
|
|
151
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
152
|
+
transformed_hash["#{key}"] = nil
|
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
154
|
+
# check to ensure the input is an array given that the attribute
|
|
155
|
+
# is documented as an array but the input is not
|
|
156
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
157
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
158
|
+
end
|
|
159
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
160
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
new(transformed_hash)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns the object in the form of hash
|
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
|
168
|
+
def to_hash
|
|
169
|
+
hash = {}
|
|
170
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
171
|
+
value = self.send(attr)
|
|
172
|
+
if value.nil?
|
|
173
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
174
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
hash[param] = _to_hash(value)
|
|
178
|
+
end
|
|
179
|
+
hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
end
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## 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`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
|
|
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 GetListingIcal200Response < ApiModelBase
|
|
18
|
+
attr_accessor :listing_id
|
|
19
|
+
|
|
20
|
+
# The feed address. Import it on any channel that reads iCal.
|
|
21
|
+
attr_accessor :url
|
|
22
|
+
|
|
23
|
+
# The calendar name the feed carries, and the name to give it when importing it by hand.
|
|
24
|
+
attr_accessor :calendar_name
|
|
25
|
+
|
|
26
|
+
# False when the listing's feed was turned off; the address then answers 404.
|
|
27
|
+
attr_accessor :enabled
|
|
28
|
+
|
|
29
|
+
# One entry per Vrbo unit mapped to the listing.
|
|
30
|
+
attr_accessor :vrbo
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'listing_id' => :'listingId',
|
|
58
|
+
:'url' => :'url',
|
|
59
|
+
:'calendar_name' => :'calendarName',
|
|
60
|
+
:'enabled' => :'enabled',
|
|
61
|
+
:'vrbo' => :'vrbo'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns attribute mapping this model knows about
|
|
66
|
+
def self.acceptable_attribute_map
|
|
67
|
+
attribute_map
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns all the JSON keys this model knows about
|
|
71
|
+
def self.acceptable_attributes
|
|
72
|
+
acceptable_attribute_map.values
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Attribute type mapping.
|
|
76
|
+
def self.openapi_types
|
|
77
|
+
{
|
|
78
|
+
:'listing_id' => :'String',
|
|
79
|
+
:'url' => :'String',
|
|
80
|
+
:'calendar_name' => :'String',
|
|
81
|
+
:'enabled' => :'Boolean',
|
|
82
|
+
:'vrbo' => :'Array<GetListingIcal200ResponseVrboInner>'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# List of attributes with nullable: true
|
|
87
|
+
def self.openapi_nullable
|
|
88
|
+
Set.new([
|
|
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::GetListingIcal200Response` 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::GetListingIcal200Response`. 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?(:'listing_id')
|
|
109
|
+
self.listing_id = attributes[:'listing_id']
|
|
110
|
+
else
|
|
111
|
+
self.listing_id = nil
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'url')
|
|
115
|
+
self.url = attributes[:'url']
|
|
116
|
+
else
|
|
117
|
+
self.url = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'calendar_name')
|
|
121
|
+
self.calendar_name = attributes[:'calendar_name']
|
|
122
|
+
else
|
|
123
|
+
self.calendar_name = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'enabled')
|
|
127
|
+
self.enabled = attributes[:'enabled']
|
|
128
|
+
else
|
|
129
|
+
self.enabled = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'vrbo')
|
|
133
|
+
if (value = attributes[:'vrbo']).is_a?(Array)
|
|
134
|
+
self.vrbo = value
|
|
135
|
+
end
|
|
136
|
+
else
|
|
137
|
+
self.vrbo = nil
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
142
|
+
# @return Array for valid properties with the reasons
|
|
143
|
+
def list_invalid_properties
|
|
144
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
145
|
+
invalid_properties = Array.new
|
|
146
|
+
if @listing_id.nil?
|
|
147
|
+
invalid_properties.push('invalid value for "listing_id", listing_id cannot be nil.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if @url.nil?
|
|
151
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if @calendar_name.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "calendar_name", calendar_name cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if @enabled.nil?
|
|
159
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if @vrbo.nil?
|
|
163
|
+
invalid_properties.push('invalid value for "vrbo", vrbo cannot be nil.')
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
invalid_properties
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Check to see if the all the properties in the model are valid
|
|
170
|
+
# @return true if the model is valid
|
|
171
|
+
def valid?
|
|
172
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
173
|
+
return false if @listing_id.nil?
|
|
174
|
+
return false if @url.nil?
|
|
175
|
+
return false if @calendar_name.nil?
|
|
176
|
+
calendar_name_validator = EnumAttributeValidator.new('String', ["Repull"])
|
|
177
|
+
return false unless calendar_name_validator.valid?(@calendar_name)
|
|
178
|
+
return false if @enabled.nil?
|
|
179
|
+
return false if @vrbo.nil?
|
|
180
|
+
true
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Custom attribute writer method with validation
|
|
184
|
+
# @param [Object] listing_id Value to be assigned
|
|
185
|
+
def listing_id=(listing_id)
|
|
186
|
+
if listing_id.nil?
|
|
187
|
+
fail ArgumentError, 'listing_id cannot be nil'
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
@listing_id = listing_id
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Custom attribute writer method with validation
|
|
194
|
+
# @param [Object] url Value to be assigned
|
|
195
|
+
def url=(url)
|
|
196
|
+
if url.nil?
|
|
197
|
+
fail ArgumentError, 'url cannot be nil'
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
@url = url
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
204
|
+
# @param [Object] calendar_name Object to be assigned
|
|
205
|
+
def calendar_name=(calendar_name)
|
|
206
|
+
validator = EnumAttributeValidator.new('String', ["Repull"])
|
|
207
|
+
unless validator.valid?(calendar_name)
|
|
208
|
+
fail ArgumentError, "invalid value for \"calendar_name\", must be one of #{validator.allowable_values}."
|
|
209
|
+
end
|
|
210
|
+
@calendar_name = calendar_name
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Custom attribute writer method with validation
|
|
214
|
+
# @param [Object] enabled Value to be assigned
|
|
215
|
+
def enabled=(enabled)
|
|
216
|
+
if enabled.nil?
|
|
217
|
+
fail ArgumentError, 'enabled cannot be nil'
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
@enabled = enabled
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Custom attribute writer method with validation
|
|
224
|
+
# @param [Object] vrbo Value to be assigned
|
|
225
|
+
def vrbo=(vrbo)
|
|
226
|
+
if vrbo.nil?
|
|
227
|
+
fail ArgumentError, 'vrbo cannot be nil'
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
@vrbo = vrbo
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Checks equality by comparing each attribute.
|
|
234
|
+
# @param [Object] Object to be compared
|
|
235
|
+
def ==(o)
|
|
236
|
+
return true if self.equal?(o)
|
|
237
|
+
self.class == o.class &&
|
|
238
|
+
listing_id == o.listing_id &&
|
|
239
|
+
url == o.url &&
|
|
240
|
+
calendar_name == o.calendar_name &&
|
|
241
|
+
enabled == o.enabled &&
|
|
242
|
+
vrbo == o.vrbo
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# @see the `==` method
|
|
246
|
+
# @param [Object] Object to be compared
|
|
247
|
+
def eql?(o)
|
|
248
|
+
self == o
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Calculates hash code according to all attributes.
|
|
252
|
+
# @return [Integer] Hash code
|
|
253
|
+
def hash
|
|
254
|
+
[listing_id, url, calendar_name, enabled, vrbo].hash
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Builds the object from hash
|
|
258
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
259
|
+
# @return [Object] Returns the model itself
|
|
260
|
+
def self.build_from_hash(attributes)
|
|
261
|
+
return nil unless attributes.is_a?(Hash)
|
|
262
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
263
|
+
transformed_hash = {}
|
|
264
|
+
openapi_types.each_pair do |key, type|
|
|
265
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
266
|
+
transformed_hash["#{key}"] = nil
|
|
267
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
268
|
+
# check to ensure the input is an array given that the attribute
|
|
269
|
+
# is documented as an array but the input is not
|
|
270
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
271
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
272
|
+
end
|
|
273
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
274
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
new(transformed_hash)
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Returns the object in the form of hash
|
|
281
|
+
# @return [Hash] Returns the object in the form of hash
|
|
282
|
+
def to_hash
|
|
283
|
+
hash = {}
|
|
284
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
285
|
+
value = self.send(attr)
|
|
286
|
+
if value.nil?
|
|
287
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
288
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
hash[param] = _to_hash(value)
|
|
292
|
+
end
|
|
293
|
+
hash
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
end
|