repull 0.2.0

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 (222) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +10 -0
  3. data/LICENSE +21 -0
  4. data/README.md +121 -0
  5. data/Rakefile +10 -0
  6. data/examples/connect_airbnb.rb +33 -0
  7. data/examples/quickstart.rb +22 -0
  8. data/lib/repull/api/ai_api.rb +86 -0
  9. data/lib/repull/api/airbnb_api.rb +1155 -0
  10. data/lib/repull/api/atlas_api.rb +194 -0
  11. data/lib/repull/api/availability_api.rb +167 -0
  12. data/lib/repull/api/billing_api.rb +139 -0
  13. data/lib/repull/api/booking_com_api.rb +617 -0
  14. data/lib/repull/api/connect_api.rb +672 -0
  15. data/lib/repull/api/conversations_api.rb +263 -0
  16. data/lib/repull/api/guests_api.rb +171 -0
  17. data/lib/repull/api/listings_api.rb +509 -0
  18. data/lib/repull/api/markets_api.rb +320 -0
  19. data/lib/repull/api/plumguide_api.rb +299 -0
  20. data/lib/repull/api/pricing_api.rb +453 -0
  21. data/lib/repull/api/properties_api.rb +166 -0
  22. data/lib/repull/api/reservations_api.rb +387 -0
  23. data/lib/repull/api/reviews_api.rb +208 -0
  24. data/lib/repull/api/schema_api.rb +347 -0
  25. data/lib/repull/api/system_api.rb +79 -0
  26. data/lib/repull/api/vrbo_api.rb +262 -0
  27. data/lib/repull/api/webhooks_api.rb +867 -0
  28. data/lib/repull/api_client.rb +397 -0
  29. data/lib/repull/api_error.rb +58 -0
  30. data/lib/repull/api_model_base.rb +88 -0
  31. data/lib/repull/configuration.rb +313 -0
  32. data/lib/repull/models/ai_operation.rb +158 -0
  33. data/lib/repull/models/airbnb_listing.rb +229 -0
  34. data/lib/repull/models/airbnb_listing_list_response.rb +158 -0
  35. data/lib/repull/models/airbnb_reservation.rb +224 -0
  36. data/lib/repull/models/airbnb_reservation_list_response.rb +158 -0
  37. data/lib/repull/models/airbnb_review.rb +222 -0
  38. data/lib/repull/models/airbnb_review_list_response.rb +158 -0
  39. data/lib/repull/models/airbnb_thread.rb +188 -0
  40. data/lib/repull/models/airbnb_thread_list_response.rb +158 -0
  41. data/lib/repull/models/booking_connect_listing_option.rb +201 -0
  42. data/lib/repull/models/booking_connect_room.rb +251 -0
  43. data/lib/repull/models/booking_connect_rooms_response.rb +274 -0
  44. data/lib/repull/models/booking_conversation.rb +178 -0
  45. data/lib/repull/models/booking_conversation_list_response.rb +158 -0
  46. data/lib/repull/models/booking_pricing_rate_update.rb +310 -0
  47. data/lib/repull/models/booking_pricing_rate_update_date_range.rb +190 -0
  48. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +179 -0
  49. data/lib/repull/models/booking_pricing_response.rb +157 -0
  50. data/lib/repull/models/booking_pricing_update_request.rb +176 -0
  51. data/lib/repull/models/booking_pricing_update_response.rb +199 -0
  52. data/lib/repull/models/booking_property.rb +188 -0
  53. data/lib/repull/models/booking_property_list_response.rb +158 -0
  54. data/lib/repull/models/booking_room_mapping.rb +177 -0
  55. data/lib/repull/models/booking_verify_hotel_request.rb +193 -0
  56. data/lib/repull/models/booking_verify_hotel_response.rb +285 -0
  57. data/lib/repull/models/bulk_pricing_failure.rb +177 -0
  58. data/lib/repull/models/bulk_pricing_item.rb +202 -0
  59. data/lib/repull/models/bulk_pricing_request.rb +212 -0
  60. data/lib/repull/models/bulk_pricing_response.rb +170 -0
  61. data/lib/repull/models/calendar_day.rb +174 -0
  62. data/lib/repull/models/calendar_response.rb +149 -0
  63. data/lib/repull/models/connect_host.rb +194 -0
  64. data/lib/repull/models/connect_provider.rb +365 -0
  65. data/lib/repull/models/connect_provider_list_response.rb +149 -0
  66. data/lib/repull/models/connect_session.rb +228 -0
  67. data/lib/repull/models/connect_status.rb +207 -0
  68. data/lib/repull/models/connection.rb +195 -0
  69. data/lib/repull/models/connection_list_response.rb +158 -0
  70. data/lib/repull/models/conversation.rb +257 -0
  71. data/lib/repull/models/conversation_detail.rb +284 -0
  72. data/lib/repull/models/conversation_guest.rb +178 -0
  73. data/lib/repull/models/conversation_guest_contact.rb +174 -0
  74. data/lib/repull/models/conversation_host.rb +186 -0
  75. data/lib/repull/models/conversation_list_response.rb +159 -0
  76. data/lib/repull/models/conversation_message_attachment.rb +174 -0
  77. data/lib/repull/models/create_ai_operation200_response.rb +156 -0
  78. data/lib/repull/models/create_billing_checkout_request.rb +181 -0
  79. data/lib/repull/models/create_connect_session_request.rb +189 -0
  80. data/lib/repull/models/create_connection_request.rb +225 -0
  81. data/lib/repull/models/create_reservation_request.rb +313 -0
  82. data/lib/repull/models/create_webhook_request.rb +211 -0
  83. data/lib/repull/models/custom_schema.rb +303 -0
  84. data/lib/repull/models/custom_schema_create.rb +253 -0
  85. data/lib/repull/models/custom_schema_create_response.rb +300 -0
  86. data/lib/repull/models/custom_schema_delete_response.rb +164 -0
  87. data/lib/repull/models/custom_schema_list_response.rb +159 -0
  88. data/lib/repull/models/custom_schema_summary.rb +300 -0
  89. data/lib/repull/models/custom_schema_update.rb +199 -0
  90. data/lib/repull/models/error.rb +165 -0
  91. data/lib/repull/models/error_error.rb +357 -0
  92. data/lib/repull/models/error_error_support.rb +167 -0
  93. data/lib/repull/models/get_health200_response.rb +156 -0
  94. data/lib/repull/models/guest.rb +271 -0
  95. data/lib/repull/models/guest_contact.rb +186 -0
  96. data/lib/repull/models/guest_flag.rb +179 -0
  97. data/lib/repull/models/guest_list_response.rb +159 -0
  98. data/lib/repull/models/guest_note.rb +187 -0
  99. data/lib/repull/models/guest_profile.rb +337 -0
  100. data/lib/repull/models/guest_reservations_summary.rb +175 -0
  101. data/lib/repull/models/listing.rb +216 -0
  102. data/lib/repull/models/listing_address.rb +158 -0
  103. data/lib/repull/models/listing_channel.rb +176 -0
  104. data/lib/repull/models/listing_comp.rb +272 -0
  105. data/lib/repull/models/listing_comp_nightly.rb +166 -0
  106. data/lib/repull/models/listing_comp_ratings.rb +157 -0
  107. data/lib/repull/models/listing_comps_response.rb +197 -0
  108. data/lib/repull/models/listing_content.rb +249 -0
  109. data/lib/repull/models/listing_create_request.rb +364 -0
  110. data/lib/repull/models/listing_create_response.rb +148 -0
  111. data/lib/repull/models/listing_generate_content_request.rb +192 -0
  112. data/lib/repull/models/listing_generate_content_response.rb +165 -0
  113. data/lib/repull/models/listing_list_response.rb +158 -0
  114. data/lib/repull/models/listing_pricing_apply_request.rb +193 -0
  115. data/lib/repull/models/listing_pricing_apply_response.rb +169 -0
  116. data/lib/repull/models/listing_pricing_history_entry.rb +212 -0
  117. data/lib/repull/models/listing_pricing_history_response.rb +159 -0
  118. data/lib/repull/models/listing_pricing_recommendation.rb +269 -0
  119. data/lib/repull/models/listing_pricing_response.rb +187 -0
  120. data/lib/repull/models/listing_pricing_response_comp_summary.rb +178 -0
  121. data/lib/repull/models/listing_pricing_response_date_range.rb +156 -0
  122. data/lib/repull/models/listing_pricing_response_listing.rb +191 -0
  123. data/lib/repull/models/listing_pricing_strategy.rb +317 -0
  124. data/lib/repull/models/listing_pricing_strategy_input.rb +264 -0
  125. data/lib/repull/models/listing_publish_airbnb_request.rb +171 -0
  126. data/lib/repull/models/listing_publish_response.rb +166 -0
  127. data/lib/repull/models/listing_publish_status_channel.rb +197 -0
  128. data/lib/repull/models/listing_publish_status_response.rb +158 -0
  129. data/lib/repull/models/listing_quality_tier.rb +175 -0
  130. data/lib/repull/models/listing_segment.rb +229 -0
  131. data/lib/repull/models/listing_segment_recommendation.rb +170 -0
  132. data/lib/repull/models/listing_segments_response.rb +230 -0
  133. data/lib/repull/models/listing_segments_response_scope.rb +159 -0
  134. data/lib/repull/models/map_connect_booking_rooms_request.rb +202 -0
  135. data/lib/repull/models/map_connect_booking_rooms_response.rb +243 -0
  136. data/lib/repull/models/market_browse_category.rb +158 -0
  137. data/lib/repull/models/market_browse_entry.rb +197 -0
  138. data/lib/repull/models/market_browse_featured.rb +188 -0
  139. data/lib/repull/models/market_browse_response.rb +158 -0
  140. data/lib/repull/models/market_calendar_day.rb +257 -0
  141. data/lib/repull/models/market_calendar_day_events_inner.rb +177 -0
  142. data/lib/repull/models/market_calendar_response.rb +178 -0
  143. data/lib/repull/models/market_detail_response.rb +269 -0
  144. data/lib/repull/models/market_detail_response_price_distribution_inner.rb +186 -0
  145. data/lib/repull/models/market_detail_response_property_type_mix_inner.rb +166 -0
  146. data/lib/repull/models/market_detail_response_supply_trend_inner.rb +156 -0
  147. data/lib/repull/models/market_detail_response_top_comps.rb +187 -0
  148. data/lib/repull/models/market_event.rb +257 -0
  149. data/lib/repull/models/market_my_listing.rb +242 -0
  150. data/lib/repull/models/market_summary.rb +259 -0
  151. data/lib/repull/models/market_top_comp.rb +275 -0
  152. data/lib/repull/models/markets_overview_response.rb +219 -0
  153. data/lib/repull/models/markets_overview_response_browse.rb +173 -0
  154. data/lib/repull/models/markets_overview_response_subscriptions.rb +157 -0
  155. data/lib/repull/models/markets_overview_response_totals.rb +165 -0
  156. data/lib/repull/models/message.rb +289 -0
  157. data/lib/repull/models/message_list_response.rb +159 -0
  158. data/lib/repull/models/pagination.rb +188 -0
  159. data/lib/repull/models/plumguide_listing.rb +167 -0
  160. data/lib/repull/models/plumguide_listing_list_response.rb +158 -0
  161. data/lib/repull/models/property.rb +271 -0
  162. data/lib/repull/models/property_list_response.rb +158 -0
  163. data/lib/repull/models/reservation.rb +457 -0
  164. data/lib/repull/models/reservation_list_response.rb +159 -0
  165. data/lib/repull/models/review.rb +357 -0
  166. data/lib/repull/models/review_category.rb +169 -0
  167. data/lib/repull/models/review_list_response.rb +159 -0
  168. data/lib/repull/models/review_response.rb +158 -0
  169. data/lib/repull/models/rotate_webhook_secret200_response.rb +165 -0
  170. data/lib/repull/models/select_connect_provider_request.rb +165 -0
  171. data/lib/repull/models/select_provider_response.rb +176 -0
  172. data/lib/repull/models/test_webhook_request.rb +165 -0
  173. data/lib/repull/models/update_availability_request.rb +149 -0
  174. data/lib/repull/models/update_listing_pricing_strategy200_response.rb +147 -0
  175. data/lib/repull/models/update_reservation_request.rb +174 -0
  176. data/lib/repull/models/update_webhook_request.rb +211 -0
  177. data/lib/repull/models/vrbo_listing.rb +167 -0
  178. data/lib/repull/models/vrbo_listing_list_response.rb +158 -0
  179. data/lib/repull/models/vrbo_reservation.rb +185 -0
  180. data/lib/repull/models/vrbo_reservation_list_response.rb +158 -0
  181. data/lib/repull/models/webhook_delivery.rb +243 -0
  182. data/lib/repull/models/webhook_delivery_detail.rb +261 -0
  183. data/lib/repull/models/webhook_delivery_list_response.rb +158 -0
  184. data/lib/repull/models/webhook_event_catalog.rb +149 -0
  185. data/lib/repull/models/webhook_event_catalog_domains_inner.rb +167 -0
  186. data/lib/repull/models/webhook_event_catalog_domains_inner_events_inner.rb +183 -0
  187. data/lib/repull/models/webhook_list_response.rb +158 -0
  188. data/lib/repull/models/webhook_subscription.rb +294 -0
  189. data/lib/repull/version.rb +15 -0
  190. data/lib/repull.rb +217 -0
  191. data/openapi/v1.json +8923 -0
  192. data/repull.gemspec +43 -0
  193. data/scripts/regen.sh +55 -0
  194. data/spec/api/ai_api_spec.rb +47 -0
  195. data/spec/api/airbnb_api_spec.rb +238 -0
  196. data/spec/api/availability_api_spec.rb +62 -0
  197. data/spec/api/billing_api_spec.rb +57 -0
  198. data/spec/api/booking_com_api_spec.rb +115 -0
  199. data/spec/api/connect_api_spec.rb +82 -0
  200. data/spec/api/conversations_api_spec.rb +68 -0
  201. data/spec/api/guests_api_spec.rb +59 -0
  202. data/spec/api/plumguide_api_spec.rb +85 -0
  203. data/spec/api/properties_api_spec.rb +60 -0
  204. data/spec/api/reservations_api_spec.rb +97 -0
  205. data/spec/api/system_api_spec.rb +45 -0
  206. data/spec/api/vrbo_api_spec.rb +55 -0
  207. data/spec/api/webhooks_api_spec.rb +69 -0
  208. data/spec/models/ai_operation_spec.rb +46 -0
  209. data/spec/models/calendar_day_spec.rb +54 -0
  210. data/spec/models/connect_host_spec.rb +60 -0
  211. data/spec/models/connect_status_spec.rb +76 -0
  212. data/spec/models/connection_spec.rb +70 -0
  213. data/spec/models/conversation_spec.rb +66 -0
  214. data/spec/models/error_error_spec.rb +54 -0
  215. data/spec/models/error_spec.rb +36 -0
  216. data/spec/models/guest_spec.rb +72 -0
  217. data/spec/models/message_spec.rb +70 -0
  218. data/spec/models/property_spec.rb +114 -0
  219. data/spec/models/reservation_spec.rb +128 -0
  220. data/spec/models/webhook_subscription_spec.rb +60 -0
  221. data/spec/spec_helper.rb +111 -0
  222. metadata +337 -0
@@ -0,0 +1,457 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: ivan@vanio.ai
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 booking/reservation from a connected PMS. Identical shape between list-row (`GET /v1/reservations`) and detail (`GET /v1/reservations/{id}`) — SDK consumers can use the same type for both.
18
+ class Reservation < ApiModelBase
19
+ # Internal Repull reservation ID
20
+ attr_accessor :id
21
+
22
+ # Internal Repull listing ID this reservation is on.
23
+ attr_accessor :listing_id
24
+
25
+ # Internal Repull guest ID. Use `GET /v1/guests/{id}` for the full profile.
26
+ attr_accessor :guest_id
27
+
28
+ attr_accessor :check_in
29
+
30
+ attr_accessor :check_out
31
+
32
+ attr_accessor :status
33
+
34
+ # Booking source. Lowercase. May be null on legacy rows.
35
+ attr_accessor :platform
36
+
37
+ # Decimal-as-string (precision 10, scale 2) to preserve precision across mixed-currency totals.
38
+ attr_accessor :total_price
39
+
40
+ # ISO 4217 currency code.
41
+ attr_accessor :currency
42
+
43
+ # Channel-side confirmation code (Airbnb HMxxx, Booking.com numeric, etc.).
44
+ attr_accessor :confirmation_code
45
+
46
+ # Raw guest details from the source channel (firstName, lastName, email, phone, count, etc.). Shape varies by platform — use the dedicated guest endpoint for a normalized profile.
47
+ attr_accessor :guest_details
48
+
49
+ # When the reservation row was created in Repull (not the booking-on-channel timestamp).
50
+ attr_accessor :created_at
51
+
52
+ # Pre-resolved display name (`firstName lastName`) extracted from `guestDetails`. Null when no first name is available.
53
+ attr_accessor :guest_name
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'id' => :'id',
59
+ :'listing_id' => :'listingId',
60
+ :'guest_id' => :'guestId',
61
+ :'check_in' => :'checkIn',
62
+ :'check_out' => :'checkOut',
63
+ :'status' => :'status',
64
+ :'platform' => :'platform',
65
+ :'total_price' => :'totalPrice',
66
+ :'currency' => :'currency',
67
+ :'confirmation_code' => :'confirmationCode',
68
+ :'guest_details' => :'guestDetails',
69
+ :'created_at' => :'createdAt',
70
+ :'guest_name' => :'guestName'
71
+ }
72
+ end
73
+
74
+ # Returns attribute mapping this model knows about
75
+ def self.acceptable_attribute_map
76
+ attribute_map
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ acceptable_attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'id' => :'String',
88
+ :'listing_id' => :'String',
89
+ :'guest_id' => :'String',
90
+ :'check_in' => :'Date',
91
+ :'check_out' => :'Date',
92
+ :'status' => :'String',
93
+ :'platform' => :'String',
94
+ :'total_price' => :'String',
95
+ :'currency' => :'String',
96
+ :'confirmation_code' => :'String',
97
+ :'guest_details' => :'Hash<String, Object>',
98
+ :'created_at' => :'Time',
99
+ :'guest_name' => :'String'
100
+ }
101
+ end
102
+
103
+ # List of attributes with nullable: true
104
+ def self.openapi_nullable
105
+ Set.new([
106
+ :'platform',
107
+ :'guest_name'
108
+ ])
109
+ end
110
+
111
+ # Initializes the object
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ def initialize(attributes = {})
114
+ if (!attributes.is_a?(Hash))
115
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::Reservation` initialize method"
116
+ end
117
+
118
+ # check to see if the attribute exists and convert string to symbol for hash key
119
+ acceptable_attribute_map = self.class.acceptable_attribute_map
120
+ attributes = attributes.each_with_object({}) { |(k, v), h|
121
+ if (!acceptable_attribute_map.key?(k.to_sym))
122
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::Reservation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
123
+ end
124
+ h[k.to_sym] = v
125
+ }
126
+
127
+ if attributes.key?(:'id')
128
+ self.id = attributes[:'id']
129
+ else
130
+ self.id = nil
131
+ end
132
+
133
+ if attributes.key?(:'listing_id')
134
+ self.listing_id = attributes[:'listing_id']
135
+ else
136
+ self.listing_id = nil
137
+ end
138
+
139
+ if attributes.key?(:'guest_id')
140
+ self.guest_id = attributes[:'guest_id']
141
+ else
142
+ self.guest_id = nil
143
+ end
144
+
145
+ if attributes.key?(:'check_in')
146
+ self.check_in = attributes[:'check_in']
147
+ else
148
+ self.check_in = nil
149
+ end
150
+
151
+ if attributes.key?(:'check_out')
152
+ self.check_out = attributes[:'check_out']
153
+ else
154
+ self.check_out = nil
155
+ end
156
+
157
+ if attributes.key?(:'status')
158
+ self.status = attributes[:'status']
159
+ else
160
+ self.status = nil
161
+ end
162
+
163
+ if attributes.key?(:'platform')
164
+ self.platform = attributes[:'platform']
165
+ end
166
+
167
+ if attributes.key?(:'total_price')
168
+ self.total_price = attributes[:'total_price']
169
+ else
170
+ self.total_price = nil
171
+ end
172
+
173
+ if attributes.key?(:'currency')
174
+ self.currency = attributes[:'currency']
175
+ else
176
+ self.currency = nil
177
+ end
178
+
179
+ if attributes.key?(:'confirmation_code')
180
+ self.confirmation_code = attributes[:'confirmation_code']
181
+ else
182
+ self.confirmation_code = nil
183
+ end
184
+
185
+ if attributes.key?(:'guest_details')
186
+ if (value = attributes[:'guest_details']).is_a?(Hash)
187
+ self.guest_details = value
188
+ end
189
+ else
190
+ self.guest_details = nil
191
+ end
192
+
193
+ if attributes.key?(:'created_at')
194
+ self.created_at = attributes[:'created_at']
195
+ else
196
+ self.created_at = nil
197
+ end
198
+
199
+ if attributes.key?(:'guest_name')
200
+ self.guest_name = attributes[:'guest_name']
201
+ end
202
+ end
203
+
204
+ # Show invalid properties with the reasons. Usually used together with valid?
205
+ # @return Array for valid properties with the reasons
206
+ def list_invalid_properties
207
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
208
+ invalid_properties = Array.new
209
+ if @id.nil?
210
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
211
+ end
212
+
213
+ if @listing_id.nil?
214
+ invalid_properties.push('invalid value for "listing_id", listing_id cannot be nil.')
215
+ end
216
+
217
+ if @guest_id.nil?
218
+ invalid_properties.push('invalid value for "guest_id", guest_id cannot be nil.')
219
+ end
220
+
221
+ if @check_in.nil?
222
+ invalid_properties.push('invalid value for "check_in", check_in cannot be nil.')
223
+ end
224
+
225
+ if @check_out.nil?
226
+ invalid_properties.push('invalid value for "check_out", check_out cannot be nil.')
227
+ end
228
+
229
+ if @status.nil?
230
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
231
+ end
232
+
233
+ if @total_price.nil?
234
+ invalid_properties.push('invalid value for "total_price", total_price cannot be nil.')
235
+ end
236
+
237
+ if @currency.nil?
238
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
239
+ end
240
+
241
+ if @confirmation_code.nil?
242
+ invalid_properties.push('invalid value for "confirmation_code", confirmation_code cannot be nil.')
243
+ end
244
+
245
+ if @guest_details.nil?
246
+ invalid_properties.push('invalid value for "guest_details", guest_details cannot be nil.')
247
+ end
248
+
249
+ if @created_at.nil?
250
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
251
+ end
252
+
253
+ invalid_properties
254
+ end
255
+
256
+ # Check to see if the all the properties in the model are valid
257
+ # @return true if the model is valid
258
+ def valid?
259
+ warn '[DEPRECATED] the `valid?` method is obsolete'
260
+ return false if @id.nil?
261
+ return false if @listing_id.nil?
262
+ return false if @guest_id.nil?
263
+ return false if @check_in.nil?
264
+ return false if @check_out.nil?
265
+ return false if @status.nil?
266
+ return false if @total_price.nil?
267
+ return false if @currency.nil?
268
+ return false if @confirmation_code.nil?
269
+ return false if @guest_details.nil?
270
+ return false if @created_at.nil?
271
+ true
272
+ end
273
+
274
+ # Custom attribute writer method with validation
275
+ # @param [Object] id Value to be assigned
276
+ def id=(id)
277
+ if id.nil?
278
+ fail ArgumentError, 'id cannot be nil'
279
+ end
280
+
281
+ @id = id
282
+ end
283
+
284
+ # Custom attribute writer method with validation
285
+ # @param [Object] listing_id Value to be assigned
286
+ def listing_id=(listing_id)
287
+ if listing_id.nil?
288
+ fail ArgumentError, 'listing_id cannot be nil'
289
+ end
290
+
291
+ @listing_id = listing_id
292
+ end
293
+
294
+ # Custom attribute writer method with validation
295
+ # @param [Object] guest_id Value to be assigned
296
+ def guest_id=(guest_id)
297
+ if guest_id.nil?
298
+ fail ArgumentError, 'guest_id cannot be nil'
299
+ end
300
+
301
+ @guest_id = guest_id
302
+ end
303
+
304
+ # Custom attribute writer method with validation
305
+ # @param [Object] check_in Value to be assigned
306
+ def check_in=(check_in)
307
+ if check_in.nil?
308
+ fail ArgumentError, 'check_in cannot be nil'
309
+ end
310
+
311
+ @check_in = check_in
312
+ end
313
+
314
+ # Custom attribute writer method with validation
315
+ # @param [Object] check_out Value to be assigned
316
+ def check_out=(check_out)
317
+ if check_out.nil?
318
+ fail ArgumentError, 'check_out cannot be nil'
319
+ end
320
+
321
+ @check_out = check_out
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] status Value to be assigned
326
+ def status=(status)
327
+ if status.nil?
328
+ fail ArgumentError, 'status cannot be nil'
329
+ end
330
+
331
+ @status = status
332
+ end
333
+
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] total_price Value to be assigned
336
+ def total_price=(total_price)
337
+ if total_price.nil?
338
+ fail ArgumentError, 'total_price cannot be nil'
339
+ end
340
+
341
+ @total_price = total_price
342
+ end
343
+
344
+ # Custom attribute writer method with validation
345
+ # @param [Object] currency Value to be assigned
346
+ def currency=(currency)
347
+ if currency.nil?
348
+ fail ArgumentError, 'currency cannot be nil'
349
+ end
350
+
351
+ @currency = currency
352
+ end
353
+
354
+ # Custom attribute writer method with validation
355
+ # @param [Object] confirmation_code Value to be assigned
356
+ def confirmation_code=(confirmation_code)
357
+ if confirmation_code.nil?
358
+ fail ArgumentError, 'confirmation_code cannot be nil'
359
+ end
360
+
361
+ @confirmation_code = confirmation_code
362
+ end
363
+
364
+ # Custom attribute writer method with validation
365
+ # @param [Object] guest_details Value to be assigned
366
+ def guest_details=(guest_details)
367
+ if guest_details.nil?
368
+ fail ArgumentError, 'guest_details cannot be nil'
369
+ end
370
+
371
+ @guest_details = guest_details
372
+ end
373
+
374
+ # Custom attribute writer method with validation
375
+ # @param [Object] created_at Value to be assigned
376
+ def created_at=(created_at)
377
+ if created_at.nil?
378
+ fail ArgumentError, 'created_at cannot be nil'
379
+ end
380
+
381
+ @created_at = created_at
382
+ end
383
+
384
+ # Checks equality by comparing each attribute.
385
+ # @param [Object] Object to be compared
386
+ def ==(o)
387
+ return true if self.equal?(o)
388
+ self.class == o.class &&
389
+ id == o.id &&
390
+ listing_id == o.listing_id &&
391
+ guest_id == o.guest_id &&
392
+ check_in == o.check_in &&
393
+ check_out == o.check_out &&
394
+ status == o.status &&
395
+ platform == o.platform &&
396
+ total_price == o.total_price &&
397
+ currency == o.currency &&
398
+ confirmation_code == o.confirmation_code &&
399
+ guest_details == o.guest_details &&
400
+ created_at == o.created_at &&
401
+ guest_name == o.guest_name
402
+ end
403
+
404
+ # @see the `==` method
405
+ # @param [Object] Object to be compared
406
+ def eql?(o)
407
+ self == o
408
+ end
409
+
410
+ # Calculates hash code according to all attributes.
411
+ # @return [Integer] Hash code
412
+ def hash
413
+ [id, listing_id, guest_id, check_in, check_out, status, platform, total_price, currency, confirmation_code, guest_details, created_at, guest_name].hash
414
+ end
415
+
416
+ # Builds the object from hash
417
+ # @param [Hash] attributes Model attributes in the form of hash
418
+ # @return [Object] Returns the model itself
419
+ def self.build_from_hash(attributes)
420
+ return nil unless attributes.is_a?(Hash)
421
+ attributes = attributes.transform_keys(&:to_sym)
422
+ transformed_hash = {}
423
+ openapi_types.each_pair do |key, type|
424
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
425
+ transformed_hash["#{key}"] = nil
426
+ elsif type =~ /\AArray<(.*)>/i
427
+ # check to ensure the input is an array given that the attribute
428
+ # is documented as an array but the input is not
429
+ if attributes[attribute_map[key]].is_a?(Array)
430
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
431
+ end
432
+ elsif !attributes[attribute_map[key]].nil?
433
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
434
+ end
435
+ end
436
+ new(transformed_hash)
437
+ end
438
+
439
+ # Returns the object in the form of hash
440
+ # @return [Hash] Returns the object in the form of hash
441
+ def to_hash
442
+ hash = {}
443
+ self.class.attribute_map.each_pair do |attr, param|
444
+ value = self.send(attr)
445
+ if value.nil?
446
+ is_nullable = self.class.openapi_nullable.include?(attr)
447
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
448
+ end
449
+
450
+ hash[param] = _to_hash(value)
451
+ end
452
+ hash
453
+ end
454
+
455
+ end
456
+
457
+ end
@@ -0,0 +1,159 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: ivan@vanio.ai
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
+ # Cursor-paginated reservation list. Pass `pagination.nextCursor` back as `?cursor=` to fetch the next page; stop when `pagination.hasMore` is `false`. The `total` field is the count of rows matching the current filter (across all pages); pass `?include_total=false` to skip the COUNT(*) on very large workspaces.
18
+ class ReservationListResponse < ApiModelBase
19
+ attr_accessor :data
20
+
21
+ attr_accessor :pagination
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'data' => :'data',
27
+ :'pagination' => :'pagination'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'data' => :'Array<Reservation>',
45
+ :'pagination' => :'Pagination'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ReservationListResponse` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ReservationListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'data')
72
+ if (value = attributes[:'data']).is_a?(Array)
73
+ self.data = value
74
+ end
75
+ end
76
+
77
+ if attributes.key?(:'pagination')
78
+ self.pagination = attributes[:'pagination']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ data == o.data &&
103
+ pagination == o.pagination
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [data, pagination].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Returns the object in the form of hash
142
+ # @return [Hash] Returns the object in the form of hash
143
+ def to_hash
144
+ hash = {}
145
+ self.class.attribute_map.each_pair do |attr, param|
146
+ value = self.send(attr)
147
+ if value.nil?
148
+ is_nullable = self.class.openapi_nullable.include?(attr)
149
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
150
+ end
151
+
152
+ hash[param] = _to_hash(value)
153
+ end
154
+ hash
155
+ end
156
+
157
+ end
158
+
159
+ end