repull 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +10 -0
- data/LICENSE +21 -0
- data/README.md +121 -0
- data/Rakefile +10 -0
- data/examples/connect_airbnb.rb +33 -0
- data/examples/quickstart.rb +22 -0
- data/lib/repull/api/ai_api.rb +86 -0
- data/lib/repull/api/airbnb_api.rb +1155 -0
- data/lib/repull/api/atlas_api.rb +194 -0
- data/lib/repull/api/availability_api.rb +167 -0
- data/lib/repull/api/billing_api.rb +139 -0
- data/lib/repull/api/booking_com_api.rb +617 -0
- data/lib/repull/api/connect_api.rb +672 -0
- data/lib/repull/api/conversations_api.rb +263 -0
- data/lib/repull/api/guests_api.rb +171 -0
- data/lib/repull/api/listings_api.rb +509 -0
- data/lib/repull/api/markets_api.rb +320 -0
- data/lib/repull/api/plumguide_api.rb +299 -0
- data/lib/repull/api/pricing_api.rb +453 -0
- data/lib/repull/api/properties_api.rb +166 -0
- data/lib/repull/api/reservations_api.rb +387 -0
- data/lib/repull/api/reviews_api.rb +208 -0
- data/lib/repull/api/schema_api.rb +347 -0
- data/lib/repull/api/system_api.rb +79 -0
- data/lib/repull/api/vrbo_api.rb +262 -0
- data/lib/repull/api/webhooks_api.rb +867 -0
- data/lib/repull/api_client.rb +397 -0
- data/lib/repull/api_error.rb +58 -0
- data/lib/repull/api_model_base.rb +88 -0
- data/lib/repull/configuration.rb +313 -0
- data/lib/repull/models/ai_operation.rb +158 -0
- data/lib/repull/models/airbnb_listing.rb +229 -0
- data/lib/repull/models/airbnb_listing_list_response.rb +158 -0
- data/lib/repull/models/airbnb_reservation.rb +224 -0
- data/lib/repull/models/airbnb_reservation_list_response.rb +158 -0
- data/lib/repull/models/airbnb_review.rb +222 -0
- data/lib/repull/models/airbnb_review_list_response.rb +158 -0
- data/lib/repull/models/airbnb_thread.rb +188 -0
- data/lib/repull/models/airbnb_thread_list_response.rb +158 -0
- data/lib/repull/models/booking_connect_listing_option.rb +201 -0
- data/lib/repull/models/booking_connect_room.rb +251 -0
- data/lib/repull/models/booking_connect_rooms_response.rb +274 -0
- data/lib/repull/models/booking_conversation.rb +178 -0
- data/lib/repull/models/booking_conversation_list_response.rb +158 -0
- data/lib/repull/models/booking_pricing_rate_update.rb +310 -0
- data/lib/repull/models/booking_pricing_rate_update_date_range.rb +190 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +179 -0
- data/lib/repull/models/booking_pricing_response.rb +157 -0
- data/lib/repull/models/booking_pricing_update_request.rb +176 -0
- data/lib/repull/models/booking_pricing_update_response.rb +199 -0
- data/lib/repull/models/booking_property.rb +188 -0
- data/lib/repull/models/booking_property_list_response.rb +158 -0
- data/lib/repull/models/booking_room_mapping.rb +177 -0
- data/lib/repull/models/booking_verify_hotel_request.rb +193 -0
- data/lib/repull/models/booking_verify_hotel_response.rb +285 -0
- data/lib/repull/models/bulk_pricing_failure.rb +177 -0
- data/lib/repull/models/bulk_pricing_item.rb +202 -0
- data/lib/repull/models/bulk_pricing_request.rb +212 -0
- data/lib/repull/models/bulk_pricing_response.rb +170 -0
- data/lib/repull/models/calendar_day.rb +174 -0
- data/lib/repull/models/calendar_response.rb +149 -0
- data/lib/repull/models/connect_host.rb +194 -0
- data/lib/repull/models/connect_provider.rb +365 -0
- data/lib/repull/models/connect_provider_list_response.rb +149 -0
- data/lib/repull/models/connect_session.rb +228 -0
- data/lib/repull/models/connect_status.rb +207 -0
- data/lib/repull/models/connection.rb +195 -0
- data/lib/repull/models/connection_list_response.rb +158 -0
- data/lib/repull/models/conversation.rb +257 -0
- data/lib/repull/models/conversation_detail.rb +284 -0
- data/lib/repull/models/conversation_guest.rb +178 -0
- data/lib/repull/models/conversation_guest_contact.rb +174 -0
- data/lib/repull/models/conversation_host.rb +186 -0
- data/lib/repull/models/conversation_list_response.rb +159 -0
- data/lib/repull/models/conversation_message_attachment.rb +174 -0
- data/lib/repull/models/create_ai_operation200_response.rb +156 -0
- data/lib/repull/models/create_billing_checkout_request.rb +181 -0
- data/lib/repull/models/create_connect_session_request.rb +189 -0
- data/lib/repull/models/create_connection_request.rb +225 -0
- data/lib/repull/models/create_reservation_request.rb +313 -0
- data/lib/repull/models/create_webhook_request.rb +211 -0
- data/lib/repull/models/custom_schema.rb +303 -0
- data/lib/repull/models/custom_schema_create.rb +253 -0
- data/lib/repull/models/custom_schema_create_response.rb +300 -0
- data/lib/repull/models/custom_schema_delete_response.rb +164 -0
- data/lib/repull/models/custom_schema_list_response.rb +159 -0
- data/lib/repull/models/custom_schema_summary.rb +300 -0
- data/lib/repull/models/custom_schema_update.rb +199 -0
- data/lib/repull/models/error.rb +165 -0
- data/lib/repull/models/error_error.rb +357 -0
- data/lib/repull/models/error_error_support.rb +167 -0
- data/lib/repull/models/get_health200_response.rb +156 -0
- data/lib/repull/models/guest.rb +271 -0
- data/lib/repull/models/guest_contact.rb +186 -0
- data/lib/repull/models/guest_flag.rb +179 -0
- data/lib/repull/models/guest_list_response.rb +159 -0
- data/lib/repull/models/guest_note.rb +187 -0
- data/lib/repull/models/guest_profile.rb +337 -0
- data/lib/repull/models/guest_reservations_summary.rb +175 -0
- data/lib/repull/models/listing.rb +216 -0
- data/lib/repull/models/listing_address.rb +158 -0
- data/lib/repull/models/listing_channel.rb +176 -0
- data/lib/repull/models/listing_comp.rb +272 -0
- data/lib/repull/models/listing_comp_nightly.rb +166 -0
- data/lib/repull/models/listing_comp_ratings.rb +157 -0
- data/lib/repull/models/listing_comps_response.rb +197 -0
- data/lib/repull/models/listing_content.rb +249 -0
- data/lib/repull/models/listing_create_request.rb +364 -0
- data/lib/repull/models/listing_create_response.rb +148 -0
- data/lib/repull/models/listing_generate_content_request.rb +192 -0
- data/lib/repull/models/listing_generate_content_response.rb +165 -0
- data/lib/repull/models/listing_list_response.rb +158 -0
- data/lib/repull/models/listing_pricing_apply_request.rb +193 -0
- data/lib/repull/models/listing_pricing_apply_response.rb +169 -0
- data/lib/repull/models/listing_pricing_history_entry.rb +212 -0
- data/lib/repull/models/listing_pricing_history_response.rb +159 -0
- data/lib/repull/models/listing_pricing_recommendation.rb +269 -0
- data/lib/repull/models/listing_pricing_response.rb +187 -0
- data/lib/repull/models/listing_pricing_response_comp_summary.rb +178 -0
- data/lib/repull/models/listing_pricing_response_date_range.rb +156 -0
- data/lib/repull/models/listing_pricing_response_listing.rb +191 -0
- data/lib/repull/models/listing_pricing_strategy.rb +317 -0
- data/lib/repull/models/listing_pricing_strategy_input.rb +264 -0
- data/lib/repull/models/listing_publish_airbnb_request.rb +171 -0
- data/lib/repull/models/listing_publish_response.rb +166 -0
- data/lib/repull/models/listing_publish_status_channel.rb +197 -0
- data/lib/repull/models/listing_publish_status_response.rb +158 -0
- data/lib/repull/models/listing_quality_tier.rb +175 -0
- data/lib/repull/models/listing_segment.rb +229 -0
- data/lib/repull/models/listing_segment_recommendation.rb +170 -0
- data/lib/repull/models/listing_segments_response.rb +230 -0
- data/lib/repull/models/listing_segments_response_scope.rb +159 -0
- data/lib/repull/models/map_connect_booking_rooms_request.rb +202 -0
- data/lib/repull/models/map_connect_booking_rooms_response.rb +243 -0
- data/lib/repull/models/market_browse_category.rb +158 -0
- data/lib/repull/models/market_browse_entry.rb +197 -0
- data/lib/repull/models/market_browse_featured.rb +188 -0
- data/lib/repull/models/market_browse_response.rb +158 -0
- data/lib/repull/models/market_calendar_day.rb +257 -0
- data/lib/repull/models/market_calendar_day_events_inner.rb +177 -0
- data/lib/repull/models/market_calendar_response.rb +178 -0
- data/lib/repull/models/market_detail_response.rb +269 -0
- data/lib/repull/models/market_detail_response_price_distribution_inner.rb +186 -0
- data/lib/repull/models/market_detail_response_property_type_mix_inner.rb +166 -0
- data/lib/repull/models/market_detail_response_supply_trend_inner.rb +156 -0
- data/lib/repull/models/market_detail_response_top_comps.rb +187 -0
- data/lib/repull/models/market_event.rb +257 -0
- data/lib/repull/models/market_my_listing.rb +242 -0
- data/lib/repull/models/market_summary.rb +259 -0
- data/lib/repull/models/market_top_comp.rb +275 -0
- data/lib/repull/models/markets_overview_response.rb +219 -0
- data/lib/repull/models/markets_overview_response_browse.rb +173 -0
- data/lib/repull/models/markets_overview_response_subscriptions.rb +157 -0
- data/lib/repull/models/markets_overview_response_totals.rb +165 -0
- data/lib/repull/models/message.rb +289 -0
- data/lib/repull/models/message_list_response.rb +159 -0
- data/lib/repull/models/pagination.rb +188 -0
- data/lib/repull/models/plumguide_listing.rb +167 -0
- data/lib/repull/models/plumguide_listing_list_response.rb +158 -0
- data/lib/repull/models/property.rb +271 -0
- data/lib/repull/models/property_list_response.rb +158 -0
- data/lib/repull/models/reservation.rb +457 -0
- data/lib/repull/models/reservation_list_response.rb +159 -0
- data/lib/repull/models/review.rb +357 -0
- data/lib/repull/models/review_category.rb +169 -0
- data/lib/repull/models/review_list_response.rb +159 -0
- data/lib/repull/models/review_response.rb +158 -0
- data/lib/repull/models/rotate_webhook_secret200_response.rb +165 -0
- data/lib/repull/models/select_connect_provider_request.rb +165 -0
- data/lib/repull/models/select_provider_response.rb +176 -0
- data/lib/repull/models/test_webhook_request.rb +165 -0
- data/lib/repull/models/update_availability_request.rb +149 -0
- data/lib/repull/models/update_listing_pricing_strategy200_response.rb +147 -0
- data/lib/repull/models/update_reservation_request.rb +174 -0
- data/lib/repull/models/update_webhook_request.rb +211 -0
- data/lib/repull/models/vrbo_listing.rb +167 -0
- data/lib/repull/models/vrbo_listing_list_response.rb +158 -0
- data/lib/repull/models/vrbo_reservation.rb +185 -0
- data/lib/repull/models/vrbo_reservation_list_response.rb +158 -0
- data/lib/repull/models/webhook_delivery.rb +243 -0
- data/lib/repull/models/webhook_delivery_detail.rb +261 -0
- data/lib/repull/models/webhook_delivery_list_response.rb +158 -0
- data/lib/repull/models/webhook_event_catalog.rb +149 -0
- data/lib/repull/models/webhook_event_catalog_domains_inner.rb +167 -0
- data/lib/repull/models/webhook_event_catalog_domains_inner_events_inner.rb +183 -0
- data/lib/repull/models/webhook_list_response.rb +158 -0
- data/lib/repull/models/webhook_subscription.rb +294 -0
- data/lib/repull/version.rb +15 -0
- data/lib/repull.rb +217 -0
- data/openapi/v1.json +8923 -0
- data/repull.gemspec +43 -0
- data/scripts/regen.sh +55 -0
- data/spec/api/ai_api_spec.rb +47 -0
- data/spec/api/airbnb_api_spec.rb +238 -0
- data/spec/api/availability_api_spec.rb +62 -0
- data/spec/api/billing_api_spec.rb +57 -0
- data/spec/api/booking_com_api_spec.rb +115 -0
- data/spec/api/connect_api_spec.rb +82 -0
- data/spec/api/conversations_api_spec.rb +68 -0
- data/spec/api/guests_api_spec.rb +59 -0
- data/spec/api/plumguide_api_spec.rb +85 -0
- data/spec/api/properties_api_spec.rb +60 -0
- data/spec/api/reservations_api_spec.rb +97 -0
- data/spec/api/system_api_spec.rb +45 -0
- data/spec/api/vrbo_api_spec.rb +55 -0
- data/spec/api/webhooks_api_spec.rb +69 -0
- data/spec/models/ai_operation_spec.rb +46 -0
- data/spec/models/calendar_day_spec.rb +54 -0
- data/spec/models/connect_host_spec.rb +60 -0
- data/spec/models/connect_status_spec.rb +76 -0
- data/spec/models/connection_spec.rb +70 -0
- data/spec/models/conversation_spec.rb +66 -0
- data/spec/models/error_error_spec.rb +54 -0
- data/spec/models/error_spec.rb +36 -0
- data/spec/models/guest_spec.rb +72 -0
- data/spec/models/message_spec.rb +70 -0
- data/spec/models/property_spec.rb +114 -0
- data/spec/models/reservation_spec.rb +128 -0
- data/spec/models/webhook_subscription_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- metadata +337 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: ivan@vanio.ai
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Repull
|
|
16
|
+
class PricingApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Apply or decline pricing recommendations
|
|
23
|
+
# Apply: writes the recommended price to the listing's calendar for the given dates and triggers the platform fan-out (Airbnb / Booking.com / VRBO). Decline: marks the recommendation as `declined` so it stops surfacing — the model can re-recommend on the next training cycle.
|
|
24
|
+
# @param id [Integer]
|
|
25
|
+
# @param listing_pricing_apply_request [ListingPricingApplyRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [ListingPricingApplyResponse]
|
|
28
|
+
def apply_listing_pricing(id, listing_pricing_apply_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = apply_listing_pricing_with_http_info(id, listing_pricing_apply_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Apply or decline pricing recommendations
|
|
34
|
+
# Apply: writes the recommended price to the listing's calendar for the given dates and triggers the platform fan-out (Airbnb / Booking.com / VRBO). Decline: marks the recommendation as `declined` so it stops surfacing — the model can re-recommend on the next training cycle.
|
|
35
|
+
# @param id [Integer]
|
|
36
|
+
# @param listing_pricing_apply_request [ListingPricingApplyRequest]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(ListingPricingApplyResponse, Integer, Hash)>] ListingPricingApplyResponse data, response status code and response headers
|
|
39
|
+
def apply_listing_pricing_with_http_info(id, listing_pricing_apply_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.apply_listing_pricing ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.apply_listing_pricing"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'listing_pricing_apply_request' is set
|
|
48
|
+
if @api_client.config.client_side_validation && listing_pricing_apply_request.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'listing_pricing_apply_request' when calling PricingApi.apply_listing_pricing"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/v1/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s))
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(listing_pricing_apply_request)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'ListingPricingApplyResponse'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"PricingApi.apply_listing_pricing",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: PricingApi#apply_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Bulk apply or decline pricing recommendations
|
|
97
|
+
# Apply or decline pending Atlas pricing recommendations across many listings in one call. Built for power users with hundreds of listings who would otherwise need 500 sequential single-listing POSTs. - `items` is capped at 500 entries per request — exceeding returns 422. - Per-item failures (stale listing IDs, no pending recs, channel auth blips) DO NOT fail the whole batch — partial success is the norm at this scale and the granular `failed[]` array lets the SDK retry just the bad entries. - Tier-limit accounting: this endpoint counts as **1 API call** regardless of how many items the body contains. Apply path writes the recommended price to each listing's calendar via the calendar service (which fans out to Airbnb/Booking/VRBO) then marks the Atlas recommendation `applied`. Decline path is Atlas-only — fast.
|
|
98
|
+
# @param bulk_pricing_request [BulkPricingRequest]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @return [BulkPricingResponse]
|
|
101
|
+
def bulk_apply_pricing(bulk_pricing_request, opts = {})
|
|
102
|
+
data, _status_code, _headers = bulk_apply_pricing_with_http_info(bulk_pricing_request, opts)
|
|
103
|
+
data
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Bulk apply or decline pricing recommendations
|
|
107
|
+
# Apply or decline pending Atlas pricing recommendations across many listings in one call. Built for power users with hundreds of listings who would otherwise need 500 sequential single-listing POSTs. - `items` is capped at 500 entries per request — exceeding returns 422. - Per-item failures (stale listing IDs, no pending recs, channel auth blips) DO NOT fail the whole batch — partial success is the norm at this scale and the granular `failed[]` array lets the SDK retry just the bad entries. - Tier-limit accounting: this endpoint counts as **1 API call** regardless of how many items the body contains. Apply path writes the recommended price to each listing's calendar via the calendar service (which fans out to Airbnb/Booking/VRBO) then marks the Atlas recommendation `applied`. Decline path is Atlas-only — fast.
|
|
108
|
+
# @param bulk_pricing_request [BulkPricingRequest]
|
|
109
|
+
# @param [Hash] opts the optional parameters
|
|
110
|
+
# @return [Array<(BulkPricingResponse, Integer, Hash)>] BulkPricingResponse data, response status code and response headers
|
|
111
|
+
def bulk_apply_pricing_with_http_info(bulk_pricing_request, opts = {})
|
|
112
|
+
if @api_client.config.debugging
|
|
113
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.bulk_apply_pricing ...'
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'bulk_pricing_request' is set
|
|
116
|
+
if @api_client.config.client_side_validation && bulk_pricing_request.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'bulk_pricing_request' when calling PricingApi.bulk_apply_pricing"
|
|
118
|
+
end
|
|
119
|
+
# resource path
|
|
120
|
+
local_var_path = '/v1/listings/pricing/bulk'
|
|
121
|
+
|
|
122
|
+
# query parameters
|
|
123
|
+
query_params = opts[:query_params] || {}
|
|
124
|
+
|
|
125
|
+
# header parameters
|
|
126
|
+
header_params = opts[:header_params] || {}
|
|
127
|
+
# HTTP header 'Accept' (if needed)
|
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
129
|
+
# HTTP header 'Content-Type'
|
|
130
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
131
|
+
if !content_type.nil?
|
|
132
|
+
header_params['Content-Type'] = content_type
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# form parameters
|
|
136
|
+
form_params = opts[:form_params] || {}
|
|
137
|
+
|
|
138
|
+
# http body (model)
|
|
139
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(bulk_pricing_request)
|
|
140
|
+
|
|
141
|
+
# return_type
|
|
142
|
+
return_type = opts[:debug_return_type] || 'BulkPricingResponse'
|
|
143
|
+
|
|
144
|
+
# auth_names
|
|
145
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
146
|
+
|
|
147
|
+
new_options = opts.merge(
|
|
148
|
+
:operation => :"PricingApi.bulk_apply_pricing",
|
|
149
|
+
:header_params => header_params,
|
|
150
|
+
:query_params => query_params,
|
|
151
|
+
:form_params => form_params,
|
|
152
|
+
:body => post_body,
|
|
153
|
+
:auth_names => auth_names,
|
|
154
|
+
:return_type => return_type
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
158
|
+
if @api_client.config.debugging
|
|
159
|
+
@api_client.config.logger.debug "API called: PricingApi#bulk_apply_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
160
|
+
end
|
|
161
|
+
return data, status_code, headers
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Get pricing recommendations
|
|
165
|
+
# Returns date-by-date pricing recommendations for a listing's upcoming calendar window, plus the listing's base-price context and a 5km comp summary. Recommendations come from the Atlas pricing model — pre-computed nightly and stored in `pricing_recommendations`. Use POST to apply or decline pending recommendations.
|
|
166
|
+
# @param id [Integer] Listing ID
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @option opts [Date] :start_date Inclusive start of the calendar window. Defaults to today.
|
|
169
|
+
# @option opts [Date] :end_date Inclusive end of the calendar window. Defaults to today + 90 days.
|
|
170
|
+
# @return [ListingPricingResponse]
|
|
171
|
+
def get_listing_pricing(id, opts = {})
|
|
172
|
+
data, _status_code, _headers = get_listing_pricing_with_http_info(id, opts)
|
|
173
|
+
data
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Get pricing recommendations
|
|
177
|
+
# Returns date-by-date pricing recommendations for a listing's upcoming calendar window, plus the listing's base-price context and a 5km comp summary. Recommendations come from the Atlas pricing model — pre-computed nightly and stored in `pricing_recommendations`. Use POST to apply or decline pending recommendations.
|
|
178
|
+
# @param id [Integer] Listing ID
|
|
179
|
+
# @param [Hash] opts the optional parameters
|
|
180
|
+
# @option opts [Date] :start_date Inclusive start of the calendar window. Defaults to today.
|
|
181
|
+
# @option opts [Date] :end_date Inclusive end of the calendar window. Defaults to today + 90 days.
|
|
182
|
+
# @return [Array<(ListingPricingResponse, Integer, Hash)>] ListingPricingResponse data, response status code and response headers
|
|
183
|
+
def get_listing_pricing_with_http_info(id, opts = {})
|
|
184
|
+
if @api_client.config.debugging
|
|
185
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.get_listing_pricing ...'
|
|
186
|
+
end
|
|
187
|
+
# verify the required parameter 'id' is set
|
|
188
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
189
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.get_listing_pricing"
|
|
190
|
+
end
|
|
191
|
+
# resource path
|
|
192
|
+
local_var_path = '/v1/listings/{id}/pricing'.sub('{id}', CGI.escape(id.to_s))
|
|
193
|
+
|
|
194
|
+
# query parameters
|
|
195
|
+
query_params = opts[:query_params] || {}
|
|
196
|
+
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
|
|
197
|
+
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
|
198
|
+
|
|
199
|
+
# header parameters
|
|
200
|
+
header_params = opts[:header_params] || {}
|
|
201
|
+
# HTTP header 'Accept' (if needed)
|
|
202
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
203
|
+
|
|
204
|
+
# form parameters
|
|
205
|
+
form_params = opts[:form_params] || {}
|
|
206
|
+
|
|
207
|
+
# http body (model)
|
|
208
|
+
post_body = opts[:debug_body]
|
|
209
|
+
|
|
210
|
+
# return_type
|
|
211
|
+
return_type = opts[:debug_return_type] || 'ListingPricingResponse'
|
|
212
|
+
|
|
213
|
+
# auth_names
|
|
214
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
215
|
+
|
|
216
|
+
new_options = opts.merge(
|
|
217
|
+
:operation => :"PricingApi.get_listing_pricing",
|
|
218
|
+
:header_params => header_params,
|
|
219
|
+
:query_params => query_params,
|
|
220
|
+
:form_params => form_params,
|
|
221
|
+
:body => post_body,
|
|
222
|
+
:auth_names => auth_names,
|
|
223
|
+
:return_type => return_type
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
227
|
+
if @api_client.config.debugging
|
|
228
|
+
@api_client.config.logger.debug "API called: PricingApi#get_listing_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
229
|
+
end
|
|
230
|
+
return data, status_code, headers
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Pricing recommendation audit trail
|
|
234
|
+
# Cursor-paginated audit trail of pricing recommendations vs applied prices for a listing across a date window. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request. Defaults to ±90 days from today. Cursor is a keyset on `date ASC` — stable even if rows are added during a partner's pagination walk. `limit` is capped at 500 — exceeding returns 422.
|
|
235
|
+
# @param id [Integer]
|
|
236
|
+
# @param [Hash] opts the optional parameters
|
|
237
|
+
# @option opts [Date] :start_date Inclusive. Defaults to today - 90 days.
|
|
238
|
+
# @option opts [Date] :end_date Inclusive. Defaults to today + 90 days.
|
|
239
|
+
# @option opts [Integer] :limit (default to 100)
|
|
240
|
+
# @option opts [String] :cursor Opaque cursor returned in the previous response's `pagination.nextCursor`. Omit to fetch the first page.
|
|
241
|
+
# @return [ListingPricingHistoryResponse]
|
|
242
|
+
def get_listing_pricing_history(id, opts = {})
|
|
243
|
+
data, _status_code, _headers = get_listing_pricing_history_with_http_info(id, opts)
|
|
244
|
+
data
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Pricing recommendation audit trail
|
|
248
|
+
# Cursor-paginated audit trail of pricing recommendations vs applied prices for a listing across a date window. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request. Defaults to ±90 days from today. Cursor is a keyset on `date ASC` — stable even if rows are added during a partner's pagination walk. `limit` is capped at 500 — exceeding returns 422.
|
|
249
|
+
# @param id [Integer]
|
|
250
|
+
# @param [Hash] opts the optional parameters
|
|
251
|
+
# @option opts [Date] :start_date Inclusive. Defaults to today - 90 days.
|
|
252
|
+
# @option opts [Date] :end_date Inclusive. Defaults to today + 90 days.
|
|
253
|
+
# @option opts [Integer] :limit (default to 100)
|
|
254
|
+
# @option opts [String] :cursor Opaque cursor returned in the previous response's `pagination.nextCursor`. Omit to fetch the first page.
|
|
255
|
+
# @return [Array<(ListingPricingHistoryResponse, Integer, Hash)>] ListingPricingHistoryResponse data, response status code and response headers
|
|
256
|
+
def get_listing_pricing_history_with_http_info(id, opts = {})
|
|
257
|
+
if @api_client.config.debugging
|
|
258
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.get_listing_pricing_history ...'
|
|
259
|
+
end
|
|
260
|
+
# verify the required parameter 'id' is set
|
|
261
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
262
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.get_listing_pricing_history"
|
|
263
|
+
end
|
|
264
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
|
|
265
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PricingApi.get_listing_pricing_history, must be smaller than or equal to 500.'
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
269
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PricingApi.get_listing_pricing_history, must be greater than or equal to 1.'
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# resource path
|
|
273
|
+
local_var_path = '/v1/listings/{id}/pricing/history'.sub('{id}', CGI.escape(id.to_s))
|
|
274
|
+
|
|
275
|
+
# query parameters
|
|
276
|
+
query_params = opts[:query_params] || {}
|
|
277
|
+
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
|
|
278
|
+
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
|
279
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
280
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
281
|
+
|
|
282
|
+
# header parameters
|
|
283
|
+
header_params = opts[:header_params] || {}
|
|
284
|
+
# HTTP header 'Accept' (if needed)
|
|
285
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
286
|
+
|
|
287
|
+
# form parameters
|
|
288
|
+
form_params = opts[:form_params] || {}
|
|
289
|
+
|
|
290
|
+
# http body (model)
|
|
291
|
+
post_body = opts[:debug_body]
|
|
292
|
+
|
|
293
|
+
# return_type
|
|
294
|
+
return_type = opts[:debug_return_type] || 'ListingPricingHistoryResponse'
|
|
295
|
+
|
|
296
|
+
# auth_names
|
|
297
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
298
|
+
|
|
299
|
+
new_options = opts.merge(
|
|
300
|
+
:operation => :"PricingApi.get_listing_pricing_history",
|
|
301
|
+
:header_params => header_params,
|
|
302
|
+
:query_params => query_params,
|
|
303
|
+
:form_params => form_params,
|
|
304
|
+
:body => post_body,
|
|
305
|
+
:auth_names => auth_names,
|
|
306
|
+
:return_type => return_type
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
310
|
+
if @api_client.config.debugging
|
|
311
|
+
@api_client.config.logger.debug "API called: PricingApi#get_listing_pricing_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
312
|
+
end
|
|
313
|
+
return data, status_code, headers
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Get pricing strategy
|
|
317
|
+
# Returns the strategy that constrains how the Atlas pricing model behaves for this listing. If no strategy row exists yet, returns sane defaults flagged with `isDefault: true`.
|
|
318
|
+
# @param id [Integer]
|
|
319
|
+
# @param [Hash] opts the optional parameters
|
|
320
|
+
# @return [ListingPricingStrategy]
|
|
321
|
+
def get_listing_pricing_strategy(id, opts = {})
|
|
322
|
+
data, _status_code, _headers = get_listing_pricing_strategy_with_http_info(id, opts)
|
|
323
|
+
data
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Get pricing strategy
|
|
327
|
+
# Returns the strategy that constrains how the Atlas pricing model behaves for this listing. If no strategy row exists yet, returns sane defaults flagged with `isDefault: true`.
|
|
328
|
+
# @param id [Integer]
|
|
329
|
+
# @param [Hash] opts the optional parameters
|
|
330
|
+
# @return [Array<(ListingPricingStrategy, Integer, Hash)>] ListingPricingStrategy data, response status code and response headers
|
|
331
|
+
def get_listing_pricing_strategy_with_http_info(id, opts = {})
|
|
332
|
+
if @api_client.config.debugging
|
|
333
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.get_listing_pricing_strategy ...'
|
|
334
|
+
end
|
|
335
|
+
# verify the required parameter 'id' is set
|
|
336
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
337
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.get_listing_pricing_strategy"
|
|
338
|
+
end
|
|
339
|
+
# resource path
|
|
340
|
+
local_var_path = '/v1/listings/{id}/pricing/strategy'.sub('{id}', CGI.escape(id.to_s))
|
|
341
|
+
|
|
342
|
+
# query parameters
|
|
343
|
+
query_params = opts[:query_params] || {}
|
|
344
|
+
|
|
345
|
+
# header parameters
|
|
346
|
+
header_params = opts[:header_params] || {}
|
|
347
|
+
# HTTP header 'Accept' (if needed)
|
|
348
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
349
|
+
|
|
350
|
+
# form parameters
|
|
351
|
+
form_params = opts[:form_params] || {}
|
|
352
|
+
|
|
353
|
+
# http body (model)
|
|
354
|
+
post_body = opts[:debug_body]
|
|
355
|
+
|
|
356
|
+
# return_type
|
|
357
|
+
return_type = opts[:debug_return_type] || 'ListingPricingStrategy'
|
|
358
|
+
|
|
359
|
+
# auth_names
|
|
360
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
361
|
+
|
|
362
|
+
new_options = opts.merge(
|
|
363
|
+
:operation => :"PricingApi.get_listing_pricing_strategy",
|
|
364
|
+
:header_params => header_params,
|
|
365
|
+
:query_params => query_params,
|
|
366
|
+
:form_params => form_params,
|
|
367
|
+
:body => post_body,
|
|
368
|
+
:auth_names => auth_names,
|
|
369
|
+
:return_type => return_type
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
373
|
+
if @api_client.config.debugging
|
|
374
|
+
@api_client.config.logger.debug "API called: PricingApi#get_listing_pricing_strategy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
375
|
+
end
|
|
376
|
+
return data, status_code, headers
|
|
377
|
+
end
|
|
378
|
+
|
|
379
|
+
# Update pricing strategy
|
|
380
|
+
# Upserts the strategy on `(listing_id, customer_id)` — repeated PUTs are idempotent. Send only the fields you want to change; omitted fields take server-side defaults.
|
|
381
|
+
# @param id [Integer]
|
|
382
|
+
# @param listing_pricing_strategy_input [ListingPricingStrategyInput]
|
|
383
|
+
# @param [Hash] opts the optional parameters
|
|
384
|
+
# @return [UpdateListingPricingStrategy200Response]
|
|
385
|
+
def update_listing_pricing_strategy(id, listing_pricing_strategy_input, opts = {})
|
|
386
|
+
data, _status_code, _headers = update_listing_pricing_strategy_with_http_info(id, listing_pricing_strategy_input, opts)
|
|
387
|
+
data
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
# Update pricing strategy
|
|
391
|
+
# Upserts the strategy on `(listing_id, customer_id)` — repeated PUTs are idempotent. Send only the fields you want to change; omitted fields take server-side defaults.
|
|
392
|
+
# @param id [Integer]
|
|
393
|
+
# @param listing_pricing_strategy_input [ListingPricingStrategyInput]
|
|
394
|
+
# @param [Hash] opts the optional parameters
|
|
395
|
+
# @return [Array<(UpdateListingPricingStrategy200Response, Integer, Hash)>] UpdateListingPricingStrategy200Response data, response status code and response headers
|
|
396
|
+
def update_listing_pricing_strategy_with_http_info(id, listing_pricing_strategy_input, opts = {})
|
|
397
|
+
if @api_client.config.debugging
|
|
398
|
+
@api_client.config.logger.debug 'Calling API: PricingApi.update_listing_pricing_strategy ...'
|
|
399
|
+
end
|
|
400
|
+
# verify the required parameter 'id' is set
|
|
401
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
402
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PricingApi.update_listing_pricing_strategy"
|
|
403
|
+
end
|
|
404
|
+
# verify the required parameter 'listing_pricing_strategy_input' is set
|
|
405
|
+
if @api_client.config.client_side_validation && listing_pricing_strategy_input.nil?
|
|
406
|
+
fail ArgumentError, "Missing the required parameter 'listing_pricing_strategy_input' when calling PricingApi.update_listing_pricing_strategy"
|
|
407
|
+
end
|
|
408
|
+
# resource path
|
|
409
|
+
local_var_path = '/v1/listings/{id}/pricing/strategy'.sub('{id}', CGI.escape(id.to_s))
|
|
410
|
+
|
|
411
|
+
# query parameters
|
|
412
|
+
query_params = opts[:query_params] || {}
|
|
413
|
+
|
|
414
|
+
# header parameters
|
|
415
|
+
header_params = opts[:header_params] || {}
|
|
416
|
+
# HTTP header 'Accept' (if needed)
|
|
417
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
418
|
+
# HTTP header 'Content-Type'
|
|
419
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
420
|
+
if !content_type.nil?
|
|
421
|
+
header_params['Content-Type'] = content_type
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
# form parameters
|
|
425
|
+
form_params = opts[:form_params] || {}
|
|
426
|
+
|
|
427
|
+
# http body (model)
|
|
428
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(listing_pricing_strategy_input)
|
|
429
|
+
|
|
430
|
+
# return_type
|
|
431
|
+
return_type = opts[:debug_return_type] || 'UpdateListingPricingStrategy200Response'
|
|
432
|
+
|
|
433
|
+
# auth_names
|
|
434
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
435
|
+
|
|
436
|
+
new_options = opts.merge(
|
|
437
|
+
:operation => :"PricingApi.update_listing_pricing_strategy",
|
|
438
|
+
:header_params => header_params,
|
|
439
|
+
:query_params => query_params,
|
|
440
|
+
:form_params => form_params,
|
|
441
|
+
:body => post_body,
|
|
442
|
+
:auth_names => auth_names,
|
|
443
|
+
:return_type => return_type
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
447
|
+
if @api_client.config.debugging
|
|
448
|
+
@api_client.config.logger.debug "API called: PricingApi#update_listing_pricing_strategy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
449
|
+
end
|
|
450
|
+
return data, status_code, headers
|
|
451
|
+
end
|
|
452
|
+
end
|
|
453
|
+
end
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: ivan@vanio.ai
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Repull
|
|
16
|
+
class PropertiesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get property details
|
|
23
|
+
# Fetch a single property by Repull id. Property ids are workspace-scoped — an id from one workspace is not valid in another. 404 means the id does not exist OR belongs to a different workspace.
|
|
24
|
+
# @param id [Integer]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [Property]
|
|
27
|
+
def get_property(id, opts = {})
|
|
28
|
+
data, _status_code, _headers = get_property_with_http_info(id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Get property details
|
|
33
|
+
# Fetch a single property by Repull id. Property ids are workspace-scoped — an id from one workspace is not valid in another. 404 means the id does not exist OR belongs to a different workspace.
|
|
34
|
+
# @param id [Integer]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(Property, Integer, Hash)>] Property data, response status code and response headers
|
|
37
|
+
def get_property_with_http_info(id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: PropertiesApi.get_property ...'
|
|
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 PropertiesApi.get_property"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/properties/{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
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'Property'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"PropertiesApi.get_property",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: PropertiesApi#get_property\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List properties
|
|
86
|
+
# Cursor-paginated list of properties for the authenticated workspace. Walk pages with `?cursor=<pagination.nextCursor>`; stop when `pagination.hasMore` is `false`. Cursor is opaque base64 — do not parse it. **Breaking change:** `?offset=` is no longer accepted. Requests passing it return 422 with a `did_you_mean: 'cursor'` hint.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @option opts [Integer] :limit Page size (max 100). Requests over the cap return 422. (default to 50)
|
|
89
|
+
# @option opts [String] :cursor Opaque cursor returned in the previous response's `pagination.nextCursor`. Omit to fetch the first page.
|
|
90
|
+
# @option opts [String] :status Filter by status. Default returns active only; pass `all` to include inactive.
|
|
91
|
+
# @option opts [Boolean] :include_total When `true` (default), the response's `pagination.total` carries the count of rows matching the current filter, across all pages. Pass `false` to skip the count for very large workspaces where the per-page COUNT(*) cost matters. (default to true)
|
|
92
|
+
# @return [PropertyListResponse]
|
|
93
|
+
def list_properties(opts = {})
|
|
94
|
+
data, _status_code, _headers = list_properties_with_http_info(opts)
|
|
95
|
+
data
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# List properties
|
|
99
|
+
# Cursor-paginated list of properties for the authenticated workspace. Walk pages with `?cursor=<pagination.nextCursor>`; stop when `pagination.hasMore` is `false`. Cursor is opaque base64 — do not parse it. **Breaking change:** `?offset=` is no longer accepted. Requests passing it return 422 with a `did_you_mean: 'cursor'` hint.
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @option opts [Integer] :limit Page size (max 100). Requests over the cap return 422. (default to 50)
|
|
102
|
+
# @option opts [String] :cursor Opaque cursor returned in the previous response's `pagination.nextCursor`. Omit to fetch the first page.
|
|
103
|
+
# @option opts [String] :status Filter by status. Default returns active only; pass `all` to include inactive.
|
|
104
|
+
# @option opts [Boolean] :include_total When `true` (default), the response's `pagination.total` carries the count of rows matching the current filter, across all pages. Pass `false` to skip the count for very large workspaces where the per-page COUNT(*) cost matters. (default to true)
|
|
105
|
+
# @return [Array<(PropertyListResponse, Integer, Hash)>] PropertyListResponse data, response status code and response headers
|
|
106
|
+
def list_properties_with_http_info(opts = {})
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug 'Calling API: PropertiesApi.list_properties ...'
|
|
109
|
+
end
|
|
110
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
111
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PropertiesApi.list_properties, must be smaller than or equal to 100.'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
115
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PropertiesApi.list_properties, must be greater than or equal to 1.'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
allowable_values = ["active", "all"]
|
|
119
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
|
120
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
|
121
|
+
end
|
|
122
|
+
# resource path
|
|
123
|
+
local_var_path = '/v1/properties'
|
|
124
|
+
|
|
125
|
+
# query parameters
|
|
126
|
+
query_params = opts[:query_params] || {}
|
|
127
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
128
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
129
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
130
|
+
query_params[:'include_total'] = opts[:'include_total'] if !opts[:'include_total'].nil?
|
|
131
|
+
|
|
132
|
+
# header parameters
|
|
133
|
+
header_params = opts[:header_params] || {}
|
|
134
|
+
# HTTP header 'Accept' (if needed)
|
|
135
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
136
|
+
|
|
137
|
+
# form parameters
|
|
138
|
+
form_params = opts[:form_params] || {}
|
|
139
|
+
|
|
140
|
+
# http body (model)
|
|
141
|
+
post_body = opts[:debug_body]
|
|
142
|
+
|
|
143
|
+
# return_type
|
|
144
|
+
return_type = opts[:debug_return_type] || 'PropertyListResponse'
|
|
145
|
+
|
|
146
|
+
# auth_names
|
|
147
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
148
|
+
|
|
149
|
+
new_options = opts.merge(
|
|
150
|
+
:operation => :"PropertiesApi.list_properties",
|
|
151
|
+
:header_params => header_params,
|
|
152
|
+
:query_params => query_params,
|
|
153
|
+
:form_params => form_params,
|
|
154
|
+
:body => post_body,
|
|
155
|
+
:auth_names => auth_names,
|
|
156
|
+
:return_type => return_type
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
160
|
+
if @api_client.config.debugging
|
|
161
|
+
@api_client.config.logger.debug "API called: PropertiesApi#list_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
162
|
+
end
|
|
163
|
+
return data, status_code, headers
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|