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,300 @@
|
|
|
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
|
+
# List-row shape returned by `GET /v1/schema/custom`. Same fields as `CustomSchema` minus heavy nested data — kept identical today; reserved as a separate schema so the list shape can shrink without breaking the detail call.
|
|
18
|
+
class CustomSchemaSummary < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :name
|
|
22
|
+
|
|
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
|
+
attr_accessor :active
|
|
29
|
+
|
|
30
|
+
attr_accessor :created_at
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'id' => :'id',
|
|
36
|
+
:'name' => :'name',
|
|
37
|
+
:'description' => :'description',
|
|
38
|
+
:'mappings' => :'mappings',
|
|
39
|
+
:'active' => :'active',
|
|
40
|
+
:'created_at' => :'createdAt'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns attribute mapping this model knows about
|
|
45
|
+
def self.acceptable_attribute_map
|
|
46
|
+
attribute_map
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns all the JSON keys this model knows about
|
|
50
|
+
def self.acceptable_attributes
|
|
51
|
+
acceptable_attribute_map.values
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute type mapping.
|
|
55
|
+
def self.openapi_types
|
|
56
|
+
{
|
|
57
|
+
:'id' => :'String',
|
|
58
|
+
:'name' => :'String',
|
|
59
|
+
:'description' => :'String',
|
|
60
|
+
:'mappings' => :'Hash<String, String>',
|
|
61
|
+
:'active' => :'Boolean',
|
|
62
|
+
:'created_at' => :'Time'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
:'description',
|
|
70
|
+
])
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Initializes the object
|
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
75
|
+
def initialize(attributes = {})
|
|
76
|
+
if (!attributes.is_a?(Hash))
|
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::CustomSchemaSummary` initialize method"
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
81
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
82
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
83
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::CustomSchemaSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
85
|
+
end
|
|
86
|
+
h[k.to_sym] = v
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'id')
|
|
90
|
+
self.id = attributes[:'id']
|
|
91
|
+
else
|
|
92
|
+
self.id = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'name')
|
|
96
|
+
self.name = attributes[:'name']
|
|
97
|
+
else
|
|
98
|
+
self.name = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'description')
|
|
102
|
+
self.description = attributes[:'description']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'mappings')
|
|
106
|
+
if (value = attributes[:'mappings']).is_a?(Hash)
|
|
107
|
+
self.mappings = value
|
|
108
|
+
end
|
|
109
|
+
else
|
|
110
|
+
self.mappings = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'active')
|
|
114
|
+
self.active = attributes[:'active']
|
|
115
|
+
else
|
|
116
|
+
self.active = nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'created_at')
|
|
120
|
+
self.created_at = attributes[:'created_at']
|
|
121
|
+
else
|
|
122
|
+
self.created_at = nil
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
|
+
# @return Array for valid properties with the reasons
|
|
128
|
+
def list_invalid_properties
|
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
130
|
+
invalid_properties = Array.new
|
|
131
|
+
if @id.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if @name.nil?
|
|
136
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if @mappings.nil?
|
|
140
|
+
invalid_properties.push('invalid value for "mappings", mappings cannot be nil.')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if @mappings.length > 50
|
|
144
|
+
invalid_properties.push('invalid value for "mappings", number of items must be less than or equal to 50.')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if @mappings.length < 1
|
|
148
|
+
invalid_properties.push('invalid value for "mappings", number of items must be greater than or equal to 1.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if @active.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "active", active cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @created_at.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
invalid_properties
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Check to see if the all the properties in the model are valid
|
|
163
|
+
# @return true if the model is valid
|
|
164
|
+
def valid?
|
|
165
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
166
|
+
return false if @id.nil?
|
|
167
|
+
return false if @name.nil?
|
|
168
|
+
return false if @mappings.nil?
|
|
169
|
+
return false if @mappings.length > 50
|
|
170
|
+
return false if @mappings.length < 1
|
|
171
|
+
return false if @active.nil?
|
|
172
|
+
return false if @created_at.nil?
|
|
173
|
+
true
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Custom attribute writer method with validation
|
|
177
|
+
# @param [Object] id Value to be assigned
|
|
178
|
+
def id=(id)
|
|
179
|
+
if id.nil?
|
|
180
|
+
fail ArgumentError, 'id cannot be nil'
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
@id = id
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Custom attribute writer method with validation
|
|
187
|
+
# @param [Object] name Value to be assigned
|
|
188
|
+
def name=(name)
|
|
189
|
+
if name.nil?
|
|
190
|
+
fail ArgumentError, 'name cannot be nil'
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
@name = name
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Custom attribute writer method with validation
|
|
197
|
+
# @param [Object] mappings Value to be assigned
|
|
198
|
+
def mappings=(mappings)
|
|
199
|
+
if mappings.nil?
|
|
200
|
+
fail ArgumentError, 'mappings cannot be nil'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if mappings.length > 50
|
|
204
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be less than or equal to 50.'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if mappings.length < 1
|
|
208
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be greater than or equal to 1.'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@mappings = mappings
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] active Value to be assigned
|
|
216
|
+
def active=(active)
|
|
217
|
+
if active.nil?
|
|
218
|
+
fail ArgumentError, 'active cannot be nil'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@active = active
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Custom attribute writer method with validation
|
|
225
|
+
# @param [Object] created_at Value to be assigned
|
|
226
|
+
def created_at=(created_at)
|
|
227
|
+
if created_at.nil?
|
|
228
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
@created_at = created_at
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Checks equality by comparing each attribute.
|
|
235
|
+
# @param [Object] Object to be compared
|
|
236
|
+
def ==(o)
|
|
237
|
+
return true if self.equal?(o)
|
|
238
|
+
self.class == o.class &&
|
|
239
|
+
id == o.id &&
|
|
240
|
+
name == o.name &&
|
|
241
|
+
description == o.description &&
|
|
242
|
+
mappings == o.mappings &&
|
|
243
|
+
active == o.active &&
|
|
244
|
+
created_at == o.created_at
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# @see the `==` method
|
|
248
|
+
# @param [Object] Object to be compared
|
|
249
|
+
def eql?(o)
|
|
250
|
+
self == o
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Calculates hash code according to all attributes.
|
|
254
|
+
# @return [Integer] Hash code
|
|
255
|
+
def hash
|
|
256
|
+
[id, name, description, mappings, active, created_at].hash
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Builds the object from hash
|
|
260
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
261
|
+
# @return [Object] Returns the model itself
|
|
262
|
+
def self.build_from_hash(attributes)
|
|
263
|
+
return nil unless attributes.is_a?(Hash)
|
|
264
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
265
|
+
transformed_hash = {}
|
|
266
|
+
openapi_types.each_pair do |key, type|
|
|
267
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
268
|
+
transformed_hash["#{key}"] = nil
|
|
269
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
270
|
+
# check to ensure the input is an array given that the attribute
|
|
271
|
+
# is documented as an array but the input is not
|
|
272
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
273
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
274
|
+
end
|
|
275
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
276
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
new(transformed_hash)
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Returns the object in the form of hash
|
|
283
|
+
# @return [Hash] Returns the object in the form of hash
|
|
284
|
+
def to_hash
|
|
285
|
+
hash = {}
|
|
286
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
287
|
+
value = self.send(attr)
|
|
288
|
+
if value.nil?
|
|
289
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
290
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
hash[param] = _to_hash(value)
|
|
294
|
+
end
|
|
295
|
+
hash
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
end
|
|
@@ -0,0 +1,199 @@
|
|
|
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 `PATCH /v1/schema/custom/{id}`. All fields optional; omitted fields are left unchanged. `name` is intentionally NOT patchable — create a new schema and migrate consumers if you need to rename.
|
|
18
|
+
class CustomSchemaUpdate < ApiModelBase
|
|
19
|
+
attr_accessor :description
|
|
20
|
+
|
|
21
|
+
# 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.).
|
|
22
|
+
attr_accessor :mappings
|
|
23
|
+
|
|
24
|
+
# Toggle the schema on/off. When `false`, requests carrying this schema name in `X-Schema` fall back to `native`.
|
|
25
|
+
attr_accessor :active
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'description' => :'description',
|
|
31
|
+
:'mappings' => :'mappings',
|
|
32
|
+
:'active' => :'active'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'description' => :'String',
|
|
50
|
+
:'mappings' => :'Hash<String, String>',
|
|
51
|
+
:'active' => :'Boolean'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
:'description',
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::CustomSchemaUpdate` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::CustomSchemaUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'description')
|
|
79
|
+
self.description = attributes[:'description']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'mappings')
|
|
83
|
+
if (value = attributes[:'mappings']).is_a?(Hash)
|
|
84
|
+
self.mappings = value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'active')
|
|
89
|
+
self.active = attributes[:'active']
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
97
|
+
invalid_properties = Array.new
|
|
98
|
+
if !@mappings.nil? && @mappings.length > 50
|
|
99
|
+
invalid_properties.push('invalid value for "mappings", number of items must be less than or equal to 50.')
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if !@mappings.nil? && @mappings.length < 1
|
|
103
|
+
invalid_properties.push('invalid value for "mappings", number of items must be greater than or equal to 1.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
return false if !@mappings.nil? && @mappings.length > 50
|
|
114
|
+
return false if !@mappings.nil? && @mappings.length < 1
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] mappings Value to be assigned
|
|
120
|
+
def mappings=(mappings)
|
|
121
|
+
if mappings.nil?
|
|
122
|
+
fail ArgumentError, 'mappings cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if mappings.length > 50
|
|
126
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be less than or equal to 50.'
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if mappings.length < 1
|
|
130
|
+
fail ArgumentError, 'invalid value for "mappings", number of items must be greater than or equal to 1.'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
@mappings = mappings
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Checks equality by comparing each attribute.
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def ==(o)
|
|
139
|
+
return true if self.equal?(o)
|
|
140
|
+
self.class == o.class &&
|
|
141
|
+
description == o.description &&
|
|
142
|
+
mappings == o.mappings &&
|
|
143
|
+
active == o.active
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @see the `==` method
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def eql?(o)
|
|
149
|
+
self == o
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Calculates hash code according to all attributes.
|
|
153
|
+
# @return [Integer] Hash code
|
|
154
|
+
def hash
|
|
155
|
+
[description, mappings, active].hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Builds the object from hash
|
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
160
|
+
# @return [Object] Returns the model itself
|
|
161
|
+
def self.build_from_hash(attributes)
|
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
|
163
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
164
|
+
transformed_hash = {}
|
|
165
|
+
openapi_types.each_pair do |key, type|
|
|
166
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = nil
|
|
168
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
169
|
+
# check to ensure the input is an array given that the attribute
|
|
170
|
+
# is documented as an array but the input is not
|
|
171
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
172
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
173
|
+
end
|
|
174
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
new(transformed_hash)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns the object in the form of hash
|
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
|
183
|
+
def to_hash
|
|
184
|
+
hash = {}
|
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
186
|
+
value = self.send(attr)
|
|
187
|
+
if value.nil?
|
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
hash[param] = _to_hash(value)
|
|
193
|
+
end
|
|
194
|
+
hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
# Standardized error envelope. Returned by EVERY 4xx/5xx response on this API. Required fields (`code`, `message`, `fix`, `docs_url`, `request_id`) are designed for LLM-driven self-recovery — an AI agent should be able to fix the underlying problem and retry without escalating to a human. Lead with `fix` and `docs_url` in your tooling; demote `support` (rare) to a last resort.
|
|
18
|
+
class Error < ApiModelBase
|
|
19
|
+
attr_accessor :error
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'error' => :'error'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
acceptable_attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
:'error' => :'ErrorError'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::Error` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::Error`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:'error')
|
|
68
|
+
self.error = attributes[:'error']
|
|
69
|
+
else
|
|
70
|
+
self.error = nil
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
75
|
+
# @return Array for valid properties with the reasons
|
|
76
|
+
def list_invalid_properties
|
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
if @error.nil?
|
|
80
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
|
+
return false if @error.nil?
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Custom attribute writer method with validation
|
|
95
|
+
# @param [Object] error Value to be assigned
|
|
96
|
+
def error=(error)
|
|
97
|
+
if error.nil?
|
|
98
|
+
fail ArgumentError, 'error cannot be nil'
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
@error = error
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Checks equality by comparing each attribute.
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def ==(o)
|
|
107
|
+
return true if self.equal?(o)
|
|
108
|
+
self.class == o.class &&
|
|
109
|
+
error == o.error
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Integer] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[error].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def self.build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
new(transformed_hash)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Returns the object in the form of hash
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_hash
|
|
150
|
+
hash = {}
|
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
152
|
+
value = self.send(attr)
|
|
153
|
+
if value.nil?
|
|
154
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
155
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
hash[param] = _to_hash(value)
|
|
159
|
+
end
|
|
160
|
+
hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|