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,617 @@
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 BookingComApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Booking.com property
23
+ # Onboard a new Booking.com hotel via the OAuth Connect flow. Returns the hotel id once Stage-1 designation completes in the Extranet.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [BookingProperty]
26
+ def create_booking_property(opts = {})
27
+ data, _status_code, _headers = create_booking_property_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Create Booking.com property
32
+ # Onboard a new Booking.com hotel via the OAuth Connect flow. Returns the hotel id once Stage-1 designation completes in the Extranet.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(BookingProperty, Integer, Hash)>] BookingProperty data, response status code and response headers
35
+ def create_booking_property_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: BookingComApi.create_booking_property ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v1/channels/booking/properties'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'BookingProperty'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"BookingComApi.create_booking_property",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: BookingComApi#create_booking_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Get Booking.com content
80
+ # Fetch the current content (descriptions, amenities, photos) for a Booking.com property. Used to round-trip edits through Repull.
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [nil]
83
+ def get_booking_content(opts = {})
84
+ get_booking_content_with_http_info(opts)
85
+ nil
86
+ end
87
+
88
+ # Get Booking.com content
89
+ # Fetch the current content (descriptions, amenities, photos) for a Booking.com property. Used to round-trip edits through Repull.
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
92
+ def get_booking_content_with_http_info(opts = {})
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug 'Calling API: BookingComApi.get_booking_content ...'
95
+ end
96
+ # resource path
97
+ local_var_path = '/v1/channels/booking/content'
98
+
99
+ # query parameters
100
+ query_params = opts[:query_params] || {}
101
+
102
+ # header parameters
103
+ header_params = opts[:header_params] || {}
104
+
105
+ # form parameters
106
+ form_params = opts[:form_params] || {}
107
+
108
+ # http body (model)
109
+ post_body = opts[:debug_body]
110
+
111
+ # return_type
112
+ return_type = opts[:debug_return_type]
113
+
114
+ # auth_names
115
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
116
+
117
+ new_options = opts.merge(
118
+ :operation => :"BookingComApi.get_booking_content",
119
+ :header_params => header_params,
120
+ :query_params => query_params,
121
+ :form_params => form_params,
122
+ :body => post_body,
123
+ :auth_names => auth_names,
124
+ :return_type => return_type
125
+ )
126
+
127
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
128
+ if @api_client.config.debugging
129
+ @api_client.config.logger.debug "API called: BookingComApi#get_booking_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
130
+ end
131
+ return data, status_code, headers
132
+ end
133
+
134
+ # Get Booking.com pricing for a listing
135
+ # Resolves the Vanio listing ID to its Booking.com `hotel_id` (via the `listings_booking` mapping owned by the authenticated workspace), then proxies Booking's `getRoomRateAvailability` for the requested window. Pricing on Booking is per-room/per-rate-plan, so `room_id` and `room_level` flow through query params unchanged. Mirrors the per-channel `/listings/{id}/pricing` shape used by Airbnb so SDK consumers can carry a Vanio listing ID across channels.
136
+ # @param id [Integer] Vanio listing ID — resolved to a Booking.com hotel ID via the workspace mapping.
137
+ # @param [Hash] opts the optional parameters
138
+ # @option opts [Date] :start_date
139
+ # @option opts [Integer] :number_of_days
140
+ # @option opts [String] :room_id
141
+ # @option opts [Boolean] :room_level When true, returns room-level (vs rate-plan-level) availability.
142
+ # @return [BookingPricingResponse]
143
+ def get_booking_listing_pricing(id, opts = {})
144
+ data, _status_code, _headers = get_booking_listing_pricing_with_http_info(id, opts)
145
+ data
146
+ end
147
+
148
+ # Get Booking.com pricing for a listing
149
+ # Resolves the Vanio listing ID to its Booking.com &#x60;hotel_id&#x60; (via the &#x60;listings_booking&#x60; mapping owned by the authenticated workspace), then proxies Booking&#39;s &#x60;getRoomRateAvailability&#x60; for the requested window. Pricing on Booking is per-room/per-rate-plan, so &#x60;room_id&#x60; and &#x60;room_level&#x60; flow through query params unchanged. Mirrors the per-channel &#x60;/listings/{id}/pricing&#x60; shape used by Airbnb so SDK consumers can carry a Vanio listing ID across channels.
150
+ # @param id [Integer] Vanio listing ID — resolved to a Booking.com hotel ID via the workspace mapping.
151
+ # @param [Hash] opts the optional parameters
152
+ # @option opts [Date] :start_date
153
+ # @option opts [Integer] :number_of_days
154
+ # @option opts [String] :room_id
155
+ # @option opts [Boolean] :room_level When true, returns room-level (vs rate-plan-level) availability.
156
+ # @return [Array<(BookingPricingResponse, Integer, Hash)>] BookingPricingResponse data, response status code and response headers
157
+ def get_booking_listing_pricing_with_http_info(id, opts = {})
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug 'Calling API: BookingComApi.get_booking_listing_pricing ...'
160
+ end
161
+ # verify the required parameter 'id' is set
162
+ if @api_client.config.client_side_validation && id.nil?
163
+ fail ArgumentError, "Missing the required parameter 'id' when calling BookingComApi.get_booking_listing_pricing"
164
+ end
165
+ # resource path
166
+ local_var_path = '/v1/channels/booking/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s))
167
+
168
+ # query parameters
169
+ query_params = opts[:query_params] || {}
170
+ query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
171
+ query_params[:'number_of_days'] = opts[:'number_of_days'] if !opts[:'number_of_days'].nil?
172
+ query_params[:'room_id'] = opts[:'room_id'] if !opts[:'room_id'].nil?
173
+ query_params[:'room_level'] = opts[:'room_level'] if !opts[:'room_level'].nil?
174
+
175
+ # header parameters
176
+ header_params = opts[:header_params] || {}
177
+ # HTTP header 'Accept' (if needed)
178
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
179
+
180
+ # form parameters
181
+ form_params = opts[:form_params] || {}
182
+
183
+ # http body (model)
184
+ post_body = opts[:debug_body]
185
+
186
+ # return_type
187
+ return_type = opts[:debug_return_type] || 'BookingPricingResponse'
188
+
189
+ # auth_names
190
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
191
+
192
+ new_options = opts.merge(
193
+ :operation => :"BookingComApi.get_booking_listing_pricing",
194
+ :header_params => header_params,
195
+ :query_params => query_params,
196
+ :form_params => form_params,
197
+ :body => post_body,
198
+ :auth_names => auth_names,
199
+ :return_type => return_type
200
+ )
201
+
202
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug "API called: BookingComApi#get_booking_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
205
+ end
206
+ return data, status_code, headers
207
+ end
208
+
209
+ # List Booking.com conversations
210
+ # List Booking.com guest conversations. Cursor-paginated. Use the messaging POST to send a reply.
211
+ # @param [Hash] opts the optional parameters
212
+ # @return [BookingConversationListResponse]
213
+ def list_booking_conversations(opts = {})
214
+ data, _status_code, _headers = list_booking_conversations_with_http_info(opts)
215
+ data
216
+ end
217
+
218
+ # List Booking.com conversations
219
+ # List Booking.com guest conversations. Cursor-paginated. Use the messaging POST to send a reply.
220
+ # @param [Hash] opts the optional parameters
221
+ # @return [Array<(BookingConversationListResponse, Integer, Hash)>] BookingConversationListResponse data, response status code and response headers
222
+ def list_booking_conversations_with_http_info(opts = {})
223
+ if @api_client.config.debugging
224
+ @api_client.config.logger.debug 'Calling API: BookingComApi.list_booking_conversations ...'
225
+ end
226
+ # resource path
227
+ local_var_path = '/v1/channels/booking/messaging'
228
+
229
+ # query parameters
230
+ query_params = opts[:query_params] || {}
231
+
232
+ # header parameters
233
+ header_params = opts[:header_params] || {}
234
+ # HTTP header 'Accept' (if needed)
235
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
236
+
237
+ # form parameters
238
+ form_params = opts[:form_params] || {}
239
+
240
+ # http body (model)
241
+ post_body = opts[:debug_body]
242
+
243
+ # return_type
244
+ return_type = opts[:debug_return_type] || 'BookingConversationListResponse'
245
+
246
+ # auth_names
247
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
248
+
249
+ new_options = opts.merge(
250
+ :operation => :"BookingComApi.list_booking_conversations",
251
+ :header_params => header_params,
252
+ :query_params => query_params,
253
+ :form_params => form_params,
254
+ :body => post_body,
255
+ :auth_names => auth_names,
256
+ :return_type => return_type
257
+ )
258
+
259
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
260
+ if @api_client.config.debugging
261
+ @api_client.config.logger.debug "API called: BookingComApi#list_booking_conversations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
262
+ end
263
+ return data, status_code, headers
264
+ end
265
+
266
+ # List Booking.com properties
267
+ # List Booking.com hotels claimed by this workspace. Each row includes the Booking-side hotel id and the connected room types.
268
+ # @param [Hash] opts the optional parameters
269
+ # @return [BookingPropertyListResponse]
270
+ def list_booking_properties(opts = {})
271
+ data, _status_code, _headers = list_booking_properties_with_http_info(opts)
272
+ data
273
+ end
274
+
275
+ # List Booking.com properties
276
+ # List Booking.com hotels claimed by this workspace. Each row includes the Booking-side hotel id and the connected room types.
277
+ # @param [Hash] opts the optional parameters
278
+ # @return [Array<(BookingPropertyListResponse, Integer, Hash)>] BookingPropertyListResponse data, response status code and response headers
279
+ def list_booking_properties_with_http_info(opts = {})
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug 'Calling API: BookingComApi.list_booking_properties ...'
282
+ end
283
+ # resource path
284
+ local_var_path = '/v1/channels/booking/properties'
285
+
286
+ # query parameters
287
+ query_params = opts[:query_params] || {}
288
+
289
+ # header parameters
290
+ header_params = opts[:header_params] || {}
291
+ # HTTP header 'Accept' (if needed)
292
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
293
+
294
+ # form parameters
295
+ form_params = opts[:form_params] || {}
296
+
297
+ # http body (model)
298
+ post_body = opts[:debug_body]
299
+
300
+ # return_type
301
+ return_type = opts[:debug_return_type] || 'BookingPropertyListResponse'
302
+
303
+ # auth_names
304
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
305
+
306
+ new_options = opts.merge(
307
+ :operation => :"BookingComApi.list_booking_properties",
308
+ :header_params => header_params,
309
+ :query_params => query_params,
310
+ :form_params => form_params,
311
+ :body => post_body,
312
+ :auth_names => auth_names,
313
+ :return_type => return_type
314
+ )
315
+
316
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
317
+ if @api_client.config.debugging
318
+ @api_client.config.logger.debug "API called: BookingComApi#list_booking_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
319
+ end
320
+ return data, status_code, headers
321
+ end
322
+
323
+ # Send Booking.com message
324
+ # Send a message in a Booking.com conversation as the host. Booking enforces content rules similar to Airbnb.
325
+ # @param [Hash] opts the optional parameters
326
+ # @return [nil]
327
+ def send_booking_message(opts = {})
328
+ send_booking_message_with_http_info(opts)
329
+ nil
330
+ end
331
+
332
+ # Send Booking.com message
333
+ # Send a message in a Booking.com conversation as the host. Booking enforces content rules similar to Airbnb.
334
+ # @param [Hash] opts the optional parameters
335
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
336
+ def send_booking_message_with_http_info(opts = {})
337
+ if @api_client.config.debugging
338
+ @api_client.config.logger.debug 'Calling API: BookingComApi.send_booking_message ...'
339
+ end
340
+ # resource path
341
+ local_var_path = '/v1/channels/booking/messaging'
342
+
343
+ # query parameters
344
+ query_params = opts[:query_params] || {}
345
+
346
+ # header parameters
347
+ header_params = opts[:header_params] || {}
348
+
349
+ # form parameters
350
+ form_params = opts[:form_params] || {}
351
+
352
+ # http body (model)
353
+ post_body = opts[:debug_body]
354
+
355
+ # return_type
356
+ return_type = opts[:debug_return_type]
357
+
358
+ # auth_names
359
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
360
+
361
+ new_options = opts.merge(
362
+ :operation => :"BookingComApi.send_booking_message",
363
+ :header_params => header_params,
364
+ :query_params => query_params,
365
+ :form_params => form_params,
366
+ :body => post_body,
367
+ :auth_names => auth_names,
368
+ :return_type => return_type
369
+ )
370
+
371
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
372
+ if @api_client.config.debugging
373
+ @api_client.config.logger.debug "API called: BookingComApi#send_booking_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
374
+ end
375
+ return data, status_code, headers
376
+ end
377
+
378
+ # Bulk sync to Booking.com
379
+ # Trigger a full bulk sync of properties + availability + rates to Booking.com. Runs async — returns 202 with a job id; poll `/v1/sync/jobs/{id}` for status.
380
+ # @param [Hash] opts the optional parameters
381
+ # @return [nil]
382
+ def sync_booking(opts = {})
383
+ sync_booking_with_http_info(opts)
384
+ nil
385
+ end
386
+
387
+ # Bulk sync to Booking.com
388
+ # Trigger a full bulk sync of properties + availability + rates to Booking.com. Runs async — returns 202 with a job id; poll &#x60;/v1/sync/jobs/{id}&#x60; for status.
389
+ # @param [Hash] opts the optional parameters
390
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
391
+ def sync_booking_with_http_info(opts = {})
392
+ if @api_client.config.debugging
393
+ @api_client.config.logger.debug 'Calling API: BookingComApi.sync_booking ...'
394
+ end
395
+ # resource path
396
+ local_var_path = '/v1/channels/booking/sync'
397
+
398
+ # query parameters
399
+ query_params = opts[:query_params] || {}
400
+
401
+ # header parameters
402
+ header_params = opts[:header_params] || {}
403
+
404
+ # form parameters
405
+ form_params = opts[:form_params] || {}
406
+
407
+ # http body (model)
408
+ post_body = opts[:debug_body]
409
+
410
+ # return_type
411
+ return_type = opts[:debug_return_type]
412
+
413
+ # auth_names
414
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
415
+
416
+ new_options = opts.merge(
417
+ :operation => :"BookingComApi.sync_booking",
418
+ :header_params => header_params,
419
+ :query_params => query_params,
420
+ :form_params => form_params,
421
+ :body => post_body,
422
+ :auth_names => auth_names,
423
+ :return_type => return_type
424
+ )
425
+
426
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
427
+ if @api_client.config.debugging
428
+ @api_client.config.logger.debug "API called: BookingComApi#sync_booking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
429
+ end
430
+ return data, status_code, headers
431
+ end
432
+
433
+ # Update Booking.com rates/availability
434
+ # Push availability + rate changes to Booking.com's OTA system. Accepts the standard OTA rate message — see Booking's OTA docs for the field shape. Errors from upstream surface as `booking_error`.
435
+ # @param [Hash] opts the optional parameters
436
+ # @return [nil]
437
+ def update_booking_availability(opts = {})
438
+ update_booking_availability_with_http_info(opts)
439
+ nil
440
+ end
441
+
442
+ # Update Booking.com rates/availability
443
+ # Push availability + rate changes to Booking.com&#39;s OTA system. Accepts the standard OTA rate message — see Booking&#39;s OTA docs for the field shape. Errors from upstream surface as &#x60;booking_error&#x60;.
444
+ # @param [Hash] opts the optional parameters
445
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
446
+ def update_booking_availability_with_http_info(opts = {})
447
+ if @api_client.config.debugging
448
+ @api_client.config.logger.debug 'Calling API: BookingComApi.update_booking_availability ...'
449
+ end
450
+ # resource path
451
+ local_var_path = '/v1/channels/booking/availability'
452
+
453
+ # query parameters
454
+ query_params = opts[:query_params] || {}
455
+
456
+ # header parameters
457
+ header_params = opts[:header_params] || {}
458
+
459
+ # form parameters
460
+ form_params = opts[:form_params] || {}
461
+
462
+ # http body (model)
463
+ post_body = opts[:debug_body]
464
+
465
+ # return_type
466
+ return_type = opts[:debug_return_type]
467
+
468
+ # auth_names
469
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
470
+
471
+ new_options = opts.merge(
472
+ :operation => :"BookingComApi.update_booking_availability",
473
+ :header_params => header_params,
474
+ :query_params => query_params,
475
+ :form_params => form_params,
476
+ :body => post_body,
477
+ :auth_names => auth_names,
478
+ :return_type => return_type
479
+ )
480
+
481
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
482
+ if @api_client.config.debugging
483
+ @api_client.config.logger.debug "API called: BookingComApi#update_booking_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
484
+ end
485
+ return data, status_code, headers
486
+ end
487
+
488
+ # Update Booking.com content
489
+ # Push content changes (descriptions, amenities, photos) to Booking.com. Booking enforces editorial review on text fields — changes appear after their content moderation queue clears.
490
+ # @param [Hash] opts the optional parameters
491
+ # @return [nil]
492
+ def update_booking_content(opts = {})
493
+ update_booking_content_with_http_info(opts)
494
+ nil
495
+ end
496
+
497
+ # Update Booking.com content
498
+ # Push content changes (descriptions, amenities, photos) to Booking.com. Booking enforces editorial review on text fields — changes appear after their content moderation queue clears.
499
+ # @param [Hash] opts the optional parameters
500
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
501
+ def update_booking_content_with_http_info(opts = {})
502
+ if @api_client.config.debugging
503
+ @api_client.config.logger.debug 'Calling API: BookingComApi.update_booking_content ...'
504
+ end
505
+ # resource path
506
+ local_var_path = '/v1/channels/booking/content'
507
+
508
+ # query parameters
509
+ query_params = opts[:query_params] || {}
510
+
511
+ # header parameters
512
+ header_params = opts[:header_params] || {}
513
+
514
+ # form parameters
515
+ form_params = opts[:form_params] || {}
516
+
517
+ # http body (model)
518
+ post_body = opts[:debug_body]
519
+
520
+ # return_type
521
+ return_type = opts[:debug_return_type]
522
+
523
+ # auth_names
524
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
525
+
526
+ new_options = opts.merge(
527
+ :operation => :"BookingComApi.update_booking_content",
528
+ :header_params => header_params,
529
+ :query_params => query_params,
530
+ :form_params => form_params,
531
+ :body => post_body,
532
+ :auth_names => auth_names,
533
+ :return_type => return_type
534
+ )
535
+
536
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
537
+ if @api_client.config.debugging
538
+ @api_client.config.logger.debug "API called: BookingComApi#update_booking_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
539
+ end
540
+ return data, status_code, headers
541
+ end
542
+
543
+ # Update Booking.com pricing for a listing
544
+ # Pushes one or more rate updates to Booking.com via `updateRates`. Each update needs `roomId` + `rateId` + `dateRange` + `price` + `currency`. Field-level validation runs up front so callers don't have to parse Booking's XML error envelope to discover a missing `roomId`.
545
+ # @param id [Integer]
546
+ # @param booking_pricing_update_request [BookingPricingUpdateRequest]
547
+ # @param [Hash] opts the optional parameters
548
+ # @return [BookingPricingUpdateResponse]
549
+ def update_booking_listing_pricing(id, booking_pricing_update_request, opts = {})
550
+ data, _status_code, _headers = update_booking_listing_pricing_with_http_info(id, booking_pricing_update_request, opts)
551
+ data
552
+ end
553
+
554
+ # Update Booking.com pricing for a listing
555
+ # Pushes one or more rate updates to Booking.com via &#x60;updateRates&#x60;. Each update needs &#x60;roomId&#x60; + &#x60;rateId&#x60; + &#x60;dateRange&#x60; + &#x60;price&#x60; + &#x60;currency&#x60;. Field-level validation runs up front so callers don&#39;t have to parse Booking&#39;s XML error envelope to discover a missing &#x60;roomId&#x60;.
556
+ # @param id [Integer]
557
+ # @param booking_pricing_update_request [BookingPricingUpdateRequest]
558
+ # @param [Hash] opts the optional parameters
559
+ # @return [Array<(BookingPricingUpdateResponse, Integer, Hash)>] BookingPricingUpdateResponse data, response status code and response headers
560
+ def update_booking_listing_pricing_with_http_info(id, booking_pricing_update_request, opts = {})
561
+ if @api_client.config.debugging
562
+ @api_client.config.logger.debug 'Calling API: BookingComApi.update_booking_listing_pricing ...'
563
+ end
564
+ # verify the required parameter 'id' is set
565
+ if @api_client.config.client_side_validation && id.nil?
566
+ fail ArgumentError, "Missing the required parameter 'id' when calling BookingComApi.update_booking_listing_pricing"
567
+ end
568
+ # verify the required parameter 'booking_pricing_update_request' is set
569
+ if @api_client.config.client_side_validation && booking_pricing_update_request.nil?
570
+ fail ArgumentError, "Missing the required parameter 'booking_pricing_update_request' when calling BookingComApi.update_booking_listing_pricing"
571
+ end
572
+ # resource path
573
+ local_var_path = '/v1/channels/booking/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s))
574
+
575
+ # query parameters
576
+ query_params = opts[:query_params] || {}
577
+
578
+ # header parameters
579
+ header_params = opts[:header_params] || {}
580
+ # HTTP header 'Accept' (if needed)
581
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
582
+ # HTTP header 'Content-Type'
583
+ content_type = @api_client.select_header_content_type(['application/json'])
584
+ if !content_type.nil?
585
+ header_params['Content-Type'] = content_type
586
+ end
587
+
588
+ # form parameters
589
+ form_params = opts[:form_params] || {}
590
+
591
+ # http body (model)
592
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(booking_pricing_update_request)
593
+
594
+ # return_type
595
+ return_type = opts[:debug_return_type] || 'BookingPricingUpdateResponse'
596
+
597
+ # auth_names
598
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
599
+
600
+ new_options = opts.merge(
601
+ :operation => :"BookingComApi.update_booking_listing_pricing",
602
+ :header_params => header_params,
603
+ :query_params => query_params,
604
+ :form_params => form_params,
605
+ :body => post_body,
606
+ :auth_names => auth_names,
607
+ :return_type => return_type
608
+ )
609
+
610
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
611
+ if @api_client.config.debugging
612
+ @api_client.config.logger.debug "API called: BookingComApi#update_booking_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
613
+ end
614
+ return data, status_code, headers
615
+ end
616
+ end
617
+ end