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,230 @@
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
+ # Which reservation writes the API performs for this listing (or, on `GET /v1/connect/{provider}`, for any listing of that connection). Derived from the PMS connector, the connection, and its write policy — a flag is true only when all three allow it.
18
+ class ReservationCapabilities < ApiModelBase
19
+ # `pms` — booked in the connected PMS; `repull` — a direct booking made in Repull.
20
+ attr_accessor :managed_by
21
+
22
+ attr_accessor :provider
23
+
24
+ # `POST /v1/reservations`.
25
+ attr_accessor :create
26
+
27
+ # `PATCH /v1/reservations/{id}`.
28
+ attr_accessor :modify
29
+
30
+ # `POST /v1/reservations/{id}/cancel`.
31
+ attr_accessor :cancel
32
+
33
+ # `POST /v1/reservations/quote`.
34
+ attr_accessor :quote
35
+
36
+ # `totalPrice` on create is honoured; otherwise the PMS (or the rate engine) prices the stay.
37
+ attr_accessor :custom_price
38
+
39
+ # What the flags do not say: limits, required access, and why something is off.
40
+ attr_accessor :notes
41
+
42
+ # `sandbox` — run end to end on the vendor sandbox (Mews, Cloudbeds); `vendor_docs` — verified against the vendor's API documentation only. Null for direct bookings.
43
+ attr_accessor :verified_against
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'managed_by' => :'managedBy',
49
+ :'provider' => :'provider',
50
+ :'create' => :'create',
51
+ :'modify' => :'modify',
52
+ :'cancel' => :'cancel',
53
+ :'quote' => :'quote',
54
+ :'custom_price' => :'customPrice',
55
+ :'notes' => :'notes',
56
+ :'verified_against' => :'verifiedAgainst'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'managed_by' => :'String',
74
+ :'provider' => :'String',
75
+ :'create' => :'Boolean',
76
+ :'modify' => :'Boolean',
77
+ :'cancel' => :'Boolean',
78
+ :'quote' => :'Boolean',
79
+ :'custom_price' => :'Boolean',
80
+ :'notes' => :'String',
81
+ :'verified_against' => :'String'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ :'provider',
89
+ :'verified_against'
90
+ ])
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ def initialize(attributes = {})
96
+ if (!attributes.is_a?(Hash))
97
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ReservationCapabilities` initialize method"
98
+ end
99
+
100
+ # check to see if the attribute exists and convert string to symbol for hash key
101
+ acceptable_attribute_map = self.class.acceptable_attribute_map
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!acceptable_attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ReservationCapabilities`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'managed_by')
110
+ self.managed_by = attributes[:'managed_by']
111
+ end
112
+
113
+ if attributes.key?(:'provider')
114
+ self.provider = attributes[:'provider']
115
+ end
116
+
117
+ if attributes.key?(:'create')
118
+ self.create = attributes[:'create']
119
+ end
120
+
121
+ if attributes.key?(:'modify')
122
+ self.modify = attributes[:'modify']
123
+ end
124
+
125
+ if attributes.key?(:'cancel')
126
+ self.cancel = attributes[:'cancel']
127
+ end
128
+
129
+ if attributes.key?(:'quote')
130
+ self.quote = attributes[:'quote']
131
+ end
132
+
133
+ if attributes.key?(:'custom_price')
134
+ self.custom_price = attributes[:'custom_price']
135
+ end
136
+
137
+ if attributes.key?(:'notes')
138
+ self.notes = attributes[:'notes']
139
+ end
140
+
141
+ if attributes.key?(:'verified_against')
142
+ self.verified_against = attributes[:'verified_against']
143
+ end
144
+ end
145
+
146
+ # Show invalid properties with the reasons. Usually used together with valid?
147
+ # @return Array for valid properties with the reasons
148
+ def list_invalid_properties
149
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
150
+ invalid_properties = Array.new
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ warn '[DEPRECATED] the `valid?` method is obsolete'
158
+ true
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ managed_by == o.managed_by &&
167
+ provider == o.provider &&
168
+ create == o.create &&
169
+ modify == o.modify &&
170
+ cancel == o.cancel &&
171
+ quote == o.quote &&
172
+ custom_price == o.custom_price &&
173
+ notes == o.notes &&
174
+ verified_against == o.verified_against
175
+ end
176
+
177
+ # @see the `==` method
178
+ # @param [Object] Object to be compared
179
+ def eql?(o)
180
+ self == o
181
+ end
182
+
183
+ # Calculates hash code according to all attributes.
184
+ # @return [Integer] Hash code
185
+ def hash
186
+ [managed_by, provider, create, modify, cancel, quote, custom_price, notes, verified_against].hash
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def self.build_from_hash(attributes)
193
+ return nil unless attributes.is_a?(Hash)
194
+ attributes = attributes.transform_keys(&:to_sym)
195
+ transformed_hash = {}
196
+ openapi_types.each_pair do |key, type|
197
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = nil
199
+ elsif type =~ /\AArray<(.*)>/i
200
+ # check to ensure the input is an array given that the attribute
201
+ # is documented as an array but the input is not
202
+ if attributes[attribute_map[key]].is_a?(Array)
203
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
204
+ end
205
+ elsif !attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
207
+ end
208
+ end
209
+ new(transformed_hash)
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ if value.nil?
219
+ is_nullable = self.class.openapi_nullable.include?(attr)
220
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
+ end
222
+
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -14,6 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
+ # Which fields a listing takes depends on whether it is managed in a PMS — see the operation description and `GET /v1/listings/{id}` → `capabilities.reservations`. A field the listing cannot take is refused by name (`422 unsupported_field`), never dropped.
17
18
  class ReservationCreateRequest < ApiModelBase
18
19
  # Internal Repull property id — see `GET /v1/properties`.
19
20
  attr_accessor :listing_id
@@ -25,21 +26,41 @@ module Repull
25
26
 
26
27
  attr_accessor :guest
27
28
 
28
- # OTA platforms are deliberately absent — those reservations are owned by the channel and arrive through sync.
29
+ # OTA platforms are deliberately absent — those reservations are owned by the channel and arrive through sync. `owner` is refused on a PMS listing (block owner stays in the PMS).
29
30
  attr_accessor :platform
30
31
 
31
- # Lifecycle status to open the reservation in. Defaults to confirmed.
32
+ # `confirmed` (default) or `tentative` (an optional hold, where the PMS has one). On a listing not managed in a PMS the value is passed to the reservation pipeline as before.
32
33
  attr_accessor :status
33
34
 
35
+ attr_accessor :adults
36
+
37
+ attr_accessor :children
38
+
39
+ # Total guests. On a PMS listing without `adults`, used as the adult count.
40
+ attr_accessor :guest_count
41
+
42
+ # PMS listings only: the total for the whole stay, in the listing's currency. Honoured where `capabilities.reservations.customPrice` is true; omit it and the PMS prices the stay (from its quote where it has one). Refused on a listing not managed in a PMS, whose rate engine prices the stay.
43
+ attr_accessor :total_price
44
+
45
+ # PMS listings only: booking notes stored in the PMS.
46
+ attr_accessor :notes
47
+
48
+ # PMS listings only: book this unit (`GET /v1/listings/{id}` → `units[].id`). Refused by PMSs that cannot target a unit.
49
+ attr_accessor :unit_id
50
+
51
+ # PMS listings only: ask the PMS to email the guest its own confirmation, where the PMS supports it.
52
+ attr_accessor :send_confirmation_email
53
+
54
+ # Listings not managed in a PMS only.
34
55
  attr_accessor :check_in_time
35
56
 
57
+ # Listings not managed in a PMS only.
36
58
  attr_accessor :check_out_time
37
59
 
38
- # Attach an existing guest instead of matching/creating one. Must belong to this workspace.
60
+ # Listings not managed in a PMS only: attach an existing guest instead of matching/creating one. Must belong to this workspace.
39
61
  attr_accessor :guest_id
40
62
 
41
- attr_accessor :guest_count
42
-
63
+ # Listings not managed in a PMS only (a PMS books in the property's currency).
43
64
  attr_accessor :currency
44
65
 
45
66
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -51,10 +72,16 @@ module Repull
51
72
  :'guest' => :'guest',
52
73
  :'platform' => :'platform',
53
74
  :'status' => :'status',
75
+ :'adults' => :'adults',
76
+ :'children' => :'children',
77
+ :'guest_count' => :'guestCount',
78
+ :'total_price' => :'totalPrice',
79
+ :'notes' => :'notes',
80
+ :'unit_id' => :'unitId',
81
+ :'send_confirmation_email' => :'sendConfirmationEmail',
54
82
  :'check_in_time' => :'checkInTime',
55
83
  :'check_out_time' => :'checkOutTime',
56
84
  :'guest_id' => :'guestId',
57
- :'guest_count' => :'guestCount',
58
85
  :'currency' => :'currency'
59
86
  }
60
87
  end
@@ -78,10 +105,16 @@ module Repull
78
105
  :'guest' => :'ReservationGuestInput',
79
106
  :'platform' => :'String',
80
107
  :'status' => :'String',
108
+ :'adults' => :'Integer',
109
+ :'children' => :'Integer',
110
+ :'guest_count' => :'Integer',
111
+ :'total_price' => :'Float',
112
+ :'notes' => :'String',
113
+ :'unit_id' => :'String',
114
+ :'send_confirmation_email' => :'Boolean',
81
115
  :'check_in_time' => :'String',
82
116
  :'check_out_time' => :'String',
83
117
  :'guest_id' => :'Integer',
84
- :'guest_count' => :'Integer',
85
118
  :'currency' => :'String'
86
119
  }
87
120
  end
@@ -141,7 +174,35 @@ module Repull
141
174
  if attributes.key?(:'status')
142
175
  self.status = attributes[:'status']
143
176
  else
144
- self.status = 'accept'
177
+ self.status = 'confirmed'
178
+ end
179
+
180
+ if attributes.key?(:'adults')
181
+ self.adults = attributes[:'adults']
182
+ end
183
+
184
+ if attributes.key?(:'children')
185
+ self.children = attributes[:'children']
186
+ end
187
+
188
+ if attributes.key?(:'guest_count')
189
+ self.guest_count = attributes[:'guest_count']
190
+ end
191
+
192
+ if attributes.key?(:'total_price')
193
+ self.total_price = attributes[:'total_price']
194
+ end
195
+
196
+ if attributes.key?(:'notes')
197
+ self.notes = attributes[:'notes']
198
+ end
199
+
200
+ if attributes.key?(:'unit_id')
201
+ self.unit_id = attributes[:'unit_id']
202
+ end
203
+
204
+ if attributes.key?(:'send_confirmation_email')
205
+ self.send_confirmation_email = attributes[:'send_confirmation_email']
145
206
  end
146
207
 
147
208
  if attributes.key?(:'check_in_time')
@@ -156,10 +217,6 @@ module Repull
156
217
  self.guest_id = attributes[:'guest_id']
157
218
  end
158
219
 
159
- if attributes.key?(:'guest_count')
160
- self.guest_count = attributes[:'guest_count']
161
- end
162
-
163
220
  if attributes.key?(:'currency')
164
221
  self.currency = attributes[:'currency']
165
222
  end
@@ -186,6 +243,26 @@ module Repull
186
243
  invalid_properties.push('invalid value for "guest", guest cannot be nil.')
187
244
  end
188
245
 
246
+ if !@adults.nil? && @adults < 1
247
+ invalid_properties.push('invalid value for "adults", must be greater than or equal to 1.')
248
+ end
249
+
250
+ if !@children.nil? && @children < 0
251
+ invalid_properties.push('invalid value for "children", must be greater than or equal to 0.')
252
+ end
253
+
254
+ if !@guest_count.nil? && @guest_count < 1
255
+ invalid_properties.push('invalid value for "guest_count", must be greater than or equal to 1.')
256
+ end
257
+
258
+ if !@total_price.nil? && @total_price < 0
259
+ invalid_properties.push('invalid value for "total_price", must be greater than or equal to 0.')
260
+ end
261
+
262
+ if !@notes.nil? && @notes.to_s.length > 5000
263
+ invalid_properties.push('invalid value for "notes", the character length must be smaller than or equal to 5000.')
264
+ end
265
+
189
266
  pattern = Regexp.new(/^([01]\d|2[0-3]):[0-5]\d$/)
190
267
  if !@check_in_time.nil? && @check_in_time !~ pattern
191
268
  invalid_properties.push("invalid value for \"check_in_time\", must conform to the pattern #{pattern}.")
@@ -196,10 +273,6 @@ module Repull
196
273
  invalid_properties.push("invalid value for \"check_out_time\", must conform to the pattern #{pattern}.")
197
274
  end
198
275
 
199
- if !@guest_count.nil? && @guest_count < 1
200
- invalid_properties.push('invalid value for "guest_count", must be greater than or equal to 1.')
201
- end
202
-
203
276
  if !@currency.nil? && @currency.to_s.length > 3
204
277
  invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
205
278
  end
@@ -219,9 +292,13 @@ module Repull
219
292
  return false if @check_in.nil?
220
293
  return false if @check_out.nil?
221
294
  return false if @guest.nil?
295
+ return false if !@adults.nil? && @adults < 1
296
+ return false if !@children.nil? && @children < 0
297
+ return false if !@guest_count.nil? && @guest_count < 1
298
+ return false if !@total_price.nil? && @total_price < 0
299
+ return false if !@notes.nil? && @notes.to_s.length > 5000
222
300
  return false if !@check_in_time.nil? && @check_in_time !~ Regexp.new(/^([01]\d|2[0-3]):[0-5]\d$/)
223
301
  return false if !@check_out_time.nil? && @check_out_time !~ Regexp.new(/^([01]\d|2[0-3]):[0-5]\d$/)
224
- return false if !@guest_count.nil? && @guest_count < 1
225
302
  return false if !@currency.nil? && @currency.to_s.length > 3
226
303
  return false if !@currency.nil? && @currency.to_s.length < 3
227
304
  true
@@ -267,6 +344,76 @@ module Repull
267
344
  @guest = guest
268
345
  end
269
346
 
347
+ # Custom attribute writer method with validation
348
+ # @param [Object] adults Value to be assigned
349
+ def adults=(adults)
350
+ if adults.nil?
351
+ fail ArgumentError, 'adults cannot be nil'
352
+ end
353
+
354
+ if adults < 1
355
+ fail ArgumentError, 'invalid value for "adults", must be greater than or equal to 1.'
356
+ end
357
+
358
+ @adults = adults
359
+ end
360
+
361
+ # Custom attribute writer method with validation
362
+ # @param [Object] children Value to be assigned
363
+ def children=(children)
364
+ if children.nil?
365
+ fail ArgumentError, 'children cannot be nil'
366
+ end
367
+
368
+ if children < 0
369
+ fail ArgumentError, 'invalid value for "children", must be greater than or equal to 0.'
370
+ end
371
+
372
+ @children = children
373
+ end
374
+
375
+ # Custom attribute writer method with validation
376
+ # @param [Object] guest_count Value to be assigned
377
+ def guest_count=(guest_count)
378
+ if guest_count.nil?
379
+ fail ArgumentError, 'guest_count cannot be nil'
380
+ end
381
+
382
+ if guest_count < 1
383
+ fail ArgumentError, 'invalid value for "guest_count", must be greater than or equal to 1.'
384
+ end
385
+
386
+ @guest_count = guest_count
387
+ end
388
+
389
+ # Custom attribute writer method with validation
390
+ # @param [Object] total_price Value to be assigned
391
+ def total_price=(total_price)
392
+ if total_price.nil?
393
+ fail ArgumentError, 'total_price cannot be nil'
394
+ end
395
+
396
+ if total_price < 0
397
+ fail ArgumentError, 'invalid value for "total_price", must be greater than or equal to 0.'
398
+ end
399
+
400
+ @total_price = total_price
401
+ end
402
+
403
+ # Custom attribute writer method with validation
404
+ # @param [Object] notes Value to be assigned
405
+ def notes=(notes)
406
+ if notes.nil?
407
+ fail ArgumentError, 'notes cannot be nil'
408
+ end
409
+
410
+ if notes.to_s.length > 5000
411
+ fail ArgumentError, 'invalid value for "notes", the character length must be smaller than or equal to 5000.'
412
+ end
413
+
414
+ @notes = notes
415
+ end
416
+
270
417
  # Custom attribute writer method with validation
271
418
  # @param [Object] check_in_time Value to be assigned
272
419
  def check_in_time=(check_in_time)
@@ -297,20 +444,6 @@ module Repull
297
444
  @check_out_time = check_out_time
298
445
  end
299
446
 
300
- # Custom attribute writer method with validation
301
- # @param [Object] guest_count Value to be assigned
302
- def guest_count=(guest_count)
303
- if guest_count.nil?
304
- fail ArgumentError, 'guest_count cannot be nil'
305
- end
306
-
307
- if guest_count < 1
308
- fail ArgumentError, 'invalid value for "guest_count", must be greater than or equal to 1.'
309
- end
310
-
311
- @guest_count = guest_count
312
- end
313
-
314
447
  # Custom attribute writer method with validation
315
448
  # @param [Object] currency Value to be assigned
316
449
  def currency=(currency)
@@ -340,10 +473,16 @@ module Repull
340
473
  guest == o.guest &&
341
474
  platform == o.platform &&
342
475
  status == o.status &&
476
+ adults == o.adults &&
477
+ children == o.children &&
478
+ guest_count == o.guest_count &&
479
+ total_price == o.total_price &&
480
+ notes == o.notes &&
481
+ unit_id == o.unit_id &&
482
+ send_confirmation_email == o.send_confirmation_email &&
343
483
  check_in_time == o.check_in_time &&
344
484
  check_out_time == o.check_out_time &&
345
485
  guest_id == o.guest_id &&
346
- guest_count == o.guest_count &&
347
486
  currency == o.currency
348
487
  end
349
488
 
@@ -356,7 +495,7 @@ module Repull
356
495
  # Calculates hash code according to all attributes.
357
496
  # @return [Integer] Hash code
358
497
  def hash
359
- [listing_id, check_in, check_out, guest, platform, status, check_in_time, check_out_time, guest_id, guest_count, currency].hash
498
+ [listing_id, check_in, check_out, guest, platform, status, adults, children, guest_count, total_price, notes, unit_id, send_confirmation_email, check_in_time, check_out_time, guest_id, currency].hash
360
499
  end
361
500
 
362
501
  # Builds the object from hash
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Repull
17
17
  class ReservationCreateResponse < ApiModelBase
18
- # Pass to `GET /v1/reservations/{id}` for the full record.
18
+ # Pass to `GET /v1/reservations/{id}` for the full record. A string, like every id in API responses.
19
19
  attr_accessor :id
20
20
 
21
21
  attr_accessor :confirmation_code
@@ -33,7 +33,7 @@ module Repull
33
33
 
34
34
  attr_accessor :guest_id
35
35
 
36
- # The price the pricing engine derived for the stay. Reservations created through this endpoint are NOT priced from the request — see the operation description. On a Mews or Cloudbeds listing, the PMS prices it from its own rate.
36
+ # The total the booking was recorded at. On a PMS listing: the PMS's total (your `totalPrice` where the PMS honours one, else the PMS's own price). On any other listing: the price the rate engine derived (`0` when the listing has no rates for the range).
37
37
  attr_accessor :total_price
38
38
 
39
39
  attr_accessor :currency
@@ -73,18 +73,18 @@ module Repull
73
73
  # Attribute type mapping.
74
74
  def self.openapi_types
75
75
  {
76
- :'id' => :'Integer',
76
+ :'id' => :'String',
77
77
  :'confirmation_code' => :'String',
78
- :'listing_id' => :'Integer',
78
+ :'listing_id' => :'String',
79
79
  :'platform' => :'String',
80
80
  :'status' => :'String',
81
81
  :'check_in' => :'Date',
82
82
  :'check_out' => :'Date',
83
- :'guest_id' => :'Integer',
83
+ :'guest_id' => :'String',
84
84
  :'total_price' => :'Float',
85
85
  :'currency' => :'String',
86
86
  :'unit' => :'ReservationCreateResponseUnit',
87
- :'pms' => :'ReservationCreateResponsePms'
87
+ :'pms' => :'ReservationPmsOutcome'
88
88
  }
89
89
  end
90
90
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Mews or Cloudbeds listings only: the room the PMS assigned. Absent for every other listing.
17
+ # PMS listings: the unit the PMS assigned (hotel-model PMSs), or null. Absent for direct bookings.
18
18
  class ReservationCreateResponseUnit < ApiModelBase
19
19
  attr_accessor :id
20
20