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,469 @@
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
+ # Fields depend on `action`. Every action except `create-property`, `request-activation` and `check-activation` names a property with `property_id` or, for a property Repull created that tiket.com has not assigned an id to yet, `partner_hotel_code`.
18
+ class TiketSetupRequest < ApiModelBase
19
+ attr_accessor :action
20
+
21
+ # tiket.com Hotel ID.
22
+ attr_accessor :property_id
23
+
24
+ # Repull's code for a property Repull created.
25
+ attr_accessor :partner_hotel_code
26
+
27
+ # `create-property`, `add-room`, `add-rate-plan`: the listing whose content is used.
28
+ attr_accessor :listing_id
29
+
30
+ # `set-tiket-hotel-id`: the Hotel ID tiket.com assigned. `check-activation`: the Hotel ID to check.
31
+ attr_accessor :hotel_id
32
+
33
+ # `create-property`, `add-room`, `add-rate-plan`: name on tiket.com.
34
+ attr_accessor :name
35
+
36
+ # `create-property`: ISO 4217.
37
+ attr_accessor :currency
38
+
39
+ # `create-property`: tiket.com property type.
40
+ attr_accessor :property_type_id
41
+
42
+ attr_accessor :latitude
43
+
44
+ attr_accessor :longitude
45
+
46
+ attr_accessor :address
47
+
48
+ attr_accessor :postal_code
49
+
50
+ attr_accessor :country_code
51
+
52
+ attr_accessor :state_code
53
+
54
+ # `create-property`: the legal entity that operates the property.
55
+ attr_accessor :company_name
56
+
57
+ attr_accessor :company_address
58
+
59
+ attr_accessor :star_rating
60
+
61
+ # `create-property`: `Room Based` or `Occupancy Based`.
62
+ attr_accessor :pricing_model
63
+
64
+ attr_accessor :description
65
+
66
+ attr_accessor :total_rooms
67
+
68
+ attr_accessor :floors
69
+
70
+ attr_accessor :when_built
71
+
72
+ # `create-property`: property contacts.
73
+ attr_accessor :contacts
74
+
75
+ # `add-room`: rooms of this type.
76
+ attr_accessor :quantity
77
+
78
+ attr_accessor :max_adults
79
+
80
+ attr_accessor :max_children
81
+
82
+ # `add-rate-plan`: rooms the rate plan applies to.
83
+ attr_accessor :room_ids
84
+
85
+ # `add-rate-plan`.
86
+ attr_accessor :cancellation_policy
87
+
88
+ # `add-rate-plan`: breakfast included.
89
+ attr_accessor :breakfast
90
+
91
+ # `request-activation`: the properties to activate.
92
+ attr_accessor :properties
93
+
94
+ # `set-push-rate-plans`: the `ratePlanId`s that receive prices and restrictions.
95
+ attr_accessor :rate_plan_ids
96
+
97
+ # `set-sync`: send calendar changes to tiket.com automatically.
98
+ attr_accessor :enabled
99
+
100
+ # Attribute mapping from ruby-style variable name to JSON key.
101
+ def self.attribute_map
102
+ {
103
+ :'action' => :'action',
104
+ :'property_id' => :'property_id',
105
+ :'partner_hotel_code' => :'partner_hotel_code',
106
+ :'listing_id' => :'listing_id',
107
+ :'hotel_id' => :'hotel_id',
108
+ :'name' => :'name',
109
+ :'currency' => :'currency',
110
+ :'property_type_id' => :'property_type_id',
111
+ :'latitude' => :'latitude',
112
+ :'longitude' => :'longitude',
113
+ :'address' => :'address',
114
+ :'postal_code' => :'postal_code',
115
+ :'country_code' => :'country_code',
116
+ :'state_code' => :'state_code',
117
+ :'company_name' => :'company_name',
118
+ :'company_address' => :'company_address',
119
+ :'star_rating' => :'star_rating',
120
+ :'pricing_model' => :'pricing_model',
121
+ :'description' => :'description',
122
+ :'total_rooms' => :'total_rooms',
123
+ :'floors' => :'floors',
124
+ :'when_built' => :'when_built',
125
+ :'contacts' => :'contacts',
126
+ :'quantity' => :'quantity',
127
+ :'max_adults' => :'max_adults',
128
+ :'max_children' => :'max_children',
129
+ :'room_ids' => :'room_ids',
130
+ :'cancellation_policy' => :'cancellation_policy',
131
+ :'breakfast' => :'breakfast',
132
+ :'properties' => :'properties',
133
+ :'rate_plan_ids' => :'rate_plan_ids',
134
+ :'enabled' => :'enabled'
135
+ }
136
+ end
137
+
138
+ # Returns attribute mapping this model knows about
139
+ def self.acceptable_attribute_map
140
+ attribute_map
141
+ end
142
+
143
+ # Returns all the JSON keys this model knows about
144
+ def self.acceptable_attributes
145
+ acceptable_attribute_map.values
146
+ end
147
+
148
+ # Attribute type mapping.
149
+ def self.openapi_types
150
+ {
151
+ :'action' => :'String',
152
+ :'property_id' => :'String',
153
+ :'partner_hotel_code' => :'String',
154
+ :'listing_id' => :'Integer',
155
+ :'hotel_id' => :'String',
156
+ :'name' => :'String',
157
+ :'currency' => :'String',
158
+ :'property_type_id' => :'Integer',
159
+ :'latitude' => :'Float',
160
+ :'longitude' => :'Float',
161
+ :'address' => :'String',
162
+ :'postal_code' => :'String',
163
+ :'country_code' => :'String',
164
+ :'state_code' => :'String',
165
+ :'company_name' => :'String',
166
+ :'company_address' => :'String',
167
+ :'star_rating' => :'Float',
168
+ :'pricing_model' => :'String',
169
+ :'description' => :'String',
170
+ :'total_rooms' => :'Integer',
171
+ :'floors' => :'Integer',
172
+ :'when_built' => :'Integer',
173
+ :'contacts' => :'Array<TiketSetupRequestContactsInner>',
174
+ :'quantity' => :'Integer',
175
+ :'max_adults' => :'Integer',
176
+ :'max_children' => :'Integer',
177
+ :'room_ids' => :'Array<String>',
178
+ :'cancellation_policy' => :'String',
179
+ :'breakfast' => :'Boolean',
180
+ :'properties' => :'Array<TiketSetupRequestPropertiesInner>',
181
+ :'rate_plan_ids' => :'Array<String>',
182
+ :'enabled' => :'Boolean'
183
+ }
184
+ end
185
+
186
+ # List of attributes with nullable: true
187
+ def self.openapi_nullable
188
+ Set.new([
189
+ ])
190
+ end
191
+
192
+ # Initializes the object
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ def initialize(attributes = {})
195
+ if (!attributes.is_a?(Hash))
196
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketSetupRequest` initialize method"
197
+ end
198
+
199
+ # check to see if the attribute exists and convert string to symbol for hash key
200
+ acceptable_attribute_map = self.class.acceptable_attribute_map
201
+ attributes = attributes.each_with_object({}) { |(k, v), h|
202
+ if (!acceptable_attribute_map.key?(k.to_sym))
203
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketSetupRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
204
+ end
205
+ h[k.to_sym] = v
206
+ }
207
+
208
+ if attributes.key?(:'action')
209
+ self.action = attributes[:'action']
210
+ else
211
+ self.action = nil
212
+ end
213
+
214
+ if attributes.key?(:'property_id')
215
+ self.property_id = attributes[:'property_id']
216
+ end
217
+
218
+ if attributes.key?(:'partner_hotel_code')
219
+ self.partner_hotel_code = attributes[:'partner_hotel_code']
220
+ end
221
+
222
+ if attributes.key?(:'listing_id')
223
+ self.listing_id = attributes[:'listing_id']
224
+ end
225
+
226
+ if attributes.key?(:'hotel_id')
227
+ self.hotel_id = attributes[:'hotel_id']
228
+ end
229
+
230
+ if attributes.key?(:'name')
231
+ self.name = attributes[:'name']
232
+ end
233
+
234
+ if attributes.key?(:'currency')
235
+ self.currency = attributes[:'currency']
236
+ end
237
+
238
+ if attributes.key?(:'property_type_id')
239
+ self.property_type_id = attributes[:'property_type_id']
240
+ end
241
+
242
+ if attributes.key?(:'latitude')
243
+ self.latitude = attributes[:'latitude']
244
+ end
245
+
246
+ if attributes.key?(:'longitude')
247
+ self.longitude = attributes[:'longitude']
248
+ end
249
+
250
+ if attributes.key?(:'address')
251
+ self.address = attributes[:'address']
252
+ end
253
+
254
+ if attributes.key?(:'postal_code')
255
+ self.postal_code = attributes[:'postal_code']
256
+ end
257
+
258
+ if attributes.key?(:'country_code')
259
+ self.country_code = attributes[:'country_code']
260
+ end
261
+
262
+ if attributes.key?(:'state_code')
263
+ self.state_code = attributes[:'state_code']
264
+ end
265
+
266
+ if attributes.key?(:'company_name')
267
+ self.company_name = attributes[:'company_name']
268
+ end
269
+
270
+ if attributes.key?(:'company_address')
271
+ self.company_address = attributes[:'company_address']
272
+ end
273
+
274
+ if attributes.key?(:'star_rating')
275
+ self.star_rating = attributes[:'star_rating']
276
+ end
277
+
278
+ if attributes.key?(:'pricing_model')
279
+ self.pricing_model = attributes[:'pricing_model']
280
+ end
281
+
282
+ if attributes.key?(:'description')
283
+ self.description = attributes[:'description']
284
+ end
285
+
286
+ if attributes.key?(:'total_rooms')
287
+ self.total_rooms = attributes[:'total_rooms']
288
+ end
289
+
290
+ if attributes.key?(:'floors')
291
+ self.floors = attributes[:'floors']
292
+ end
293
+
294
+ if attributes.key?(:'when_built')
295
+ self.when_built = attributes[:'when_built']
296
+ end
297
+
298
+ if attributes.key?(:'contacts')
299
+ if (value = attributes[:'contacts']).is_a?(Array)
300
+ self.contacts = value
301
+ end
302
+ end
303
+
304
+ if attributes.key?(:'quantity')
305
+ self.quantity = attributes[:'quantity']
306
+ end
307
+
308
+ if attributes.key?(:'max_adults')
309
+ self.max_adults = attributes[:'max_adults']
310
+ end
311
+
312
+ if attributes.key?(:'max_children')
313
+ self.max_children = attributes[:'max_children']
314
+ end
315
+
316
+ if attributes.key?(:'room_ids')
317
+ if (value = attributes[:'room_ids']).is_a?(Array)
318
+ self.room_ids = value
319
+ end
320
+ end
321
+
322
+ if attributes.key?(:'cancellation_policy')
323
+ self.cancellation_policy = attributes[:'cancellation_policy']
324
+ end
325
+
326
+ if attributes.key?(:'breakfast')
327
+ self.breakfast = attributes[:'breakfast']
328
+ end
329
+
330
+ if attributes.key?(:'properties')
331
+ if (value = attributes[:'properties']).is_a?(Array)
332
+ self.properties = value
333
+ end
334
+ end
335
+
336
+ if attributes.key?(:'rate_plan_ids')
337
+ if (value = attributes[:'rate_plan_ids']).is_a?(Array)
338
+ self.rate_plan_ids = value
339
+ end
340
+ end
341
+
342
+ if attributes.key?(:'enabled')
343
+ self.enabled = attributes[:'enabled']
344
+ end
345
+ end
346
+
347
+ # Show invalid properties with the reasons. Usually used together with valid?
348
+ # @return Array for valid properties with the reasons
349
+ def list_invalid_properties
350
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
351
+ invalid_properties = Array.new
352
+ if @action.nil?
353
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
354
+ end
355
+
356
+ invalid_properties
357
+ end
358
+
359
+ # Check to see if the all the properties in the model are valid
360
+ # @return true if the model is valid
361
+ def valid?
362
+ warn '[DEPRECATED] the `valid?` method is obsolete'
363
+ return false if @action.nil?
364
+ true
365
+ end
366
+
367
+ # Custom attribute writer method with validation
368
+ # @param [Object] action Value to be assigned
369
+ def action=(action)
370
+ if action.nil?
371
+ fail ArgumentError, 'action cannot be nil'
372
+ end
373
+
374
+ @action = action
375
+ end
376
+
377
+ # Checks equality by comparing each attribute.
378
+ # @param [Object] Object to be compared
379
+ def ==(o)
380
+ return true if self.equal?(o)
381
+ self.class == o.class &&
382
+ action == o.action &&
383
+ property_id == o.property_id &&
384
+ partner_hotel_code == o.partner_hotel_code &&
385
+ listing_id == o.listing_id &&
386
+ hotel_id == o.hotel_id &&
387
+ name == o.name &&
388
+ currency == o.currency &&
389
+ property_type_id == o.property_type_id &&
390
+ latitude == o.latitude &&
391
+ longitude == o.longitude &&
392
+ address == o.address &&
393
+ postal_code == o.postal_code &&
394
+ country_code == o.country_code &&
395
+ state_code == o.state_code &&
396
+ company_name == o.company_name &&
397
+ company_address == o.company_address &&
398
+ star_rating == o.star_rating &&
399
+ pricing_model == o.pricing_model &&
400
+ description == o.description &&
401
+ total_rooms == o.total_rooms &&
402
+ floors == o.floors &&
403
+ when_built == o.when_built &&
404
+ contacts == o.contacts &&
405
+ quantity == o.quantity &&
406
+ max_adults == o.max_adults &&
407
+ max_children == o.max_children &&
408
+ room_ids == o.room_ids &&
409
+ cancellation_policy == o.cancellation_policy &&
410
+ breakfast == o.breakfast &&
411
+ properties == o.properties &&
412
+ rate_plan_ids == o.rate_plan_ids &&
413
+ enabled == o.enabled
414
+ end
415
+
416
+ # @see the `==` method
417
+ # @param [Object] Object to be compared
418
+ def eql?(o)
419
+ self == o
420
+ end
421
+
422
+ # Calculates hash code according to all attributes.
423
+ # @return [Integer] Hash code
424
+ def hash
425
+ [action, property_id, partner_hotel_code, listing_id, hotel_id, name, currency, property_type_id, latitude, longitude, address, postal_code, country_code, state_code, company_name, company_address, star_rating, pricing_model, description, total_rooms, floors, when_built, contacts, quantity, max_adults, max_children, room_ids, cancellation_policy, breakfast, properties, rate_plan_ids, enabled].hash
426
+ end
427
+
428
+ # Builds the object from hash
429
+ # @param [Hash] attributes Model attributes in the form of hash
430
+ # @return [Object] Returns the model itself
431
+ def self.build_from_hash(attributes)
432
+ return nil unless attributes.is_a?(Hash)
433
+ attributes = attributes.transform_keys(&:to_sym)
434
+ transformed_hash = {}
435
+ openapi_types.each_pair do |key, type|
436
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
437
+ transformed_hash["#{key}"] = nil
438
+ elsif type =~ /\AArray<(.*)>/i
439
+ # check to ensure the input is an array given that the attribute
440
+ # is documented as an array but the input is not
441
+ if attributes[attribute_map[key]].is_a?(Array)
442
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
443
+ end
444
+ elsif !attributes[attribute_map[key]].nil?
445
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
446
+ end
447
+ end
448
+ new(transformed_hash)
449
+ end
450
+
451
+ # Returns the object in the form of hash
452
+ # @return [Hash] Returns the object in the form of hash
453
+ def to_hash
454
+ hash = {}
455
+ self.class.attribute_map.each_pair do |attr, param|
456
+ value = self.send(attr)
457
+ if value.nil?
458
+ is_nullable = self.class.openapi_nullable.include?(attr)
459
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
460
+ end
461
+
462
+ hash[param] = _to_hash(value)
463
+ end
464
+ hash
465
+ end
466
+
467
+ end
468
+
469
+ end
@@ -0,0 +1,192 @@
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
+ class TiketSetupRequestContactsInner < ApiModelBase
18
+ attr_accessor :profile_type
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :position_id
23
+
24
+ attr_accessor :phone
25
+
26
+ attr_accessor :country_access_code
27
+
28
+ attr_accessor :email
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'profile_type' => :'profile_type',
34
+ :'name' => :'name',
35
+ :'position_id' => :'position_id',
36
+ :'phone' => :'phone',
37
+ :'country_access_code' => :'country_access_code',
38
+ :'email' => :'email'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'profile_type' => :'String',
56
+ :'name' => :'String',
57
+ :'position_id' => :'Integer',
58
+ :'phone' => :'String',
59
+ :'country_access_code' => :'String',
60
+ :'email' => :'String'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::TiketSetupRequestContactsInner` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::TiketSetupRequestContactsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'profile_type')
87
+ self.profile_type = attributes[:'profile_type']
88
+ end
89
+
90
+ if attributes.key?(:'name')
91
+ self.name = attributes[:'name']
92
+ end
93
+
94
+ if attributes.key?(:'position_id')
95
+ self.position_id = attributes[:'position_id']
96
+ end
97
+
98
+ if attributes.key?(:'phone')
99
+ self.phone = attributes[:'phone']
100
+ end
101
+
102
+ if attributes.key?(:'country_access_code')
103
+ self.country_access_code = attributes[:'country_access_code']
104
+ end
105
+
106
+ if attributes.key?(:'email')
107
+ self.email = attributes[:'email']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ true
124
+ end
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ profile_type == o.profile_type &&
132
+ name == o.name &&
133
+ position_id == o.position_id &&
134
+ phone == o.phone &&
135
+ country_access_code == o.country_access_code &&
136
+ email == o.email
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [profile_type, name, position_id, phone, country_access_code, email].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ end
191
+
192
+ end