repull 0.2.59 → 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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +17 -17
  3. data/lib/repull/api/connect_api.rb +10 -10
  4. data/lib/repull/api/connections_api.rb +4 -4
  5. data/lib/repull/api/reviews_api.rb +4 -4
  6. data/lib/repull/models/account_import.rb +1 -1
  7. data/lib/repull/models/airbnb_data_freshness.rb +1 -1
  8. data/lib/repull/models/airbnb_reservation.rb +346 -6
  9. data/lib/repull/models/airbnb_reservation_detail.rb +679 -0
  10. data/lib/repull/models/airbnb_reservation_detail_response.rb +173 -0
  11. data/lib/repull/models/airbnb_transaction.rb +1 -1
  12. data/lib/repull/models/airbnb_transaction_payout.rb +2 -2
  13. data/lib/repull/models/connect_provider_session.rb +266 -0
  14. data/lib/repull/models/connect_status.rb +12 -1
  15. data/lib/repull/models/connection.rb +16 -5
  16. data/lib/repull/models/create_connect_session_request.rb +2 -2
  17. data/lib/repull/models/create_connection_request.rb +3 -2
  18. data/lib/repull/models/create_price_labs_key201_response.rb +12 -1
  19. data/lib/repull/models/guest.rb +4 -2
  20. data/lib/repull/models/hospitable_webhook.rb +218 -0
  21. data/lib/repull/models/review.rb +1 -1
  22. data/lib/repull/models/start_connection_import202_response_data.rb +32 -6
  23. data/lib/repull/models/start_connection_import_request.rb +3 -5
  24. data/lib/repull/models/submit_hospitable_credentials200_response.rb +169 -0
  25. data/lib/repull/models/sync_airbnb_transactions200_response_accounts_inner.rb +1 -1
  26. data/lib/repull/models/sync_airbnb_transactions_request.rb +1 -1
  27. data/lib/repull/version.rb +1 -1
  28. data/lib/repull.rb +5 -0
  29. data/openapi/v1.json +569 -41
  30. metadata +6 -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
@@ -24,7 +24,7 @@ module Repull
24
24
 
25
25
  attr_accessor :account_name
26
26
 
27
- # `COMPLETED`: settled in a payout. `UPCOMING`: expected, not paid out yet.
27
+ # `COMPLETED`: settled in a payout. `RELEASED`: Airbnb released it (its date has passed) but has not paid it out yet — the payout is held, or accumulating toward the host's next one; it becomes `COMPLETED` under its payout when paid. `UPCOMING`: expected, not released yet.
28
28
  attr_accessor :status
29
29
 
30
30
  # Airbnb's line type, verbatim: `Payout`, `Reservation`, `Adjustment`, `Resolution Payout`, `Resolution Adjustment`, `Cancellation Fee`, `Pass Through Tot`, …
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Repull
17
17
  class AirbnbTransactionPayout < ApiModelBase
18
- # The payout this line was settled in (its own id on a Payout row). `null` on an UPCOMING line.
18
+ # The payout this line was settled in (its own id on a Payout row). `null` on an unpaid (`RELEASED` / `UPCOMING`) line.
19
19
  attr_accessor :payout_id
20
20
 
21
21
  # `true` when Airbnb sent no payout id (a payout netting to $0.00) and Repull derived a stable one.
@@ -23,7 +23,7 @@ module Repull
23
23
 
24
24
  attr_accessor :payout_date
25
25
 
26
- # Position within the payout, from 1. `null` on the Payout row and on UPCOMING lines.
26
+ # Position within the payout, from 1. `null` on the Payout row and on unpaid lines.
27
27
  attr_accessor :line_index
28
28
 
29
29
  # On the Payout row only: the amount paid out. Its lines sum to it.
@@ -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
@@ -45,6 +45,9 @@ module Repull
45
45
  # PMS connections only: what the app may change in the PMS. Change it with `PATCH /v1/connect/{provider}/write-policy`.
46
46
  attr_accessor :write_policy
47
47
 
48
+ # Hospitable only (`GET /v1/connect/hospitable`): the webhook URL the host pastes into Hospitable (Apps → Webhooks → + Add new) and whether deliveries are arriving.
49
+ attr_accessor :webhook
50
+
48
51
  attr_accessor :capabilities
49
52
 
50
53
  # Vrbo only: the same freshness envelope the Airbnb read endpoints return, per account and in aggregate. Its reason is never_synced until a mapping is confirmed and importing while upcoming bookings come in.
@@ -92,6 +95,7 @@ module Repull
92
95
  :'host' => :'host',
93
96
  :'accounts' => :'accounts',
94
97
  :'write_policy' => :'writePolicy',
98
+ :'webhook' => :'webhook',
95
99
  :'capabilities' => :'capabilities',
96
100
  :'data_freshness' => :'dataFreshness',
97
101
  :'action' => :'action',
@@ -123,6 +127,7 @@ module Repull
123
127
  :'host' => :'ConnectHost',
124
128
  :'accounts' => :'Array<ConnectStatusAccountsInner>',
125
129
  :'write_policy' => :'PmsWritePolicy',
130
+ :'webhook' => :'HospitableWebhook',
126
131
  :'capabilities' => :'ConnectStatusCapabilities',
127
132
  :'data_freshness' => :'Object',
128
133
  :'action' => :'ConnectionAction',
@@ -136,6 +141,7 @@ module Repull
136
141
  :'external_account_id',
137
142
  :'access_type',
138
143
  :'host',
144
+ :'webhook',
139
145
  :'action',
140
146
  :'fix_url'
141
147
  ])
@@ -203,6 +209,10 @@ module Repull
203
209
  self.write_policy = attributes[:'write_policy']
204
210
  end
205
211
 
212
+ if attributes.key?(:'webhook')
213
+ self.webhook = attributes[:'webhook']
214
+ end
215
+
206
216
  if attributes.key?(:'capabilities')
207
217
  self.capabilities = attributes[:'capabilities']
208
218
  end
@@ -251,6 +261,7 @@ module Repull
251
261
  host == o.host &&
252
262
  accounts == o.accounts &&
253
263
  write_policy == o.write_policy &&
264
+ webhook == o.webhook &&
254
265
  capabilities == o.capabilities &&
255
266
  data_freshness == o.data_freshness &&
256
267
  action == o.action &&
@@ -266,7 +277,7 @@ module Repull
266
277
  # Calculates hash code according to all attributes.
267
278
  # @return [Integer] Hash code
268
279
  def hash
269
- [connected, provider, id, connection_id, status, external_account_id, created_at, access_type, host, accounts, write_policy, capabilities, data_freshness, action, fix_url].hash
280
+ [connected, provider, id, connection_id, status, external_account_id, created_at, access_type, host, accounts, write_policy, webhook, capabilities, data_freshness, action, fix_url].hash
270
281
  end
271
282
 
272
283
  # Builds the object from hash
@@ -63,6 +63,9 @@ module Repull
63
63
  # Apps only: how the app is doing on this connection. `null` once disconnected.
64
64
  attr_accessor :health
65
65
 
66
+ # Hospitable only: the webhook URL the host pastes into Hospitable (Apps → Webhooks → + Add new) and whether deliveries are arriving. Show it in your own UI so the host can set it up. Absent for other providers.
67
+ attr_accessor :webhook
68
+
66
69
  class EnumAttributeValidator
67
70
  attr_reader :datatype
68
71
  attr_reader :allowable_values
@@ -104,7 +107,8 @@ module Repull
104
107
  :'key_masked' => :'keyMasked',
105
108
  :'label' => :'label',
106
109
  :'disconnected_at' => :'disconnectedAt',
107
- :'health' => :'health'
110
+ :'health' => :'health',
111
+ :'webhook' => :'webhook'
108
112
  }
109
113
  end
110
114
 
@@ -137,7 +141,8 @@ module Repull
137
141
  :'key_masked' => :'String',
138
142
  :'label' => :'String',
139
143
  :'disconnected_at' => :'Time',
140
- :'health' => :'AppConnectionHealth'
144
+ :'health' => :'AppConnectionHealth',
145
+ :'webhook' => :'HospitableWebhook'
141
146
  }
142
147
  end
143
148
 
@@ -153,7 +158,8 @@ module Repull
153
158
  :'listing_ids',
154
159
  :'label',
155
160
  :'disconnected_at',
156
- :'health'
161
+ :'health',
162
+ :'webhook'
157
163
  ])
158
164
  end
159
165
 
@@ -242,6 +248,10 @@ module Repull
242
248
  if attributes.key?(:'health')
243
249
  self.health = attributes[:'health']
244
250
  end
251
+
252
+ if attributes.key?(:'webhook')
253
+ self.webhook = attributes[:'webhook']
254
+ end
245
255
  end
246
256
 
247
257
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -280,7 +290,8 @@ module Repull
280
290
  key_masked == o.key_masked &&
281
291
  label == o.label &&
282
292
  disconnected_at == o.disconnected_at &&
283
- health == o.health
293
+ health == o.health &&
294
+ webhook == o.webhook
284
295
  end
285
296
 
286
297
  # @see the `==` method
@@ -292,7 +303,7 @@ module Repull
292
303
  # Calculates hash code according to all attributes.
293
304
  # @return [Integer] Hash code
294
305
  def hash
295
- [id, provider, status, external_account_id, access_type, created_at, host, action, fix_url, import, scope, listing_ids, listing_count, key_masked, label, disconnected_at, health].hash
306
+ [id, provider, status, external_account_id, access_type, created_at, host, action, fix_url, import, scope, listing_ids, listing_count, key_masked, label, disconnected_at, health, webhook].hash
296
307
  end
297
308
 
298
309
  # Builds the object from hash
@@ -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). Status query params are appended.
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 the redirect back (`&state=`), in the popup message, and in the `connect.session.completed` webhook.
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 + Booking.com — where to redirect the user after they finish the hosted connect flow.
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
- # Airbnb + Booking.com — your own correlation token, e.g. your user id (at most 500 characters). Echoed on the redirect back (`&state=`) and in the `connect.session.completed` webhook.
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