repull 0.2.35 → 0.2.37

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +70 -2
  3. data/lib/repull/api/conversations_api.rb +2 -2
  4. data/lib/repull/api/listings_api.rb +8 -8
  5. data/lib/repull/api/migrate_api.rb +68 -0
  6. data/lib/repull/api/reservations_api.rb +4 -4
  7. data/lib/repull/models/account_disconnected_payload.rb +16 -4
  8. data/lib/repull/models/account_disconnected_payload_listings_inner.rb +157 -0
  9. data/lib/repull/models/airbnb_calendar_operation.rb +12 -12
  10. data/lib/repull/models/booking_unacknowledged_event.rb +281 -0
  11. data/lib/repull/models/booking_unacknowledged_payload.rb +229 -0
  12. data/lib/repull/models/channel_degraded_event.rb +279 -0
  13. data/lib/repull/models/channel_degraded_payload.rb +174 -0
  14. data/lib/repull/models/channel_degraded_payload_object.rb +262 -0
  15. data/lib/repull/models/channel_sync_failed_event.rb +280 -0
  16. data/lib/repull/models/channel_sync_failure_payload.rb +214 -0
  17. data/lib/repull/models/channel_sync_failure_payload_failures_inner.rb +213 -0
  18. data/lib/repull/models/channel_sync_failure_payload_object.rb +289 -0
  19. data/lib/repull/models/charge_per.rb +42 -0
  20. data/lib/repull/models/create_connect_session_request.rb +2 -2
  21. data/lib/repull/models/create_connection_request.rb +1 -1
  22. data/lib/repull/models/import_from_channex200_response.rb +147 -0
  23. data/lib/repull/models/import_from_channex200_response_data.rb +324 -0
  24. data/lib/repull/models/import_from_channex200_response_data_channels_inner.rb +263 -0
  25. data/lib/repull/models/import_from_channex200_response_data_properties_inner.rb +222 -0
  26. data/lib/repull/models/import_from_channex200_response_data_summary.rb +201 -0
  27. data/lib/repull/models/import_from_channex200_response_data_summary_bookings.rb +165 -0
  28. data/lib/repull/models/import_from_channex200_response_data_summary_properties.rb +165 -0
  29. data/lib/repull/models/import_from_channex_request.rb +223 -0
  30. data/lib/repull/models/inquiry_webhook_object.rb +10 -1
  31. data/lib/repull/models/inquiry_webhook_object_guest.rb +159 -0
  32. data/lib/repull/models/list_inquiries200_response_data_inner.rb +27 -1
  33. data/lib/repull/models/list_inquiries200_response_data_inner_guest.rb +160 -0
  34. data/lib/repull/models/listing.rb +82 -1
  35. data/lib/repull/models/listing_channel.rb +15 -4
  36. data/lib/repull/models/listing_content_photo.rb +206 -0
  37. data/lib/repull/models/listing_fee.rb +229 -0
  38. data/lib/repull/models/listing_policies.rb +257 -0
  39. data/lib/repull/models/listing_policies_check_in.rb +179 -0
  40. data/lib/repull/models/listing_policies_check_out.rb +148 -0
  41. data/lib/repull/models/listing_policies_quiet_hours.rb +156 -0
  42. data/lib/repull/models/listing_pricing_settings.rb +233 -0
  43. data/lib/repull/models/listing_room.rb +190 -0
  44. data/lib/repull/models/listing_room_beds_inner.rb +156 -0
  45. data/lib/repull/models/listing_rules.rb +212 -0
  46. data/lib/repull/models/listing_tax.rb +241 -0
  47. data/lib/repull/models/listing_webhook_object_channels_inner.rb +16 -5
  48. data/lib/repull/models/reservation.rb +25 -1
  49. data/lib/repull/models/reservation_access_code.rb +301 -0
  50. data/lib/repull/models/reservation_access_code_locks_inner.rb +190 -0
  51. data/lib/repull/models/reservation_thread_assigned_event.rb +279 -0
  52. data/lib/repull/models/reservation_thread_assigned_payload.rb +174 -0
  53. data/lib/repull/models/reservation_thread_assigned_payload_object.rb +249 -0
  54. data/lib/repull/models/submit_ciirus_credentials200_response.rb +213 -0
  55. data/lib/repull/models/submit_ciirus_credentials200_response_account_info.rb +159 -0
  56. data/lib/repull/models/submit_ciirus_credentials_request.rb +184 -0
  57. data/lib/repull/models/submit_ciirus_credentials_request_credentials.rb +203 -0
  58. data/lib/repull/models/webhook_event.rb +8 -0
  59. data/lib/repull/models/webhook_event_type.rb +5 -1
  60. data/lib/repull/version.rb +1 -1
  61. data/lib/repull.rb +41 -0
  62. data/openapi/v1.json +1937 -32
  63. data/scripts/regen.sh +1 -1
  64. metadata +43 -4
  65. data/spec/api/plumguide_api_spec.rb +0 -85
@@ -0,0 +1,241 @@
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
+ # A tax charged to the guest. One shape for every channel and PMS.
18
+ class ListingTax < ApiModelBase
19
+ # `vat`, `vat_gst`, `city_tax`, `transient_occupancy_tax`, …
20
+ attr_accessor :type
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :amount
25
+
26
+ attr_accessor :amount_type
27
+
28
+ attr_accessor :charged_per
29
+
30
+ # What it is charged on (`accommodation`, `cleaning`, other fee types). `null`: the whole stay.
31
+ attr_accessor :applies_to
32
+
33
+ # Already included in the price rather than added on top.
34
+ attr_accessor :included
35
+
36
+ # `airbnb` (host-remitted), `airbnb_collected` (Airbnb collects and remits), `guesty`, …
37
+ attr_accessor :source
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'type' => :'type',
65
+ :'name' => :'name',
66
+ :'amount' => :'amount',
67
+ :'amount_type' => :'amountType',
68
+ :'charged_per' => :'chargedPer',
69
+ :'applies_to' => :'appliesTo',
70
+ :'included' => :'included',
71
+ :'source' => :'source'
72
+ }
73
+ end
74
+
75
+ # Returns attribute mapping this model knows about
76
+ def self.acceptable_attribute_map
77
+ attribute_map
78
+ end
79
+
80
+ # Returns all the JSON keys this model knows about
81
+ def self.acceptable_attributes
82
+ acceptable_attribute_map.values
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.openapi_types
87
+ {
88
+ :'type' => :'String',
89
+ :'name' => :'String',
90
+ :'amount' => :'Float',
91
+ :'amount_type' => :'String',
92
+ :'charged_per' => :'ChargePer',
93
+ :'applies_to' => :'Array<String>',
94
+ :'included' => :'Boolean',
95
+ :'source' => :'String'
96
+ }
97
+ end
98
+
99
+ # List of attributes with nullable: true
100
+ def self.openapi_nullable
101
+ Set.new([
102
+ :'name',
103
+ :'applies_to',
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingTax` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ acceptable_attribute_map = self.class.acceptable_attribute_map
116
+ attributes = attributes.each_with_object({}) { |(k, v), h|
117
+ if (!acceptable_attribute_map.key?(k.to_sym))
118
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingTax`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
119
+ end
120
+ h[k.to_sym] = v
121
+ }
122
+
123
+ if attributes.key?(:'type')
124
+ self.type = attributes[:'type']
125
+ end
126
+
127
+ if attributes.key?(:'name')
128
+ self.name = attributes[:'name']
129
+ end
130
+
131
+ if attributes.key?(:'amount')
132
+ self.amount = attributes[:'amount']
133
+ end
134
+
135
+ if attributes.key?(:'amount_type')
136
+ self.amount_type = attributes[:'amount_type']
137
+ end
138
+
139
+ if attributes.key?(:'charged_per')
140
+ self.charged_per = attributes[:'charged_per']
141
+ end
142
+
143
+ if attributes.key?(:'applies_to')
144
+ if (value = attributes[:'applies_to']).is_a?(Array)
145
+ self.applies_to = value
146
+ end
147
+ end
148
+
149
+ if attributes.key?(:'included')
150
+ self.included = attributes[:'included']
151
+ end
152
+
153
+ if attributes.key?(:'source')
154
+ self.source = attributes[:'source']
155
+ end
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properties with the reasons
160
+ def list_invalid_properties
161
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
162
+ invalid_properties = Array.new
163
+ invalid_properties
164
+ end
165
+
166
+ # Check to see if the all the properties in the model are valid
167
+ # @return true if the model is valid
168
+ def valid?
169
+ warn '[DEPRECATED] the `valid?` method is obsolete'
170
+ true
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
+ type == o.type &&
179
+ name == o.name &&
180
+ amount == o.amount &&
181
+ amount_type == o.amount_type &&
182
+ charged_per == o.charged_per &&
183
+ applies_to == o.applies_to &&
184
+ included == o.included &&
185
+ source == o.source
186
+ end
187
+
188
+ # @see the `==` method
189
+ # @param [Object] Object to be compared
190
+ def eql?(o)
191
+ self == o
192
+ end
193
+
194
+ # Calculates hash code according to all attributes.
195
+ # @return [Integer] Hash code
196
+ def hash
197
+ [type, name, amount, amount_type, charged_per, applies_to, included, source].hash
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def self.build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ attributes = attributes.transform_keys(&:to_sym)
206
+ transformed_hash = {}
207
+ openapi_types.each_pair do |key, type|
208
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
209
+ transformed_hash["#{key}"] = nil
210
+ elsif type =~ /\AArray<(.*)>/i
211
+ # check to ensure the input is an array given that the attribute
212
+ # is documented as an array but the input is not
213
+ if attributes[attribute_map[key]].is_a?(Array)
214
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
215
+ end
216
+ elsif !attributes[attribute_map[key]].nil?
217
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
218
+ end
219
+ end
220
+ new(transformed_hash)
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ end
240
+
241
+ end
@@ -25,6 +25,9 @@ module Repull
25
25
 
26
26
  attr_accessor :sync_category
27
27
 
28
+ # The connected account this listing belongs to on this channel — for Airbnb the host account (`externalAccountId` is the Airbnb host id). The same account `account.disconnected` names, so a disconnect can be matched to its listings. Null when it cannot be resolved.
29
+ attr_accessor :account
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
  :'external_id' => :'externalId',
33
36
  :'active' => :'active',
34
37
  :'sync_enabled' => :'syncEnabled',
35
- :'sync_category' => :'syncCategory'
38
+ :'sync_category' => :'syncCategory',
39
+ :'account' => :'account'
36
40
  }
37
41
  end
38
42
 
@@ -53,14 +57,16 @@ module Repull
53
57
  :'external_id' => :'String',
54
58
  :'active' => :'Boolean',
55
59
  :'sync_enabled' => :'Boolean',
56
- :'sync_category' => :'String'
60
+ :'sync_category' => :'String',
61
+ :'account' => :'RecordAccount'
57
62
  }
58
63
  end
59
64
 
60
65
  # List of attributes with nullable: true
61
66
  def self.openapi_nullable
62
67
  Set.new([
63
- :'sync_category'
68
+ :'sync_category',
69
+ :'account'
64
70
  ])
65
71
  end
66
72
 
@@ -99,6 +105,10 @@ module Repull
99
105
  if attributes.key?(:'sync_category')
100
106
  self.sync_category = attributes[:'sync_category']
101
107
  end
108
+
109
+ if attributes.key?(:'account')
110
+ self.account = attributes[:'account']
111
+ end
102
112
  end
103
113
 
104
114
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -125,7 +135,8 @@ module Repull
125
135
  external_id == o.external_id &&
126
136
  active == o.active &&
127
137
  sync_enabled == o.sync_enabled &&
128
- sync_category == o.sync_category
138
+ sync_category == o.sync_category &&
139
+ account == o.account
129
140
  end
130
141
 
131
142
  # @see the `==` method
@@ -137,7 +148,7 @@ module Repull
137
148
  # Calculates hash code according to all attributes.
138
149
  # @return [Integer] Hash code
139
150
  def hash
140
- [platform, external_id, active, sync_enabled, sync_category].hash
151
+ [platform, external_id, active, sync_enabled, sync_category, account].hash
141
152
  end
142
153
 
143
154
  # Builds the object from hash
@@ -73,6 +73,12 @@ module Repull
73
73
 
74
74
  attr_accessor :unit
75
75
 
76
+ # The PMS's own id for this reservation (for example Guesty's reservation `_id`), so you can look it up in the PMS. `null` when the reservation did not come from a PMS.
77
+ attr_accessor :pms_reservation_id
78
+
79
+ # Door codes for the stay from the PMS's lock manager (today: Guesty Locks Manager), refreshed about every 30 minutes for stays checking in within 14 days that have not checked out. `null` when the reservation's codes are not read from a PMS. `[]` when they are and there is none yet, and for a cancelled stay.
80
+ attr_accessor :access_codes
81
+
76
82
  # Inline guest summary. May be undefined for owner-blocks / pre-arrival rows.
77
83
  attr_accessor :primary_guest
78
84
 
@@ -126,6 +132,8 @@ module Repull
126
132
  :'platform' => :'platform',
127
133
  :'confirmation_code' => :'confirmationCode',
128
134
  :'unit' => :'unit',
135
+ :'pms_reservation_id' => :'pmsReservationId',
136
+ :'access_codes' => :'accessCodes',
129
137
  :'primary_guest' => :'primaryGuest',
130
138
  :'occupancy' => :'occupancy',
131
139
  :'financials' => :'financials',
@@ -172,6 +180,8 @@ module Repull
172
180
  :'platform' => :'String',
173
181
  :'confirmation_code' => :'String',
174
182
  :'unit' => :'ReservationUnit',
183
+ :'pms_reservation_id' => :'String',
184
+ :'access_codes' => :'Array<ReservationAccessCode>',
175
185
  :'primary_guest' => :'ReservationPrimaryGuest',
176
186
  :'occupancy' => :'ReservationOccupancy',
177
187
  :'financials' => :'ReservationFinancials',
@@ -198,6 +208,8 @@ module Repull
198
208
  :'source',
199
209
  :'platform',
200
210
  :'unit',
211
+ :'pms_reservation_id',
212
+ :'access_codes',
201
213
  :'booked_at',
202
214
  :'guest_name'
203
215
  ])
@@ -311,6 +323,16 @@ module Repull
311
323
  self.unit = attributes[:'unit']
312
324
  end
313
325
 
326
+ if attributes.key?(:'pms_reservation_id')
327
+ self.pms_reservation_id = attributes[:'pms_reservation_id']
328
+ end
329
+
330
+ if attributes.key?(:'access_codes')
331
+ if (value = attributes[:'access_codes']).is_a?(Array)
332
+ self.access_codes = value
333
+ end
334
+ end
335
+
314
336
  if attributes.key?(:'primary_guest')
315
337
  self.primary_guest = attributes[:'primary_guest']
316
338
  end
@@ -518,6 +540,8 @@ module Repull
518
540
  platform == o.platform &&
519
541
  confirmation_code == o.confirmation_code &&
520
542
  unit == o.unit &&
543
+ pms_reservation_id == o.pms_reservation_id &&
544
+ access_codes == o.access_codes &&
521
545
  primary_guest == o.primary_guest &&
522
546
  occupancy == o.occupancy &&
523
547
  financials == o.financials &&
@@ -539,7 +563,7 @@ module Repull
539
563
  # Calculates hash code according to all attributes.
540
564
  # @return [Integer] Hash code
541
565
  def hash
542
- [account, id, listing_id, guest_id, check_in, check_out, check_in_time, check_out_time, guest_notes, conversation_id, external_thread_id, inquiry_id, status, status_detail, pending_reason, respond_by, source, platform, confirmation_code, unit, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
566
+ [account, id, listing_id, guest_id, check_in, check_out, check_in_time, check_out_time, guest_notes, conversation_id, external_thread_id, inquiry_id, status, status_detail, pending_reason, respond_by, source, platform, confirmation_code, unit, pms_reservation_id, access_codes, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
543
567
  end
544
568
 
545
569
  # Builds the object from hash
@@ -0,0 +1,301 @@
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
+ # One door code for a stay, as the PMS reported it.
18
+ class ReservationAccessCode < ApiModelBase
19
+ # The code to enter on the lock.
20
+ attr_accessor :code
21
+
22
+ # `guest`: the code to give the guest. `backup`: give it only if the guest code fails; Guesty may change a backup code read before check-in day.
23
+ attr_accessor :type
24
+
25
+ # The PMS's status for the code, lower-cased.
26
+ attr_accessor :status
27
+
28
+ # When the code starts working. `null` when the PMS gives no window.
29
+ attr_accessor :valid_from
30
+
31
+ # When the code stops working. `null` when the PMS gives no window.
32
+ attr_accessor :valid_until
33
+
34
+ # The locks the code opens.
35
+ attr_accessor :locks
36
+
37
+ # The PMS the code was read from.
38
+ attr_accessor :source
39
+
40
+ # When the codes were last read from the PMS.
41
+ attr_accessor :updated_at
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'code' => :'code',
47
+ :'type' => :'type',
48
+ :'status' => :'status',
49
+ :'valid_from' => :'validFrom',
50
+ :'valid_until' => :'validUntil',
51
+ :'locks' => :'locks',
52
+ :'source' => :'source',
53
+ :'updated_at' => :'updatedAt'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'code' => :'String',
71
+ :'type' => :'String',
72
+ :'status' => :'String',
73
+ :'valid_from' => :'Time',
74
+ :'valid_until' => :'Time',
75
+ :'locks' => :'Array<ReservationAccessCodeLocksInner>',
76
+ :'source' => :'String',
77
+ :'updated_at' => :'Time'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ :'status',
85
+ :'valid_from',
86
+ :'valid_until',
87
+ :'updated_at'
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ReservationAccessCode` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ acceptable_attribute_map = self.class.acceptable_attribute_map
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!acceptable_attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ReservationAccessCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'code')
108
+ self.code = attributes[:'code']
109
+ else
110
+ self.code = nil
111
+ end
112
+
113
+ if attributes.key?(:'type')
114
+ self.type = attributes[:'type']
115
+ else
116
+ self.type = nil
117
+ end
118
+
119
+ if attributes.key?(:'status')
120
+ self.status = attributes[:'status']
121
+ else
122
+ self.status = nil
123
+ end
124
+
125
+ if attributes.key?(:'valid_from')
126
+ self.valid_from = attributes[:'valid_from']
127
+ else
128
+ self.valid_from = nil
129
+ end
130
+
131
+ if attributes.key?(:'valid_until')
132
+ self.valid_until = attributes[:'valid_until']
133
+ else
134
+ self.valid_until = nil
135
+ end
136
+
137
+ if attributes.key?(:'locks')
138
+ if (value = attributes[:'locks']).is_a?(Array)
139
+ self.locks = value
140
+ end
141
+ else
142
+ self.locks = nil
143
+ end
144
+
145
+ if attributes.key?(:'source')
146
+ self.source = attributes[:'source']
147
+ else
148
+ self.source = nil
149
+ end
150
+
151
+ if attributes.key?(:'updated_at')
152
+ self.updated_at = attributes[:'updated_at']
153
+ else
154
+ self.updated_at = nil
155
+ end
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properties with the reasons
160
+ def list_invalid_properties
161
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
162
+ invalid_properties = Array.new
163
+ if @code.nil?
164
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
165
+ end
166
+
167
+ if @type.nil?
168
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
169
+ end
170
+
171
+ if @locks.nil?
172
+ invalid_properties.push('invalid value for "locks", locks cannot be nil.')
173
+ end
174
+
175
+ if @source.nil?
176
+ invalid_properties.push('invalid value for "source", source cannot be nil.')
177
+ end
178
+
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ warn '[DEPRECATED] the `valid?` method is obsolete'
186
+ return false if @code.nil?
187
+ return false if @type.nil?
188
+ return false if @locks.nil?
189
+ return false if @source.nil?
190
+ true
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] code Value to be assigned
195
+ def code=(code)
196
+ if code.nil?
197
+ fail ArgumentError, 'code cannot be nil'
198
+ end
199
+
200
+ @code = code
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] type Value to be assigned
205
+ def type=(type)
206
+ if type.nil?
207
+ fail ArgumentError, 'type cannot be nil'
208
+ end
209
+
210
+ @type = type
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] locks Value to be assigned
215
+ def locks=(locks)
216
+ if locks.nil?
217
+ fail ArgumentError, 'locks cannot be nil'
218
+ end
219
+
220
+ @locks = locks
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] source Value to be assigned
225
+ def source=(source)
226
+ if source.nil?
227
+ fail ArgumentError, 'source cannot be nil'
228
+ end
229
+
230
+ @source = source
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
+ code == o.code &&
239
+ type == o.type &&
240
+ status == o.status &&
241
+ valid_from == o.valid_from &&
242
+ valid_until == o.valid_until &&
243
+ locks == o.locks &&
244
+ source == o.source &&
245
+ updated_at == o.updated_at
246
+ end
247
+
248
+ # @see the `==` method
249
+ # @param [Object] Object to be compared
250
+ def eql?(o)
251
+ self == o
252
+ end
253
+
254
+ # Calculates hash code according to all attributes.
255
+ # @return [Integer] Hash code
256
+ def hash
257
+ [code, type, status, valid_from, valid_until, locks, source, updated_at].hash
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def self.build_from_hash(attributes)
264
+ return nil unless attributes.is_a?(Hash)
265
+ attributes = attributes.transform_keys(&:to_sym)
266
+ transformed_hash = {}
267
+ openapi_types.each_pair do |key, type|
268
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = nil
270
+ elsif type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[attribute_map[key]].is_a?(Array)
274
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
275
+ end
276
+ elsif !attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
278
+ end
279
+ end
280
+ new(transformed_hash)
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ end
300
+
301
+ end