repull 0.2.14 → 0.2.16
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 +4 -4
- data/lib/repull/api/airbnb_api.rb +1387 -152
- data/lib/repull/api/availability_api.rb +2 -2
- data/lib/repull/api/billing_api.rb +4 -4
- data/lib/repull/api/booking_com_api.rb +36 -27
- data/lib/repull/api/connect_api.rb +4 -4
- data/lib/repull/api/conversations_api.rb +398 -4
- data/lib/repull/api/guests_api.rb +2 -2
- data/lib/repull/api/listings_api.rb +97 -13
- data/lib/repull/api/reservations_api.rb +157 -6
- data/lib/repull/api/webhooks_api.rb +10 -3
- data/lib/repull/models/accept_reservation_request200_response.rb +321 -0
- data/lib/repull/models/account_created_event.rb +95 -31
- data/lib/repull/models/account_disconnected_event.rb +95 -31
- data/lib/repull/models/ai_operation_completed_event.rb +95 -31
- data/lib/repull/models/ai_operation_failed_event.rb +95 -31
- data/lib/repull/models/airbnb_account_freshness.rb +239 -0
- data/lib/repull/models/airbnb_alteration.rb +46 -2
- data/lib/repull/models/airbnb_alteration_create_request.rb +264 -0
- data/lib/repull/models/airbnb_connection.rb +69 -2
- data/lib/repull/models/airbnb_connection_host.rb +1 -1
- data/lib/repull/models/airbnb_content_write_response.rb +275 -0
- data/lib/repull/models/airbnb_data_freshness.rb +22 -10
- data/lib/repull/models/airbnb_description_write_request.rb +192 -0
- data/lib/repull/models/airbnb_description_write_request_description.rb +365 -0
- data/lib/repull/models/airbnb_listing.rb +12 -1
- data/lib/repull/models/airbnb_listing_action200_response.rb +105 -0
- data/lib/repull/models/airbnb_listing_action200_response_one_of.rb +157 -0
- data/lib/repull/models/airbnb_listing_action200_response_one_of1.rb +175 -0
- data/lib/repull/models/airbnb_listing_action_request.rb +2 -2
- data/lib/repull/models/airbnb_listing_details_response.rb +284 -0
- data/lib/repull/models/airbnb_listing_details_write_request.rb +209 -0
- data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +214 -0
- data/lib/repull/models/airbnb_listing_details_write_request_quiet_hours_inner.rb +190 -0
- data/lib/repull/models/airbnb_listing_lifecycle_response.rb +196 -0
- data/lib/repull/models/airbnb_permits_response.rb +163 -0
- data/lib/repull/models/airbnb_permits_response_cached_inner.rb +200 -0
- data/lib/repull/models/airbnb_permits_write_request.rb +176 -0
- data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +228 -0
- data/lib/repull/models/airbnb_permits_write_request_permits_inner_answers_inner.rb +198 -0
- data/lib/repull/models/airbnb_photo_position.rb +159 -0
- data/lib/repull/models/airbnb_publish_result.rb +263 -0
- data/lib/repull/models/airbnb_reservation.rb +23 -1
- data/lib/repull/models/{create_airbnb_alteration_request.rb → airbnb_reservation_action200_response.rb} +12 -50
- data/lib/repull/models/airbnb_reservation_action_request.rb +248 -0
- data/lib/repull/models/airbnb_reservation_list_response.rb +13 -4
- data/lib/repull/models/airbnb_review.rb +23 -1
- data/lib/repull/models/airbnb_review_list_response.rb +13 -4
- data/lib/repull/models/airbnb_safety_disclosure.rb +202 -0
- data/lib/repull/models/airbnb_safety_disclosures_response.rb +162 -0
- data/lib/repull/models/airbnb_safety_disclosures_write_request.rb +176 -0
- data/lib/repull/models/airbnb_thread.rb +23 -1
- data/lib/repull/models/airbnb_thread_list_response.rb +13 -4
- data/lib/repull/models/airbnb_transaction.rb +23 -1
- data/lib/repull/models/booking_availability_update.rb +4 -20
- data/lib/repull/models/booking_availability_update_date_range.rb +193 -0
- data/lib/repull/models/booking_availability_update_request.rb +14 -3
- data/lib/repull/models/booking_pricing_rate_update.rb +32 -4
- data/lib/repull/models/booking_pricing_rate_update_date_range.rb +3 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +10 -10
- data/lib/repull/models/booking_pricing_response.rb +16 -4
- data/lib/repull/models/booking_pricing_update_response.rb +82 -18
- data/lib/repull/models/booking_property.rb +107 -36
- data/lib/repull/models/booking_property_listings_inner.rb +244 -0
- data/lib/repull/models/booking_rate_write_occupancy.rb +187 -0
- data/lib/repull/models/booking_rate_write_price_half.rb +188 -0
- data/lib/repull/models/booking_rate_write_restriction_half.rb +212 -0
- data/lib/repull/models/booking_rate_write_verification.rb +200 -0
- data/lib/repull/models/booking_rate_write_verification_row.rb +196 -0
- data/lib/repull/models/booking_restriction_request_row.rb +199 -0
- data/lib/repull/models/booking_restriction_verification.rb +208 -0
- data/lib/repull/models/booking_restriction_verification_row.rb +203 -0
- data/lib/repull/models/booking_restriction_verification_row_booking_value.rb +105 -0
- data/lib/repull/models/booking_restriction_verification_row_expected.rb +105 -0
- data/lib/repull/models/booking_rooms_rates_response.rb +41 -7
- data/lib/repull/models/booking_rooms_rates_response_rooms_inner.rb +12 -1
- data/lib/repull/models/booking_rooms_rates_response_rooms_inner_rates_inner.rb +1 -0
- data/lib/repull/models/booking_upstream_failure.rb +204 -0
- data/lib/repull/models/calendar_updated_event.rb +95 -31
- data/lib/repull/models/conversation_message_attachment.rb +28 -1
- data/lib/repull/models/create_airbnb_listing_room_request.rb +315 -0
- data/lib/repull/models/create_airbnb_offer_request.rb +93 -8
- data/lib/repull/models/create_airbnb_offer_request_guest_details.rb +279 -0
- data/lib/repull/models/create_conversation_special_offer201_response.rb +293 -0
- data/lib/repull/models/create_conversation_special_offer201_response_guests.rb +189 -0
- data/lib/repull/models/create_conversation_special_offer_request.rb +263 -0
- data/lib/repull/models/create_conversation_special_offer_request_guests.rb +263 -0
- data/lib/repull/models/decline_reservation_request_request.rb +234 -0
- data/lib/repull/models/delete_airbnb_listing_photo200_response.rb +14 -4
- data/lib/repull/models/delete_airbnb_listing_room200_response.rb +157 -0
- data/lib/repull/models/error_error.rb +31 -1
- data/lib/repull/models/get_airbnb_booking_settings200_response.rb +190 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data.rb +246 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_advance_notice.rb +172 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_booking_window.rb +160 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation.rb +203 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation_non_refundable.rb +218 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in.rb +159 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in_start.rb +104 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_out.rb +172 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_instant_book.rb +206 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_preparation_time.rb +173 -0
- data/lib/repull/models/get_airbnb_listing_details200_response.rb +192 -0
- data/lib/repull/models/get_airbnb_offer200_response.rb +289 -0
- data/lib/repull/models/get_usage_summary200_response.rb +10 -1
- data/lib/repull/models/get_usage_summary200_response_limits.rb +11 -1
- data/lib/repull/models/get_usage_summary200_response_remaining.rb +11 -1
- data/lib/repull/models/get_usage_summary200_response_used.rb +10 -1
- data/lib/repull/models/get_usage_tier200_response.rb +10 -1
- data/lib/repull/models/get_usage_tier200_response_limits.rb +11 -1
- data/lib/repull/models/get_usage_tier200_response_remaining.rb +11 -1
- data/lib/repull/models/get_usage_tier200_response_used.rb +10 -1
- data/lib/repull/models/inquiry_created_event.rb +281 -0
- data/lib/repull/models/inquiry_created_payload.rb +185 -0
- data/lib/repull/models/inquiry_updated_event.rb +281 -0
- data/lib/repull/models/inquiry_updated_payload.rb +213 -0
- data/lib/repull/models/inquiry_webhook_object.rb +323 -0
- data/lib/repull/models/inquiry_webhook_object_expected_payout.rb +158 -0
- data/lib/repull/models/inquiry_webhook_object_guests.rb +188 -0
- data/lib/repull/models/list_airbnb_listing_permits200_response.rb +190 -0
- data/lib/repull/models/list_airbnb_listing_safety_disclosures200_response.rb +190 -0
- data/lib/repull/models/list_airbnb_thread_messages200_response.rb +170 -0
- data/lib/repull/models/list_airbnb_thread_messages200_response_data_inner.rb +274 -0
- data/lib/repull/models/list_airbnb_thread_messages200_response_pagination.rb +158 -0
- data/lib/repull/models/list_inquiries200_response.rb +192 -0
- data/lib/repull/models/list_inquiries200_response_data_inner.rb +418 -0
- data/lib/repull/models/list_inquiries200_response_data_inner_expected_payout.rb +159 -0
- data/lib/repull/models/list_inquiries200_response_data_inner_guests.rb +188 -0
- data/lib/repull/models/listing.rb +2 -1
- data/lib/repull/models/listing_content.rb +13 -2
- data/lib/repull/models/listing_content_update_request.rb +21 -2
- data/lib/repull/models/listing_content_update_request_details.rb +206 -0
- data/lib/repull/models/listing_content_update_request_policies.rb +95 -5
- data/lib/repull/models/listing_content_update_response.rb +1 -1
- data/lib/repull/models/listing_created_event.rb +95 -31
- data/lib/repull/models/listing_deleted_event.rb +95 -31
- data/lib/repull/models/listing_deleted_payload.rb +55 -21
- data/lib/repull/models/listing_publish_airbnb_response.rb +165 -0
- data/lib/repull/models/listing_pull_airbnb_request.rb +149 -0
- data/lib/repull/models/listing_pull_response.rb +231 -0
- data/lib/repull/models/listing_reactivated_event.rb +281 -0
- data/lib/repull/models/listing_suspended_event.rb +281 -0
- data/lib/repull/models/listing_suspension_payload.rb +202 -0
- data/lib/repull/models/listing_updated_event.rb +95 -31
- data/lib/repull/models/listing_updated_payload.rb +50 -22
- data/lib/repull/models/listing_webhook_object.rb +291 -0
- data/lib/repull/models/listing_webhook_object_address.rb +168 -0
- data/lib/repull/models/listing_webhook_object_channels_inner.rb +184 -0
- data/lib/repull/models/message.rb +1 -0
- data/lib/repull/models/payment_completed_event.rb +95 -31
- data/lib/repull/models/payment_completed_payload.rb +46 -44
- data/lib/repull/models/payment_refunded_event.rb +95 -31
- data/lib/repull/models/payment_refunded_payload.rb +46 -44
- data/lib/repull/models/payment_webhook_object.rb +351 -0
- data/lib/repull/models/preapprove_conversation201_response.rb +253 -0
- data/lib/repull/models/preapprove_conversation_request.rb +150 -0
- data/lib/repull/models/publish_section_error.rb +232 -0
- data/lib/repull/models/reorder_airbnb_listing_photos200_response.rb +191 -0
- data/lib/repull/models/reorder_airbnb_listing_photos200_response_data.rb +172 -0
- data/lib/repull/models/reorder_airbnb_listing_photos_request.rb +185 -0
- data/lib/repull/models/replay_webhook_delivery_request.rb +150 -0
- data/lib/repull/models/repull_ping_event.rb +95 -31
- data/lib/repull/models/reservation.rb +44 -2
- data/lib/repull/models/reservation_alteration_created_event.rb +95 -31
- data/lib/repull/models/reservation_alteration_responded_event.rb +95 -31
- data/lib/repull/models/reservation_cancelled_event.rb +95 -31
- data/lib/repull/models/reservation_created_event.rb +95 -32
- data/lib/repull/models/reservation_message_received_event.rb +95 -31
- data/lib/repull/models/reservation_message_received_payload.rb +17 -4
- data/lib/repull/models/reservation_request_created_event.rb +281 -0
- data/lib/repull/models/reservation_request_created_payload.rb +224 -0
- data/lib/repull/models/reservation_request_updated_event.rb +281 -0
- data/lib/repull/models/reservation_request_updated_payload.rb +251 -0
- data/lib/repull/models/reservation_updated_event.rb +95 -31
- data/lib/repull/models/reservation_webhook_object.rb +38 -5
- data/lib/repull/models/review_created_event.rb +95 -31
- data/lib/repull/models/review_responded_event.rb +95 -31
- data/lib/repull/models/send_airbnb_message201_response.rb +104 -0
- data/lib/repull/models/send_airbnb_message_request.rb +4 -20
- data/lib/repull/models/send_message_attachment.rb +225 -0
- data/lib/repull/models/send_message_part.rb +201 -0
- data/lib/repull/models/send_message_request.rb +44 -19
- data/lib/repull/models/send_message_response.rb +29 -5
- data/lib/repull/models/sent_attachment.rb +196 -0
- data/lib/repull/models/set_airbnb_listing_cover_photo200_response.rb +191 -0
- data/lib/repull/models/set_airbnb_listing_cover_photo200_response_data.rb +171 -0
- data/lib/repull/models/set_airbnb_listing_cover_photo_request.rb +165 -0
- data/lib/repull/models/update_airbnb_booking_settings200_response.rb +164 -0
- data/lib/repull/models/update_airbnb_booking_settings200_response_data.rb +205 -0
- data/lib/repull/models/update_airbnb_booking_settings_request.rb +202 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_advance_notice.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_booking_window.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_cancellation.rb +201 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_cancellation_non_refundable.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_check_in.rb +159 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_check_out.rb +182 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_instant_book.rb +203 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_preparation_time.rb +182 -0
- data/lib/repull/models/update_airbnb_listing_amenities200_response.rb +191 -0
- data/lib/repull/models/update_airbnb_listing_amenities200_response_data.rb +158 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request.rb +199 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request_accessibility_amenities_inner.rb +246 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request_amenities_inner.rb +218 -0
- data/lib/repull/models/update_airbnb_listing_permits200_response.rb +168 -0
- data/lib/repull/models/update_airbnb_listing_photo200_response.rb +194 -0
- data/lib/repull/models/update_airbnb_listing_photo_request.rb +242 -0
- data/lib/repull/models/update_airbnb_listing_room200_response.rb +194 -0
- data/lib/repull/models/update_airbnb_listing_room_request.rb +293 -0
- data/lib/repull/models/update_airbnb_listing_room_request_beds_inner.rb +209 -0
- data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner.rb +182 -0
- data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner_value.rb +105 -0
- data/lib/repull/models/update_airbnb_listing_safety_disclosures200_response.rb +180 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request.rb +184 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner.rb +305 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner_listing_id.rb +105 -0
- data/lib/repull/models/usage_quota_warning_event.rb +281 -0
- data/lib/repull/models/usage_quota_warning_payload.rb +224 -0
- data/lib/repull/models/usage_quota_warning_payload_top_operation.rb +167 -0
- data/lib/repull/models/webhook_event.rb +17 -3
- data/lib/repull/models/webhook_event_account.rb +171 -0
- data/lib/repull/models/webhook_event_type.rb +8 -1
- data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +240 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +138 -1
- data/openapi/v1.json +19578 -10662
- data/scripts/regen.sh +1 -1
- metadata +140 -3
|
@@ -0,0 +1,203 @@
|
|
|
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_live_YOUR_API_KEY ``` ## 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`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
# One restriction on one night, read back off Booking.com after the write.
|
|
18
|
+
class BookingRestrictionVerificationRow < ApiModelBase
|
|
19
|
+
attr_accessor :room_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :rate_id
|
|
22
|
+
|
|
23
|
+
attr_accessor :date
|
|
24
|
+
|
|
25
|
+
attr_accessor :field
|
|
26
|
+
|
|
27
|
+
attr_accessor :expected
|
|
28
|
+
|
|
29
|
+
attr_accessor :booking_value
|
|
30
|
+
|
|
31
|
+
attr_accessor :match
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'room_id' => :'roomId',
|
|
37
|
+
:'rate_id' => :'rateId',
|
|
38
|
+
:'date' => :'date',
|
|
39
|
+
:'field' => :'field',
|
|
40
|
+
:'expected' => :'expected',
|
|
41
|
+
:'booking_value' => :'bookingValue',
|
|
42
|
+
:'match' => :'match'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns attribute mapping this model knows about
|
|
47
|
+
def self.acceptable_attribute_map
|
|
48
|
+
attribute_map
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Returns all the JSON keys this model knows about
|
|
52
|
+
def self.acceptable_attributes
|
|
53
|
+
acceptable_attribute_map.values
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Attribute type mapping.
|
|
57
|
+
def self.openapi_types
|
|
58
|
+
{
|
|
59
|
+
:'room_id' => :'String',
|
|
60
|
+
:'rate_id' => :'String',
|
|
61
|
+
:'date' => :'Date',
|
|
62
|
+
:'field' => :'String',
|
|
63
|
+
:'expected' => :'BookingRestrictionVerificationRowExpected',
|
|
64
|
+
:'booking_value' => :'BookingRestrictionVerificationRowBookingValue',
|
|
65
|
+
:'match' => :'Boolean'
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# List of attributes with nullable: true
|
|
70
|
+
def self.openapi_nullable
|
|
71
|
+
Set.new([
|
|
72
|
+
:'booking_value',
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingRestrictionVerificationRow` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingRestrictionVerificationRow`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'room_id')
|
|
93
|
+
self.room_id = attributes[:'room_id']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'rate_id')
|
|
97
|
+
self.rate_id = attributes[:'rate_id']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'date')
|
|
101
|
+
self.date = attributes[:'date']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'field')
|
|
105
|
+
self.field = attributes[:'field']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'expected')
|
|
109
|
+
self.expected = attributes[:'expected']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'booking_value')
|
|
113
|
+
self.booking_value = attributes[:'booking_value']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'match')
|
|
117
|
+
self.match = attributes[:'match']
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
122
|
+
# @return Array for valid properties with the reasons
|
|
123
|
+
def list_invalid_properties
|
|
124
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
125
|
+
invalid_properties = Array.new
|
|
126
|
+
invalid_properties
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Check to see if the all the properties in the model are valid
|
|
130
|
+
# @return true if the model is valid
|
|
131
|
+
def valid?
|
|
132
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
133
|
+
true
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Checks equality by comparing each attribute.
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def ==(o)
|
|
139
|
+
return true if self.equal?(o)
|
|
140
|
+
self.class == o.class &&
|
|
141
|
+
room_id == o.room_id &&
|
|
142
|
+
rate_id == o.rate_id &&
|
|
143
|
+
date == o.date &&
|
|
144
|
+
field == o.field &&
|
|
145
|
+
expected == o.expected &&
|
|
146
|
+
booking_value == o.booking_value &&
|
|
147
|
+
match == o.match
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# @see the `==` method
|
|
151
|
+
# @param [Object] Object to be compared
|
|
152
|
+
def eql?(o)
|
|
153
|
+
self == o
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Calculates hash code according to all attributes.
|
|
157
|
+
# @return [Integer] Hash code
|
|
158
|
+
def hash
|
|
159
|
+
[room_id, rate_id, date, field, expected, booking_value, match].hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Builds the object from hash
|
|
163
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
164
|
+
# @return [Object] Returns the model itself
|
|
165
|
+
def self.build_from_hash(attributes)
|
|
166
|
+
return nil unless attributes.is_a?(Hash)
|
|
167
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
168
|
+
transformed_hash = {}
|
|
169
|
+
openapi_types.each_pair do |key, type|
|
|
170
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
171
|
+
transformed_hash["#{key}"] = nil
|
|
172
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
173
|
+
# check to ensure the input is an array given that the attribute
|
|
174
|
+
# is documented as an array but the input is not
|
|
175
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
176
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
177
|
+
end
|
|
178
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
179
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
new(transformed_hash)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Returns the object in the form of hash
|
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
|
187
|
+
def to_hash
|
|
188
|
+
hash = {}
|
|
189
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
190
|
+
value = self.send(attr)
|
|
191
|
+
if value.nil?
|
|
192
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
193
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
hash[param] = _to_hash(value)
|
|
197
|
+
end
|
|
198
|
+
hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
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_live_YOUR_API_KEY ``` ## 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`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
# What Booking.com holds for that night now; `null` when they reported nothing for the field either way.
|
|
18
|
+
module BookingRestrictionVerificationRowBookingValue
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
21
|
+
def openapi_one_of
|
|
22
|
+
[
|
|
23
|
+
:'Boolean',
|
|
24
|
+
:'Integer'
|
|
25
|
+
]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Builds the object
|
|
29
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
30
|
+
# @return [Object] Returns the model or the data itself
|
|
31
|
+
def build(data)
|
|
32
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
33
|
+
# Note:
|
|
34
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
35
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
36
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
37
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
38
|
+
# - TODO: logging when debugging is set.
|
|
39
|
+
openapi_one_of.each do |klass|
|
|
40
|
+
begin
|
|
41
|
+
next if klass == :AnyType # "nullable: true"
|
|
42
|
+
return find_and_cast_into_type(klass, data)
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.iso8601(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = Repull.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
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_live_YOUR_API_KEY ``` ## 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`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
# The value that was sent.
|
|
18
|
+
module BookingRestrictionVerificationRowExpected
|
|
19
|
+
class << self
|
|
20
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
21
|
+
def openapi_one_of
|
|
22
|
+
[
|
|
23
|
+
:'Boolean',
|
|
24
|
+
:'Integer'
|
|
25
|
+
]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Builds the object
|
|
29
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
30
|
+
# @return [Object] Returns the model or the data itself
|
|
31
|
+
def build(data)
|
|
32
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
33
|
+
# Note:
|
|
34
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
35
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
36
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
37
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
38
|
+
# - TODO: logging when debugging is set.
|
|
39
|
+
openapi_one_of.each do |klass|
|
|
40
|
+
begin
|
|
41
|
+
next if klass == :AnyType # "nullable: true"
|
|
42
|
+
return find_and_cast_into_type(klass, data)
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.iso8601(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = Repull.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|
|
@@ -14,21 +14,34 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
# Returned by `GET /v1/channels/booking/properties/{id}/rooms`. Exposes the Booking.com room + rate-plan mapping ids for a listing so a caller can assemble a `PUT /v1/channels/booking/availability` restriction write (which requires `roomId` + `rateId` on every update).
|
|
17
|
+
# Returned by `GET /v1/channels/booking/properties/{id}/rooms`. Exposes the Booking.com room + rate-plan mapping ids for a listing so a caller can assemble a `PUT /v1/channels/booking/availability` restriction write (which requires `roomId` + `rateId` on every update). Read live from Booking's B.XML roomrates feed; `source` says so, and says when the answer came from the last import instead.
|
|
18
18
|
class BookingRoomsRatesResponse < ApiModelBase
|
|
19
|
-
# Booking.com hotel/property id the rooms belong to.
|
|
19
|
+
# Booking.com hotel/property id the rooms belong to — the one the mapping resolved to.
|
|
20
20
|
attr_accessor :hotel_id
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# Repull listing id echoed back.
|
|
23
23
|
attr_accessor :listing_id
|
|
24
24
|
|
|
25
|
+
# Other Booking.com properties this listing is also published under. Empty in the normal case. Pass one as `?hotel_id=` to read its rooms instead.
|
|
26
|
+
attr_accessor :other_hotel_ids
|
|
27
|
+
|
|
28
|
+
# Where the rooms came from. `booking` — read live from Booking.com just now. `mirror` — Booking.com returned nothing usable, so these are the rooms and rate plans recorded at the last import; the ids are Booking.com's own and are safe to write against, but they can be stale and `maxPersons`, `policy`, `policyId`, `pricingType` and `isChildRate` come back `null` because only the live feed states them.
|
|
29
|
+
attr_accessor :source
|
|
30
|
+
|
|
31
|
+
# Why the live read was not used. Null when `source` is `booking`.
|
|
32
|
+
attr_accessor :mirror_reason
|
|
33
|
+
|
|
34
|
+
# Empty only when Booking.com reports no rooms for this property AND nothing was recorded at the last import. A failed read is never an empty list — it is an error.
|
|
25
35
|
attr_accessor :rooms
|
|
26
36
|
|
|
27
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
38
|
def self.attribute_map
|
|
29
39
|
{
|
|
30
|
-
:'hotel_id' => :'
|
|
31
|
-
:'listing_id' => :'
|
|
40
|
+
:'hotel_id' => :'hotelId',
|
|
41
|
+
:'listing_id' => :'listingId',
|
|
42
|
+
:'other_hotel_ids' => :'otherHotelIds',
|
|
43
|
+
:'source' => :'source',
|
|
44
|
+
:'mirror_reason' => :'mirrorReason',
|
|
32
45
|
:'rooms' => :'rooms'
|
|
33
46
|
}
|
|
34
47
|
end
|
|
@@ -47,7 +60,10 @@ module Repull
|
|
|
47
60
|
def self.openapi_types
|
|
48
61
|
{
|
|
49
62
|
:'hotel_id' => :'String',
|
|
50
|
-
:'listing_id' => :'
|
|
63
|
+
:'listing_id' => :'String',
|
|
64
|
+
:'other_hotel_ids' => :'Array<String>',
|
|
65
|
+
:'source' => :'String',
|
|
66
|
+
:'mirror_reason' => :'String',
|
|
51
67
|
:'rooms' => :'Array<BookingRoomsRatesResponseRoomsInner>'
|
|
52
68
|
}
|
|
53
69
|
end
|
|
@@ -55,6 +71,7 @@ module Repull
|
|
|
55
71
|
# List of attributes with nullable: true
|
|
56
72
|
def self.openapi_nullable
|
|
57
73
|
Set.new([
|
|
74
|
+
:'mirror_reason',
|
|
58
75
|
])
|
|
59
76
|
end
|
|
60
77
|
|
|
@@ -82,6 +99,20 @@ module Repull
|
|
|
82
99
|
self.listing_id = attributes[:'listing_id']
|
|
83
100
|
end
|
|
84
101
|
|
|
102
|
+
if attributes.key?(:'other_hotel_ids')
|
|
103
|
+
if (value = attributes[:'other_hotel_ids']).is_a?(Array)
|
|
104
|
+
self.other_hotel_ids = value
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'source')
|
|
109
|
+
self.source = attributes[:'source']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'mirror_reason')
|
|
113
|
+
self.mirror_reason = attributes[:'mirror_reason']
|
|
114
|
+
end
|
|
115
|
+
|
|
85
116
|
if attributes.key?(:'rooms')
|
|
86
117
|
if (value = attributes[:'rooms']).is_a?(Array)
|
|
87
118
|
self.rooms = value
|
|
@@ -111,6 +142,9 @@ module Repull
|
|
|
111
142
|
self.class == o.class &&
|
|
112
143
|
hotel_id == o.hotel_id &&
|
|
113
144
|
listing_id == o.listing_id &&
|
|
145
|
+
other_hotel_ids == o.other_hotel_ids &&
|
|
146
|
+
source == o.source &&
|
|
147
|
+
mirror_reason == o.mirror_reason &&
|
|
114
148
|
rooms == o.rooms
|
|
115
149
|
end
|
|
116
150
|
|
|
@@ -123,7 +157,7 @@ module Repull
|
|
|
123
157
|
# Calculates hash code according to all attributes.
|
|
124
158
|
# @return [Integer] Hash code
|
|
125
159
|
def hash
|
|
126
|
-
[hotel_id, listing_id, rooms].hash
|
|
160
|
+
[hotel_id, listing_id, other_hotel_ids, source, mirror_reason, rooms].hash
|
|
127
161
|
end
|
|
128
162
|
|
|
129
163
|
# Builds the object from hash
|
|
@@ -20,6 +20,9 @@ module Repull
|
|
|
20
20
|
|
|
21
21
|
attr_accessor :room_name
|
|
22
22
|
|
|
23
|
+
# Booking.com's capacity for this room, as imported. The occupancy a rate write falls back to when the rate plan states no `maxPersons`. Null when Booking.com never stated one.
|
|
24
|
+
attr_accessor :max_adults
|
|
25
|
+
|
|
23
26
|
attr_accessor :rates
|
|
24
27
|
|
|
25
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -27,6 +30,7 @@ module Repull
|
|
|
27
30
|
{
|
|
28
31
|
:'room_id' => :'roomId',
|
|
29
32
|
:'room_name' => :'roomName',
|
|
33
|
+
:'max_adults' => :'maxAdults',
|
|
30
34
|
:'rates' => :'rates'
|
|
31
35
|
}
|
|
32
36
|
end
|
|
@@ -46,6 +50,7 @@ module Repull
|
|
|
46
50
|
{
|
|
47
51
|
:'room_id' => :'String',
|
|
48
52
|
:'room_name' => :'String',
|
|
53
|
+
:'max_adults' => :'Integer',
|
|
49
54
|
:'rates' => :'Array<BookingRoomsRatesResponseRoomsInnerRatesInner>'
|
|
50
55
|
}
|
|
51
56
|
end
|
|
@@ -55,6 +60,7 @@ module Repull
|
|
|
55
60
|
Set.new([
|
|
56
61
|
:'room_id',
|
|
57
62
|
:'room_name',
|
|
63
|
+
:'max_adults',
|
|
58
64
|
])
|
|
59
65
|
end
|
|
60
66
|
|
|
@@ -82,6 +88,10 @@ module Repull
|
|
|
82
88
|
self.room_name = attributes[:'room_name']
|
|
83
89
|
end
|
|
84
90
|
|
|
91
|
+
if attributes.key?(:'max_adults')
|
|
92
|
+
self.max_adults = attributes[:'max_adults']
|
|
93
|
+
end
|
|
94
|
+
|
|
85
95
|
if attributes.key?(:'rates')
|
|
86
96
|
if (value = attributes[:'rates']).is_a?(Array)
|
|
87
97
|
self.rates = value
|
|
@@ -111,6 +121,7 @@ module Repull
|
|
|
111
121
|
self.class == o.class &&
|
|
112
122
|
room_id == o.room_id &&
|
|
113
123
|
room_name == o.room_name &&
|
|
124
|
+
max_adults == o.max_adults &&
|
|
114
125
|
rates == o.rates
|
|
115
126
|
end
|
|
116
127
|
|
|
@@ -123,7 +134,7 @@ module Repull
|
|
|
123
134
|
# Calculates hash code according to all attributes.
|
|
124
135
|
# @return [Integer] Hash code
|
|
125
136
|
def hash
|
|
126
|
-
[room_id, room_name, rates].hash
|
|
137
|
+
[room_id, room_name, max_adults, rates].hash
|
|
127
138
|
end
|
|
128
139
|
|
|
129
140
|
# Builds the object from hash
|
|
@@ -25,6 +25,7 @@ module Repull
|
|
|
25
25
|
|
|
26
26
|
attr_accessor :policy_id
|
|
27
27
|
|
|
28
|
+
# The party size this rate plan prices. A rate amount must be written at this number: above it Booking.com declines the price in silence, below it answers 400. Null when `source` is `mirror`.
|
|
28
29
|
attr_accessor :max_persons
|
|
29
30
|
|
|
30
31
|
# Pricing model: `Standard`, `RLO`, `OBP`, or `LOS`.
|