repull 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +10 -0
- data/LICENSE +21 -0
- data/README.md +121 -0
- data/Rakefile +10 -0
- data/examples/connect_airbnb.rb +33 -0
- data/examples/quickstart.rb +22 -0
- data/lib/repull/api/ai_api.rb +86 -0
- data/lib/repull/api/airbnb_api.rb +1155 -0
- data/lib/repull/api/atlas_api.rb +194 -0
- data/lib/repull/api/availability_api.rb +167 -0
- data/lib/repull/api/billing_api.rb +139 -0
- data/lib/repull/api/booking_com_api.rb +617 -0
- data/lib/repull/api/connect_api.rb +672 -0
- data/lib/repull/api/conversations_api.rb +263 -0
- data/lib/repull/api/guests_api.rb +171 -0
- data/lib/repull/api/listings_api.rb +509 -0
- data/lib/repull/api/markets_api.rb +320 -0
- data/lib/repull/api/plumguide_api.rb +299 -0
- data/lib/repull/api/pricing_api.rb +453 -0
- data/lib/repull/api/properties_api.rb +166 -0
- data/lib/repull/api/reservations_api.rb +387 -0
- data/lib/repull/api/reviews_api.rb +208 -0
- data/lib/repull/api/schema_api.rb +347 -0
- data/lib/repull/api/system_api.rb +79 -0
- data/lib/repull/api/vrbo_api.rb +262 -0
- data/lib/repull/api/webhooks_api.rb +867 -0
- data/lib/repull/api_client.rb +397 -0
- data/lib/repull/api_error.rb +58 -0
- data/lib/repull/api_model_base.rb +88 -0
- data/lib/repull/configuration.rb +313 -0
- data/lib/repull/models/ai_operation.rb +158 -0
- data/lib/repull/models/airbnb_listing.rb +229 -0
- data/lib/repull/models/airbnb_listing_list_response.rb +158 -0
- data/lib/repull/models/airbnb_reservation.rb +224 -0
- data/lib/repull/models/airbnb_reservation_list_response.rb +158 -0
- data/lib/repull/models/airbnb_review.rb +222 -0
- data/lib/repull/models/airbnb_review_list_response.rb +158 -0
- data/lib/repull/models/airbnb_thread.rb +188 -0
- data/lib/repull/models/airbnb_thread_list_response.rb +158 -0
- data/lib/repull/models/booking_connect_listing_option.rb +201 -0
- data/lib/repull/models/booking_connect_room.rb +251 -0
- data/lib/repull/models/booking_connect_rooms_response.rb +274 -0
- data/lib/repull/models/booking_conversation.rb +178 -0
- data/lib/repull/models/booking_conversation_list_response.rb +158 -0
- data/lib/repull/models/booking_pricing_rate_update.rb +310 -0
- data/lib/repull/models/booking_pricing_rate_update_date_range.rb +190 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +179 -0
- data/lib/repull/models/booking_pricing_response.rb +157 -0
- data/lib/repull/models/booking_pricing_update_request.rb +176 -0
- data/lib/repull/models/booking_pricing_update_response.rb +199 -0
- data/lib/repull/models/booking_property.rb +188 -0
- data/lib/repull/models/booking_property_list_response.rb +158 -0
- data/lib/repull/models/booking_room_mapping.rb +177 -0
- data/lib/repull/models/booking_verify_hotel_request.rb +193 -0
- data/lib/repull/models/booking_verify_hotel_response.rb +285 -0
- data/lib/repull/models/bulk_pricing_failure.rb +177 -0
- data/lib/repull/models/bulk_pricing_item.rb +202 -0
- data/lib/repull/models/bulk_pricing_request.rb +212 -0
- data/lib/repull/models/bulk_pricing_response.rb +170 -0
- data/lib/repull/models/calendar_day.rb +174 -0
- data/lib/repull/models/calendar_response.rb +149 -0
- data/lib/repull/models/connect_host.rb +194 -0
- data/lib/repull/models/connect_provider.rb +365 -0
- data/lib/repull/models/connect_provider_list_response.rb +149 -0
- data/lib/repull/models/connect_session.rb +228 -0
- data/lib/repull/models/connect_status.rb +207 -0
- data/lib/repull/models/connection.rb +195 -0
- data/lib/repull/models/connection_list_response.rb +158 -0
- data/lib/repull/models/conversation.rb +257 -0
- data/lib/repull/models/conversation_detail.rb +284 -0
- data/lib/repull/models/conversation_guest.rb +178 -0
- data/lib/repull/models/conversation_guest_contact.rb +174 -0
- data/lib/repull/models/conversation_host.rb +186 -0
- data/lib/repull/models/conversation_list_response.rb +159 -0
- data/lib/repull/models/conversation_message_attachment.rb +174 -0
- data/lib/repull/models/create_ai_operation200_response.rb +156 -0
- data/lib/repull/models/create_billing_checkout_request.rb +181 -0
- data/lib/repull/models/create_connect_session_request.rb +189 -0
- data/lib/repull/models/create_connection_request.rb +225 -0
- data/lib/repull/models/create_reservation_request.rb +313 -0
- data/lib/repull/models/create_webhook_request.rb +211 -0
- data/lib/repull/models/custom_schema.rb +303 -0
- data/lib/repull/models/custom_schema_create.rb +253 -0
- data/lib/repull/models/custom_schema_create_response.rb +300 -0
- data/lib/repull/models/custom_schema_delete_response.rb +164 -0
- data/lib/repull/models/custom_schema_list_response.rb +159 -0
- data/lib/repull/models/custom_schema_summary.rb +300 -0
- data/lib/repull/models/custom_schema_update.rb +199 -0
- data/lib/repull/models/error.rb +165 -0
- data/lib/repull/models/error_error.rb +357 -0
- data/lib/repull/models/error_error_support.rb +167 -0
- data/lib/repull/models/get_health200_response.rb +156 -0
- data/lib/repull/models/guest.rb +271 -0
- data/lib/repull/models/guest_contact.rb +186 -0
- data/lib/repull/models/guest_flag.rb +179 -0
- data/lib/repull/models/guest_list_response.rb +159 -0
- data/lib/repull/models/guest_note.rb +187 -0
- data/lib/repull/models/guest_profile.rb +337 -0
- data/lib/repull/models/guest_reservations_summary.rb +175 -0
- data/lib/repull/models/listing.rb +216 -0
- data/lib/repull/models/listing_address.rb +158 -0
- data/lib/repull/models/listing_channel.rb +176 -0
- data/lib/repull/models/listing_comp.rb +272 -0
- data/lib/repull/models/listing_comp_nightly.rb +166 -0
- data/lib/repull/models/listing_comp_ratings.rb +157 -0
- data/lib/repull/models/listing_comps_response.rb +197 -0
- data/lib/repull/models/listing_content.rb +249 -0
- data/lib/repull/models/listing_create_request.rb +364 -0
- data/lib/repull/models/listing_create_response.rb +148 -0
- data/lib/repull/models/listing_generate_content_request.rb +192 -0
- data/lib/repull/models/listing_generate_content_response.rb +165 -0
- data/lib/repull/models/listing_list_response.rb +158 -0
- data/lib/repull/models/listing_pricing_apply_request.rb +193 -0
- data/lib/repull/models/listing_pricing_apply_response.rb +169 -0
- data/lib/repull/models/listing_pricing_history_entry.rb +212 -0
- data/lib/repull/models/listing_pricing_history_response.rb +159 -0
- data/lib/repull/models/listing_pricing_recommendation.rb +269 -0
- data/lib/repull/models/listing_pricing_response.rb +187 -0
- data/lib/repull/models/listing_pricing_response_comp_summary.rb +178 -0
- data/lib/repull/models/listing_pricing_response_date_range.rb +156 -0
- data/lib/repull/models/listing_pricing_response_listing.rb +191 -0
- data/lib/repull/models/listing_pricing_strategy.rb +317 -0
- data/lib/repull/models/listing_pricing_strategy_input.rb +264 -0
- data/lib/repull/models/listing_publish_airbnb_request.rb +171 -0
- data/lib/repull/models/listing_publish_response.rb +166 -0
- data/lib/repull/models/listing_publish_status_channel.rb +197 -0
- data/lib/repull/models/listing_publish_status_response.rb +158 -0
- data/lib/repull/models/listing_quality_tier.rb +175 -0
- data/lib/repull/models/listing_segment.rb +229 -0
- data/lib/repull/models/listing_segment_recommendation.rb +170 -0
- data/lib/repull/models/listing_segments_response.rb +230 -0
- data/lib/repull/models/listing_segments_response_scope.rb +159 -0
- data/lib/repull/models/map_connect_booking_rooms_request.rb +202 -0
- data/lib/repull/models/map_connect_booking_rooms_response.rb +243 -0
- data/lib/repull/models/market_browse_category.rb +158 -0
- data/lib/repull/models/market_browse_entry.rb +197 -0
- data/lib/repull/models/market_browse_featured.rb +188 -0
- data/lib/repull/models/market_browse_response.rb +158 -0
- data/lib/repull/models/market_calendar_day.rb +257 -0
- data/lib/repull/models/market_calendar_day_events_inner.rb +177 -0
- data/lib/repull/models/market_calendar_response.rb +178 -0
- data/lib/repull/models/market_detail_response.rb +269 -0
- data/lib/repull/models/market_detail_response_price_distribution_inner.rb +186 -0
- data/lib/repull/models/market_detail_response_property_type_mix_inner.rb +166 -0
- data/lib/repull/models/market_detail_response_supply_trend_inner.rb +156 -0
- data/lib/repull/models/market_detail_response_top_comps.rb +187 -0
- data/lib/repull/models/market_event.rb +257 -0
- data/lib/repull/models/market_my_listing.rb +242 -0
- data/lib/repull/models/market_summary.rb +259 -0
- data/lib/repull/models/market_top_comp.rb +275 -0
- data/lib/repull/models/markets_overview_response.rb +219 -0
- data/lib/repull/models/markets_overview_response_browse.rb +173 -0
- data/lib/repull/models/markets_overview_response_subscriptions.rb +157 -0
- data/lib/repull/models/markets_overview_response_totals.rb +165 -0
- data/lib/repull/models/message.rb +289 -0
- data/lib/repull/models/message_list_response.rb +159 -0
- data/lib/repull/models/pagination.rb +188 -0
- data/lib/repull/models/plumguide_listing.rb +167 -0
- data/lib/repull/models/plumguide_listing_list_response.rb +158 -0
- data/lib/repull/models/property.rb +271 -0
- data/lib/repull/models/property_list_response.rb +158 -0
- data/lib/repull/models/reservation.rb +457 -0
- data/lib/repull/models/reservation_list_response.rb +159 -0
- data/lib/repull/models/review.rb +357 -0
- data/lib/repull/models/review_category.rb +169 -0
- data/lib/repull/models/review_list_response.rb +159 -0
- data/lib/repull/models/review_response.rb +158 -0
- data/lib/repull/models/rotate_webhook_secret200_response.rb +165 -0
- data/lib/repull/models/select_connect_provider_request.rb +165 -0
- data/lib/repull/models/select_provider_response.rb +176 -0
- data/lib/repull/models/test_webhook_request.rb +165 -0
- data/lib/repull/models/update_availability_request.rb +149 -0
- data/lib/repull/models/update_listing_pricing_strategy200_response.rb +147 -0
- data/lib/repull/models/update_reservation_request.rb +174 -0
- data/lib/repull/models/update_webhook_request.rb +211 -0
- data/lib/repull/models/vrbo_listing.rb +167 -0
- data/lib/repull/models/vrbo_listing_list_response.rb +158 -0
- data/lib/repull/models/vrbo_reservation.rb +185 -0
- data/lib/repull/models/vrbo_reservation_list_response.rb +158 -0
- data/lib/repull/models/webhook_delivery.rb +243 -0
- data/lib/repull/models/webhook_delivery_detail.rb +261 -0
- data/lib/repull/models/webhook_delivery_list_response.rb +158 -0
- data/lib/repull/models/webhook_event_catalog.rb +149 -0
- data/lib/repull/models/webhook_event_catalog_domains_inner.rb +167 -0
- data/lib/repull/models/webhook_event_catalog_domains_inner_events_inner.rb +183 -0
- data/lib/repull/models/webhook_list_response.rb +158 -0
- data/lib/repull/models/webhook_subscription.rb +294 -0
- data/lib/repull/version.rb +15 -0
- data/lib/repull.rb +217 -0
- data/openapi/v1.json +8923 -0
- data/repull.gemspec +43 -0
- data/scripts/regen.sh +55 -0
- data/spec/api/ai_api_spec.rb +47 -0
- data/spec/api/airbnb_api_spec.rb +238 -0
- data/spec/api/availability_api_spec.rb +62 -0
- data/spec/api/billing_api_spec.rb +57 -0
- data/spec/api/booking_com_api_spec.rb +115 -0
- data/spec/api/connect_api_spec.rb +82 -0
- data/spec/api/conversations_api_spec.rb +68 -0
- data/spec/api/guests_api_spec.rb +59 -0
- data/spec/api/plumguide_api_spec.rb +85 -0
- data/spec/api/properties_api_spec.rb +60 -0
- data/spec/api/reservations_api_spec.rb +97 -0
- data/spec/api/system_api_spec.rb +45 -0
- data/spec/api/vrbo_api_spec.rb +55 -0
- data/spec/api/webhooks_api_spec.rb +69 -0
- data/spec/models/ai_operation_spec.rb +46 -0
- data/spec/models/calendar_day_spec.rb +54 -0
- data/spec/models/connect_host_spec.rb +60 -0
- data/spec/models/connect_status_spec.rb +76 -0
- data/spec/models/connection_spec.rb +70 -0
- data/spec/models/conversation_spec.rb +66 -0
- data/spec/models/error_error_spec.rb +54 -0
- data/spec/models/error_spec.rb +36 -0
- data/spec/models/guest_spec.rb +72 -0
- data/spec/models/message_spec.rb +70 -0
- data/spec/models/property_spec.rb +114 -0
- data/spec/models/reservation_spec.rb +128 -0
- data/spec/models/webhook_subscription_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- metadata +337 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: ivan@vanio.ai
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
# A custom field-mapping schema owned by the workspace. Reshapes the `native` response into the workspace's preferred field names. Apply one per request via the `X-Schema: <name>` header on any read endpoint.
|
|
18
|
+
class CustomSchema < ApiModelBase
|
|
19
|
+
# Stable workspace-scoped identifier.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# 3-100 lowercase chars, hyphens allowed (`^[a-z0-9][a-z0-9-]{1,98}[a-z0-9]$`). Must be unique within the workspace. Cannot collide with reserved names (`calry`, `calry-v1`, `native`).
|
|
23
|
+
attr_accessor :name
|
|
24
|
+
|
|
25
|
+
attr_accessor :description
|
|
26
|
+
|
|
27
|
+
# Field-mapping table. Keys are the output field names emitted in the response payload; values are simple expressions referenced against the source `native` payload (dot paths, basic arithmetic, string concatenation). Min 1 entry, max 50 entries. Each key must be <= 100 chars; each expression must be <= 500 chars and pass the safety check (no `eval`, no `function`, no `process`, etc.).
|
|
28
|
+
attr_accessor :mappings
|
|
29
|
+
|
|
30
|
+
# When `false`, requests carrying this schema name in `X-Schema` fall back to `native`.
|
|
31
|
+
attr_accessor :active
|
|
32
|
+
|
|
33
|
+
attr_accessor :created_at
|
|
34
|
+
|
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
36
|
+
def self.attribute_map
|
|
37
|
+
{
|
|
38
|
+
:'id' => :'id',
|
|
39
|
+
:'name' => :'name',
|
|
40
|
+
:'description' => :'description',
|
|
41
|
+
:'mappings' => :'mappings',
|
|
42
|
+
:'active' => :'active',
|
|
43
|
+
:'created_at' => :'createdAt'
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns attribute mapping this model knows about
|
|
48
|
+
def self.acceptable_attribute_map
|
|
49
|
+
attribute_map
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
|
53
|
+
def self.acceptable_attributes
|
|
54
|
+
acceptable_attribute_map.values
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Attribute type mapping.
|
|
58
|
+
def self.openapi_types
|
|
59
|
+
{
|
|
60
|
+
:'id' => :'String',
|
|
61
|
+
:'name' => :'String',
|
|
62
|
+
:'description' => :'String',
|
|
63
|
+
:'mappings' => :'Hash<String, String>',
|
|
64
|
+
:'active' => :'Boolean',
|
|
65
|
+
:'created_at' => :'Time'
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# List of attributes with nullable: true
|
|
70
|
+
def self.openapi_nullable
|
|
71
|
+
Set.new([
|
|
72
|
+
:'description',
|
|
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::CustomSchema` 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::CustomSchema`. 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?(:'id')
|
|
93
|
+
self.id = attributes[:'id']
|
|
94
|
+
else
|
|
95
|
+
self.id = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'name')
|
|
99
|
+
self.name = attributes[:'name']
|
|
100
|
+
else
|
|
101
|
+
self.name = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'description')
|
|
105
|
+
self.description = attributes[:'description']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'mappings')
|
|
109
|
+
if (value = attributes[:'mappings']).is_a?(Hash)
|
|
110
|
+
self.mappings = value
|
|
111
|
+
end
|
|
112
|
+
else
|
|
113
|
+
self.mappings = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'active')
|
|
117
|
+
self.active = attributes[:'active']
|
|
118
|
+
else
|
|
119
|
+
self.active = nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'created_at')
|
|
123
|
+
self.created_at = attributes[:'created_at']
|
|
124
|
+
else
|
|
125
|
+
self.created_at = nil
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
130
|
+
# @return Array for valid properties with the reasons
|
|
131
|
+
def list_invalid_properties
|
|
132
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
133
|
+
invalid_properties = Array.new
|
|
134
|
+
if @id.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @name.nil?
|
|
139
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @mappings.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "mappings", mappings cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if @mappings.length > 50
|
|
147
|
+
invalid_properties.push('invalid value for "mappings", number of items must be less than or equal to 50.')
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if @mappings.length < 1
|
|
151
|
+
invalid_properties.push('invalid value for "mappings", number of items must be greater than or equal to 1.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if @active.nil?
|
|
155
|
+
invalid_properties.push('invalid value for "active", active cannot be nil.')
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if @created_at.nil?
|
|
159
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
invalid_properties
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Check to see if the all the properties in the model are valid
|
|
166
|
+
# @return true if the model is valid
|
|
167
|
+
def valid?
|
|
168
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
169
|
+
return false if @id.nil?
|
|
170
|
+
return false if @name.nil?
|
|
171
|
+
return false if @mappings.nil?
|
|
172
|
+
return false if @mappings.length > 50
|
|
173
|
+
return false if @mappings.length < 1
|
|
174
|
+
return false if @active.nil?
|
|
175
|
+
return false if @created_at.nil?
|
|
176
|
+
true
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Custom attribute writer method with validation
|
|
180
|
+
# @param [Object] id Value to be assigned
|
|
181
|
+
def id=(id)
|
|
182
|
+
if id.nil?
|
|
183
|
+
fail ArgumentError, 'id cannot be nil'
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
@id = id
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Custom attribute writer method with validation
|
|
190
|
+
# @param [Object] name Value to be assigned
|
|
191
|
+
def name=(name)
|
|
192
|
+
if name.nil?
|
|
193
|
+
fail ArgumentError, 'name cannot be nil'
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
@name = name
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Custom attribute writer method with validation
|
|
200
|
+
# @param [Object] mappings Value to be assigned
|
|
201
|
+
def mappings=(mappings)
|
|
202
|
+
if mappings.nil?
|
|
203
|
+
fail ArgumentError, 'mappings cannot be nil'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if mappings.length > 50
|
|
207
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be less than or equal to 50.'
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
if mappings.length < 1
|
|
211
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be greater than or equal to 1.'
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@mappings = mappings
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] active Value to be assigned
|
|
219
|
+
def active=(active)
|
|
220
|
+
if active.nil?
|
|
221
|
+
fail ArgumentError, 'active cannot be nil'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
@active = active
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Custom attribute writer method with validation
|
|
228
|
+
# @param [Object] created_at Value to be assigned
|
|
229
|
+
def created_at=(created_at)
|
|
230
|
+
if created_at.nil?
|
|
231
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
@created_at = created_at
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Checks equality by comparing each attribute.
|
|
238
|
+
# @param [Object] Object to be compared
|
|
239
|
+
def ==(o)
|
|
240
|
+
return true if self.equal?(o)
|
|
241
|
+
self.class == o.class &&
|
|
242
|
+
id == o.id &&
|
|
243
|
+
name == o.name &&
|
|
244
|
+
description == o.description &&
|
|
245
|
+
mappings == o.mappings &&
|
|
246
|
+
active == o.active &&
|
|
247
|
+
created_at == o.created_at
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# @see the `==` method
|
|
251
|
+
# @param [Object] Object to be compared
|
|
252
|
+
def eql?(o)
|
|
253
|
+
self == o
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Calculates hash code according to all attributes.
|
|
257
|
+
# @return [Integer] Hash code
|
|
258
|
+
def hash
|
|
259
|
+
[id, name, description, mappings, active, created_at].hash
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Builds the object from hash
|
|
263
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
264
|
+
# @return [Object] Returns the model itself
|
|
265
|
+
def self.build_from_hash(attributes)
|
|
266
|
+
return nil unless attributes.is_a?(Hash)
|
|
267
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
268
|
+
transformed_hash = {}
|
|
269
|
+
openapi_types.each_pair do |key, type|
|
|
270
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
271
|
+
transformed_hash["#{key}"] = nil
|
|
272
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
273
|
+
# check to ensure the input is an array given that the attribute
|
|
274
|
+
# is documented as an array but the input is not
|
|
275
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
276
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
277
|
+
end
|
|
278
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
279
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
new(transformed_hash)
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Returns the object in the form of hash
|
|
286
|
+
# @return [Hash] Returns the object in the form of hash
|
|
287
|
+
def to_hash
|
|
288
|
+
hash = {}
|
|
289
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
290
|
+
value = self.send(attr)
|
|
291
|
+
if value.nil?
|
|
292
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
293
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
hash[param] = _to_hash(value)
|
|
297
|
+
end
|
|
298
|
+
hash
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
end
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: ivan@vanio.ai
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
# Request body for `POST /v1/schema/custom`.
|
|
18
|
+
class CustomSchemaCreate < ApiModelBase
|
|
19
|
+
# 3-100 lowercase chars + hyphens. Must be unique within the workspace and cannot collide with reserved names (`calry`, `calry-v1`, `native`).
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# Optional human-readable note shown in the dashboard.
|
|
23
|
+
attr_accessor :description
|
|
24
|
+
|
|
25
|
+
# Field-mapping table. Keys are the output field names emitted in the response payload; values are simple expressions referenced against the source `native` payload (dot paths, basic arithmetic, string concatenation). Min 1 entry, max 50 entries. Each key must be <= 100 chars; each expression must be <= 500 chars and pass the safety check (no `eval`, no `function`, no `process`, etc.).
|
|
26
|
+
attr_accessor :mappings
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'name' => :'name',
|
|
32
|
+
:'description' => :'description',
|
|
33
|
+
:'mappings' => :'mappings'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'name' => :'String',
|
|
51
|
+
:'description' => :'String',
|
|
52
|
+
:'mappings' => :'Hash<String, String>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
:'description',
|
|
60
|
+
])
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Initializes the object
|
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
65
|
+
def initialize(attributes = {})
|
|
66
|
+
if (!attributes.is_a?(Hash))
|
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::CustomSchemaCreate` initialize method"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
71
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
72
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
73
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::CustomSchemaCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
75
|
+
end
|
|
76
|
+
h[k.to_sym] = v
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'name')
|
|
80
|
+
self.name = attributes[:'name']
|
|
81
|
+
else
|
|
82
|
+
self.name = nil
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'description')
|
|
86
|
+
self.description = attributes[:'description']
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'mappings')
|
|
90
|
+
if (value = attributes[:'mappings']).is_a?(Hash)
|
|
91
|
+
self.mappings = value
|
|
92
|
+
end
|
|
93
|
+
else
|
|
94
|
+
self.mappings = nil
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
99
|
+
# @return Array for valid properties with the reasons
|
|
100
|
+
def list_invalid_properties
|
|
101
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
102
|
+
invalid_properties = Array.new
|
|
103
|
+
if @name.nil?
|
|
104
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if @name.to_s.length > 100
|
|
108
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if @name.to_s.length < 3
|
|
112
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 3.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
pattern = Regexp.new(/^[a-z0-9][a-z0-9-]{1,98}[a-z0-9]$/)
|
|
116
|
+
if @name !~ pattern
|
|
117
|
+
invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @mappings.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "mappings", mappings cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if @mappings.length > 50
|
|
125
|
+
invalid_properties.push('invalid value for "mappings", number of items must be less than or equal to 50.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if @mappings.length < 1
|
|
129
|
+
invalid_properties.push('invalid value for "mappings", number of items must be greater than or equal to 1.')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
invalid_properties
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Check to see if the all the properties in the model are valid
|
|
136
|
+
# @return true if the model is valid
|
|
137
|
+
def valid?
|
|
138
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
139
|
+
return false if @name.nil?
|
|
140
|
+
return false if @name.to_s.length > 100
|
|
141
|
+
return false if @name.to_s.length < 3
|
|
142
|
+
return false if @name !~ Regexp.new(/^[a-z0-9][a-z0-9-]{1,98}[a-z0-9]$/)
|
|
143
|
+
return false if @mappings.nil?
|
|
144
|
+
return false if @mappings.length > 50
|
|
145
|
+
return false if @mappings.length < 1
|
|
146
|
+
true
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] name Value to be assigned
|
|
151
|
+
def name=(name)
|
|
152
|
+
if name.nil?
|
|
153
|
+
fail ArgumentError, 'name cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if name.to_s.length > 100
|
|
157
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if name.to_s.length < 3
|
|
161
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 3.'
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
pattern = Regexp.new(/^[a-z0-9][a-z0-9-]{1,98}[a-z0-9]$/)
|
|
165
|
+
if name !~ pattern
|
|
166
|
+
fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
@name = name
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method with validation
|
|
173
|
+
# @param [Object] mappings Value to be assigned
|
|
174
|
+
def mappings=(mappings)
|
|
175
|
+
if mappings.nil?
|
|
176
|
+
fail ArgumentError, 'mappings cannot be nil'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if mappings.length > 50
|
|
180
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be less than or equal to 50.'
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if mappings.length < 1
|
|
184
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be greater than or equal to 1.'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@mappings = mappings
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Checks equality by comparing each attribute.
|
|
191
|
+
# @param [Object] Object to be compared
|
|
192
|
+
def ==(o)
|
|
193
|
+
return true if self.equal?(o)
|
|
194
|
+
self.class == o.class &&
|
|
195
|
+
name == o.name &&
|
|
196
|
+
description == o.description &&
|
|
197
|
+
mappings == o.mappings
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# @see the `==` method
|
|
201
|
+
# @param [Object] Object to be compared
|
|
202
|
+
def eql?(o)
|
|
203
|
+
self == o
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Calculates hash code according to all attributes.
|
|
207
|
+
# @return [Integer] Hash code
|
|
208
|
+
def hash
|
|
209
|
+
[name, description, mappings].hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Builds the object from hash
|
|
213
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
214
|
+
# @return [Object] Returns the model itself
|
|
215
|
+
def self.build_from_hash(attributes)
|
|
216
|
+
return nil unless attributes.is_a?(Hash)
|
|
217
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
218
|
+
transformed_hash = {}
|
|
219
|
+
openapi_types.each_pair do |key, type|
|
|
220
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
221
|
+
transformed_hash["#{key}"] = nil
|
|
222
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
223
|
+
# check to ensure the input is an array given that the attribute
|
|
224
|
+
# is documented as an array but the input is not
|
|
225
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
226
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
227
|
+
end
|
|
228
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
229
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
new(transformed_hash)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Returns the object in the form of hash
|
|
236
|
+
# @return [Hash] Returns the object in the form of hash
|
|
237
|
+
def to_hash
|
|
238
|
+
hash = {}
|
|
239
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
240
|
+
value = self.send(attr)
|
|
241
|
+
if value.nil?
|
|
242
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
243
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
hash[param] = _to_hash(value)
|
|
247
|
+
end
|
|
248
|
+
hash
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
end
|