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,387 @@
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 'cgi'
14
+
15
+ module Repull
16
+ class ReservationsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Cancel reservation
23
+ # Cancel an existing reservation. Cancellation rules vary by provider — Airbnb host-cancellations carry penalties; Booking.com cancellations apply the per-rate-plan policy. Once 200 is returned, the upstream PMS state is committed.
24
+ # @param id [Integer]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [nil]
27
+ def cancel_reservation(id, opts = {})
28
+ cancel_reservation_with_http_info(id, opts)
29
+ nil
30
+ end
31
+
32
+ # Cancel reservation
33
+ # Cancel an existing reservation. Cancellation rules vary by provider — Airbnb host-cancellations carry penalties; Booking.com cancellations apply the per-rate-plan policy. Once 200 is returned, the upstream PMS state is committed.
34
+ # @param id [Integer]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
+ def cancel_reservation_with_http_info(id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ReservationsApi.cancel_reservation ...'
40
+ end
41
+ # verify the required parameter 'id' is set
42
+ if @api_client.config.client_side_validation && id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReservationsApi.cancel_reservation"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v1/reservations/{id}'.sub('{id}', CGI.escape(id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:debug_body]
59
+
60
+ # return_type
61
+ return_type = opts[:debug_return_type]
62
+
63
+ # auth_names
64
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
65
+
66
+ new_options = opts.merge(
67
+ :operation => :"ReservationsApi.cancel_reservation",
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: ReservationsApi#cancel_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+
83
+ # Create a reservation
84
+ # Create a reservation in the source PMS. Required fields depend on the connected provider (e.g. Airbnb requires guest email; Booking.com requires hotel id). Validation errors return 422 with the offending `field` populated.
85
+ # @param create_reservation_request [CreateReservationRequest]
86
+ # @param [Hash] opts the optional parameters
87
+ # @return [Reservation]
88
+ def create_reservation(create_reservation_request, opts = {})
89
+ data, _status_code, _headers = create_reservation_with_http_info(create_reservation_request, opts)
90
+ data
91
+ end
92
+
93
+ # Create a reservation
94
+ # Create a reservation in the source PMS. Required fields depend on the connected provider (e.g. Airbnb requires guest email; Booking.com requires hotel id). Validation errors return 422 with the offending &#x60;field&#x60; populated.
95
+ # @param create_reservation_request [CreateReservationRequest]
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
98
+ def create_reservation_with_http_info(create_reservation_request, opts = {})
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug 'Calling API: ReservationsApi.create_reservation ...'
101
+ end
102
+ # verify the required parameter 'create_reservation_request' is set
103
+ if @api_client.config.client_side_validation && create_reservation_request.nil?
104
+ fail ArgumentError, "Missing the required parameter 'create_reservation_request' when calling ReservationsApi.create_reservation"
105
+ end
106
+ # resource path
107
+ local_var_path = '/v1/reservations'
108
+
109
+ # query parameters
110
+ query_params = opts[:query_params] || {}
111
+
112
+ # header parameters
113
+ header_params = opts[:header_params] || {}
114
+ # HTTP header 'Accept' (if needed)
115
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
116
+ # HTTP header 'Content-Type'
117
+ content_type = @api_client.select_header_content_type(['application/json'])
118
+ if !content_type.nil?
119
+ header_params['Content-Type'] = content_type
120
+ end
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_reservation_request)
127
+
128
+ # return_type
129
+ return_type = opts[:debug_return_type] || 'Reservation'
130
+
131
+ # auth_names
132
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
133
+
134
+ new_options = opts.merge(
135
+ :operation => :"ReservationsApi.create_reservation",
136
+ :header_params => header_params,
137
+ :query_params => query_params,
138
+ :form_params => form_params,
139
+ :body => post_body,
140
+ :auth_names => auth_names,
141
+ :return_type => return_type
142
+ )
143
+
144
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: ReservationsApi#create_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
+ end
148
+ return data, status_code, headers
149
+ end
150
+
151
+ # Get reservation details
152
+ # Returns the full record for a single reservation, scoped to the authenticated workspace. Response shape is identical to a single row in `GET /v1/reservations` so SDK consumers can use the same type for both. Returns **404** if the id does not exist OR belongs to a different workspace — the API never differentiates the two so caller can't enumerate other workspaces' ids.
153
+ # @param id [Integer] Internal Repull reservation ID.
154
+ # @param [Hash] opts the optional parameters
155
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
156
+ # @return [Reservation]
157
+ def get_reservation(id, opts = {})
158
+ data, _status_code, _headers = get_reservation_with_http_info(id, opts)
159
+ data
160
+ end
161
+
162
+ # Get reservation details
163
+ # Returns the full record for a single reservation, scoped to the authenticated workspace. Response shape is identical to a single row in &#x60;GET /v1/reservations&#x60; so SDK consumers can use the same type for both. Returns **404** if the id does not exist OR belongs to a different workspace — the API never differentiates the two so caller can&#39;t enumerate other workspaces&#39; ids.
164
+ # @param id [Integer] Internal Repull reservation ID.
165
+ # @param [Hash] opts the optional parameters
166
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
167
+ # @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
168
+ def get_reservation_with_http_info(id, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: ReservationsApi.get_reservation ...'
171
+ end
172
+ # verify the required parameter 'id' is set
173
+ if @api_client.config.client_side_validation && id.nil?
174
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReservationsApi.get_reservation"
175
+ end
176
+ # resource path
177
+ local_var_path = '/v1/reservations/{id}'.sub('{id}', CGI.escape(id.to_s))
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
186
+ header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
187
+
188
+ # form parameters
189
+ form_params = opts[:form_params] || {}
190
+
191
+ # http body (model)
192
+ post_body = opts[:debug_body]
193
+
194
+ # return_type
195
+ return_type = opts[:debug_return_type] || 'Reservation'
196
+
197
+ # auth_names
198
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
199
+
200
+ new_options = opts.merge(
201
+ :operation => :"ReservationsApi.get_reservation",
202
+ :header_params => header_params,
203
+ :query_params => query_params,
204
+ :form_params => form_params,
205
+ :body => post_body,
206
+ :auth_names => auth_names,
207
+ :return_type => return_type
208
+ )
209
+
210
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
211
+ if @api_client.config.debugging
212
+ @api_client.config.logger.debug "API called: ReservationsApi#get_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
213
+ end
214
+ return data, status_code, headers
215
+ end
216
+
217
+ # List reservations
218
+ # Cursor-paginated list of reservations across all connected PMS platforms. Filter by platform, status, listing, or check-in date range. **Pagination:** Walk pages with `?cursor=` — pass `pagination.nextCursor` from one response back as `?cursor=` on the next request. Stop when `pagination.hasMore` is `false`. `limit` defaults to 50, max 100; requesting more returns 422 (no silent truncation). **Breaking change:** `?offset=` is no longer accepted. Requests passing it return 422 with a `did_you_mean: 'cursor'` hint.
219
+ # @param [Hash] opts the optional parameters
220
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
221
+ # @option opts [Integer] :limit Page size (max 100). Requests over the cap return 422. (default to 50)
222
+ # @option opts [String] :cursor Opaque cursor returned in the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.
223
+ # @option opts [String] :platform Filter by booking platform
224
+ # @option opts [String] :status
225
+ # @option opts [Integer] :listing_id Filter to a single listing
226
+ # @option opts [Date] :check_in_after Check-in date &gt;&#x3D; this value
227
+ # @option opts [Date] :check_in_before Check-in date &lt;&#x3D; this value
228
+ # @option opts [Date] :check_in_from Deprecated alias for &#x60;check_in_after&#x60;.
229
+ # @option opts [Date] :check_in_to Deprecated alias for &#x60;check_in_before&#x60;.
230
+ # @option opts [Boolean] :include_total When &#x60;true&#x60; (default), the response&#39;s &#x60;pagination.total&#x60; carries the count of rows matching the current filter, across all pages. Pass &#x60;false&#x60; to skip the count for very large workspaces where the per-page COUNT(*) cost matters. (default to true)
231
+ # @return [ReservationListResponse]
232
+ def list_reservations(opts = {})
233
+ data, _status_code, _headers = list_reservations_with_http_info(opts)
234
+ data
235
+ end
236
+
237
+ # List reservations
238
+ # Cursor-paginated list of reservations across all connected PMS platforms. Filter by platform, status, listing, or check-in date range. **Pagination:** Walk pages with &#x60;?cursor&#x3D;&#x60; — pass &#x60;pagination.nextCursor&#x60; from one response back as &#x60;?cursor&#x3D;&#x60; on the next request. Stop when &#x60;pagination.hasMore&#x60; is &#x60;false&#x60;. &#x60;limit&#x60; defaults to 50, max 100; requesting more returns 422 (no silent truncation). **Breaking change:** &#x60;?offset&#x3D;&#x60; is no longer accepted. Requests passing it return 422 with a &#x60;did_you_mean: &#39;cursor&#39;&#x60; hint.
239
+ # @param [Hash] opts the optional parameters
240
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
241
+ # @option opts [Integer] :limit Page size (max 100). Requests over the cap return 422. (default to 50)
242
+ # @option opts [String] :cursor Opaque cursor returned in the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.
243
+ # @option opts [String] :platform Filter by booking platform
244
+ # @option opts [String] :status
245
+ # @option opts [Integer] :listing_id Filter to a single listing
246
+ # @option opts [Date] :check_in_after Check-in date &gt;&#x3D; this value
247
+ # @option opts [Date] :check_in_before Check-in date &lt;&#x3D; this value
248
+ # @option opts [Date] :check_in_from Deprecated alias for &#x60;check_in_after&#x60;.
249
+ # @option opts [Date] :check_in_to Deprecated alias for &#x60;check_in_before&#x60;.
250
+ # @option opts [Boolean] :include_total When &#x60;true&#x60; (default), the response&#39;s &#x60;pagination.total&#x60; carries the count of rows matching the current filter, across all pages. Pass &#x60;false&#x60; to skip the count for very large workspaces where the per-page COUNT(*) cost matters. (default to true)
251
+ # @return [Array<(ReservationListResponse, Integer, Hash)>] ReservationListResponse data, response status code and response headers
252
+ def list_reservations_with_http_info(opts = {})
253
+ if @api_client.config.debugging
254
+ @api_client.config.logger.debug 'Calling API: ReservationsApi.list_reservations ...'
255
+ end
256
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
257
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReservationsApi.list_reservations, must be smaller than or equal to 100.'
258
+ end
259
+
260
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
261
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReservationsApi.list_reservations, must be greater than or equal to 1.'
262
+ end
263
+
264
+ allowable_values = ["confirmed", "pending", "cancelled", "completed"]
265
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
266
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
267
+ end
268
+ # resource path
269
+ local_var_path = '/v1/reservations'
270
+
271
+ # query parameters
272
+ query_params = opts[:query_params] || {}
273
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
274
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
275
+ query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
276
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
277
+ query_params[:'listingId'] = opts[:'listing_id'] if !opts[:'listing_id'].nil?
278
+ query_params[:'check_in_after'] = opts[:'check_in_after'] if !opts[:'check_in_after'].nil?
279
+ query_params[:'check_in_before'] = opts[:'check_in_before'] if !opts[:'check_in_before'].nil?
280
+ query_params[:'checkInFrom'] = opts[:'check_in_from'] if !opts[:'check_in_from'].nil?
281
+ query_params[:'checkInTo'] = opts[:'check_in_to'] if !opts[:'check_in_to'].nil?
282
+ query_params[:'include_total'] = opts[:'include_total'] if !opts[:'include_total'].nil?
283
+
284
+ # header parameters
285
+ header_params = opts[:header_params] || {}
286
+ # HTTP header 'Accept' (if needed)
287
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
288
+ header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
289
+
290
+ # form parameters
291
+ form_params = opts[:form_params] || {}
292
+
293
+ # http body (model)
294
+ post_body = opts[:debug_body]
295
+
296
+ # return_type
297
+ return_type = opts[:debug_return_type] || 'ReservationListResponse'
298
+
299
+ # auth_names
300
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
301
+
302
+ new_options = opts.merge(
303
+ :operation => :"ReservationsApi.list_reservations",
304
+ :header_params => header_params,
305
+ :query_params => query_params,
306
+ :form_params => form_params,
307
+ :body => post_body,
308
+ :auth_names => auth_names,
309
+ :return_type => return_type
310
+ )
311
+
312
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
313
+ if @api_client.config.debugging
314
+ @api_client.config.logger.debug "API called: ReservationsApi#list_reservations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
315
+ end
316
+ return data, status_code, headers
317
+ end
318
+
319
+ # Update reservation
320
+ # Patch reservation fields (dates, status, special requests). Only fields included in the body are modified. Use the cancel endpoint for cancellations — DELETE handles cancellation but not partial updates.
321
+ # @param id [Integer]
322
+ # @param [Hash] opts the optional parameters
323
+ # @option opts [UpdateReservationRequest] :update_reservation_request
324
+ # @return [nil]
325
+ def update_reservation(id, opts = {})
326
+ update_reservation_with_http_info(id, opts)
327
+ nil
328
+ end
329
+
330
+ # Update reservation
331
+ # Patch reservation fields (dates, status, special requests). Only fields included in the body are modified. Use the cancel endpoint for cancellations — DELETE handles cancellation but not partial updates.
332
+ # @param id [Integer]
333
+ # @param [Hash] opts the optional parameters
334
+ # @option opts [UpdateReservationRequest] :update_reservation_request
335
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
336
+ def update_reservation_with_http_info(id, opts = {})
337
+ if @api_client.config.debugging
338
+ @api_client.config.logger.debug 'Calling API: ReservationsApi.update_reservation ...'
339
+ end
340
+ # verify the required parameter 'id' is set
341
+ if @api_client.config.client_side_validation && id.nil?
342
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReservationsApi.update_reservation"
343
+ end
344
+ # resource path
345
+ local_var_path = '/v1/reservations/{id}'.sub('{id}', CGI.escape(id.to_s))
346
+
347
+ # query parameters
348
+ query_params = opts[:query_params] || {}
349
+
350
+ # header parameters
351
+ header_params = opts[:header_params] || {}
352
+ # HTTP header 'Content-Type'
353
+ content_type = @api_client.select_header_content_type(['application/json'])
354
+ if !content_type.nil?
355
+ header_params['Content-Type'] = content_type
356
+ end
357
+
358
+ # form parameters
359
+ form_params = opts[:form_params] || {}
360
+
361
+ # http body (model)
362
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_reservation_request'])
363
+
364
+ # return_type
365
+ return_type = opts[:debug_return_type]
366
+
367
+ # auth_names
368
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
369
+
370
+ new_options = opts.merge(
371
+ :operation => :"ReservationsApi.update_reservation",
372
+ :header_params => header_params,
373
+ :query_params => query_params,
374
+ :form_params => form_params,
375
+ :body => post_body,
376
+ :auth_names => auth_names,
377
+ :return_type => return_type
378
+ )
379
+
380
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
381
+ if @api_client.config.debugging
382
+ @api_client.config.logger.debug "API called: ReservationsApi#update_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
383
+ end
384
+ return data, status_code, headers
385
+ end
386
+ end
387
+ end
@@ -0,0 +1,208 @@
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 'cgi'
14
+
15
+ module Repull
16
+ class ReviewsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get review
23
+ # Returns one review (the bare `Review` object — NOT wrapped in `{ data: ... }`). Scoped to the authenticated workspace via the listings join — reviews that don't belong to the workspace return 404 (we don't differentiate to avoid leaking other customers' ids).
24
+ # @param id [Integer] Internal Repull review id.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
27
+ # @return [Review]
28
+ def get_review(id, opts = {})
29
+ data, _status_code, _headers = get_review_with_http_info(id, opts)
30
+ data
31
+ end
32
+
33
+ # Get review
34
+ # Returns one review (the bare &#x60;Review&#x60; object — NOT wrapped in &#x60;{ data: ... }&#x60;). Scoped to the authenticated workspace via the listings join — reviews that don&#39;t belong to the workspace return 404 (we don&#39;t differentiate to avoid leaking other customers&#39; ids).
35
+ # @param id [Integer] Internal Repull review id.
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
38
+ # @return [Array<(Review, Integer, Hash)>] Review data, response status code and response headers
39
+ def get_review_with_http_info(id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ReviewsApi.get_review ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling ReviewsApi.get_review"
46
+ end
47
+ # resource path
48
+ local_var_path = '/v1/reviews/{id}'.sub('{id}', CGI.escape(id.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
+ header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:debug_body]
64
+
65
+ # return_type
66
+ return_type = opts[:debug_return_type] || 'Review'
67
+
68
+ # auth_names
69
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
70
+
71
+ new_options = opts.merge(
72
+ :operation => :"ReviewsApi.get_review",
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: ReviewsApi#get_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # List reviews
89
+ # Cursor-paginated guest + host review stream for the workspace. Backed by main vanio's unified `reviews` table (populated by per-channel backfill crons), so this surface returns the complete cross-channel history — separate from `/v1/channels/airbnb/reviews` which hits Airbnb live. Filters: `platform` (`airbnb`|`booking`|`vrbo`), `listing_id` (internal Repull listing id), `rating_min` / `rating_max` (inclusive bounds, 0..5), `status` (`responded`|`unanswered`|`all`), `reviewer_role` (`guest` (default) | `host` | `all`).
90
+ # @param [Hash] opts the optional parameters
91
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
92
+ # @option opts [String] :cursor Opaque cursor returned in the previous response&#39;s &#x60;pagination.nextCursor&#x60;.
93
+ # @option opts [Integer] :limit (default to 20)
94
+ # @option opts [String] :platform
95
+ # @option opts [Integer] :listing_id Restrict to one internal Repull listing.
96
+ # @option opts [Float] :rating_min
97
+ # @option opts [Float] :rating_max
98
+ # @option opts [String] :status &#x60;responded&#x60; — host has replied. &#x60;unanswered&#x60; — host has not replied. &#x60;all&#x60; — no filter.
99
+ # @option opts [String] :reviewer_role &#x60;guest&#x60; (default) — reviews written by guests about the host/property. &#x60;host&#x60; — reviews written by the host about guests. &#x60;all&#x60; — both. (default to 'guest')
100
+ # @return [ReviewListResponse]
101
+ def list_reviews(opts = {})
102
+ data, _status_code, _headers = list_reviews_with_http_info(opts)
103
+ data
104
+ end
105
+
106
+ # List reviews
107
+ # Cursor-paginated guest + host review stream for the workspace. Backed by main vanio&#39;s unified &#x60;reviews&#x60; table (populated by per-channel backfill crons), so this surface returns the complete cross-channel history — separate from &#x60;/v1/channels/airbnb/reviews&#x60; which hits Airbnb live. Filters: &#x60;platform&#x60; (&#x60;airbnb&#x60;|&#x60;booking&#x60;|&#x60;vrbo&#x60;), &#x60;listing_id&#x60; (internal Repull listing id), &#x60;rating_min&#x60; / &#x60;rating_max&#x60; (inclusive bounds, 0..5), &#x60;status&#x60; (&#x60;responded&#x60;|&#x60;unanswered&#x60;|&#x60;all&#x60;), &#x60;reviewer_role&#x60; (&#x60;guest&#x60; (default) | &#x60;host&#x60; | &#x60;all&#x60;).
108
+ # @param [Hash] opts the optional parameters
109
+ # @option opts [String] :x_schema Apply a custom or built-in schema to transform the response. Built-in: &#x60;native&#x60; (default), &#x60;calry&#x60;, &#x60;calry-v1&#x60;. Custom: any schema name created via &#x60;POST /v1/schema/custom&#x60;. Unknown / inactive schema names fall back to &#x60;native&#x60;.
110
+ # @option opts [String] :cursor Opaque cursor returned in the previous response&#39;s &#x60;pagination.nextCursor&#x60;.
111
+ # @option opts [Integer] :limit (default to 20)
112
+ # @option opts [String] :platform
113
+ # @option opts [Integer] :listing_id Restrict to one internal Repull listing.
114
+ # @option opts [Float] :rating_min
115
+ # @option opts [Float] :rating_max
116
+ # @option opts [String] :status &#x60;responded&#x60; — host has replied. &#x60;unanswered&#x60; — host has not replied. &#x60;all&#x60; — no filter.
117
+ # @option opts [String] :reviewer_role &#x60;guest&#x60; (default) — reviews written by guests about the host/property. &#x60;host&#x60; — reviews written by the host about guests. &#x60;all&#x60; — both. (default to 'guest')
118
+ # @return [Array<(ReviewListResponse, Integer, Hash)>] ReviewListResponse data, response status code and response headers
119
+ def list_reviews_with_http_info(opts = {})
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug 'Calling API: ReviewsApi.list_reviews ...'
122
+ end
123
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
124
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReviewsApi.list_reviews, must be smaller than or equal to 100.'
125
+ end
126
+
127
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
128
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReviewsApi.list_reviews, must be greater than or equal to 1.'
129
+ end
130
+
131
+ allowable_values = ["airbnb", "booking", "vrbo"]
132
+ if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform'])
133
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
134
+ end
135
+ if @api_client.config.client_side_validation && !opts[:'rating_min'].nil? && opts[:'rating_min'] > 5
136
+ fail ArgumentError, 'invalid value for "opts[:"rating_min"]" when calling ReviewsApi.list_reviews, must be smaller than or equal to 5.'
137
+ end
138
+
139
+ if @api_client.config.client_side_validation && !opts[:'rating_min'].nil? && opts[:'rating_min'] < 0
140
+ fail ArgumentError, 'invalid value for "opts[:"rating_min"]" when calling ReviewsApi.list_reviews, must be greater than or equal to 0.'
141
+ end
142
+
143
+ if @api_client.config.client_side_validation && !opts[:'rating_max'].nil? && opts[:'rating_max'] > 5
144
+ fail ArgumentError, 'invalid value for "opts[:"rating_max"]" when calling ReviewsApi.list_reviews, must be smaller than or equal to 5.'
145
+ end
146
+
147
+ if @api_client.config.client_side_validation && !opts[:'rating_max'].nil? && opts[:'rating_max'] < 0
148
+ fail ArgumentError, 'invalid value for "opts[:"rating_max"]" when calling ReviewsApi.list_reviews, must be greater than or equal to 0.'
149
+ end
150
+
151
+ allowable_values = ["responded", "unanswered", "all"]
152
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
153
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
154
+ end
155
+ allowable_values = ["guest", "host", "all"]
156
+ if @api_client.config.client_side_validation && opts[:'reviewer_role'] && !allowable_values.include?(opts[:'reviewer_role'])
157
+ fail ArgumentError, "invalid value for \"reviewer_role\", must be one of #{allowable_values}"
158
+ end
159
+ # resource path
160
+ local_var_path = '/v1/reviews'
161
+
162
+ # query parameters
163
+ query_params = opts[:query_params] || {}
164
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
165
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
166
+ query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
167
+ query_params[:'listingId'] = opts[:'listing_id'] if !opts[:'listing_id'].nil?
168
+ query_params[:'rating_min'] = opts[:'rating_min'] if !opts[:'rating_min'].nil?
169
+ query_params[:'rating_max'] = opts[:'rating_max'] if !opts[:'rating_max'].nil?
170
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
171
+ query_params[:'reviewerRole'] = opts[:'reviewer_role'] if !opts[:'reviewer_role'].nil?
172
+
173
+ # header parameters
174
+ header_params = opts[:header_params] || {}
175
+ # HTTP header 'Accept' (if needed)
176
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
177
+ header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil?
178
+
179
+ # form parameters
180
+ form_params = opts[:form_params] || {}
181
+
182
+ # http body (model)
183
+ post_body = opts[:debug_body]
184
+
185
+ # return_type
186
+ return_type = opts[:debug_return_type] || 'ReviewListResponse'
187
+
188
+ # auth_names
189
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
190
+
191
+ new_options = opts.merge(
192
+ :operation => :"ReviewsApi.list_reviews",
193
+ :header_params => header_params,
194
+ :query_params => query_params,
195
+ :form_params => form_params,
196
+ :body => post_body,
197
+ :auth_names => auth_names,
198
+ :return_type => return_type
199
+ )
200
+
201
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug "API called: ReviewsApi#list_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
+ end
205
+ return data, status_code, headers
206
+ end
207
+ end
208
+ end