repull 0.2.33 → 0.2.34
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/promotions_api.rb +574 -0
- data/lib/repull/models/listing_updated_payload.rb +2 -2
- data/lib/repull/models/promotion.rb +344 -0
- data/lib/repull/models/promotion_applies_to.rb +161 -0
- data/lib/repull/models/promotion_bulk_request.rb +236 -0
- data/lib/repull/models/promotion_bulk_response.rb +158 -0
- data/lib/repull/models/promotion_bulk_response_data_inner.rb +174 -0
- data/lib/repull/models/promotion_bulk_response_data_inner_error.rb +165 -0
- data/lib/repull/models/promotion_bulk_response_summary.rb +156 -0
- data/lib/repull/models/promotion_catalog.rb +158 -0
- data/lib/repull/models/promotion_catalog_channels_inner.rb +222 -0
- data/lib/repull/models/promotion_catalog_entry.rb +265 -0
- data/lib/repull/models/promotion_catalog_field.rb +205 -0
- data/lib/repull/models/promotion_catalog_field_options_inner.rb +156 -0
- data/lib/repull/models/promotion_catalog_response.rb +147 -0
- data/lib/repull/models/promotion_create_request.rb +258 -0
- data/lib/repull/models/promotion_delete_response.rb +147 -0
- data/lib/repull/models/promotion_delete_response_data.rb +156 -0
- data/lib/repull/models/promotion_discount.rb +191 -0
- data/lib/repull/models/promotion_input.rb +241 -0
- data/lib/repull/models/promotion_list_response.rb +170 -0
- data/lib/repull/models/promotion_refresh_response.rb +170 -0
- data/lib/repull/models/promotion_response.rb +147 -0
- data/lib/repull/models/promotion_rules.rb +290 -0
- data/lib/repull/models/promotion_rules_blackout_dates_quota.rb +156 -0
- data/lib/repull/models/promotion_rules_booking_window.rb +230 -0
- data/lib/repull/models/promotion_rules_last_minute.rb +218 -0
- data/lib/repull/models/promotion_rules_stay_window.rb +211 -0
- data/lib/repull/models/promotion_type.rb +47 -0
- data/lib/repull/models/promotion_update_request.rb +175 -0
- data/lib/repull/models/promotion_usage.rb +193 -0
- data/lib/repull/models/promotion_usage_revenue.rb +156 -0
- data/lib/repull/models/reservation_money_line.rb +14 -4
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +31 -0
- data/openapi/v1.json +1061 -2
- data/scripts/regen.sh +1 -1
- metadata +32 -1
|
@@ -0,0 +1,156 @@
|
|
|
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 PromotionUsageRevenue < ApiModelBase
|
|
18
|
+
attr_accessor :amount
|
|
19
|
+
|
|
20
|
+
attr_accessor :currency
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'amount' => :'amount',
|
|
26
|
+
:'currency' => :'currency'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'amount' => :'Float',
|
|
44
|
+
:'currency' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PromotionUsageRevenue` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PromotionUsageRevenue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'amount')
|
|
71
|
+
self.amount = attributes[:'amount']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'currency')
|
|
75
|
+
self.currency = attributes[:'currency']
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
80
|
+
# @return Array for valid properties with the reasons
|
|
81
|
+
def list_invalid_properties
|
|
82
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
83
|
+
invalid_properties = Array.new
|
|
84
|
+
invalid_properties
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Check to see if the all the properties in the model are valid
|
|
88
|
+
# @return true if the model is valid
|
|
89
|
+
def valid?
|
|
90
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Checks equality by comparing each attribute.
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def ==(o)
|
|
97
|
+
return true if self.equal?(o)
|
|
98
|
+
self.class == o.class &&
|
|
99
|
+
amount == o.amount &&
|
|
100
|
+
currency == o.currency
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# @see the `==` method
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def eql?(o)
|
|
106
|
+
self == o
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Calculates hash code according to all attributes.
|
|
110
|
+
# @return [Integer] Hash code
|
|
111
|
+
def hash
|
|
112
|
+
[amount, currency].hash
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Builds the object from hash
|
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
117
|
+
# @return [Object] Returns the model itself
|
|
118
|
+
def self.build_from_hash(attributes)
|
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
|
120
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
121
|
+
transformed_hash = {}
|
|
122
|
+
openapi_types.each_pair do |key, type|
|
|
123
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
124
|
+
transformed_hash["#{key}"] = nil
|
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
126
|
+
# check to ensure the input is an array given that the attribute
|
|
127
|
+
# is documented as an array but the input is not
|
|
128
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
129
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
130
|
+
end
|
|
131
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
new(transformed_hash)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Returns the object in the form of hash
|
|
139
|
+
# @return [Hash] Returns the object in the form of hash
|
|
140
|
+
def to_hash
|
|
141
|
+
hash = {}
|
|
142
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
143
|
+
value = self.send(attr)
|
|
144
|
+
if value.nil?
|
|
145
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
146
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
hash[param] = _to_hash(value)
|
|
150
|
+
end
|
|
151
|
+
hash
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
@@ -34,6 +34,9 @@ module Repull
|
|
|
34
34
|
# VAT charged on top of this line, when the channel splits it out separately.
|
|
35
35
|
attr_accessor :vat
|
|
36
36
|
|
|
37
|
+
# Discount lines only: the listing promotion that produced the discount, named as in `GET /v1/listings/{id}/promotions` (Airbnb reports each applied promotion as its own line). `custom` is an Airbnb Custom promotion.
|
|
38
|
+
attr_accessor :promotion_type
|
|
39
|
+
|
|
37
40
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
41
|
def self.attribute_map
|
|
39
42
|
{
|
|
@@ -42,7 +45,8 @@ module Repull
|
|
|
42
45
|
:'amount' => :'amount',
|
|
43
46
|
:'description' => :'description',
|
|
44
47
|
:'quantity' => :'quantity',
|
|
45
|
-
:'vat' => :'vat'
|
|
48
|
+
:'vat' => :'vat',
|
|
49
|
+
:'promotion_type' => :'promotionType'
|
|
46
50
|
}
|
|
47
51
|
end
|
|
48
52
|
|
|
@@ -64,7 +68,8 @@ module Repull
|
|
|
64
68
|
:'amount' => :'Float',
|
|
65
69
|
:'description' => :'String',
|
|
66
70
|
:'quantity' => :'Float',
|
|
67
|
-
:'vat' => :'Float'
|
|
71
|
+
:'vat' => :'Float',
|
|
72
|
+
:'promotion_type' => :'String'
|
|
68
73
|
}
|
|
69
74
|
end
|
|
70
75
|
|
|
@@ -115,6 +120,10 @@ module Repull
|
|
|
115
120
|
if attributes.key?(:'vat')
|
|
116
121
|
self.vat = attributes[:'vat']
|
|
117
122
|
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'promotion_type')
|
|
125
|
+
self.promotion_type = attributes[:'promotion_type']
|
|
126
|
+
end
|
|
118
127
|
end
|
|
119
128
|
|
|
120
129
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -157,7 +166,8 @@ module Repull
|
|
|
157
166
|
amount == o.amount &&
|
|
158
167
|
description == o.description &&
|
|
159
168
|
quantity == o.quantity &&
|
|
160
|
-
vat == o.vat
|
|
169
|
+
vat == o.vat &&
|
|
170
|
+
promotion_type == o.promotion_type
|
|
161
171
|
end
|
|
162
172
|
|
|
163
173
|
# @see the `==` method
|
|
@@ -169,7 +179,7 @@ module Repull
|
|
|
169
179
|
# Calculates hash code according to all attributes.
|
|
170
180
|
# @return [Integer] Hash code
|
|
171
181
|
def hash
|
|
172
|
-
[name, type, amount, description, quantity, vat].hash
|
|
182
|
+
[name, type, amount, description, quantity, vat, promotion_type].hash
|
|
173
183
|
end
|
|
174
184
|
|
|
175
185
|
# Builds the object from hash
|
data/lib/repull/version.rb
CHANGED
data/lib/repull.rb
CHANGED
|
@@ -486,6 +486,36 @@ require 'repull/models/preapprove_conversation_request'
|
|
|
486
486
|
require 'repull/models/preview_conversation_special_offer_request'
|
|
487
487
|
require 'repull/models/preview_conversation_special_offer_request_fees_inner'
|
|
488
488
|
require 'repull/models/preview_conversation_special_offer_request_guests'
|
|
489
|
+
require 'repull/models/promotion'
|
|
490
|
+
require 'repull/models/promotion_applies_to'
|
|
491
|
+
require 'repull/models/promotion_bulk_request'
|
|
492
|
+
require 'repull/models/promotion_bulk_response'
|
|
493
|
+
require 'repull/models/promotion_bulk_response_data_inner'
|
|
494
|
+
require 'repull/models/promotion_bulk_response_data_inner_error'
|
|
495
|
+
require 'repull/models/promotion_bulk_response_summary'
|
|
496
|
+
require 'repull/models/promotion_catalog'
|
|
497
|
+
require 'repull/models/promotion_catalog_channels_inner'
|
|
498
|
+
require 'repull/models/promotion_catalog_entry'
|
|
499
|
+
require 'repull/models/promotion_catalog_field'
|
|
500
|
+
require 'repull/models/promotion_catalog_field_options_inner'
|
|
501
|
+
require 'repull/models/promotion_catalog_response'
|
|
502
|
+
require 'repull/models/promotion_create_request'
|
|
503
|
+
require 'repull/models/promotion_delete_response'
|
|
504
|
+
require 'repull/models/promotion_delete_response_data'
|
|
505
|
+
require 'repull/models/promotion_discount'
|
|
506
|
+
require 'repull/models/promotion_input'
|
|
507
|
+
require 'repull/models/promotion_list_response'
|
|
508
|
+
require 'repull/models/promotion_refresh_response'
|
|
509
|
+
require 'repull/models/promotion_response'
|
|
510
|
+
require 'repull/models/promotion_rules'
|
|
511
|
+
require 'repull/models/promotion_rules_blackout_dates_quota'
|
|
512
|
+
require 'repull/models/promotion_rules_booking_window'
|
|
513
|
+
require 'repull/models/promotion_rules_last_minute'
|
|
514
|
+
require 'repull/models/promotion_rules_stay_window'
|
|
515
|
+
require 'repull/models/promotion_type'
|
|
516
|
+
require 'repull/models/promotion_update_request'
|
|
517
|
+
require 'repull/models/promotion_usage'
|
|
518
|
+
require 'repull/models/promotion_usage_revenue'
|
|
489
519
|
require 'repull/models/property'
|
|
490
520
|
require 'repull/models/property_availability'
|
|
491
521
|
require 'repull/models/property_availability_coverage'
|
|
@@ -715,6 +745,7 @@ require 'repull/api/markets_api'
|
|
|
715
745
|
require 'repull/api/migrate_api'
|
|
716
746
|
require 'repull/api/plumguide_api'
|
|
717
747
|
require 'repull/api/pricing_api'
|
|
748
|
+
require 'repull/api/promotions_api'
|
|
718
749
|
require 'repull/api/properties_api'
|
|
719
750
|
require 'repull/api/quotes_api'
|
|
720
751
|
require 'repull/api/reservations_api'
|