repull 0.2.60 → 0.2.61
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 +8 -8
- data/lib/repull/api/connect_api.rb +5 -5
- data/lib/repull/api/connections_api.rb +4 -4
- data/lib/repull/models/account_import.rb +1 -1
- data/lib/repull/models/airbnb_reservation.rb +346 -6
- data/lib/repull/models/airbnb_reservation_detail.rb +679 -0
- data/lib/repull/models/airbnb_reservation_detail_response.rb +173 -0
- data/lib/repull/models/connect_provider_session.rb +266 -0
- data/lib/repull/models/create_connect_session_request.rb +2 -2
- data/lib/repull/models/create_connection_request.rb +3 -2
- data/lib/repull/models/guest.rb +4 -2
- data/lib/repull/models/start_connection_import202_response_data.rb +32 -6
- data/lib/repull/models/start_connection_import_request.rb +3 -5
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +3 -0
- data/openapi/v1.json +483 -26
- metadata +4 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## 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`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
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 AirbnbReservationDetailResponse < ApiModelBase
|
|
18
|
+
attr_accessor :data
|
|
19
|
+
|
|
20
|
+
attr_accessor :data_freshness
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'data' => :'data',
|
|
26
|
+
:'data_freshness' => :'dataFreshness'
|
|
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' => :'AirbnbReservationDetail',
|
|
44
|
+
:'data_freshness' => :'AirbnbDataFreshness'
|
|
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::AirbnbReservationDetailResponse` 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::AirbnbReservationDetailResponse`. 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
|
+
self.data = attributes[:'data']
|
|
72
|
+
else
|
|
73
|
+
self.data = nil
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'data_freshness')
|
|
77
|
+
self.data_freshness = attributes[:'data_freshness']
|
|
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
|
+
if @data.nil?
|
|
87
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
invalid_properties
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Check to see if the all the properties in the model are valid
|
|
94
|
+
# @return true if the model is valid
|
|
95
|
+
def valid?
|
|
96
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
97
|
+
return false if @data.nil?
|
|
98
|
+
true
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Custom attribute writer method with validation
|
|
102
|
+
# @param [Object] data Value to be assigned
|
|
103
|
+
def data=(data)
|
|
104
|
+
if data.nil?
|
|
105
|
+
fail ArgumentError, 'data cannot be nil'
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
@data = data
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Checks equality by comparing each attribute.
|
|
112
|
+
# @param [Object] Object to be compared
|
|
113
|
+
def ==(o)
|
|
114
|
+
return true if self.equal?(o)
|
|
115
|
+
self.class == o.class &&
|
|
116
|
+
data == o.data &&
|
|
117
|
+
data_freshness == o.data_freshness
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# @see the `==` method
|
|
121
|
+
# @param [Object] Object to be compared
|
|
122
|
+
def eql?(o)
|
|
123
|
+
self == o
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Calculates hash code according to all attributes.
|
|
127
|
+
# @return [Integer] Hash code
|
|
128
|
+
def hash
|
|
129
|
+
[data, data_freshness].hash
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Builds the object from hash
|
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
134
|
+
# @return [Object] Returns the model itself
|
|
135
|
+
def self.build_from_hash(attributes)
|
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
|
137
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
138
|
+
transformed_hash = {}
|
|
139
|
+
openapi_types.each_pair do |key, type|
|
|
140
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = nil
|
|
142
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
143
|
+
# check to ensure the input is an array given that the attribute
|
|
144
|
+
# is documented as an array but the input is not
|
|
145
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
146
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
147
|
+
end
|
|
148
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
149
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
new(transformed_hash)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Returns the object in the form of hash
|
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
|
157
|
+
def to_hash
|
|
158
|
+
hash = {}
|
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
160
|
+
value = self.send(attr)
|
|
161
|
+
if value.nil?
|
|
162
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
163
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
hash[param] = _to_hash(value)
|
|
167
|
+
end
|
|
168
|
+
hash
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
end
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Repull API
|
|
3
|
+
|
|
4
|
+
#The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## 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`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
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
|
+
# A hosted Connect session for one provider (`POST /v1/connect/{provider}`). Send the user to `url`; every return to your `redirectUrl` carries `status`, `sessionId` and your `state`.
|
|
18
|
+
class ConnectProviderSession < ApiModelBase
|
|
19
|
+
# The hosted page to send the user to.
|
|
20
|
+
attr_accessor :url
|
|
21
|
+
|
|
22
|
+
attr_accessor :provider
|
|
23
|
+
|
|
24
|
+
# Also sent back on the redirect (`sessionId=`), in the popup message and in `connect.session.completed`.
|
|
25
|
+
attr_accessor :session_id
|
|
26
|
+
|
|
27
|
+
attr_accessor :expires_at
|
|
28
|
+
|
|
29
|
+
# Your `state` from the request, echoed; `null` when you sent none.
|
|
30
|
+
attr_accessor :state
|
|
31
|
+
|
|
32
|
+
# PriceLabs only, when the request opened a sub-workspace (`workspace.name`).
|
|
33
|
+
attr_accessor :workspace_id
|
|
34
|
+
|
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
36
|
+
def self.attribute_map
|
|
37
|
+
{
|
|
38
|
+
:'url' => :'url',
|
|
39
|
+
:'provider' => :'provider',
|
|
40
|
+
:'session_id' => :'sessionId',
|
|
41
|
+
:'expires_at' => :'expiresAt',
|
|
42
|
+
:'state' => :'state',
|
|
43
|
+
:'workspace_id' => :'workspaceId'
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns attribute mapping this model knows about
|
|
48
|
+
def self.acceptable_attribute_map
|
|
49
|
+
attribute_map
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
|
53
|
+
def self.acceptable_attributes
|
|
54
|
+
acceptable_attribute_map.values
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Attribute type mapping.
|
|
58
|
+
def self.openapi_types
|
|
59
|
+
{
|
|
60
|
+
:'url' => :'String',
|
|
61
|
+
:'provider' => :'String',
|
|
62
|
+
:'session_id' => :'String',
|
|
63
|
+
:'expires_at' => :'Time',
|
|
64
|
+
:'state' => :'String',
|
|
65
|
+
:'workspace_id' => :'String'
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# List of attributes with nullable: true
|
|
70
|
+
def self.openapi_nullable
|
|
71
|
+
Set.new([
|
|
72
|
+
:'state',
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectProviderSession` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectProviderSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'url')
|
|
93
|
+
self.url = attributes[:'url']
|
|
94
|
+
else
|
|
95
|
+
self.url = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'provider')
|
|
99
|
+
self.provider = attributes[:'provider']
|
|
100
|
+
else
|
|
101
|
+
self.provider = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'session_id')
|
|
105
|
+
self.session_id = attributes[:'session_id']
|
|
106
|
+
else
|
|
107
|
+
self.session_id = nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'expires_at')
|
|
111
|
+
self.expires_at = attributes[:'expires_at']
|
|
112
|
+
else
|
|
113
|
+
self.expires_at = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'state')
|
|
117
|
+
self.state = attributes[:'state']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'workspace_id')
|
|
121
|
+
self.workspace_id = attributes[:'workspace_id']
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
126
|
+
# @return Array for valid properties with the reasons
|
|
127
|
+
def list_invalid_properties
|
|
128
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
129
|
+
invalid_properties = Array.new
|
|
130
|
+
if @url.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if @provider.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "provider", provider cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @session_id.nil?
|
|
139
|
+
invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @expires_at.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
invalid_properties
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Check to see if the all the properties in the model are valid
|
|
150
|
+
# @return true if the model is valid
|
|
151
|
+
def valid?
|
|
152
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
153
|
+
return false if @url.nil?
|
|
154
|
+
return false if @provider.nil?
|
|
155
|
+
return false if @session_id.nil?
|
|
156
|
+
return false if @expires_at.nil?
|
|
157
|
+
true
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Custom attribute writer method with validation
|
|
161
|
+
# @param [Object] url Value to be assigned
|
|
162
|
+
def url=(url)
|
|
163
|
+
if url.nil?
|
|
164
|
+
fail ArgumentError, 'url cannot be nil'
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
@url = url
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Custom attribute writer method with validation
|
|
171
|
+
# @param [Object] provider Value to be assigned
|
|
172
|
+
def provider=(provider)
|
|
173
|
+
if provider.nil?
|
|
174
|
+
fail ArgumentError, 'provider cannot be nil'
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
@provider = provider
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Custom attribute writer method with validation
|
|
181
|
+
# @param [Object] session_id Value to be assigned
|
|
182
|
+
def session_id=(session_id)
|
|
183
|
+
if session_id.nil?
|
|
184
|
+
fail ArgumentError, 'session_id cannot be nil'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@session_id = session_id
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Custom attribute writer method with validation
|
|
191
|
+
# @param [Object] expires_at Value to be assigned
|
|
192
|
+
def expires_at=(expires_at)
|
|
193
|
+
if expires_at.nil?
|
|
194
|
+
fail ArgumentError, 'expires_at cannot be nil'
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
@expires_at = expires_at
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Checks equality by comparing each attribute.
|
|
201
|
+
# @param [Object] Object to be compared
|
|
202
|
+
def ==(o)
|
|
203
|
+
return true if self.equal?(o)
|
|
204
|
+
self.class == o.class &&
|
|
205
|
+
url == o.url &&
|
|
206
|
+
provider == o.provider &&
|
|
207
|
+
session_id == o.session_id &&
|
|
208
|
+
expires_at == o.expires_at &&
|
|
209
|
+
state == o.state &&
|
|
210
|
+
workspace_id == o.workspace_id
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# @see the `==` method
|
|
214
|
+
# @param [Object] Object to be compared
|
|
215
|
+
def eql?(o)
|
|
216
|
+
self == o
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Calculates hash code according to all attributes.
|
|
220
|
+
# @return [Integer] Hash code
|
|
221
|
+
def hash
|
|
222
|
+
[url, provider, session_id, expires_at, state, workspace_id].hash
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Builds the object from hash
|
|
226
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
227
|
+
# @return [Object] Returns the model itself
|
|
228
|
+
def self.build_from_hash(attributes)
|
|
229
|
+
return nil unless attributes.is_a?(Hash)
|
|
230
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
231
|
+
transformed_hash = {}
|
|
232
|
+
openapi_types.each_pair do |key, type|
|
|
233
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
234
|
+
transformed_hash["#{key}"] = nil
|
|
235
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
236
|
+
# check to ensure the input is an array given that the attribute
|
|
237
|
+
# is documented as an array but the input is not
|
|
238
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
239
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
240
|
+
end
|
|
241
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
242
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
new(transformed_hash)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Returns the object in the form of hash
|
|
249
|
+
# @return [Hash] Returns the object in the form of hash
|
|
250
|
+
def to_hash
|
|
251
|
+
hash = {}
|
|
252
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
253
|
+
value = self.send(attr)
|
|
254
|
+
if value.nil?
|
|
255
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
256
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
hash[param] = _to_hash(value)
|
|
260
|
+
end
|
|
261
|
+
hash
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
end
|
|
@@ -15,10 +15,10 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
17
|
class CreateConnectSessionRequest < ApiModelBase
|
|
18
|
-
# Where to send the user after they finish (or cancel).
|
|
18
|
+
# Where to send the user after they finish (or cancel). Every return to it carries `status` (`connected`, `cancelled`, `error` with a `code`, `expired`, `pending` when the host chose to finish later, or `requested` for a request-only PMS), `sessionId` (the id this call returns) and `state` when you sent one; a connected return adds `connectionId` and `externalAccountId` (and `hostId` for Airbnb). Your existing query string is kept.
|
|
19
19
|
attr_accessor :redirect_url
|
|
20
20
|
|
|
21
|
-
# Your own correlation token, e.g. your user id (at most 500 characters). Echoed in this response, on
|
|
21
|
+
# Your own correlation token, e.g. your user id (at most 500 characters). Echoed in this response, on every redirect back (`&state=`, whatever the outcome), in the popup message, and in the `connect.session.completed` webhook. Without it, match the return by `sessionId`.
|
|
22
22
|
attr_accessor :state
|
|
23
23
|
|
|
24
24
|
# Airbnb — how many months of past reservations the first import pulls (1–60). Omit it for the default window. Upcoming stays are always imported. A wider window takes longer to import, because every extra month is more stays to fetch.
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
|
16
16
|
module Repull
|
|
17
17
|
# Provider-specific credentials (apiKey, clientId/clientSecret, etc.) or OAuth init params for Airbnb.
|
|
18
18
|
class CreateConnectionRequest < ApiModelBase
|
|
19
|
-
# Airbnb
|
|
19
|
+
# Airbnb, Booking.com and PriceLabs — where to send the user after they finish (or cancel) the hosted connect flow. Every return to it carries `status` (`connected`, `cancelled`, `error` with a `code`, `expired`, `pending` when the host chose to finish later, or `requested` for a request-only PMS), `sessionId` (the id this call returns) and `state` when you sent one; a connected return adds `connectionId` and `externalAccountId` (and `hostId` for Airbnb). Your existing query string is kept.
|
|
20
20
|
attr_accessor :redirect_url
|
|
21
21
|
|
|
22
22
|
# Airbnb only — selects the OAuth scope set. 'read_only' grants read-only scopes; 'messaging' (shown to hosts as \"Messaging & reviews\") grants read scopes plus message read/send and review writes (reply to guest reviews, submit host reviews — Airbnb's reviews_write) but NOT property management, so it can coexist with another app (e.g. an existing PMS) that already holds property management on the same Airbnb account; 'full_access' (default) grants full host scopes including the exclusive property management (only one app per Airbnb account can hold it). The hosted consent screen normally lets the host pick a tier; passing `accessType` explicitly fixes the tier and hides that choice, so the host can only continue with the tier you requested. Omit it to let the host choose.
|
|
@@ -25,7 +25,7 @@ module Repull
|
|
|
25
25
|
# Airbnb — how many months of past reservations the first import pulls (1–60). Omit it for the default window. Upcoming stays are always imported. A wider window takes longer to import, because every extra month is more stays to fetch.
|
|
26
26
|
attr_accessor :reservation_history_months
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# Your own correlation token, e.g. your user id (at most 500 characters), for every hosted flow (Airbnb, Booking.com, PriceLabs). Echoed in this response, on every redirect back (`&state=`, whatever the outcome), in the popup message, and in the `connect.session.completed` webhook. Without it, match the return by `sessionId`.
|
|
29
29
|
attr_accessor :state
|
|
30
30
|
|
|
31
31
|
attr_accessor :workspace
|
|
@@ -92,6 +92,7 @@ module Repull
|
|
|
92
92
|
# List of attributes with nullable: true
|
|
93
93
|
def self.openapi_nullable
|
|
94
94
|
Set.new([
|
|
95
|
+
:'state',
|
|
95
96
|
:'locale'
|
|
96
97
|
])
|
|
97
98
|
end
|
data/lib/repull/models/guest.rb
CHANGED
|
@@ -45,8 +45,10 @@ module Repull
|
|
|
45
45
|
# Decimal-as-string to preserve precision across mixed-currency totals.
|
|
46
46
|
attr_accessor :total_revenue
|
|
47
47
|
|
|
48
|
+
# Check-out date of the guest's most recent stay (YYYY-MM-DD).
|
|
48
49
|
attr_accessor :last_stayed_at
|
|
49
50
|
|
|
51
|
+
# Check-in date of the guest's first stay (YYYY-MM-DD).
|
|
50
52
|
attr_accessor :first_stayed_at
|
|
51
53
|
|
|
52
54
|
attr_accessor :created_at
|
|
@@ -115,8 +117,8 @@ module Repull
|
|
|
115
117
|
:'email' => :'String',
|
|
116
118
|
:'total_reservations' => :'Integer',
|
|
117
119
|
:'total_revenue' => :'String',
|
|
118
|
-
:'last_stayed_at' => :'
|
|
119
|
-
:'first_stayed_at' => :'
|
|
120
|
+
:'last_stayed_at' => :'Date',
|
|
121
|
+
:'first_stayed_at' => :'Date',
|
|
120
122
|
:'created_at' => :'Time'
|
|
121
123
|
}
|
|
122
124
|
end
|
|
@@ -24,6 +24,12 @@ module Repull
|
|
|
24
24
|
|
|
25
25
|
attr_accessor :queued_at
|
|
26
26
|
|
|
27
|
+
# The import's id on `GET /v1/connections/{id}/imports` and in the `account.import.*` webhooks.
|
|
28
|
+
attr_accessor :import_id
|
|
29
|
+
|
|
30
|
+
# `full` only: an earlier import of this account that no worker had picked up, closed as `failed` (`did_not_start`) and replaced by this one.
|
|
31
|
+
attr_accessor :replaced_import_id
|
|
32
|
+
|
|
27
33
|
class EnumAttributeValidator
|
|
28
34
|
attr_reader :datatype
|
|
29
35
|
attr_reader :allowable_values
|
|
@@ -52,7 +58,9 @@ module Repull
|
|
|
52
58
|
:'connection' => :'connection',
|
|
53
59
|
:'scope' => :'scope',
|
|
54
60
|
:'status' => :'status',
|
|
55
|
-
:'queued_at' => :'queuedAt'
|
|
61
|
+
:'queued_at' => :'queuedAt',
|
|
62
|
+
:'import_id' => :'importId',
|
|
63
|
+
:'replaced_import_id' => :'replacedImportId'
|
|
56
64
|
}
|
|
57
65
|
end
|
|
58
66
|
|
|
@@ -72,13 +80,17 @@ module Repull
|
|
|
72
80
|
:'connection' => :'String',
|
|
73
81
|
:'scope' => :'String',
|
|
74
82
|
:'status' => :'String',
|
|
75
|
-
:'queued_at' => :'Time'
|
|
83
|
+
:'queued_at' => :'Time',
|
|
84
|
+
:'import_id' => :'String',
|
|
85
|
+
:'replaced_import_id' => :'String'
|
|
76
86
|
}
|
|
77
87
|
end
|
|
78
88
|
|
|
79
89
|
# List of attributes with nullable: true
|
|
80
90
|
def self.openapi_nullable
|
|
81
91
|
Set.new([
|
|
92
|
+
:'import_id',
|
|
93
|
+
:'replaced_import_id'
|
|
82
94
|
])
|
|
83
95
|
end
|
|
84
96
|
|
|
@@ -121,6 +133,18 @@ module Repull
|
|
|
121
133
|
else
|
|
122
134
|
self.queued_at = nil
|
|
123
135
|
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'import_id')
|
|
138
|
+
self.import_id = attributes[:'import_id']
|
|
139
|
+
else
|
|
140
|
+
self.import_id = nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'replaced_import_id')
|
|
144
|
+
self.replaced_import_id = attributes[:'replaced_import_id']
|
|
145
|
+
else
|
|
146
|
+
self.replaced_import_id = nil
|
|
147
|
+
end
|
|
124
148
|
end
|
|
125
149
|
|
|
126
150
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -153,7 +177,7 @@ module Repull
|
|
|
153
177
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
154
178
|
return false if @connection.nil?
|
|
155
179
|
return false if @scope.nil?
|
|
156
|
-
scope_validator = EnumAttributeValidator.new('String', ["listings", "
|
|
180
|
+
scope_validator = EnumAttributeValidator.new('String', ["listings", "full"])
|
|
157
181
|
return false unless scope_validator.valid?(@scope)
|
|
158
182
|
return false if @status.nil?
|
|
159
183
|
status_validator = EnumAttributeValidator.new('String', ["queued"])
|
|
@@ -175,7 +199,7 @@ module Repull
|
|
|
175
199
|
# Custom attribute writer method checking allowed values (enum).
|
|
176
200
|
# @param [Object] scope Object to be assigned
|
|
177
201
|
def scope=(scope)
|
|
178
|
-
validator = EnumAttributeValidator.new('String', ["listings", "
|
|
202
|
+
validator = EnumAttributeValidator.new('String', ["listings", "full"])
|
|
179
203
|
unless validator.valid?(scope)
|
|
180
204
|
fail ArgumentError, "invalid value for \"scope\", must be one of #{validator.allowable_values}."
|
|
181
205
|
end
|
|
@@ -210,7 +234,9 @@ module Repull
|
|
|
210
234
|
connection == o.connection &&
|
|
211
235
|
scope == o.scope &&
|
|
212
236
|
status == o.status &&
|
|
213
|
-
queued_at == o.queued_at
|
|
237
|
+
queued_at == o.queued_at &&
|
|
238
|
+
import_id == o.import_id &&
|
|
239
|
+
replaced_import_id == o.replaced_import_id
|
|
214
240
|
end
|
|
215
241
|
|
|
216
242
|
# @see the `==` method
|
|
@@ -222,7 +248,7 @@ module Repull
|
|
|
222
248
|
# Calculates hash code according to all attributes.
|
|
223
249
|
# @return [Integer] Hash code
|
|
224
250
|
def hash
|
|
225
|
-
[connection, scope, status, queued_at].hash
|
|
251
|
+
[connection, scope, status, queued_at, import_id, replaced_import_id].hash
|
|
226
252
|
end
|
|
227
253
|
|
|
228
254
|
# Builds the object from hash
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Repull
|
|
17
17
|
class StartConnectionImportRequest < ApiModelBase
|
|
18
|
-
# What to import. `
|
|
18
|
+
# What to import. `full` = the first-connect import again (listings, calendars, reservations, payouts, reviews, conversations), for an account that has never fully imported. `listings` = the account's listings with their calendars. Omit to let Repull choose: `full` for an account that has never fully imported, else `listings`.
|
|
19
19
|
attr_accessor :scope
|
|
20
20
|
|
|
21
21
|
class EnumAttributeValidator
|
|
@@ -88,8 +88,6 @@ module Repull
|
|
|
88
88
|
|
|
89
89
|
if attributes.key?(:'scope')
|
|
90
90
|
self.scope = attributes[:'scope']
|
|
91
|
-
else
|
|
92
|
-
self.scope = 'listings'
|
|
93
91
|
end
|
|
94
92
|
end
|
|
95
93
|
|
|
@@ -105,7 +103,7 @@ module Repull
|
|
|
105
103
|
# @return true if the model is valid
|
|
106
104
|
def valid?
|
|
107
105
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
108
|
-
scope_validator = EnumAttributeValidator.new('String', ["listings", "
|
|
106
|
+
scope_validator = EnumAttributeValidator.new('String', ["listings", "full"])
|
|
109
107
|
return false unless scope_validator.valid?(@scope)
|
|
110
108
|
true
|
|
111
109
|
end
|
|
@@ -113,7 +111,7 @@ module Repull
|
|
|
113
111
|
# Custom attribute writer method checking allowed values (enum).
|
|
114
112
|
# @param [Object] scope Object to be assigned
|
|
115
113
|
def scope=(scope)
|
|
116
|
-
validator = EnumAttributeValidator.new('String', ["listings", "
|
|
114
|
+
validator = EnumAttributeValidator.new('String', ["listings", "full"])
|
|
117
115
|
unless validator.valid?(scope)
|
|
118
116
|
fail ArgumentError, "invalid value for \"scope\", must be one of #{validator.allowable_values}."
|
|
119
117
|
end
|
data/lib/repull/version.rb
CHANGED