repull 0.2.8 → 0.2.10

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +1443 -182
  3. data/lib/repull/api/availability_api.rb +24 -92
  4. data/lib/repull/api/billing_api.rb +186 -15
  5. data/lib/repull/api/booking_com_api.rb +532 -41
  6. data/lib/repull/api/listings_api.rb +74 -0
  7. data/lib/repull/api/plumguide_api.rb +245 -0
  8. data/lib/repull/api/reservations_api.rb +0 -197
  9. data/lib/repull/api/sandbox_api.rb +136 -0
  10. data/lib/repull/api/vrbo_api.rb +0 -126
  11. data/lib/repull/models/acknowledge_booking_reservations_request.rb +176 -0
  12. data/lib/repull/models/{create_studio_project201_response_data.rb → airbnb_alteration.rb} +44 -52
  13. data/lib/repull/models/airbnb_amenity.rb +171 -0
  14. data/lib/repull/models/{get_studio_deployment200_response.rb → airbnb_availability_write_request.rb} +52 -10
  15. data/lib/repull/models/airbnb_calendar_operation.rb +250 -0
  16. data/lib/repull/models/airbnb_listing_action_request.rb +198 -0
  17. data/lib/repull/models/{update_availability_request.rb → airbnb_pricing_write_request.rb} +100 -11
  18. data/lib/repull/models/booking_availability_update.rb +276 -0
  19. data/lib/repull/models/booking_availability_update_request.rb +230 -0
  20. data/lib/repull/models/{generate_studio_completion_request_project_id.rb → booking_availability_update_request_property_id.rb} +2 -2
  21. data/lib/repull/models/booking_availability_update_request_updates_inner.rb +104 -0
  22. data/lib/repull/models/booking_pricing_rate_update.rb +1 -0
  23. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +65 -6
  24. data/lib/repull/models/booking_setup_request.rb +220 -0
  25. data/lib/repull/models/create_airbnb_alteration_request.rb +195 -0
  26. data/lib/repull/models/{create_studio_deployment201_response_data.rb → create_airbnb_offer_request.rb} +42 -30
  27. data/lib/repull/models/{create_studio_project_request.rb → create_booking_webhook_request.rb} +36 -47
  28. data/lib/repull/models/{generate_studio_completion200_response.rb → delete_airbnb_listing_photo200_response.rb} +10 -10
  29. data/lib/repull/models/{delete_studio_project200_response.rb → get_airbnb_alteration200_response.rb} +50 -7
  30. data/lib/repull/models/{delete_studio_project_file200_response.rb → get_airbnb_listing_quality200_response.rb} +37 -7
  31. data/lib/repull/models/{create_studio_project_generation201_response.rb → get_airbnb_listing_settings200_response.rb} +37 -7
  32. data/lib/repull/models/{delete_studio_deployment200_response.rb → get_airbnb_thread200_response.rb} +50 -7
  33. data/lib/repull/models/{list_studio_deployments200_response.rb → get_usage_logs200_response.rb} +17 -8
  34. data/lib/repull/models/get_usage_logs200_response_data_inner.rb +264 -0
  35. data/lib/repull/models/{create_studio_deployment201_response.rb → get_usage_logs200_response_pagination.rb} +29 -10
  36. data/lib/repull/models/get_usage_summary200_response.rb +232 -0
  37. data/lib/repull/models/get_usage_summary200_response_breakdown_inner.rb +183 -0
  38. data/lib/repull/models/{delete_studio_deployment200_response_data.rb → get_usage_summary200_response_limits.rb} +18 -16
  39. data/lib/repull/models/{delete_studio_project200_response_data.rb → get_usage_summary200_response_remaining.rb} +18 -16
  40. data/lib/repull/models/{create_studio_project_generation201_response_data.rb → get_usage_summary200_response_status_distribution.rb} +31 -22
  41. data/lib/repull/models/{upsert_studio_project_file_request.rb → get_usage_summary200_response_timeline_inner.rb} +28 -28
  42. data/lib/repull/models/{create_studio_project_generation_request.rb → get_usage_summary200_response_totals.rb} +28 -28
  43. data/lib/repull/models/{create_studio_project201_response.rb → get_usage_summary200_response_used.rb} +19 -10
  44. data/lib/repull/models/get_usage_tier200_response.rb +183 -0
  45. data/lib/repull/models/{list_studio_projects200_response.rb → get_usage_tier200_response_limits.rb} +31 -12
  46. data/lib/repull/models/{update_reservation_request.rb → get_usage_tier200_response_remaining.rb} +25 -31
  47. data/lib/repull/models/{get_studio_project200_response.rb → get_usage_tier200_response_used.rb} +28 -10
  48. data/lib/repull/models/list_airbnb_alterations200_response.rb +192 -0
  49. data/lib/repull/models/list_airbnb_listing_amenities200_response.rb +190 -0
  50. data/lib/repull/models/{create_studio_deployment_request.rb → list_airbnb_listing_amenities200_response_data.rb} +23 -28
  51. data/lib/repull/models/{list_studio_project_files200_response.rb → list_airbnb_transactions200_response.rb} +50 -7
  52. data/lib/repull/models/listing_content_update_request.rb +243 -0
  53. data/lib/repull/models/{upsert_studio_project_file200_response.rb → listing_content_update_request_address.rb} +53 -10
  54. data/lib/repull/models/listing_content_update_request_amenities.rb +105 -0
  55. data/lib/repull/models/listing_content_update_request_amenities_one_of_inner.rb +196 -0
  56. data/lib/repull/models/listing_content_update_request_occupancy.rb +179 -0
  57. data/lib/repull/{api/ai_api.rb → models/listing_content_update_request_photos_inner.rb} +77 -59
  58. data/lib/repull/models/{generate_studio_completion200_response_data.rb → listing_content_update_request_photos_inner_one_of.rb} +81 -66
  59. data/lib/repull/models/listing_content_update_request_policies.rb +253 -0
  60. data/lib/repull/models/{create_ai_operation200_response.rb → listing_content_update_response.rb} +32 -16
  61. data/lib/repull/models/map_airbnb_listing_request.rb +215 -0
  62. data/lib/repull/models/{create_reservation_request.rb → map_airbnb_listing_response.rb} +137 -116
  63. data/lib/repull/models/property.rb +42 -69
  64. data/lib/repull/models/property_availability.rb +222 -0
  65. data/lib/repull/models/property_availability_day.rb +247 -0
  66. data/lib/repull/models/reservation.rb +28 -1
  67. data/lib/repull/models/sandbox_fixture_ref.rb +193 -0
  68. data/lib/repull/models/{delete_studio_project_file200_response_data.rb → sandbox_reset_result.rb} +72 -11
  69. data/lib/repull/models/sandbox_reset_result_deleted.rb +216 -0
  70. data/lib/repull/models/sandbox_seed_result.rb +278 -0
  71. data/lib/repull/models/{update_studio_project_request.rb → update_airbnb_message_request.rb} +43 -24
  72. data/lib/repull/models/update_booking_charges_request.rb +194 -0
  73. data/lib/repull/version.rb +1 -1
  74. data/lib/repull.rb +59 -34
  75. data/openapi/v1.json +3956 -2522
  76. metadata +61 -36
  77. data/lib/repull/api/studio_api.rb +0 -1094
  78. data/lib/repull/models/generate_studio_completion_request.rb +0 -305
  79. data/lib/repull/models/upsert_studio_project_file200_response_data.rb +0 -147
@@ -659,5 +659,79 @@ module Repull
659
659
  end
660
660
  return data, status_code, headers
661
661
  end
662
+
663
+ # Update canonical listing content
664
+ # Write your PMS's canonical listing content — title, description, amenities, address, occupancy, and policies — into a Repull listing, making it the source of truth. This is the flagship \"the PMS owns listing content, Repull distributes it\" enabler. **Partial update:** every field is optional. Only the fields you send are written; absent fields are left untouched. `amenities` is a FULL replacement of the amenity set (omit to leave untouched, send `[]` to clear). **Local write only — NOT a channel publish.** This mutates Repull's own copy of the content. It does NOT push to Airbnb / Booking.com; it marks the channels dirty so a later publish knows what changed. Distribution stays a separate explicit step. **Photos are deferred:** a provided `photos` array is echoed back in the `deferred` field and NOT persisted (media ingestion is a follow-up). Cross-tenant access (a listing that belongs to a different workspace) returns 404 — never 403. This endpoint is served even when the account is over the plan-listings cap, since editing content on a listing you already own never grows the portfolio.
665
+ # @param id [Integer] Repull listing id
666
+ # @param listing_content_update_request [ListingContentUpdateRequest]
667
+ # @param [Hash] opts the optional parameters
668
+ # @return [ListingContentUpdateResponse]
669
+ def update_listing_content(id, listing_content_update_request, opts = {})
670
+ data, _status_code, _headers = update_listing_content_with_http_info(id, listing_content_update_request, opts)
671
+ data
672
+ end
673
+
674
+ # Update canonical listing content
675
+ # Write your PMS's canonical listing content — title, description, amenities, address, occupancy, and policies — into a Repull listing, making it the source of truth. This is the flagship \"the PMS owns listing content, Repull distributes it\" enabler. **Partial update:** every field is optional. Only the fields you send are written; absent fields are left untouched. `amenities` is a FULL replacement of the amenity set (omit to leave untouched, send `[]` to clear). **Local write only — NOT a channel publish.** This mutates Repull's own copy of the content. It does NOT push to Airbnb / Booking.com; it marks the channels dirty so a later publish knows what changed. Distribution stays a separate explicit step. **Photos are deferred:** a provided `photos` array is echoed back in the `deferred` field and NOT persisted (media ingestion is a follow-up). Cross-tenant access (a listing that belongs to a different workspace) returns 404 — never 403. This endpoint is served even when the account is over the plan-listings cap, since editing content on a listing you already own never grows the portfolio.
676
+ # @param id [Integer] Repull listing id
677
+ # @param listing_content_update_request [ListingContentUpdateRequest]
678
+ # @param [Hash] opts the optional parameters
679
+ # @return [Array<(ListingContentUpdateResponse, Integer, Hash)>] ListingContentUpdateResponse data, response status code and response headers
680
+ def update_listing_content_with_http_info(id, listing_content_update_request, opts = {})
681
+ if @api_client.config.debugging
682
+ @api_client.config.logger.debug 'Calling API: ListingsApi.update_listing_content ...'
683
+ end
684
+ # verify the required parameter 'id' is set
685
+ if @api_client.config.client_side_validation && id.nil?
686
+ fail ArgumentError, "Missing the required parameter 'id' when calling ListingsApi.update_listing_content"
687
+ end
688
+ # verify the required parameter 'listing_content_update_request' is set
689
+ if @api_client.config.client_side_validation && listing_content_update_request.nil?
690
+ fail ArgumentError, "Missing the required parameter 'listing_content_update_request' when calling ListingsApi.update_listing_content"
691
+ end
692
+ # resource path
693
+ local_var_path = '/v1/listings/{id}/content'.sub('{id}', CGI.escape(id.to_s))
694
+
695
+ # query parameters
696
+ query_params = opts[:query_params] || {}
697
+
698
+ # header parameters
699
+ header_params = opts[:header_params] || {}
700
+ # HTTP header 'Accept' (if needed)
701
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
702
+ # HTTP header 'Content-Type'
703
+ content_type = @api_client.select_header_content_type(['application/json'])
704
+ if !content_type.nil?
705
+ header_params['Content-Type'] = content_type
706
+ end
707
+
708
+ # form parameters
709
+ form_params = opts[:form_params] || {}
710
+
711
+ # http body (model)
712
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(listing_content_update_request)
713
+
714
+ # return_type
715
+ return_type = opts[:debug_return_type] || 'ListingContentUpdateResponse'
716
+
717
+ # auth_names
718
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
719
+
720
+ new_options = opts.merge(
721
+ :operation => :"ListingsApi.update_listing_content",
722
+ :header_params => header_params,
723
+ :query_params => query_params,
724
+ :form_params => form_params,
725
+ :body => post_body,
726
+ :auth_names => auth_names,
727
+ :return_type => return_type
728
+ )
729
+
730
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
731
+ if @api_client.config.debugging
732
+ @api_client.config.logger.debug "API called: ListingsApi#update_listing_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
733
+ end
734
+ return data, status_code, headers
735
+ end
662
736
  end
663
737
  end
@@ -19,6 +19,63 @@ module Repull
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Remove Plumguide webhook config
23
+ # Delete the Plumguide webhook configuration for this workspace. Plumguide stops delivering webhooks until a new config is set.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def delete_plumguide_webhooks(opts = {})
27
+ delete_plumguide_webhooks_with_http_info(opts)
28
+ nil
29
+ end
30
+
31
+ # Remove Plumguide webhook config
32
+ # Delete the Plumguide webhook configuration for this workspace. Plumguide stops delivering webhooks until a new config is set.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
35
+ def delete_plumguide_webhooks_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.delete_plumguide_webhooks ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/v1/channels/plumguide/webhooks'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type]
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"PlumguideApi.delete_plumguide_webhooks",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: PlumguideApi#delete_plumguide_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
22
79
  # Get Plumguide availability
23
80
  # Read the per-day availability calendar for a Plumguide listing. Returns the same row shape as Airbnb availability for SDK convenience.
24
81
  # @param [Hash] opts the optional parameters
@@ -129,6 +186,126 @@ module Repull
129
186
  return data, status_code, headers
130
187
  end
131
188
 
189
+ # Get Plumguide webhook config
190
+ # Read the current Plumguide webhook configuration for this workspace.
191
+ # @param [Hash] opts the optional parameters
192
+ # @return [nil]
193
+ def get_plumguide_webhooks(opts = {})
194
+ get_plumguide_webhooks_with_http_info(opts)
195
+ nil
196
+ end
197
+
198
+ # Get Plumguide webhook config
199
+ # Read the current Plumguide webhook configuration for this workspace.
200
+ # @param [Hash] opts the optional parameters
201
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
202
+ def get_plumguide_webhooks_with_http_info(opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.get_plumguide_webhooks ...'
205
+ end
206
+ # resource path
207
+ local_var_path = '/v1/channels/plumguide/webhooks'
208
+
209
+ # query parameters
210
+ query_params = opts[:query_params] || {}
211
+
212
+ # header parameters
213
+ header_params = opts[:header_params] || {}
214
+ # HTTP header 'Accept' (if needed)
215
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
216
+
217
+ # form parameters
218
+ form_params = opts[:form_params] || {}
219
+
220
+ # http body (model)
221
+ post_body = opts[:debug_body]
222
+
223
+ # return_type
224
+ return_type = opts[:debug_return_type]
225
+
226
+ # auth_names
227
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
228
+
229
+ new_options = opts.merge(
230
+ :operation => :"PlumguideApi.get_plumguide_webhooks",
231
+ :header_params => header_params,
232
+ :query_params => query_params,
233
+ :form_params => form_params,
234
+ :body => post_body,
235
+ :auth_names => auth_names,
236
+ :return_type => return_type
237
+ )
238
+
239
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug "API called: PlumguideApi#get_plumguide_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
242
+ end
243
+ return data, status_code, headers
244
+ end
245
+
246
+ # List Plumguide bookings
247
+ # List Plumguide bookings. Default returns all bookings; pass `listing_id` to filter to one listing, or `booking_code` to fetch a single booking.
248
+ # @param [Hash] opts the optional parameters
249
+ # @option opts [Integer] :listing_id Filter to a single Plumguide listing.
250
+ # @option opts [String] :booking_code Fetch a single booking by its Plumguide booking code.
251
+ # @return [nil]
252
+ def list_plumguide_bookings(opts = {})
253
+ list_plumguide_bookings_with_http_info(opts)
254
+ nil
255
+ end
256
+
257
+ # List Plumguide bookings
258
+ # List Plumguide bookings. Default returns all bookings; pass &#x60;listing_id&#x60; to filter to one listing, or &#x60;booking_code&#x60; to fetch a single booking.
259
+ # @param [Hash] opts the optional parameters
260
+ # @option opts [Integer] :listing_id Filter to a single Plumguide listing.
261
+ # @option opts [String] :booking_code Fetch a single booking by its Plumguide booking code.
262
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
263
+ def list_plumguide_bookings_with_http_info(opts = {})
264
+ if @api_client.config.debugging
265
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.list_plumguide_bookings ...'
266
+ end
267
+ # resource path
268
+ local_var_path = '/v1/channels/plumguide/bookings'
269
+
270
+ # query parameters
271
+ query_params = opts[:query_params] || {}
272
+ query_params[:'listing_id'] = opts[:'listing_id'] if !opts[:'listing_id'].nil?
273
+ query_params[:'booking_code'] = opts[:'booking_code'] if !opts[:'booking_code'].nil?
274
+
275
+ # header parameters
276
+ header_params = opts[:header_params] || {}
277
+ # HTTP header 'Accept' (if needed)
278
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
279
+
280
+ # form parameters
281
+ form_params = opts[:form_params] || {}
282
+
283
+ # http body (model)
284
+ post_body = opts[:debug_body]
285
+
286
+ # return_type
287
+ return_type = opts[:debug_return_type]
288
+
289
+ # auth_names
290
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
291
+
292
+ new_options = opts.merge(
293
+ :operation => :"PlumguideApi.list_plumguide_bookings",
294
+ :header_params => header_params,
295
+ :query_params => query_params,
296
+ :form_params => form_params,
297
+ :body => post_body,
298
+ :auth_names => auth_names,
299
+ :return_type => return_type
300
+ )
301
+
302
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
303
+ if @api_client.config.debugging
304
+ @api_client.config.logger.debug "API called: PlumguideApi#list_plumguide_bookings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
305
+ end
306
+ return data, status_code, headers
307
+ end
308
+
132
309
  # List Plumguide listings
133
310
  # List Plumguide listings this workspace has access to. Plumguide is approval-based — listings appear once Plumguide has accepted them.
134
311
  # @param [Hash] opts the optional parameters
@@ -295,5 +472,73 @@ module Repull
295
472
  end
296
473
  return data, status_code, headers
297
474
  end
475
+
476
+ # Replace Plumguide webhook config
477
+ # Replace the Plumguide webhook configuration. The body carries the full webhook config payload — this is a full replacement, not a patch.
478
+ # @param request_body [Hash<String, Object>]
479
+ # @param [Hash] opts the optional parameters
480
+ # @return [nil]
481
+ def update_plumguide_webhooks(request_body, opts = {})
482
+ update_plumguide_webhooks_with_http_info(request_body, opts)
483
+ nil
484
+ end
485
+
486
+ # Replace Plumguide webhook config
487
+ # Replace the Plumguide webhook configuration. The body carries the full webhook config payload — this is a full replacement, not a patch.
488
+ # @param request_body [Hash<String, Object>]
489
+ # @param [Hash] opts the optional parameters
490
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
491
+ def update_plumguide_webhooks_with_http_info(request_body, opts = {})
492
+ if @api_client.config.debugging
493
+ @api_client.config.logger.debug 'Calling API: PlumguideApi.update_plumguide_webhooks ...'
494
+ end
495
+ # verify the required parameter 'request_body' is set
496
+ if @api_client.config.client_side_validation && request_body.nil?
497
+ fail ArgumentError, "Missing the required parameter 'request_body' when calling PlumguideApi.update_plumguide_webhooks"
498
+ end
499
+ # resource path
500
+ local_var_path = '/v1/channels/plumguide/webhooks'
501
+
502
+ # query parameters
503
+ query_params = opts[:query_params] || {}
504
+
505
+ # header parameters
506
+ header_params = opts[:header_params] || {}
507
+ # HTTP header 'Accept' (if needed)
508
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
509
+ # HTTP header 'Content-Type'
510
+ content_type = @api_client.select_header_content_type(['application/json'])
511
+ if !content_type.nil?
512
+ header_params['Content-Type'] = content_type
513
+ end
514
+
515
+ # form parameters
516
+ form_params = opts[:form_params] || {}
517
+
518
+ # http body (model)
519
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
520
+
521
+ # return_type
522
+ return_type = opts[:debug_return_type]
523
+
524
+ # auth_names
525
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
526
+
527
+ new_options = opts.merge(
528
+ :operation => :"PlumguideApi.update_plumguide_webhooks",
529
+ :header_params => header_params,
530
+ :query_params => query_params,
531
+ :form_params => form_params,
532
+ :body => post_body,
533
+ :auth_names => auth_names,
534
+ :return_type => return_type
535
+ )
536
+
537
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
538
+ if @api_client.config.debugging
539
+ @api_client.config.logger.debug "API called: PlumguideApi#update_plumguide_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
540
+ end
541
+ return data, status_code, headers
542
+ end
298
543
  end
299
544
  end
@@ -19,135 +19,6 @@ module Repull
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Cancel reservation
23
- # Cancel an existing reservation. Cancellation rules vary by provider — Airbnb host-cancellations carry penalties; Booking.com cancellations apply the per-rate-plan policy. Once 200 is returned, the upstream PMS state is committed.
24
- # @param id [Integer]
25
- # @param [Hash] opts the optional parameters
26
- # @return [nil]
27
- def cancel_reservation(id, opts = {})
28
- cancel_reservation_with_http_info(id, opts)
29
- nil
30
- end
31
-
32
- # Cancel reservation
33
- # Cancel an existing reservation. Cancellation rules vary by provider — Airbnb host-cancellations carry penalties; Booking.com cancellations apply the per-rate-plan policy. Once 200 is returned, the upstream PMS state is committed.
34
- # @param id [Integer]
35
- # @param [Hash] opts the optional parameters
36
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
37
- def cancel_reservation_with_http_info(id, opts = {})
38
- if @api_client.config.debugging
39
- @api_client.config.logger.debug 'Calling API: ReservationsApi.cancel_reservation ...'
40
- end
41
- # verify the required parameter 'id' is set
42
- if @api_client.config.client_side_validation && id.nil?
43
- fail ArgumentError, "Missing the required parameter 'id' when calling ReservationsApi.cancel_reservation"
44
- end
45
- # resource path
46
- local_var_path = '/v1/reservations/{id}'.sub('{id}', CGI.escape(id.to_s))
47
-
48
- # query parameters
49
- query_params = opts[:query_params] || {}
50
-
51
- # header parameters
52
- header_params = opts[:header_params] || {}
53
-
54
- # form parameters
55
- form_params = opts[:form_params] || {}
56
-
57
- # http body (model)
58
- post_body = opts[:debug_body]
59
-
60
- # return_type
61
- return_type = opts[:debug_return_type]
62
-
63
- # auth_names
64
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
65
-
66
- new_options = opts.merge(
67
- :operation => :"ReservationsApi.cancel_reservation",
68
- :header_params => header_params,
69
- :query_params => query_params,
70
- :form_params => form_params,
71
- :body => post_body,
72
- :auth_names => auth_names,
73
- :return_type => return_type
74
- )
75
-
76
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
77
- if @api_client.config.debugging
78
- @api_client.config.logger.debug "API called: ReservationsApi#cancel_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
- end
80
- return data, status_code, headers
81
- end
82
-
83
- # Create a reservation
84
- # Create a reservation in the source PMS. Required fields depend on the connected provider (e.g. Airbnb requires guest email; Booking.com requires hotel id). Validation errors return 422 with the offending `field` populated.
85
- # @param create_reservation_request [CreateReservationRequest]
86
- # @param [Hash] opts the optional parameters
87
- # @return [Reservation]
88
- def create_reservation(create_reservation_request, opts = {})
89
- data, _status_code, _headers = create_reservation_with_http_info(create_reservation_request, opts)
90
- data
91
- end
92
-
93
- # Create a reservation
94
- # Create a reservation in the source PMS. Required fields depend on the connected provider (e.g. Airbnb requires guest email; Booking.com requires hotel id). Validation errors return 422 with the offending &#x60;field&#x60; populated.
95
- # @param create_reservation_request [CreateReservationRequest]
96
- # @param [Hash] opts the optional parameters
97
- # @return [Array<(Reservation, Integer, Hash)>] Reservation data, response status code and response headers
98
- def create_reservation_with_http_info(create_reservation_request, opts = {})
99
- if @api_client.config.debugging
100
- @api_client.config.logger.debug 'Calling API: ReservationsApi.create_reservation ...'
101
- end
102
- # verify the required parameter 'create_reservation_request' is set
103
- if @api_client.config.client_side_validation && create_reservation_request.nil?
104
- fail ArgumentError, "Missing the required parameter 'create_reservation_request' when calling ReservationsApi.create_reservation"
105
- end
106
- # resource path
107
- local_var_path = '/v1/reservations'
108
-
109
- # query parameters
110
- query_params = opts[:query_params] || {}
111
-
112
- # header parameters
113
- header_params = opts[:header_params] || {}
114
- # HTTP header 'Accept' (if needed)
115
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
116
- # HTTP header 'Content-Type'
117
- content_type = @api_client.select_header_content_type(['application/json'])
118
- if !content_type.nil?
119
- header_params['Content-Type'] = content_type
120
- end
121
-
122
- # form parameters
123
- form_params = opts[:form_params] || {}
124
-
125
- # http body (model)
126
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_reservation_request)
127
-
128
- # return_type
129
- return_type = opts[:debug_return_type] || 'Reservation'
130
-
131
- # auth_names
132
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
133
-
134
- new_options = opts.merge(
135
- :operation => :"ReservationsApi.create_reservation",
136
- :header_params => header_params,
137
- :query_params => query_params,
138
- :form_params => form_params,
139
- :body => post_body,
140
- :auth_names => auth_names,
141
- :return_type => return_type
142
- )
143
-
144
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
145
- if @api_client.config.debugging
146
- @api_client.config.logger.debug "API called: ReservationsApi#create_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
- end
148
- return data, status_code, headers
149
- end
150
-
151
22
  # Get reservation details
152
23
  # Returns the full record for a single reservation, scoped to the authenticated workspace. Response shape is identical to a single row in `GET /v1/reservations` so SDK consumers can use the same type for both. Returns **404** if the id does not exist OR belongs to a different workspace — the API never differentiates the two so caller can't enumerate other workspaces' ids.
153
24
  # @param id [Integer] Internal Repull reservation ID.
@@ -344,73 +215,5 @@ module Repull
344
215
  end
345
216
  return data, status_code, headers
346
217
  end
347
-
348
- # Update reservation
349
- # Patch reservation fields (dates, status, special requests). Only fields included in the body are modified. Use the cancel endpoint for cancellations — DELETE handles cancellation but not partial updates.
350
- # @param id [Integer]
351
- # @param [Hash] opts the optional parameters
352
- # @option opts [UpdateReservationRequest] :update_reservation_request
353
- # @return [nil]
354
- def update_reservation(id, opts = {})
355
- update_reservation_with_http_info(id, opts)
356
- nil
357
- end
358
-
359
- # Update reservation
360
- # Patch reservation fields (dates, status, special requests). Only fields included in the body are modified. Use the cancel endpoint for cancellations — DELETE handles cancellation but not partial updates.
361
- # @param id [Integer]
362
- # @param [Hash] opts the optional parameters
363
- # @option opts [UpdateReservationRequest] :update_reservation_request
364
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
365
- def update_reservation_with_http_info(id, opts = {})
366
- if @api_client.config.debugging
367
- @api_client.config.logger.debug 'Calling API: ReservationsApi.update_reservation ...'
368
- end
369
- # verify the required parameter 'id' is set
370
- if @api_client.config.client_side_validation && id.nil?
371
- fail ArgumentError, "Missing the required parameter 'id' when calling ReservationsApi.update_reservation"
372
- end
373
- # resource path
374
- local_var_path = '/v1/reservations/{id}'.sub('{id}', CGI.escape(id.to_s))
375
-
376
- # query parameters
377
- query_params = opts[:query_params] || {}
378
-
379
- # header parameters
380
- header_params = opts[:header_params] || {}
381
- # HTTP header 'Content-Type'
382
- content_type = @api_client.select_header_content_type(['application/json'])
383
- if !content_type.nil?
384
- header_params['Content-Type'] = content_type
385
- end
386
-
387
- # form parameters
388
- form_params = opts[:form_params] || {}
389
-
390
- # http body (model)
391
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_reservation_request'])
392
-
393
- # return_type
394
- return_type = opts[:debug_return_type]
395
-
396
- # auth_names
397
- auth_names = opts[:debug_auth_names] || ['bearerAuth']
398
-
399
- new_options = opts.merge(
400
- :operation => :"ReservationsApi.update_reservation",
401
- :header_params => header_params,
402
- :query_params => query_params,
403
- :form_params => form_params,
404
- :body => post_body,
405
- :auth_names => auth_names,
406
- :return_type => return_type
407
- )
408
-
409
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
410
- if @api_client.config.debugging
411
- @api_client.config.logger.debug "API called: ReservationsApi#update_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
412
- end
413
- return data, status_code, headers
414
- end
415
218
  end
416
219
  end