repull 0.2.33 → 0.2.35

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +4 -4
  3. data/lib/repull/api/health_api.rb +3 -3
  4. data/lib/repull/api/promotions_api.rb +574 -0
  5. data/lib/repull/models/connect_session_completed_payload.rb +1 -1
  6. data/lib/repull/models/connect_status_accounts_inner.rb +12 -1
  7. data/lib/repull/models/create_connect_session_request.rb +25 -1
  8. data/lib/repull/models/create_connection_request.rb +2 -22
  9. data/lib/repull/models/list_connection_units200_response.rb +12 -1
  10. data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -0
  11. data/lib/repull/models/listing_address.rb +62 -5
  12. data/lib/repull/models/listing_updated_payload.rb +2 -2
  13. data/lib/repull/models/message.rb +24 -1
  14. data/lib/repull/models/postal_address.rb +216 -0
  15. data/lib/repull/models/promotion.rb +344 -0
  16. data/lib/repull/models/promotion_applies_to.rb +161 -0
  17. data/lib/repull/models/promotion_bulk_request.rb +236 -0
  18. data/lib/repull/models/{plumguide_listing_list_response.rb → promotion_bulk_response.rb} +11 -11
  19. data/lib/repull/models/{calendar_updated_payload.rb → promotion_bulk_response_data_inner.rb} +23 -33
  20. data/lib/repull/models/promotion_bulk_response_data_inner_error.rb +165 -0
  21. data/lib/repull/models/promotion_bulk_response_summary.rb +156 -0
  22. data/lib/repull/models/{plumguide_listing.rb → promotion_catalog.rb} +18 -27
  23. data/lib/repull/models/promotion_catalog_channels_inner.rb +222 -0
  24. data/lib/repull/models/promotion_catalog_entry.rb +265 -0
  25. data/lib/repull/models/promotion_catalog_field.rb +205 -0
  26. data/lib/repull/models/{calendar_updated_payload_range.rb → promotion_catalog_field_options_inner.rb} +16 -16
  27. data/lib/repull/models/promotion_catalog_response.rb +147 -0
  28. data/lib/repull/models/promotion_create_request.rb +258 -0
  29. data/lib/repull/models/promotion_delete_response.rb +147 -0
  30. data/lib/repull/models/promotion_delete_response_data.rb +156 -0
  31. data/lib/repull/models/promotion_discount.rb +191 -0
  32. data/lib/repull/models/promotion_input.rb +241 -0
  33. data/lib/repull/models/promotion_list_response.rb +170 -0
  34. data/lib/repull/models/promotion_refresh_response.rb +170 -0
  35. data/lib/repull/models/promotion_response.rb +147 -0
  36. data/lib/repull/models/{calendar_updated_event.rb → promotion_rules.rb} +113 -104
  37. data/lib/repull/models/promotion_rules_blackout_dates_quota.rb +156 -0
  38. data/lib/repull/models/promotion_rules_booking_window.rb +230 -0
  39. data/lib/repull/models/promotion_rules_last_minute.rb +218 -0
  40. data/lib/repull/models/promotion_rules_stay_window.rb +211 -0
  41. data/lib/repull/models/promotion_type.rb +47 -0
  42. data/lib/repull/models/promotion_update_request.rb +175 -0
  43. data/lib/repull/models/promotion_usage.rb +193 -0
  44. data/lib/repull/models/promotion_usage_revenue.rb +156 -0
  45. data/lib/repull/models/property.rb +12 -2
  46. data/lib/repull/models/reservation_money_line.rb +14 -4
  47. data/lib/repull/models/webhook_event.rb +0 -2
  48. data/lib/repull/models/webhook_event_type.rb +1 -2
  49. data/lib/repull/version.rb +1 -1
  50. data/lib/repull.rb +32 -6
  51. data/openapi/v1.json +1193 -357
  52. data/scripts/regen.sh +1 -1
  53. metadata +34 -8
  54. data/lib/repull/api/plumguide_api.rb +0 -552
@@ -0,0 +1,236 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | unlimited (10 included, then billed per listing) | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ class PromotionBulkRequest < ApiModelBase
18
+ attr_accessor :listing_ids
19
+
20
+ attr_accessor :action
21
+
22
+ attr_accessor :promotion
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'listing_ids' => :'listingIds',
28
+ :'action' => :'action',
29
+ :'promotion' => :'promotion'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'listing_ids' => :'Array<Integer>',
47
+ :'action' => :'String',
48
+ :'promotion' => :'PromotionInput'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PromotionBulkRequest` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PromotionBulkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'listing_ids')
75
+ if (value = attributes[:'listing_ids']).is_a?(Array)
76
+ self.listing_ids = value
77
+ end
78
+ else
79
+ self.listing_ids = nil
80
+ end
81
+
82
+ if attributes.key?(:'action')
83
+ self.action = attributes[:'action']
84
+ else
85
+ self.action = nil
86
+ end
87
+
88
+ if attributes.key?(:'promotion')
89
+ self.promotion = attributes[:'promotion']
90
+ else
91
+ self.promotion = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @listing_ids.nil?
101
+ invalid_properties.push('invalid value for "listing_ids", listing_ids cannot be nil.')
102
+ end
103
+
104
+ if @listing_ids.length > 100
105
+ invalid_properties.push('invalid value for "listing_ids", number of items must be less than or equal to 100.')
106
+ end
107
+
108
+ if @listing_ids.length < 1
109
+ invalid_properties.push('invalid value for "listing_ids", number of items must be greater than or equal to 1.')
110
+ end
111
+
112
+ if @action.nil?
113
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
114
+ end
115
+
116
+ if @promotion.nil?
117
+ invalid_properties.push('invalid value for "promotion", promotion cannot be nil.')
118
+ end
119
+
120
+ invalid_properties
121
+ end
122
+
123
+ # Check to see if the all the properties in the model are valid
124
+ # @return true if the model is valid
125
+ def valid?
126
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
+ return false if @listing_ids.nil?
128
+ return false if @listing_ids.length > 100
129
+ return false if @listing_ids.length < 1
130
+ return false if @action.nil?
131
+ return false if @promotion.nil?
132
+ true
133
+ end
134
+
135
+ # Custom attribute writer method with validation
136
+ # @param [Object] listing_ids Value to be assigned
137
+ def listing_ids=(listing_ids)
138
+ if listing_ids.nil?
139
+ fail ArgumentError, 'listing_ids cannot be nil'
140
+ end
141
+
142
+ if listing_ids.length > 100
143
+ fail ArgumentError, 'invalid value for "listing_ids", number of items must be less than or equal to 100.'
144
+ end
145
+
146
+ if listing_ids.length < 1
147
+ fail ArgumentError, 'invalid value for "listing_ids", number of items must be greater than or equal to 1.'
148
+ end
149
+
150
+ @listing_ids = listing_ids
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] action Value to be assigned
155
+ def action=(action)
156
+ if action.nil?
157
+ fail ArgumentError, 'action cannot be nil'
158
+ end
159
+
160
+ @action = action
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] promotion Value to be assigned
165
+ def promotion=(promotion)
166
+ if promotion.nil?
167
+ fail ArgumentError, 'promotion cannot be nil'
168
+ end
169
+
170
+ @promotion = promotion
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ listing_ids == o.listing_ids &&
179
+ action == o.action &&
180
+ promotion == o.promotion
181
+ end
182
+
183
+ # @see the `==` method
184
+ # @param [Object] Object to be compared
185
+ def eql?(o)
186
+ self == o
187
+ end
188
+
189
+ # Calculates hash code according to all attributes.
190
+ # @return [Integer] Hash code
191
+ def hash
192
+ [listing_ids, action, promotion].hash
193
+ end
194
+
195
+ # Builds the object from hash
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ # @return [Object] Returns the model itself
198
+ def self.build_from_hash(attributes)
199
+ return nil unless attributes.is_a?(Hash)
200
+ attributes = attributes.transform_keys(&:to_sym)
201
+ transformed_hash = {}
202
+ openapi_types.each_pair do |key, type|
203
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = nil
205
+ elsif type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[attribute_map[key]].is_a?(Array)
209
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
210
+ end
211
+ elsif !attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
213
+ end
214
+ end
215
+ new(transformed_hash)
216
+ end
217
+
218
+ # Returns the object in the form of hash
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_hash
221
+ hash = {}
222
+ self.class.attribute_map.each_pair do |attr, param|
223
+ value = self.send(attr)
224
+ if value.nil?
225
+ is_nullable = self.class.openapi_nullable.include?(attr)
226
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
+ end
228
+
229
+ hash[param] = _to_hash(value)
230
+ end
231
+ hash
232
+ end
233
+
234
+ end
235
+
236
+ end
@@ -14,16 +14,16 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- class PlumguideListingListResponse < ApiModelBase
17
+ class PromotionBulkResponse < ApiModelBase
18
18
  attr_accessor :data
19
19
 
20
- attr_accessor :pagination
20
+ attr_accessor :summary
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
23
23
  def self.attribute_map
24
24
  {
25
25
  :'data' => :'data',
26
- :'pagination' => :'pagination'
26
+ :'summary' => :'summary'
27
27
  }
28
28
  end
29
29
 
@@ -40,8 +40,8 @@ module Repull
40
40
  # Attribute type mapping.
41
41
  def self.openapi_types
42
42
  {
43
- :'data' => :'Array<PlumguideListing>',
44
- :'pagination' => :'Pagination'
43
+ :'data' => :'Array<PromotionBulkResponseDataInner>',
44
+ :'summary' => :'PromotionBulkResponseSummary'
45
45
  }
46
46
  end
47
47
 
@@ -55,14 +55,14 @@ module Repull
55
55
  # @param [Hash] attributes Model attributes in the form of hash
56
56
  def initialize(attributes = {})
57
57
  if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PlumguideListingListResponse` initialize method"
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PromotionBulkResponse` initialize method"
59
59
  end
60
60
 
61
61
  # check to see if the attribute exists and convert string to symbol for hash key
62
62
  acceptable_attribute_map = self.class.acceptable_attribute_map
63
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
64
64
  if (!acceptable_attribute_map.key?(k.to_sym))
65
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PlumguideListingListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PromotionBulkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
66
  end
67
67
  h[k.to_sym] = v
68
68
  }
@@ -73,8 +73,8 @@ module Repull
73
73
  end
74
74
  end
75
75
 
76
- if attributes.key?(:'pagination')
77
- self.pagination = attributes[:'pagination']
76
+ if attributes.key?(:'summary')
77
+ self.summary = attributes[:'summary']
78
78
  end
79
79
  end
80
80
 
@@ -99,7 +99,7 @@ module Repull
99
99
  return true if self.equal?(o)
100
100
  self.class == o.class &&
101
101
  data == o.data &&
102
- pagination == o.pagination
102
+ summary == o.summary
103
103
  end
104
104
 
105
105
  # @see the `==` method
@@ -111,7 +111,7 @@ module Repull
111
111
  # Calculates hash code according to all attributes.
112
112
  # @return [Integer] Hash code
113
113
  def hash
114
- [data, pagination].hash
114
+ [data, summary].hash
115
115
  end
116
116
 
117
117
  # Builds the object from hash
@@ -14,26 +14,22 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Payload for `calendar.updated`. Availability or pricing for a listing was updated.
18
- class CalendarUpdatedPayload < ApiModelBase
17
+ class PromotionBulkResponseDataInner < ApiModelBase
19
18
  attr_accessor :listing_id
20
19
 
21
- attr_accessor :range
20
+ attr_accessor :ok
22
21
 
23
- attr_accessor :affected_dates
22
+ attr_accessor :promotion
24
23
 
25
- attr_accessor :pricing_changed
26
-
27
- attr_accessor :availability_changed
24
+ attr_accessor :error
28
25
 
29
26
  # Attribute mapping from ruby-style variable name to JSON key.
30
27
  def self.attribute_map
31
28
  {
32
29
  :'listing_id' => :'listingId',
33
- :'range' => :'range',
34
- :'affected_dates' => :'affectedDates',
35
- :'pricing_changed' => :'pricingChanged',
36
- :'availability_changed' => :'availabilityChanged'
30
+ :'ok' => :'ok',
31
+ :'promotion' => :'promotion',
32
+ :'error' => :'error'
37
33
  }
38
34
  end
39
35
 
@@ -50,11 +46,10 @@ module Repull
50
46
  # Attribute type mapping.
51
47
  def self.openapi_types
52
48
  {
53
- :'listing_id' => :'Integer',
54
- :'range' => :'CalendarUpdatedPayloadRange',
55
- :'affected_dates' => :'Integer',
56
- :'pricing_changed' => :'Boolean',
57
- :'availability_changed' => :'Boolean'
49
+ :'listing_id' => :'String',
50
+ :'ok' => :'Boolean',
51
+ :'promotion' => :'Promotion',
52
+ :'error' => :'PromotionBulkResponseDataInnerError'
58
53
  }
59
54
  end
60
55
 
@@ -68,14 +63,14 @@ module Repull
68
63
  # @param [Hash] attributes Model attributes in the form of hash
69
64
  def initialize(attributes = {})
70
65
  if (!attributes.is_a?(Hash))
71
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::CalendarUpdatedPayload` initialize method"
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PromotionBulkResponseDataInner` initialize method"
72
67
  end
73
68
 
74
69
  # check to see if the attribute exists and convert string to symbol for hash key
75
70
  acceptable_attribute_map = self.class.acceptable_attribute_map
76
71
  attributes = attributes.each_with_object({}) { |(k, v), h|
77
72
  if (!acceptable_attribute_map.key?(k.to_sym))
78
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::CalendarUpdatedPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PromotionBulkResponseDataInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
74
  end
80
75
  h[k.to_sym] = v
81
76
  }
@@ -84,20 +79,16 @@ module Repull
84
79
  self.listing_id = attributes[:'listing_id']
85
80
  end
86
81
 
87
- if attributes.key?(:'range')
88
- self.range = attributes[:'range']
89
- end
90
-
91
- if attributes.key?(:'affected_dates')
92
- self.affected_dates = attributes[:'affected_dates']
82
+ if attributes.key?(:'ok')
83
+ self.ok = attributes[:'ok']
93
84
  end
94
85
 
95
- if attributes.key?(:'pricing_changed')
96
- self.pricing_changed = attributes[:'pricing_changed']
86
+ if attributes.key?(:'promotion')
87
+ self.promotion = attributes[:'promotion']
97
88
  end
98
89
 
99
- if attributes.key?(:'availability_changed')
100
- self.availability_changed = attributes[:'availability_changed']
90
+ if attributes.key?(:'error')
91
+ self.error = attributes[:'error']
101
92
  end
102
93
  end
103
94
 
@@ -122,10 +113,9 @@ module Repull
122
113
  return true if self.equal?(o)
123
114
  self.class == o.class &&
124
115
  listing_id == o.listing_id &&
125
- range == o.range &&
126
- affected_dates == o.affected_dates &&
127
- pricing_changed == o.pricing_changed &&
128
- availability_changed == o.availability_changed
116
+ ok == o.ok &&
117
+ promotion == o.promotion &&
118
+ error == o.error
129
119
  end
130
120
 
131
121
  # @see the `==` method
@@ -137,7 +127,7 @@ module Repull
137
127
  # Calculates hash code according to all attributes.
138
128
  # @return [Integer] Hash code
139
129
  def hash
140
- [listing_id, range, affected_dates, pricing_changed, availability_changed].hash
130
+ [listing_id, ok, promotion, error].hash
141
131
  end
142
132
 
143
133
  # Builds the object from hash
@@ -0,0 +1,165 @@
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 PromotionBulkResponseDataInnerError < ApiModelBase
18
+ attr_accessor :message
19
+
20
+ attr_accessor :code
21
+
22
+ attr_accessor :field
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'message' => :'message',
28
+ :'code' => :'code',
29
+ :'field' => :'field'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'message' => :'String',
47
+ :'code' => :'String',
48
+ :'field' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PromotionBulkResponseDataInnerError` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PromotionBulkResponseDataInnerError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'message')
75
+ self.message = attributes[:'message']
76
+ end
77
+
78
+ if attributes.key?(:'code')
79
+ self.code = attributes[:'code']
80
+ end
81
+
82
+ if attributes.key?(:'field')
83
+ self.field = attributes[:'field']
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
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ message == o.message &&
108
+ code == o.code &&
109
+ field == o.field
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [message, code, field].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end