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,193 @@
|
|
|
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 nights this update applies to. **Both ends are inclusive** — `start` equal to `end` is one night.
|
|
18
|
+
class BookingAvailabilityUpdateDateRange < ApiModelBase
|
|
19
|
+
# First night, YYYY-MM-DD.
|
|
20
|
+
attr_accessor :start
|
|
21
|
+
|
|
22
|
+
# Last night, YYYY-MM-DD, inclusive.
|
|
23
|
+
attr_accessor :_end
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'start' => :'start',
|
|
29
|
+
:'_end' => :'end'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'start' => :'Date',
|
|
47
|
+
:'_end' => :'Date'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingAvailabilityUpdateDateRange` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingAvailabilityUpdateDateRange`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'start')
|
|
74
|
+
self.start = attributes[:'start']
|
|
75
|
+
else
|
|
76
|
+
self.start = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'_end')
|
|
80
|
+
self._end = attributes[:'_end']
|
|
81
|
+
else
|
|
82
|
+
self._end = nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
if @start.nil?
|
|
92
|
+
invalid_properties.push('invalid value for "start", start cannot be nil.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if @_end.nil?
|
|
96
|
+
invalid_properties.push('invalid value for "_end", _end cannot be nil.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
invalid_properties
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Check to see if the all the properties in the model are valid
|
|
103
|
+
# @return true if the model is valid
|
|
104
|
+
def valid?
|
|
105
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
106
|
+
return false if @start.nil?
|
|
107
|
+
return false if @_end.nil?
|
|
108
|
+
true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] start Value to be assigned
|
|
113
|
+
def start=(start)
|
|
114
|
+
if start.nil?
|
|
115
|
+
fail ArgumentError, 'start cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@start = start
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] _end Value to be assigned
|
|
123
|
+
def _end=(_end)
|
|
124
|
+
if _end.nil?
|
|
125
|
+
fail ArgumentError, '_end cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@_end = _end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
start == o.start &&
|
|
137
|
+
_end == o._end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @see the `==` method
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def eql?(o)
|
|
143
|
+
self == o
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Calculates hash code according to all attributes.
|
|
147
|
+
# @return [Integer] Hash code
|
|
148
|
+
def hash
|
|
149
|
+
[start, _end].hash
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def self.build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
158
|
+
transformed_hash = {}
|
|
159
|
+
openapi_types.each_pair do |key, type|
|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = nil
|
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
163
|
+
# check to ensure the input is an array given that the attribute
|
|
164
|
+
# is documented as an array but the input is not
|
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
167
|
+
end
|
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
new(transformed_hash)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
if value.nil?
|
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
hash[param] = _to_hash(value)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|
|
@@ -14,11 +14,14 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
# Body for `PUT /v1/channels/booking/availability`.
|
|
17
|
+
# Body for `PUT /v1/channels/booking/availability`. `type` selects which of Booking.com's writes to perform. Date ranges are inclusive at both ends everywhere in this body.
|
|
18
18
|
class BookingAvailabilityUpdateRequest < ApiModelBase
|
|
19
|
-
# `rates` →
|
|
19
|
+
# `rates` → nightly prices (+ any restrictions sent with them), written at an explicit `occupancy`; `availability` → inventory, stop-sell and restrictions; `derived-pricing` → occupancy-derived pricing rules. A rates update may not carry `roomsToSell`: inventory is an `availability` write.
|
|
20
20
|
attr_accessor :type
|
|
21
21
|
|
|
22
|
+
# Only for `type: \"rates\"`. Default `true`: after the write the affected nights are read back off Booking.com so `applied` can say `verified` or `mismatch`. Send `false` to skip the read (one fewer Booking.com call); the response then reports `applied: \"unverified\"`.
|
|
23
|
+
attr_accessor :verify
|
|
24
|
+
|
|
22
25
|
attr_accessor :property_id
|
|
23
26
|
|
|
24
27
|
# For `type: \"rates\"` each item is a `BookingPricingRateUpdate`; for `type: \"availability\"` a `BookingAvailabilityUpdate`; for `type: \"derived-pricing\"` a derived-price rule set.
|
|
@@ -28,6 +31,7 @@ module Repull
|
|
|
28
31
|
def self.attribute_map
|
|
29
32
|
{
|
|
30
33
|
:'type' => :'type',
|
|
34
|
+
:'verify' => :'verify',
|
|
31
35
|
:'property_id' => :'property_id',
|
|
32
36
|
:'updates' => :'updates'
|
|
33
37
|
}
|
|
@@ -47,6 +51,7 @@ module Repull
|
|
|
47
51
|
def self.openapi_types
|
|
48
52
|
{
|
|
49
53
|
:'type' => :'String',
|
|
54
|
+
:'verify' => :'Boolean',
|
|
50
55
|
:'property_id' => :'BookingAvailabilityUpdateRequestPropertyId',
|
|
51
56
|
:'updates' => :'Array<BookingAvailabilityUpdateRequestUpdatesInner>'
|
|
52
57
|
}
|
|
@@ -55,6 +60,7 @@ module Repull
|
|
|
55
60
|
# List of attributes with nullable: true
|
|
56
61
|
def self.openapi_nullable
|
|
57
62
|
Set.new([
|
|
63
|
+
:'verify',
|
|
58
64
|
])
|
|
59
65
|
end
|
|
60
66
|
|
|
@@ -80,6 +86,10 @@ module Repull
|
|
|
80
86
|
self.type = nil
|
|
81
87
|
end
|
|
82
88
|
|
|
89
|
+
if attributes.key?(:'verify')
|
|
90
|
+
self.verify = attributes[:'verify']
|
|
91
|
+
end
|
|
92
|
+
|
|
83
93
|
if attributes.key?(:'property_id')
|
|
84
94
|
self.property_id = attributes[:'property_id']
|
|
85
95
|
else
|
|
@@ -170,6 +180,7 @@ module Repull
|
|
|
170
180
|
return true if self.equal?(o)
|
|
171
181
|
self.class == o.class &&
|
|
172
182
|
type == o.type &&
|
|
183
|
+
verify == o.verify &&
|
|
173
184
|
property_id == o.property_id &&
|
|
174
185
|
updates == o.updates
|
|
175
186
|
end
|
|
@@ -183,7 +194,7 @@ module Repull
|
|
|
183
194
|
# Calculates hash code according to all attributes.
|
|
184
195
|
# @return [Integer] Hash code
|
|
185
196
|
def hash
|
|
186
|
-
[type, property_id, updates].hash
|
|
197
|
+
[type, verify, property_id, updates].hash
|
|
187
198
|
end
|
|
188
199
|
|
|
189
200
|
# Builds the object from hash
|
|
@@ -14,25 +14,29 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
# A single (room, rate-plan, date-range) update
|
|
17
|
+
# A single (room, rate-plan, date-range) price update. The amount is written against the party size in `occupancy`, for every night from `dateRange.start` to `dateRange.end` inclusive.
|
|
18
18
|
class BookingPricingRateUpdate < ApiModelBase
|
|
19
|
-
# Booking.com room
|
|
19
|
+
# Booking.com room id the rate plan sells. `GET /v1/channels/booking/properties/{id}/rooms` lists them.
|
|
20
20
|
attr_accessor :room_id
|
|
21
21
|
|
|
22
|
-
# Booking.com rate-plan
|
|
22
|
+
# Booking.com rate-plan id.
|
|
23
23
|
attr_accessor :rate_id
|
|
24
24
|
|
|
25
25
|
attr_accessor :date_range
|
|
26
26
|
|
|
27
|
+
# Nightly amount, in `currency`, for a party of `occupancy`.
|
|
27
28
|
attr_accessor :price
|
|
28
29
|
|
|
30
|
+
# Currency the rate plan is sold in.
|
|
29
31
|
attr_accessor :currency
|
|
30
32
|
|
|
33
|
+
# Optional single-occupancy amount, written alongside the main amount.
|
|
31
34
|
attr_accessor :single_price
|
|
32
35
|
|
|
36
|
+
# The party size this rate plan prices — a key, not a preference. Booking.com stores the amount against this number: above the rate plan's own maximum it declines the price in silence and the night keeps its old value; below it, it answers 400 and the old price stays published. Omit it and Repull resolves it from Booking.com's own data for this (room, rate plan) and echoes the value and its source back in `occupancy[]`. When it cannot be resolved the write is refused with `422` naming `updates[N].occupancy` — a price is never sent at a guessed party size.
|
|
33
37
|
attr_accessor :occupancy
|
|
34
38
|
|
|
35
|
-
#
|
|
39
|
+
# Refused. A rate update carries prices only; sending this returns `422 inventory_not_in_rate_update` naming `updates[N].roomsToSell`. Write inventory with `type: \"availability\"` and `availableRooms` (plus `closed: true` for a stop-sell).
|
|
36
40
|
attr_accessor :rooms_to_sell
|
|
37
41
|
|
|
38
42
|
attr_accessor :restrictions
|
|
@@ -170,10 +174,18 @@ module Repull
|
|
|
170
174
|
invalid_properties.push('invalid value for "price", price cannot be nil.')
|
|
171
175
|
end
|
|
172
176
|
|
|
177
|
+
if @price < 0
|
|
178
|
+
invalid_properties.push('invalid value for "price", must be greater than or equal to 0.')
|
|
179
|
+
end
|
|
180
|
+
|
|
173
181
|
if @currency.nil?
|
|
174
182
|
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
|
175
183
|
end
|
|
176
184
|
|
|
185
|
+
if !@occupancy.nil? && @occupancy < 1
|
|
186
|
+
invalid_properties.push('invalid value for "occupancy", must be greater than or equal to 1.')
|
|
187
|
+
end
|
|
188
|
+
|
|
177
189
|
invalid_properties
|
|
178
190
|
end
|
|
179
191
|
|
|
@@ -185,7 +197,9 @@ module Repull
|
|
|
185
197
|
return false if @rate_id.nil?
|
|
186
198
|
return false if @date_range.nil?
|
|
187
199
|
return false if @price.nil?
|
|
200
|
+
return false if @price < 0
|
|
188
201
|
return false if @currency.nil?
|
|
202
|
+
return false if !@occupancy.nil? && @occupancy < 1
|
|
189
203
|
true
|
|
190
204
|
end
|
|
191
205
|
|
|
@@ -226,6 +240,10 @@ module Repull
|
|
|
226
240
|
fail ArgumentError, 'price cannot be nil'
|
|
227
241
|
end
|
|
228
242
|
|
|
243
|
+
if price < 0
|
|
244
|
+
fail ArgumentError, 'invalid value for "price", must be greater than or equal to 0.'
|
|
245
|
+
end
|
|
246
|
+
|
|
229
247
|
@price = price
|
|
230
248
|
end
|
|
231
249
|
|
|
@@ -239,6 +257,16 @@ module Repull
|
|
|
239
257
|
@currency = currency
|
|
240
258
|
end
|
|
241
259
|
|
|
260
|
+
# Custom attribute writer method with validation
|
|
261
|
+
# @param [Object] occupancy Value to be assigned
|
|
262
|
+
def occupancy=(occupancy)
|
|
263
|
+
if !occupancy.nil? && occupancy < 1
|
|
264
|
+
fail ArgumentError, 'invalid value for "occupancy", must be greater than or equal to 1.'
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
@occupancy = occupancy
|
|
268
|
+
end
|
|
269
|
+
|
|
242
270
|
# Checks equality by comparing each attribute.
|
|
243
271
|
# @param [Object] Object to be compared
|
|
244
272
|
def ==(o)
|
|
@@ -14,9 +14,12 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
+
# The nights this update applies to. **Both ends are inclusive**: `{ \"start\": \"2026-11-04\", \"end\": \"2026-11-04\" }` writes exactly one night.
|
|
17
18
|
class BookingPricingRateUpdateDateRange < ApiModelBase
|
|
19
|
+
# First night, YYYY-MM-DD.
|
|
18
20
|
attr_accessor :start
|
|
19
21
|
|
|
22
|
+
# Last night, YYYY-MM-DD, inclusive — the same date as `start` for a single night.
|
|
20
23
|
attr_accessor :_end
|
|
21
24
|
|
|
22
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -14,33 +14,33 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
#
|
|
17
|
+
# Length-of-stay and arrival restrictions for the nights in this update. Omit a field to leave that restriction untouched — nothing you do not state is changed. These are written on Booking.com's availability notification, which is the wire that carries a restriction when no inventory changes hands. Sending them alongside a price is supported: the prices and the restrictions are two writes, and the response reports each one separately (`price` and `restrictions`), so a half that lands is never reported as a failure and a half that is refused is never reported as applied. Three restrictions are refused with `422 restriction_not_supported` naming the field: Booking.com's notification has no element for them, and dropping a restriction you stated would be worse than refusing it. Set those on the rate plan in the Booking.com Extranet.
|
|
18
18
|
class BookingPricingRateUpdateRestrictions < ApiModelBase
|
|
19
|
-
# Minimum length of stay
|
|
19
|
+
# Minimum length of stay. Booking.com stores a 1-night minimum as no minimum at all, so `minStay: 1` reads back as `0` and is reported as applied.
|
|
20
20
|
attr_accessor :min_stay
|
|
21
21
|
|
|
22
|
-
# Maximum length of stay
|
|
22
|
+
# Maximum length of stay.
|
|
23
23
|
attr_accessor :max_stay
|
|
24
24
|
|
|
25
|
-
# Closed-to-arrival — guests may not check in on the
|
|
25
|
+
# Closed-to-arrival — guests may not check in on these nights. `false` clears the flag; omit the field to leave it as it is.
|
|
26
26
|
attr_accessor :closed_to_arrival
|
|
27
27
|
|
|
28
|
-
# Closed-to-departure — guests may not check out on the
|
|
28
|
+
# Closed-to-departure — guests may not check out on these nights. `false` clears the flag; omit the field to leave it as it is.
|
|
29
29
|
attr_accessor :closed_to_departure
|
|
30
30
|
|
|
31
|
-
# Arrival-based minimum length of stay
|
|
31
|
+
# Arrival-based minimum length of stay — applies to stays that START on these nights, rather than any stay covering them.
|
|
32
32
|
attr_accessor :min_stay_arrival
|
|
33
33
|
|
|
34
|
-
# Arrival-based maximum length of stay
|
|
34
|
+
# Arrival-based maximum length of stay.
|
|
35
35
|
attr_accessor :max_stay_arrival
|
|
36
36
|
|
|
37
|
-
#
|
|
37
|
+
# Refused. Booking.com's restriction notification has no element for an exact arrival-based stay length, so it cannot be written through the API; sending it returns `422 restriction_not_supported` naming `updates[N].restrictions.exactStayArrival`. Set it on the rate plan in the Booking.com Extranet.
|
|
38
38
|
attr_accessor :exact_stay_arrival
|
|
39
39
|
|
|
40
|
-
#
|
|
40
|
+
# Refused, for the same reason as `exactStayArrival` — returns `422 restriction_not_supported`. Set the minimum advance-reservation window on the rate plan in the Booking.com Extranet.
|
|
41
41
|
attr_accessor :min_advance_res
|
|
42
42
|
|
|
43
|
-
#
|
|
43
|
+
# Refused, for the same reason as `exactStayArrival` — returns `422 restriction_not_supported`. Set the maximum advance-reservation window on the rate plan in the Booking.com Extranet.
|
|
44
44
|
attr_accessor :max_advance_res
|
|
45
45
|
|
|
46
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -20,11 +20,15 @@ module Repull
|
|
|
20
20
|
|
|
21
21
|
attr_accessor :listing_id
|
|
22
22
|
|
|
23
|
+
# Other Booking.com properties this listing is also published under. Empty in the normal case. Pass one as `?hotel_id=` to read its pricing instead.
|
|
24
|
+
attr_accessor :other_hotel_ids
|
|
25
|
+
|
|
23
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
27
|
def self.attribute_map
|
|
25
28
|
{
|
|
26
29
|
:'hotel_id' => :'hotelId',
|
|
27
|
-
:'listing_id' => :'listingId'
|
|
30
|
+
:'listing_id' => :'listingId',
|
|
31
|
+
:'other_hotel_ids' => :'otherHotelIds'
|
|
28
32
|
}
|
|
29
33
|
end
|
|
30
34
|
|
|
@@ -42,7 +46,8 @@ module Repull
|
|
|
42
46
|
def self.openapi_types
|
|
43
47
|
{
|
|
44
48
|
:'hotel_id' => :'String',
|
|
45
|
-
:'listing_id' => :'String'
|
|
49
|
+
:'listing_id' => :'String',
|
|
50
|
+
:'other_hotel_ids' => :'Array<String>'
|
|
46
51
|
}
|
|
47
52
|
end
|
|
48
53
|
|
|
@@ -75,6 +80,12 @@ module Repull
|
|
|
75
80
|
if attributes.key?(:'listing_id')
|
|
76
81
|
self.listing_id = attributes[:'listing_id']
|
|
77
82
|
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'other_hotel_ids')
|
|
85
|
+
if (value = attributes[:'other_hotel_ids']).is_a?(Array)
|
|
86
|
+
self.other_hotel_ids = value
|
|
87
|
+
end
|
|
88
|
+
end
|
|
78
89
|
end
|
|
79
90
|
|
|
80
91
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -98,7 +109,8 @@ module Repull
|
|
|
98
109
|
return true if self.equal?(o)
|
|
99
110
|
self.class == o.class &&
|
|
100
111
|
hotel_id == o.hotel_id &&
|
|
101
|
-
listing_id == o.listing_id
|
|
112
|
+
listing_id == o.listing_id &&
|
|
113
|
+
other_hotel_ids == o.other_hotel_ids
|
|
102
114
|
end
|
|
103
115
|
|
|
104
116
|
# @see the `==` method
|
|
@@ -110,7 +122,7 @@ module Repull
|
|
|
110
122
|
# Calculates hash code according to all attributes.
|
|
111
123
|
# @return [Integer] Hash code
|
|
112
124
|
def hash
|
|
113
|
-
[hotel_id, listing_id].hash
|
|
125
|
+
[hotel_id, listing_id, other_hotel_ids].hash
|
|
114
126
|
end
|
|
115
127
|
|
|
116
128
|
# Builds the object from hash
|
|
@@ -14,31 +14,53 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
+
# What a Booking.com rate write actually did. Returned by `PUT /v1/channels/booking/listings/{id}/pricing` and by `PUT /v1/channels/booking/availability` with `type: \"rates\"`. Prices and restrictions are two writes on two of Booking.com's wires, and Booking.com can take one and refuse the other. The response says so: `price` and `restrictions` each carry their own state, their own read-back and — when refused — Booking.com's own reason. The top-level `applied` summarises them, and is `partial` when they disagree. A half that landed is never reported as a failure.
|
|
17
18
|
class BookingPricingUpdateResponse < ApiModelBase
|
|
18
19
|
attr_accessor :hotel_id
|
|
19
20
|
|
|
20
21
|
attr_accessor :listing_id
|
|
21
22
|
|
|
22
|
-
#
|
|
23
|
-
attr_accessor :
|
|
23
|
+
# Echoed back by `PUT /v1/channels/booking/availability`.
|
|
24
|
+
attr_accessor :property_id
|
|
24
25
|
|
|
26
|
+
# How many updates were sent.
|
|
25
27
|
attr_accessor :requested
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
attr_accessor :occupancy
|
|
30
|
+
|
|
31
|
+
# What is known about the nights now. `verified` — read back, every night carries what was sent. `mismatch` — read back, some do not (`verification.rows` / `restrictions.verification.rows` name them). `rejected` — Booking.com refused everything that was sent. `partial` — one half landed and the other did not; read `price.applied` and `restrictions.applied` to see which, and `restrictions.rejection.message` for Booking.com's reason. `unverified` — Booking.com acknowledged the request and no read-back ran: an unknown, not a success. A bare acknowledgement is never reported as \"all applied\".
|
|
32
|
+
attr_accessor :applied
|
|
33
|
+
|
|
34
|
+
attr_accessor :price
|
|
35
|
+
|
|
36
|
+
attr_accessor :restrictions
|
|
37
|
+
|
|
38
|
+
attr_accessor :verification
|
|
39
|
+
|
|
40
|
+
# Booking.com's own answers, verbatim: `rates` (the rate-amount notification) and `restrictions` (the availability notification, when the updates carried any restriction).
|
|
41
|
+
attr_accessor :booking
|
|
42
|
+
|
|
43
|
+
# Failures Booking.com named, across both wires. Empty means Booking.com named none — not that the nights changed; that is what `applied` is for.
|
|
28
44
|
attr_accessor :errors
|
|
29
45
|
|
|
30
|
-
#
|
|
31
|
-
attr_accessor :
|
|
46
|
+
# Present when Booking.com's rate-plan read did not complete, so an occupancy fell back to the room definition.
|
|
47
|
+
attr_accessor :rate_plan_read_error
|
|
32
48
|
|
|
33
49
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
50
|
def self.attribute_map
|
|
35
51
|
{
|
|
36
52
|
:'hotel_id' => :'hotelId',
|
|
37
53
|
:'listing_id' => :'listingId',
|
|
38
|
-
:'
|
|
54
|
+
:'property_id' => :'propertyId',
|
|
39
55
|
:'requested' => :'requested',
|
|
56
|
+
:'occupancy' => :'occupancy',
|
|
57
|
+
:'applied' => :'applied',
|
|
58
|
+
:'price' => :'price',
|
|
59
|
+
:'restrictions' => :'restrictions',
|
|
60
|
+
:'verification' => :'verification',
|
|
61
|
+
:'booking' => :'booking',
|
|
40
62
|
:'errors' => :'errors',
|
|
41
|
-
:'
|
|
63
|
+
:'rate_plan_read_error' => :'ratePlanReadError'
|
|
42
64
|
}
|
|
43
65
|
end
|
|
44
66
|
|
|
@@ -57,16 +79,26 @@ module Repull
|
|
|
57
79
|
{
|
|
58
80
|
:'hotel_id' => :'String',
|
|
59
81
|
:'listing_id' => :'String',
|
|
60
|
-
:'
|
|
82
|
+
:'property_id' => :'String',
|
|
61
83
|
:'requested' => :'Integer',
|
|
84
|
+
:'occupancy' => :'Array<BookingRateWriteOccupancy>',
|
|
85
|
+
:'applied' => :'String',
|
|
86
|
+
:'price' => :'BookingRateWritePriceHalf',
|
|
87
|
+
:'restrictions' => :'BookingRateWriteRestrictionHalf',
|
|
88
|
+
:'verification' => :'BookingRateWriteVerification',
|
|
89
|
+
:'booking' => :'Hash<String, Object>',
|
|
62
90
|
:'errors' => :'Array<Hash<String, Object>>',
|
|
63
|
-
:'
|
|
91
|
+
:'rate_plan_read_error' => :'String'
|
|
64
92
|
}
|
|
65
93
|
end
|
|
66
94
|
|
|
67
95
|
# List of attributes with nullable: true
|
|
68
96
|
def self.openapi_nullable
|
|
69
97
|
Set.new([
|
|
98
|
+
:'hotel_id',
|
|
99
|
+
:'listing_id',
|
|
100
|
+
:'property_id',
|
|
101
|
+
:'rate_plan_read_error'
|
|
70
102
|
])
|
|
71
103
|
end
|
|
72
104
|
|
|
@@ -94,24 +126,50 @@ module Repull
|
|
|
94
126
|
self.listing_id = attributes[:'listing_id']
|
|
95
127
|
end
|
|
96
128
|
|
|
97
|
-
if attributes.key?(:'
|
|
98
|
-
self.
|
|
129
|
+
if attributes.key?(:'property_id')
|
|
130
|
+
self.property_id = attributes[:'property_id']
|
|
99
131
|
end
|
|
100
132
|
|
|
101
133
|
if attributes.key?(:'requested')
|
|
102
134
|
self.requested = attributes[:'requested']
|
|
103
135
|
end
|
|
104
136
|
|
|
137
|
+
if attributes.key?(:'occupancy')
|
|
138
|
+
if (value = attributes[:'occupancy']).is_a?(Array)
|
|
139
|
+
self.occupancy = value
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'applied')
|
|
144
|
+
self.applied = attributes[:'applied']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'price')
|
|
148
|
+
self.price = attributes[:'price']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'restrictions')
|
|
152
|
+
self.restrictions = attributes[:'restrictions']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'verification')
|
|
156
|
+
self.verification = attributes[:'verification']
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'booking')
|
|
160
|
+
if (value = attributes[:'booking']).is_a?(Hash)
|
|
161
|
+
self.booking = value
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
105
165
|
if attributes.key?(:'errors')
|
|
106
166
|
if (value = attributes[:'errors']).is_a?(Array)
|
|
107
167
|
self.errors = value
|
|
108
168
|
end
|
|
109
169
|
end
|
|
110
170
|
|
|
111
|
-
if attributes.key?(:'
|
|
112
|
-
|
|
113
|
-
self.raw = value
|
|
114
|
-
end
|
|
171
|
+
if attributes.key?(:'rate_plan_read_error')
|
|
172
|
+
self.rate_plan_read_error = attributes[:'rate_plan_read_error']
|
|
115
173
|
end
|
|
116
174
|
end
|
|
117
175
|
|
|
@@ -137,10 +195,16 @@ module Repull
|
|
|
137
195
|
self.class == o.class &&
|
|
138
196
|
hotel_id == o.hotel_id &&
|
|
139
197
|
listing_id == o.listing_id &&
|
|
140
|
-
|
|
198
|
+
property_id == o.property_id &&
|
|
141
199
|
requested == o.requested &&
|
|
200
|
+
occupancy == o.occupancy &&
|
|
201
|
+
applied == o.applied &&
|
|
202
|
+
price == o.price &&
|
|
203
|
+
restrictions == o.restrictions &&
|
|
204
|
+
verification == o.verification &&
|
|
205
|
+
booking == o.booking &&
|
|
142
206
|
errors == o.errors &&
|
|
143
|
-
|
|
207
|
+
rate_plan_read_error == o.rate_plan_read_error
|
|
144
208
|
end
|
|
145
209
|
|
|
146
210
|
# @see the `==` method
|
|
@@ -152,7 +216,7 @@ module Repull
|
|
|
152
216
|
# Calculates hash code according to all attributes.
|
|
153
217
|
# @return [Integer] Hash code
|
|
154
218
|
def hash
|
|
155
|
-
[hotel_id, listing_id,
|
|
219
|
+
[hotel_id, listing_id, property_id, requested, occupancy, applied, price, restrictions, verification, booking, errors, rate_plan_read_error].hash
|
|
156
220
|
end
|
|
157
221
|
|
|
158
222
|
# Builds the object from hash
|