repull 0.2.61 → 0.2.62

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +200 -0
  3. data/lib/repull/api/listings_api.rb +70 -0
  4. data/lib/repull/api/properties_api.rb +3 -3
  5. data/lib/repull/api/tiket_api.rb +885 -0
  6. data/lib/repull/models/listing_publish_tiket_response.rb +165 -0
  7. data/lib/repull/models/listing_publish_tiket_response_result.rb +182 -0
  8. data/lib/repull/models/map_tiket_connect_rooms_request.rb +201 -0
  9. data/lib/repull/models/map_tiket_connect_rooms_request_mappings_inner.rb +184 -0
  10. data/lib/repull/models/publish_listing_tiket_request.rb +148 -0
  11. data/lib/repull/models/reservation.rb +1 -1
  12. data/lib/repull/models/sync_tiket_request.rb +160 -0
  13. data/lib/repull/models/tiket_ari_day.rb +347 -0
  14. data/lib/repull/models/tiket_ari_mismatch.rb +198 -0
  15. data/lib/repull/models/tiket_ari_update.rb +468 -0
  16. data/lib/repull/models/tiket_ari_write_response.rb +357 -0
  17. data/lib/repull/models/tiket_availability_response.rb +269 -0
  18. data/lib/repull/models/tiket_availability_update_request.rb +241 -0
  19. data/lib/repull/models/tiket_child_price.rb +217 -0
  20. data/lib/repull/models/tiket_connect_claim_response.rb +216 -0
  21. data/lib/repull/models/tiket_connect_map_rooms_response.rb +204 -0
  22. data/lib/repull/models/tiket_connect_rooms_response.rb +295 -0
  23. data/lib/repull/models/tiket_connect_rooms_response_rooms_inner.rb +199 -0
  24. data/lib/repull/models/tiket_content_response.rb +202 -0
  25. data/lib/repull/models/tiket_content_response_objects_inner.rb +237 -0
  26. data/lib/repull/models/tiket_listing_pricing_response.rb +321 -0
  27. data/lib/repull/models/tiket_listing_pricing_update_request.rb +209 -0
  28. data/lib/repull/models/tiket_map_listings_request.rb +202 -0
  29. data/lib/repull/models/tiket_map_listings_request_mappings_inner.rb +186 -0
  30. data/lib/repull/models/tiket_map_listings_response.rb +169 -0
  31. data/lib/repull/models/tiket_map_listings_response_results_inner.rb +176 -0
  32. data/lib/repull/models/tiket_occupancy_price.rb +201 -0
  33. data/lib/repull/models/tiket_property.rb +278 -0
  34. data/lib/repull/models/tiket_property_list_response.rb +166 -0
  35. data/lib/repull/models/tiket_property_listings_inner.rb +175 -0
  36. data/lib/repull/models/tiket_property_rooms_response.rb +192 -0
  37. data/lib/repull/models/tiket_rate_plan.rb +178 -0
  38. data/lib/repull/models/tiket_reservation.rb +421 -0
  39. data/lib/repull/models/tiket_reservation_list_response.rb +192 -0
  40. data/lib/repull/models/tiket_reservation_list_response_pagination.rb +165 -0
  41. data/lib/repull/models/tiket_room.rb +232 -0
  42. data/lib/repull/models/tiket_setup_request.rb +469 -0
  43. data/lib/repull/models/tiket_setup_request_contacts_inner.rb +192 -0
  44. data/lib/repull/models/tiket_setup_request_properties_inner.rb +174 -0
  45. data/lib/repull/models/tiket_setup_response.rb +159 -0
  46. data/lib/repull/models/tiket_sync_response.rb +167 -0
  47. data/lib/repull/models/tiket_sync_response_results_inner.rb +239 -0
  48. data/lib/repull/models/verify_tiket_claim_request.rb +212 -0
  49. data/lib/repull/version.rb +1 -1
  50. data/lib/repull.rb +43 -0
  51. data/openapi/v1.json +8050 -5448
  52. data/spec/api/tiket_api_spec.rb +56 -0
  53. metadata +47 -2
@@ -0,0 +1,347 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ # What tiket.com holds for one night of one room type and rate plan. Rooms to sell (`available`, `booked`) belong to the room type and repeat on each of its rate plans; prices and restrictions belong to the rate plan. A field tiket.com returned nothing for is `null`.
18
+ class TiketAriDay < ApiModelBase
19
+ attr_accessor :date
20
+
21
+ # tiket.com room type id.
22
+ attr_accessor :room_type_code
23
+
24
+ # tiket.com rate plan id. `null` on a room type with no rate plan selected.
25
+ attr_accessor :rate_plan_code
26
+
27
+ # Rooms to sell.
28
+ attr_accessor :available
29
+
30
+ # Rooms tiket.com has sold for the night.
31
+ attr_accessor :booked
32
+
33
+ # Room Based price per night, tax included.
34
+ attr_accessor :price
35
+
36
+ # Occupancy Based prices. Empty on a Room Based property.
37
+ attr_accessor :occupancy_prices
38
+
39
+ # Children prices as tiket.com holds them (set in the extranet; see the note on children rates under `PUT /v1/channels/tiket/availability`).
40
+ attr_accessor :child_prices
41
+
42
+ attr_accessor :currency
43
+
44
+ # Minimum nights.
45
+ attr_accessor :min_stay
46
+
47
+ # Maximum nights.
48
+ attr_accessor :max_stay
49
+
50
+ # `true` when the rate plan is closed for the night.
51
+ attr_accessor :stop_sell
52
+
53
+ attr_accessor :closed_to_arrival
54
+
55
+ attr_accessor :closed_to_departure
56
+
57
+ # Minimum days between booking and arrival.
58
+ attr_accessor :min_advance_days
59
+
60
+ # Maximum days between booking and arrival.
61
+ attr_accessor :max_advance_days
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'date' => :'date',
67
+ :'room_type_code' => :'roomTypeCode',
68
+ :'rate_plan_code' => :'ratePlanCode',
69
+ :'available' => :'available',
70
+ :'booked' => :'booked',
71
+ :'price' => :'price',
72
+ :'occupancy_prices' => :'occupancyPrices',
73
+ :'child_prices' => :'childPrices',
74
+ :'currency' => :'currency',
75
+ :'min_stay' => :'minStay',
76
+ :'max_stay' => :'maxStay',
77
+ :'stop_sell' => :'stopSell',
78
+ :'closed_to_arrival' => :'closedToArrival',
79
+ :'closed_to_departure' => :'closedToDeparture',
80
+ :'min_advance_days' => :'minAdvanceDays',
81
+ :'max_advance_days' => :'maxAdvanceDays'
82
+ }
83
+ end
84
+
85
+ # Returns attribute mapping this model knows about
86
+ def self.acceptable_attribute_map
87
+ attribute_map
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ acceptable_attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'date' => :'Date',
99
+ :'room_type_code' => :'String',
100
+ :'rate_plan_code' => :'String',
101
+ :'available' => :'Integer',
102
+ :'booked' => :'Integer',
103
+ :'price' => :'Float',
104
+ :'occupancy_prices' => :'Array<TiketOccupancyPrice>',
105
+ :'child_prices' => :'Array<TiketChildPrice>',
106
+ :'currency' => :'String',
107
+ :'min_stay' => :'Integer',
108
+ :'max_stay' => :'Integer',
109
+ :'stop_sell' => :'Boolean',
110
+ :'closed_to_arrival' => :'Boolean',
111
+ :'closed_to_departure' => :'Boolean',
112
+ :'min_advance_days' => :'Integer',
113
+ :'max_advance_days' => :'Integer'
114
+ }
115
+ end
116
+
117
+ # List of attributes with nullable: true
118
+ def self.openapi_nullable
119
+ Set.new([
120
+ :'rate_plan_code',
121
+ :'available',
122
+ :'booked',
123
+ :'price',
124
+ :'currency',
125
+ :'min_stay',
126
+ :'max_stay',
127
+ :'stop_sell',
128
+ :'closed_to_arrival',
129
+ :'closed_to_departure',
130
+ :'min_advance_days',
131
+ :'max_advance_days'
132
+ ])
133
+ end
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ if (!attributes.is_a?(Hash))
139
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketAriDay` initialize method"
140
+ end
141
+
142
+ # check to see if the attribute exists and convert string to symbol for hash key
143
+ acceptable_attribute_map = self.class.acceptable_attribute_map
144
+ attributes = attributes.each_with_object({}) { |(k, v), h|
145
+ if (!acceptable_attribute_map.key?(k.to_sym))
146
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketAriDay`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
147
+ end
148
+ h[k.to_sym] = v
149
+ }
150
+
151
+ if attributes.key?(:'date')
152
+ self.date = attributes[:'date']
153
+ else
154
+ self.date = nil
155
+ end
156
+
157
+ if attributes.key?(:'room_type_code')
158
+ self.room_type_code = attributes[:'room_type_code']
159
+ else
160
+ self.room_type_code = nil
161
+ end
162
+
163
+ if attributes.key?(:'rate_plan_code')
164
+ self.rate_plan_code = attributes[:'rate_plan_code']
165
+ else
166
+ self.rate_plan_code = nil
167
+ end
168
+
169
+ if attributes.key?(:'available')
170
+ self.available = attributes[:'available']
171
+ end
172
+
173
+ if attributes.key?(:'booked')
174
+ self.booked = attributes[:'booked']
175
+ end
176
+
177
+ if attributes.key?(:'price')
178
+ self.price = attributes[:'price']
179
+ end
180
+
181
+ if attributes.key?(:'occupancy_prices')
182
+ if (value = attributes[:'occupancy_prices']).is_a?(Array)
183
+ self.occupancy_prices = value
184
+ end
185
+ end
186
+
187
+ if attributes.key?(:'child_prices')
188
+ if (value = attributes[:'child_prices']).is_a?(Array)
189
+ self.child_prices = value
190
+ end
191
+ end
192
+
193
+ if attributes.key?(:'currency')
194
+ self.currency = attributes[:'currency']
195
+ end
196
+
197
+ if attributes.key?(:'min_stay')
198
+ self.min_stay = attributes[:'min_stay']
199
+ end
200
+
201
+ if attributes.key?(:'max_stay')
202
+ self.max_stay = attributes[:'max_stay']
203
+ end
204
+
205
+ if attributes.key?(:'stop_sell')
206
+ self.stop_sell = attributes[:'stop_sell']
207
+ end
208
+
209
+ if attributes.key?(:'closed_to_arrival')
210
+ self.closed_to_arrival = attributes[:'closed_to_arrival']
211
+ end
212
+
213
+ if attributes.key?(:'closed_to_departure')
214
+ self.closed_to_departure = attributes[:'closed_to_departure']
215
+ end
216
+
217
+ if attributes.key?(:'min_advance_days')
218
+ self.min_advance_days = attributes[:'min_advance_days']
219
+ end
220
+
221
+ if attributes.key?(:'max_advance_days')
222
+ self.max_advance_days = attributes[:'max_advance_days']
223
+ end
224
+ end
225
+
226
+ # Show invalid properties with the reasons. Usually used together with valid?
227
+ # @return Array for valid properties with the reasons
228
+ def list_invalid_properties
229
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
230
+ invalid_properties = Array.new
231
+ if @date.nil?
232
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
233
+ end
234
+
235
+ if @room_type_code.nil?
236
+ invalid_properties.push('invalid value for "room_type_code", room_type_code cannot be nil.')
237
+ end
238
+
239
+ invalid_properties
240
+ end
241
+
242
+ # Check to see if the all the properties in the model are valid
243
+ # @return true if the model is valid
244
+ def valid?
245
+ warn '[DEPRECATED] the `valid?` method is obsolete'
246
+ return false if @date.nil?
247
+ return false if @room_type_code.nil?
248
+ true
249
+ end
250
+
251
+ # Custom attribute writer method with validation
252
+ # @param [Object] date Value to be assigned
253
+ def date=(date)
254
+ if date.nil?
255
+ fail ArgumentError, 'date cannot be nil'
256
+ end
257
+
258
+ @date = date
259
+ end
260
+
261
+ # Custom attribute writer method with validation
262
+ # @param [Object] room_type_code Value to be assigned
263
+ def room_type_code=(room_type_code)
264
+ if room_type_code.nil?
265
+ fail ArgumentError, 'room_type_code cannot be nil'
266
+ end
267
+
268
+ @room_type_code = room_type_code
269
+ end
270
+
271
+ # Checks equality by comparing each attribute.
272
+ # @param [Object] Object to be compared
273
+ def ==(o)
274
+ return true if self.equal?(o)
275
+ self.class == o.class &&
276
+ date == o.date &&
277
+ room_type_code == o.room_type_code &&
278
+ rate_plan_code == o.rate_plan_code &&
279
+ available == o.available &&
280
+ booked == o.booked &&
281
+ price == o.price &&
282
+ occupancy_prices == o.occupancy_prices &&
283
+ child_prices == o.child_prices &&
284
+ currency == o.currency &&
285
+ min_stay == o.min_stay &&
286
+ max_stay == o.max_stay &&
287
+ stop_sell == o.stop_sell &&
288
+ closed_to_arrival == o.closed_to_arrival &&
289
+ closed_to_departure == o.closed_to_departure &&
290
+ min_advance_days == o.min_advance_days &&
291
+ max_advance_days == o.max_advance_days
292
+ end
293
+
294
+ # @see the `==` method
295
+ # @param [Object] Object to be compared
296
+ def eql?(o)
297
+ self == o
298
+ end
299
+
300
+ # Calculates hash code according to all attributes.
301
+ # @return [Integer] Hash code
302
+ def hash
303
+ [date, room_type_code, rate_plan_code, available, booked, price, occupancy_prices, child_prices, currency, min_stay, max_stay, stop_sell, closed_to_arrival, closed_to_departure, min_advance_days, max_advance_days].hash
304
+ end
305
+
306
+ # Builds the object from hash
307
+ # @param [Hash] attributes Model attributes in the form of hash
308
+ # @return [Object] Returns the model itself
309
+ def self.build_from_hash(attributes)
310
+ return nil unless attributes.is_a?(Hash)
311
+ attributes = attributes.transform_keys(&:to_sym)
312
+ transformed_hash = {}
313
+ openapi_types.each_pair do |key, type|
314
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
315
+ transformed_hash["#{key}"] = nil
316
+ elsif type =~ /\AArray<(.*)>/i
317
+ # check to ensure the input is an array given that the attribute
318
+ # is documented as an array but the input is not
319
+ if attributes[attribute_map[key]].is_a?(Array)
320
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
321
+ end
322
+ elsif !attributes[attribute_map[key]].nil?
323
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
324
+ end
325
+ end
326
+ new(transformed_hash)
327
+ end
328
+
329
+ # Returns the object in the form of hash
330
+ # @return [Hash] Returns the object in the form of hash
331
+ def to_hash
332
+ hash = {}
333
+ self.class.attribute_map.each_pair do |attr, param|
334
+ value = self.send(attr)
335
+ if value.nil?
336
+ is_nullable = self.class.openapi_nullable.include?(attr)
337
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
338
+ end
339
+
340
+ hash[param] = _to_hash(value)
341
+ end
342
+ hash
343
+ end
344
+
345
+ end
346
+
347
+ end
@@ -0,0 +1,198 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ # A night where what tiket.com holds after the write differs from what was sent.
18
+ class TiketAriMismatch < ApiModelBase
19
+ attr_accessor :date
20
+
21
+ attr_accessor :room_type_code
22
+
23
+ attr_accessor :rate_plan_code
24
+
25
+ attr_accessor :field
26
+
27
+ # The value sent.
28
+ attr_accessor :sent
29
+
30
+ # The value tiket.com returned.
31
+ attr_accessor :read
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'date' => :'date',
37
+ :'room_type_code' => :'roomTypeCode',
38
+ :'rate_plan_code' => :'ratePlanCode',
39
+ :'field' => :'field',
40
+ :'sent' => :'sent',
41
+ :'read' => :'read'
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
+ :'date' => :'Date',
59
+ :'room_type_code' => :'String',
60
+ :'rate_plan_code' => :'String',
61
+ :'field' => :'String',
62
+ :'sent' => :'Object',
63
+ :'read' => :'Object'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ :'rate_plan_code',
71
+ :'sent',
72
+ :'read'
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketAriMismatch` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketAriMismatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'date')
93
+ self.date = attributes[:'date']
94
+ end
95
+
96
+ if attributes.key?(:'room_type_code')
97
+ self.room_type_code = attributes[:'room_type_code']
98
+ end
99
+
100
+ if attributes.key?(:'rate_plan_code')
101
+ self.rate_plan_code = attributes[:'rate_plan_code']
102
+ end
103
+
104
+ if attributes.key?(:'field')
105
+ self.field = attributes[:'field']
106
+ end
107
+
108
+ if attributes.key?(:'sent')
109
+ self.sent = attributes[:'sent']
110
+ end
111
+
112
+ if attributes.key?(:'read')
113
+ self.read = attributes[:'read']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
129
+ true
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ date == o.date &&
138
+ room_type_code == o.room_type_code &&
139
+ rate_plan_code == o.rate_plan_code &&
140
+ field == o.field &&
141
+ sent == o.sent &&
142
+ read == o.read
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [date, room_type_code, rate_plan_code, field, sent, read].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
172
+ end
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
175
+ end
176
+ end
177
+ new(transformed_hash)
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ end
197
+
198
+ end