repull 0.2.26 → 0.2.27

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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +38 -23
  3. data/lib/repull/api/booking_com_api.rb +9 -2
  4. data/lib/repull/api/connect_api.rb +4 -4
  5. data/lib/repull/api/listings_api.rb +2 -2
  6. data/lib/repull/api/properties_api.rb +2 -2
  7. data/lib/repull/api/reservations_api.rb +93 -6
  8. data/lib/repull/api/vrbo_api.rb +9 -2
  9. data/lib/repull/models/airbnb_listing.rb +13 -2
  10. data/lib/repull/models/airbnb_listing_details_write_request.rb +109 -5
  11. data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +1 -1
  12. data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +2 -2
  13. data/lib/repull/models/airbnb_pricing_write_request.rb +30 -2
  14. data/lib/repull/models/airbnb_pricing_write_request_fees_inner.rb +291 -0
  15. data/lib/repull/models/booking_property_listings_inner.rb +57 -1
  16. data/lib/repull/models/cancel_reservation200_response.rb +1 -1
  17. data/lib/repull/models/connect_status.rb +35 -4
  18. data/lib/repull/models/connect_status_capabilities.rb +148 -0
  19. data/lib/repull/models/connection.rb +28 -5
  20. data/lib/repull/models/connection_action.rb +188 -0
  21. data/lib/repull/models/create_connect_session_request.rb +39 -1
  22. data/lib/repull/models/create_connection_request.rb +39 -1
  23. data/lib/repull/models/error_error.rb +13 -1
  24. data/lib/repull/models/{cancel_reservation200_response_pms.rb → error_error_listings_inner.rb} +36 -30
  25. data/lib/repull/models/get_booking_extranet_login_status200_response.rb +2 -1
  26. data/lib/repull/models/list_listing_units200_response.rb +2 -1
  27. data/lib/repull/models/listing.rb +23 -2
  28. data/lib/repull/models/listing_capabilities.rb +148 -0
  29. data/lib/repull/models/property.rb +14 -3
  30. data/lib/repull/models/reservation_capabilities.rb +230 -0
  31. data/lib/repull/models/reservation_create_request.rb +172 -33
  32. data/lib/repull/models/reservation_create_response.rb +6 -6
  33. data/lib/repull/models/reservation_create_response_unit.rb +1 -1
  34. data/lib/repull/models/{reservation_create_response_pms.rb → reservation_pms_outcome.rb} +38 -8
  35. data/lib/repull/models/reservation_pms_outcome_quote.rb +168 -0
  36. data/lib/repull/models/{cancel_reservation200_response_pms_errors_inner.rb → reservation_pms_section_error.rb} +16 -16
  37. data/lib/repull/models/reservation_quote_request.rb +312 -0
  38. data/lib/repull/models/reservation_quote_response.rb +228 -0
  39. data/lib/repull/models/reservation_quote_response_breakdown.rb +175 -0
  40. data/lib/repull/models/reservation_update_response.rb +16 -6
  41. data/lib/repull/models/submit_smoobu_credentials_request.rb +2 -5
  42. data/lib/repull/models/submit_smoobu_credentials_request_credentials.rb +193 -0
  43. data/lib/repull/models/update_airbnb_checkin_guide200_response.rb +147 -0
  44. data/lib/repull/models/update_airbnb_checkin_guide200_response_data.rb +177 -0
  45. data/lib/repull/models/{airbnb_permits_write_request_permits_inner_answers_value.rb → update_airbnb_checkin_guide200_response_data_steps_inner.rb} +24 -43
  46. data/lib/repull/models/update_airbnb_checkin_guide_request.rb +186 -0
  47. data/lib/repull/models/update_airbnb_checkin_guide_request_steps_inner.rb +182 -0
  48. data/lib/repull/version.rb +1 -1
  49. data/lib/repull.rb +18 -4
  50. data/openapi/v1.json +2059 -335
  51. data/scripts/regen.sh +1 -1
  52. metadata +20 -6
@@ -0,0 +1,148 @@
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
+
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
+ # PMS providers only. `reservations`: which reservation writes the API performs on this connection's listings — the connector's support combined with `writePolicy`. When `connected` is false, what the connector supports once connected.
18
+ class ConnectStatusCapabilities < ApiModelBase
19
+ attr_accessor :reservations
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'reservations' => :'reservations'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'reservations' => :'ReservationCapabilities'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectStatusCapabilities` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectStatusCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'reservations')
68
+ self.reservations = attributes[:'reservations']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ reservations == o.reservations
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [reservations].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Returns the object in the form of hash
131
+ # @return [Hash] Returns the object in the form of hash
132
+ def to_hash
133
+ hash = {}
134
+ self.class.attribute_map.each_pair do |attr, param|
135
+ value = self.send(attr)
136
+ if value.nil?
137
+ is_nullable = self.class.openapi_nullable.include?(attr)
138
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
139
+ end
140
+
141
+ hash[param] = _to_hash(value)
142
+ end
143
+ hash
144
+ end
145
+
146
+ end
147
+
148
+ end
@@ -19,6 +19,7 @@ module Repull
19
19
 
20
20
  attr_accessor :provider
21
21
 
22
+ # `active` — connected and working. `pending` — still settling. `needs_permissions` — connected but the host must grant more access before it works (see `action`/`fixUrl`). An `active` connection can also carry an `action` (e.g. a Smoobu legacy API key that must be replaced with a key + secret before October 31, 2026). `error` — the last operation failed. `disconnected` — revoked or superseded.
22
23
  attr_accessor :status
23
24
 
24
25
  attr_accessor :external_account_id
@@ -28,6 +29,12 @@ module Repull
28
29
  # Host metadata for the linked account. Currently populated for Airbnb only; null for other providers.
29
30
  attr_accessor :host
30
31
 
32
+ # Set when the host must do something before the connection works (e.g. grant the invited Booking.com Extranet user full access). `null` when no action is pending.
33
+ attr_accessor :action
34
+
35
+ # Durable link that reopens the hosted Connect flow bound to this account on the fix screen — send the host here to resolve `action`. Present only when `action.required` is true; `null` otherwise.
36
+ attr_accessor :fix_url
37
+
31
38
  # Attribute mapping from ruby-style variable name to JSON key.
32
39
  def self.attribute_map
33
40
  {
@@ -36,7 +43,9 @@ module Repull
36
43
  :'status' => :'status',
37
44
  :'external_account_id' => :'externalAccountId',
38
45
  :'created_at' => :'createdAt',
39
- :'host' => :'host'
46
+ :'host' => :'host',
47
+ :'action' => :'action',
48
+ :'fix_url' => :'fixUrl'
40
49
  }
41
50
  end
42
51
 
@@ -58,7 +67,9 @@ module Repull
58
67
  :'status' => :'String',
59
68
  :'external_account_id' => :'String',
60
69
  :'created_at' => :'Time',
61
- :'host' => :'ConnectHost'
70
+ :'host' => :'ConnectHost',
71
+ :'action' => :'ConnectionAction',
72
+ :'fix_url' => :'String'
62
73
  }
63
74
  end
64
75
 
@@ -66,7 +77,9 @@ module Repull
66
77
  def self.openapi_nullable
67
78
  Set.new([
68
79
  :'external_account_id',
69
- :'host'
80
+ :'host',
81
+ :'action',
82
+ :'fix_url'
70
83
  ])
71
84
  end
72
85
 
@@ -109,6 +122,14 @@ module Repull
109
122
  if attributes.key?(:'host')
110
123
  self.host = attributes[:'host']
111
124
  end
125
+
126
+ if attributes.key?(:'action')
127
+ self.action = attributes[:'action']
128
+ end
129
+
130
+ if attributes.key?(:'fix_url')
131
+ self.fix_url = attributes[:'fix_url']
132
+ end
112
133
  end
113
134
 
114
135
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -136,7 +157,9 @@ module Repull
136
157
  status == o.status &&
137
158
  external_account_id == o.external_account_id &&
138
159
  created_at == o.created_at &&
139
- host == o.host
160
+ host == o.host &&
161
+ action == o.action &&
162
+ fix_url == o.fix_url
140
163
  end
141
164
 
142
165
  # @see the `==` method
@@ -148,7 +171,7 @@ module Repull
148
171
  # Calculates hash code according to all attributes.
149
172
  # @return [Integer] Hash code
150
173
  def hash
151
- [id, provider, status, external_account_id, created_at, host].hash
174
+ [id, provider, status, external_account_id, created_at, host, action, fix_url].hash
152
175
  end
153
176
 
154
177
  # Builds the object from hash
@@ -0,0 +1,188 @@
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
+
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 host action a connection needs before it can work.
18
+ class ConnectionAction < ApiModelBase
19
+ # Whether a host action is pending.
20
+ attr_accessor :required
21
+
22
+ # Machine-readable reason, stable for programmatic handling.
23
+ attr_accessor :reason
24
+
25
+ # Host-facing one-liner describing what to do.
26
+ attr_accessor :message
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'required' => :'required',
32
+ :'reason' => :'reason',
33
+ :'message' => :'message'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'required' => :'Boolean',
51
+ :'reason' => :'String',
52
+ :'message' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'reason',
60
+ :'message'
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectionAction` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectionAction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'required')
81
+ self.required = attributes[:'required']
82
+ else
83
+ self.required = nil
84
+ end
85
+
86
+ if attributes.key?(:'reason')
87
+ self.reason = attributes[:'reason']
88
+ end
89
+
90
+ if attributes.key?(:'message')
91
+ self.message = attributes[:'message']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @required.nil?
101
+ invalid_properties.push('invalid value for "required", required cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ return false if @required.nil?
112
+ true
113
+ end
114
+
115
+ # Custom attribute writer method with validation
116
+ # @param [Object] required Value to be assigned
117
+ def required=(required)
118
+ if required.nil?
119
+ fail ArgumentError, 'required cannot be nil'
120
+ end
121
+
122
+ @required = required
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ required == o.required &&
131
+ reason == o.reason &&
132
+ message == o.message
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ def hash
144
+ [required, reason, message].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ attributes = attributes.transform_keys(&:to_sym)
153
+ transformed_hash = {}
154
+ openapi_types.each_pair do |key, type|
155
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
156
+ transformed_hash["#{key}"] = nil
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[attribute_map[key]].is_a?(Array)
161
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
162
+ end
163
+ elsif !attributes[attribute_map[key]].nil?
164
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
165
+ end
166
+ end
167
+ new(transformed_hash)
168
+ end
169
+
170
+ # Returns the object in the form of hash
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_hash
173
+ hash = {}
174
+ self.class.attribute_map.each_pair do |attr, param|
175
+ value = self.send(attr)
176
+ if value.nil?
177
+ is_nullable = self.class.openapi_nullable.include?(attr)
178
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
179
+ end
180
+
181
+ hash[param] = _to_hash(value)
182
+ end
183
+ hash
184
+ end
185
+
186
+ end
187
+
188
+ end
@@ -21,6 +21,9 @@ module Repull
21
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.
22
22
  attr_accessor :state
23
23
 
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.
25
+ attr_accessor :reservation_history_months
26
+
24
27
  # What the connection may do. Airbnb: the OAuth scope tier. Vrbo: `messaging` (or `read_only`) imports bookings and messages and never pushes the calendar; `full_access` also pushes prices and availability. Setting it locks the choice; omit it to let the host choose on the hosted page (default `full_access`).
25
28
  attr_accessor :access_type
26
29
 
@@ -67,6 +70,7 @@ module Repull
67
70
  {
68
71
  :'redirect_url' => :'redirectUrl',
69
72
  :'state' => :'state',
73
+ :'reservation_history_months' => :'reservationHistoryMonths',
70
74
  :'access_type' => :'accessType',
71
75
  :'allowed_providers' => :'allowedProviders',
72
76
  :'locale' => :'locale',
@@ -92,6 +96,7 @@ module Repull
92
96
  {
93
97
  :'redirect_url' => :'String',
94
98
  :'state' => :'String',
99
+ :'reservation_history_months' => :'Integer',
95
100
  :'access_type' => :'String',
96
101
  :'allowed_providers' => :'Array<String>',
97
102
  :'locale' => :'String',
@@ -137,6 +142,10 @@ module Repull
137
142
  self.state = attributes[:'state']
138
143
  end
139
144
 
145
+ if attributes.key?(:'reservation_history_months')
146
+ self.reservation_history_months = attributes[:'reservation_history_months']
147
+ end
148
+
140
149
  if attributes.key?(:'access_type')
141
150
  self.access_type = attributes[:'access_type']
142
151
  end
@@ -181,6 +190,14 @@ module Repull
181
190
  invalid_properties.push('invalid value for "redirect_url", redirect_url cannot be nil.')
182
191
  end
183
192
 
193
+ if !@reservation_history_months.nil? && @reservation_history_months > 60
194
+ invalid_properties.push('invalid value for "reservation_history_months", must be smaller than or equal to 60.')
195
+ end
196
+
197
+ if !@reservation_history_months.nil? && @reservation_history_months < 1
198
+ invalid_properties.push('invalid value for "reservation_history_months", must be greater than or equal to 1.')
199
+ end
200
+
184
201
  invalid_properties
185
202
  end
186
203
 
@@ -189,6 +206,8 @@ module Repull
189
206
  def valid?
190
207
  warn '[DEPRECATED] the `valid?` method is obsolete'
191
208
  return false if @redirect_url.nil?
209
+ return false if !@reservation_history_months.nil? && @reservation_history_months > 60
210
+ return false if !@reservation_history_months.nil? && @reservation_history_months < 1
192
211
  access_type_validator = EnumAttributeValidator.new('String', ["full_access", "messaging", "read_only"])
193
212
  return false unless access_type_validator.valid?(@access_type)
194
213
  purpose_validator = EnumAttributeValidator.new('String', ["connect", "migrate"])
@@ -206,6 +225,24 @@ module Repull
206
225
  @redirect_url = redirect_url
207
226
  end
208
227
 
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] reservation_history_months Value to be assigned
230
+ def reservation_history_months=(reservation_history_months)
231
+ if reservation_history_months.nil?
232
+ fail ArgumentError, 'reservation_history_months cannot be nil'
233
+ end
234
+
235
+ if reservation_history_months > 60
236
+ fail ArgumentError, 'invalid value for "reservation_history_months", must be smaller than or equal to 60.'
237
+ end
238
+
239
+ if reservation_history_months < 1
240
+ fail ArgumentError, 'invalid value for "reservation_history_months", must be greater than or equal to 1.'
241
+ end
242
+
243
+ @reservation_history_months = reservation_history_months
244
+ end
245
+
209
246
  # Custom attribute writer method checking allowed values (enum).
210
247
  # @param [Object] access_type Object to be assigned
211
248
  def access_type=(access_type)
@@ -233,6 +270,7 @@ module Repull
233
270
  self.class == o.class &&
234
271
  redirect_url == o.redirect_url &&
235
272
  state == o.state &&
273
+ reservation_history_months == o.reservation_history_months &&
236
274
  access_type == o.access_type &&
237
275
  allowed_providers == o.allowed_providers &&
238
276
  locale == o.locale &&
@@ -251,7 +289,7 @@ module Repull
251
289
  # Calculates hash code according to all attributes.
252
290
  # @return [Integer] Hash code
253
291
  def hash
254
- [redirect_url, state, access_type, allowed_providers, locale, purpose, workspace, copy, scope].hash
292
+ [redirect_url, state, reservation_history_months, access_type, allowed_providers, locale, purpose, workspace, copy, scope].hash
255
293
  end
256
294
 
257
295
  # Builds the object from hash
@@ -22,6 +22,9 @@ module Repull
22
22
  # Airbnb only — selects the OAuth scope set. 'read_only' grants read-only scopes; 'messaging' grants read scopes plus message read/send 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.
23
23
  attr_accessor :access_type
24
24
 
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
+ attr_accessor :reservation_history_months
27
+
25
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.
26
29
  attr_accessor :state
27
30
 
@@ -61,6 +64,7 @@ module Repull
61
64
  {
62
65
  :'redirect_url' => :'redirectUrl',
63
66
  :'access_type' => :'accessType',
67
+ :'reservation_history_months' => :'reservationHistoryMonths',
64
68
  :'state' => :'state',
65
69
  :'client_id' => :'clientId',
66
70
  :'client_secret' => :'clientSecret',
@@ -83,6 +87,7 @@ module Repull
83
87
  {
84
88
  :'redirect_url' => :'String',
85
89
  :'access_type' => :'String',
90
+ :'reservation_history_months' => :'Integer',
86
91
  :'state' => :'String',
87
92
  :'client_id' => :'String',
88
93
  :'client_secret' => :'String',
@@ -123,6 +128,10 @@ module Repull
123
128
  self.access_type = 'full_access'
124
129
  end
125
130
 
131
+ if attributes.key?(:'reservation_history_months')
132
+ self.reservation_history_months = attributes[:'reservation_history_months']
133
+ end
134
+
126
135
  if attributes.key?(:'state')
127
136
  self.state = attributes[:'state']
128
137
  end
@@ -145,6 +154,14 @@ module Repull
145
154
  def list_invalid_properties
146
155
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
147
156
  invalid_properties = Array.new
157
+ if !@reservation_history_months.nil? && @reservation_history_months > 60
158
+ invalid_properties.push('invalid value for "reservation_history_months", must be smaller than or equal to 60.')
159
+ end
160
+
161
+ if !@reservation_history_months.nil? && @reservation_history_months < 1
162
+ invalid_properties.push('invalid value for "reservation_history_months", must be greater than or equal to 1.')
163
+ end
164
+
148
165
  invalid_properties
149
166
  end
150
167
 
@@ -154,6 +171,8 @@ module Repull
154
171
  warn '[DEPRECATED] the `valid?` method is obsolete'
155
172
  access_type_validator = EnumAttributeValidator.new('String', ["read_only", "full_access", "messaging"])
156
173
  return false unless access_type_validator.valid?(@access_type)
174
+ return false if !@reservation_history_months.nil? && @reservation_history_months > 60
175
+ return false if !@reservation_history_months.nil? && @reservation_history_months < 1
157
176
  true
158
177
  end
159
178
 
@@ -167,6 +186,24 @@ module Repull
167
186
  @access_type = access_type
168
187
  end
169
188
 
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] reservation_history_months Value to be assigned
191
+ def reservation_history_months=(reservation_history_months)
192
+ if reservation_history_months.nil?
193
+ fail ArgumentError, 'reservation_history_months cannot be nil'
194
+ end
195
+
196
+ if reservation_history_months > 60
197
+ fail ArgumentError, 'invalid value for "reservation_history_months", must be smaller than or equal to 60.'
198
+ end
199
+
200
+ if reservation_history_months < 1
201
+ fail ArgumentError, 'invalid value for "reservation_history_months", must be greater than or equal to 1.'
202
+ end
203
+
204
+ @reservation_history_months = reservation_history_months
205
+ end
206
+
170
207
  # Checks equality by comparing each attribute.
171
208
  # @param [Object] Object to be compared
172
209
  def ==(o)
@@ -174,6 +211,7 @@ module Repull
174
211
  self.class == o.class &&
175
212
  redirect_url == o.redirect_url &&
176
213
  access_type == o.access_type &&
214
+ reservation_history_months == o.reservation_history_months &&
177
215
  state == o.state &&
178
216
  client_id == o.client_id &&
179
217
  client_secret == o.client_secret &&
@@ -189,7 +227,7 @@ module Repull
189
227
  # Calculates hash code according to all attributes.
190
228
  # @return [Integer] Hash code
191
229
  def hash
192
- [redirect_url, access_type, state, client_id, client_secret, locale].hash
230
+ [redirect_url, access_type, reservation_history_months, state, client_id, client_secret, locale].hash
193
231
  end
194
232
 
195
233
  # Builds the object from hash