repull 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/repull/api/airbnb_api.rb +116 -129
- data/lib/repull/api/billing_api.rb +0 -55
- data/lib/repull/api/booking_com_api.rb +19 -118
- data/lib/repull/api/listings_api.rb +74 -0
- data/lib/repull/api/reservations_api.rb +0 -197
- data/lib/repull/api/{availability_api.rb → sandbox_api.rb} +35 -66
- data/lib/repull/api/vrbo_api.rb +0 -126
- data/lib/repull/models/{create_studio_project_request.rb → airbnb_availability_write_request.rb} +38 -52
- data/lib/repull/models/{create_studio_deployment201_response_data.rb → airbnb_calendar_operation.rb} +108 -57
- data/lib/repull/models/{update_studio_project_request.rb → airbnb_listing_action_request.rb} +55 -47
- data/lib/repull/models/{update_availability_request.rb → airbnb_pricing_write_request.rb} +100 -11
- data/lib/repull/models/{update_reservation_request.rb → booking_availability_update.rb} +124 -22
- data/lib/repull/models/{list_studio_deployments200_response.rb → booking_availability_update_request.rb} +90 -18
- data/lib/repull/models/{generate_studio_completion_request_project_id.rb → booking_availability_update_request_property_id.rb} +2 -2
- data/lib/repull/models/{get_studio_deployment200_response.rb → booking_availability_update_request_updates_inner.rb} +74 -117
- data/lib/repull/models/booking_pricing_rate_update.rb +1 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +65 -6
- data/lib/repull/models/{get_studio_project200_response.rb → listing_content_update_request.rb} +106 -10
- data/lib/repull/models/{upsert_studio_project_file200_response.rb → listing_content_update_request_address.rb} +53 -10
- data/lib/repull/models/listing_content_update_request_amenities.rb +105 -0
- data/lib/repull/models/{create_studio_deployment_request.rb → listing_content_update_request_amenities_one_of_inner.rb} +51 -20
- data/lib/repull/models/{create_studio_project_generation_request.rb → listing_content_update_request_occupancy.rb} +42 -28
- data/lib/repull/{api/ai_api.rb → models/listing_content_update_request_photos_inner.rb} +77 -59
- data/lib/repull/models/{generate_studio_completion200_response_data.rb → listing_content_update_request_photos_inner_one_of.rb} +81 -66
- data/lib/repull/models/{generate_studio_completion200_response.rb → listing_content_update_request_policies.rb} +116 -10
- data/lib/repull/models/{delete_studio_project200_response_data.rb → listing_content_update_response.rb} +26 -10
- data/lib/repull/models/map_airbnb_listing_request.rb +215 -0
- data/lib/repull/models/{create_reservation_request.rb → map_airbnb_listing_response.rb} +137 -116
- data/lib/repull/models/property.rb +42 -69
- data/lib/repull/models/reservation.rb +28 -1
- data/lib/repull/models/{upsert_studio_project_file_request.rb → sandbox_fixture_ref.rb} +48 -20
- data/lib/repull/models/{delete_studio_deployment200_response_data.rb → sandbox_reset_result.rb} +72 -11
- data/lib/repull/models/sandbox_reset_result_deleted.rb +216 -0
- data/lib/repull/models/sandbox_seed_result.rb +278 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +24 -35
- data/openapi/v1.json +1167 -2030
- metadata +26 -37
- data/lib/repull/api/studio_api.rb +0 -1094
- data/lib/repull/models/create_ai_operation200_response.rb +0 -156
- data/lib/repull/models/create_studio_deployment201_response.rb +0 -147
- data/lib/repull/models/create_studio_project201_response.rb +0 -147
- data/lib/repull/models/create_studio_project201_response_data.rb +0 -199
- data/lib/repull/models/create_studio_project_generation201_response.rb +0 -147
- data/lib/repull/models/create_studio_project_generation201_response_data.rb +0 -165
- data/lib/repull/models/delete_studio_deployment200_response.rb +0 -147
- data/lib/repull/models/delete_studio_project200_response.rb +0 -147
- data/lib/repull/models/delete_studio_project_file200_response.rb +0 -147
- data/lib/repull/models/delete_studio_project_file200_response_data.rb +0 -156
- data/lib/repull/models/generate_studio_completion_request.rb +0 -305
- data/lib/repull/models/list_studio_project_files200_response.rb +0 -149
- data/lib/repull/models/list_studio_projects200_response.rb +0 -149
- data/lib/repull/models/upsert_studio_project_file200_response_data.rb +0 -147
|
@@ -0,0 +1,215 @@
|
|
|
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`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: ivan@vanio.ai
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
# Body for `POST /v1/channels/airbnb/listings/map`.
|
|
18
|
+
class MapAirbnbListingRequest < ApiModelBase
|
|
19
|
+
# The Airbnb listing id to map. Discover it via `GET /v1/channels/airbnb/listings`.
|
|
20
|
+
attr_accessor :airbnb_id
|
|
21
|
+
|
|
22
|
+
# Canonical Repull listing id to link the Airbnb listing to. Must belong to your workspace. A numeric string is also accepted.
|
|
23
|
+
attr_accessor :listing_id
|
|
24
|
+
|
|
25
|
+
# Optional. When present, must match the Airbnb listing's host id — guards against mapping the wrong host's listing.
|
|
26
|
+
attr_accessor :host_id
|
|
27
|
+
|
|
28
|
+
# Whether the resulting platform link has sync enabled.
|
|
29
|
+
attr_accessor :sync_enabled
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'airbnb_id' => :'airbnbId',
|
|
35
|
+
:'listing_id' => :'listingId',
|
|
36
|
+
:'host_id' => :'hostId',
|
|
37
|
+
:'sync_enabled' => :'syncEnabled'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns attribute mapping this model knows about
|
|
42
|
+
def self.acceptable_attribute_map
|
|
43
|
+
attribute_map
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns all the JSON keys this model knows about
|
|
47
|
+
def self.acceptable_attributes
|
|
48
|
+
acceptable_attribute_map.values
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.openapi_types
|
|
53
|
+
{
|
|
54
|
+
:'airbnb_id' => :'String',
|
|
55
|
+
:'listing_id' => :'Integer',
|
|
56
|
+
:'host_id' => :'String',
|
|
57
|
+
:'sync_enabled' => :'Boolean'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::MapAirbnbListingRequest` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::MapAirbnbListingRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'airbnb_id')
|
|
84
|
+
self.airbnb_id = attributes[:'airbnb_id']
|
|
85
|
+
else
|
|
86
|
+
self.airbnb_id = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'listing_id')
|
|
90
|
+
self.listing_id = attributes[:'listing_id']
|
|
91
|
+
else
|
|
92
|
+
self.listing_id = nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'host_id')
|
|
96
|
+
self.host_id = attributes[:'host_id']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'sync_enabled')
|
|
100
|
+
self.sync_enabled = attributes[:'sync_enabled']
|
|
101
|
+
else
|
|
102
|
+
self.sync_enabled = true
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
107
|
+
# @return Array for valid properties with the reasons
|
|
108
|
+
def list_invalid_properties
|
|
109
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
110
|
+
invalid_properties = Array.new
|
|
111
|
+
if @airbnb_id.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "airbnb_id", airbnb_id cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @listing_id.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "listing_id", listing_id cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
invalid_properties
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Check to see if the all the properties in the model are valid
|
|
123
|
+
# @return true if the model is valid
|
|
124
|
+
def valid?
|
|
125
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
126
|
+
return false if @airbnb_id.nil?
|
|
127
|
+
return false if @listing_id.nil?
|
|
128
|
+
true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Custom attribute writer method with validation
|
|
132
|
+
# @param [Object] airbnb_id Value to be assigned
|
|
133
|
+
def airbnb_id=(airbnb_id)
|
|
134
|
+
if airbnb_id.nil?
|
|
135
|
+
fail ArgumentError, 'airbnb_id cannot be nil'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@airbnb_id = airbnb_id
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] listing_id Value to be assigned
|
|
143
|
+
def listing_id=(listing_id)
|
|
144
|
+
if listing_id.nil?
|
|
145
|
+
fail ArgumentError, 'listing_id cannot be nil'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
@listing_id = listing_id
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Checks equality by comparing each attribute.
|
|
152
|
+
# @param [Object] Object to be compared
|
|
153
|
+
def ==(o)
|
|
154
|
+
return true if self.equal?(o)
|
|
155
|
+
self.class == o.class &&
|
|
156
|
+
airbnb_id == o.airbnb_id &&
|
|
157
|
+
listing_id == o.listing_id &&
|
|
158
|
+
host_id == o.host_id &&
|
|
159
|
+
sync_enabled == o.sync_enabled
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# @see the `==` method
|
|
163
|
+
# @param [Object] Object to be compared
|
|
164
|
+
def eql?(o)
|
|
165
|
+
self == o
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Calculates hash code according to all attributes.
|
|
169
|
+
# @return [Integer] Hash code
|
|
170
|
+
def hash
|
|
171
|
+
[airbnb_id, listing_id, host_id, sync_enabled].hash
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Builds the object from hash
|
|
175
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
176
|
+
# @return [Object] Returns the model itself
|
|
177
|
+
def self.build_from_hash(attributes)
|
|
178
|
+
return nil unless attributes.is_a?(Hash)
|
|
179
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
180
|
+
transformed_hash = {}
|
|
181
|
+
openapi_types.each_pair do |key, type|
|
|
182
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
183
|
+
transformed_hash["#{key}"] = nil
|
|
184
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
185
|
+
# check to ensure the input is an array given that the attribute
|
|
186
|
+
# is documented as an array but the input is not
|
|
187
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
188
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
189
|
+
end
|
|
190
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
191
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
new(transformed_hash)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Returns the object in the form of hash
|
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
|
199
|
+
def to_hash
|
|
200
|
+
hash = {}
|
|
201
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
202
|
+
value = self.send(attr)
|
|
203
|
+
if value.nil?
|
|
204
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
205
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
hash[param] = _to_hash(value)
|
|
209
|
+
end
|
|
210
|
+
hash
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
end
|
|
@@ -14,40 +14,39 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
# Id fields are strings (API-wide convention — bigint ids are stringified to avoid 53-bit JS-number precision loss).
|
|
18
|
+
class MapAirbnbListingResponse < ApiModelBase
|
|
19
|
+
attr_accessor :success
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
# True when the Airbnb listing was already mapped to this listing (no-op).
|
|
22
|
+
attr_accessor :already_mapped
|
|
21
23
|
|
|
22
|
-
attr_accessor :
|
|
24
|
+
attr_accessor :airbnb_id
|
|
23
25
|
|
|
24
|
-
attr_accessor :
|
|
26
|
+
attr_accessor :listing_id
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
# The listing the Airbnb record pointed at before this call. Omitted on a no-op.
|
|
29
|
+
attr_accessor :previous_listing_id
|
|
27
30
|
|
|
28
|
-
attr_accessor :
|
|
31
|
+
attr_accessor :host_id
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
# Internal id of the `listings_airbnb` record.
|
|
34
|
+
attr_accessor :listing_airbnb_id
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
attr_accessor :total_price
|
|
35
|
-
|
|
36
|
-
attr_accessor :currency
|
|
36
|
+
# Internal id of the resulting `listing_platform_links` row.
|
|
37
|
+
attr_accessor :platform_link_id
|
|
37
38
|
|
|
38
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
40
|
def self.attribute_map
|
|
40
41
|
{
|
|
41
|
-
:'
|
|
42
|
-
:'
|
|
43
|
-
:'
|
|
44
|
-
:'
|
|
45
|
-
:'
|
|
46
|
-
:'
|
|
47
|
-
:'
|
|
48
|
-
:'
|
|
49
|
-
:'total_price' => :'totalPrice',
|
|
50
|
-
:'currency' => :'currency'
|
|
42
|
+
:'success' => :'success',
|
|
43
|
+
:'already_mapped' => :'alreadyMapped',
|
|
44
|
+
:'airbnb_id' => :'airbnbId',
|
|
45
|
+
:'listing_id' => :'listingId',
|
|
46
|
+
:'previous_listing_id' => :'previousListingId',
|
|
47
|
+
:'host_id' => :'hostId',
|
|
48
|
+
:'listing_airbnb_id' => :'listingAirbnbId',
|
|
49
|
+
:'platform_link_id' => :'platformLinkId'
|
|
51
50
|
}
|
|
52
51
|
end
|
|
53
52
|
|
|
@@ -64,16 +63,14 @@ module Repull
|
|
|
64
63
|
# Attribute type mapping.
|
|
65
64
|
def self.openapi_types
|
|
66
65
|
{
|
|
67
|
-
:'
|
|
68
|
-
:'
|
|
69
|
-
:'
|
|
70
|
-
:'
|
|
71
|
-
:'
|
|
72
|
-
:'
|
|
73
|
-
:'
|
|
74
|
-
:'
|
|
75
|
-
:'total_price' => :'Float',
|
|
76
|
-
:'currency' => :'String'
|
|
66
|
+
:'success' => :'Boolean',
|
|
67
|
+
:'already_mapped' => :'Boolean',
|
|
68
|
+
:'airbnb_id' => :'String',
|
|
69
|
+
:'listing_id' => :'String',
|
|
70
|
+
:'previous_listing_id' => :'String',
|
|
71
|
+
:'host_id' => :'String',
|
|
72
|
+
:'listing_airbnb_id' => :'String',
|
|
73
|
+
:'platform_link_id' => :'String'
|
|
77
74
|
}
|
|
78
75
|
end
|
|
79
76
|
|
|
@@ -87,66 +84,62 @@ module Repull
|
|
|
87
84
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
85
|
def initialize(attributes = {})
|
|
89
86
|
if (!attributes.is_a?(Hash))
|
|
90
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::
|
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::MapAirbnbListingResponse` initialize method"
|
|
91
88
|
end
|
|
92
89
|
|
|
93
90
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
91
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
95
92
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
93
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::MapAirbnbListingResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
98
95
|
end
|
|
99
96
|
h[k.to_sym] = v
|
|
100
97
|
}
|
|
101
98
|
|
|
102
|
-
if attributes.key?(:'
|
|
103
|
-
self.
|
|
104
|
-
else
|
|
105
|
-
self.property_id = nil
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
if attributes.key?(:'check_in')
|
|
109
|
-
self.check_in = attributes[:'check_in']
|
|
99
|
+
if attributes.key?(:'success')
|
|
100
|
+
self.success = attributes[:'success']
|
|
110
101
|
else
|
|
111
|
-
self.
|
|
102
|
+
self.success = nil
|
|
112
103
|
end
|
|
113
104
|
|
|
114
|
-
if attributes.key?(:'
|
|
115
|
-
self.
|
|
105
|
+
if attributes.key?(:'already_mapped')
|
|
106
|
+
self.already_mapped = attributes[:'already_mapped']
|
|
116
107
|
else
|
|
117
|
-
self.
|
|
108
|
+
self.already_mapped = nil
|
|
118
109
|
end
|
|
119
110
|
|
|
120
|
-
if attributes.key?(:'
|
|
121
|
-
self.
|
|
111
|
+
if attributes.key?(:'airbnb_id')
|
|
112
|
+
self.airbnb_id = attributes[:'airbnb_id']
|
|
122
113
|
else
|
|
123
|
-
self.
|
|
114
|
+
self.airbnb_id = nil
|
|
124
115
|
end
|
|
125
116
|
|
|
126
|
-
if attributes.key?(:'
|
|
127
|
-
self.
|
|
117
|
+
if attributes.key?(:'listing_id')
|
|
118
|
+
self.listing_id = attributes[:'listing_id']
|
|
128
119
|
else
|
|
129
|
-
self.
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
if attributes.key?(:'guest_email')
|
|
133
|
-
self.guest_email = attributes[:'guest_email']
|
|
120
|
+
self.listing_id = nil
|
|
134
121
|
end
|
|
135
122
|
|
|
136
|
-
if attributes.key?(:'
|
|
137
|
-
self.
|
|
123
|
+
if attributes.key?(:'previous_listing_id')
|
|
124
|
+
self.previous_listing_id = attributes[:'previous_listing_id']
|
|
138
125
|
end
|
|
139
126
|
|
|
140
|
-
if attributes.key?(:'
|
|
141
|
-
self.
|
|
127
|
+
if attributes.key?(:'host_id')
|
|
128
|
+
self.host_id = attributes[:'host_id']
|
|
129
|
+
else
|
|
130
|
+
self.host_id = nil
|
|
142
131
|
end
|
|
143
132
|
|
|
144
|
-
if attributes.key?(:'
|
|
145
|
-
self.
|
|
133
|
+
if attributes.key?(:'listing_airbnb_id')
|
|
134
|
+
self.listing_airbnb_id = attributes[:'listing_airbnb_id']
|
|
135
|
+
else
|
|
136
|
+
self.listing_airbnb_id = nil
|
|
146
137
|
end
|
|
147
138
|
|
|
148
|
-
if attributes.key?(:'
|
|
149
|
-
self.
|
|
139
|
+
if attributes.key?(:'platform_link_id')
|
|
140
|
+
self.platform_link_id = attributes[:'platform_link_id']
|
|
141
|
+
else
|
|
142
|
+
self.platform_link_id = nil
|
|
150
143
|
end
|
|
151
144
|
end
|
|
152
145
|
|
|
@@ -155,24 +148,32 @@ module Repull
|
|
|
155
148
|
def list_invalid_properties
|
|
156
149
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
157
150
|
invalid_properties = Array.new
|
|
158
|
-
if @
|
|
159
|
-
invalid_properties.push('invalid value for "
|
|
151
|
+
if @success.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "success", success cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @already_mapped.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "already_mapped", already_mapped cannot be nil.')
|
|
160
157
|
end
|
|
161
158
|
|
|
162
|
-
if @
|
|
163
|
-
invalid_properties.push('invalid value for "
|
|
159
|
+
if @airbnb_id.nil?
|
|
160
|
+
invalid_properties.push('invalid value for "airbnb_id", airbnb_id cannot be nil.')
|
|
164
161
|
end
|
|
165
162
|
|
|
166
|
-
if @
|
|
167
|
-
invalid_properties.push('invalid value for "
|
|
163
|
+
if @listing_id.nil?
|
|
164
|
+
invalid_properties.push('invalid value for "listing_id", listing_id cannot be nil.')
|
|
168
165
|
end
|
|
169
166
|
|
|
170
|
-
if @
|
|
171
|
-
invalid_properties.push('invalid value for "
|
|
167
|
+
if @host_id.nil?
|
|
168
|
+
invalid_properties.push('invalid value for "host_id", host_id cannot be nil.')
|
|
172
169
|
end
|
|
173
170
|
|
|
174
|
-
if @
|
|
175
|
-
invalid_properties.push('invalid value for "
|
|
171
|
+
if @listing_airbnb_id.nil?
|
|
172
|
+
invalid_properties.push('invalid value for "listing_airbnb_id", listing_airbnb_id cannot be nil.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if @platform_link_id.nil?
|
|
176
|
+
invalid_properties.push('invalid value for "platform_link_id", platform_link_id cannot be nil.')
|
|
176
177
|
end
|
|
177
178
|
|
|
178
179
|
invalid_properties
|
|
@@ -182,62 +183,84 @@ module Repull
|
|
|
182
183
|
# @return true if the model is valid
|
|
183
184
|
def valid?
|
|
184
185
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
185
|
-
return false if @
|
|
186
|
-
return false if @
|
|
187
|
-
return false if @
|
|
188
|
-
return false if @
|
|
189
|
-
return false if @
|
|
186
|
+
return false if @success.nil?
|
|
187
|
+
return false if @already_mapped.nil?
|
|
188
|
+
return false if @airbnb_id.nil?
|
|
189
|
+
return false if @listing_id.nil?
|
|
190
|
+
return false if @host_id.nil?
|
|
191
|
+
return false if @listing_airbnb_id.nil?
|
|
192
|
+
return false if @platform_link_id.nil?
|
|
190
193
|
true
|
|
191
194
|
end
|
|
192
195
|
|
|
193
196
|
# Custom attribute writer method with validation
|
|
194
|
-
# @param [Object]
|
|
195
|
-
def
|
|
196
|
-
if
|
|
197
|
-
fail ArgumentError, '
|
|
197
|
+
# @param [Object] success Value to be assigned
|
|
198
|
+
def success=(success)
|
|
199
|
+
if success.nil?
|
|
200
|
+
fail ArgumentError, 'success cannot be nil'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@success = success
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Custom attribute writer method with validation
|
|
207
|
+
# @param [Object] already_mapped Value to be assigned
|
|
208
|
+
def already_mapped=(already_mapped)
|
|
209
|
+
if already_mapped.nil?
|
|
210
|
+
fail ArgumentError, 'already_mapped cannot be nil'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
@already_mapped = already_mapped
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Custom attribute writer method with validation
|
|
217
|
+
# @param [Object] airbnb_id Value to be assigned
|
|
218
|
+
def airbnb_id=(airbnb_id)
|
|
219
|
+
if airbnb_id.nil?
|
|
220
|
+
fail ArgumentError, 'airbnb_id cannot be nil'
|
|
198
221
|
end
|
|
199
222
|
|
|
200
|
-
@
|
|
223
|
+
@airbnb_id = airbnb_id
|
|
201
224
|
end
|
|
202
225
|
|
|
203
226
|
# Custom attribute writer method with validation
|
|
204
|
-
# @param [Object]
|
|
205
|
-
def
|
|
206
|
-
if
|
|
207
|
-
fail ArgumentError, '
|
|
227
|
+
# @param [Object] listing_id Value to be assigned
|
|
228
|
+
def listing_id=(listing_id)
|
|
229
|
+
if listing_id.nil?
|
|
230
|
+
fail ArgumentError, 'listing_id cannot be nil'
|
|
208
231
|
end
|
|
209
232
|
|
|
210
|
-
@
|
|
233
|
+
@listing_id = listing_id
|
|
211
234
|
end
|
|
212
235
|
|
|
213
236
|
# Custom attribute writer method with validation
|
|
214
|
-
# @param [Object]
|
|
215
|
-
def
|
|
216
|
-
if
|
|
217
|
-
fail ArgumentError, '
|
|
237
|
+
# @param [Object] host_id Value to be assigned
|
|
238
|
+
def host_id=(host_id)
|
|
239
|
+
if host_id.nil?
|
|
240
|
+
fail ArgumentError, 'host_id cannot be nil'
|
|
218
241
|
end
|
|
219
242
|
|
|
220
|
-
@
|
|
243
|
+
@host_id = host_id
|
|
221
244
|
end
|
|
222
245
|
|
|
223
246
|
# Custom attribute writer method with validation
|
|
224
|
-
# @param [Object]
|
|
225
|
-
def
|
|
226
|
-
if
|
|
227
|
-
fail ArgumentError, '
|
|
247
|
+
# @param [Object] listing_airbnb_id Value to be assigned
|
|
248
|
+
def listing_airbnb_id=(listing_airbnb_id)
|
|
249
|
+
if listing_airbnb_id.nil?
|
|
250
|
+
fail ArgumentError, 'listing_airbnb_id cannot be nil'
|
|
228
251
|
end
|
|
229
252
|
|
|
230
|
-
@
|
|
253
|
+
@listing_airbnb_id = listing_airbnb_id
|
|
231
254
|
end
|
|
232
255
|
|
|
233
256
|
# Custom attribute writer method with validation
|
|
234
|
-
# @param [Object]
|
|
235
|
-
def
|
|
236
|
-
if
|
|
237
|
-
fail ArgumentError, '
|
|
257
|
+
# @param [Object] platform_link_id Value to be assigned
|
|
258
|
+
def platform_link_id=(platform_link_id)
|
|
259
|
+
if platform_link_id.nil?
|
|
260
|
+
fail ArgumentError, 'platform_link_id cannot be nil'
|
|
238
261
|
end
|
|
239
262
|
|
|
240
|
-
@
|
|
263
|
+
@platform_link_id = platform_link_id
|
|
241
264
|
end
|
|
242
265
|
|
|
243
266
|
# Checks equality by comparing each attribute.
|
|
@@ -245,16 +268,14 @@ module Repull
|
|
|
245
268
|
def ==(o)
|
|
246
269
|
return true if self.equal?(o)
|
|
247
270
|
self.class == o.class &&
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
total_price == o.total_price &&
|
|
257
|
-
currency == o.currency
|
|
271
|
+
success == o.success &&
|
|
272
|
+
already_mapped == o.already_mapped &&
|
|
273
|
+
airbnb_id == o.airbnb_id &&
|
|
274
|
+
listing_id == o.listing_id &&
|
|
275
|
+
previous_listing_id == o.previous_listing_id &&
|
|
276
|
+
host_id == o.host_id &&
|
|
277
|
+
listing_airbnb_id == o.listing_airbnb_id &&
|
|
278
|
+
platform_link_id == o.platform_link_id
|
|
258
279
|
end
|
|
259
280
|
|
|
260
281
|
# @see the `==` method
|
|
@@ -266,7 +287,7 @@ module Repull
|
|
|
266
287
|
# Calculates hash code according to all attributes.
|
|
267
288
|
# @return [Integer] Hash code
|
|
268
289
|
def hash
|
|
269
|
-
[
|
|
290
|
+
[success, already_mapped, airbnb_id, listing_id, previous_listing_id, host_id, listing_airbnb_id, platform_link_id].hash
|
|
270
291
|
end
|
|
271
292
|
|
|
272
293
|
# Builds the object from hash
|