repull 0.2.15 → 0.2.17
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 +149 -54
- data/lib/repull/api/billing_api.rb +4 -4
- data/lib/repull/api/booking_com_api.rb +122 -29
- 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 +186 -16
- 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_publish_result.rb +41 -2
- data/lib/repull/models/airbnb_reservation_action200_response.rb +157 -0
- data/lib/repull/models/airbnb_reservation_action_request.rb +248 -0
- 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_action_request.rb +176 -0
- data/lib/repull/models/booking_property_action_response.rb +281 -0
- data/lib/repull/models/booking_property_listings_inner.rb +244 -0
- data/lib/repull/models/booking_publish_result.rb +245 -0
- data/lib/repull/models/booking_publish_section_error.rb +220 -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_setup_request.rb +44 -5
- data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -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/channel_market_state_item.rb +291 -0
- data/lib/repull/models/conversation_message_attachment.rb +28 -1
- 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/error_error.rb +11 -1
- 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_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_address_readiness.rb +171 -0
- data/lib/repull/models/listing_content_update_request_address.rb +40 -3
- data/lib/repull/models/listing_create_request.rb +48 -2
- 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_market_state_request.rb +149 -0
- data/lib/repull/models/listing_market_state_response.rb +221 -0
- data/lib/repull/models/listing_publish_booking_request.rb +149 -0
- data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
- data/lib/repull/models/listing_publish_status_channel.rb +32 -1
- data/lib/repull/models/listing_publish_status_connection.rb +17 -5
- data/lib/repull/models/listing_publish_status_response.rb +13 -1
- 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/replay_webhook_delivery_request.rb +150 -0
- data/lib/repull/models/repull_ping_event.rb +95 -31
- data/lib/repull/models/reservation.rb +22 -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/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/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 +71 -1
- data/openapi/v1.json +19706 -13248
- data/scripts/regen.sh +1 -1
- metadata +73 -3
|
@@ -0,0 +1,291 @@
|
|
|
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 happened on ONE channel item — one Airbnb connection, or one Booking.com property. A listing can carry several Airbnb connections (a re-list, or a move between host accounts) and each gets its own entry.
|
|
18
|
+
class ChannelMarketStateItem < ApiModelBase
|
|
19
|
+
attr_accessor :channel
|
|
20
|
+
|
|
21
|
+
# **What is now true of this item**, not what you asked for. `offline` — it is off the market. `online` — it is back on. `unchanged` — nothing was sent, or what was sent did not take; `code` and `message` say why. `unchanged` never means \"it was already like that\": it means we did not put it there, and it is still in whatever state it was in before the call.
|
|
22
|
+
attr_accessor :state
|
|
23
|
+
|
|
24
|
+
# True only when the channel confirmed the change.
|
|
25
|
+
attr_accessor :ok
|
|
26
|
+
|
|
27
|
+
# Airbnb connection row id — the `id` from `GET /v1/channels/airbnb/listings/{id}`. Present on Airbnb items.
|
|
28
|
+
attr_accessor :connection_id
|
|
29
|
+
|
|
30
|
+
# The Booking.com property acted on. Present on Booking.com items; null when the property could not be resolved.
|
|
31
|
+
attr_accessor :hotel_id
|
|
32
|
+
|
|
33
|
+
# Error code when `ok` is false — the SAME code the channel-specific endpoint returns for this failure, so one vocabulary covers both surfaces. Absent when `ok` is true. The channel codes come in pairs, and the pair is the retryable split — the most useful bit in the whole item: - `airbnb_rejected` / `booking_rejected` — the channel refused the request AS SENT. `message` carries its own reason. Correct it and send again; resending the same thing is refused again. - `airbnb_error` / `booking_error` — the channel did not complete the request (outage, timeout, server error). Nothing about the request needs to change: retry with backoff. Plus `ambiguous_booking_mapping` (name the property with `hotelId`) and `payment_required` (a billing refusal, which keeps its own code rather than being buried under a channel one).
|
|
34
|
+
attr_accessor :code
|
|
35
|
+
|
|
36
|
+
# The `code` this item used to carry, for callers still branching on the old string. A migration aid with a deprecation window — **`code` is canonical.** This fan-out reaches Airbnb through an internal hop that flattens a refusal into its own 500, so an unambiguous Airbnb 400 (\"Please specify a valid room type\") was reported as `airbnb_error` — whose published advice is to retry with backoff, forever, for something Airbnb will never accept. It now reads Airbnb's real status and answers `airbnb_rejected`, and the classification covers the whole 4xx range rather than only `400`. Items whose code changed carry `previousCode`. **Removed in v2.**
|
|
37
|
+
attr_accessor :previous_code
|
|
38
|
+
|
|
39
|
+
# The channel's own reason, verbatim. Absent when `ok` is true.
|
|
40
|
+
attr_accessor :message
|
|
41
|
+
|
|
42
|
+
# What to do about it, phrased for the direction you asked for — \"still live and taking bookings\" and \"still down\" call for different reactions. Absent when `ok` is true.
|
|
43
|
+
attr_accessor :fix
|
|
44
|
+
|
|
45
|
+
# Airbnb only, and only when going offline: the listing was READ BACK after the deactivation and confirmed down. Airbnb accepts a deactivation and leaves some listings live, so \"we sent the request\" is a weaker claim than this one and is never reported as success.
|
|
46
|
+
attr_accessor :verified
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'channel' => :'channel',
|
|
52
|
+
:'state' => :'state',
|
|
53
|
+
:'ok' => :'ok',
|
|
54
|
+
:'connection_id' => :'connectionId',
|
|
55
|
+
:'hotel_id' => :'hotelId',
|
|
56
|
+
:'code' => :'code',
|
|
57
|
+
:'previous_code' => :'previousCode',
|
|
58
|
+
:'message' => :'message',
|
|
59
|
+
:'fix' => :'fix',
|
|
60
|
+
:'verified' => :'verified'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns attribute mapping this model knows about
|
|
65
|
+
def self.acceptable_attribute_map
|
|
66
|
+
attribute_map
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns all the JSON keys this model knows about
|
|
70
|
+
def self.acceptable_attributes
|
|
71
|
+
acceptable_attribute_map.values
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Attribute type mapping.
|
|
75
|
+
def self.openapi_types
|
|
76
|
+
{
|
|
77
|
+
:'channel' => :'String',
|
|
78
|
+
:'state' => :'String',
|
|
79
|
+
:'ok' => :'Boolean',
|
|
80
|
+
:'connection_id' => :'String',
|
|
81
|
+
:'hotel_id' => :'String',
|
|
82
|
+
:'code' => :'String',
|
|
83
|
+
:'previous_code' => :'String',
|
|
84
|
+
:'message' => :'String',
|
|
85
|
+
:'fix' => :'String',
|
|
86
|
+
:'verified' => :'Boolean'
|
|
87
|
+
}
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# List of attributes with nullable: true
|
|
91
|
+
def self.openapi_nullable
|
|
92
|
+
Set.new([
|
|
93
|
+
:'connection_id',
|
|
94
|
+
:'hotel_id',
|
|
95
|
+
])
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Initializes the object
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
def initialize(attributes = {})
|
|
101
|
+
if (!attributes.is_a?(Hash))
|
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ChannelMarketStateItem` initialize method"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
106
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ChannelMarketStateItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
110
|
+
end
|
|
111
|
+
h[k.to_sym] = v
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'channel')
|
|
115
|
+
self.channel = attributes[:'channel']
|
|
116
|
+
else
|
|
117
|
+
self.channel = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'state')
|
|
121
|
+
self.state = attributes[:'state']
|
|
122
|
+
else
|
|
123
|
+
self.state = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'ok')
|
|
127
|
+
self.ok = attributes[:'ok']
|
|
128
|
+
else
|
|
129
|
+
self.ok = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'connection_id')
|
|
133
|
+
self.connection_id = attributes[:'connection_id']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'hotel_id')
|
|
137
|
+
self.hotel_id = attributes[:'hotel_id']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'code')
|
|
141
|
+
self.code = attributes[:'code']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'previous_code')
|
|
145
|
+
self.previous_code = attributes[:'previous_code']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'message')
|
|
149
|
+
self.message = attributes[:'message']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'fix')
|
|
153
|
+
self.fix = attributes[:'fix']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'verified')
|
|
157
|
+
self.verified = attributes[:'verified']
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
162
|
+
# @return Array for valid properties with the reasons
|
|
163
|
+
def list_invalid_properties
|
|
164
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
165
|
+
invalid_properties = Array.new
|
|
166
|
+
if @channel.nil?
|
|
167
|
+
invalid_properties.push('invalid value for "channel", channel cannot be nil.')
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if @state.nil?
|
|
171
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if @ok.nil?
|
|
175
|
+
invalid_properties.push('invalid value for "ok", ok cannot be nil.')
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
invalid_properties
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Check to see if the all the properties in the model are valid
|
|
182
|
+
# @return true if the model is valid
|
|
183
|
+
def valid?
|
|
184
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
185
|
+
return false if @channel.nil?
|
|
186
|
+
return false if @state.nil?
|
|
187
|
+
return false if @ok.nil?
|
|
188
|
+
true
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] channel Value to be assigned
|
|
193
|
+
def channel=(channel)
|
|
194
|
+
if channel.nil?
|
|
195
|
+
fail ArgumentError, 'channel cannot be nil'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@channel = channel
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] state Value to be assigned
|
|
203
|
+
def state=(state)
|
|
204
|
+
if state.nil?
|
|
205
|
+
fail ArgumentError, 'state cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@state = state
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] ok Value to be assigned
|
|
213
|
+
def ok=(ok)
|
|
214
|
+
if ok.nil?
|
|
215
|
+
fail ArgumentError, 'ok cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@ok = ok
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Checks equality by comparing each attribute.
|
|
222
|
+
# @param [Object] Object to be compared
|
|
223
|
+
def ==(o)
|
|
224
|
+
return true if self.equal?(o)
|
|
225
|
+
self.class == o.class &&
|
|
226
|
+
channel == o.channel &&
|
|
227
|
+
state == o.state &&
|
|
228
|
+
ok == o.ok &&
|
|
229
|
+
connection_id == o.connection_id &&
|
|
230
|
+
hotel_id == o.hotel_id &&
|
|
231
|
+
code == o.code &&
|
|
232
|
+
previous_code == o.previous_code &&
|
|
233
|
+
message == o.message &&
|
|
234
|
+
fix == o.fix &&
|
|
235
|
+
verified == o.verified
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# @see the `==` method
|
|
239
|
+
# @param [Object] Object to be compared
|
|
240
|
+
def eql?(o)
|
|
241
|
+
self == o
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Calculates hash code according to all attributes.
|
|
245
|
+
# @return [Integer] Hash code
|
|
246
|
+
def hash
|
|
247
|
+
[channel, state, ok, connection_id, hotel_id, code, previous_code, message, fix, verified].hash
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Builds the object from hash
|
|
251
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
252
|
+
# @return [Object] Returns the model itself
|
|
253
|
+
def self.build_from_hash(attributes)
|
|
254
|
+
return nil unless attributes.is_a?(Hash)
|
|
255
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
256
|
+
transformed_hash = {}
|
|
257
|
+
openapi_types.each_pair do |key, type|
|
|
258
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
259
|
+
transformed_hash["#{key}"] = nil
|
|
260
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
261
|
+
# check to ensure the input is an array given that the attribute
|
|
262
|
+
# is documented as an array but the input is not
|
|
263
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
264
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
265
|
+
end
|
|
266
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
267
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
new(transformed_hash)
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Returns the object in the form of hash
|
|
274
|
+
# @return [Hash] Returns the object in the form of hash
|
|
275
|
+
def to_hash
|
|
276
|
+
hash = {}
|
|
277
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
278
|
+
value = self.send(attr)
|
|
279
|
+
if value.nil?
|
|
280
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
281
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
hash[param] = _to_hash(value)
|
|
285
|
+
end
|
|
286
|
+
hash
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
end
|
|
@@ -14,11 +14,19 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
+
# A file on a message — a photo the guest sent, or a file sent to the guest. Files are copied to durable storage, so `url` keeps working after the channel's own link expires. Treat `url` as opaque.
|
|
17
18
|
class ConversationMessageAttachment < ApiModelBase
|
|
18
19
|
attr_accessor :id
|
|
19
20
|
|
|
21
|
+
# Where to download the file.
|
|
22
|
+
attr_accessor :url
|
|
23
|
+
|
|
24
|
+
# Same value as `url` (kept for older clients; it is not image-only). Use `url`.
|
|
20
25
|
attr_accessor :image_url
|
|
21
26
|
|
|
27
|
+
# Coarse kind, derived from `contentType`.
|
|
28
|
+
attr_accessor :type
|
|
29
|
+
|
|
22
30
|
attr_accessor :content_type
|
|
23
31
|
|
|
24
32
|
attr_accessor :created_at
|
|
@@ -27,7 +35,9 @@ module Repull
|
|
|
27
35
|
def self.attribute_map
|
|
28
36
|
{
|
|
29
37
|
:'id' => :'id',
|
|
38
|
+
:'url' => :'url',
|
|
30
39
|
:'image_url' => :'imageUrl',
|
|
40
|
+
:'type' => :'type',
|
|
31
41
|
:'content_type' => :'contentType',
|
|
32
42
|
:'created_at' => :'createdAt'
|
|
33
43
|
}
|
|
@@ -47,7 +57,9 @@ module Repull
|
|
|
47
57
|
def self.openapi_types
|
|
48
58
|
{
|
|
49
59
|
:'id' => :'String',
|
|
60
|
+
:'url' => :'String',
|
|
50
61
|
:'image_url' => :'String',
|
|
62
|
+
:'type' => :'String',
|
|
51
63
|
:'content_type' => :'String',
|
|
52
64
|
:'created_at' => :'Time'
|
|
53
65
|
}
|
|
@@ -56,6 +68,11 @@ module Repull
|
|
|
56
68
|
# List of attributes with nullable: true
|
|
57
69
|
def self.openapi_nullable
|
|
58
70
|
Set.new([
|
|
71
|
+
:'id',
|
|
72
|
+
:'url',
|
|
73
|
+
:'image_url',
|
|
74
|
+
:'content_type',
|
|
75
|
+
:'created_at'
|
|
59
76
|
])
|
|
60
77
|
end
|
|
61
78
|
|
|
@@ -79,10 +96,18 @@ module Repull
|
|
|
79
96
|
self.id = attributes[:'id']
|
|
80
97
|
end
|
|
81
98
|
|
|
99
|
+
if attributes.key?(:'url')
|
|
100
|
+
self.url = attributes[:'url']
|
|
101
|
+
end
|
|
102
|
+
|
|
82
103
|
if attributes.key?(:'image_url')
|
|
83
104
|
self.image_url = attributes[:'image_url']
|
|
84
105
|
end
|
|
85
106
|
|
|
107
|
+
if attributes.key?(:'type')
|
|
108
|
+
self.type = attributes[:'type']
|
|
109
|
+
end
|
|
110
|
+
|
|
86
111
|
if attributes.key?(:'content_type')
|
|
87
112
|
self.content_type = attributes[:'content_type']
|
|
88
113
|
end
|
|
@@ -113,7 +138,9 @@ module Repull
|
|
|
113
138
|
return true if self.equal?(o)
|
|
114
139
|
self.class == o.class &&
|
|
115
140
|
id == o.id &&
|
|
141
|
+
url == o.url &&
|
|
116
142
|
image_url == o.image_url &&
|
|
143
|
+
type == o.type &&
|
|
117
144
|
content_type == o.content_type &&
|
|
118
145
|
created_at == o.created_at
|
|
119
146
|
end
|
|
@@ -127,7 +154,7 @@ module Repull
|
|
|
127
154
|
# Calculates hash code according to all attributes.
|
|
128
155
|
# @return [Integer] Hash code
|
|
129
156
|
def hash
|
|
130
|
-
[id, image_url, content_type, created_at].hash
|
|
157
|
+
[id, url, image_url, type, content_type, created_at].hash
|
|
131
158
|
end
|
|
132
159
|
|
|
133
160
|
# Builds the object from hash
|
|
@@ -15,15 +15,29 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
17
|
class CreateAirbnbOfferRequest < ApiModelBase
|
|
18
|
-
#
|
|
18
|
+
# What to create.
|
|
19
19
|
attr_accessor :type
|
|
20
20
|
|
|
21
|
-
# Airbnb thread id
|
|
21
|
+
# Airbnb message-thread id the offer answers. (`threadId` is accepted too.)
|
|
22
22
|
attr_accessor :thread_id
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# Pre-approval only: require the guest to book through the pre-approval rather than Instant Book. (`blockInstantBooking` is accepted too.)
|
|
25
25
|
attr_accessor :block_instant_booking
|
|
26
26
|
|
|
27
|
+
# Offer only (required): the AIRBNB listing id, as a string.
|
|
28
|
+
attr_accessor :listing_id
|
|
29
|
+
|
|
30
|
+
# Offer only (required): first night.
|
|
31
|
+
attr_accessor :start_date
|
|
32
|
+
|
|
33
|
+
# Offer only (required).
|
|
34
|
+
attr_accessor :nights
|
|
35
|
+
|
|
36
|
+
# Offer only (required): total for the stay, in the listing’s Airbnb currency.
|
|
37
|
+
attr_accessor :total_price
|
|
38
|
+
|
|
39
|
+
attr_accessor :guest_details
|
|
40
|
+
|
|
27
41
|
class EnumAttributeValidator
|
|
28
42
|
attr_reader :datatype
|
|
29
43
|
attr_reader :allowable_values
|
|
@@ -50,8 +64,13 @@ module Repull
|
|
|
50
64
|
def self.attribute_map
|
|
51
65
|
{
|
|
52
66
|
:'type' => :'type',
|
|
53
|
-
:'thread_id' => :'
|
|
54
|
-
:'block_instant_booking' => :'
|
|
67
|
+
:'thread_id' => :'thread_id',
|
|
68
|
+
:'block_instant_booking' => :'block_instant_booking',
|
|
69
|
+
:'listing_id' => :'listing_id',
|
|
70
|
+
:'start_date' => :'start_date',
|
|
71
|
+
:'nights' => :'nights',
|
|
72
|
+
:'total_price' => :'total_price',
|
|
73
|
+
:'guest_details' => :'guest_details'
|
|
55
74
|
}
|
|
56
75
|
end
|
|
57
76
|
|
|
@@ -70,7 +89,12 @@ module Repull
|
|
|
70
89
|
{
|
|
71
90
|
:'type' => :'String',
|
|
72
91
|
:'thread_id' => :'String',
|
|
73
|
-
:'block_instant_booking' => :'Boolean'
|
|
92
|
+
:'block_instant_booking' => :'Boolean',
|
|
93
|
+
:'listing_id' => :'String',
|
|
94
|
+
:'start_date' => :'Date',
|
|
95
|
+
:'nights' => :'Integer',
|
|
96
|
+
:'total_price' => :'Float',
|
|
97
|
+
:'guest_details' => :'CreateAirbnbOfferRequestGuestDetails'
|
|
74
98
|
}
|
|
75
99
|
end
|
|
76
100
|
|
|
@@ -104,6 +128,8 @@ module Repull
|
|
|
104
128
|
|
|
105
129
|
if attributes.key?(:'thread_id')
|
|
106
130
|
self.thread_id = attributes[:'thread_id']
|
|
131
|
+
else
|
|
132
|
+
self.thread_id = nil
|
|
107
133
|
end
|
|
108
134
|
|
|
109
135
|
if attributes.key?(:'block_instant_booking')
|
|
@@ -111,6 +137,26 @@ module Repull
|
|
|
111
137
|
else
|
|
112
138
|
self.block_instant_booking = false
|
|
113
139
|
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'listing_id')
|
|
142
|
+
self.listing_id = attributes[:'listing_id']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'start_date')
|
|
146
|
+
self.start_date = attributes[:'start_date']
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if attributes.key?(:'nights')
|
|
150
|
+
self.nights = attributes[:'nights']
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'total_price')
|
|
154
|
+
self.total_price = attributes[:'total_price']
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'guest_details')
|
|
158
|
+
self.guest_details = attributes[:'guest_details']
|
|
159
|
+
end
|
|
114
160
|
end
|
|
115
161
|
|
|
116
162
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -122,6 +168,14 @@ module Repull
|
|
|
122
168
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
123
169
|
end
|
|
124
170
|
|
|
171
|
+
if @thread_id.nil?
|
|
172
|
+
invalid_properties.push('invalid value for "thread_id", thread_id cannot be nil.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if !@nights.nil? && @nights < 1
|
|
176
|
+
invalid_properties.push('invalid value for "nights", must be greater than or equal to 1.')
|
|
177
|
+
end
|
|
178
|
+
|
|
125
179
|
invalid_properties
|
|
126
180
|
end
|
|
127
181
|
|
|
@@ -132,6 +186,8 @@ module Repull
|
|
|
132
186
|
return false if @type.nil?
|
|
133
187
|
type_validator = EnumAttributeValidator.new('String', ["offer", "preapproval"])
|
|
134
188
|
return false unless type_validator.valid?(@type)
|
|
189
|
+
return false if @thread_id.nil?
|
|
190
|
+
return false if !@nights.nil? && @nights < 1
|
|
135
191
|
true
|
|
136
192
|
end
|
|
137
193
|
|
|
@@ -145,6 +201,30 @@ module Repull
|
|
|
145
201
|
@type = type
|
|
146
202
|
end
|
|
147
203
|
|
|
204
|
+
# Custom attribute writer method with validation
|
|
205
|
+
# @param [Object] thread_id Value to be assigned
|
|
206
|
+
def thread_id=(thread_id)
|
|
207
|
+
if thread_id.nil?
|
|
208
|
+
fail ArgumentError, 'thread_id cannot be nil'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@thread_id = thread_id
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] nights Value to be assigned
|
|
216
|
+
def nights=(nights)
|
|
217
|
+
if nights.nil?
|
|
218
|
+
fail ArgumentError, 'nights cannot be nil'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if nights < 1
|
|
222
|
+
fail ArgumentError, 'invalid value for "nights", must be greater than or equal to 1.'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@nights = nights
|
|
226
|
+
end
|
|
227
|
+
|
|
148
228
|
# Checks equality by comparing each attribute.
|
|
149
229
|
# @param [Object] Object to be compared
|
|
150
230
|
def ==(o)
|
|
@@ -152,7 +232,12 @@ module Repull
|
|
|
152
232
|
self.class == o.class &&
|
|
153
233
|
type == o.type &&
|
|
154
234
|
thread_id == o.thread_id &&
|
|
155
|
-
block_instant_booking == o.block_instant_booking
|
|
235
|
+
block_instant_booking == o.block_instant_booking &&
|
|
236
|
+
listing_id == o.listing_id &&
|
|
237
|
+
start_date == o.start_date &&
|
|
238
|
+
nights == o.nights &&
|
|
239
|
+
total_price == o.total_price &&
|
|
240
|
+
guest_details == o.guest_details
|
|
156
241
|
end
|
|
157
242
|
|
|
158
243
|
# @see the `==` method
|
|
@@ -164,7 +249,7 @@ module Repull
|
|
|
164
249
|
# Calculates hash code according to all attributes.
|
|
165
250
|
# @return [Integer] Hash code
|
|
166
251
|
def hash
|
|
167
|
-
[type, thread_id, block_instant_booking].hash
|
|
252
|
+
[type, thread_id, block_instant_booking, listing_id, start_date, nights, total_price, guest_details].hash
|
|
168
253
|
end
|
|
169
254
|
|
|
170
255
|
# Builds the object from hash
|