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,170 @@
|
|
|
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
|
+
# Structural observation about the segment landscape — not LLM-generated.
|
|
18
|
+
class ListingSegmentRecommendation < ApiModelBase
|
|
19
|
+
# Stable identifier for the recommendation kind. SDKs can switch on this safely.
|
|
20
|
+
attr_accessor :kind
|
|
21
|
+
|
|
22
|
+
attr_accessor :message
|
|
23
|
+
|
|
24
|
+
attr_accessor :evidence
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'kind' => :'kind',
|
|
30
|
+
:'message' => :'message',
|
|
31
|
+
:'evidence' => :'evidence'
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns attribute mapping this model knows about
|
|
36
|
+
def self.acceptable_attribute_map
|
|
37
|
+
attribute_map
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
|
41
|
+
def self.acceptable_attributes
|
|
42
|
+
acceptable_attribute_map.values
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute type mapping.
|
|
46
|
+
def self.openapi_types
|
|
47
|
+
{
|
|
48
|
+
:'kind' => :'String',
|
|
49
|
+
:'message' => :'String',
|
|
50
|
+
:'evidence' => :'Hash<String, Object>'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# List of attributes with nullable: true
|
|
55
|
+
def self.openapi_nullable
|
|
56
|
+
Set.new([
|
|
57
|
+
:'evidence'
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingSegmentRecommendation` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingSegmentRecommendation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'kind')
|
|
78
|
+
self.kind = attributes[:'kind']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'message')
|
|
82
|
+
self.message = attributes[:'message']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'evidence')
|
|
86
|
+
if (value = attributes[:'evidence']).is_a?(Hash)
|
|
87
|
+
self.evidence = value
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
93
|
+
# @return Array for valid properties with the reasons
|
|
94
|
+
def list_invalid_properties
|
|
95
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
96
|
+
invalid_properties = Array.new
|
|
97
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Checks equality by comparing each attribute.
|
|
108
|
+
# @param [Object] Object to be compared
|
|
109
|
+
def ==(o)
|
|
110
|
+
return true if self.equal?(o)
|
|
111
|
+
self.class == o.class &&
|
|
112
|
+
kind == o.kind &&
|
|
113
|
+
message == o.message &&
|
|
114
|
+
evidence == o.evidence
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# @see the `==` method
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def eql?(o)
|
|
120
|
+
self == o
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Calculates hash code according to all attributes.
|
|
124
|
+
# @return [Integer] Hash code
|
|
125
|
+
def hash
|
|
126
|
+
[kind, message, evidence].hash
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Builds the object from hash
|
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
131
|
+
# @return [Object] Returns the model itself
|
|
132
|
+
def self.build_from_hash(attributes)
|
|
133
|
+
return nil unless attributes.is_a?(Hash)
|
|
134
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
135
|
+
transformed_hash = {}
|
|
136
|
+
openapi_types.each_pair do |key, type|
|
|
137
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
138
|
+
transformed_hash["#{key}"] = nil
|
|
139
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
140
|
+
# check to ensure the input is an array given that the attribute
|
|
141
|
+
# is documented as an array but the input is not
|
|
142
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
143
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
144
|
+
end
|
|
145
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
146
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
new(transformed_hash)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Returns the object in the form of hash
|
|
153
|
+
# @return [Hash] Returns the object in the form of hash
|
|
154
|
+
def to_hash
|
|
155
|
+
hash = {}
|
|
156
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
157
|
+
value = self.send(attr)
|
|
158
|
+
if value.nil?
|
|
159
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
160
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
hash[param] = _to_hash(value)
|
|
164
|
+
end
|
|
165
|
+
hash
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
end
|
|
@@ -0,0 +1,230 @@
|
|
|
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
|
+
# Returned by `GET /v1/listings/{id}/segments`. Honest about DNA coverage — when no comps in the scope have been DNA-scored, returns `totalCompsAnalyzed: 0` plus a `low_dna_coverage` recommendation rather than fabricated data.
|
|
18
|
+
class ListingSegmentsResponse < ApiModelBase
|
|
19
|
+
attr_accessor :listing_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :level
|
|
22
|
+
|
|
23
|
+
attr_accessor :scope
|
|
24
|
+
|
|
25
|
+
# The source listing's own `ai_segment` (or null if not yet scored).
|
|
26
|
+
attr_accessor :my_segment
|
|
27
|
+
|
|
28
|
+
attr_accessor :my_quality_tier
|
|
29
|
+
|
|
30
|
+
# Number of comps in scope that have a DNA score. `0` is a coverage signal, not an error.
|
|
31
|
+
attr_accessor :total_comps_analyzed
|
|
32
|
+
|
|
33
|
+
attr_accessor :segments
|
|
34
|
+
|
|
35
|
+
attr_accessor :quality_tiers
|
|
36
|
+
|
|
37
|
+
attr_accessor :recommendations
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'listing_id' => :'listingId',
|
|
43
|
+
:'level' => :'level',
|
|
44
|
+
:'scope' => :'scope',
|
|
45
|
+
:'my_segment' => :'mySegment',
|
|
46
|
+
:'my_quality_tier' => :'myQualityTier',
|
|
47
|
+
:'total_comps_analyzed' => :'totalCompsAnalyzed',
|
|
48
|
+
:'segments' => :'segments',
|
|
49
|
+
:'quality_tiers' => :'qualityTiers',
|
|
50
|
+
:'recommendations' => :'recommendations'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns attribute mapping this model knows about
|
|
55
|
+
def self.acceptable_attribute_map
|
|
56
|
+
attribute_map
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns all the JSON keys this model knows about
|
|
60
|
+
def self.acceptable_attributes
|
|
61
|
+
acceptable_attribute_map.values
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute type mapping.
|
|
65
|
+
def self.openapi_types
|
|
66
|
+
{
|
|
67
|
+
:'listing_id' => :'String',
|
|
68
|
+
:'level' => :'String',
|
|
69
|
+
:'scope' => :'ListingSegmentsResponseScope',
|
|
70
|
+
:'my_segment' => :'String',
|
|
71
|
+
:'my_quality_tier' => :'String',
|
|
72
|
+
:'total_comps_analyzed' => :'Integer',
|
|
73
|
+
:'segments' => :'Array<ListingSegment>',
|
|
74
|
+
:'quality_tiers' => :'Array<ListingQualityTier>',
|
|
75
|
+
:'recommendations' => :'Array<ListingSegmentRecommendation>'
|
|
76
|
+
}
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# List of attributes with nullable: true
|
|
80
|
+
def self.openapi_nullable
|
|
81
|
+
Set.new([
|
|
82
|
+
:'my_segment',
|
|
83
|
+
:'my_quality_tier',
|
|
84
|
+
])
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Initializes the object
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
def initialize(attributes = {})
|
|
90
|
+
if (!attributes.is_a?(Hash))
|
|
91
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingSegmentsResponse` initialize method"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
95
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
97
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingSegmentsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
99
|
+
end
|
|
100
|
+
h[k.to_sym] = v
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'listing_id')
|
|
104
|
+
self.listing_id = attributes[:'listing_id']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'level')
|
|
108
|
+
self.level = attributes[:'level']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'scope')
|
|
112
|
+
self.scope = attributes[:'scope']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'my_segment')
|
|
116
|
+
self.my_segment = attributes[:'my_segment']
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'my_quality_tier')
|
|
120
|
+
self.my_quality_tier = attributes[:'my_quality_tier']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'total_comps_analyzed')
|
|
124
|
+
self.total_comps_analyzed = attributes[:'total_comps_analyzed']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'segments')
|
|
128
|
+
if (value = attributes[:'segments']).is_a?(Array)
|
|
129
|
+
self.segments = value
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'quality_tiers')
|
|
134
|
+
if (value = attributes[:'quality_tiers']).is_a?(Array)
|
|
135
|
+
self.quality_tiers = value
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'recommendations')
|
|
140
|
+
if (value = attributes[:'recommendations']).is_a?(Array)
|
|
141
|
+
self.recommendations = value
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
147
|
+
# @return Array for valid properties with the reasons
|
|
148
|
+
def list_invalid_properties
|
|
149
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
150
|
+
invalid_properties = Array.new
|
|
151
|
+
invalid_properties
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Check to see if the all the properties in the model are valid
|
|
155
|
+
# @return true if the model is valid
|
|
156
|
+
def valid?
|
|
157
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
158
|
+
true
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Checks equality by comparing each attribute.
|
|
162
|
+
# @param [Object] Object to be compared
|
|
163
|
+
def ==(o)
|
|
164
|
+
return true if self.equal?(o)
|
|
165
|
+
self.class == o.class &&
|
|
166
|
+
listing_id == o.listing_id &&
|
|
167
|
+
level == o.level &&
|
|
168
|
+
scope == o.scope &&
|
|
169
|
+
my_segment == o.my_segment &&
|
|
170
|
+
my_quality_tier == o.my_quality_tier &&
|
|
171
|
+
total_comps_analyzed == o.total_comps_analyzed &&
|
|
172
|
+
segments == o.segments &&
|
|
173
|
+
quality_tiers == o.quality_tiers &&
|
|
174
|
+
recommendations == o.recommendations
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# @see the `==` method
|
|
178
|
+
# @param [Object] Object to be compared
|
|
179
|
+
def eql?(o)
|
|
180
|
+
self == o
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Calculates hash code according to all attributes.
|
|
184
|
+
# @return [Integer] Hash code
|
|
185
|
+
def hash
|
|
186
|
+
[listing_id, level, scope, my_segment, my_quality_tier, total_comps_analyzed, segments, quality_tiers, recommendations].hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Builds the object from hash
|
|
190
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
191
|
+
# @return [Object] Returns the model itself
|
|
192
|
+
def self.build_from_hash(attributes)
|
|
193
|
+
return nil unless attributes.is_a?(Hash)
|
|
194
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
195
|
+
transformed_hash = {}
|
|
196
|
+
openapi_types.each_pair do |key, type|
|
|
197
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
198
|
+
transformed_hash["#{key}"] = nil
|
|
199
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
200
|
+
# check to ensure the input is an array given that the attribute
|
|
201
|
+
# is documented as an array but the input is not
|
|
202
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
203
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
204
|
+
end
|
|
205
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
206
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
new(transformed_hash)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the object in the form of hash
|
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
|
214
|
+
def to_hash
|
|
215
|
+
hash = {}
|
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
217
|
+
value = self.send(attr)
|
|
218
|
+
if value.nil?
|
|
219
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
220
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
hash[param] = _to_hash(value)
|
|
224
|
+
end
|
|
225
|
+
hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
@@ -0,0 +1,159 @@
|
|
|
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
|
+
# When `level=comp_set` carries `radiusKm`; when `level=market` carries `city`. May be empty when neither could be resolved.
|
|
18
|
+
class ListingSegmentsResponseScope < ApiModelBase
|
|
19
|
+
attr_accessor :radius_km
|
|
20
|
+
|
|
21
|
+
attr_accessor :city
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'radius_km' => :'radiusKm',
|
|
27
|
+
:'city' => :'city'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'radius_km' => :'Float',
|
|
45
|
+
:'city' => :'String'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
:'radius_km',
|
|
53
|
+
:'city'
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingSegmentsResponseScope` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingSegmentsResponseScope`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'radius_km')
|
|
74
|
+
self.radius_km = attributes[:'radius_km']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'city')
|
|
78
|
+
self.city = attributes[:'city']
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
83
|
+
# @return Array for valid properties with the reasons
|
|
84
|
+
def list_invalid_properties
|
|
85
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
86
|
+
invalid_properties = Array.new
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
|
+
true
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Checks equality by comparing each attribute.
|
|
98
|
+
# @param [Object] Object to be compared
|
|
99
|
+
def ==(o)
|
|
100
|
+
return true if self.equal?(o)
|
|
101
|
+
self.class == o.class &&
|
|
102
|
+
radius_km == o.radius_km &&
|
|
103
|
+
city == o.city
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @see the `==` method
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def eql?(o)
|
|
109
|
+
self == o
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Calculates hash code according to all attributes.
|
|
113
|
+
# @return [Integer] Hash code
|
|
114
|
+
def hash
|
|
115
|
+
[radius_km, city].hash
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Builds the object from hash
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
# @return [Object] Returns the model itself
|
|
121
|
+
def self.build_from_hash(attributes)
|
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
|
123
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
124
|
+
transformed_hash = {}
|
|
125
|
+
openapi_types.each_pair do |key, type|
|
|
126
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
127
|
+
transformed_hash["#{key}"] = nil
|
|
128
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
129
|
+
# check to ensure the input is an array given that the attribute
|
|
130
|
+
# is documented as an array but the input is not
|
|
131
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
132
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
133
|
+
end
|
|
134
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
new(transformed_hash)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Returns the object in the form of hash
|
|
142
|
+
# @return [Hash] Returns the object in the form of hash
|
|
143
|
+
def to_hash
|
|
144
|
+
hash = {}
|
|
145
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
146
|
+
value = self.send(attr)
|
|
147
|
+
if value.nil?
|
|
148
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
149
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
hash[param] = _to_hash(value)
|
|
153
|
+
end
|
|
154
|
+
hash
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
end
|