repull 0.2.14 → 0.2.15

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 (110) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +1265 -125
  3. data/lib/repull/api/availability_api.rb +2 -2
  4. data/lib/repull/api/connect_api.rb +4 -4
  5. data/lib/repull/api/listings_api.rb +97 -13
  6. data/lib/repull/models/airbnb_account_freshness.rb +239 -0
  7. data/lib/repull/models/airbnb_alteration.rb +46 -2
  8. data/lib/repull/models/airbnb_alteration_create_request.rb +264 -0
  9. data/lib/repull/models/airbnb_connection.rb +69 -2
  10. data/lib/repull/models/airbnb_connection_host.rb +1 -1
  11. data/lib/repull/models/airbnb_content_write_response.rb +275 -0
  12. data/lib/repull/models/airbnb_data_freshness.rb +22 -10
  13. data/lib/repull/models/{create_airbnb_alteration_request.rb → airbnb_description_write_request.rb} +44 -47
  14. data/lib/repull/models/airbnb_description_write_request_description.rb +365 -0
  15. data/lib/repull/models/airbnb_listing.rb +12 -1
  16. data/lib/repull/models/airbnb_listing_action200_response.rb +105 -0
  17. data/lib/repull/models/airbnb_listing_action200_response_one_of.rb +157 -0
  18. data/lib/repull/models/airbnb_listing_action200_response_one_of1.rb +175 -0
  19. data/lib/repull/models/airbnb_listing_action_request.rb +2 -2
  20. data/lib/repull/models/airbnb_listing_details_response.rb +284 -0
  21. data/lib/repull/models/airbnb_listing_details_write_request.rb +209 -0
  22. data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +214 -0
  23. data/lib/repull/models/airbnb_listing_details_write_request_quiet_hours_inner.rb +190 -0
  24. data/lib/repull/models/airbnb_listing_lifecycle_response.rb +196 -0
  25. data/lib/repull/models/airbnb_permits_response.rb +163 -0
  26. data/lib/repull/models/airbnb_permits_response_cached_inner.rb +200 -0
  27. data/lib/repull/models/airbnb_permits_write_request.rb +176 -0
  28. data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +228 -0
  29. data/lib/repull/models/airbnb_permits_write_request_permits_inner_answers_inner.rb +198 -0
  30. data/lib/repull/models/airbnb_photo_position.rb +159 -0
  31. data/lib/repull/models/airbnb_publish_result.rb +263 -0
  32. data/lib/repull/models/airbnb_reservation.rb +23 -1
  33. data/lib/repull/models/airbnb_reservation_list_response.rb +13 -4
  34. data/lib/repull/models/airbnb_review.rb +23 -1
  35. data/lib/repull/models/airbnb_review_list_response.rb +13 -4
  36. data/lib/repull/models/airbnb_safety_disclosure.rb +202 -0
  37. data/lib/repull/models/airbnb_safety_disclosures_response.rb +162 -0
  38. data/lib/repull/models/airbnb_safety_disclosures_write_request.rb +176 -0
  39. data/lib/repull/models/airbnb_thread.rb +23 -1
  40. data/lib/repull/models/airbnb_thread_list_response.rb +13 -4
  41. data/lib/repull/models/airbnb_transaction.rb +23 -1
  42. data/lib/repull/models/create_airbnb_listing_room_request.rb +315 -0
  43. data/lib/repull/models/delete_airbnb_listing_photo200_response.rb +14 -4
  44. data/lib/repull/models/delete_airbnb_listing_room200_response.rb +157 -0
  45. data/lib/repull/models/error_error.rb +31 -1
  46. data/lib/repull/models/get_airbnb_booking_settings200_response.rb +190 -0
  47. data/lib/repull/models/get_airbnb_booking_settings200_response_data.rb +246 -0
  48. data/lib/repull/models/get_airbnb_booking_settings200_response_data_advance_notice.rb +172 -0
  49. data/lib/repull/models/get_airbnb_booking_settings200_response_data_booking_window.rb +160 -0
  50. data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation.rb +203 -0
  51. data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation_non_refundable.rb +218 -0
  52. data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in.rb +159 -0
  53. data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in_start.rb +104 -0
  54. data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_out.rb +172 -0
  55. data/lib/repull/models/get_airbnb_booking_settings200_response_data_instant_book.rb +206 -0
  56. data/lib/repull/models/get_airbnb_booking_settings200_response_data_preparation_time.rb +173 -0
  57. data/lib/repull/models/get_airbnb_listing_details200_response.rb +192 -0
  58. data/lib/repull/models/list_airbnb_listing_permits200_response.rb +190 -0
  59. data/lib/repull/models/list_airbnb_listing_safety_disclosures200_response.rb +190 -0
  60. data/lib/repull/models/listing.rb +2 -1
  61. data/lib/repull/models/listing_content.rb +13 -2
  62. data/lib/repull/models/listing_content_update_request.rb +21 -2
  63. data/lib/repull/models/listing_content_update_request_details.rb +206 -0
  64. data/lib/repull/models/listing_content_update_request_policies.rb +95 -5
  65. data/lib/repull/models/listing_content_update_response.rb +1 -1
  66. data/lib/repull/models/listing_publish_airbnb_response.rb +165 -0
  67. data/lib/repull/models/listing_pull_airbnb_request.rb +149 -0
  68. data/lib/repull/models/listing_pull_response.rb +231 -0
  69. data/lib/repull/models/publish_section_error.rb +232 -0
  70. data/lib/repull/models/reorder_airbnb_listing_photos200_response.rb +191 -0
  71. data/lib/repull/models/reorder_airbnb_listing_photos200_response_data.rb +172 -0
  72. data/lib/repull/models/reorder_airbnb_listing_photos_request.rb +185 -0
  73. data/lib/repull/models/reservation.rb +23 -1
  74. data/lib/repull/models/reservation_webhook_object.rb +38 -5
  75. data/lib/repull/models/set_airbnb_listing_cover_photo200_response.rb +191 -0
  76. data/lib/repull/models/set_airbnb_listing_cover_photo200_response_data.rb +171 -0
  77. data/lib/repull/models/set_airbnb_listing_cover_photo_request.rb +165 -0
  78. data/lib/repull/models/update_airbnb_booking_settings200_response.rb +164 -0
  79. data/lib/repull/models/update_airbnb_booking_settings200_response_data.rb +205 -0
  80. data/lib/repull/models/update_airbnb_booking_settings_request.rb +202 -0
  81. data/lib/repull/models/update_airbnb_booking_settings_request_advance_notice.rb +183 -0
  82. data/lib/repull/models/update_airbnb_booking_settings_request_booking_window.rb +183 -0
  83. data/lib/repull/models/update_airbnb_booking_settings_request_cancellation.rb +201 -0
  84. data/lib/repull/models/update_airbnb_booking_settings_request_cancellation_non_refundable.rb +183 -0
  85. data/lib/repull/models/update_airbnb_booking_settings_request_check_in.rb +159 -0
  86. data/lib/repull/models/update_airbnb_booking_settings_request_check_out.rb +182 -0
  87. data/lib/repull/models/update_airbnb_booking_settings_request_instant_book.rb +203 -0
  88. data/lib/repull/models/update_airbnb_booking_settings_request_preparation_time.rb +182 -0
  89. data/lib/repull/models/update_airbnb_listing_amenities200_response.rb +191 -0
  90. data/lib/repull/models/update_airbnb_listing_amenities200_response_data.rb +158 -0
  91. data/lib/repull/models/update_airbnb_listing_amenities_request.rb +199 -0
  92. data/lib/repull/models/update_airbnb_listing_amenities_request_accessibility_amenities_inner.rb +246 -0
  93. data/lib/repull/models/update_airbnb_listing_amenities_request_amenities_inner.rb +218 -0
  94. data/lib/repull/models/update_airbnb_listing_permits200_response.rb +168 -0
  95. data/lib/repull/models/update_airbnb_listing_photo200_response.rb +194 -0
  96. data/lib/repull/models/update_airbnb_listing_photo_request.rb +242 -0
  97. data/lib/repull/models/update_airbnb_listing_room200_response.rb +194 -0
  98. data/lib/repull/models/update_airbnb_listing_room_request.rb +293 -0
  99. data/lib/repull/models/update_airbnb_listing_room_request_beds_inner.rb +209 -0
  100. data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner.rb +182 -0
  101. data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner_value.rb +105 -0
  102. data/lib/repull/models/update_airbnb_listing_safety_disclosures200_response.rb +180 -0
  103. data/lib/repull/models/upload_airbnb_listing_photos_request.rb +184 -0
  104. data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner.rb +305 -0
  105. data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner_listing_id.rb +105 -0
  106. data/lib/repull/version.rb +1 -1
  107. data/lib/repull.rb +78 -1
  108. data/openapi/v1.json +4523 -1282
  109. data/scripts/regen.sh +1 -1
  110. metadata +80 -3
@@ -89,23 +89,25 @@ module Repull
89
89
  return data, status_code, headers
90
90
  end
91
91
 
92
- # Listing action (delete/push/publish)
93
- # Apply a state action to a listing by id. The path `id` is the canonical Repull listing id. `delete` is a **deactivate of the Repull record only** — it sets the listing inactive and KEEPS the row; it does NOT touch the upstream Airbnb listing (Repull never deletes or deactivates on Airbnb's side). Use it to exclude a listing / trim back under the plan-listings cap; reactivate via `PATCH /v1/listings/{id}` with `{ \"active\": true }`. Idempotent. `push` / `publish` push the listing's content to Airbnb via the same host-side sync orchestrator as `POST /v1/listings/{id}/publish/airbnb` — pass `airbnbConnectionId` to update an already-mapped Airbnb listing, or `hostId` to create + publish a new one under that host. `force` re-pushes every field, ignoring dirty-field tracking. Any other action (e.g. `pull`, `unlist`) returns a structured 422 naming the supported actions. Returns `403 listing_inactive` for `push`/`publish` when the listing is inactive. `delete` (deactivation) is always accepted.
92
+ # Listing action (delete/push/publish/unlist/relist)
93
+ # Apply a state action to a listing by id. The path `id` is the canonical Repull listing id. **Deactivating in Repull and unlisting on Airbnb are different operations.** `delete` is a **deactivate of the Repull record only** — it sets the listing inactive and KEEPS the row; it does NOT touch the Airbnb listing, which stays live and keeps taking bookings. Use it to exclude a listing from the API / trim back under the plan-listings cap; reactivate via `PATCH /v1/listings/{id}` with `{ \"active\": true }`. Idempotent. `unlist` calls Airbnb and **takes the live listing down**: it is deactivated with a valid deactivation reason and then READ BACK, so \"Airbnb accepted the call but the listing is still live\" is reported as a failure rather than a success. Requires `airbnbConnectionId` — a listing can be connected to more than one Airbnb listing, and taking down the wrong one is not undoable through this API. `relist` puts it back up (re-enables sync and makes the listing available again); it does not push content. `push` / `publish` push the listing's content to Airbnb via the same host-side sync orchestrator as `POST /v1/listings/{id}/publish/airbnb` — pass `airbnbConnectionId` to update an already-mapped Airbnb listing, or `hostId` to create + publish a new one under that host. `force` re-pushes every field, ignoring dirty-field tracking. The result is per-section: see `AirbnbPublishResult`. Any other action (e.g. `pull`) returns a structured 422 naming the supported actions. Returns `403 listing_inactive` for `push`/`publish`/`unlist`/`relist` when the listing is inactive. `delete` (deactivation) is always accepted.
94
94
  # @param id [String]
95
95
  # @param [Hash] opts the optional parameters
96
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged `Idempotency-Status: cached` — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → `409 idempotency_key_in_use`. - Same key with a DIFFERENT payload → `422 idempotency_key_reused`. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status >= 500 are deliberately not stored, so a server error stays retryable.
96
97
  # @option opts [AirbnbListingActionRequest] :airbnb_listing_action_request
97
- # @return [nil]
98
+ # @return [AirbnbListingAction200Response]
98
99
  def airbnb_listing_action(id, opts = {})
99
- airbnb_listing_action_with_http_info(id, opts)
100
- nil
100
+ data, _status_code, _headers = airbnb_listing_action_with_http_info(id, opts)
101
+ data
101
102
  end
102
103
 
103
- # Listing action (delete/push/publish)
104
- # Apply a state action to a listing by id. The path `id` is the canonical Repull listing id. `delete` is a **deactivate of the Repull record only** — it sets the listing inactive and KEEPS the row; it does NOT touch the upstream Airbnb listing (Repull never deletes or deactivates on Airbnb's side). Use it to exclude a listing / trim back under the plan-listings cap; reactivate via `PATCH /v1/listings/{id}` with `{ \"active\": true }`. Idempotent. `push` / `publish` push the listing's content to Airbnb via the same host-side sync orchestrator as `POST /v1/listings/{id}/publish/airbnb` — pass `airbnbConnectionId` to update an already-mapped Airbnb listing, or `hostId` to create + publish a new one under that host. `force` re-pushes every field, ignoring dirty-field tracking. Any other action (e.g. `pull`, `unlist`) returns a structured 422 naming the supported actions. Returns `403 listing_inactive` for `push`/`publish` when the listing is inactive. `delete` (deactivation) is always accepted.
104
+ # Listing action (delete/push/publish/unlist/relist)
105
+ # Apply a state action to a listing by id. The path `id` is the canonical Repull listing id. **Deactivating in Repull and unlisting on Airbnb are different operations.** `delete` is a **deactivate of the Repull record only** — it sets the listing inactive and KEEPS the row; it does NOT touch the Airbnb listing, which stays live and keeps taking bookings. Use it to exclude a listing from the API / trim back under the plan-listings cap; reactivate via `PATCH /v1/listings/{id}` with `{ \"active\": true }`. Idempotent. `unlist` calls Airbnb and **takes the live listing down**: it is deactivated with a valid deactivation reason and then READ BACK, so \"Airbnb accepted the call but the listing is still live\" is reported as a failure rather than a success. Requires `airbnbConnectionId` — a listing can be connected to more than one Airbnb listing, and taking down the wrong one is not undoable through this API. `relist` puts it back up (re-enables sync and makes the listing available again); it does not push content. `push` / `publish` push the listing's content to Airbnb via the same host-side sync orchestrator as `POST /v1/listings/{id}/publish/airbnb` — pass `airbnbConnectionId` to update an already-mapped Airbnb listing, or `hostId` to create + publish a new one under that host. `force` re-pushes every field, ignoring dirty-field tracking. The result is per-section: see `AirbnbPublishResult`. Any other action (e.g. `pull`) returns a structured 422 naming the supported actions. Returns `403 listing_inactive` for `push`/`publish`/`unlist`/`relist` when the listing is inactive. `delete` (deactivation) is always accepted.
105
106
  # @param id [String]
106
107
  # @param [Hash] opts the optional parameters
108
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged `Idempotency-Status: cached` — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → `409 idempotency_key_in_use`. - Same key with a DIFFERENT payload → `422 idempotency_key_reused`. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status >= 500 are deliberately not stored, so a server error stays retryable.
107
109
  # @option opts [AirbnbListingActionRequest] :airbnb_listing_action_request
108
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
110
+ # @return [Array<(AirbnbListingAction200Response, Integer, Hash)>] AirbnbListingAction200Response data, response status code and response headers
109
111
  def airbnb_listing_action_with_http_info(id, opts = {})
110
112
  if @api_client.config.debugging
111
113
  @api_client.config.logger.debug 'Calling API: AirbnbApi.airbnb_listing_action ...'
@@ -114,6 +116,10 @@ module Repull
114
116
  if @api_client.config.client_side_validation && id.nil?
115
117
  fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.airbnb_listing_action"
116
118
  end
119
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
120
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AirbnbApi.airbnb_listing_action, the character length must be smaller than or equal to 255.'
121
+ end
122
+
117
123
  # resource path
118
124
  local_var_path = '/v1/channels/airbnb/listings/{id}'.sub('{id}', CGI.escape(id.to_s))
119
125
 
@@ -129,6 +135,7 @@ module Repull
129
135
  if !content_type.nil?
130
136
  header_params['Content-Type'] = content_type
131
137
  end
138
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
132
139
 
133
140
  # form parameters
134
141
  form_params = opts[:form_params] || {}
@@ -137,7 +144,7 @@ module Repull
137
144
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'airbnb_listing_action_request'])
138
145
 
139
146
  # return_type
140
- return_type = opts[:debug_return_type]
147
+ return_type = opts[:debug_return_type] || 'AirbnbListingAction200Response'
141
148
 
142
149
  # auth_names
143
150
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
@@ -222,28 +229,98 @@ module Repull
222
229
  return data, status_code, headers
223
230
  end
224
231
 
225
- # Create Airbnb alteration
226
- # Create a reservation alteration request (change dates, guest count, or price) on Airbnb. **Write-side** — calls Airbnb upstream. Requires a connected Airbnb host for the workspace, else `404 no_connection`. Returns `403 listing_inactive` when the listing this resolves to is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
227
- # @param create_airbnb_alteration_request [CreateAirbnbAlterationRequest]
232
+ # Cancel Airbnb alteration
233
+ # Withdraw an alteration you proposed, before the other side has answered it. **Write-side** — calls Airbnb upstream (`respondToAlteration` with status `canceled`). Use this when you sent the wrong dates, guest count, price or listing: the alteration stops being pending instead of sitting there until the guest acts on it. This is the third of Airbnb's three answers to a pending alteration, alongside `accept` and `decline`, and behaves identically to them: requires a connected Airbnb host for the workspace (else `404 no_connection`) and that the alteration id belongs to a reservation in your workspace (else `404 not_found`). No request body is required. Airbnb decides whether an alteration can still be withdrawn — one that has already been accepted or declined is refused upstream, and Airbnb's own reason comes back in `message`. Returns `403 listing_inactive` when the listing this resolves to is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
234
+ # @param id [String] Airbnb alteration id (the &#x60;alterationId&#x60; from a &#x60;GET /v1/channels/airbnb/alterations&#x60; row).
228
235
  # @param [Hash] opts the optional parameters
236
+ # @option opts [Object] :body
229
237
  # @return [nil]
230
- def create_airbnb_alteration(create_airbnb_alteration_request, opts = {})
231
- create_airbnb_alteration_with_http_info(create_airbnb_alteration_request, opts)
238
+ def cancel_airbnb_alteration(id, opts = {})
239
+ cancel_airbnb_alteration_with_http_info(id, opts)
232
240
  nil
233
241
  end
234
242
 
235
- # Create Airbnb alteration
236
- # Create a reservation alteration request (change dates, guest count, or price) on Airbnb. **Write-side** — calls Airbnb upstream. Requires a connected Airbnb host for the workspace, else &#x60;404 no_connection&#x60;. Returns &#x60;403 listing_inactive&#x60; when the listing this resolves to is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
237
- # @param create_airbnb_alteration_request [CreateAirbnbAlterationRequest]
243
+ # Cancel Airbnb alteration
244
+ # Withdraw an alteration you proposed, before the other side has answered it. **Write-side** — calls Airbnb upstream (&#x60;respondToAlteration&#x60; with status &#x60;canceled&#x60;). Use this when you sent the wrong dates, guest count, price or listing: the alteration stops being pending instead of sitting there until the guest acts on it. This is the third of Airbnb&#39;s three answers to a pending alteration, alongside &#x60;accept&#x60; and &#x60;decline&#x60;, and behaves identically to them: requires a connected Airbnb host for the workspace (else &#x60;404 no_connection&#x60;) and that the alteration id belongs to a reservation in your workspace (else &#x60;404 not_found&#x60;). No request body is required. Airbnb decides whether an alteration can still be withdrawn — one that has already been accepted or declined is refused upstream, and Airbnb&#39;s own reason comes back in &#x60;message&#x60;. Returns &#x60;403 listing_inactive&#x60; when the listing this resolves to is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
245
+ # @param id [String] Airbnb alteration id (the &#x60;alterationId&#x60; from a &#x60;GET /v1/channels/airbnb/alterations&#x60; row).
238
246
  # @param [Hash] opts the optional parameters
247
+ # @option opts [Object] :body
239
248
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
240
- def create_airbnb_alteration_with_http_info(create_airbnb_alteration_request, opts = {})
249
+ def cancel_airbnb_alteration_with_http_info(id, opts = {})
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.cancel_airbnb_alteration ...'
252
+ end
253
+ # verify the required parameter 'id' is set
254
+ if @api_client.config.client_side_validation && id.nil?
255
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.cancel_airbnb_alteration"
256
+ end
257
+ # resource path
258
+ local_var_path = '/v1/channels/airbnb/alterations/{id}/cancel'.sub('{id}', CGI.escape(id.to_s))
259
+
260
+ # query parameters
261
+ query_params = opts[:query_params] || {}
262
+
263
+ # header parameters
264
+ header_params = opts[:header_params] || {}
265
+ # HTTP header 'Accept' (if needed)
266
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
267
+ # HTTP header 'Content-Type'
268
+ content_type = @api_client.select_header_content_type(['application/json'])
269
+ if !content_type.nil?
270
+ header_params['Content-Type'] = content_type
271
+ end
272
+
273
+ # form parameters
274
+ form_params = opts[:form_params] || {}
275
+
276
+ # http body (model)
277
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
278
+
279
+ # return_type
280
+ return_type = opts[:debug_return_type]
281
+
282
+ # auth_names
283
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
284
+
285
+ new_options = opts.merge(
286
+ :operation => :"AirbnbApi.cancel_airbnb_alteration",
287
+ :header_params => header_params,
288
+ :query_params => query_params,
289
+ :form_params => form_params,
290
+ :body => post_body,
291
+ :auth_names => auth_names,
292
+ :return_type => return_type
293
+ )
294
+
295
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug "API called: AirbnbApi#cancel_airbnb_alteration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
298
+ end
299
+ return data, status_code, headers
300
+ end
301
+
302
+ # Create Airbnb alteration
303
+ # Propose a change to an existing Airbnb reservation: new dates, a new guest count, a new total price, or a move to a different listing. **Write-side** — calls Airbnb upstream. Requires a connected Airbnb host for the workspace, else `404 no_connection`. The body is validated before anything reaches Airbnb. `confirmation_code` is required and **at least one** of `check_in`, `check_out`, `number_of_guests`, `total_price` or `listing_id` must be sent with it — an alteration that changes nothing is `422 invalid_params`, not a request Airbnb is asked to act on. Unknown fields are refused rather than ignored, so a misspelling can never look like a successful write. **Listing transfer.** `listing_id` moves the reservation to another listing in your workspace. Send the **Repull** listing id (the `id` from `GET /v1/properties`); Repull checks you own it, that it is active and connected to Airbnb, translates it to the Airbnb listing id and sends it upstream. Callers who hold the Airbnb-side id instead may send `airbnb_listing_id`. **Airbnb decides** whether to honour a listing change on an alteration — Repull sends it and reports Airbnb’s answer; a refusal comes back as `422 airbnb_rejected` carrying Airbnb’s own message. Returns `403 listing_inactive` when the reservation’s listing, or the listing it is being moved to, is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
304
+ # @param airbnb_alteration_create_request [AirbnbAlterationCreateRequest]
305
+ # @param [Hash] opts the optional parameters
306
+ # @return [AirbnbAlteration]
307
+ def create_airbnb_alteration(airbnb_alteration_create_request, opts = {})
308
+ data, _status_code, _headers = create_airbnb_alteration_with_http_info(airbnb_alteration_create_request, opts)
309
+ data
310
+ end
311
+
312
+ # Create Airbnb alteration
313
+ # Propose a change to an existing Airbnb reservation: new dates, a new guest count, a new total price, or a move to a different listing. **Write-side** — calls Airbnb upstream. Requires a connected Airbnb host for the workspace, else &#x60;404 no_connection&#x60;. The body is validated before anything reaches Airbnb. &#x60;confirmation_code&#x60; is required and **at least one** of &#x60;check_in&#x60;, &#x60;check_out&#x60;, &#x60;number_of_guests&#x60;, &#x60;total_price&#x60; or &#x60;listing_id&#x60; must be sent with it — an alteration that changes nothing is &#x60;422 invalid_params&#x60;, not a request Airbnb is asked to act on. Unknown fields are refused rather than ignored, so a misspelling can never look like a successful write. **Listing transfer.** &#x60;listing_id&#x60; moves the reservation to another listing in your workspace. Send the **Repull** listing id (the &#x60;id&#x60; from &#x60;GET /v1/properties&#x60;); Repull checks you own it, that it is active and connected to Airbnb, translates it to the Airbnb listing id and sends it upstream. Callers who hold the Airbnb-side id instead may send &#x60;airbnb_listing_id&#x60;. **Airbnb decides** whether to honour a listing change on an alteration — Repull sends it and reports Airbnb’s answer; a refusal comes back as &#x60;422 airbnb_rejected&#x60; carrying Airbnb’s own message. Returns &#x60;403 listing_inactive&#x60; when the reservation’s listing, or the listing it is being moved to, is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
314
+ # @param airbnb_alteration_create_request [AirbnbAlterationCreateRequest]
315
+ # @param [Hash] opts the optional parameters
316
+ # @return [Array<(AirbnbAlteration, Integer, Hash)>] AirbnbAlteration data, response status code and response headers
317
+ def create_airbnb_alteration_with_http_info(airbnb_alteration_create_request, opts = {})
241
318
  if @api_client.config.debugging
242
319
  @api_client.config.logger.debug 'Calling API: AirbnbApi.create_airbnb_alteration ...'
243
320
  end
244
- # verify the required parameter 'create_airbnb_alteration_request' is set
245
- if @api_client.config.client_side_validation && create_airbnb_alteration_request.nil?
246
- fail ArgumentError, "Missing the required parameter 'create_airbnb_alteration_request' when calling AirbnbApi.create_airbnb_alteration"
321
+ # verify the required parameter 'airbnb_alteration_create_request' is set
322
+ if @api_client.config.client_side_validation && airbnb_alteration_create_request.nil?
323
+ fail ArgumentError, "Missing the required parameter 'airbnb_alteration_create_request' when calling AirbnbApi.create_airbnb_alteration"
247
324
  end
248
325
  # resource path
249
326
  local_var_path = '/v1/channels/airbnb/alterations'
@@ -265,10 +342,10 @@ module Repull
265
342
  form_params = opts[:form_params] || {}
266
343
 
267
344
  # http body (model)
268
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_airbnb_alteration_request)
345
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(airbnb_alteration_create_request)
269
346
 
270
347
  # return_type
271
- return_type = opts[:debug_return_type]
348
+ return_type = opts[:debug_return_type] || 'AirbnbAlteration'
272
349
 
273
350
  # auth_names
274
351
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
@@ -291,23 +368,23 @@ module Repull
291
368
  end
292
369
 
293
370
  # Create an Airbnb room
294
- # Create a new room on an Airbnb listing. **Write-side** — calls Airbnb upstream. Body is the full room object minus `room_id`. Requires a connected Airbnb host, else `404 no_connection`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
371
+ # Create a new room on an Airbnb listing, with its sleeping arrangement. **Write-side** — calls Airbnb upstream. Requires a connected Airbnb host, else `404 no_connection`. The response is the room object as Airbnb returned it. The new room is also seeded into our own copy, so the very next `GET /rooms` shows it rather than waiting for the sync. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
295
372
  # @param id [String] Repull listing id (numeric string).
296
- # @param request_body [Hash<String, Object>]
373
+ # @param create_airbnb_listing_room_request [CreateAirbnbListingRoomRequest]
297
374
  # @param [Hash] opts the optional parameters
298
375
  # @return [nil]
299
- def create_airbnb_listing_room(id, request_body, opts = {})
300
- create_airbnb_listing_room_with_http_info(id, request_body, opts)
376
+ def create_airbnb_listing_room(id, create_airbnb_listing_room_request, opts = {})
377
+ create_airbnb_listing_room_with_http_info(id, create_airbnb_listing_room_request, opts)
301
378
  nil
302
379
  end
303
380
 
304
381
  # Create an Airbnb room
305
- # Create a new room on an Airbnb listing. **Write-side** — calls Airbnb upstream. Body is the full room object minus &#x60;room_id&#x60;. Requires a connected Airbnb host, else &#x60;404 no_connection&#x60;. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
382
+ # Create a new room on an Airbnb listing, with its sleeping arrangement. **Write-side** — calls Airbnb upstream. Requires a connected Airbnb host, else &#x60;404 no_connection&#x60;. The response is the room object as Airbnb returned it. The new room is also seeded into our own copy, so the very next &#x60;GET /rooms&#x60; shows it rather than waiting for the sync. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
306
383
  # @param id [String] Repull listing id (numeric string).
307
- # @param request_body [Hash<String, Object>]
384
+ # @param create_airbnb_listing_room_request [CreateAirbnbListingRoomRequest]
308
385
  # @param [Hash] opts the optional parameters
309
386
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
310
- def create_airbnb_listing_room_with_http_info(id, request_body, opts = {})
387
+ def create_airbnb_listing_room_with_http_info(id, create_airbnb_listing_room_request, opts = {})
311
388
  if @api_client.config.debugging
312
389
  @api_client.config.logger.debug 'Calling API: AirbnbApi.create_airbnb_listing_room ...'
313
390
  end
@@ -315,9 +392,9 @@ module Repull
315
392
  if @api_client.config.client_side_validation && id.nil?
316
393
  fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.create_airbnb_listing_room"
317
394
  end
318
- # verify the required parameter 'request_body' is set
319
- if @api_client.config.client_side_validation && request_body.nil?
320
- fail ArgumentError, "Missing the required parameter 'request_body' when calling AirbnbApi.create_airbnb_listing_room"
395
+ # verify the required parameter 'create_airbnb_listing_room_request' is set
396
+ if @api_client.config.client_side_validation && create_airbnb_listing_room_request.nil?
397
+ fail ArgumentError, "Missing the required parameter 'create_airbnb_listing_room_request' when calling AirbnbApi.create_airbnb_listing_room"
321
398
  end
322
399
  # resource path
323
400
  local_var_path = '/v1/channels/airbnb/listings/{id}/rooms'.sub('{id}', CGI.escape(id.to_s))
@@ -339,7 +416,7 @@ module Repull
339
416
  form_params = opts[:form_params] || {}
340
417
 
341
418
  # http body (model)
342
- post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
419
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_airbnb_listing_room_request)
343
420
 
344
421
  # return_type
345
422
  return_type = opts[:debug_return_type]
@@ -503,7 +580,7 @@ module Repull
503
580
  end
504
581
 
505
582
  # Delete an Airbnb photo
506
- # Remove a single photo from an Airbnb listing. Pass the Airbnb-side photo id as `?photoId=`. Write-side — calls Airbnb upstream; the local photo cache is reconciled by the sync worker afterwards. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
583
+ # Remove a single photo from an Airbnb listing. Pass the Airbnb-side photo id as `?photoId=`. **Write-side** — calls Airbnb upstream. The photo is proven to belong to the listing named in the path first; a photo from another listing returns `404`. Airbnb refuses to delete a listing's last photo. Both stored copies drop the photo on success — `stored` reports whether that succeeded. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
507
584
  # @param id [String]
508
585
  # @param photo_id [String] Airbnb-side photo id to delete.
509
586
  # @param [Hash] opts the optional parameters
@@ -514,7 +591,7 @@ module Repull
514
591
  end
515
592
 
516
593
  # Delete an Airbnb photo
517
- # Remove a single photo from an Airbnb listing. Pass the Airbnb-side photo id as &#x60;?photoId&#x3D;&#x60;. Write-side — calls Airbnb upstream; the local photo cache is reconciled by the sync worker afterwards. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
594
+ # Remove a single photo from an Airbnb listing. Pass the Airbnb-side photo id as &#x60;?photoId&#x3D;&#x60;. **Write-side** — calls Airbnb upstream. The photo is proven to belong to the listing named in the path first; a photo from another listing returns &#x60;404&#x60;. Airbnb refuses to delete a listing&#39;s last photo. Both stored copies drop the photo on success — &#x60;stored&#x60; reports whether that succeeded. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
518
595
  # @param id [String]
519
596
  # @param photo_id [String] Airbnb-side photo id to delete.
520
597
  # @param [Hash] opts the optional parameters
@@ -573,22 +650,22 @@ module Repull
573
650
  end
574
651
 
575
652
  # Delete an Airbnb room
576
- # Delete a room from an Airbnb listing. **Write-side** — calls Airbnb upstream. Pass the Airbnb-side room id as `?roomId=`. Requires a connected Airbnb host, else `404 no_connection`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
653
+ # Delete a room from an Airbnb listing, and its beds with it. **Write-side** — calls Airbnb upstream. Pass the Airbnb-side room id as `?roomId=`. Requires a connected Airbnb host, else `404 no_connection`. The room is proven to belong to the listing named in the path first; a room from another listing returns `404`. Both stored copies drop the room on success — `stored` reports whether that succeeded. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
577
654
  # @param id [String] Repull listing id (numeric string).
578
655
  # @param room_id [String] Airbnb-side room id to delete.
579
656
  # @param [Hash] opts the optional parameters
580
- # @return [DeleteAirbnbListingPhoto200Response]
657
+ # @return [DeleteAirbnbListingRoom200Response]
581
658
  def delete_airbnb_listing_room(id, room_id, opts = {})
582
659
  data, _status_code, _headers = delete_airbnb_listing_room_with_http_info(id, room_id, opts)
583
660
  data
584
661
  end
585
662
 
586
663
  # Delete an Airbnb room
587
- # Delete a room from an Airbnb listing. **Write-side** — calls Airbnb upstream. Pass the Airbnb-side room id as &#x60;?roomId&#x3D;&#x60;. Requires a connected Airbnb host, else &#x60;404 no_connection&#x60;. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
664
+ # Delete a room from an Airbnb listing, and its beds with it. **Write-side** — calls Airbnb upstream. Pass the Airbnb-side room id as &#x60;?roomId&#x3D;&#x60;. Requires a connected Airbnb host, else &#x60;404 no_connection&#x60;. The room is proven to belong to the listing named in the path first; a room from another listing returns &#x60;404&#x60;. Both stored copies drop the room on success — &#x60;stored&#x60; reports whether that succeeded. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
588
665
  # @param id [String] Repull listing id (numeric string).
589
666
  # @param room_id [String] Airbnb-side room id to delete.
590
667
  # @param [Hash] opts the optional parameters
591
- # @return [Array<(DeleteAirbnbListingPhoto200Response, Integer, Hash)>] DeleteAirbnbListingPhoto200Response data, response status code and response headers
668
+ # @return [Array<(DeleteAirbnbListingRoom200Response, Integer, Hash)>] DeleteAirbnbListingRoom200Response data, response status code and response headers
592
669
  def delete_airbnb_listing_room_with_http_info(id, room_id, opts = {})
593
670
  if @api_client.config.debugging
594
671
  @api_client.config.logger.debug 'Calling API: AirbnbApi.delete_airbnb_listing_room ...'
@@ -620,7 +697,7 @@ module Repull
620
697
  post_body = opts[:debug_body]
621
698
 
622
699
  # return_type
623
- return_type = opts[:debug_return_type] || 'DeleteAirbnbListingPhoto200Response'
700
+ return_type = opts[:debug_return_type] || 'DeleteAirbnbListingRoom200Response'
624
701
 
625
702
  # auth_names
626
703
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
@@ -779,6 +856,69 @@ module Repull
779
856
  return data, status_code, headers
780
857
  end
781
858
 
859
+ # Get Airbnb booking settings
860
+ # Read how an Airbnb listing takes bookings and what happens when a guest cancels: booking mode, Instant Book state, the good-track-record requirement, check-in/check-out times, advance notice, preparation time, booking window, the short-stay and long-stay cancellation policies, and the non-refundable option. **This is Repull's stored copy, not a live call to Airbnb.** Values come from the local Airbnb mirror that the sync workers fill, so the response always carries `dataFreshness` — check `dataFreshness.stale` (and `dataFreshness.accounts[]` when the workspace has several Airbnb accounts) before treating a value as current. **Not exposed by Airbnb.** The pre-reservation message and automatic stay extension have no field on Airbnb's `booking_settings` resource, so neither can be read or written here; set the pre-reservation message in the Airbnb host dashboard, and handle extensions through `/v1/channels/airbnb/alterations`. Airbnb also expresses the same-day cutoff only as whole hours of advance notice, so `advanceNotice.hours` is as precise as the cutoff gets. Returns `404` when the listing has no Airbnb connection in this workspace, and `403 listing_inactive` when the listing is inactive — an inactive listing keeps syncing but cannot be read or changed through the API until it is activated.
861
+ # @param id [String] Repull listing id (numeric string), not the Airbnb listing id.
862
+ # @param [Hash] opts the optional parameters
863
+ # @return [GetAirbnbBookingSettings200Response]
864
+ def get_airbnb_booking_settings(id, opts = {})
865
+ data, _status_code, _headers = get_airbnb_booking_settings_with_http_info(id, opts)
866
+ data
867
+ end
868
+
869
+ # Get Airbnb booking settings
870
+ # Read how an Airbnb listing takes bookings and what happens when a guest cancels: booking mode, Instant Book state, the good-track-record requirement, check-in/check-out times, advance notice, preparation time, booking window, the short-stay and long-stay cancellation policies, and the non-refundable option. **This is Repull&#39;s stored copy, not a live call to Airbnb.** Values come from the local Airbnb mirror that the sync workers fill, so the response always carries &#x60;dataFreshness&#x60; — check &#x60;dataFreshness.stale&#x60; (and &#x60;dataFreshness.accounts[]&#x60; when the workspace has several Airbnb accounts) before treating a value as current. **Not exposed by Airbnb.** The pre-reservation message and automatic stay extension have no field on Airbnb&#39;s &#x60;booking_settings&#x60; resource, so neither can be read or written here; set the pre-reservation message in the Airbnb host dashboard, and handle extensions through &#x60;/v1/channels/airbnb/alterations&#x60;. Airbnb also expresses the same-day cutoff only as whole hours of advance notice, so &#x60;advanceNotice.hours&#x60; is as precise as the cutoff gets. Returns &#x60;404&#x60; when the listing has no Airbnb connection in this workspace, and &#x60;403 listing_inactive&#x60; when the listing is inactive — an inactive listing keeps syncing but cannot be read or changed through the API until it is activated.
871
+ # @param id [String] Repull listing id (numeric string), not the Airbnb listing id.
872
+ # @param [Hash] opts the optional parameters
873
+ # @return [Array<(GetAirbnbBookingSettings200Response, Integer, Hash)>] GetAirbnbBookingSettings200Response data, response status code and response headers
874
+ def get_airbnb_booking_settings_with_http_info(id, opts = {})
875
+ if @api_client.config.debugging
876
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.get_airbnb_booking_settings ...'
877
+ end
878
+ # verify the required parameter 'id' is set
879
+ if @api_client.config.client_side_validation && id.nil?
880
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.get_airbnb_booking_settings"
881
+ end
882
+ # resource path
883
+ local_var_path = '/v1/channels/airbnb/listings/{id}/booking-settings'.sub('{id}', CGI.escape(id.to_s))
884
+
885
+ # query parameters
886
+ query_params = opts[:query_params] || {}
887
+
888
+ # header parameters
889
+ header_params = opts[:header_params] || {}
890
+ # HTTP header 'Accept' (if needed)
891
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
892
+
893
+ # form parameters
894
+ form_params = opts[:form_params] || {}
895
+
896
+ # http body (model)
897
+ post_body = opts[:debug_body]
898
+
899
+ # return_type
900
+ return_type = opts[:debug_return_type] || 'GetAirbnbBookingSettings200Response'
901
+
902
+ # auth_names
903
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
904
+
905
+ new_options = opts.merge(
906
+ :operation => :"AirbnbApi.get_airbnb_booking_settings",
907
+ :header_params => header_params,
908
+ :query_params => query_params,
909
+ :form_params => form_params,
910
+ :body => post_body,
911
+ :auth_names => auth_names,
912
+ :return_type => return_type
913
+ )
914
+
915
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
916
+ if @api_client.config.debugging
917
+ @api_client.config.logger.debug "API called: AirbnbApi#get_airbnb_booking_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
918
+ end
919
+ return data, status_code, headers
920
+ end
921
+
782
922
  # Get Airbnb check-in guide
783
923
  # Return every published locale variant of an Airbnb listing's check-in guide. **Pure DB read** from `listings_airbnb_check_in_guides`. Pass `?locale=en` to filter to one locale (prefix match). Returns `404` when the listing has no Airbnb connection in this workspace. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
784
924
  # @param id [String] Repull listing id (numeric string).
@@ -966,7 +1106,7 @@ module Repull
966
1106
  end
967
1107
 
968
1108
  # Get Airbnb listing
969
- # Fetch all Airbnb connection rows for a single Vanio listing id. A property may be linked from multiple Airbnb hosts — every match is returned. Pass `?include=amenities` to enrich each row with its current Airbnb amenities. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1109
+ # Fetch all Airbnb connection rows for a single Vanio listing id. A property may be linked from multiple Airbnb hosts — every match is returned. Pass `?include=amenities` to enrich each row with its current Airbnb amenities. Each row carries `syncCategory` — Airbnb's own per-listing API sync decision (`sync_all`, `sync_rates_and_availability`, or `none`) — and `writable`, which is `false` exactly when that category is `none`, meaning Airbnb refuses every write to the listing and Repull returns `403 listing_not_api_connected` without sending anything. `GET /v1/channels/airbnb/listings` reports both fields for the whole portfolio in one call. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
970
1110
  # @param id [String]
971
1111
  # @param [Hash] opts the optional parameters
972
1112
  # @option opts [String] :include Comma-separated expansions. Currently supported: &#x60;amenities&#x60;.
@@ -977,7 +1117,7 @@ module Repull
977
1117
  end
978
1118
 
979
1119
  # Get Airbnb listing
980
- # Fetch all Airbnb connection rows for a single Vanio listing id. A property may be linked from multiple Airbnb hosts — every match is returned. Pass &#x60;?include&#x3D;amenities&#x60; to enrich each row with its current Airbnb amenities. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1120
+ # Fetch all Airbnb connection rows for a single Vanio listing id. A property may be linked from multiple Airbnb hosts — every match is returned. Pass &#x60;?include&#x3D;amenities&#x60; to enrich each row with its current Airbnb amenities. Each row carries &#x60;syncCategory&#x60; — Airbnb&#39;s own per-listing API sync decision (&#x60;sync_all&#x60;, &#x60;sync_rates_and_availability&#x60;, or &#x60;none&#x60;) — and &#x60;writable&#x60;, which is &#x60;false&#x60; exactly when that category is &#x60;none&#x60;, meaning Airbnb refuses every write to the listing and Repull returns &#x60;403 listing_not_api_connected&#x60; without sending anything. &#x60;GET /v1/channels/airbnb/listings&#x60; reports both fields for the whole portfolio in one call. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
981
1121
  # @param id [String]
982
1122
  # @param [Hash] opts the optional parameters
983
1123
  # @option opts [String] :include Comma-separated expansions. Currently supported: &#x60;amenities&#x60;.
@@ -1094,6 +1234,69 @@ module Repull
1094
1234
  return data, status_code, headers
1095
1235
  end
1096
1236
 
1237
+ # Get Airbnb listing details
1238
+ # What kind of property Airbnb thinks this is — property type group and category, room type, capacity — plus the check-in method (`checkInOption`), whether the listing is live (`hasAvailability`), and **`lockedFields`: the attributes Airbnb refuses to change on this listing**. **Pure DB read** from the local mirror, one entry per Airbnb connection. Read `lockedFields` before a content write. Airbnb does not refuse a write to a locked attribute: it returns 200, reports the attribute as locked, and applies nothing — which is why a write can look successful and change nothing. 1,180 of 5,917 synced listings carry at least one locked attribute. Returns `404` when the listing has no Airbnb connection in this workspace, and `403 listing_inactive` when the listing is inactive.
1239
+ # @param id [String] Repull listing id (numeric string).
1240
+ # @param [Hash] opts the optional parameters
1241
+ # @return [GetAirbnbListingDetails200Response]
1242
+ def get_airbnb_listing_details(id, opts = {})
1243
+ data, _status_code, _headers = get_airbnb_listing_details_with_http_info(id, opts)
1244
+ data
1245
+ end
1246
+
1247
+ # Get Airbnb listing details
1248
+ # What kind of property Airbnb thinks this is — property type group and category, room type, capacity — plus the check-in method (&#x60;checkInOption&#x60;), whether the listing is live (&#x60;hasAvailability&#x60;), and **&#x60;lockedFields&#x60;: the attributes Airbnb refuses to change on this listing**. **Pure DB read** from the local mirror, one entry per Airbnb connection. Read &#x60;lockedFields&#x60; before a content write. Airbnb does not refuse a write to a locked attribute: it returns 200, reports the attribute as locked, and applies nothing — which is why a write can look successful and change nothing. 1,180 of 5,917 synced listings carry at least one locked attribute. Returns &#x60;404&#x60; when the listing has no Airbnb connection in this workspace, and &#x60;403 listing_inactive&#x60; when the listing is inactive.
1249
+ # @param id [String] Repull listing id (numeric string).
1250
+ # @param [Hash] opts the optional parameters
1251
+ # @return [Array<(GetAirbnbListingDetails200Response, Integer, Hash)>] GetAirbnbListingDetails200Response data, response status code and response headers
1252
+ def get_airbnb_listing_details_with_http_info(id, opts = {})
1253
+ if @api_client.config.debugging
1254
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.get_airbnb_listing_details ...'
1255
+ end
1256
+ # verify the required parameter 'id' is set
1257
+ if @api_client.config.client_side_validation && id.nil?
1258
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.get_airbnb_listing_details"
1259
+ end
1260
+ # resource path
1261
+ local_var_path = '/v1/channels/airbnb/listings/{id}/details'.sub('{id}', CGI.escape(id.to_s))
1262
+
1263
+ # query parameters
1264
+ query_params = opts[:query_params] || {}
1265
+
1266
+ # header parameters
1267
+ header_params = opts[:header_params] || {}
1268
+ # HTTP header 'Accept' (if needed)
1269
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1270
+
1271
+ # form parameters
1272
+ form_params = opts[:form_params] || {}
1273
+
1274
+ # http body (model)
1275
+ post_body = opts[:debug_body]
1276
+
1277
+ # return_type
1278
+ return_type = opts[:debug_return_type] || 'GetAirbnbListingDetails200Response'
1279
+
1280
+ # auth_names
1281
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1282
+
1283
+ new_options = opts.merge(
1284
+ :operation => :"AirbnbApi.get_airbnb_listing_details",
1285
+ :header_params => header_params,
1286
+ :query_params => query_params,
1287
+ :form_params => form_params,
1288
+ :body => post_body,
1289
+ :auth_names => auth_names,
1290
+ :return_type => return_type
1291
+ )
1292
+
1293
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1294
+ if @api_client.config.debugging
1295
+ @api_client.config.logger.debug "API called: AirbnbApi#get_airbnb_listing_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1296
+ end
1297
+ return data, status_code, headers
1298
+ end
1299
+
1097
1300
  # Get Airbnb pricing
1098
1301
  # Read the current pricing config (base price, weekend uplift, length-of-stay discounts, smart-pricing bounds) for an Airbnb listing. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1099
1302
  # @param id [String]
@@ -1424,8 +1627,9 @@ module Repull
1424
1627
  end
1425
1628
 
1426
1629
  # List Airbnb alterations
1427
- # List reservation alteration requests for Airbnb reservations in this workspace. **Pure DB read** from the local `reservation_alterations` mirror — never calls Airbnb upstream — scoped to your workspace via the reservations join. Default returns only pending alterations; pass `?type=all` for the full history. Filter to a single reservation with `?reservation_code=<confirmation code>`. Every response carries the `dataFreshness` envelope. Alterations of reservations on inactive listings are left out. Filtering by a reservation on an inactive listing (`reservation_code`) returns `403 listing_inactive`.
1630
+ # List reservation alteration requests for Airbnb reservations in this workspace. **Pure DB read** from the local `reservation_alterations` mirror — never calls Airbnb upstream — scoped to your workspace via the reservations join. Default returns only pending alterations; pass `?type=all` for the full history. Filter to a single reservation with `?reservation_code=<confirmation code>`. Every response carries the `dataFreshness` envelope. Each row carries the proposed change in its `new*` fields. A **listing transfer** shows up as `newListingId` (Repull listing id) and `newAirbnbListingId` (Airbnb's own id); both are `null` when the alteration does not move the reservation. Alterations of reservations on inactive listings are left out. Filtering by a reservation on an inactive listing (`reservation_code`) returns `403 listing_inactive`. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account's rows; pass `?account_id=<airbnb host id>` to scope to one. Every row carries `accountId` + `accountName` either way, and `dataFreshness.accounts[]` reports each account's freshness separately, so one disconnected host no longer marks the whole response stale.
1428
1631
  # @param [Hash] opts the optional parameters
1632
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
1429
1633
  # @option opts [String] :type Scope: &#x60;pending&#x60; (default) returns only alterations awaiting a decision; &#x60;all&#x60; returns every alteration. (default to 'pending')
1430
1634
  # @option opts [String] :reservation_code Airbnb confirmation code — restricts results to a single reservation. Returns an empty array when no reservation matches within your workspace.
1431
1635
  # @return [ListAirbnbAlterations200Response]
@@ -1435,8 +1639,9 @@ module Repull
1435
1639
  end
1436
1640
 
1437
1641
  # List Airbnb alterations
1438
- # List reservation alteration requests for Airbnb reservations in this workspace. **Pure DB read** from the local &#x60;reservation_alterations&#x60; mirror — never calls Airbnb upstream — scoped to your workspace via the reservations join. Default returns only pending alterations; pass &#x60;?type&#x3D;all&#x60; for the full history. Filter to a single reservation with &#x60;?reservation_code&#x3D;&lt;confirmation code&gt;&#x60;. Every response carries the &#x60;dataFreshness&#x60; envelope. Alterations of reservations on inactive listings are left out. Filtering by a reservation on an inactive listing (&#x60;reservation_code&#x60;) returns &#x60;403 listing_inactive&#x60;.
1642
+ # List reservation alteration requests for Airbnb reservations in this workspace. **Pure DB read** from the local &#x60;reservation_alterations&#x60; mirror — never calls Airbnb upstream — scoped to your workspace via the reservations join. Default returns only pending alterations; pass &#x60;?type&#x3D;all&#x60; for the full history. Filter to a single reservation with &#x60;?reservation_code&#x3D;&lt;confirmation code&gt;&#x60;. Every response carries the &#x60;dataFreshness&#x60; envelope. Each row carries the proposed change in its &#x60;new*&#x60; fields. A **listing transfer** shows up as &#x60;newListingId&#x60; (Repull listing id) and &#x60;newAirbnbListingId&#x60; (Airbnb&#39;s own id); both are &#x60;null&#x60; when the alteration does not move the reservation. Alterations of reservations on inactive listings are left out. Filtering by a reservation on an inactive listing (&#x60;reservation_code&#x60;) returns &#x60;403 listing_inactive&#x60;. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account&#39;s rows; pass &#x60;?account_id&#x3D;&lt;airbnb host id&gt;&#x60; to scope to one. Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, and &#x60;dataFreshness.accounts[]&#x60; reports each account&#39;s freshness separately, so one disconnected host no longer marks the whole response stale.
1439
1643
  # @param [Hash] opts the optional parameters
1644
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
1440
1645
  # @option opts [String] :type Scope: &#x60;pending&#x60; (default) returns only alterations awaiting a decision; &#x60;all&#x60; returns every alteration. (default to 'pending')
1441
1646
  # @option opts [String] :reservation_code Airbnb confirmation code — restricts results to a single reservation. Returns an empty array when no reservation matches within your workspace.
1442
1647
  # @return [Array<(ListAirbnbAlterations200Response, Integer, Hash)>] ListAirbnbAlterations200Response data, response status code and response headers
@@ -1453,6 +1658,7 @@ module Repull
1453
1658
 
1454
1659
  # query parameters
1455
1660
  query_params = opts[:query_params] || {}
1661
+ query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
1456
1662
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
1457
1663
  query_params[:'reservation_code'] = opts[:'reservation_code'] if !opts[:'reservation_code'].nil?
1458
1664
 
@@ -1622,6 +1828,76 @@ module Repull
1622
1828
  return data, status_code, headers
1623
1829
  end
1624
1830
 
1831
+ # List Airbnb permits and licences
1832
+ # The regulatory permits, licences and registration numbers attached to an Airbnb listing. **DB-only by default.** `?source=cache` (the default) returns the permits as last mirrored by the sync worker — regulatory body, regulation type, status, permit number — with no upstream call. **`?source=live` also returns the QUESTIONS.** The mirror stores the RESULT of a permit, not what Airbnb asks for it, so a caller that is about to write needs `?source=live` once: it returns each permit flow with the `question_key`, `answer_type` and `options` of every question, and the answers already on file. Airbnb refuses a `question_key` it did not ask for on this listing, so this is not optional guesswork you can skip. Returns `404` when the listing has no Airbnb connection in this workspace, and `403 listing_inactive` when the listing is inactive.
1833
+ # @param id [String] Repull listing id (numeric string).
1834
+ # @param [Hash] opts the optional parameters
1835
+ # @option opts [String] :source &#x60;cache&#x60; (default) reads the local mirror only. &#x60;live&#x60; additionally asks Airbnb for the permit questions. (default to 'cache')
1836
+ # @return [ListAirbnbListingPermits200Response]
1837
+ def list_airbnb_listing_permits(id, opts = {})
1838
+ data, _status_code, _headers = list_airbnb_listing_permits_with_http_info(id, opts)
1839
+ data
1840
+ end
1841
+
1842
+ # List Airbnb permits and licences
1843
+ # The regulatory permits, licences and registration numbers attached to an Airbnb listing. **DB-only by default.** &#x60;?source&#x3D;cache&#x60; (the default) returns the permits as last mirrored by the sync worker — regulatory body, regulation type, status, permit number — with no upstream call. **&#x60;?source&#x3D;live&#x60; also returns the QUESTIONS.** The mirror stores the RESULT of a permit, not what Airbnb asks for it, so a caller that is about to write needs &#x60;?source&#x3D;live&#x60; once: it returns each permit flow with the &#x60;question_key&#x60;, &#x60;answer_type&#x60; and &#x60;options&#x60; of every question, and the answers already on file. Airbnb refuses a &#x60;question_key&#x60; it did not ask for on this listing, so this is not optional guesswork you can skip. Returns &#x60;404&#x60; when the listing has no Airbnb connection in this workspace, and &#x60;403 listing_inactive&#x60; when the listing is inactive.
1844
+ # @param id [String] Repull listing id (numeric string).
1845
+ # @param [Hash] opts the optional parameters
1846
+ # @option opts [String] :source &#x60;cache&#x60; (default) reads the local mirror only. &#x60;live&#x60; additionally asks Airbnb for the permit questions. (default to 'cache')
1847
+ # @return [Array<(ListAirbnbListingPermits200Response, Integer, Hash)>] ListAirbnbListingPermits200Response data, response status code and response headers
1848
+ def list_airbnb_listing_permits_with_http_info(id, opts = {})
1849
+ if @api_client.config.debugging
1850
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.list_airbnb_listing_permits ...'
1851
+ end
1852
+ # verify the required parameter 'id' is set
1853
+ if @api_client.config.client_side_validation && id.nil?
1854
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.list_airbnb_listing_permits"
1855
+ end
1856
+ allowable_values = ["cache", "live"]
1857
+ if @api_client.config.client_side_validation && opts[:'source'] && !allowable_values.include?(opts[:'source'])
1858
+ fail ArgumentError, "invalid value for \"source\", must be one of #{allowable_values}"
1859
+ end
1860
+ # resource path
1861
+ local_var_path = '/v1/channels/airbnb/listings/{id}/permits'.sub('{id}', CGI.escape(id.to_s))
1862
+
1863
+ # query parameters
1864
+ query_params = opts[:query_params] || {}
1865
+ query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
1866
+
1867
+ # header parameters
1868
+ header_params = opts[:header_params] || {}
1869
+ # HTTP header 'Accept' (if needed)
1870
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1871
+
1872
+ # form parameters
1873
+ form_params = opts[:form_params] || {}
1874
+
1875
+ # http body (model)
1876
+ post_body = opts[:debug_body]
1877
+
1878
+ # return_type
1879
+ return_type = opts[:debug_return_type] || 'ListAirbnbListingPermits200Response'
1880
+
1881
+ # auth_names
1882
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
1883
+
1884
+ new_options = opts.merge(
1885
+ :operation => :"AirbnbApi.list_airbnb_listing_permits",
1886
+ :header_params => header_params,
1887
+ :query_params => query_params,
1888
+ :form_params => form_params,
1889
+ :body => post_body,
1890
+ :auth_names => auth_names,
1891
+ :return_type => return_type
1892
+ )
1893
+
1894
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1895
+ if @api_client.config.debugging
1896
+ @api_client.config.logger.debug "API called: AirbnbApi#list_airbnb_listing_permits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1897
+ end
1898
+ return data, status_code, headers
1899
+ end
1900
+
1625
1901
  # List Airbnb photos
1626
1902
  # List photos attached to an Airbnb listing in display order. Returns the public CDN URL plus Airbnb-side metadata (id, caption, room). Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1627
1903
  # @param id [String]
@@ -1686,7 +1962,7 @@ module Repull
1686
1962
  end
1687
1963
 
1688
1964
  # List Airbnb rooms
1689
- # List the rooms configured on an Airbnb listing, ordered by room number. **Pure DB read** from `listings_airbnb_rooms`. Returns `404` when the listing has no Airbnb connection in this workspace. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1965
+ # List the rooms configured on an Airbnb listing, ordered by room number, each with its sleeping arrangement in `beds`. **Pure DB read** from `listings_airbnb_rooms` + `listings_airbnb_beds`. Returns `404` when the listing has no Airbnb connection in this workspace. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1690
1966
  # @param id [String] Repull listing id (numeric string).
1691
1967
  # @param [Hash] opts the optional parameters
1692
1968
  # @return [GetAirbnbCheckinGuide200Response]
@@ -1696,7 +1972,7 @@ module Repull
1696
1972
  end
1697
1973
 
1698
1974
  # List Airbnb rooms
1699
- # List the rooms configured on an Airbnb listing, ordered by room number. **Pure DB read** from &#x60;listings_airbnb_rooms&#x60;. Returns &#x60;404&#x60; when the listing has no Airbnb connection in this workspace. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1975
+ # List the rooms configured on an Airbnb listing, ordered by room number, each with its sleeping arrangement in &#x60;beds&#x60;. **Pure DB read** from &#x60;listings_airbnb_rooms&#x60; + &#x60;listings_airbnb_beds&#x60;. Returns &#x60;404&#x60; when the listing has no Airbnb connection in this workspace. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
1700
1976
  # @param id [String] Repull listing id (numeric string).
1701
1977
  # @param [Hash] opts the optional parameters
1702
1978
  # @return [Array<(GetAirbnbCheckinGuide200Response, Integer, Hash)>] GetAirbnbCheckinGuide200Response data, response status code and response headers
@@ -1748,31 +2024,34 @@ module Repull
1748
2024
  return data, status_code, headers
1749
2025
  end
1750
2026
 
1751
- # List Airbnb listings
1752
- # List every Airbnb listing this workspace has access to via the connected Airbnb account. **Pure DB read never calls Airbnb upstream.** The connect flow is what populates the local cache; the API serves what's already there. Customers with a disconnected host still see their last-synced data, with the top-level `dataFreshness` envelope flagging the staleness and pointing at the reconnect URL. Pass `?include=amenities` to enrich each connection with its locally-cached amenity set. Returns `null` per connection when the cache is empty. Inactive listings are left out; they keep syncing and reappear once activated. Use `GET /v1/listings?status=inactive` to find them.
2027
+ # List guest-safety disclosures
2028
+ # What a guest is told about the property before they book — exterior security cameras, a decibel noise monitor, pets on the property, stairs, a pool with no fence, weapons, shared spaces, limited parking. Airbnb calls them `listing_expectations_for_guests` and shows them at booking time. **Pure DB read** from the local mirror. EVERY supported disclosure type is returned, including the ones this listing has not declared (`value: false`), so \"does this property have cameras?\" has an answer rather than a missing key — `declared` tells you whether Airbnb holds an explicit answer. Types Airbnb returns that are not in the documented set are passed through rather than dropped. Where a listing is connected to several Airbnb listings, a disclosure declared on any of them is reported as true of the property. Returns `404` when the listing has no Airbnb connection in this workspace, and `403 listing_inactive` when the listing is inactive.
2029
+ # @param id [String] Repull listing id (numeric string).
1753
2030
  # @param [Hash] opts the optional parameters
1754
- # @option opts [String] :include Comma-separated expansions. Currently supported: &#x60;amenities&#x60; (adds &#x60;amenities&#x60; and &#x60;accessibility_amenities&#x60; arrays to each connection, sourced from the local &#x60;listings_airbnb_amenities&#x60; cache).
1755
- # @return [AirbnbListingListResponse]
1756
- def list_airbnb_listings(opts = {})
1757
- data, _status_code, _headers = list_airbnb_listings_with_http_info(opts)
2031
+ # @return [ListAirbnbListingSafetyDisclosures200Response]
2032
+ def list_airbnb_listing_safety_disclosures(id, opts = {})
2033
+ data, _status_code, _headers = list_airbnb_listing_safety_disclosures_with_http_info(id, opts)
1758
2034
  data
1759
2035
  end
1760
2036
 
1761
- # List Airbnb listings
1762
- # List every Airbnb listing this workspace has access to via the connected Airbnb account. **Pure DB read never calls Airbnb upstream.** The connect flow is what populates the local cache; the API serves what&#39;s already there. Customers with a disconnected host still see their last-synced data, with the top-level &#x60;dataFreshness&#x60; envelope flagging the staleness and pointing at the reconnect URL. Pass &#x60;?include&#x3D;amenities&#x60; to enrich each connection with its locally-cached amenity set. Returns &#x60;null&#x60; per connection when the cache is empty. Inactive listings are left out; they keep syncing and reappear once activated. Use &#x60;GET /v1/listings?status&#x3D;inactive&#x60; to find them.
2037
+ # List guest-safety disclosures
2038
+ # What a guest is told about the property before they book exterior security cameras, a decibel noise monitor, pets on the property, stairs, a pool with no fence, weapons, shared spaces, limited parking. Airbnb calls them &#x60;listing_expectations_for_guests&#x60; and shows them at booking time. **Pure DB read** from the local mirror. EVERY supported disclosure type is returned, including the ones this listing has not declared (&#x60;value: false&#x60;), so \&quot;does this property have cameras?\&quot; has an answer rather than a missing key — &#x60;declared&#x60; tells you whether Airbnb holds an explicit answer. Types Airbnb returns that are not in the documented set are passed through rather than dropped. Where a listing is connected to several Airbnb listings, a disclosure declared on any of them is reported as true of the property. Returns &#x60;404&#x60; when the listing has no Airbnb connection in this workspace, and &#x60;403 listing_inactive&#x60; when the listing is inactive.
2039
+ # @param id [String] Repull listing id (numeric string).
1763
2040
  # @param [Hash] opts the optional parameters
1764
- # @option opts [String] :include Comma-separated expansions. Currently supported: &#x60;amenities&#x60; (adds &#x60;amenities&#x60; and &#x60;accessibility_amenities&#x60; arrays to each connection, sourced from the local &#x60;listings_airbnb_amenities&#x60; cache).
1765
- # @return [Array<(AirbnbListingListResponse, Integer, Hash)>] AirbnbListingListResponse data, response status code and response headers
1766
- def list_airbnb_listings_with_http_info(opts = {})
2041
+ # @return [Array<(ListAirbnbListingSafetyDisclosures200Response, Integer, Hash)>] ListAirbnbListingSafetyDisclosures200Response data, response status code and response headers
2042
+ def list_airbnb_listing_safety_disclosures_with_http_info(id, opts = {})
1767
2043
  if @api_client.config.debugging
1768
- @api_client.config.logger.debug 'Calling API: AirbnbApi.list_airbnb_listings ...'
2044
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.list_airbnb_listing_safety_disclosures ...'
2045
+ end
2046
+ # verify the required parameter 'id' is set
2047
+ if @api_client.config.client_side_validation && id.nil?
2048
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.list_airbnb_listing_safety_disclosures"
1769
2049
  end
1770
2050
  # resource path
1771
- local_var_path = '/v1/channels/airbnb/listings'
2051
+ local_var_path = '/v1/channels/airbnb/listings/{id}/safety-disclosures'.sub('{id}', CGI.escape(id.to_s))
1772
2052
 
1773
2053
  # query parameters
1774
2054
  query_params = opts[:query_params] || {}
1775
- query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
1776
2055
 
1777
2056
  # header parameters
1778
2057
  header_params = opts[:header_params] || {}
@@ -1786,13 +2065,13 @@ module Repull
1786
2065
  post_body = opts[:debug_body]
1787
2066
 
1788
2067
  # return_type
1789
- return_type = opts[:debug_return_type] || 'AirbnbListingListResponse'
2068
+ return_type = opts[:debug_return_type] || 'ListAirbnbListingSafetyDisclosures200Response'
1790
2069
 
1791
2070
  # auth_names
1792
2071
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
1793
2072
 
1794
2073
  new_options = opts.merge(
1795
- :operation => :"AirbnbApi.list_airbnb_listings",
2074
+ :operation => :"AirbnbApi.list_airbnb_listing_safety_disclosures",
1796
2075
  :header_params => header_params,
1797
2076
  :query_params => query_params,
1798
2077
  :form_params => form_params,
@@ -1803,37 +2082,102 @@ module Repull
1803
2082
 
1804
2083
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1805
2084
  if @api_client.config.debugging
1806
- @api_client.config.logger.debug "API called: AirbnbApi#list_airbnb_listings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2085
+ @api_client.config.logger.debug "API called: AirbnbApi#list_airbnb_listing_safety_disclosures\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1807
2086
  end
1808
2087
  return data, status_code, headers
1809
2088
  end
1810
2089
 
1811
- # List Airbnb reservations
1812
- # Cursor-paginated list of reservations sourced directly from Airbnb. Use this when you need Airbnb-specific fields (guest payout split, cancellation policy snapshot) that the unified `/v1/reservations` endpoint flattens away. Walk pages with `?cursor=<pagination.nextCursor>` until `pagination.hasMore` is `false`. The cursor is opaquenever construct or parse it client-side. `?offset=` is also accepted as a first-class alias for shallow paging (0..10000) — see the `offset` parameter below. Mutually exclusive with `cursor`. Internally this walks upstream Airbnb cursor pages to skip rows, so deep offsets cost N/limit upstream round-trips; cursor remains the better choice for deep pagination. When `status` is omitted, all statuses are returned (Airbnb defaults to `accepted` only on its own surface, but this endpoint normalises to \"all\"). Pass `?status=accepted` to scope. Reservations on inactive listings are left out (counts and cursors included); they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (`listing_id`) returns `403 listing_inactive`.
2090
+ # List Airbnb listings
2091
+ # List every Airbnb listing this workspace has access to via the connected Airbnb account. **Pure DB read never calls Airbnb upstream.** The connect flow is what populates the local cache; the API serves what's already there. Customers with a disconnected host still see their last-synced data, with the top-level `dataFreshness` envelope flagging the staleness and pointing at the reconnect URL. Pass `?include=amenities` to enrich each connection with its locally-cached amenity set. Returns `null` per connection when the cache is empty. Pass `?include=thumbnail` to add `thumbnailUrl` to each listing one extra column on the query that already runs, so a selection screen renders from a single request instead of one call per listing. `null` when the listing has no thumbnail stored. Combine comma-separated, e.g. `?include=amenities,thumbnail`. **Can this listing be written to?** Every connection carries `syncCategory` — Airbnb's own per-listing API sync decision (`sync_all`, `sync_rates_and_availability`, or `none`) — and `writable`, which is `false` exactly when that category is `none`. Airbnb authorises sync one listing at a time, so a connected account can still hold listings Airbnb refuses every write to; a write to one of those returns `403 listing_not_api_connected` before anything is sent, and reconnecting the account does not change it (the host must switch the listing on in Airbnb). Check `writable` here before a portfolio-wide push instead of discovering it one 403 at a time. Inactive listings are left out; they keep syncing and reappear once activated. Use `GET /v1/listings?status=inactive` to find them. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account's rows; pass `?account_id=<airbnb host id>` to scope to one. Every row carries `accountId` + `accountName` either way, and `dataFreshness.accounts[]` reports each account's freshness separately, so one disconnected host no longer marks the whole response stale.
1813
2092
  # @param [Hash] opts the optional parameters
1814
- # @option opts [String] :cursor Opaque cursor returned by the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.
1815
- # @option opts [Integer] :offset First-class alias for cursor-based pagination. Mutually exclusive with &#x60;cursor&#x60; passing both returns 422. Accepts integers in &#x60;[0, 10000]&#x60;; deeper walks must use &#x60;cursor&#x60; (constant per-page cost). The response always includes &#x60;pagination.nextCursor&#x60; so consumers can switch from offset cursor mid-walk for deep pagination without re-keying. (default to 0)
1816
- # @option opts [Integer] :limit Max items per page. Hard cap is 100. (default to 50)
1817
- # @option opts [String] :listing_id Filter to one Airbnb listing id (numeric string).
1818
- # @option opts [String] :status Filter by reservation status. Omit to receive all statuses.
1819
- # @option opts [Date] :start_date ISO 8601 (YYYY-MM-DD) lower bound on Airbnb&#39;s date range filter.
1820
- # @option opts [Date] :end_date ISO 8601 (YYYY-MM-DD) upper bound on Airbnb&#39;s date range filter.
1821
- # @option opts [Boolean] :include_total Whether to include &#x60;pagination.total&#x60;. Always populated when Airbnb returns a total count (effectively always); accepted for shape symmetry with the rest of the API. (default to true)
1822
- # @return [AirbnbReservationListResponse]
1823
- def list_airbnb_reservations(opts = {})
1824
- data, _status_code, _headers = list_airbnb_reservations_with_http_info(opts)
2093
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2094
+ # @option opts [String] :include Comma-separated expansions. Currently supported: &#x60;amenities&#x60; (adds &#x60;amenities&#x60; and &#x60;accessibility_amenities&#x60; arrays to each connection, sourced from the local &#x60;listings_airbnb_amenities&#x60; cache) and &#x60;thumbnail&#x60; (adds &#x60;thumbnailUrl&#x60; to each listing). Unknown values return 422 with a &#x60;valid_values&#x60; envelope.
2095
+ # @return [AirbnbListingListResponse]
2096
+ def list_airbnb_listings(opts = {})
2097
+ data, _status_code, _headers = list_airbnb_listings_with_http_info(opts)
1825
2098
  data
1826
2099
  end
1827
2100
 
1828
- # List Airbnb reservations
1829
- # Cursor-paginated list of reservations sourced directly from Airbnb. Use this when you need Airbnb-specific fields (guest payout split, cancellation policy snapshot) that the unified &#x60;/v1/reservations&#x60; endpoint flattens away. Walk pages with &#x60;?cursor&#x3D;&lt;pagination.nextCursor&gt;&#x60; until &#x60;pagination.hasMore&#x60; is &#x60;false&#x60;. The cursor is opaquenever construct or parse it client-side. &#x60;?offset&#x3D;&#x60; is also accepted as a first-class alias for shallow paging (0..10000) — see the &#x60;offset&#x60; parameter below. Mutually exclusive with &#x60;cursor&#x60;. Internally this walks upstream Airbnb cursor pages to skip rows, so deep offsets cost N/limit upstream round-trips; cursor remains the better choice for deep pagination. When &#x60;status&#x60; is omitted, all statuses are returned (Airbnb defaults to &#x60;accepted&#x60; only on its own surface, but this endpoint normalises to \&quot;all\&quot;). Pass &#x60;?status&#x3D;accepted&#x60; to scope. Reservations on inactive listings are left out (counts and cursors included); they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (&#x60;listing_id&#x60;) returns &#x60;403 listing_inactive&#x60;.
2101
+ # List Airbnb listings
2102
+ # List every Airbnb listing this workspace has access to via the connected Airbnb account. **Pure DB read never calls Airbnb upstream.** The connect flow is what populates the local cache; the API serves what&#39;s already there. Customers with a disconnected host still see their last-synced data, with the top-level &#x60;dataFreshness&#x60; envelope flagging the staleness and pointing at the reconnect URL. Pass &#x60;?include&#x3D;amenities&#x60; to enrich each connection with its locally-cached amenity set. Returns &#x60;null&#x60; per connection when the cache is empty. Pass &#x60;?include&#x3D;thumbnail&#x60; to add &#x60;thumbnailUrl&#x60; to each listing one extra column on the query that already runs, so a selection screen renders from a single request instead of one call per listing. &#x60;null&#x60; when the listing has no thumbnail stored. Combine comma-separated, e.g. &#x60;?include&#x3D;amenities,thumbnail&#x60;. **Can this listing be written to?** Every connection carries &#x60;syncCategory&#x60; — Airbnb&#39;s own per-listing API sync decision (&#x60;sync_all&#x60;, &#x60;sync_rates_and_availability&#x60;, or &#x60;none&#x60;) — and &#x60;writable&#x60;, which is &#x60;false&#x60; exactly when that category is &#x60;none&#x60;. Airbnb authorises sync one listing at a time, so a connected account can still hold listings Airbnb refuses every write to; a write to one of those returns &#x60;403 listing_not_api_connected&#x60; before anything is sent, and reconnecting the account does not change it (the host must switch the listing on in Airbnb). Check &#x60;writable&#x60; here before a portfolio-wide push instead of discovering it one 403 at a time. Inactive listings are left out; they keep syncing and reappear once activated. Use &#x60;GET /v1/listings?status&#x3D;inactive&#x60; to find them. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account&#39;s rows; pass &#x60;?account_id&#x3D;&lt;airbnb host id&gt;&#x60; to scope to one. Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, and &#x60;dataFreshness.accounts[]&#x60; reports each account&#39;s freshness separately, so one disconnected host no longer marks the whole response stale.
1830
2103
  # @param [Hash] opts the optional parameters
1831
- # @option opts [String] :cursor Opaque cursor returned by the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.
1832
- # @option opts [Integer] :offset First-class alias for cursor-based pagination. Mutually exclusive with &#x60;cursor&#x60; passing both returns 422. Accepts integers in &#x60;[0, 10000]&#x60;; deeper walks must use &#x60;cursor&#x60; (constant per-page cost). The response always includes &#x60;pagination.nextCursor&#x60; so consumers can switch from offset cursor mid-walk for deep pagination without re-keying. (default to 0)
1833
- # @option opts [Integer] :limit Max items per page. Hard cap is 100. (default to 50)
1834
- # @option opts [String] :listing_id Filter to one Airbnb listing id (numeric string).
1835
- # @option opts [String] :status Filter by reservation status. Omit to receive all statuses.
1836
- # @option opts [Date] :start_date ISO 8601 (YYYY-MM-DD) lower bound on Airbnb&#39;s date range filter.
2104
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2105
+ # @option opts [String] :include Comma-separated expansions. Currently supported: &#x60;amenities&#x60; (adds &#x60;amenities&#x60; and &#x60;accessibility_amenities&#x60; arrays to each connection, sourced from the local &#x60;listings_airbnb_amenities&#x60; cache) and &#x60;thumbnail&#x60; (adds &#x60;thumbnailUrl&#x60; to each listing). Unknown values return 422 with a &#x60;valid_values&#x60; envelope.
2106
+ # @return [Array<(AirbnbListingListResponse, Integer, Hash)>] AirbnbListingListResponse data, response status code and response headers
2107
+ def list_airbnb_listings_with_http_info(opts = {})
2108
+ if @api_client.config.debugging
2109
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.list_airbnb_listings ...'
2110
+ end
2111
+ # resource path
2112
+ local_var_path = '/v1/channels/airbnb/listings'
2113
+
2114
+ # query parameters
2115
+ query_params = opts[:query_params] || {}
2116
+ query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
2117
+ query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
2118
+
2119
+ # header parameters
2120
+ header_params = opts[:header_params] || {}
2121
+ # HTTP header 'Accept' (if needed)
2122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2123
+
2124
+ # form parameters
2125
+ form_params = opts[:form_params] || {}
2126
+
2127
+ # http body (model)
2128
+ post_body = opts[:debug_body]
2129
+
2130
+ # return_type
2131
+ return_type = opts[:debug_return_type] || 'AirbnbListingListResponse'
2132
+
2133
+ # auth_names
2134
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2135
+
2136
+ new_options = opts.merge(
2137
+ :operation => :"AirbnbApi.list_airbnb_listings",
2138
+ :header_params => header_params,
2139
+ :query_params => query_params,
2140
+ :form_params => form_params,
2141
+ :body => post_body,
2142
+ :auth_names => auth_names,
2143
+ :return_type => return_type
2144
+ )
2145
+
2146
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2147
+ if @api_client.config.debugging
2148
+ @api_client.config.logger.debug "API called: AirbnbApi#list_airbnb_listings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2149
+ end
2150
+ return data, status_code, headers
2151
+ end
2152
+
2153
+ # List Airbnb reservations
2154
+ # Cursor-paginated list of reservations sourced directly from Airbnb. Use this when you need Airbnb-specific fields (guest payout split, cancellation policy snapshot) that the unified `/v1/reservations` endpoint flattens away. Walk pages with `?cursor=<pagination.nextCursor>` until `pagination.hasMore` is `false`. The cursor is opaque — never construct or parse it client-side. `?offset=` is also accepted as a first-class alias for shallow paging (0..10000) — see the `offset` parameter below. Mutually exclusive with `cursor`. Internally this walks upstream Airbnb cursor pages to skip rows, so deep offsets cost N/limit upstream round-trips; cursor remains the better choice for deep pagination. When `status` is omitted, all statuses are returned (Airbnb defaults to `accepted` only on its own surface, but this endpoint normalises to \"all\"). Pass `?status=accepted` to scope. Reservations on inactive listings are left out (counts and cursors included); they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (`listing_id`) returns `403 listing_inactive`. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account's rows; pass `?account_id=<airbnb host id>` to scope to one. Every row carries `accountId` + `accountName` either way, and `dataFreshness.accounts[]` reports each account's freshness separately, so one disconnected host no longer marks the whole response stale.
2155
+ # @param [Hash] opts the optional parameters
2156
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2157
+ # @option opts [String] :cursor Opaque cursor returned by the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.
2158
+ # @option opts [Integer] :offset First-class alias for cursor-based pagination. Mutually exclusive with &#x60;cursor&#x60; — passing both returns 422. Accepts integers in &#x60;[0, 10000]&#x60;; deeper walks must use &#x60;cursor&#x60; (constant per-page cost). The response always includes &#x60;pagination.nextCursor&#x60; so consumers can switch from offset → cursor mid-walk for deep pagination without re-keying. (default to 0)
2159
+ # @option opts [Integer] :limit Max items per page. Hard cap is 100. (default to 50)
2160
+ # @option opts [String] :listing_id Filter to one Airbnb listing id (numeric string).
2161
+ # @option opts [String] :status Filter by reservation status. Omit to receive all statuses.
2162
+ # @option opts [Date] :start_date ISO 8601 (YYYY-MM-DD) lower bound on Airbnb&#39;s date range filter.
2163
+ # @option opts [Date] :end_date ISO 8601 (YYYY-MM-DD) upper bound on Airbnb&#39;s date range filter.
2164
+ # @option opts [Boolean] :include_total Whether to include &#x60;pagination.total&#x60;. Always populated when Airbnb returns a total count (effectively always); accepted for shape symmetry with the rest of the API. (default to true)
2165
+ # @return [AirbnbReservationListResponse]
2166
+ def list_airbnb_reservations(opts = {})
2167
+ data, _status_code, _headers = list_airbnb_reservations_with_http_info(opts)
2168
+ data
2169
+ end
2170
+
2171
+ # List Airbnb reservations
2172
+ # Cursor-paginated list of reservations sourced directly from Airbnb. Use this when you need Airbnb-specific fields (guest payout split, cancellation policy snapshot) that the unified &#x60;/v1/reservations&#x60; endpoint flattens away. Walk pages with &#x60;?cursor&#x3D;&lt;pagination.nextCursor&gt;&#x60; until &#x60;pagination.hasMore&#x60; is &#x60;false&#x60;. The cursor is opaque — never construct or parse it client-side. &#x60;?offset&#x3D;&#x60; is also accepted as a first-class alias for shallow paging (0..10000) — see the &#x60;offset&#x60; parameter below. Mutually exclusive with &#x60;cursor&#x60;. Internally this walks upstream Airbnb cursor pages to skip rows, so deep offsets cost N/limit upstream round-trips; cursor remains the better choice for deep pagination. When &#x60;status&#x60; is omitted, all statuses are returned (Airbnb defaults to &#x60;accepted&#x60; only on its own surface, but this endpoint normalises to \&quot;all\&quot;). Pass &#x60;?status&#x3D;accepted&#x60; to scope. Reservations on inactive listings are left out (counts and cursors included); they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (&#x60;listing_id&#x60;) returns &#x60;403 listing_inactive&#x60;. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account&#39;s rows; pass &#x60;?account_id&#x3D;&lt;airbnb host id&gt;&#x60; to scope to one. Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, and &#x60;dataFreshness.accounts[]&#x60; reports each account&#39;s freshness separately, so one disconnected host no longer marks the whole response stale.
2173
+ # @param [Hash] opts the optional parameters
2174
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2175
+ # @option opts [String] :cursor Opaque cursor returned by the previous response&#39;s &#x60;pagination.nextCursor&#x60;. Omit to fetch the first page.
2176
+ # @option opts [Integer] :offset First-class alias for cursor-based pagination. Mutually exclusive with &#x60;cursor&#x60; — passing both returns 422. Accepts integers in &#x60;[0, 10000]&#x60;; deeper walks must use &#x60;cursor&#x60; (constant per-page cost). The response always includes &#x60;pagination.nextCursor&#x60; so consumers can switch from offset → cursor mid-walk for deep pagination without re-keying. (default to 0)
2177
+ # @option opts [Integer] :limit Max items per page. Hard cap is 100. (default to 50)
2178
+ # @option opts [String] :listing_id Filter to one Airbnb listing id (numeric string).
2179
+ # @option opts [String] :status Filter by reservation status. Omit to receive all statuses.
2180
+ # @option opts [Date] :start_date ISO 8601 (YYYY-MM-DD) lower bound on Airbnb&#39;s date range filter.
1837
2181
  # @option opts [Date] :end_date ISO 8601 (YYYY-MM-DD) upper bound on Airbnb&#39;s date range filter.
1838
2182
  # @option opts [Boolean] :include_total Whether to include &#x60;pagination.total&#x60;. Always populated when Airbnb returns a total count (effectively always); accepted for shape symmetry with the rest of the API. (default to true)
1839
2183
  # @return [Array<(AirbnbReservationListResponse, Integer, Hash)>] AirbnbReservationListResponse data, response status code and response headers
@@ -1866,6 +2210,7 @@ module Repull
1866
2210
 
1867
2211
  # query parameters
1868
2212
  query_params = opts[:query_params] || {}
2213
+ query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
1869
2214
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1870
2215
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1871
2216
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
@@ -1910,8 +2255,9 @@ module Repull
1910
2255
  end
1911
2256
 
1912
2257
  # List Airbnb reviews
1913
- # List reviews left by guests on Airbnb listings in this workspace. Includes both reviews of the host and reviews of the guest (where the host has not yet submitted theirs). Reviews of inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (`listing_id`) returns `403 listing_inactive`.
2258
+ # List reviews left by guests on Airbnb listings in this workspace. Includes both reviews of the host and reviews of the guest (where the host has not yet submitted theirs). Reviews of inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (`listing_id`) returns `403 listing_inactive`. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account's rows; pass `?account_id=<airbnb host id>` to scope to one. Every row carries `accountId` + `accountName` either way, and `dataFreshness.accounts[]` reports each account's freshness separately, so one disconnected host no longer marks the whole response stale.
1914
2259
  # @param [Hash] opts the optional parameters
2260
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
1915
2261
  # @return [AirbnbReviewListResponse]
1916
2262
  def list_airbnb_reviews(opts = {})
1917
2263
  data, _status_code, _headers = list_airbnb_reviews_with_http_info(opts)
@@ -1919,8 +2265,9 @@ module Repull
1919
2265
  end
1920
2266
 
1921
2267
  # List Airbnb reviews
1922
- # List reviews left by guests on Airbnb listings in this workspace. Includes both reviews of the host and reviews of the guest (where the host has not yet submitted theirs). Reviews of inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (&#x60;listing_id&#x60;) returns &#x60;403 listing_inactive&#x60;.
2268
+ # List reviews left by guests on Airbnb listings in this workspace. Includes both reviews of the host and reviews of the guest (where the host has not yet submitted theirs). Reviews of inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (&#x60;listing_id&#x60;) returns &#x60;403 listing_inactive&#x60;. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account&#39;s rows; pass &#x60;?account_id&#x3D;&lt;airbnb host id&gt;&#x60; to scope to one. Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, and &#x60;dataFreshness.accounts[]&#x60; reports each account&#39;s freshness separately, so one disconnected host no longer marks the whole response stale.
1923
2269
  # @param [Hash] opts the optional parameters
2270
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
1924
2271
  # @return [Array<(AirbnbReviewListResponse, Integer, Hash)>] AirbnbReviewListResponse data, response status code and response headers
1925
2272
  def list_airbnb_reviews_with_http_info(opts = {})
1926
2273
  if @api_client.config.debugging
@@ -1931,6 +2278,7 @@ module Repull
1931
2278
 
1932
2279
  # query parameters
1933
2280
  query_params = opts[:query_params] || {}
2281
+ query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
1934
2282
 
1935
2283
  # header parameters
1936
2284
  header_params = opts[:header_params] || {}
@@ -2030,8 +2378,9 @@ module Repull
2030
2378
  end
2031
2379
 
2032
2380
  # List Airbnb message threads
2033
- # List Airbnb message threads (one per guest conversation). Cursor-paginated. Each thread includes a preview of the latest message. Threads on inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (`listing_id`) returns `403 listing_inactive`.
2381
+ # List Airbnb message threads (one per guest conversation). Cursor-paginated. Each thread includes a preview of the latest message. Threads on inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (`listing_id`) returns `403 listing_inactive`. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account's rows; pass `?account_id=<airbnb host id>` to scope to one. Every row carries `accountId` + `accountName` either way, and `dataFreshness.accounts[]` reports each account's freshness separately, so one disconnected host no longer marks the whole response stale.
2034
2382
  # @param [Hash] opts the optional parameters
2383
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2035
2384
  # @return [AirbnbThreadListResponse]
2036
2385
  def list_airbnb_threads(opts = {})
2037
2386
  data, _status_code, _headers = list_airbnb_threads_with_http_info(opts)
@@ -2039,8 +2388,9 @@ module Repull
2039
2388
  end
2040
2389
 
2041
2390
  # List Airbnb message threads
2042
- # List Airbnb message threads (one per guest conversation). Cursor-paginated. Each thread includes a preview of the latest message. Threads on inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (&#x60;listing_id&#x60;) returns &#x60;403 listing_inactive&#x60;.
2391
+ # List Airbnb message threads (one per guest conversation). Cursor-paginated. Each thread includes a preview of the latest message. Threads on inactive listings are left out; they keep syncing and reappear once the listing is activated. Filtering by an inactive listing (&#x60;listing_id&#x60;) returns &#x60;403 listing_inactive&#x60;. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account&#39;s rows; pass &#x60;?account_id&#x3D;&lt;airbnb host id&gt;&#x60; to scope to one. Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, and &#x60;dataFreshness.accounts[]&#x60; reports each account&#39;s freshness separately, so one disconnected host no longer marks the whole response stale.
2043
2392
  # @param [Hash] opts the optional parameters
2393
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2044
2394
  # @return [Array<(AirbnbThreadListResponse, Integer, Hash)>] AirbnbThreadListResponse data, response status code and response headers
2045
2395
  def list_airbnb_threads_with_http_info(opts = {})
2046
2396
  if @api_client.config.debugging
@@ -2051,6 +2401,7 @@ module Repull
2051
2401
 
2052
2402
  # query parameters
2053
2403
  query_params = opts[:query_params] || {}
2404
+ query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
2054
2405
 
2055
2406
  # header parameters
2056
2407
  header_params = opts[:header_params] || {}
@@ -2087,8 +2438,9 @@ module Repull
2087
2438
  end
2088
2439
 
2089
2440
  # List Airbnb transactions
2090
- # List Airbnb host transactions (reservation earnings, payouts, resolution adjustments) for this workspace, newest first. **Pure DB read** — customer-facing reads never call Airbnb upstream; they serve the `airbnb_transactions` mirror. Each row carries the genuine host- and guest-side financial breakdown (accommodation subtotal, cleaning fee, host + guest service fees split base/VAT, tax buckets, expected/actual host payout with settlement status). Trigger a refresh with `POST` on this path. When the mirror is empty or the host disconnected, `dataFreshness.stale = true` with a `reason` (`never_synced`, `host_disconnected_<iso>`, `sync_lag_>_24h`). Transactions of reservations on inactive listings are left out; payout rows, which belong to no listing, are always included.
2441
+ # List Airbnb host transactions (reservation earnings, payouts, resolution adjustments) for this workspace, newest first. **Pure DB read** — customer-facing reads never call Airbnb upstream; they serve the `airbnb_transactions` mirror. Each row carries the genuine host- and guest-side financial breakdown (accommodation subtotal, cleaning fee, host + guest service fees split base/VAT, tax buckets, expected/actual host payout with settlement status). Trigger a refresh with `POST` on this path. When the mirror is empty or the host disconnected, `dataFreshness.stale = true` with a `reason` (`never_synced`, `host_disconnected_<iso>`, `sync_lag_>_24h`). Transactions of reservations on inactive listings are left out; payout rows, which belong to no listing, are always included. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account's rows; pass `?account_id=<airbnb host id>` to scope to one. Every row carries `accountId` + `accountName` either way, and `dataFreshness.accounts[]` reports each account's freshness separately, so one disconnected host no longer marks the whole response stale.
2091
2442
  # @param [Hash] opts the optional parameters
2443
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2092
2444
  # @return [ListAirbnbTransactions200Response]
2093
2445
  def list_airbnb_transactions(opts = {})
2094
2446
  data, _status_code, _headers = list_airbnb_transactions_with_http_info(opts)
@@ -2096,8 +2448,9 @@ module Repull
2096
2448
  end
2097
2449
 
2098
2450
  # List Airbnb transactions
2099
- # List Airbnb host transactions (reservation earnings, payouts, resolution adjustments) for this workspace, newest first. **Pure DB read** — customer-facing reads never call Airbnb upstream; they serve the &#x60;airbnb_transactions&#x60; mirror. Each row carries the genuine host- and guest-side financial breakdown (accommodation subtotal, cleaning fee, host + guest service fees split base/VAT, tax buckets, expected/actual host payout with settlement status). Trigger a refresh with &#x60;POST&#x60; on this path. When the mirror is empty or the host disconnected, &#x60;dataFreshness.stale &#x3D; true&#x60; with a &#x60;reason&#x60; (&#x60;never_synced&#x60;, &#x60;host_disconnected_&lt;iso&gt;&#x60;, &#x60;sync_lag_&gt;_24h&#x60;). Transactions of reservations on inactive listings are left out; payout rows, which belong to no listing, are always included.
2451
+ # List Airbnb host transactions (reservation earnings, payouts, resolution adjustments) for this workspace, newest first. **Pure DB read** — customer-facing reads never call Airbnb upstream; they serve the &#x60;airbnb_transactions&#x60; mirror. Each row carries the genuine host- and guest-side financial breakdown (accommodation subtotal, cleaning fee, host + guest service fees split base/VAT, tax buckets, expected/actual host payout with settlement status). Trigger a refresh with &#x60;POST&#x60; on this path. When the mirror is empty or the host disconnected, &#x60;dataFreshness.stale &#x3D; true&#x60; with a &#x60;reason&#x60; (&#x60;never_synced&#x60;, &#x60;host_disconnected_&lt;iso&gt;&#x60;, &#x60;sync_lag_&gt;_24h&#x60;). Transactions of reservations on inactive listings are left out; payout rows, which belong to no listing, are always included. **Several Airbnb accounts?** A workspace can connect more than one. By default this returns every connected account&#39;s rows; pass &#x60;?account_id&#x3D;&lt;airbnb host id&gt;&#x60; to scope to one. Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, and &#x60;dataFreshness.accounts[]&#x60; reports each account&#39;s freshness separately, so one disconnected host no longer marks the whole response stale.
2100
2452
  # @param [Hash] opts the optional parameters
2453
+ # @option opts [String] :account_id Scope the response to ONE connected Airbnb account. The value is the Airbnb host id — the same &#x60;accounts[].externalAccountId&#x60; that &#x60;GET /v1/connect/airbnb&#x60; returns and &#x60;DELETE /v1/connect/airbnb?accountId&#x3D;&#x60; accepts. A workspace can connect several Airbnb accounts. Omit this and you get every account&#39;s rows (the default, unchanged). Every row carries &#x60;accountId&#x60; + &#x60;accountName&#x60; either way, so you can group without a second call. An id that is not connected to THIS workspace returns &#x60;404 not_found&#x60; with your own ids in &#x60;valid_values&#x60; — we do not distinguish \&quot;no such host\&quot; from \&quot;someone else&#39;s host\&quot;, because confirming the latter would leak another workspace&#39;s account. Note this is NOT the &#x60;X-Account-Id&#x60; header, which carries a connection id and cannot tell two Airbnb hosts apart.
2101
2454
  # @return [Array<(ListAirbnbTransactions200Response, Integer, Hash)>] ListAirbnbTransactions200Response data, response status code and response headers
2102
2455
  def list_airbnb_transactions_with_http_info(opts = {})
2103
2456
  if @api_client.config.debugging
@@ -2108,6 +2461,7 @@ module Repull
2108
2461
 
2109
2462
  # query parameters
2110
2463
  query_params = opts[:query_params] || {}
2464
+ query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
2111
2465
 
2112
2466
  # header parameters
2113
2467
  header_params = opts[:header_params] || {}
@@ -2211,6 +2565,80 @@ module Repull
2211
2565
  return data, status_code, headers
2212
2566
  end
2213
2567
 
2568
+ # Reorder the Airbnb photo tour
2569
+ # Set the order of a listing's photo tour in one call. **Write-side** — calls Airbnb upstream. Send the photo ids in the order you want them shown, first photo first. Ids you leave out keep their current relative order behind the ones you list, so moving one photo to the front is `{\"photo_ids\": [\"<id>\"]}`. Positions are then written as a dense run starting at 1. Airbnb has no bulk photo endpoint — order is one `sort_order` per photo — so this saves a loop of up to 200 requests against your rate limit and makes the partial-failure case reportable. How much is atomic: - Everything is validated before anything is written. A duplicate id, an id that is not on this listing, an inactive listing or a missing connection all fail with **zero** upstream writes. - Only photos whose position actually changes are written; re-sending the order you already have writes nothing. - On the first upstream failure the run stops — nothing after it is attempted. The error carries `applied`, `failed_photo_id` and `not_attempted`, uses Airbnb's own status (`422` rejected / `403` reauth / `429` / `502`), and the operation is idempotent: re-send the identical body to finish the run. - Our stored copy records what actually landed, never the intent. Validation is against our cached copy of the tour, so a listing whose photos have never synced returns `404` — use `PATCH /photos` (which needs no cache) until the first sync lands. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2570
+ # @param id [String] Repull listing id (numeric string).
2571
+ # @param reorder_airbnb_listing_photos_request [ReorderAirbnbListingPhotosRequest]
2572
+ # @param [Hash] opts the optional parameters
2573
+ # @return [ReorderAirbnbListingPhotos200Response]
2574
+ def reorder_airbnb_listing_photos(id, reorder_airbnb_listing_photos_request, opts = {})
2575
+ data, _status_code, _headers = reorder_airbnb_listing_photos_with_http_info(id, reorder_airbnb_listing_photos_request, opts)
2576
+ data
2577
+ end
2578
+
2579
+ # Reorder the Airbnb photo tour
2580
+ # Set the order of a listing&#39;s photo tour in one call. **Write-side** — calls Airbnb upstream. Send the photo ids in the order you want them shown, first photo first. Ids you leave out keep their current relative order behind the ones you list, so moving one photo to the front is &#x60;{\&quot;photo_ids\&quot;: [\&quot;&lt;id&gt;\&quot;]}&#x60;. Positions are then written as a dense run starting at 1. Airbnb has no bulk photo endpoint — order is one &#x60;sort_order&#x60; per photo — so this saves a loop of up to 200 requests against your rate limit and makes the partial-failure case reportable. How much is atomic: - Everything is validated before anything is written. A duplicate id, an id that is not on this listing, an inactive listing or a missing connection all fail with **zero** upstream writes. - Only photos whose position actually changes are written; re-sending the order you already have writes nothing. - On the first upstream failure the run stops — nothing after it is attempted. The error carries &#x60;applied&#x60;, &#x60;failed_photo_id&#x60; and &#x60;not_attempted&#x60;, uses Airbnb&#39;s own status (&#x60;422&#x60; rejected / &#x60;403&#x60; reauth / &#x60;429&#x60; / &#x60;502&#x60;), and the operation is idempotent: re-send the identical body to finish the run. - Our stored copy records what actually landed, never the intent. Validation is against our cached copy of the tour, so a listing whose photos have never synced returns &#x60;404&#x60; — use &#x60;PATCH /photos&#x60; (which needs no cache) until the first sync lands. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2581
+ # @param id [String] Repull listing id (numeric string).
2582
+ # @param reorder_airbnb_listing_photos_request [ReorderAirbnbListingPhotosRequest]
2583
+ # @param [Hash] opts the optional parameters
2584
+ # @return [Array<(ReorderAirbnbListingPhotos200Response, Integer, Hash)>] ReorderAirbnbListingPhotos200Response data, response status code and response headers
2585
+ def reorder_airbnb_listing_photos_with_http_info(id, reorder_airbnb_listing_photos_request, opts = {})
2586
+ if @api_client.config.debugging
2587
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.reorder_airbnb_listing_photos ...'
2588
+ end
2589
+ # verify the required parameter 'id' is set
2590
+ if @api_client.config.client_side_validation && id.nil?
2591
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.reorder_airbnb_listing_photos"
2592
+ end
2593
+ # verify the required parameter 'reorder_airbnb_listing_photos_request' is set
2594
+ if @api_client.config.client_side_validation && reorder_airbnb_listing_photos_request.nil?
2595
+ fail ArgumentError, "Missing the required parameter 'reorder_airbnb_listing_photos_request' when calling AirbnbApi.reorder_airbnb_listing_photos"
2596
+ end
2597
+ # resource path
2598
+ local_var_path = '/v1/channels/airbnb/listings/{id}/photos/order'.sub('{id}', CGI.escape(id.to_s))
2599
+
2600
+ # query parameters
2601
+ query_params = opts[:query_params] || {}
2602
+
2603
+ # header parameters
2604
+ header_params = opts[:header_params] || {}
2605
+ # HTTP header 'Accept' (if needed)
2606
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2607
+ # HTTP header 'Content-Type'
2608
+ content_type = @api_client.select_header_content_type(['application/json'])
2609
+ if !content_type.nil?
2610
+ header_params['Content-Type'] = content_type
2611
+ end
2612
+
2613
+ # form parameters
2614
+ form_params = opts[:form_params] || {}
2615
+
2616
+ # http body (model)
2617
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(reorder_airbnb_listing_photos_request)
2618
+
2619
+ # return_type
2620
+ return_type = opts[:debug_return_type] || 'ReorderAirbnbListingPhotos200Response'
2621
+
2622
+ # auth_names
2623
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2624
+
2625
+ new_options = opts.merge(
2626
+ :operation => :"AirbnbApi.reorder_airbnb_listing_photos",
2627
+ :header_params => header_params,
2628
+ :query_params => query_params,
2629
+ :form_params => form_params,
2630
+ :body => post_body,
2631
+ :auth_names => auth_names,
2632
+ :return_type => return_type
2633
+ )
2634
+
2635
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2636
+ if @api_client.config.debugging
2637
+ @api_client.config.logger.debug "API called: AirbnbApi#reorder_airbnb_listing_photos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2638
+ end
2639
+ return data, status_code, headers
2640
+ end
2641
+
2214
2642
  # Respond to Airbnb review
2215
2643
  # Post a public host response to a guest review. Airbnb allows one response per review — repeated POSTs return 409. Response text is capped at 1000 characters. Returns `403 listing_inactive` when the listing this resolves to is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2216
2644
  # @param id [String] Airbnb review id.
@@ -2416,6 +2844,80 @@ module Repull
2416
2844
  return data, status_code, headers
2417
2845
  end
2418
2846
 
2847
+ # Set the Airbnb cover photo
2848
+ # Choose which photo leads the listing. **Write-side** — calls Airbnb upstream. Airbnb has no \"cover\" field: the cover is the first photo of the tour, so this is a position write. Usually it is a single upstream request — the chosen photo takes a position below the current first one and nothing else moves. When the tour already starts at position 1 and there is no room below it, the tour is renumbered instead, one request per photo whose position actually changes, with the same stop-at-first-failure reporting as `PUT /photos/order` (`applied`, `failed_photo_id`, `not_attempted`; re-send the identical body to finish). The listing thumbnail — what every list view renders — is repointed at the new cover, so the change is not visible only inside the photo tour. The photo must already be in our cached copy of the tour; one uploaded since the last sync returns `404`, and `PATCH /photos` can set its position in the meantime. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2849
+ # @param id [String] Repull listing id (numeric string).
2850
+ # @param set_airbnb_listing_cover_photo_request [SetAirbnbListingCoverPhotoRequest]
2851
+ # @param [Hash] opts the optional parameters
2852
+ # @return [SetAirbnbListingCoverPhoto200Response]
2853
+ def set_airbnb_listing_cover_photo(id, set_airbnb_listing_cover_photo_request, opts = {})
2854
+ data, _status_code, _headers = set_airbnb_listing_cover_photo_with_http_info(id, set_airbnb_listing_cover_photo_request, opts)
2855
+ data
2856
+ end
2857
+
2858
+ # Set the Airbnb cover photo
2859
+ # Choose which photo leads the listing. **Write-side** — calls Airbnb upstream. Airbnb has no \&quot;cover\&quot; field: the cover is the first photo of the tour, so this is a position write. Usually it is a single upstream request — the chosen photo takes a position below the current first one and nothing else moves. When the tour already starts at position 1 and there is no room below it, the tour is renumbered instead, one request per photo whose position actually changes, with the same stop-at-first-failure reporting as &#x60;PUT /photos/order&#x60; (&#x60;applied&#x60;, &#x60;failed_photo_id&#x60;, &#x60;not_attempted&#x60;; re-send the identical body to finish). The listing thumbnail — what every list view renders — is repointed at the new cover, so the change is not visible only inside the photo tour. The photo must already be in our cached copy of the tour; one uploaded since the last sync returns &#x60;404&#x60;, and &#x60;PATCH /photos&#x60; can set its position in the meantime. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2860
+ # @param id [String] Repull listing id (numeric string).
2861
+ # @param set_airbnb_listing_cover_photo_request [SetAirbnbListingCoverPhotoRequest]
2862
+ # @param [Hash] opts the optional parameters
2863
+ # @return [Array<(SetAirbnbListingCoverPhoto200Response, Integer, Hash)>] SetAirbnbListingCoverPhoto200Response data, response status code and response headers
2864
+ def set_airbnb_listing_cover_photo_with_http_info(id, set_airbnb_listing_cover_photo_request, opts = {})
2865
+ if @api_client.config.debugging
2866
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.set_airbnb_listing_cover_photo ...'
2867
+ end
2868
+ # verify the required parameter 'id' is set
2869
+ if @api_client.config.client_side_validation && id.nil?
2870
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.set_airbnb_listing_cover_photo"
2871
+ end
2872
+ # verify the required parameter 'set_airbnb_listing_cover_photo_request' is set
2873
+ if @api_client.config.client_side_validation && set_airbnb_listing_cover_photo_request.nil?
2874
+ fail ArgumentError, "Missing the required parameter 'set_airbnb_listing_cover_photo_request' when calling AirbnbApi.set_airbnb_listing_cover_photo"
2875
+ end
2876
+ # resource path
2877
+ local_var_path = '/v1/channels/airbnb/listings/{id}/photos/cover'.sub('{id}', CGI.escape(id.to_s))
2878
+
2879
+ # query parameters
2880
+ query_params = opts[:query_params] || {}
2881
+
2882
+ # header parameters
2883
+ header_params = opts[:header_params] || {}
2884
+ # HTTP header 'Accept' (if needed)
2885
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
2886
+ # HTTP header 'Content-Type'
2887
+ content_type = @api_client.select_header_content_type(['application/json'])
2888
+ if !content_type.nil?
2889
+ header_params['Content-Type'] = content_type
2890
+ end
2891
+
2892
+ # form parameters
2893
+ form_params = opts[:form_params] || {}
2894
+
2895
+ # http body (model)
2896
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(set_airbnb_listing_cover_photo_request)
2897
+
2898
+ # return_type
2899
+ return_type = opts[:debug_return_type] || 'SetAirbnbListingCoverPhoto200Response'
2900
+
2901
+ # auth_names
2902
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
2903
+
2904
+ new_options = opts.merge(
2905
+ :operation => :"AirbnbApi.set_airbnb_listing_cover_photo",
2906
+ :header_params => header_params,
2907
+ :query_params => query_params,
2908
+ :form_params => form_params,
2909
+ :body => post_body,
2910
+ :auth_names => auth_names,
2911
+ :return_type => return_type
2912
+ )
2913
+
2914
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2915
+ if @api_client.config.debugging
2916
+ @api_client.config.logger.debug "API called: AirbnbApi#set_airbnb_listing_cover_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2917
+ end
2918
+ return data, status_code, headers
2919
+ end
2920
+
2419
2921
  # Sync Airbnb transactions
2420
2922
  # Refresh the Airbnb transactions mirror for this workspace by pulling from Airbnb upstream and upserting the breakdown that `GET` serves. Optional JSON body `{ start_date, end_date, transaction_type }` (`transaction_type` is `COMPLETED` or `UPCOMING`; both are synced when omitted). Returns `{ synced, count }`.
2421
2923
  # @param [Hash] opts the optional parameters
@@ -2480,6 +2982,80 @@ module Repull
2480
2982
  return data, status_code, headers
2481
2983
  end
2482
2984
 
2985
+ # Update Airbnb booking settings
2986
+ # Set any subset of a listing's booking settings on Airbnb. Partial — a field you do not send is left as it is. `{id}` is the **Repull listing id** (from `GET /v1/properties` or `GET /v1/channels/airbnb/listings`), not the Airbnb listing id; Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb, so a bad value is a `422` naming the field rather than a failed upstream call. Unknown fields are refused rather than dropped. **Two groups, applied in order.** Instant Book, check-in/out and the cancellation fields go to Airbnb's booking-settings resource. Advance notice, preparation time and booking window go to Airbnb's availability rules — Airbnb replaces that whole document, so Repull reads the current rules first and merges your change onto them, which is why setting a preparation time does not blank the listing's min/max nights. The response's `applied` array names the groups that were written. **Non-refundable is a percentage here, a factor on Airbnb.** Airbnb stores `non_refundable_price_factor` between 0.7 and 1.0; send `cancellation.nonRefundable.discountPercent` (0-30) and Repull converts — 10% becomes 0.9. `enabled: false` sets the factor to 1.0. **Not exposed by Airbnb:** `preReservationMessage` and `automaticStayExtension`. Sending either returns a `422` explaining where to set it instead. **Errors:** `403 connection_reauth_required` — Airbnb no longer accepts the connection for this listing (reconnect; retrying won't help). `403 listing_inactive` — the listing is inactive. `404 not_found` — no Airbnb-connected listing with this id in the workspace. `422 invalid_params` — the body is wrong; `field` names it. `422 airbnb_rejected` — Airbnb refused the change; `message` carries its reason. `429 airbnb_rate_limited` — back off. `502 airbnb_error` — Airbnb outage or timeout; retry.
2987
+ # @param id [String] Repull listing id (numeric string), not the Airbnb listing id.
2988
+ # @param update_airbnb_booking_settings_request [UpdateAirbnbBookingSettingsRequest]
2989
+ # @param [Hash] opts the optional parameters
2990
+ # @return [UpdateAirbnbBookingSettings200Response]
2991
+ def update_airbnb_booking_settings(id, update_airbnb_booking_settings_request, opts = {})
2992
+ data, _status_code, _headers = update_airbnb_booking_settings_with_http_info(id, update_airbnb_booking_settings_request, opts)
2993
+ data
2994
+ end
2995
+
2996
+ # Update Airbnb booking settings
2997
+ # Set any subset of a listing&#39;s booking settings on Airbnb. Partial — a field you do not send is left as it is. &#x60;{id}&#x60; is the **Repull listing id** (from &#x60;GET /v1/properties&#x60; or &#x60;GET /v1/channels/airbnb/listings&#x60;), not the Airbnb listing id; Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb, so a bad value is a &#x60;422&#x60; naming the field rather than a failed upstream call. Unknown fields are refused rather than dropped. **Two groups, applied in order.** Instant Book, check-in/out and the cancellation fields go to Airbnb&#39;s booking-settings resource. Advance notice, preparation time and booking window go to Airbnb&#39;s availability rules — Airbnb replaces that whole document, so Repull reads the current rules first and merges your change onto them, which is why setting a preparation time does not blank the listing&#39;s min/max nights. The response&#39;s &#x60;applied&#x60; array names the groups that were written. **Non-refundable is a percentage here, a factor on Airbnb.** Airbnb stores &#x60;non_refundable_price_factor&#x60; between 0.7 and 1.0; send &#x60;cancellation.nonRefundable.discountPercent&#x60; (0-30) and Repull converts — 10% becomes 0.9. &#x60;enabled: false&#x60; sets the factor to 1.0. **Not exposed by Airbnb:** &#x60;preReservationMessage&#x60; and &#x60;automaticStayExtension&#x60;. Sending either returns a &#x60;422&#x60; explaining where to set it instead. **Errors:** &#x60;403 connection_reauth_required&#x60; — Airbnb no longer accepts the connection for this listing (reconnect; retrying won&#39;t help). &#x60;403 listing_inactive&#x60; — the listing is inactive. &#x60;404 not_found&#x60; — no Airbnb-connected listing with this id in the workspace. &#x60;422 invalid_params&#x60; — the body is wrong; &#x60;field&#x60; names it. &#x60;422 airbnb_rejected&#x60; — Airbnb refused the change; &#x60;message&#x60; carries its reason. &#x60;429 airbnb_rate_limited&#x60; — back off. &#x60;502 airbnb_error&#x60; — Airbnb outage or timeout; retry.
2998
+ # @param id [String] Repull listing id (numeric string), not the Airbnb listing id.
2999
+ # @param update_airbnb_booking_settings_request [UpdateAirbnbBookingSettingsRequest]
3000
+ # @param [Hash] opts the optional parameters
3001
+ # @return [Array<(UpdateAirbnbBookingSettings200Response, Integer, Hash)>] UpdateAirbnbBookingSettings200Response data, response status code and response headers
3002
+ def update_airbnb_booking_settings_with_http_info(id, update_airbnb_booking_settings_request, opts = {})
3003
+ if @api_client.config.debugging
3004
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_booking_settings ...'
3005
+ end
3006
+ # verify the required parameter 'id' is set
3007
+ if @api_client.config.client_side_validation && id.nil?
3008
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_booking_settings"
3009
+ end
3010
+ # verify the required parameter 'update_airbnb_booking_settings_request' is set
3011
+ if @api_client.config.client_side_validation && update_airbnb_booking_settings_request.nil?
3012
+ fail ArgumentError, "Missing the required parameter 'update_airbnb_booking_settings_request' when calling AirbnbApi.update_airbnb_booking_settings"
3013
+ end
3014
+ # resource path
3015
+ local_var_path = '/v1/channels/airbnb/listings/{id}/booking-settings'.sub('{id}', CGI.escape(id.to_s))
3016
+
3017
+ # query parameters
3018
+ query_params = opts[:query_params] || {}
3019
+
3020
+ # header parameters
3021
+ header_params = opts[:header_params] || {}
3022
+ # HTTP header 'Accept' (if needed)
3023
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3024
+ # HTTP header 'Content-Type'
3025
+ content_type = @api_client.select_header_content_type(['application/json'])
3026
+ if !content_type.nil?
3027
+ header_params['Content-Type'] = content_type
3028
+ end
3029
+
3030
+ # form parameters
3031
+ form_params = opts[:form_params] || {}
3032
+
3033
+ # http body (model)
3034
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_airbnb_booking_settings_request)
3035
+
3036
+ # return_type
3037
+ return_type = opts[:debug_return_type] || 'UpdateAirbnbBookingSettings200Response'
3038
+
3039
+ # auth_names
3040
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3041
+
3042
+ new_options = opts.merge(
3043
+ :operation => :"AirbnbApi.update_airbnb_booking_settings",
3044
+ :header_params => header_params,
3045
+ :query_params => query_params,
3046
+ :form_params => form_params,
3047
+ :body => post_body,
3048
+ :auth_names => auth_names,
3049
+ :return_type => return_type
3050
+ )
3051
+
3052
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3053
+ if @api_client.config.debugging
3054
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_booking_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3055
+ end
3056
+ return data, status_code, headers
3057
+ end
3058
+
2483
3059
  # Upsert Airbnb check-in guide
2484
3060
  # Upsert the check-in guide for one locale on an Airbnb listing. **Write-side** — calls Airbnb upstream; the DB mirror is reconciled by the sync worker once the upstream call returns. Target the locale with `?locale=en` (defaults to `en`). Requires a connected Airbnb host, else `404 no_connection`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2485
3061
  # @param id [String] Repull listing id (numeric string).
@@ -2546,37 +3122,37 @@ module Repull
2546
3122
  return data, status_code, headers
2547
3123
  end
2548
3124
 
2549
- # Update Airbnb availability
2550
- # Push availability + restrictions to Airbnb. `type: \"calendar\"` writes per-date restrictions min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (`availability: \"unavailable\"`) via a batch of operations that each target either a date range or an explicit date list. `type: \"rules\"` writes listing-level availability rules (default min/max nights, booking lead time, turnover days, seasonal/day-of-week min nights). Restrictions never leak across channels this endpoint writes only to Airbnb. `{id}` is the **Repull listing id** (from `GET /v1/properties` or `GET /v1/channels/airbnb/listings`), not the Airbnb listing id Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is `422 invalid_params` naming the `field`. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a `busy_subtype` whenever `availability` is `\"unavailable\"`. If an operation leaves it out, Repull sends `busy_subtype: \"BLOCKED_BY_HOST\"`; send `\"OUTSIDE_RESERVATION\"` for dates held by a booking made on another channel. **Errors:** `403 connection_reauth_required` Airbnb no longer accepts the connection for this listing (reconnect; retrying won't help). `403 listing_inactive` the listing is inactive. `404 not_found` no Airbnb-connected listing with this id in the workspace. `422 airbnb_rejected` Airbnb refused the change; `message` carries its reason. `429 airbnb_rate_limited` back off. `502 airbnb_error` Airbnb outage or timeout; retry.
2551
- # @param id [String]
2552
- # @param airbnb_availability_write_request [AirbnbAvailabilityWriteRequest]
3125
+ # Update Airbnb amenities
3126
+ # Set amenities on an Airbnb listing. **Write-side**calls Airbnb upstream. **Partial by design**: only the amenities you name change, so turning one off is a one-line body and nothing else on the listing moves. Ids are the `id` values `GET /amenities` returns (e.g. `wireless_internet`, `ac`, `kitchen`); case is ignored. Airbnb refuses ids outside its vocabulary that comes back as `422 airbnb_rejected` carrying Airbnb's own message. `accessibility_amenities` go to Airbnb's separate accessibility resource, which has **no read side at all** Airbnb offers no endpoint to fetch them back, and the combined amenities GET 404s on production listings. What you can read back is our own copy: this endpoint updates it on success, and `GET /amenities` returns it under `accessibilityAmenities`. Airbnb may also hold an accessibility claim for review until photo evidence is attached; pass `photo_ids` to supply it. Our Airbnb copy is updated on success so a read straight after this write returns the new values. The platform-neutral copy behind `GET /v1/listings/{id}?include=amenities` uses a different amenity vocabulary and is refreshed by the next sync, except where an id happens to be identical in both. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3127
+ # @param id [String] Repull listing id (numeric string).
3128
+ # @param update_airbnb_listing_amenities_request [UpdateAirbnbListingAmenitiesRequest]
2553
3129
  # @param [Hash] opts the optional parameters
2554
- # @return [nil]
2555
- def update_airbnb_listing_availability(id, airbnb_availability_write_request, opts = {})
2556
- update_airbnb_listing_availability_with_http_info(id, airbnb_availability_write_request, opts)
2557
- nil
3130
+ # @return [UpdateAirbnbListingAmenities200Response]
3131
+ def update_airbnb_listing_amenities(id, update_airbnb_listing_amenities_request, opts = {})
3132
+ data, _status_code, _headers = update_airbnb_listing_amenities_with_http_info(id, update_airbnb_listing_amenities_request, opts)
3133
+ data
2558
3134
  end
2559
3135
 
2560
- # Update Airbnb availability
2561
- # Push availability + restrictions to Airbnb. &#x60;type: \&quot;calendar\&quot;&#x60; writes per-date restrictions min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (&#x60;availability: \&quot;unavailable\&quot;&#x60;) via a batch of operations that each target either a date range or an explicit date list. &#x60;type: \&quot;rules\&quot;&#x60; writes listing-level availability rules (default min/max nights, booking lead time, turnover days, seasonal/day-of-week min nights). Restrictions never leak across channels this endpoint writes only to Airbnb. &#x60;{id}&#x60; is the **Repull listing id** (from &#x60;GET /v1/properties&#x60; or &#x60;GET /v1/channels/airbnb/listings&#x60;), not the Airbnb listing idRepull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is &#x60;422 invalid_params&#x60; naming the &#x60;field&#x60;. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a &#x60;busy_subtype&#x60; whenever &#x60;availability&#x60; is &#x60;\&quot;unavailable\&quot;&#x60;. If an operation leaves it out, Repull sends &#x60;busy_subtype: \&quot;BLOCKED_BY_HOST\&quot;&#x60;; send &#x60;\&quot;OUTSIDE_RESERVATION\&quot;&#x60; for dates held by a booking made on another channel. **Errors:** &#x60;403 connection_reauth_required&#x60; Airbnb no longer accepts the connection for this listing (reconnect; retrying won&#39;t help). &#x60;403 listing_inactive&#x60; the listing is inactive. &#x60;404 not_found&#x60; no Airbnb-connected listing with this id in the workspace. &#x60;422 airbnb_rejected&#x60; Airbnb refused the change; &#x60;message&#x60; carries its reason. &#x60;429 airbnb_rate_limited&#x60; back off. &#x60;502 airbnb_error&#x60; Airbnb outage or timeout; retry.
2562
- # @param id [String]
2563
- # @param airbnb_availability_write_request [AirbnbAvailabilityWriteRequest]
3136
+ # Update Airbnb amenities
3137
+ # Set amenities on an Airbnb listing. **Write-side** calls Airbnb upstream. **Partial by design**: only the amenities you name change, so turning one off is a one-line body and nothing else on the listing moves. Ids are the &#x60;id&#x60; values &#x60;GET /amenities&#x60; returns (e.g. &#x60;wireless_internet&#x60;, &#x60;ac&#x60;, &#x60;kitchen&#x60;); case is ignored. Airbnb refuses ids outside its vocabularythat comes back as &#x60;422 airbnb_rejected&#x60; carrying Airbnb&#39;s own message. &#x60;accessibility_amenities&#x60; go to Airbnb&#39;s separate accessibility resource, which has **no read side at all** Airbnb offers no endpoint to fetch them back, and the combined amenities GET 404s on production listings. What you can read back is our own copy: this endpoint updates it on success, and &#x60;GET /amenities&#x60; returns it under &#x60;accessibilityAmenities&#x60;. Airbnb may also hold an accessibility claim for review until photo evidence is attached; pass &#x60;photo_ids&#x60; to supply it. Our Airbnb copy is updated on success so a read straight after this write returns the new values. The platform-neutral copy behind &#x60;GET /v1/listings/{id}?include&#x3D;amenities&#x60; uses a different amenity vocabulary and is refreshed by the next sync, except where an id happens to be identical in both. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3138
+ # @param id [String] Repull listing id (numeric string).
3139
+ # @param update_airbnb_listing_amenities_request [UpdateAirbnbListingAmenitiesRequest]
2564
3140
  # @param [Hash] opts the optional parameters
2565
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2566
- def update_airbnb_listing_availability_with_http_info(id, airbnb_availability_write_request, opts = {})
3141
+ # @return [Array<(UpdateAirbnbListingAmenities200Response, Integer, Hash)>] UpdateAirbnbListingAmenities200Response data, response status code and response headers
3142
+ def update_airbnb_listing_amenities_with_http_info(id, update_airbnb_listing_amenities_request, opts = {})
2567
3143
  if @api_client.config.debugging
2568
- @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_availability ...'
3144
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_amenities ...'
2569
3145
  end
2570
3146
  # verify the required parameter 'id' is set
2571
3147
  if @api_client.config.client_side_validation && id.nil?
2572
- fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_availability"
3148
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_amenities"
2573
3149
  end
2574
- # verify the required parameter 'airbnb_availability_write_request' is set
2575
- if @api_client.config.client_side_validation && airbnb_availability_write_request.nil?
2576
- fail ArgumentError, "Missing the required parameter 'airbnb_availability_write_request' when calling AirbnbApi.update_airbnb_listing_availability"
3150
+ # verify the required parameter 'update_airbnb_listing_amenities_request' is set
3151
+ if @api_client.config.client_side_validation && update_airbnb_listing_amenities_request.nil?
3152
+ fail ArgumentError, "Missing the required parameter 'update_airbnb_listing_amenities_request' when calling AirbnbApi.update_airbnb_listing_amenities"
2577
3153
  end
2578
3154
  # resource path
2579
- local_var_path = '/v1/channels/airbnb/listings/{id}/availability'.sub('{id}', CGI.escape(id.to_s))
3155
+ local_var_path = '/v1/channels/airbnb/listings/{id}/amenities'.sub('{id}', CGI.escape(id.to_s))
2580
3156
 
2581
3157
  # query parameters
2582
3158
  query_params = opts[:query_params] || {}
@@ -2595,16 +3171,16 @@ module Repull
2595
3171
  form_params = opts[:form_params] || {}
2596
3172
 
2597
3173
  # http body (model)
2598
- post_body = opts[:debug_body] || @api_client.object_to_http_body(airbnb_availability_write_request)
3174
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_airbnb_listing_amenities_request)
2599
3175
 
2600
3176
  # return_type
2601
- return_type = opts[:debug_return_type]
3177
+ return_type = opts[:debug_return_type] || 'UpdateAirbnbListingAmenities200Response'
2602
3178
 
2603
3179
  # auth_names
2604
3180
  auth_names = opts[:debug_auth_names] || ['bearerAuth']
2605
3181
 
2606
3182
  new_options = opts.merge(
2607
- :operation => :"AirbnbApi.update_airbnb_listing_availability",
3183
+ :operation => :"AirbnbApi.update_airbnb_listing_amenities",
2608
3184
  :header_params => header_params,
2609
3185
  :query_params => query_params,
2610
3186
  :form_params => form_params,
@@ -2615,15 +3191,406 @@ module Repull
2615
3191
 
2616
3192
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2617
3193
  if @api_client.config.debugging
2618
- @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3194
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_amenities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2619
3195
  end
2620
3196
  return data, status_code, headers
2621
3197
  end
2622
3198
 
2623
- # Update Airbnb pricing
2624
- # Push pricing changes to Airbnb. The `type` discriminator selects the sub-resource (model, standard settings, LOS, rate-plan, fees, currency, rule, or per-date `calendar`). `type: \"calendar\"` carries the full per-date restriction set nightly price, min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (`availability: \"unavailable\"`). For settings sub-resources the full object is replaced GET first, mutate locally, then PUT the whole object. `{id}` is the **Repull listing id** (from `GET /v1/properties` or `GET /v1/channels/airbnb/listings`), not the Airbnb listing id — Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is `422 invalid_params` naming the `field`. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a `busy_subtype` whenever `availability` is `\"unavailable\"`. If an operation leaves it out, Repull sends `busy_subtype: \"BLOCKED_BY_HOST\"`; send `\"OUTSIDE_RESERVATION\"` for dates held by a booking made on another channel. **Errors:** `403 connection_reauth_required` — Airbnb no longer accepts the connection for this listing (reconnect; retrying won't help). `403 listing_inactive` — the listing is inactive. `404 not_found` — no Airbnb-connected listing with this id in the workspace. `422 airbnb_rejected` — Airbnb refused the change; `message` carries its reason. `429 airbnb_rate_limited` — back off. `502 airbnb_error` — Airbnb outage or timeout; retry.
3199
+ # Update Airbnb availability
3200
+ # Push availability + restrictions to Airbnb. `type: \"calendar\"` writes per-date restrictions — min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (`availability: \"unavailable\"`) — via a batch of operations that each target either a date range or an explicit date list. `type: \"rules\"` writes listing-level availability rules (default min/max nights, booking lead time, turnover days, seasonal/day-of-week min nights). Restrictions never leak across channels — this endpoint writes only to Airbnb. `{id}` is the **Repull listing id** (from `GET /v1/properties` or `GET /v1/channels/airbnb/listings`), not the Airbnb listing id — Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is `422 invalid_params` naming the `field`. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a `busy_subtype` whenever `availability` is `\"unavailable\"`. If an operation leaves it out, Repull sends `busy_subtype: \"BLOCKED_BY_HOST\"`; send `\"OUTSIDE_RESERVATION\"` for dates held by a booking made on another channel. **Errors:** `403 listing_not_api_connected` — Airbnb was never told to sync this listing (its `syncCategory` is `none`); the host must switch API sync on for it in Airbnb, reconnecting the account will not help. `403 connection_reauth_required` — Airbnb no longer accepts the connection at all (reconnect; retrying won't help). `403 listing_inactive` — the listing is inactive. `404 not_found` — no Airbnb-connected listing with this id in the workspace. `422 airbnb_rejected` — Airbnb refused the change; `message` carries its reason. `429 airbnb_rate_limited` — back off. `502 airbnb_error` — Airbnb outage or timeout; retry.
2625
3201
  # @param id [String]
2626
- # @param airbnb_pricing_write_request [AirbnbPricingWriteRequest]
3202
+ # @param airbnb_availability_write_request [AirbnbAvailabilityWriteRequest]
3203
+ # @param [Hash] opts the optional parameters
3204
+ # @return [nil]
3205
+ def update_airbnb_listing_availability(id, airbnb_availability_write_request, opts = {})
3206
+ update_airbnb_listing_availability_with_http_info(id, airbnb_availability_write_request, opts)
3207
+ nil
3208
+ end
3209
+
3210
+ # Update Airbnb availability
3211
+ # Push availability + restrictions to Airbnb. &#x60;type: \&quot;calendar\&quot;&#x60; writes per-date restrictions — min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (&#x60;availability: \&quot;unavailable\&quot;&#x60;) — via a batch of operations that each target either a date range or an explicit date list. &#x60;type: \&quot;rules\&quot;&#x60; writes listing-level availability rules (default min/max nights, booking lead time, turnover days, seasonal/day-of-week min nights). Restrictions never leak across channels — this endpoint writes only to Airbnb. &#x60;{id}&#x60; is the **Repull listing id** (from &#x60;GET /v1/properties&#x60; or &#x60;GET /v1/channels/airbnb/listings&#x60;), not the Airbnb listing id — Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is &#x60;422 invalid_params&#x60; naming the &#x60;field&#x60;. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a &#x60;busy_subtype&#x60; whenever &#x60;availability&#x60; is &#x60;\&quot;unavailable\&quot;&#x60;. If an operation leaves it out, Repull sends &#x60;busy_subtype: \&quot;BLOCKED_BY_HOST\&quot;&#x60;; send &#x60;\&quot;OUTSIDE_RESERVATION\&quot;&#x60; for dates held by a booking made on another channel. **Errors:** &#x60;403 listing_not_api_connected&#x60; — Airbnb was never told to sync this listing (its &#x60;syncCategory&#x60; is &#x60;none&#x60;); the host must switch API sync on for it in Airbnb, reconnecting the account will not help. &#x60;403 connection_reauth_required&#x60; — Airbnb no longer accepts the connection at all (reconnect; retrying won&#39;t help). &#x60;403 listing_inactive&#x60; — the listing is inactive. &#x60;404 not_found&#x60; — no Airbnb-connected listing with this id in the workspace. &#x60;422 airbnb_rejected&#x60; — Airbnb refused the change; &#x60;message&#x60; carries its reason. &#x60;429 airbnb_rate_limited&#x60; — back off. &#x60;502 airbnb_error&#x60; — Airbnb outage or timeout; retry.
3212
+ # @param id [String]
3213
+ # @param airbnb_availability_write_request [AirbnbAvailabilityWriteRequest]
3214
+ # @param [Hash] opts the optional parameters
3215
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
3216
+ def update_airbnb_listing_availability_with_http_info(id, airbnb_availability_write_request, opts = {})
3217
+ if @api_client.config.debugging
3218
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_availability ...'
3219
+ end
3220
+ # verify the required parameter 'id' is set
3221
+ if @api_client.config.client_side_validation && id.nil?
3222
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_availability"
3223
+ end
3224
+ # verify the required parameter 'airbnb_availability_write_request' is set
3225
+ if @api_client.config.client_side_validation && airbnb_availability_write_request.nil?
3226
+ fail ArgumentError, "Missing the required parameter 'airbnb_availability_write_request' when calling AirbnbApi.update_airbnb_listing_availability"
3227
+ end
3228
+ # resource path
3229
+ local_var_path = '/v1/channels/airbnb/listings/{id}/availability'.sub('{id}', CGI.escape(id.to_s))
3230
+
3231
+ # query parameters
3232
+ query_params = opts[:query_params] || {}
3233
+
3234
+ # header parameters
3235
+ header_params = opts[:header_params] || {}
3236
+ # HTTP header 'Accept' (if needed)
3237
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3238
+ # HTTP header 'Content-Type'
3239
+ content_type = @api_client.select_header_content_type(['application/json'])
3240
+ if !content_type.nil?
3241
+ header_params['Content-Type'] = content_type
3242
+ end
3243
+
3244
+ # form parameters
3245
+ form_params = opts[:form_params] || {}
3246
+
3247
+ # http body (model)
3248
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(airbnb_availability_write_request)
3249
+
3250
+ # return_type
3251
+ return_type = opts[:debug_return_type]
3252
+
3253
+ # auth_names
3254
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3255
+
3256
+ new_options = opts.merge(
3257
+ :operation => :"AirbnbApi.update_airbnb_listing_availability",
3258
+ :header_params => header_params,
3259
+ :query_params => query_params,
3260
+ :form_params => form_params,
3261
+ :body => post_body,
3262
+ :auth_names => auth_names,
3263
+ :return_type => return_type
3264
+ )
3265
+
3266
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3267
+ if @api_client.config.debugging
3268
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3269
+ end
3270
+ return data, status_code, headers
3271
+ end
3272
+
3273
+ # Update an Airbnb description for one locale
3274
+ # Write one locale's copy to the live Airbnb listing. Airbnb keeps a SEPARATE description per locale (`PUT /v2/listing_descriptions/{listingId}/{locale}`), which is why `locale` is part of the request and not a guess: a listing can carry twelve of them, and writing Italian copy into the English row is how a translation gets lost. Only the fields you send are written; Airbnb keeps the rest. `GET /v1/channels/airbnb/listings/{id}/settings?type=locales` lists the locales already synced for the listing. `description` is not an accepted field: Airbnb composes the public description from the sections (`summary`, `space`, `access`, …) and ignores a directly-supplied one. **A 200 does not by itself mean the change was applied.** On an established listing Airbnb LOCKS host-managed description fields — the write returns 200, reports them as locked, and applies nothing for them. The response reports `blockedFields`: the fields YOU sent that Airbnb dropped. `blockedFields: []` is what a landed write looks like; a non-empty list is still a 200 (the other fields really were written) with a `message` naming what was not. Reporting that as a clean success is the bug behind \"the description does not push to Airbnb\". This writes to AIRBNB. To write Repull's own canonical copy — the content a later publish distributes — use `PUT /v1/listings/{id}/content` with `locale`. Send `Idempotency-Key` to make a retry safe. Returns `403 listing_inactive` when the listing is inactive.
3275
+ # @param id [String] Repull listing id (numeric string).
3276
+ # @param airbnb_description_write_request [AirbnbDescriptionWriteRequest]
3277
+ # @param [Hash] opts the optional parameters
3278
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3279
+ # @return [AirbnbContentWriteResponse]
3280
+ def update_airbnb_listing_description(id, airbnb_description_write_request, opts = {})
3281
+ data, _status_code, _headers = update_airbnb_listing_description_with_http_info(id, airbnb_description_write_request, opts)
3282
+ data
3283
+ end
3284
+
3285
+ # Update an Airbnb description for one locale
3286
+ # Write one locale&#39;s copy to the live Airbnb listing. Airbnb keeps a SEPARATE description per locale (&#x60;PUT /v2/listing_descriptions/{listingId}/{locale}&#x60;), which is why &#x60;locale&#x60; is part of the request and not a guess: a listing can carry twelve of them, and writing Italian copy into the English row is how a translation gets lost. Only the fields you send are written; Airbnb keeps the rest. &#x60;GET /v1/channels/airbnb/listings/{id}/settings?type&#x3D;locales&#x60; lists the locales already synced for the listing. &#x60;description&#x60; is not an accepted field: Airbnb composes the public description from the sections (&#x60;summary&#x60;, &#x60;space&#x60;, &#x60;access&#x60;, …) and ignores a directly-supplied one. **A 200 does not by itself mean the change was applied.** On an established listing Airbnb LOCKS host-managed description fields — the write returns 200, reports them as locked, and applies nothing for them. The response reports &#x60;blockedFields&#x60;: the fields YOU sent that Airbnb dropped. &#x60;blockedFields: []&#x60; is what a landed write looks like; a non-empty list is still a 200 (the other fields really were written) with a &#x60;message&#x60; naming what was not. Reporting that as a clean success is the bug behind \&quot;the description does not push to Airbnb\&quot;. This writes to AIRBNB. To write Repull&#39;s own canonical copy — the content a later publish distributes — use &#x60;PUT /v1/listings/{id}/content&#x60; with &#x60;locale&#x60;. Send &#x60;Idempotency-Key&#x60; to make a retry safe. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive.
3287
+ # @param id [String] Repull listing id (numeric string).
3288
+ # @param airbnb_description_write_request [AirbnbDescriptionWriteRequest]
3289
+ # @param [Hash] opts the optional parameters
3290
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3291
+ # @return [Array<(AirbnbContentWriteResponse, Integer, Hash)>] AirbnbContentWriteResponse data, response status code and response headers
3292
+ def update_airbnb_listing_description_with_http_info(id, airbnb_description_write_request, opts = {})
3293
+ if @api_client.config.debugging
3294
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_description ...'
3295
+ end
3296
+ # verify the required parameter 'id' is set
3297
+ if @api_client.config.client_side_validation && id.nil?
3298
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_description"
3299
+ end
3300
+ # verify the required parameter 'airbnb_description_write_request' is set
3301
+ if @api_client.config.client_side_validation && airbnb_description_write_request.nil?
3302
+ fail ArgumentError, "Missing the required parameter 'airbnb_description_write_request' when calling AirbnbApi.update_airbnb_listing_description"
3303
+ end
3304
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
3305
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AirbnbApi.update_airbnb_listing_description, the character length must be smaller than or equal to 255.'
3306
+ end
3307
+
3308
+ # resource path
3309
+ local_var_path = '/v1/channels/airbnb/listings/{id}/descriptions'.sub('{id}', CGI.escape(id.to_s))
3310
+
3311
+ # query parameters
3312
+ query_params = opts[:query_params] || {}
3313
+
3314
+ # header parameters
3315
+ header_params = opts[:header_params] || {}
3316
+ # HTTP header 'Accept' (if needed)
3317
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3318
+ # HTTP header 'Content-Type'
3319
+ content_type = @api_client.select_header_content_type(['application/json'])
3320
+ if !content_type.nil?
3321
+ header_params['Content-Type'] = content_type
3322
+ end
3323
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
3324
+
3325
+ # form parameters
3326
+ form_params = opts[:form_params] || {}
3327
+
3328
+ # http body (model)
3329
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(airbnb_description_write_request)
3330
+
3331
+ # return_type
3332
+ return_type = opts[:debug_return_type] || 'AirbnbContentWriteResponse'
3333
+
3334
+ # auth_names
3335
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3336
+
3337
+ new_options = opts.merge(
3338
+ :operation => :"AirbnbApi.update_airbnb_listing_description",
3339
+ :header_params => header_params,
3340
+ :query_params => query_params,
3341
+ :form_params => form_params,
3342
+ :body => post_body,
3343
+ :auth_names => auth_names,
3344
+ :return_type => return_type
3345
+ )
3346
+
3347
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3348
+ if @api_client.config.debugging
3349
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_description\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3350
+ end
3351
+ return data, status_code, headers
3352
+ end
3353
+
3354
+ # Update property type, room type, quiet hours or check-in method
3355
+ # Change what kind of property the Airbnb listing is, when its quiet hours are, or how the guest gets in. Partial: only the fields you send are written. At least one required; an unknown field is refused by name rather than dropped. This is the UPDATE path for fields that previously had none. `POST /v1/listings` accepts a `propertyType` when a listing is CREATED and nothing could change it afterwards, so a listing mis-typed at import stayed mis-typed; the check-in method was mirrored and never exposed at all. **A 200 does not by itself mean the change was applied.** `property_type_category`, `property_type_group` and `check_in_option` are among the attributes Airbnb locks on established listings: the write returns 200, and Airbnb applies nothing for the locked ones. The response reports `blockedFields` — the fields YOU sent that Airbnb dropped — and `blockedFields: []` is what a landed write looks like. `GET …/details` reports the same list as `lockedFields` so you can check first. Canonical property type (the value Repull keeps and republishes) is set with `PUT /v1/listings/{id}/content` under `details`; this endpoint writes straight to Airbnb. Send `Idempotency-Key` to make a retry safe.
3356
+ # @param id [String] Repull listing id (numeric string).
3357
+ # @param airbnb_listing_details_write_request [AirbnbListingDetailsWriteRequest]
3358
+ # @param [Hash] opts the optional parameters
3359
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3360
+ # @return [AirbnbContentWriteResponse]
3361
+ def update_airbnb_listing_details(id, airbnb_listing_details_write_request, opts = {})
3362
+ data, _status_code, _headers = update_airbnb_listing_details_with_http_info(id, airbnb_listing_details_write_request, opts)
3363
+ data
3364
+ end
3365
+
3366
+ # Update property type, room type, quiet hours or check-in method
3367
+ # Change what kind of property the Airbnb listing is, when its quiet hours are, or how the guest gets in. Partial: only the fields you send are written. At least one required; an unknown field is refused by name rather than dropped. This is the UPDATE path for fields that previously had none. &#x60;POST /v1/listings&#x60; accepts a &#x60;propertyType&#x60; when a listing is CREATED and nothing could change it afterwards, so a listing mis-typed at import stayed mis-typed; the check-in method was mirrored and never exposed at all. **A 200 does not by itself mean the change was applied.** &#x60;property_type_category&#x60;, &#x60;property_type_group&#x60; and &#x60;check_in_option&#x60; are among the attributes Airbnb locks on established listings: the write returns 200, and Airbnb applies nothing for the locked ones. The response reports &#x60;blockedFields&#x60; — the fields YOU sent that Airbnb dropped — and &#x60;blockedFields: []&#x60; is what a landed write looks like. &#x60;GET …/details&#x60; reports the same list as &#x60;lockedFields&#x60; so you can check first. Canonical property type (the value Repull keeps and republishes) is set with &#x60;PUT /v1/listings/{id}/content&#x60; under &#x60;details&#x60;; this endpoint writes straight to Airbnb. Send &#x60;Idempotency-Key&#x60; to make a retry safe.
3368
+ # @param id [String] Repull listing id (numeric string).
3369
+ # @param airbnb_listing_details_write_request [AirbnbListingDetailsWriteRequest]
3370
+ # @param [Hash] opts the optional parameters
3371
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3372
+ # @return [Array<(AirbnbContentWriteResponse, Integer, Hash)>] AirbnbContentWriteResponse data, response status code and response headers
3373
+ def update_airbnb_listing_details_with_http_info(id, airbnb_listing_details_write_request, opts = {})
3374
+ if @api_client.config.debugging
3375
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_details ...'
3376
+ end
3377
+ # verify the required parameter 'id' is set
3378
+ if @api_client.config.client_side_validation && id.nil?
3379
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_details"
3380
+ end
3381
+ # verify the required parameter 'airbnb_listing_details_write_request' is set
3382
+ if @api_client.config.client_side_validation && airbnb_listing_details_write_request.nil?
3383
+ fail ArgumentError, "Missing the required parameter 'airbnb_listing_details_write_request' when calling AirbnbApi.update_airbnb_listing_details"
3384
+ end
3385
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
3386
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AirbnbApi.update_airbnb_listing_details, the character length must be smaller than or equal to 255.'
3387
+ end
3388
+
3389
+ # resource path
3390
+ local_var_path = '/v1/channels/airbnb/listings/{id}/details'.sub('{id}', CGI.escape(id.to_s))
3391
+
3392
+ # query parameters
3393
+ query_params = opts[:query_params] || {}
3394
+
3395
+ # header parameters
3396
+ header_params = opts[:header_params] || {}
3397
+ # HTTP header 'Accept' (if needed)
3398
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3399
+ # HTTP header 'Content-Type'
3400
+ content_type = @api_client.select_header_content_type(['application/json'])
3401
+ if !content_type.nil?
3402
+ header_params['Content-Type'] = content_type
3403
+ end
3404
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
3405
+
3406
+ # form parameters
3407
+ form_params = opts[:form_params] || {}
3408
+
3409
+ # http body (model)
3410
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(airbnb_listing_details_write_request)
3411
+
3412
+ # return_type
3413
+ return_type = opts[:debug_return_type] || 'AirbnbContentWriteResponse'
3414
+
3415
+ # auth_names
3416
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3417
+
3418
+ new_options = opts.merge(
3419
+ :operation => :"AirbnbApi.update_airbnb_listing_details",
3420
+ :header_params => header_params,
3421
+ :query_params => query_params,
3422
+ :form_params => form_params,
3423
+ :body => post_body,
3424
+ :auth_names => auth_names,
3425
+ :return_type => return_type
3426
+ )
3427
+
3428
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3429
+ if @api_client.config.debugging
3430
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3431
+ end
3432
+ return data, status_code, headers
3433
+ end
3434
+
3435
+ # Answer Airbnb permit questions
3436
+ # Answer the regulatory permit questions for a listing — the licence or registration number a city requires to keep the listing up. Read the questions first with `GET …/permits?source=live`: every answer is keyed by a `question_key` Airbnb asks for THIS listing, and the question's `answer_type` decides which value field applies (`text_value`, `date_value`, or `selected_options_value`). Answers are forwarded verbatim — nothing is defaulted or inferred, because a wrong licence number can take a listing down in a regulated city. Send `Idempotency-Key`: a timeout here leaves you unable to tell \"never arrived\" from \"arrived, response lost\", and this is a compliance filing. Airbnb refusing the answers (an unknown question key, a malformed licence number) is `422 airbnb_rejected` carrying Airbnb's own reason. An expired or revoked Airbnb connection is `403 connection_reauth_required`.
3437
+ # @param id [String] Repull listing id (numeric string).
3438
+ # @param airbnb_permits_write_request [AirbnbPermitsWriteRequest]
3439
+ # @param [Hash] opts the optional parameters
3440
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3441
+ # @return [UpdateAirbnbListingPermits200Response]
3442
+ def update_airbnb_listing_permits(id, airbnb_permits_write_request, opts = {})
3443
+ data, _status_code, _headers = update_airbnb_listing_permits_with_http_info(id, airbnb_permits_write_request, opts)
3444
+ data
3445
+ end
3446
+
3447
+ # Answer Airbnb permit questions
3448
+ # Answer the regulatory permit questions for a listing — the licence or registration number a city requires to keep the listing up. Read the questions first with &#x60;GET …/permits?source&#x3D;live&#x60;: every answer is keyed by a &#x60;question_key&#x60; Airbnb asks for THIS listing, and the question&#39;s &#x60;answer_type&#x60; decides which value field applies (&#x60;text_value&#x60;, &#x60;date_value&#x60;, or &#x60;selected_options_value&#x60;). Answers are forwarded verbatim — nothing is defaulted or inferred, because a wrong licence number can take a listing down in a regulated city. Send &#x60;Idempotency-Key&#x60;: a timeout here leaves you unable to tell \&quot;never arrived\&quot; from \&quot;arrived, response lost\&quot;, and this is a compliance filing. Airbnb refusing the answers (an unknown question key, a malformed licence number) is &#x60;422 airbnb_rejected&#x60; carrying Airbnb&#39;s own reason. An expired or revoked Airbnb connection is &#x60;403 connection_reauth_required&#x60;.
3449
+ # @param id [String] Repull listing id (numeric string).
3450
+ # @param airbnb_permits_write_request [AirbnbPermitsWriteRequest]
3451
+ # @param [Hash] opts the optional parameters
3452
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3453
+ # @return [Array<(UpdateAirbnbListingPermits200Response, Integer, Hash)>] UpdateAirbnbListingPermits200Response data, response status code and response headers
3454
+ def update_airbnb_listing_permits_with_http_info(id, airbnb_permits_write_request, opts = {})
3455
+ if @api_client.config.debugging
3456
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_permits ...'
3457
+ end
3458
+ # verify the required parameter 'id' is set
3459
+ if @api_client.config.client_side_validation && id.nil?
3460
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_permits"
3461
+ end
3462
+ # verify the required parameter 'airbnb_permits_write_request' is set
3463
+ if @api_client.config.client_side_validation && airbnb_permits_write_request.nil?
3464
+ fail ArgumentError, "Missing the required parameter 'airbnb_permits_write_request' when calling AirbnbApi.update_airbnb_listing_permits"
3465
+ end
3466
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
3467
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AirbnbApi.update_airbnb_listing_permits, the character length must be smaller than or equal to 255.'
3468
+ end
3469
+
3470
+ # resource path
3471
+ local_var_path = '/v1/channels/airbnb/listings/{id}/permits'.sub('{id}', CGI.escape(id.to_s))
3472
+
3473
+ # query parameters
3474
+ query_params = opts[:query_params] || {}
3475
+
3476
+ # header parameters
3477
+ header_params = opts[:header_params] || {}
3478
+ # HTTP header 'Accept' (if needed)
3479
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3480
+ # HTTP header 'Content-Type'
3481
+ content_type = @api_client.select_header_content_type(['application/json'])
3482
+ if !content_type.nil?
3483
+ header_params['Content-Type'] = content_type
3484
+ end
3485
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
3486
+
3487
+ # form parameters
3488
+ form_params = opts[:form_params] || {}
3489
+
3490
+ # http body (model)
3491
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(airbnb_permits_write_request)
3492
+
3493
+ # return_type
3494
+ return_type = opts[:debug_return_type] || 'UpdateAirbnbListingPermits200Response'
3495
+
3496
+ # auth_names
3497
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3498
+
3499
+ new_options = opts.merge(
3500
+ :operation => :"AirbnbApi.update_airbnb_listing_permits",
3501
+ :header_params => header_params,
3502
+ :query_params => query_params,
3503
+ :form_params => form_params,
3504
+ :body => post_body,
3505
+ :auth_names => auth_names,
3506
+ :return_type => return_type
3507
+ )
3508
+
3509
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3510
+ if @api_client.config.debugging
3511
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_permits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3512
+ end
3513
+ return data, status_code, headers
3514
+ end
3515
+
3516
+ # Update an Airbnb photo
3517
+ # Change one photo's caption, its position in the tour, the room it is filed under, or its metadata. **Write-side** — calls Airbnb upstream. Airbnb's photo endpoints are keyed by photo id alone, so the photo is proven to belong to the listing named in the path before anything is sent; a photo from another listing returns `404`, the same answer a photo that does not exist gets. On success both stored copies are updated — the Airbnb mirror `GET /photos` serves AND the canonical photo tour behind `GET /v1/listings/{id}` — so a read straight after this write returns the new value instead of waiting for the next sync. `stored` says whether that succeeded; `false` means Airbnb accepted the change but our copy will only catch up at the next sync. To move several photos at once use `PUT /photos/order`: it is one call instead of N, it validates the whole order before writing anything, and it reports exactly what landed if Airbnb refuses part-way. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3518
+ # @param id [String] Repull listing id (numeric string).
3519
+ # @param update_airbnb_listing_photo_request [UpdateAirbnbListingPhotoRequest]
3520
+ # @param [Hash] opts the optional parameters
3521
+ # @return [UpdateAirbnbListingPhoto200Response]
3522
+ def update_airbnb_listing_photo(id, update_airbnb_listing_photo_request, opts = {})
3523
+ data, _status_code, _headers = update_airbnb_listing_photo_with_http_info(id, update_airbnb_listing_photo_request, opts)
3524
+ data
3525
+ end
3526
+
3527
+ # Update an Airbnb photo
3528
+ # Change one photo&#39;s caption, its position in the tour, the room it is filed under, or its metadata. **Write-side** — calls Airbnb upstream. Airbnb&#39;s photo endpoints are keyed by photo id alone, so the photo is proven to belong to the listing named in the path before anything is sent; a photo from another listing returns &#x60;404&#x60;, the same answer a photo that does not exist gets. On success both stored copies are updated — the Airbnb mirror &#x60;GET /photos&#x60; serves AND the canonical photo tour behind &#x60;GET /v1/listings/{id}&#x60; — so a read straight after this write returns the new value instead of waiting for the next sync. &#x60;stored&#x60; says whether that succeeded; &#x60;false&#x60; means Airbnb accepted the change but our copy will only catch up at the next sync. To move several photos at once use &#x60;PUT /photos/order&#x60;: it is one call instead of N, it validates the whole order before writing anything, and it reports exactly what landed if Airbnb refuses part-way. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3529
+ # @param id [String] Repull listing id (numeric string).
3530
+ # @param update_airbnb_listing_photo_request [UpdateAirbnbListingPhotoRequest]
3531
+ # @param [Hash] opts the optional parameters
3532
+ # @return [Array<(UpdateAirbnbListingPhoto200Response, Integer, Hash)>] UpdateAirbnbListingPhoto200Response data, response status code and response headers
3533
+ def update_airbnb_listing_photo_with_http_info(id, update_airbnb_listing_photo_request, opts = {})
3534
+ if @api_client.config.debugging
3535
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_photo ...'
3536
+ end
3537
+ # verify the required parameter 'id' is set
3538
+ if @api_client.config.client_side_validation && id.nil?
3539
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_photo"
3540
+ end
3541
+ # verify the required parameter 'update_airbnb_listing_photo_request' is set
3542
+ if @api_client.config.client_side_validation && update_airbnb_listing_photo_request.nil?
3543
+ fail ArgumentError, "Missing the required parameter 'update_airbnb_listing_photo_request' when calling AirbnbApi.update_airbnb_listing_photo"
3544
+ end
3545
+ # resource path
3546
+ local_var_path = '/v1/channels/airbnb/listings/{id}/photos'.sub('{id}', CGI.escape(id.to_s))
3547
+
3548
+ # query parameters
3549
+ query_params = opts[:query_params] || {}
3550
+
3551
+ # header parameters
3552
+ header_params = opts[:header_params] || {}
3553
+ # HTTP header 'Accept' (if needed)
3554
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3555
+ # HTTP header 'Content-Type'
3556
+ content_type = @api_client.select_header_content_type(['application/json'])
3557
+ if !content_type.nil?
3558
+ header_params['Content-Type'] = content_type
3559
+ end
3560
+
3561
+ # form parameters
3562
+ form_params = opts[:form_params] || {}
3563
+
3564
+ # http body (model)
3565
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_airbnb_listing_photo_request)
3566
+
3567
+ # return_type
3568
+ return_type = opts[:debug_return_type] || 'UpdateAirbnbListingPhoto200Response'
3569
+
3570
+ # auth_names
3571
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3572
+
3573
+ new_options = opts.merge(
3574
+ :operation => :"AirbnbApi.update_airbnb_listing_photo",
3575
+ :header_params => header_params,
3576
+ :query_params => query_params,
3577
+ :form_params => form_params,
3578
+ :body => post_body,
3579
+ :auth_names => auth_names,
3580
+ :return_type => return_type
3581
+ )
3582
+
3583
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
3584
+ if @api_client.config.debugging
3585
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3586
+ end
3587
+ return data, status_code, headers
3588
+ end
3589
+
3590
+ # Update Airbnb pricing
3591
+ # Push pricing changes to Airbnb. The `type` discriminator selects the sub-resource (model, standard settings, LOS, rate-plan, fees, currency, rule, or per-date `calendar`). `type: \"calendar\"` carries the full per-date restriction set — nightly price, min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (`availability: \"unavailable\"`). For settings sub-resources the full object is replaced — GET first, mutate locally, then PUT the whole object. `{id}` is the **Repull listing id** (from `GET /v1/properties` or `GET /v1/channels/airbnb/listings`), not the Airbnb listing id — Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is `422 invalid_params` naming the `field`. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a `busy_subtype` whenever `availability` is `\"unavailable\"`. If an operation leaves it out, Repull sends `busy_subtype: \"BLOCKED_BY_HOST\"`; send `\"OUTSIDE_RESERVATION\"` for dates held by a booking made on another channel. **Errors:** `403 listing_not_api_connected` — Airbnb was never told to sync this listing (its `syncCategory` is `none`); the host must switch API sync on for it in Airbnb, reconnecting the account will not help. `403 connection_reauth_required` — Airbnb no longer accepts the connection at all (reconnect; retrying won't help). `403 listing_inactive` — the listing is inactive. `404 not_found` — no Airbnb-connected listing with this id in the workspace. `422 airbnb_rejected` — Airbnb refused the change; `message` carries its reason. `429 airbnb_rate_limited` — back off. `502 airbnb_error` — Airbnb outage or timeout; retry.
3592
+ # @param id [String]
3593
+ # @param airbnb_pricing_write_request [AirbnbPricingWriteRequest]
2627
3594
  # @param [Hash] opts the optional parameters
2628
3595
  # @return [nil]
2629
3596
  def update_airbnb_listing_pricing(id, airbnb_pricing_write_request, opts = {})
@@ -2632,7 +3599,7 @@ module Repull
2632
3599
  end
2633
3600
 
2634
3601
  # Update Airbnb pricing
2635
- # Push pricing changes to Airbnb. The &#x60;type&#x60; discriminator selects the sub-resource (model, standard settings, LOS, rate-plan, fees, currency, rule, or per-date &#x60;calendar&#x60;). &#x60;type: \&quot;calendar\&quot;&#x60; carries the full per-date restriction set — nightly price, min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (&#x60;availability: \&quot;unavailable\&quot;&#x60;). For settings sub-resources the full object is replaced — GET first, mutate locally, then PUT the whole object. &#x60;{id}&#x60; is the **Repull listing id** (from &#x60;GET /v1/properties&#x60; or &#x60;GET /v1/channels/airbnb/listings&#x60;), not the Airbnb listing id — Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is &#x60;422 invalid_params&#x60; naming the &#x60;field&#x60;. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a &#x60;busy_subtype&#x60; whenever &#x60;availability&#x60; is &#x60;\&quot;unavailable\&quot;&#x60;. If an operation leaves it out, Repull sends &#x60;busy_subtype: \&quot;BLOCKED_BY_HOST\&quot;&#x60;; send &#x60;\&quot;OUTSIDE_RESERVATION\&quot;&#x60; for dates held by a booking made on another channel. **Errors:** &#x60;403 connection_reauth_required&#x60; — Airbnb no longer accepts the connection for this listing (reconnect; retrying won&#39;t help). &#x60;403 listing_inactive&#x60; — the listing is inactive. &#x60;404 not_found&#x60; — no Airbnb-connected listing with this id in the workspace. &#x60;422 airbnb_rejected&#x60; — Airbnb refused the change; &#x60;message&#x60; carries its reason. &#x60;429 airbnb_rate_limited&#x60; — back off. &#x60;502 airbnb_error&#x60; — Airbnb outage or timeout; retry.
3602
+ # Push pricing changes to Airbnb. The &#x60;type&#x60; discriminator selects the sub-resource (model, standard settings, LOS, rate-plan, fees, currency, rule, or per-date &#x60;calendar&#x60;). &#x60;type: \&quot;calendar\&quot;&#x60; carries the full per-date restriction set — nightly price, min/max nights, closed-to-arrival, closed-to-departure, and stop-sell (&#x60;availability: \&quot;unavailable\&quot;&#x60;). For settings sub-resources the full object is replaced — GET first, mutate locally, then PUT the whole object. &#x60;{id}&#x60; is the **Repull listing id** (from &#x60;GET /v1/properties&#x60; or &#x60;GET /v1/channels/airbnb/listings&#x60;), not the Airbnb listing id — Repull translates it before calling Airbnb. The body is validated before anything reaches Airbnb: a malformed body is &#x60;422 invalid_params&#x60; naming the &#x60;field&#x60;. Calendar operations accept only the documented fields. **Blocking dates:** Airbnb requires a &#x60;busy_subtype&#x60; whenever &#x60;availability&#x60; is &#x60;\&quot;unavailable\&quot;&#x60;. If an operation leaves it out, Repull sends &#x60;busy_subtype: \&quot;BLOCKED_BY_HOST\&quot;&#x60;; send &#x60;\&quot;OUTSIDE_RESERVATION\&quot;&#x60; for dates held by a booking made on another channel. **Errors:** &#x60;403 listing_not_api_connected&#x60; — Airbnb was never told to sync this listing (its &#x60;syncCategory&#x60; is &#x60;none&#x60;); the host must switch API sync on for it in Airbnb, reconnecting the account will not help. &#x60;403 connection_reauth_required&#x60; — Airbnb no longer accepts the connection at all (reconnect; retrying won&#39;t help). &#x60;403 listing_inactive&#x60; — the listing is inactive. &#x60;404 not_found&#x60; — no Airbnb-connected listing with this id in the workspace. &#x60;422 airbnb_rejected&#x60; — Airbnb refused the change; &#x60;message&#x60; carries its reason. &#x60;429 airbnb_rate_limited&#x60; — back off. &#x60;502 airbnb_error&#x60; — Airbnb outage or timeout; retry.
2636
3603
  # @param id [String]
2637
3604
  # @param airbnb_pricing_write_request [AirbnbPricingWriteRequest]
2638
3605
  # @param [Hash] opts the optional parameters
@@ -2694,6 +3661,168 @@ module Repull
2694
3661
  return data, status_code, headers
2695
3662
  end
2696
3663
 
3664
+ # Update an Airbnb room
3665
+ # Change a room's type, number, privacy or sleeping arrangement. **Write-side** — calls Airbnb upstream. Pass the Airbnb-side room id as `?roomId=` and send only the fields you want to change. `beds` REPLACES the room's whole arrangement — that is Airbnb's semantics for the field — so send every bed the room has, not just the changed one. Airbnb's room endpoints are keyed by room id alone, so the room is proven to belong to the listing named in the path before anything is sent; a room from another listing returns `404`, the same answer a room that does not exist gets. On success both stored copies are rebuilt to match, so a read straight after this write returns the new arrangement. `stored` says whether that succeeded. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3666
+ # @param id [String] Repull listing id (numeric string).
3667
+ # @param room_id [String] Airbnb-side room id to update.
3668
+ # @param update_airbnb_listing_room_request [UpdateAirbnbListingRoomRequest]
3669
+ # @param [Hash] opts the optional parameters
3670
+ # @return [UpdateAirbnbListingRoom200Response]
3671
+ def update_airbnb_listing_room(id, room_id, update_airbnb_listing_room_request, opts = {})
3672
+ data, _status_code, _headers = update_airbnb_listing_room_with_http_info(id, room_id, update_airbnb_listing_room_request, opts)
3673
+ data
3674
+ end
3675
+
3676
+ # Update an Airbnb room
3677
+ # Change a room&#39;s type, number, privacy or sleeping arrangement. **Write-side** — calls Airbnb upstream. Pass the Airbnb-side room id as &#x60;?roomId&#x3D;&#x60; and send only the fields you want to change. &#x60;beds&#x60; REPLACES the room&#39;s whole arrangement — that is Airbnb&#39;s semantics for the field — so send every bed the room has, not just the changed one. Airbnb&#39;s room endpoints are keyed by room id alone, so the room is proven to belong to the listing named in the path before anything is sent; a room from another listing returns &#x60;404&#x60;, the same answer a room that does not exist gets. On success both stored copies are rebuilt to match, so a read straight after this write returns the new arrangement. &#x60;stored&#x60; says whether that succeeded. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3678
+ # @param id [String] Repull listing id (numeric string).
3679
+ # @param room_id [String] Airbnb-side room id to update.
3680
+ # @param update_airbnb_listing_room_request [UpdateAirbnbListingRoomRequest]
3681
+ # @param [Hash] opts the optional parameters
3682
+ # @return [Array<(UpdateAirbnbListingRoom200Response, Integer, Hash)>] UpdateAirbnbListingRoom200Response data, response status code and response headers
3683
+ def update_airbnb_listing_room_with_http_info(id, room_id, update_airbnb_listing_room_request, opts = {})
3684
+ if @api_client.config.debugging
3685
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_room ...'
3686
+ end
3687
+ # verify the required parameter 'id' is set
3688
+ if @api_client.config.client_side_validation && id.nil?
3689
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_room"
3690
+ end
3691
+ # verify the required parameter 'room_id' is set
3692
+ if @api_client.config.client_side_validation && room_id.nil?
3693
+ fail ArgumentError, "Missing the required parameter 'room_id' when calling AirbnbApi.update_airbnb_listing_room"
3694
+ end
3695
+ # verify the required parameter 'update_airbnb_listing_room_request' is set
3696
+ if @api_client.config.client_side_validation && update_airbnb_listing_room_request.nil?
3697
+ fail ArgumentError, "Missing the required parameter 'update_airbnb_listing_room_request' when calling AirbnbApi.update_airbnb_listing_room"
3698
+ end
3699
+ # resource path
3700
+ local_var_path = '/v1/channels/airbnb/listings/{id}/rooms'.sub('{id}', CGI.escape(id.to_s))
3701
+
3702
+ # query parameters
3703
+ query_params = opts[:query_params] || {}
3704
+ query_params[:'roomId'] = room_id
3705
+
3706
+ # header parameters
3707
+ header_params = opts[:header_params] || {}
3708
+ # HTTP header 'Accept' (if needed)
3709
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3710
+ # HTTP header 'Content-Type'
3711
+ content_type = @api_client.select_header_content_type(['application/json'])
3712
+ if !content_type.nil?
3713
+ header_params['Content-Type'] = content_type
3714
+ end
3715
+
3716
+ # form parameters
3717
+ form_params = opts[:form_params] || {}
3718
+
3719
+ # http body (model)
3720
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_airbnb_listing_room_request)
3721
+
3722
+ # return_type
3723
+ return_type = opts[:debug_return_type] || 'UpdateAirbnbListingRoom200Response'
3724
+
3725
+ # auth_names
3726
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3727
+
3728
+ new_options = opts.merge(
3729
+ :operation => :"AirbnbApi.update_airbnb_listing_room",
3730
+ :header_params => header_params,
3731
+ :query_params => query_params,
3732
+ :form_params => form_params,
3733
+ :body => post_body,
3734
+ :auth_names => auth_names,
3735
+ :return_type => return_type
3736
+ )
3737
+
3738
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3739
+ if @api_client.config.debugging
3740
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_room\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3741
+ end
3742
+ return data, status_code, headers
3743
+ end
3744
+
3745
+ # Update guest-safety disclosures
3746
+ # Declare or retract the guest-safety disclosures on the live Airbnb listing. **This is a MERGE, not a replacement.** Airbnb keeps one value per disclosure type: a type you leave out keeps the value it has, and to retract one you send it with `value: false`. A full replacement would let a partial request silently un-declare a security camera — a guest-safety statement, not a preference. Only the disclosures are sent upstream. The same Airbnb endpoint carries the cancellation policy and instant-book settings, and this endpoint never touches them. Send `Idempotency-Key` to make a retry safe. Airbnb refusing the change is `422 airbnb_rejected` with Airbnb's own reason; an expired or revoked connection is `403 connection_reauth_required`.
3747
+ # @param id [String] Repull listing id (numeric string).
3748
+ # @param airbnb_safety_disclosures_write_request [AirbnbSafetyDisclosuresWriteRequest]
3749
+ # @param [Hash] opts the optional parameters
3750
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3751
+ # @return [UpdateAirbnbListingSafetyDisclosures200Response]
3752
+ def update_airbnb_listing_safety_disclosures(id, airbnb_safety_disclosures_write_request, opts = {})
3753
+ data, _status_code, _headers = update_airbnb_listing_safety_disclosures_with_http_info(id, airbnb_safety_disclosures_write_request, opts)
3754
+ data
3755
+ end
3756
+
3757
+ # Update guest-safety disclosures
3758
+ # Declare or retract the guest-safety disclosures on the live Airbnb listing. **This is a MERGE, not a replacement.** Airbnb keeps one value per disclosure type: a type you leave out keeps the value it has, and to retract one you send it with &#x60;value: false&#x60;. A full replacement would let a partial request silently un-declare a security camera — a guest-safety statement, not a preference. Only the disclosures are sent upstream. The same Airbnb endpoint carries the cancellation policy and instant-book settings, and this endpoint never touches them. Send &#x60;Idempotency-Key&#x60; to make a retry safe. Airbnb refusing the change is &#x60;422 airbnb_rejected&#x60; with Airbnb&#39;s own reason; an expired or revoked connection is &#x60;403 connection_reauth_required&#x60;.
3759
+ # @param id [String] Repull listing id (numeric string).
3760
+ # @param airbnb_safety_disclosures_write_request [AirbnbSafetyDisclosuresWriteRequest]
3761
+ # @param [Hash] opts the optional parameters
3762
+ # @option opts [String] :idempotency_key Makes a retry of this request safe. Send a unique string (a UUID generated at the point you build the request) and the response is stored for 24 hours: a repeat with the SAME key replays that stored response — tagged &#x60;Idempotency-Status: cached&#x60; — without running the operation again, so no duplicate reservation, guest or guest message is created. - Same key while the first request is still in flight → &#x60;409 idempotency_key_in_use&#x60;. - Same key with a DIFFERENT payload → &#x60;422 idempotency_key_reused&#x60;. Generate a new key per distinct request; reuse one only when retrying that exact request. - Responses with status &gt;&#x3D; 500 are deliberately not stored, so a server error stays retryable.
3763
+ # @return [Array<(UpdateAirbnbListingSafetyDisclosures200Response, Integer, Hash)>] UpdateAirbnbListingSafetyDisclosures200Response data, response status code and response headers
3764
+ def update_airbnb_listing_safety_disclosures_with_http_info(id, airbnb_safety_disclosures_write_request, opts = {})
3765
+ if @api_client.config.debugging
3766
+ @api_client.config.logger.debug 'Calling API: AirbnbApi.update_airbnb_listing_safety_disclosures ...'
3767
+ end
3768
+ # verify the required parameter 'id' is set
3769
+ if @api_client.config.client_side_validation && id.nil?
3770
+ fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.update_airbnb_listing_safety_disclosures"
3771
+ end
3772
+ # verify the required parameter 'airbnb_safety_disclosures_write_request' is set
3773
+ if @api_client.config.client_side_validation && airbnb_safety_disclosures_write_request.nil?
3774
+ fail ArgumentError, "Missing the required parameter 'airbnb_safety_disclosures_write_request' when calling AirbnbApi.update_airbnb_listing_safety_disclosures"
3775
+ end
3776
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
3777
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling AirbnbApi.update_airbnb_listing_safety_disclosures, the character length must be smaller than or equal to 255.'
3778
+ end
3779
+
3780
+ # resource path
3781
+ local_var_path = '/v1/channels/airbnb/listings/{id}/safety-disclosures'.sub('{id}', CGI.escape(id.to_s))
3782
+
3783
+ # query parameters
3784
+ query_params = opts[:query_params] || {}
3785
+
3786
+ # header parameters
3787
+ header_params = opts[:header_params] || {}
3788
+ # HTTP header 'Accept' (if needed)
3789
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3790
+ # HTTP header 'Content-Type'
3791
+ content_type = @api_client.select_header_content_type(['application/json'])
3792
+ if !content_type.nil?
3793
+ header_params['Content-Type'] = content_type
3794
+ end
3795
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
3796
+
3797
+ # form parameters
3798
+ form_params = opts[:form_params] || {}
3799
+
3800
+ # http body (model)
3801
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(airbnb_safety_disclosures_write_request)
3802
+
3803
+ # return_type
3804
+ return_type = opts[:debug_return_type] || 'UpdateAirbnbListingSafetyDisclosures200Response'
3805
+
3806
+ # auth_names
3807
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
3808
+
3809
+ new_options = opts.merge(
3810
+ :operation => :"AirbnbApi.update_airbnb_listing_safety_disclosures",
3811
+ :header_params => header_params,
3812
+ :query_params => query_params,
3813
+ :form_params => form_params,
3814
+ :body => post_body,
3815
+ :auth_names => auth_names,
3816
+ :return_type => return_type
3817
+ )
3818
+
3819
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
3820
+ if @api_client.config.debugging
3821
+ @api_client.config.logger.debug "API called: AirbnbApi#update_airbnb_listing_safety_disclosures\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3822
+ end
3823
+ return data, status_code, headers
3824
+ end
3825
+
2697
3826
  # Edit / react to / mark an Airbnb message
2698
3827
  # Act on a single message in an Airbnb thread. **Write-side** — calls Airbnb upstream. The `action` discriminator selects the operation: - `edit` — replace message text (requires `message`). - `unsend` — retract the message. - `read` — mark the message as read. - `react` — add a reaction (requires `reaction`). Requires a connected Airbnb host, else `404 no_connection`. Returns `403 listing_inactive` when the listing this resolves to is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2699
3828
  # @param thread_id [String] Airbnb thread id.
@@ -2775,21 +3904,23 @@ module Repull
2775
3904
  end
2776
3905
 
2777
3906
  # Upload photos to Airbnb
2778
- # Upload one or more photos to an Airbnb listing. Accepts public image URLs (Airbnb fetches them) direct binary upload is not supported on this endpoint. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3907
+ # Upload one or more photos to an Airbnb listing. `image` is base64 image DATA, not a url — a `data:image/jpeg;base64,…` prefix is accepted and stripped, and the decoded image must be under 25 MB. (This operation previously documented public image urls that Airbnb would fetch. It never did: a url arrived at Airbnb as a ~60-byte image.) Airbnb assigns the photo id and CDN urls, so the newly uploaded photos appear in `GET /photos` after the next sync. Caption, order and room assignment can be set straight away with `PATCH /photos`, `PUT /photos/order` and `PUT /photos/cover`. Returns `403 listing_inactive` when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2779
3908
  # @param id [String]
3909
+ # @param upload_airbnb_listing_photos_request [UploadAirbnbListingPhotosRequest]
2780
3910
  # @param [Hash] opts the optional parameters
2781
3911
  # @return [nil]
2782
- def upload_airbnb_listing_photos(id, opts = {})
2783
- upload_airbnb_listing_photos_with_http_info(id, opts)
3912
+ def upload_airbnb_listing_photos(id, upload_airbnb_listing_photos_request, opts = {})
3913
+ upload_airbnb_listing_photos_with_http_info(id, upload_airbnb_listing_photos_request, opts)
2784
3914
  nil
2785
3915
  end
2786
3916
 
2787
3917
  # Upload photos to Airbnb
2788
- # Upload one or more photos to an Airbnb listing. Accepts public image URLs (Airbnb fetches them) direct binary upload is not supported on this endpoint. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
3918
+ # Upload one or more photos to an Airbnb listing. &#x60;image&#x60; is base64 image DATA, not a url — a &#x60;data:image/jpeg;base64,…&#x60; prefix is accepted and stripped, and the decoded image must be under 25 MB. (This operation previously documented public image urls that Airbnb would fetch. It never did: a url arrived at Airbnb as a ~60-byte image.) Airbnb assigns the photo id and CDN urls, so the newly uploaded photos appear in &#x60;GET /photos&#x60; after the next sync. Caption, order and room assignment can be set straight away with &#x60;PATCH /photos&#x60;, &#x60;PUT /photos/order&#x60; and &#x60;PUT /photos/cover&#x60;. Returns &#x60;403 listing_inactive&#x60; when the listing is inactive. An inactive listing keeps syncing, but cannot be read or changed through the API until it is activated.
2789
3919
  # @param id [String]
3920
+ # @param upload_airbnb_listing_photos_request [UploadAirbnbListingPhotosRequest]
2790
3921
  # @param [Hash] opts the optional parameters
2791
3922
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2792
- def upload_airbnb_listing_photos_with_http_info(id, opts = {})
3923
+ def upload_airbnb_listing_photos_with_http_info(id, upload_airbnb_listing_photos_request, opts = {})
2793
3924
  if @api_client.config.debugging
2794
3925
  @api_client.config.logger.debug 'Calling API: AirbnbApi.upload_airbnb_listing_photos ...'
2795
3926
  end
@@ -2797,6 +3928,10 @@ module Repull
2797
3928
  if @api_client.config.client_side_validation && id.nil?
2798
3929
  fail ArgumentError, "Missing the required parameter 'id' when calling AirbnbApi.upload_airbnb_listing_photos"
2799
3930
  end
3931
+ # verify the required parameter 'upload_airbnb_listing_photos_request' is set
3932
+ if @api_client.config.client_side_validation && upload_airbnb_listing_photos_request.nil?
3933
+ fail ArgumentError, "Missing the required parameter 'upload_airbnb_listing_photos_request' when calling AirbnbApi.upload_airbnb_listing_photos"
3934
+ end
2800
3935
  # resource path
2801
3936
  local_var_path = '/v1/channels/airbnb/listings/{id}/photos'.sub('{id}', CGI.escape(id.to_s))
2802
3937
 
@@ -2807,12 +3942,17 @@ module Repull
2807
3942
  header_params = opts[:header_params] || {}
2808
3943
  # HTTP header 'Accept' (if needed)
2809
3944
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
3945
+ # HTTP header 'Content-Type'
3946
+ content_type = @api_client.select_header_content_type(['application/json'])
3947
+ if !content_type.nil?
3948
+ header_params['Content-Type'] = content_type
3949
+ end
2810
3950
 
2811
3951
  # form parameters
2812
3952
  form_params = opts[:form_params] || {}
2813
3953
 
2814
3954
  # http body (model)
2815
- post_body = opts[:debug_body]
3955
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_airbnb_listing_photos_request)
2816
3956
 
2817
3957
  # return_type
2818
3958
  return_type = opts[:debug_return_type]