repull 0.2.14 → 0.2.15
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 +1265 -125
- data/lib/repull/api/availability_api.rb +2 -2
- data/lib/repull/api/connect_api.rb +4 -4
- data/lib/repull/api/listings_api.rb +97 -13
- data/lib/repull/models/airbnb_account_freshness.rb +239 -0
- data/lib/repull/models/airbnb_alteration.rb +46 -2
- data/lib/repull/models/airbnb_alteration_create_request.rb +264 -0
- data/lib/repull/models/airbnb_connection.rb +69 -2
- data/lib/repull/models/airbnb_connection_host.rb +1 -1
- data/lib/repull/models/airbnb_content_write_response.rb +275 -0
- data/lib/repull/models/airbnb_data_freshness.rb +22 -10
- data/lib/repull/models/{create_airbnb_alteration_request.rb → airbnb_description_write_request.rb} +44 -47
- data/lib/repull/models/airbnb_description_write_request_description.rb +365 -0
- data/lib/repull/models/airbnb_listing.rb +12 -1
- data/lib/repull/models/airbnb_listing_action200_response.rb +105 -0
- data/lib/repull/models/airbnb_listing_action200_response_one_of.rb +157 -0
- data/lib/repull/models/airbnb_listing_action200_response_one_of1.rb +175 -0
- data/lib/repull/models/airbnb_listing_action_request.rb +2 -2
- data/lib/repull/models/airbnb_listing_details_response.rb +284 -0
- data/lib/repull/models/airbnb_listing_details_write_request.rb +209 -0
- data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +214 -0
- data/lib/repull/models/airbnb_listing_details_write_request_quiet_hours_inner.rb +190 -0
- data/lib/repull/models/airbnb_listing_lifecycle_response.rb +196 -0
- data/lib/repull/models/airbnb_permits_response.rb +163 -0
- data/lib/repull/models/airbnb_permits_response_cached_inner.rb +200 -0
- data/lib/repull/models/airbnb_permits_write_request.rb +176 -0
- data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +228 -0
- data/lib/repull/models/airbnb_permits_write_request_permits_inner_answers_inner.rb +198 -0
- data/lib/repull/models/airbnb_photo_position.rb +159 -0
- data/lib/repull/models/airbnb_publish_result.rb +263 -0
- data/lib/repull/models/airbnb_reservation.rb +23 -1
- data/lib/repull/models/airbnb_reservation_list_response.rb +13 -4
- data/lib/repull/models/airbnb_review.rb +23 -1
- data/lib/repull/models/airbnb_review_list_response.rb +13 -4
- data/lib/repull/models/airbnb_safety_disclosure.rb +202 -0
- data/lib/repull/models/airbnb_safety_disclosures_response.rb +162 -0
- data/lib/repull/models/airbnb_safety_disclosures_write_request.rb +176 -0
- data/lib/repull/models/airbnb_thread.rb +23 -1
- data/lib/repull/models/airbnb_thread_list_response.rb +13 -4
- data/lib/repull/models/airbnb_transaction.rb +23 -1
- data/lib/repull/models/create_airbnb_listing_room_request.rb +315 -0
- data/lib/repull/models/delete_airbnb_listing_photo200_response.rb +14 -4
- data/lib/repull/models/delete_airbnb_listing_room200_response.rb +157 -0
- data/lib/repull/models/error_error.rb +31 -1
- data/lib/repull/models/get_airbnb_booking_settings200_response.rb +190 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data.rb +246 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_advance_notice.rb +172 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_booking_window.rb +160 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation.rb +203 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation_non_refundable.rb +218 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in.rb +159 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in_start.rb +104 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_out.rb +172 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_instant_book.rb +206 -0
- data/lib/repull/models/get_airbnb_booking_settings200_response_data_preparation_time.rb +173 -0
- data/lib/repull/models/get_airbnb_listing_details200_response.rb +192 -0
- data/lib/repull/models/list_airbnb_listing_permits200_response.rb +190 -0
- data/lib/repull/models/list_airbnb_listing_safety_disclosures200_response.rb +190 -0
- data/lib/repull/models/listing.rb +2 -1
- data/lib/repull/models/listing_content.rb +13 -2
- data/lib/repull/models/listing_content_update_request.rb +21 -2
- data/lib/repull/models/listing_content_update_request_details.rb +206 -0
- data/lib/repull/models/listing_content_update_request_policies.rb +95 -5
- data/lib/repull/models/listing_content_update_response.rb +1 -1
- data/lib/repull/models/listing_publish_airbnb_response.rb +165 -0
- data/lib/repull/models/listing_pull_airbnb_request.rb +149 -0
- data/lib/repull/models/listing_pull_response.rb +231 -0
- data/lib/repull/models/publish_section_error.rb +232 -0
- data/lib/repull/models/reorder_airbnb_listing_photos200_response.rb +191 -0
- data/lib/repull/models/reorder_airbnb_listing_photos200_response_data.rb +172 -0
- data/lib/repull/models/reorder_airbnb_listing_photos_request.rb +185 -0
- data/lib/repull/models/reservation.rb +23 -1
- data/lib/repull/models/reservation_webhook_object.rb +38 -5
- data/lib/repull/models/set_airbnb_listing_cover_photo200_response.rb +191 -0
- data/lib/repull/models/set_airbnb_listing_cover_photo200_response_data.rb +171 -0
- data/lib/repull/models/set_airbnb_listing_cover_photo_request.rb +165 -0
- data/lib/repull/models/update_airbnb_booking_settings200_response.rb +164 -0
- data/lib/repull/models/update_airbnb_booking_settings200_response_data.rb +205 -0
- data/lib/repull/models/update_airbnb_booking_settings_request.rb +202 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_advance_notice.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_booking_window.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_cancellation.rb +201 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_cancellation_non_refundable.rb +183 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_check_in.rb +159 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_check_out.rb +182 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_instant_book.rb +203 -0
- data/lib/repull/models/update_airbnb_booking_settings_request_preparation_time.rb +182 -0
- data/lib/repull/models/update_airbnb_listing_amenities200_response.rb +191 -0
- data/lib/repull/models/update_airbnb_listing_amenities200_response_data.rb +158 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request.rb +199 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request_accessibility_amenities_inner.rb +246 -0
- data/lib/repull/models/update_airbnb_listing_amenities_request_amenities_inner.rb +218 -0
- data/lib/repull/models/update_airbnb_listing_permits200_response.rb +168 -0
- data/lib/repull/models/update_airbnb_listing_photo200_response.rb +194 -0
- data/lib/repull/models/update_airbnb_listing_photo_request.rb +242 -0
- data/lib/repull/models/update_airbnb_listing_room200_response.rb +194 -0
- data/lib/repull/models/update_airbnb_listing_room_request.rb +293 -0
- data/lib/repull/models/update_airbnb_listing_room_request_beds_inner.rb +209 -0
- data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner.rb +182 -0
- data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner_value.rb +105 -0
- data/lib/repull/models/update_airbnb_listing_safety_disclosures200_response.rb +180 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request.rb +184 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner.rb +305 -0
- data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner_listing_id.rb +105 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +78 -1
- data/openapi/v1.json +4523 -1282
- data/scripts/regen.sh +1 -1
- metadata +80 -3
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: ivan@vanio.ai
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Repull
|
|
17
|
+
# Result of a content write. **A 200 does not by itself mean the change was applied**: Airbnb locks host-managed fields on established listings and answers 200 while applying nothing for them. `blockedFields` is the list of fields YOU sent that Airbnb dropped; `blockedFields: []` is what a landed write looks like.
|
|
18
|
+
class AirbnbContentWriteResponse < ApiModelBase
|
|
19
|
+
attr_accessor :listing_id
|
|
20
|
+
|
|
21
|
+
# The Airbnb-side listing id the write went to.
|
|
22
|
+
attr_accessor :airbnb_listing_id
|
|
23
|
+
|
|
24
|
+
# Descriptions only — the locale written.
|
|
25
|
+
attr_accessor :locale
|
|
26
|
+
|
|
27
|
+
# Fields that were applied.
|
|
28
|
+
attr_accessor :written
|
|
29
|
+
|
|
30
|
+
# Fields you sent that Airbnb refused to change. Not retryable — the content is managed on Airbnb.
|
|
31
|
+
attr_accessor :blocked_fields
|
|
32
|
+
|
|
33
|
+
# Present only when `blockedFields` is non-empty: what was not applied.
|
|
34
|
+
attr_accessor :message
|
|
35
|
+
|
|
36
|
+
# Present only when `blockedFields` is non-empty: what to do about it.
|
|
37
|
+
attr_accessor :fix
|
|
38
|
+
|
|
39
|
+
# Airbnb's raw response.
|
|
40
|
+
attr_accessor :result
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
43
|
+
def self.attribute_map
|
|
44
|
+
{
|
|
45
|
+
:'listing_id' => :'listingId',
|
|
46
|
+
:'airbnb_listing_id' => :'airbnbListingId',
|
|
47
|
+
:'locale' => :'locale',
|
|
48
|
+
:'written' => :'written',
|
|
49
|
+
:'blocked_fields' => :'blockedFields',
|
|
50
|
+
:'message' => :'message',
|
|
51
|
+
:'fix' => :'fix',
|
|
52
|
+
:'result' => :'result'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Returns attribute mapping this model knows about
|
|
57
|
+
def self.acceptable_attribute_map
|
|
58
|
+
attribute_map
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns all the JSON keys this model knows about
|
|
62
|
+
def self.acceptable_attributes
|
|
63
|
+
acceptable_attribute_map.values
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Attribute type mapping.
|
|
67
|
+
def self.openapi_types
|
|
68
|
+
{
|
|
69
|
+
:'listing_id' => :'String',
|
|
70
|
+
:'airbnb_listing_id' => :'String',
|
|
71
|
+
:'locale' => :'String',
|
|
72
|
+
:'written' => :'Array<String>',
|
|
73
|
+
:'blocked_fields' => :'Array<String>',
|
|
74
|
+
:'message' => :'String',
|
|
75
|
+
:'fix' => :'String',
|
|
76
|
+
:'result' => :'Hash<String, Object>'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List of attributes with nullable: true
|
|
81
|
+
def self.openapi_nullable
|
|
82
|
+
Set.new([
|
|
83
|
+
])
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Initializes the object
|
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
88
|
+
def initialize(attributes = {})
|
|
89
|
+
if (!attributes.is_a?(Hash))
|
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbContentWriteResponse` initialize method"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
94
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
96
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbContentWriteResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
98
|
+
end
|
|
99
|
+
h[k.to_sym] = v
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'listing_id')
|
|
103
|
+
self.listing_id = attributes[:'listing_id']
|
|
104
|
+
else
|
|
105
|
+
self.listing_id = nil
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'airbnb_listing_id')
|
|
109
|
+
self.airbnb_listing_id = attributes[:'airbnb_listing_id']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'locale')
|
|
113
|
+
self.locale = attributes[:'locale']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'written')
|
|
117
|
+
if (value = attributes[:'written']).is_a?(Array)
|
|
118
|
+
self.written = value
|
|
119
|
+
end
|
|
120
|
+
else
|
|
121
|
+
self.written = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'blocked_fields')
|
|
125
|
+
if (value = attributes[:'blocked_fields']).is_a?(Array)
|
|
126
|
+
self.blocked_fields = value
|
|
127
|
+
end
|
|
128
|
+
else
|
|
129
|
+
self.blocked_fields = nil
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'message')
|
|
133
|
+
self.message = attributes[:'message']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'fix')
|
|
137
|
+
self.fix = attributes[:'fix']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'result')
|
|
141
|
+
if (value = attributes[:'result']).is_a?(Hash)
|
|
142
|
+
self.result = value
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
148
|
+
# @return Array for valid properties with the reasons
|
|
149
|
+
def list_invalid_properties
|
|
150
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
151
|
+
invalid_properties = Array.new
|
|
152
|
+
if @listing_id.nil?
|
|
153
|
+
invalid_properties.push('invalid value for "listing_id", listing_id cannot be nil.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if @written.nil?
|
|
157
|
+
invalid_properties.push('invalid value for "written", written cannot be nil.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @blocked_fields.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "blocked_fields", blocked_fields cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
invalid_properties
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Check to see if the all the properties in the model are valid
|
|
168
|
+
# @return true if the model is valid
|
|
169
|
+
def valid?
|
|
170
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
171
|
+
return false if @listing_id.nil?
|
|
172
|
+
return false if @written.nil?
|
|
173
|
+
return false if @blocked_fields.nil?
|
|
174
|
+
true
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Custom attribute writer method with validation
|
|
178
|
+
# @param [Object] listing_id Value to be assigned
|
|
179
|
+
def listing_id=(listing_id)
|
|
180
|
+
if listing_id.nil?
|
|
181
|
+
fail ArgumentError, 'listing_id cannot be nil'
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
@listing_id = listing_id
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Custom attribute writer method with validation
|
|
188
|
+
# @param [Object] written Value to be assigned
|
|
189
|
+
def written=(written)
|
|
190
|
+
if written.nil?
|
|
191
|
+
fail ArgumentError, 'written cannot be nil'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
@written = written
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] blocked_fields Value to be assigned
|
|
199
|
+
def blocked_fields=(blocked_fields)
|
|
200
|
+
if blocked_fields.nil?
|
|
201
|
+
fail ArgumentError, 'blocked_fields cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
@blocked_fields = blocked_fields
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Checks equality by comparing each attribute.
|
|
208
|
+
# @param [Object] Object to be compared
|
|
209
|
+
def ==(o)
|
|
210
|
+
return true if self.equal?(o)
|
|
211
|
+
self.class == o.class &&
|
|
212
|
+
listing_id == o.listing_id &&
|
|
213
|
+
airbnb_listing_id == o.airbnb_listing_id &&
|
|
214
|
+
locale == o.locale &&
|
|
215
|
+
written == o.written &&
|
|
216
|
+
blocked_fields == o.blocked_fields &&
|
|
217
|
+
message == o.message &&
|
|
218
|
+
fix == o.fix &&
|
|
219
|
+
result == o.result
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# @see the `==` method
|
|
223
|
+
# @param [Object] Object to be compared
|
|
224
|
+
def eql?(o)
|
|
225
|
+
self == o
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Calculates hash code according to all attributes.
|
|
229
|
+
# @return [Integer] Hash code
|
|
230
|
+
def hash
|
|
231
|
+
[listing_id, airbnb_listing_id, locale, written, blocked_fields, message, fix, result].hash
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Builds the object from hash
|
|
235
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
236
|
+
# @return [Object] Returns the model itself
|
|
237
|
+
def self.build_from_hash(attributes)
|
|
238
|
+
return nil unless attributes.is_a?(Hash)
|
|
239
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
240
|
+
transformed_hash = {}
|
|
241
|
+
openapi_types.each_pair do |key, type|
|
|
242
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
243
|
+
transformed_hash["#{key}"] = nil
|
|
244
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
245
|
+
# check to ensure the input is an array given that the attribute
|
|
246
|
+
# is documented as an array but the input is not
|
|
247
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
248
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
249
|
+
end
|
|
250
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
251
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
new(transformed_hash)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Returns the object in the form of hash
|
|
258
|
+
# @return [Hash] Returns the object in the form of hash
|
|
259
|
+
def to_hash
|
|
260
|
+
hash = {}
|
|
261
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
262
|
+
value = self.send(attr)
|
|
263
|
+
if value.nil?
|
|
264
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
265
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
hash[param] = _to_hash(value)
|
|
269
|
+
end
|
|
270
|
+
hash
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
end
|
|
@@ -14,27 +14,31 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
# Top-level freshness indicator for any DB-backed Airbnb read. Tells consumers WHY a column may be `null` or stale without sprinkling per-row error envelopes through the response. The endpoint always returns 200 + DB data; this field is the single signal for \"should I prompt the user to reconnect / wait for sync?\".
|
|
17
|
+
# Top-level freshness indicator for any DB-backed Airbnb read. Tells consumers WHY a column may be `null` or stale without sprinkling per-row error envelopes through the response. The endpoint always returns 200 + DB data; this field is the single signal for \"should I prompt the user to reconnect / wait for sync?\". A workspace can connect several Airbnb accounts, so the answer has two levels. `accounts[]` carries the verdict per account; the top-level fields aggregate it. Scope a request with `?account_id=` and `accounts[]` holds exactly that account, with the top-level fields mirroring it.
|
|
18
18
|
class AirbnbDataFreshness < ApiModelBase
|
|
19
|
-
#
|
|
19
|
+
# The most recent Airbnb import COMPLETED by any account in scope. `null` when none of them ever has. A run that failed or was rate-limited does not move it.
|
|
20
20
|
attr_accessor :last_synced_at
|
|
21
21
|
|
|
22
|
-
# `true` when
|
|
22
|
+
# `true` only when EVERY connected Airbnb account is stale — nothing in this response can be trusted to be current. With one account (the common case) that is the same as it has always been. With several, one disconnected host no longer condemns the other's rows: `stale` stays `false` and `reason` becomes `partial_account_staleness`. Read `accounts[]` for which is which.
|
|
23
23
|
attr_accessor :stale
|
|
24
24
|
|
|
25
|
-
# Why the data is stale. One of `host_disconnected_since_<iso>`, `sync_lag_>_24h`, `never_synced`.
|
|
25
|
+
# Why the data is stale. One of `host_disconnected_since_<iso>`, `host_not_activated`, `sync_lag_>_24h`, `never_synced`, `host_disconnected`, or `partial_account_staleness`. The last one appears WITH `stale: false`: the response is usable, but at least one connected account needs attention — deliberately surfaced so a consumer reading only the aggregate is never told everything is fine while an account is down.
|
|
26
26
|
attr_accessor :reason
|
|
27
27
|
|
|
28
|
-
# Dashboard URL the consumer can open to resolve the staleness (
|
|
28
|
+
# Dashboard URL the consumer can open to resolve the staleness (the Airbnb connections screen). Present whenever `reason` is, including on `partial_account_staleness`.
|
|
29
29
|
attr_accessor :fix_url
|
|
30
30
|
|
|
31
|
+
# Per-account freshness, sorted by `accountId`. Omitted on responses that have no connected account to attribute (e.g. a workspace that has never connected Airbnb).
|
|
32
|
+
attr_accessor :accounts
|
|
33
|
+
|
|
31
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
35
|
def self.attribute_map
|
|
33
36
|
{
|
|
34
37
|
:'last_synced_at' => :'lastSyncedAt',
|
|
35
38
|
:'stale' => :'stale',
|
|
36
39
|
:'reason' => :'reason',
|
|
37
|
-
:'fix_url' => :'fixUrl'
|
|
40
|
+
:'fix_url' => :'fixUrl',
|
|
41
|
+
:'accounts' => :'accounts'
|
|
38
42
|
}
|
|
39
43
|
end
|
|
40
44
|
|
|
@@ -54,7 +58,8 @@ module Repull
|
|
|
54
58
|
:'last_synced_at' => :'Time',
|
|
55
59
|
:'stale' => :'Boolean',
|
|
56
60
|
:'reason' => :'String',
|
|
57
|
-
:'fix_url' => :'String'
|
|
61
|
+
:'fix_url' => :'String',
|
|
62
|
+
:'accounts' => :'Array<AirbnbAccountFreshness>'
|
|
58
63
|
}
|
|
59
64
|
end
|
|
60
65
|
|
|
@@ -63,7 +68,7 @@ module Repull
|
|
|
63
68
|
Set.new([
|
|
64
69
|
:'last_synced_at',
|
|
65
70
|
:'reason',
|
|
66
|
-
:'fix_url'
|
|
71
|
+
:'fix_url',
|
|
67
72
|
])
|
|
68
73
|
end
|
|
69
74
|
|
|
@@ -102,6 +107,12 @@ module Repull
|
|
|
102
107
|
if attributes.key?(:'fix_url')
|
|
103
108
|
self.fix_url = attributes[:'fix_url']
|
|
104
109
|
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'accounts')
|
|
112
|
+
if (value = attributes[:'accounts']).is_a?(Array)
|
|
113
|
+
self.accounts = value
|
|
114
|
+
end
|
|
115
|
+
end
|
|
105
116
|
end
|
|
106
117
|
|
|
107
118
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -142,7 +153,8 @@ module Repull
|
|
|
142
153
|
last_synced_at == o.last_synced_at &&
|
|
143
154
|
stale == o.stale &&
|
|
144
155
|
reason == o.reason &&
|
|
145
|
-
fix_url == o.fix_url
|
|
156
|
+
fix_url == o.fix_url &&
|
|
157
|
+
accounts == o.accounts
|
|
146
158
|
end
|
|
147
159
|
|
|
148
160
|
# @see the `==` method
|
|
@@ -154,7 +166,7 @@ module Repull
|
|
|
154
166
|
# Calculates hash code according to all attributes.
|
|
155
167
|
# @return [Integer] Hash code
|
|
156
168
|
def hash
|
|
157
|
-
[last_synced_at, stale, reason, fix_url].hash
|
|
169
|
+
[last_synced_at, stale, reason, fix_url, accounts].hash
|
|
158
170
|
end
|
|
159
171
|
|
|
160
172
|
# Builds the object from hash
|
data/lib/repull/models/{create_airbnb_alteration_request.rb → airbnb_description_write_request.rb}
RENAMED
|
@@ -14,26 +14,18 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
# Write one locale's copy. Airbnb keeps a separate description per locale, which is why the locale is explicit: writing Italian copy into the English row is how a translation gets lost. Only the fields you send are written.
|
|
18
|
+
class AirbnbDescriptionWriteRequest < ApiModelBase
|
|
19
|
+
# Language tag — `en`, `it`, `pt-BR`. `GET /v1/channels/airbnb/listings/{id}/settings?type=locales` lists the locales already synced for this listing.
|
|
20
|
+
attr_accessor :locale
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
attr_accessor :check_in
|
|
23
|
-
|
|
24
|
-
# New check-out date (YYYY-MM-DD).
|
|
25
|
-
attr_accessor :check_out
|
|
26
|
-
|
|
27
|
-
# New guest count.
|
|
28
|
-
attr_accessor :number_of_guests
|
|
22
|
+
attr_accessor :description
|
|
29
23
|
|
|
30
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
25
|
def self.attribute_map
|
|
32
26
|
{
|
|
33
|
-
:'
|
|
34
|
-
:'
|
|
35
|
-
:'check_out' => :'check_out',
|
|
36
|
-
:'number_of_guests' => :'number_of_guests'
|
|
27
|
+
:'locale' => :'locale',
|
|
28
|
+
:'description' => :'description'
|
|
37
29
|
}
|
|
38
30
|
end
|
|
39
31
|
|
|
@@ -50,10 +42,8 @@ module Repull
|
|
|
50
42
|
# Attribute type mapping.
|
|
51
43
|
def self.openapi_types
|
|
52
44
|
{
|
|
53
|
-
:'
|
|
54
|
-
:'
|
|
55
|
-
:'check_out' => :'Date',
|
|
56
|
-
:'number_of_guests' => :'Integer'
|
|
45
|
+
:'locale' => :'String',
|
|
46
|
+
:'description' => :'AirbnbDescriptionWriteRequestDescription'
|
|
57
47
|
}
|
|
58
48
|
end
|
|
59
49
|
|
|
@@ -67,34 +57,28 @@ module Repull
|
|
|
67
57
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
58
|
def initialize(attributes = {})
|
|
69
59
|
if (!attributes.is_a?(Hash))
|
|
70
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbDescriptionWriteRequest` initialize method"
|
|
71
61
|
end
|
|
72
62
|
|
|
73
63
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
64
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
65
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
66
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbDescriptionWriteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
68
|
end
|
|
79
69
|
h[k.to_sym] = v
|
|
80
70
|
}
|
|
81
71
|
|
|
82
|
-
if attributes.key?(:'
|
|
83
|
-
self.
|
|
72
|
+
if attributes.key?(:'locale')
|
|
73
|
+
self.locale = attributes[:'locale']
|
|
84
74
|
else
|
|
85
|
-
self.
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
if attributes.key?(:'check_in')
|
|
89
|
-
self.check_in = attributes[:'check_in']
|
|
75
|
+
self.locale = nil
|
|
90
76
|
end
|
|
91
77
|
|
|
92
|
-
if attributes.key?(:'
|
|
93
|
-
self.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if attributes.key?(:'number_of_guests')
|
|
97
|
-
self.number_of_guests = attributes[:'number_of_guests']
|
|
78
|
+
if attributes.key?(:'description')
|
|
79
|
+
self.description = attributes[:'description']
|
|
80
|
+
else
|
|
81
|
+
self.description = nil
|
|
98
82
|
end
|
|
99
83
|
end
|
|
100
84
|
|
|
@@ -103,8 +87,12 @@ module Repull
|
|
|
103
87
|
def list_invalid_properties
|
|
104
88
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
105
89
|
invalid_properties = Array.new
|
|
106
|
-
if @
|
|
107
|
-
invalid_properties.push('invalid value for "
|
|
90
|
+
if @locale.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "locale", locale cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if @description.nil?
|
|
95
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
|
108
96
|
end
|
|
109
97
|
|
|
110
98
|
invalid_properties
|
|
@@ -114,18 +102,29 @@ module Repull
|
|
|
114
102
|
# @return true if the model is valid
|
|
115
103
|
def valid?
|
|
116
104
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
117
|
-
return false if @
|
|
105
|
+
return false if @locale.nil?
|
|
106
|
+
return false if @description.nil?
|
|
118
107
|
true
|
|
119
108
|
end
|
|
120
109
|
|
|
121
110
|
# Custom attribute writer method with validation
|
|
122
|
-
# @param [Object]
|
|
123
|
-
def
|
|
124
|
-
if
|
|
125
|
-
fail ArgumentError, '
|
|
111
|
+
# @param [Object] locale Value to be assigned
|
|
112
|
+
def locale=(locale)
|
|
113
|
+
if locale.nil?
|
|
114
|
+
fail ArgumentError, 'locale cannot be nil'
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
@locale = locale
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] description Value to be assigned
|
|
122
|
+
def description=(description)
|
|
123
|
+
if description.nil?
|
|
124
|
+
fail ArgumentError, 'description cannot be nil'
|
|
126
125
|
end
|
|
127
126
|
|
|
128
|
-
@
|
|
127
|
+
@description = description
|
|
129
128
|
end
|
|
130
129
|
|
|
131
130
|
# Checks equality by comparing each attribute.
|
|
@@ -133,10 +132,8 @@ module Repull
|
|
|
133
132
|
def ==(o)
|
|
134
133
|
return true if self.equal?(o)
|
|
135
134
|
self.class == o.class &&
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
check_out == o.check_out &&
|
|
139
|
-
number_of_guests == o.number_of_guests
|
|
135
|
+
locale == o.locale &&
|
|
136
|
+
description == o.description
|
|
140
137
|
end
|
|
141
138
|
|
|
142
139
|
# @see the `==` method
|
|
@@ -148,7 +145,7 @@ module Repull
|
|
|
148
145
|
# Calculates hash code according to all attributes.
|
|
149
146
|
# @return [Integer] Hash code
|
|
150
147
|
def hash
|
|
151
|
-
[
|
|
148
|
+
[locale, description].hash
|
|
152
149
|
end
|
|
153
150
|
|
|
154
151
|
# Builds the object from hash
|