repull 0.2.35 → 0.2.36
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/listings_api.rb +8 -8
- data/lib/repull/api/migrate_api.rb +68 -0
- data/lib/repull/models/booking_unacknowledged_event.rb +281 -0
- data/lib/repull/models/booking_unacknowledged_payload.rb +229 -0
- data/lib/repull/models/channel_degraded_event.rb +279 -0
- data/lib/repull/models/channel_degraded_payload.rb +174 -0
- data/lib/repull/models/channel_degraded_payload_object.rb +262 -0
- data/lib/repull/models/channel_sync_failed_event.rb +280 -0
- data/lib/repull/models/channel_sync_failure_payload.rb +214 -0
- data/lib/repull/models/channel_sync_failure_payload_failures_inner.rb +213 -0
- data/lib/repull/models/channel_sync_failure_payload_object.rb +289 -0
- data/lib/repull/models/charge_per.rb +42 -0
- data/lib/repull/models/create_connect_session_request.rb +2 -2
- data/lib/repull/models/create_connection_request.rb +1 -1
- data/lib/repull/models/import_from_channex200_response.rb +147 -0
- data/lib/repull/models/import_from_channex200_response_data.rb +324 -0
- data/lib/repull/models/import_from_channex200_response_data_channels_inner.rb +263 -0
- data/lib/repull/models/import_from_channex200_response_data_properties_inner.rb +222 -0
- data/lib/repull/models/import_from_channex200_response_data_summary.rb +201 -0
- data/lib/repull/models/import_from_channex200_response_data_summary_bookings.rb +165 -0
- data/lib/repull/models/import_from_channex200_response_data_summary_properties.rb +165 -0
- data/lib/repull/models/import_from_channex_request.rb +223 -0
- data/lib/repull/models/listing.rb +82 -1
- data/lib/repull/models/listing_content_photo.rb +206 -0
- data/lib/repull/models/listing_fee.rb +229 -0
- data/lib/repull/models/listing_policies.rb +257 -0
- data/lib/repull/models/listing_policies_check_in.rb +179 -0
- data/lib/repull/models/listing_policies_check_out.rb +148 -0
- data/lib/repull/models/listing_policies_quiet_hours.rb +156 -0
- data/lib/repull/models/listing_pricing_settings.rb +233 -0
- data/lib/repull/models/listing_room.rb +190 -0
- data/lib/repull/models/listing_room_beds_inner.rb +156 -0
- data/lib/repull/models/listing_rules.rb +212 -0
- data/lib/repull/models/listing_tax.rb +241 -0
- data/lib/repull/models/reservation_thread_assigned_event.rb +279 -0
- data/lib/repull/models/reservation_thread_assigned_payload.rb +174 -0
- data/lib/repull/models/reservation_thread_assigned_payload_object.rb +249 -0
- data/lib/repull/models/webhook_event.rb +8 -0
- data/lib/repull/models/webhook_event_type.rb +5 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +32 -0
- data/openapi/v1.json +1591 -8
- metadata +34 -4
- data/spec/api/plumguide_api_spec.rb +0 -85
|
@@ -0,0 +1,223 @@
|
|
|
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 ImportFromChannexRequest < ApiModelBase
|
|
18
|
+
# Your Channex API key (the `user-api-key` header value). Used for this request only.
|
|
19
|
+
attr_accessor :api_key
|
|
20
|
+
|
|
21
|
+
# `production` reads app.channex.io, `staging` reads staging.channex.io.
|
|
22
|
+
attr_accessor :environment
|
|
23
|
+
|
|
24
|
+
# Match and report without writing anything.
|
|
25
|
+
attr_accessor :dry_run
|
|
26
|
+
|
|
27
|
+
class EnumAttributeValidator
|
|
28
|
+
attr_reader :datatype
|
|
29
|
+
attr_reader :allowable_values
|
|
30
|
+
|
|
31
|
+
def initialize(datatype, allowable_values)
|
|
32
|
+
@allowable_values = allowable_values.map do |value|
|
|
33
|
+
case datatype.to_s
|
|
34
|
+
when /Integer/i
|
|
35
|
+
value.to_i
|
|
36
|
+
when /Float/i
|
|
37
|
+
value.to_f
|
|
38
|
+
else
|
|
39
|
+
value
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def valid?(value)
|
|
45
|
+
!value || allowable_values.include?(value)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
|
+
def self.attribute_map
|
|
51
|
+
{
|
|
52
|
+
:'api_key' => :'apiKey',
|
|
53
|
+
:'environment' => :'environment',
|
|
54
|
+
:'dry_run' => :'dryRun'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
|
64
|
+
def self.acceptable_attributes
|
|
65
|
+
acceptable_attribute_map.values
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.openapi_types
|
|
70
|
+
{
|
|
71
|
+
:'api_key' => :'String',
|
|
72
|
+
:'environment' => :'String',
|
|
73
|
+
:'dry_run' => :'Boolean'
|
|
74
|
+
}
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# List of attributes with nullable: true
|
|
78
|
+
def self.openapi_nullable
|
|
79
|
+
Set.new([
|
|
80
|
+
])
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Initializes the object
|
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
85
|
+
def initialize(attributes = {})
|
|
86
|
+
if (!attributes.is_a?(Hash))
|
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ImportFromChannexRequest` initialize method"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
91
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
92
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
93
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ImportFromChannexRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
95
|
+
end
|
|
96
|
+
h[k.to_sym] = v
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'api_key')
|
|
100
|
+
self.api_key = attributes[:'api_key']
|
|
101
|
+
else
|
|
102
|
+
self.api_key = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'environment')
|
|
106
|
+
self.environment = attributes[:'environment']
|
|
107
|
+
else
|
|
108
|
+
self.environment = 'production'
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'dry_run')
|
|
112
|
+
self.dry_run = attributes[:'dry_run']
|
|
113
|
+
else
|
|
114
|
+
self.dry_run = false
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
|
+
# @return Array for valid properties with the reasons
|
|
120
|
+
def list_invalid_properties
|
|
121
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
122
|
+
invalid_properties = Array.new
|
|
123
|
+
if @api_key.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "api_key", api_key cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
invalid_properties
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Check to see if the all the properties in the model are valid
|
|
131
|
+
# @return true if the model is valid
|
|
132
|
+
def valid?
|
|
133
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
134
|
+
return false if @api_key.nil?
|
|
135
|
+
environment_validator = EnumAttributeValidator.new('String', ["production", "staging"])
|
|
136
|
+
return false unless environment_validator.valid?(@environment)
|
|
137
|
+
true
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Custom attribute writer method with validation
|
|
141
|
+
# @param [Object] api_key Value to be assigned
|
|
142
|
+
def api_key=(api_key)
|
|
143
|
+
if api_key.nil?
|
|
144
|
+
fail ArgumentError, 'api_key cannot be nil'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
@api_key = api_key
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
151
|
+
# @param [Object] environment Object to be assigned
|
|
152
|
+
def environment=(environment)
|
|
153
|
+
validator = EnumAttributeValidator.new('String', ["production", "staging"])
|
|
154
|
+
unless validator.valid?(environment)
|
|
155
|
+
fail ArgumentError, "invalid value for \"environment\", must be one of #{validator.allowable_values}."
|
|
156
|
+
end
|
|
157
|
+
@environment = environment
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Checks equality by comparing each attribute.
|
|
161
|
+
# @param [Object] Object to be compared
|
|
162
|
+
def ==(o)
|
|
163
|
+
return true if self.equal?(o)
|
|
164
|
+
self.class == o.class &&
|
|
165
|
+
api_key == o.api_key &&
|
|
166
|
+
environment == o.environment &&
|
|
167
|
+
dry_run == o.dry_run
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# @see the `==` method
|
|
171
|
+
# @param [Object] Object to be compared
|
|
172
|
+
def eql?(o)
|
|
173
|
+
self == o
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Calculates hash code according to all attributes.
|
|
177
|
+
# @return [Integer] Hash code
|
|
178
|
+
def hash
|
|
179
|
+
[api_key, environment, dry_run].hash
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Builds the object from hash
|
|
183
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
184
|
+
# @return [Object] Returns the model itself
|
|
185
|
+
def self.build_from_hash(attributes)
|
|
186
|
+
return nil unless attributes.is_a?(Hash)
|
|
187
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
188
|
+
transformed_hash = {}
|
|
189
|
+
openapi_types.each_pair do |key, type|
|
|
190
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
191
|
+
transformed_hash["#{key}"] = nil
|
|
192
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
193
|
+
# check to ensure the input is an array given that the attribute
|
|
194
|
+
# is documented as an array but the input is not
|
|
195
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
196
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
197
|
+
end
|
|
198
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
199
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
new(transformed_hash)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Returns the object in the form of hash
|
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
|
207
|
+
def to_hash
|
|
208
|
+
hash = {}
|
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
210
|
+
value = self.send(attr)
|
|
211
|
+
if value.nil?
|
|
212
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
213
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
hash[param] = _to_hash(value)
|
|
217
|
+
end
|
|
218
|
+
hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
end
|
|
@@ -57,6 +57,27 @@ module Repull
|
|
|
57
57
|
# **Only present when the caller passes `?include=details`.** Sourced from `listings_details`. `null` when the listing has no details row stored (vs the field being absent — that signals the caller did not opt into the expansion).
|
|
58
58
|
attr_accessor :details
|
|
59
59
|
|
|
60
|
+
# **Only present with `?include=rooms`.** Each room and its beds. `[]` when none are stored.
|
|
61
|
+
attr_accessor :rooms
|
|
62
|
+
|
|
63
|
+
# **Only present with `?include=policies`.** Cancellation, house rules, check-in and check-out, pets/smoking/events/children, quiet hours, deposit.
|
|
64
|
+
attr_accessor :policies
|
|
65
|
+
|
|
66
|
+
# **Only present with `?include=rules`.** Stay rules: min/max nights, booking window, advance notice, preparation time, and whether booking requests are allowed.
|
|
67
|
+
attr_accessor :rules
|
|
68
|
+
|
|
69
|
+
# **Only present with `?include=pricing`.** Standing prices: base and weekend rate, cleaning and extra-guest fees, deposit, weekly/monthly discounts. `null` when none are stored.
|
|
70
|
+
attr_accessor :pricing
|
|
71
|
+
|
|
72
|
+
# **Only present with `?include=fees`.** Every fee, the cleaning fee included, whatever channel or PMS it came from. `[]` when none.
|
|
73
|
+
attr_accessor :fees
|
|
74
|
+
|
|
75
|
+
# **Only present with `?include=taxes`.** Taxes charged to the guest. `[]` when none.
|
|
76
|
+
attr_accessor :taxes
|
|
77
|
+
|
|
78
|
+
# **Only present with `?include=photos`.** The listing photos in display order.
|
|
79
|
+
attr_accessor :photos
|
|
80
|
+
|
|
60
81
|
attr_accessor :created_at
|
|
61
82
|
|
|
62
83
|
attr_accessor :updated_at
|
|
@@ -79,6 +100,13 @@ module Repull
|
|
|
79
100
|
:'amenities' => :'amenities',
|
|
80
101
|
:'content' => :'content',
|
|
81
102
|
:'details' => :'details',
|
|
103
|
+
:'rooms' => :'rooms',
|
|
104
|
+
:'policies' => :'policies',
|
|
105
|
+
:'rules' => :'rules',
|
|
106
|
+
:'pricing' => :'pricing',
|
|
107
|
+
:'fees' => :'fees',
|
|
108
|
+
:'taxes' => :'taxes',
|
|
109
|
+
:'photos' => :'photos',
|
|
82
110
|
:'created_at' => :'createdAt',
|
|
83
111
|
:'updated_at' => :'updatedAt'
|
|
84
112
|
}
|
|
@@ -112,6 +140,13 @@ module Repull
|
|
|
112
140
|
:'amenities' => :'Array<ListingAmenity>',
|
|
113
141
|
:'content' => :'ListingContent',
|
|
114
142
|
:'details' => :'ListingDetails',
|
|
143
|
+
:'rooms' => :'Array<ListingRoom>',
|
|
144
|
+
:'policies' => :'ListingPolicies',
|
|
145
|
+
:'rules' => :'ListingRules',
|
|
146
|
+
:'pricing' => :'ListingPricingSettings',
|
|
147
|
+
:'fees' => :'Array<ListingFee>',
|
|
148
|
+
:'taxes' => :'Array<ListingTax>',
|
|
149
|
+
:'photos' => :'Array<ListingContentPhoto>',
|
|
115
150
|
:'created_at' => :'Time',
|
|
116
151
|
:'updated_at' => :'Time'
|
|
117
152
|
}
|
|
@@ -125,6 +160,9 @@ module Repull
|
|
|
125
160
|
:'thumbnail_url',
|
|
126
161
|
:'content',
|
|
127
162
|
:'details',
|
|
163
|
+
:'policies',
|
|
164
|
+
:'rules',
|
|
165
|
+
:'pricing',
|
|
128
166
|
])
|
|
129
167
|
end
|
|
130
168
|
|
|
@@ -210,6 +248,42 @@ module Repull
|
|
|
210
248
|
self.details = attributes[:'details']
|
|
211
249
|
end
|
|
212
250
|
|
|
251
|
+
if attributes.key?(:'rooms')
|
|
252
|
+
if (value = attributes[:'rooms']).is_a?(Array)
|
|
253
|
+
self.rooms = value
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if attributes.key?(:'policies')
|
|
258
|
+
self.policies = attributes[:'policies']
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if attributes.key?(:'rules')
|
|
262
|
+
self.rules = attributes[:'rules']
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if attributes.key?(:'pricing')
|
|
266
|
+
self.pricing = attributes[:'pricing']
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if attributes.key?(:'fees')
|
|
270
|
+
if (value = attributes[:'fees']).is_a?(Array)
|
|
271
|
+
self.fees = value
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
if attributes.key?(:'taxes')
|
|
276
|
+
if (value = attributes[:'taxes']).is_a?(Array)
|
|
277
|
+
self.taxes = value
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if attributes.key?(:'photos')
|
|
282
|
+
if (value = attributes[:'photos']).is_a?(Array)
|
|
283
|
+
self.photos = value
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
|
|
213
287
|
if attributes.key?(:'created_at')
|
|
214
288
|
self.created_at = attributes[:'created_at']
|
|
215
289
|
end
|
|
@@ -273,6 +347,13 @@ module Repull
|
|
|
273
347
|
amenities == o.amenities &&
|
|
274
348
|
content == o.content &&
|
|
275
349
|
details == o.details &&
|
|
350
|
+
rooms == o.rooms &&
|
|
351
|
+
policies == o.policies &&
|
|
352
|
+
rules == o.rules &&
|
|
353
|
+
pricing == o.pricing &&
|
|
354
|
+
fees == o.fees &&
|
|
355
|
+
taxes == o.taxes &&
|
|
356
|
+
photos == o.photos &&
|
|
276
357
|
created_at == o.created_at &&
|
|
277
358
|
updated_at == o.updated_at
|
|
278
359
|
end
|
|
@@ -286,7 +367,7 @@ module Repull
|
|
|
286
367
|
# Calculates hash code according to all attributes.
|
|
287
368
|
# @return [Integer] Hash code
|
|
288
369
|
def hash
|
|
289
|
-
[capabilities, kind, hotel, unit_count, units, id, name, public_name, address, thumbnail_url, status, channels, amenities, content, details, created_at, updated_at].hash
|
|
370
|
+
[capabilities, kind, 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
|
|
290
371
|
end
|
|
291
372
|
|
|
292
373
|
# Builds the object from hash
|
|
@@ -0,0 +1,206 @@
|
|
|
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 ListingContentPhoto < ApiModelBase
|
|
18
|
+
attr_accessor :url
|
|
19
|
+
|
|
20
|
+
attr_accessor :thumbnail_url
|
|
21
|
+
|
|
22
|
+
attr_accessor :caption
|
|
23
|
+
|
|
24
|
+
attr_accessor :category
|
|
25
|
+
|
|
26
|
+
attr_accessor :width
|
|
27
|
+
|
|
28
|
+
attr_accessor :height
|
|
29
|
+
|
|
30
|
+
attr_accessor :sort_order
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'url' => :'url',
|
|
36
|
+
:'thumbnail_url' => :'thumbnailUrl',
|
|
37
|
+
:'caption' => :'caption',
|
|
38
|
+
:'category' => :'category',
|
|
39
|
+
:'width' => :'width',
|
|
40
|
+
:'height' => :'height',
|
|
41
|
+
:'sort_order' => :'sortOrder'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns all the JSON keys this model knows about
|
|
51
|
+
def self.acceptable_attributes
|
|
52
|
+
acceptable_attribute_map.values
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute type mapping.
|
|
56
|
+
def self.openapi_types
|
|
57
|
+
{
|
|
58
|
+
:'url' => :'String',
|
|
59
|
+
:'thumbnail_url' => :'String',
|
|
60
|
+
:'caption' => :'String',
|
|
61
|
+
:'category' => :'String',
|
|
62
|
+
:'width' => :'Integer',
|
|
63
|
+
:'height' => :'Integer',
|
|
64
|
+
:'sort_order' => :'Integer'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# List of attributes with nullable: true
|
|
69
|
+
def self.openapi_nullable
|
|
70
|
+
Set.new([
|
|
71
|
+
:'thumbnail_url',
|
|
72
|
+
:'caption',
|
|
73
|
+
:'category',
|
|
74
|
+
:'width',
|
|
75
|
+
:'height',
|
|
76
|
+
])
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Initializes the object
|
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
|
+
def initialize(attributes = {})
|
|
82
|
+
if (!attributes.is_a?(Hash))
|
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingContentPhoto` initialize method"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
87
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
89
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingContentPhoto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
91
|
+
end
|
|
92
|
+
h[k.to_sym] = v
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'url')
|
|
96
|
+
self.url = attributes[:'url']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'thumbnail_url')
|
|
100
|
+
self.thumbnail_url = attributes[:'thumbnail_url']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'caption')
|
|
104
|
+
self.caption = attributes[:'caption']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'category')
|
|
108
|
+
self.category = attributes[:'category']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'width')
|
|
112
|
+
self.width = attributes[:'width']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'height')
|
|
116
|
+
self.height = attributes[:'height']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'sort_order')
|
|
120
|
+
self.sort_order = attributes[:'sort_order']
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
125
|
+
# @return Array for valid properties with the reasons
|
|
126
|
+
def list_invalid_properties
|
|
127
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
128
|
+
invalid_properties = Array.new
|
|
129
|
+
invalid_properties
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Check to see if the all the properties in the model are valid
|
|
133
|
+
# @return true if the model is valid
|
|
134
|
+
def valid?
|
|
135
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Checks equality by comparing each attribute.
|
|
140
|
+
# @param [Object] Object to be compared
|
|
141
|
+
def ==(o)
|
|
142
|
+
return true if self.equal?(o)
|
|
143
|
+
self.class == o.class &&
|
|
144
|
+
url == o.url &&
|
|
145
|
+
thumbnail_url == o.thumbnail_url &&
|
|
146
|
+
caption == o.caption &&
|
|
147
|
+
category == o.category &&
|
|
148
|
+
width == o.width &&
|
|
149
|
+
height == o.height &&
|
|
150
|
+
sort_order == o.sort_order
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# @see the `==` method
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def eql?(o)
|
|
156
|
+
self == o
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Calculates hash code according to all attributes.
|
|
160
|
+
# @return [Integer] Hash code
|
|
161
|
+
def hash
|
|
162
|
+
[url, thumbnail_url, caption, category, width, height, sort_order].hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Builds the object from hash
|
|
166
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
167
|
+
# @return [Object] Returns the model itself
|
|
168
|
+
def self.build_from_hash(attributes)
|
|
169
|
+
return nil unless attributes.is_a?(Hash)
|
|
170
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
171
|
+
transformed_hash = {}
|
|
172
|
+
openapi_types.each_pair do |key, type|
|
|
173
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
174
|
+
transformed_hash["#{key}"] = nil
|
|
175
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
176
|
+
# check to ensure the input is an array given that the attribute
|
|
177
|
+
# is documented as an array but the input is not
|
|
178
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
179
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
180
|
+
end
|
|
181
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
182
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
new(transformed_hash)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Returns the object in the form of hash
|
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
|
190
|
+
def to_hash
|
|
191
|
+
hash = {}
|
|
192
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
193
|
+
value = self.send(attr)
|
|
194
|
+
if value.nil?
|
|
195
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
196
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
hash[param] = _to_hash(value)
|
|
200
|
+
end
|
|
201
|
+
hash
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
end
|