repull 0.2.60 → 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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +8 -8
  3. data/lib/repull/api/connect_api.rb +205 -5
  4. data/lib/repull/api/connections_api.rb +4 -4
  5. data/lib/repull/api/listings_api.rb +70 -0
  6. data/lib/repull/api/properties_api.rb +3 -3
  7. data/lib/repull/api/tiket_api.rb +885 -0
  8. data/lib/repull/models/account_import.rb +1 -1
  9. data/lib/repull/models/airbnb_reservation.rb +346 -6
  10. data/lib/repull/models/airbnb_reservation_detail.rb +679 -0
  11. data/lib/repull/models/airbnb_reservation_detail_response.rb +173 -0
  12. data/lib/repull/models/connect_provider_session.rb +266 -0
  13. data/lib/repull/models/create_connect_session_request.rb +2 -2
  14. data/lib/repull/models/create_connection_request.rb +3 -2
  15. data/lib/repull/models/guest.rb +4 -2
  16. data/lib/repull/models/listing_publish_tiket_response.rb +165 -0
  17. data/lib/repull/models/listing_publish_tiket_response_result.rb +182 -0
  18. data/lib/repull/models/map_tiket_connect_rooms_request.rb +201 -0
  19. data/lib/repull/models/map_tiket_connect_rooms_request_mappings_inner.rb +184 -0
  20. data/lib/repull/models/publish_listing_tiket_request.rb +148 -0
  21. data/lib/repull/models/reservation.rb +1 -1
  22. data/lib/repull/models/start_connection_import202_response_data.rb +32 -6
  23. data/lib/repull/models/start_connection_import_request.rb +3 -5
  24. data/lib/repull/models/sync_tiket_request.rb +160 -0
  25. data/lib/repull/models/tiket_ari_day.rb +347 -0
  26. data/lib/repull/models/tiket_ari_mismatch.rb +198 -0
  27. data/lib/repull/models/tiket_ari_update.rb +468 -0
  28. data/lib/repull/models/tiket_ari_write_response.rb +357 -0
  29. data/lib/repull/models/tiket_availability_response.rb +269 -0
  30. data/lib/repull/models/tiket_availability_update_request.rb +241 -0
  31. data/lib/repull/models/tiket_child_price.rb +217 -0
  32. data/lib/repull/models/tiket_connect_claim_response.rb +216 -0
  33. data/lib/repull/models/tiket_connect_map_rooms_response.rb +204 -0
  34. data/lib/repull/models/tiket_connect_rooms_response.rb +295 -0
  35. data/lib/repull/models/tiket_connect_rooms_response_rooms_inner.rb +199 -0
  36. data/lib/repull/models/tiket_content_response.rb +202 -0
  37. data/lib/repull/models/tiket_content_response_objects_inner.rb +237 -0
  38. data/lib/repull/models/tiket_listing_pricing_response.rb +321 -0
  39. data/lib/repull/models/tiket_listing_pricing_update_request.rb +209 -0
  40. data/lib/repull/models/tiket_map_listings_request.rb +202 -0
  41. data/lib/repull/models/tiket_map_listings_request_mappings_inner.rb +186 -0
  42. data/lib/repull/models/tiket_map_listings_response.rb +169 -0
  43. data/lib/repull/models/tiket_map_listings_response_results_inner.rb +176 -0
  44. data/lib/repull/models/tiket_occupancy_price.rb +201 -0
  45. data/lib/repull/models/tiket_property.rb +278 -0
  46. data/lib/repull/models/tiket_property_list_response.rb +166 -0
  47. data/lib/repull/models/tiket_property_listings_inner.rb +175 -0
  48. data/lib/repull/models/tiket_property_rooms_response.rb +192 -0
  49. data/lib/repull/models/tiket_rate_plan.rb +178 -0
  50. data/lib/repull/models/tiket_reservation.rb +421 -0
  51. data/lib/repull/models/tiket_reservation_list_response.rb +192 -0
  52. data/lib/repull/models/tiket_reservation_list_response_pagination.rb +165 -0
  53. data/lib/repull/models/tiket_room.rb +232 -0
  54. data/lib/repull/models/tiket_setup_request.rb +469 -0
  55. data/lib/repull/models/tiket_setup_request_contacts_inner.rb +192 -0
  56. data/lib/repull/models/tiket_setup_request_properties_inner.rb +174 -0
  57. data/lib/repull/models/tiket_setup_response.rb +159 -0
  58. data/lib/repull/models/tiket_sync_response.rb +167 -0
  59. data/lib/repull/models/tiket_sync_response_results_inner.rb +239 -0
  60. data/lib/repull/models/verify_tiket_claim_request.rb +212 -0
  61. data/lib/repull/version.rb +1 -1
  62. data/lib/repull.rb +46 -0
  63. data/openapi/v1.json +10004 -6945
  64. data/spec/api/tiket_api_spec.rb +56 -0
  65. metadata +50 -2
@@ -0,0 +1,357 @@
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
+ # Result of a tiket.com rates / availability / restrictions write.
18
+ class TiketAriWriteResponse < ApiModelBase
19
+ # Present on `PUT /v1/channels/tiket/listings/{id}/pricing`.
20
+ attr_accessor :listing_id
21
+
22
+ # tiket.com Hotel ID.
23
+ attr_accessor :property_id
24
+
25
+ # Present on `PUT /v1/channels/tiket/listings/{id}/pricing`.
26
+ attr_accessor :room_type_code
27
+
28
+ attr_accessor :type
29
+
30
+ # Update rows sent (on the listing route, one per targeted rate plan).
31
+ attr_accessor :updates
32
+
33
+ # Requests made to tiket.com.
34
+ attr_accessor :requests
35
+
36
+ # tiket.com's reference for each request. Quote them to tiket.com support.
37
+ attr_accessor :echo_tokens
38
+
39
+ # tiket.com's own warnings, verbatim (for example `ARI_PARTIALLY_ERROR` when part of a request was not applied).
40
+ attr_accessor :warnings
41
+
42
+ # `verified` — the read-back matches what was sent. `mismatch` — tiket.com holds something else for at least one night (see `mismatches`). `unverified` — `verify: false` was sent.
43
+ attr_accessor :applied
44
+
45
+ # Present when `applied` is `mismatch`. At most 100; `mismatchCount` is the total.
46
+ attr_accessor :mismatches
47
+
48
+ attr_accessor :mismatch_count
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'listing_id' => :'listingId',
54
+ :'property_id' => :'propertyId',
55
+ :'room_type_code' => :'roomTypeCode',
56
+ :'type' => :'type',
57
+ :'updates' => :'updates',
58
+ :'requests' => :'requests',
59
+ :'echo_tokens' => :'echoTokens',
60
+ :'warnings' => :'warnings',
61
+ :'applied' => :'applied',
62
+ :'mismatches' => :'mismatches',
63
+ :'mismatch_count' => :'mismatchCount'
64
+ }
65
+ end
66
+
67
+ # Returns attribute mapping this model knows about
68
+ def self.acceptable_attribute_map
69
+ attribute_map
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ acceptable_attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'listing_id' => :'String',
81
+ :'property_id' => :'String',
82
+ :'room_type_code' => :'String',
83
+ :'type' => :'String',
84
+ :'updates' => :'Integer',
85
+ :'requests' => :'Integer',
86
+ :'echo_tokens' => :'Array<String>',
87
+ :'warnings' => :'Array<Hash<String, Object>>',
88
+ :'applied' => :'String',
89
+ :'mismatches' => :'Array<TiketAriMismatch>',
90
+ :'mismatch_count' => :'Integer'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketAriWriteResponse` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketAriWriteResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'listing_id')
117
+ self.listing_id = attributes[:'listing_id']
118
+ end
119
+
120
+ if attributes.key?(:'property_id')
121
+ self.property_id = attributes[:'property_id']
122
+ else
123
+ self.property_id = nil
124
+ end
125
+
126
+ if attributes.key?(:'room_type_code')
127
+ self.room_type_code = attributes[:'room_type_code']
128
+ end
129
+
130
+ if attributes.key?(:'type')
131
+ self.type = attributes[:'type']
132
+ else
133
+ self.type = nil
134
+ end
135
+
136
+ if attributes.key?(:'updates')
137
+ self.updates = attributes[:'updates']
138
+ else
139
+ self.updates = nil
140
+ end
141
+
142
+ if attributes.key?(:'requests')
143
+ self.requests = attributes[:'requests']
144
+ else
145
+ self.requests = nil
146
+ end
147
+
148
+ if attributes.key?(:'echo_tokens')
149
+ if (value = attributes[:'echo_tokens']).is_a?(Array)
150
+ self.echo_tokens = value
151
+ end
152
+ end
153
+
154
+ if attributes.key?(:'warnings')
155
+ if (value = attributes[:'warnings']).is_a?(Array)
156
+ self.warnings = value
157
+ end
158
+ end
159
+
160
+ if attributes.key?(:'applied')
161
+ self.applied = attributes[:'applied']
162
+ else
163
+ self.applied = nil
164
+ end
165
+
166
+ if attributes.key?(:'mismatches')
167
+ if (value = attributes[:'mismatches']).is_a?(Array)
168
+ self.mismatches = value
169
+ end
170
+ end
171
+
172
+ if attributes.key?(:'mismatch_count')
173
+ self.mismatch_count = attributes[:'mismatch_count']
174
+ end
175
+ end
176
+
177
+ # Show invalid properties with the reasons. Usually used together with valid?
178
+ # @return Array for valid properties with the reasons
179
+ def list_invalid_properties
180
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
181
+ invalid_properties = Array.new
182
+ if @property_id.nil?
183
+ invalid_properties.push('invalid value for "property_id", property_id cannot be nil.')
184
+ end
185
+
186
+ if @type.nil?
187
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
188
+ end
189
+
190
+ if @updates.nil?
191
+ invalid_properties.push('invalid value for "updates", updates cannot be nil.')
192
+ end
193
+
194
+ if @requests.nil?
195
+ invalid_properties.push('invalid value for "requests", requests cannot be nil.')
196
+ end
197
+
198
+ if @applied.nil?
199
+ invalid_properties.push('invalid value for "applied", applied cannot be nil.')
200
+ end
201
+
202
+ if !@mismatches.nil? && @mismatches.length > 100
203
+ invalid_properties.push('invalid value for "mismatches", number of items must be less than or equal to 100.')
204
+ end
205
+
206
+ invalid_properties
207
+ end
208
+
209
+ # Check to see if the all the properties in the model are valid
210
+ # @return true if the model is valid
211
+ def valid?
212
+ warn '[DEPRECATED] the `valid?` method is obsolete'
213
+ return false if @property_id.nil?
214
+ return false if @type.nil?
215
+ return false if @updates.nil?
216
+ return false if @requests.nil?
217
+ return false if @applied.nil?
218
+ return false if !@mismatches.nil? && @mismatches.length > 100
219
+ true
220
+ end
221
+
222
+ # Custom attribute writer method with validation
223
+ # @param [Object] property_id Value to be assigned
224
+ def property_id=(property_id)
225
+ if property_id.nil?
226
+ fail ArgumentError, 'property_id cannot be nil'
227
+ end
228
+
229
+ @property_id = property_id
230
+ end
231
+
232
+ # Custom attribute writer method with validation
233
+ # @param [Object] type Value to be assigned
234
+ def type=(type)
235
+ if type.nil?
236
+ fail ArgumentError, 'type cannot be nil'
237
+ end
238
+
239
+ @type = type
240
+ end
241
+
242
+ # Custom attribute writer method with validation
243
+ # @param [Object] updates Value to be assigned
244
+ def updates=(updates)
245
+ if updates.nil?
246
+ fail ArgumentError, 'updates cannot be nil'
247
+ end
248
+
249
+ @updates = updates
250
+ end
251
+
252
+ # Custom attribute writer method with validation
253
+ # @param [Object] requests Value to be assigned
254
+ def requests=(requests)
255
+ if requests.nil?
256
+ fail ArgumentError, 'requests cannot be nil'
257
+ end
258
+
259
+ @requests = requests
260
+ end
261
+
262
+ # Custom attribute writer method with validation
263
+ # @param [Object] applied Value to be assigned
264
+ def applied=(applied)
265
+ if applied.nil?
266
+ fail ArgumentError, 'applied cannot be nil'
267
+ end
268
+
269
+ @applied = applied
270
+ end
271
+
272
+ # Custom attribute writer method with validation
273
+ # @param [Object] mismatches Value to be assigned
274
+ def mismatches=(mismatches)
275
+ if mismatches.nil?
276
+ fail ArgumentError, 'mismatches cannot be nil'
277
+ end
278
+
279
+ if mismatches.length > 100
280
+ fail ArgumentError, 'invalid value for "mismatches", number of items must be less than or equal to 100.'
281
+ end
282
+
283
+ @mismatches = mismatches
284
+ end
285
+
286
+ # Checks equality by comparing each attribute.
287
+ # @param [Object] Object to be compared
288
+ def ==(o)
289
+ return true if self.equal?(o)
290
+ self.class == o.class &&
291
+ listing_id == o.listing_id &&
292
+ property_id == o.property_id &&
293
+ room_type_code == o.room_type_code &&
294
+ type == o.type &&
295
+ updates == o.updates &&
296
+ requests == o.requests &&
297
+ echo_tokens == o.echo_tokens &&
298
+ warnings == o.warnings &&
299
+ applied == o.applied &&
300
+ mismatches == o.mismatches &&
301
+ mismatch_count == o.mismatch_count
302
+ end
303
+
304
+ # @see the `==` method
305
+ # @param [Object] Object to be compared
306
+ def eql?(o)
307
+ self == o
308
+ end
309
+
310
+ # Calculates hash code according to all attributes.
311
+ # @return [Integer] Hash code
312
+ def hash
313
+ [listing_id, property_id, room_type_code, type, updates, requests, echo_tokens, warnings, applied, mismatches, mismatch_count].hash
314
+ end
315
+
316
+ # Builds the object from hash
317
+ # @param [Hash] attributes Model attributes in the form of hash
318
+ # @return [Object] Returns the model itself
319
+ def self.build_from_hash(attributes)
320
+ return nil unless attributes.is_a?(Hash)
321
+ attributes = attributes.transform_keys(&:to_sym)
322
+ transformed_hash = {}
323
+ openapi_types.each_pair do |key, type|
324
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
325
+ transformed_hash["#{key}"] = nil
326
+ elsif type =~ /\AArray<(.*)>/i
327
+ # check to ensure the input is an array given that the attribute
328
+ # is documented as an array but the input is not
329
+ if attributes[attribute_map[key]].is_a?(Array)
330
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
331
+ end
332
+ elsif !attributes[attribute_map[key]].nil?
333
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
334
+ end
335
+ end
336
+ new(transformed_hash)
337
+ end
338
+
339
+ # Returns the object in the form of hash
340
+ # @return [Hash] Returns the object in the form of hash
341
+ def to_hash
342
+ hash = {}
343
+ self.class.attribute_map.each_pair do |attr, param|
344
+ value = self.send(attr)
345
+ if value.nil?
346
+ is_nullable = self.class.openapi_nullable.include?(attr)
347
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
348
+ end
349
+
350
+ hash[param] = _to_hash(value)
351
+ end
352
+ hash
353
+ end
354
+
355
+ end
356
+
357
+ end
@@ -0,0 +1,269 @@
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
+ # Returned by `GET /v1/channels/tiket/availability`.
18
+ class TiketAvailabilityResponse < ApiModelBase
19
+ # tiket.com Hotel ID.
20
+ attr_accessor :property_id
21
+
22
+ # `Room Based` (one `price` per night) or `Occupancy Based` (`occupancyPrices` per number of guests). Set per property in the tiket.com extranet.
23
+ attr_accessor :price_model
24
+
25
+ # The property currency.
26
+ attr_accessor :currency
27
+
28
+ attr_accessor :start
29
+
30
+ # Inclusive.
31
+ attr_accessor :_end
32
+
33
+ attr_accessor :days
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'property_id' => :'propertyId',
39
+ :'price_model' => :'priceModel',
40
+ :'currency' => :'currency',
41
+ :'start' => :'start',
42
+ :'_end' => :'end',
43
+ :'days' => :'days'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'property_id' => :'String',
61
+ :'price_model' => :'String',
62
+ :'currency' => :'String',
63
+ :'start' => :'Date',
64
+ :'_end' => :'Date',
65
+ :'days' => :'Array<TiketAriDay>'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'price_model',
73
+ :'currency',
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketAvailabilityResponse` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketAvailabilityResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'property_id')
94
+ self.property_id = attributes[:'property_id']
95
+ else
96
+ self.property_id = nil
97
+ end
98
+
99
+ if attributes.key?(:'price_model')
100
+ self.price_model = attributes[:'price_model']
101
+ end
102
+
103
+ if attributes.key?(:'currency')
104
+ self.currency = attributes[:'currency']
105
+ end
106
+
107
+ if attributes.key?(:'start')
108
+ self.start = attributes[:'start']
109
+ else
110
+ self.start = nil
111
+ end
112
+
113
+ if attributes.key?(:'_end')
114
+ self._end = attributes[:'_end']
115
+ else
116
+ self._end = nil
117
+ end
118
+
119
+ if attributes.key?(:'days')
120
+ if (value = attributes[:'days']).is_a?(Array)
121
+ self.days = value
122
+ end
123
+ else
124
+ self.days = nil
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
+ invalid_properties = Array.new
133
+ if @property_id.nil?
134
+ invalid_properties.push('invalid value for "property_id", property_id cannot be nil.')
135
+ end
136
+
137
+ if @start.nil?
138
+ invalid_properties.push('invalid value for "start", start cannot be nil.')
139
+ end
140
+
141
+ if @_end.nil?
142
+ invalid_properties.push('invalid value for "_end", _end cannot be nil.')
143
+ end
144
+
145
+ if @days.nil?
146
+ invalid_properties.push('invalid value for "days", days cannot be nil.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ warn '[DEPRECATED] the `valid?` method is obsolete'
156
+ return false if @property_id.nil?
157
+ return false if @start.nil?
158
+ return false if @_end.nil?
159
+ return false if @days.nil?
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] property_id Value to be assigned
165
+ def property_id=(property_id)
166
+ if property_id.nil?
167
+ fail ArgumentError, 'property_id cannot be nil'
168
+ end
169
+
170
+ @property_id = property_id
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] start Value to be assigned
175
+ def start=(start)
176
+ if start.nil?
177
+ fail ArgumentError, 'start cannot be nil'
178
+ end
179
+
180
+ @start = start
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] _end Value to be assigned
185
+ def _end=(_end)
186
+ if _end.nil?
187
+ fail ArgumentError, '_end cannot be nil'
188
+ end
189
+
190
+ @_end = _end
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] days Value to be assigned
195
+ def days=(days)
196
+ if days.nil?
197
+ fail ArgumentError, 'days cannot be nil'
198
+ end
199
+
200
+ @days = days
201
+ end
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] Object to be compared
205
+ def ==(o)
206
+ return true if self.equal?(o)
207
+ self.class == o.class &&
208
+ property_id == o.property_id &&
209
+ price_model == o.price_model &&
210
+ currency == o.currency &&
211
+ start == o.start &&
212
+ _end == o._end &&
213
+ days == o.days
214
+ end
215
+
216
+ # @see the `==` method
217
+ # @param [Object] Object to be compared
218
+ def eql?(o)
219
+ self == o
220
+ end
221
+
222
+ # Calculates hash code according to all attributes.
223
+ # @return [Integer] Hash code
224
+ def hash
225
+ [property_id, price_model, currency, start, _end, days].hash
226
+ end
227
+
228
+ # Builds the object from hash
229
+ # @param [Hash] attributes Model attributes in the form of hash
230
+ # @return [Object] Returns the model itself
231
+ def self.build_from_hash(attributes)
232
+ return nil unless attributes.is_a?(Hash)
233
+ attributes = attributes.transform_keys(&:to_sym)
234
+ transformed_hash = {}
235
+ openapi_types.each_pair do |key, type|
236
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
237
+ transformed_hash["#{key}"] = nil
238
+ elsif type =~ /\AArray<(.*)>/i
239
+ # check to ensure the input is an array given that the attribute
240
+ # is documented as an array but the input is not
241
+ if attributes[attribute_map[key]].is_a?(Array)
242
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
243
+ end
244
+ elsif !attributes[attribute_map[key]].nil?
245
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
246
+ end
247
+ end
248
+ new(transformed_hash)
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ end
268
+
269
+ end