repull 0.2.17 → 0.2.18
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 +4 -4
- data/lib/repull/api/health_api.rb +0 -57
- data/lib/repull/api/migrate_api.rb +552 -0
- data/lib/repull/api/reservations_api.rb +2 -2
- data/lib/repull/models/airbnb_permits_response.rb +1 -1
- data/lib/repull/models/airbnb_permits_write_request.rb +1 -1
- data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +43 -4
- data/lib/repull/models/{airbnb_permits_write_request_permits_inner_answers_inner.rb → airbnb_permits_write_request_permits_inner_answers_value.rb} +22 -34
- data/lib/repull/models/check_migration_cutover200_response.rb +147 -0
- data/lib/repull/models/check_migration_cutover_request.rb +175 -0
- data/lib/repull/models/check_migration_cutover_request_reservations_inner.rb +216 -0
- data/lib/repull/models/connect_provider.rb +18 -5
- data/lib/repull/models/connect_session.rb +25 -5
- data/lib/repull/models/create_connect_session_request.rb +81 -5
- data/lib/repull/models/create_connect_session_request_copy.rb +251 -0
- data/lib/repull/models/create_connect_session_request_workspace.rb +196 -0
- data/lib/repull/models/delete_migration200_response.rb +147 -0
- data/lib/repull/models/delete_migration200_response_data.rb +165 -0
- data/lib/repull/models/get_migration200_response.rb +147 -0
- data/lib/repull/models/get_migration_channel_map200_response.rb +147 -0
- data/lib/repull/models/get_migration_report200_response.rb +147 -0
- data/lib/repull/models/list_migrations200_response.rb +158 -0
- data/lib/repull/models/listing_content_update_request.rb +10 -1
- data/lib/repull/models/listing_content_update_request_pricing.rb +235 -0
- data/lib/repull/models/listing_content_update_response.rb +1 -1
- data/lib/repull/models/listing_create_request.rb +24 -1
- data/lib/repull/models/listing_create_response.rb +14 -4
- data/lib/repull/models/migration.rb +303 -0
- data/lib/repull/models/migration_channel_map.rb +169 -0
- data/lib/repull/models/migration_channel_map_listings_inner.rb +208 -0
- data/lib/repull/models/migration_channel_map_listings_inner_airbnb.rb +156 -0
- data/lib/repull/models/migration_channel_map_listings_inner_booking.rb +156 -0
- data/lib/repull/models/migration_channel_map_sources_inner.rb +167 -0
- data/lib/repull/models/migration_completed_event.rb +309 -0
- data/lib/repull/models/migration_connections_inner.rb +195 -0
- data/lib/repull/models/migration_counts.rb +183 -0
- data/lib/repull/models/migration_cutover_check.rb +200 -0
- data/lib/repull/models/migration_cutover_check_mismatched_inner.rb +156 -0
- data/lib/repull/models/migration_failed_event.rb +309 -0
- data/lib/repull/models/migration_import_payload.rb +225 -0
- data/lib/repull/models/migration_import_payload_results_inner.rb +165 -0
- data/lib/repull/models/migration_import_run.rb +202 -0
- data/lib/repull/models/migration_import_run_results_inner.rb +165 -0
- data/lib/repull/models/migration_report.rb +179 -0
- data/lib/repull/models/migration_report_issues_inner.rb +229 -0
- data/lib/repull/models/migration_reservation_ref.rb +184 -0
- data/lib/repull/models/reservation.rb +12 -2
- data/lib/repull/models/run_migration_import202_response.rb +147 -0
- data/lib/repull/models/run_migration_import202_response_data.rb +158 -0
- data/lib/repull/models/run_migration_import202_response_data_queued_inner.rb +174 -0
- data/lib/repull/models/run_migration_import_request.rb +182 -0
- data/lib/repull/models/webhook_event.rb +4 -0
- data/lib/repull/models/webhook_event_type.rb +3 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +37 -1
- data/openapi/v1.json +3426 -2244
- metadata +39 -3
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
class ListMigrations200Response < ApiModelBase
|
|
18
|
+
attr_accessor :data
|
|
19
|
+
|
|
20
|
+
attr_accessor :pagination
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'data' => :'data',
|
|
26
|
+
:'pagination' => :'pagination'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'data' => :'Array<Migration>',
|
|
44
|
+
:'pagination' => :'GetUsageLogs200ResponsePagination'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListMigrations200Response` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListMigrations200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'data')
|
|
71
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
72
|
+
self.data = value
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'pagination')
|
|
77
|
+
self.pagination = attributes[:'pagination']
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
82
|
+
# @return Array for valid properties with the reasons
|
|
83
|
+
def list_invalid_properties
|
|
84
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
85
|
+
invalid_properties = Array.new
|
|
86
|
+
invalid_properties
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Check to see if the all the properties in the model are valid
|
|
90
|
+
# @return true if the model is valid
|
|
91
|
+
def valid?
|
|
92
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
|
+
true
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Checks equality by comparing each attribute.
|
|
97
|
+
# @param [Object] Object to be compared
|
|
98
|
+
def ==(o)
|
|
99
|
+
return true if self.equal?(o)
|
|
100
|
+
self.class == o.class &&
|
|
101
|
+
data == o.data &&
|
|
102
|
+
pagination == o.pagination
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @see the `==` method
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def eql?(o)
|
|
108
|
+
self == o
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Calculates hash code according to all attributes.
|
|
112
|
+
# @return [Integer] Hash code
|
|
113
|
+
def hash
|
|
114
|
+
[data, pagination].hash
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Builds the object from hash
|
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
119
|
+
# @return [Object] Returns the model itself
|
|
120
|
+
def self.build_from_hash(attributes)
|
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
|
122
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
123
|
+
transformed_hash = {}
|
|
124
|
+
openapi_types.each_pair do |key, type|
|
|
125
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
126
|
+
transformed_hash["#{key}"] = nil
|
|
127
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
128
|
+
# check to ensure the input is an array given that the attribute
|
|
129
|
+
# is documented as an array but the input is not
|
|
130
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
131
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
132
|
+
end
|
|
133
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
new(transformed_hash)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Returns the object in the form of hash
|
|
141
|
+
# @return [Hash] Returns the object in the form of hash
|
|
142
|
+
def to_hash
|
|
143
|
+
hash = {}
|
|
144
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
145
|
+
value = self.send(attr)
|
|
146
|
+
if value.nil?
|
|
147
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
148
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
hash[param] = _to_hash(value)
|
|
152
|
+
end
|
|
153
|
+
hash
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
end
|
|
@@ -39,6 +39,8 @@ module Repull
|
|
|
39
39
|
|
|
40
40
|
attr_accessor :occupancy
|
|
41
41
|
|
|
42
|
+
attr_accessor :pricing
|
|
43
|
+
|
|
42
44
|
attr_accessor :policies
|
|
43
45
|
|
|
44
46
|
# Photo set — full replacement by default (pass `photosMode: \"append\"` to add after existing photos, or `[]` to clear; omit to leave untouched). Each entry is a hosted image URL (string) or a structured ref. URL-ingest only: the URL is persisted and attached to the listing in order — the OTA push downloads it at publish time. Binary/multipart upload is a follow-up. A non-empty array with no valid http(s) URL is reported in `deferred` (existing photos left untouched).
|
|
@@ -59,6 +61,7 @@ module Repull
|
|
|
59
61
|
:'address' => :'address',
|
|
60
62
|
:'details' => :'details',
|
|
61
63
|
:'occupancy' => :'occupancy',
|
|
64
|
+
:'pricing' => :'pricing',
|
|
62
65
|
:'policies' => :'policies',
|
|
63
66
|
:'photos' => :'photos',
|
|
64
67
|
:'photos_mode' => :'photosMode'
|
|
@@ -87,6 +90,7 @@ module Repull
|
|
|
87
90
|
:'address' => :'ListingContentUpdateRequestAddress',
|
|
88
91
|
:'details' => :'ListingContentUpdateRequestDetails',
|
|
89
92
|
:'occupancy' => :'ListingContentUpdateRequestOccupancy',
|
|
93
|
+
:'pricing' => :'ListingContentUpdateRequestPricing',
|
|
90
94
|
:'policies' => :'ListingContentUpdateRequestPolicies',
|
|
91
95
|
:'photos' => :'Array<ListingContentUpdateRequestPhotosInner>',
|
|
92
96
|
:'photos_mode' => :'String'
|
|
@@ -155,6 +159,10 @@ module Repull
|
|
|
155
159
|
self.occupancy = attributes[:'occupancy']
|
|
156
160
|
end
|
|
157
161
|
|
|
162
|
+
if attributes.key?(:'pricing')
|
|
163
|
+
self.pricing = attributes[:'pricing']
|
|
164
|
+
end
|
|
165
|
+
|
|
158
166
|
if attributes.key?(:'policies')
|
|
159
167
|
self.policies = attributes[:'policies']
|
|
160
168
|
end
|
|
@@ -201,6 +209,7 @@ module Repull
|
|
|
201
209
|
address == o.address &&
|
|
202
210
|
details == o.details &&
|
|
203
211
|
occupancy == o.occupancy &&
|
|
212
|
+
pricing == o.pricing &&
|
|
204
213
|
policies == o.policies &&
|
|
205
214
|
photos == o.photos &&
|
|
206
215
|
photos_mode == o.photos_mode
|
|
@@ -215,7 +224,7 @@ module Repull
|
|
|
215
224
|
# Calculates hash code according to all attributes.
|
|
216
225
|
# @return [Integer] Hash code
|
|
217
226
|
def hash
|
|
218
|
-
[locale, title, name, description, summary, amenities, address, details, occupancy, policies, photos, photos_mode].hash
|
|
227
|
+
[locale, title, name, description, summary, amenities, address, details, occupancy, pricing, policies, photos, photos_mode].hash
|
|
219
228
|
end
|
|
220
229
|
|
|
221
230
|
# Builds the object from hash
|
|
@@ -0,0 +1,235 @@
|
|
|
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
|
+
# The listing's standing rates. Partial like every other section: only the fields you send are written, and `null` clears one. Changing `defaultDailyPrice` or `weekendPrice` also moves the nights on the calendar that still carry the old rate and were written by us — a night you or a channel priced yourself is never touched, and neither is a blocked or reserved one. So a price change reaches the calendar without overwriting anyone's work. This is still a local write. Publish to send the new rates to a channel.
|
|
18
|
+
class ListingContentUpdateRequestPricing < ApiModelBase
|
|
19
|
+
# Nightly rate for every night that is not a weekend night.
|
|
20
|
+
attr_accessor :default_daily_price
|
|
21
|
+
|
|
22
|
+
# Nightly rate for Saturday and Sunday nights (UTC).
|
|
23
|
+
attr_accessor :weekend_price
|
|
24
|
+
|
|
25
|
+
attr_accessor :cleaning_fee
|
|
26
|
+
|
|
27
|
+
attr_accessor :price_per_extra_guest
|
|
28
|
+
|
|
29
|
+
attr_accessor :security_deposit
|
|
30
|
+
|
|
31
|
+
# Fraction, not a percentage: `0.1` is 10% off a stay of a week or more.
|
|
32
|
+
attr_accessor :weekly_discount
|
|
33
|
+
|
|
34
|
+
# Fraction, not a percentage.
|
|
35
|
+
attr_accessor :monthly_discount
|
|
36
|
+
|
|
37
|
+
# Guests covered by the nightly rate before `pricePerExtraGuest` applies.
|
|
38
|
+
attr_accessor :guests_included
|
|
39
|
+
|
|
40
|
+
# ISO 4217, e.g. `USD`.
|
|
41
|
+
attr_accessor :currency
|
|
42
|
+
|
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
|
+
def self.attribute_map
|
|
45
|
+
{
|
|
46
|
+
:'default_daily_price' => :'defaultDailyPrice',
|
|
47
|
+
:'weekend_price' => :'weekendPrice',
|
|
48
|
+
:'cleaning_fee' => :'cleaningFee',
|
|
49
|
+
:'price_per_extra_guest' => :'pricePerExtraGuest',
|
|
50
|
+
:'security_deposit' => :'securityDeposit',
|
|
51
|
+
:'weekly_discount' => :'weeklyDiscount',
|
|
52
|
+
:'monthly_discount' => :'monthlyDiscount',
|
|
53
|
+
:'guests_included' => :'guestsIncluded',
|
|
54
|
+
:'currency' => :'currency'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
|
64
|
+
def self.acceptable_attributes
|
|
65
|
+
acceptable_attribute_map.values
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.openapi_types
|
|
70
|
+
{
|
|
71
|
+
:'default_daily_price' => :'Float',
|
|
72
|
+
:'weekend_price' => :'Float',
|
|
73
|
+
:'cleaning_fee' => :'Float',
|
|
74
|
+
:'price_per_extra_guest' => :'Float',
|
|
75
|
+
:'security_deposit' => :'Float',
|
|
76
|
+
:'weekly_discount' => :'Float',
|
|
77
|
+
:'monthly_discount' => :'Float',
|
|
78
|
+
:'guests_included' => :'Integer',
|
|
79
|
+
:'currency' => :'String'
|
|
80
|
+
}
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# List of attributes with nullable: true
|
|
84
|
+
def self.openapi_nullable
|
|
85
|
+
Set.new([
|
|
86
|
+
:'default_daily_price',
|
|
87
|
+
:'weekend_price',
|
|
88
|
+
:'cleaning_fee',
|
|
89
|
+
:'price_per_extra_guest',
|
|
90
|
+
:'security_deposit',
|
|
91
|
+
:'weekly_discount',
|
|
92
|
+
:'monthly_discount',
|
|
93
|
+
:'guests_included',
|
|
94
|
+
:'currency'
|
|
95
|
+
])
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Initializes the object
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
def initialize(attributes = {})
|
|
101
|
+
if (!attributes.is_a?(Hash))
|
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingContentUpdateRequestPricing` initialize method"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
106
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingContentUpdateRequestPricing`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
110
|
+
end
|
|
111
|
+
h[k.to_sym] = v
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'default_daily_price')
|
|
115
|
+
self.default_daily_price = attributes[:'default_daily_price']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'weekend_price')
|
|
119
|
+
self.weekend_price = attributes[:'weekend_price']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'cleaning_fee')
|
|
123
|
+
self.cleaning_fee = attributes[:'cleaning_fee']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'price_per_extra_guest')
|
|
127
|
+
self.price_per_extra_guest = attributes[:'price_per_extra_guest']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'security_deposit')
|
|
131
|
+
self.security_deposit = attributes[:'security_deposit']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'weekly_discount')
|
|
135
|
+
self.weekly_discount = attributes[:'weekly_discount']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'monthly_discount')
|
|
139
|
+
self.monthly_discount = attributes[:'monthly_discount']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'guests_included')
|
|
143
|
+
self.guests_included = attributes[:'guests_included']
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'currency')
|
|
147
|
+
self.currency = attributes[:'currency']
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
152
|
+
# @return Array for valid properties with the reasons
|
|
153
|
+
def list_invalid_properties
|
|
154
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
155
|
+
invalid_properties = Array.new
|
|
156
|
+
invalid_properties
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Check to see if the all the properties in the model are valid
|
|
160
|
+
# @return true if the model is valid
|
|
161
|
+
def valid?
|
|
162
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
163
|
+
true
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Checks equality by comparing each attribute.
|
|
167
|
+
# @param [Object] Object to be compared
|
|
168
|
+
def ==(o)
|
|
169
|
+
return true if self.equal?(o)
|
|
170
|
+
self.class == o.class &&
|
|
171
|
+
default_daily_price == o.default_daily_price &&
|
|
172
|
+
weekend_price == o.weekend_price &&
|
|
173
|
+
cleaning_fee == o.cleaning_fee &&
|
|
174
|
+
price_per_extra_guest == o.price_per_extra_guest &&
|
|
175
|
+
security_deposit == o.security_deposit &&
|
|
176
|
+
weekly_discount == o.weekly_discount &&
|
|
177
|
+
monthly_discount == o.monthly_discount &&
|
|
178
|
+
guests_included == o.guests_included &&
|
|
179
|
+
currency == o.currency
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# @see the `==` method
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def eql?(o)
|
|
185
|
+
self == o
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Calculates hash code according to all attributes.
|
|
189
|
+
# @return [Integer] Hash code
|
|
190
|
+
def hash
|
|
191
|
+
[default_daily_price, weekend_price, cleaning_fee, price_per_extra_guest, security_deposit, weekly_discount, monthly_discount, guests_included, currency].hash
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Builds the object from hash
|
|
195
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
196
|
+
# @return [Object] Returns the model itself
|
|
197
|
+
def self.build_from_hash(attributes)
|
|
198
|
+
return nil unless attributes.is_a?(Hash)
|
|
199
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
200
|
+
transformed_hash = {}
|
|
201
|
+
openapi_types.each_pair do |key, type|
|
|
202
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
203
|
+
transformed_hash["#{key}"] = nil
|
|
204
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
205
|
+
# check to ensure the input is an array given that the attribute
|
|
206
|
+
# is documented as an array but the input is not
|
|
207
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
208
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
209
|
+
end
|
|
210
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
211
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
new(transformed_hash)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Returns the object in the form of hash
|
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
|
219
|
+
def to_hash
|
|
220
|
+
hash = {}
|
|
221
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
222
|
+
value = self.send(attr)
|
|
223
|
+
if value.nil?
|
|
224
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
225
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
hash[param] = _to_hash(value)
|
|
229
|
+
end
|
|
230
|
+
hash
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
end
|
|
@@ -18,7 +18,7 @@ module Repull
|
|
|
18
18
|
# The listing id (serialized as a string to preserve precision).
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
|
-
# Content slabs that were actually written, e.g. [\"title\",\"occupancy\",\"amenities\"]. A non-English write also reports `locale:<tag>` so you can see which row was written.
|
|
21
|
+
# Content slabs that were actually written, e.g. [\"title\",\"occupancy\",\"amenities\"]. A non-English write also reports `locale:<tag>` so you can see which row was written. A rate change reports `pricing`, and `calendar` as well when nights on the calendar moved to the new rate.
|
|
22
22
|
attr_accessor :changed
|
|
23
23
|
|
|
24
24
|
# Provided-but-not-applied fields — e.g. \"photos\" when a non-empty photos array carried no valid http(s) URL.
|
|
@@ -63,8 +63,15 @@ module Repull
|
|
|
63
63
|
|
|
64
64
|
attr_accessor :description
|
|
65
65
|
|
|
66
|
+
# Nightly rate for every night that is not a weekend night. Stating it is what gives the new listing a calendar: 365 nights are written from it, and that calendar is what a publish sends to the channel. Without a price the listing has no availability to publish, which Booking.com refuses with \"No availability pushed\".
|
|
66
67
|
attr_accessor :default_daily_price
|
|
67
68
|
|
|
69
|
+
# Nightly rate for Saturday and Sunday nights (UTC). Omit it and those nights take `defaultDailyPrice`. It is the same rate the direct-booking quoter charges for a weekend night, so the calendar and a quote cannot disagree.
|
|
70
|
+
attr_accessor :weekend_price
|
|
71
|
+
|
|
72
|
+
# Charged per guest above the number included in the nightly rate.
|
|
73
|
+
attr_accessor :price_per_extra_guest
|
|
74
|
+
|
|
68
75
|
attr_accessor :cleaning_fee
|
|
69
76
|
|
|
70
77
|
attr_accessor :cancellation_policy
|
|
@@ -103,6 +110,8 @@ module Repull
|
|
|
103
110
|
:'summary' => :'summary',
|
|
104
111
|
:'description' => :'description',
|
|
105
112
|
:'default_daily_price' => :'defaultDailyPrice',
|
|
113
|
+
:'weekend_price' => :'weekendPrice',
|
|
114
|
+
:'price_per_extra_guest' => :'pricePerExtraGuest',
|
|
106
115
|
:'cleaning_fee' => :'cleaningFee',
|
|
107
116
|
:'cancellation_policy' => :'cancellationPolicy',
|
|
108
117
|
:'check_in_time_start' => :'checkInTimeStart',
|
|
@@ -146,6 +155,8 @@ module Repull
|
|
|
146
155
|
:'summary' => :'String',
|
|
147
156
|
:'description' => :'String',
|
|
148
157
|
:'default_daily_price' => :'Float',
|
|
158
|
+
:'weekend_price' => :'Float',
|
|
159
|
+
:'price_per_extra_guest' => :'Float',
|
|
149
160
|
:'cleaning_fee' => :'Float',
|
|
150
161
|
:'cancellation_policy' => :'String',
|
|
151
162
|
:'check_in_time_start' => :'String',
|
|
@@ -160,6 +171,8 @@ module Repull
|
|
|
160
171
|
# List of attributes with nullable: true
|
|
161
172
|
def self.openapi_nullable
|
|
162
173
|
Set.new([
|
|
174
|
+
:'weekend_price',
|
|
175
|
+
:'price_per_extra_guest',
|
|
163
176
|
])
|
|
164
177
|
end
|
|
165
178
|
|
|
@@ -257,6 +270,14 @@ module Repull
|
|
|
257
270
|
self.default_daily_price = attributes[:'default_daily_price']
|
|
258
271
|
end
|
|
259
272
|
|
|
273
|
+
if attributes.key?(:'weekend_price')
|
|
274
|
+
self.weekend_price = attributes[:'weekend_price']
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if attributes.key?(:'price_per_extra_guest')
|
|
278
|
+
self.price_per_extra_guest = attributes[:'price_per_extra_guest']
|
|
279
|
+
end
|
|
280
|
+
|
|
260
281
|
if attributes.key?(:'cleaning_fee')
|
|
261
282
|
self.cleaning_fee = attributes[:'cleaning_fee']
|
|
262
283
|
end
|
|
@@ -344,6 +365,8 @@ module Repull
|
|
|
344
365
|
summary == o.summary &&
|
|
345
366
|
description == o.description &&
|
|
346
367
|
default_daily_price == o.default_daily_price &&
|
|
368
|
+
weekend_price == o.weekend_price &&
|
|
369
|
+
price_per_extra_guest == o.price_per_extra_guest &&
|
|
347
370
|
cleaning_fee == o.cleaning_fee &&
|
|
348
371
|
cancellation_policy == o.cancellation_policy &&
|
|
349
372
|
check_in_time_start == o.check_in_time_start &&
|
|
@@ -363,7 +386,7 @@ module Repull
|
|
|
363
386
|
# Calculates hash code according to all attributes.
|
|
364
387
|
# @return [Integer] Hash code
|
|
365
388
|
def hash
|
|
366
|
-
[name, property_type, room_type_category, property_type_category, street, city, state, postal_code, zipcode, country_code, lat, lng, bedrooms, bathrooms, beds, person_capacity, summary, description, default_daily_price, cleaning_fee, cancellation_policy, check_in_time_start, check_out_time, allows_pets, allows_smoking, allows_children, allows_events].hash
|
|
389
|
+
[name, property_type, room_type_category, property_type_category, street, city, state, postal_code, zipcode, country_code, lat, lng, bedrooms, bathrooms, beds, person_capacity, summary, description, default_daily_price, weekend_price, price_per_extra_guest, cleaning_fee, cancellation_policy, check_in_time_start, check_out_time, allows_pets, allows_smoking, allows_children, allows_events].hash
|
|
367
390
|
end
|
|
368
391
|
|
|
369
392
|
# Builds the object from hash
|
|
@@ -18,10 +18,14 @@ module Repull
|
|
|
18
18
|
# New listing ID — use for follow-up generate-content / publish calls
|
|
19
19
|
attr_accessor :id
|
|
20
20
|
|
|
21
|
+
# Nights of calendar written from the price you stated. `0` means the listing has no calendar and a publish will send no availability — state `defaultDailyPrice` on the create, or set it later with `PUT /v1/listings/{id}/content` under `pricing`.
|
|
22
|
+
attr_accessor :calendar_days_seeded
|
|
23
|
+
|
|
21
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
25
|
def self.attribute_map
|
|
23
26
|
{
|
|
24
|
-
:'id' => :'id'
|
|
27
|
+
:'id' => :'id',
|
|
28
|
+
:'calendar_days_seeded' => :'calendarDaysSeeded'
|
|
25
29
|
}
|
|
26
30
|
end
|
|
27
31
|
|
|
@@ -38,7 +42,8 @@ module Repull
|
|
|
38
42
|
# Attribute type mapping.
|
|
39
43
|
def self.openapi_types
|
|
40
44
|
{
|
|
41
|
-
:'id' => :'String'
|
|
45
|
+
:'id' => :'String',
|
|
46
|
+
:'calendar_days_seeded' => :'Integer'
|
|
42
47
|
}
|
|
43
48
|
end
|
|
44
49
|
|
|
@@ -67,6 +72,10 @@ module Repull
|
|
|
67
72
|
if attributes.key?(:'id')
|
|
68
73
|
self.id = attributes[:'id']
|
|
69
74
|
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'calendar_days_seeded')
|
|
77
|
+
self.calendar_days_seeded = attributes[:'calendar_days_seeded']
|
|
78
|
+
end
|
|
70
79
|
end
|
|
71
80
|
|
|
72
81
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -89,7 +98,8 @@ module Repull
|
|
|
89
98
|
def ==(o)
|
|
90
99
|
return true if self.equal?(o)
|
|
91
100
|
self.class == o.class &&
|
|
92
|
-
id == o.id
|
|
101
|
+
id == o.id &&
|
|
102
|
+
calendar_days_seeded == o.calendar_days_seeded
|
|
93
103
|
end
|
|
94
104
|
|
|
95
105
|
# @see the `==` method
|
|
@@ -101,7 +111,7 @@ module Repull
|
|
|
101
111
|
# Calculates hash code according to all attributes.
|
|
102
112
|
# @return [Integer] Hash code
|
|
103
113
|
def hash
|
|
104
|
-
[id].hash
|
|
114
|
+
[id, calendar_days_seeded].hash
|
|
105
115
|
end
|
|
106
116
|
|
|
107
117
|
# Builds the object from hash
|