repull 0.2.30 → 0.2.32

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +2 -2
  3. data/lib/repull/api/billing_api.rb +68 -9
  4. data/lib/repull/api/booking_com_api.rb +80 -0
  5. data/lib/repull/api/connect_api.rb +139 -0
  6. data/lib/repull/api/conversations_api.rb +5 -2
  7. data/lib/repull/api/health_api.rb +2 -2
  8. data/lib/repull/api/hotels_api.rb +142 -0
  9. data/lib/repull/api/transactions_api.rb +109 -0
  10. data/lib/repull/api/workspaces_api.rb +96 -0
  11. data/lib/repull/configuration.rb +0 -4
  12. data/lib/repull/models/availability_batch_write_request.rb +30 -1
  13. data/lib/repull/models/availability_write_request.rb +30 -1
  14. data/lib/repull/models/availability_write_settings.rb +33 -4
  15. data/lib/repull/models/connect_provider.rb +2 -2
  16. data/lib/repull/models/connect_session.rb +12 -2
  17. data/lib/repull/models/create_billing_checkout200_response.rb +156 -0
  18. data/lib/repull/models/create_billing_checkout_request.rb +2 -2
  19. data/lib/repull/models/create_connect_session_request.rb +13 -1
  20. data/lib/repull/models/create_connect_session_request_workspace.rb +1 -1
  21. data/lib/repull/models/get_billing200_response.rb +183 -0
  22. data/lib/repull/models/get_billing200_response_limits.rb +160 -0
  23. data/lib/repull/models/get_billing200_response_used.rb +156 -0
  24. data/lib/repull/models/get_channel_health200_response_vrbo.rb +11 -1
  25. data/lib/repull/models/get_hotel200_response.rb +252 -0
  26. data/lib/repull/models/get_hotel200_response_room_types_inner.rb +168 -0
  27. data/lib/repull/models/get_usage_summary200_response.rb +10 -1
  28. data/lib/repull/models/get_usage_summary200_response_credits.rb +186 -0
  29. data/lib/repull/models/list_booking_transactions200_response.rb +158 -0
  30. data/lib/repull/models/list_hotels200_response.rb +158 -0
  31. data/lib/repull/models/list_hotels200_response_data_inner.rb +241 -0
  32. data/lib/repull/models/list_workspaces200_response.rb +158 -0
  33. data/lib/repull/models/listing.rb +50 -1
  34. data/lib/repull/models/listing_hotel.rb +202 -0
  35. data/lib/repull/models/record_account.rb +15 -5
  36. data/lib/repull/models/reservation.rb +45 -1
  37. data/lib/repull/models/reservation_message_received_payload.rb +12 -1
  38. data/lib/repull/models/reservation_message_sent_payload.rb +12 -1
  39. data/lib/repull/models/reservation_message_updated_payload.rb +12 -1
  40. data/lib/repull/models/reservation_webhook_object.rb +49 -5
  41. data/lib/repull/models/select_provider_response.rb +1 -1
  42. data/lib/repull/models/transaction.rb +349 -0
  43. data/lib/repull/models/transaction_fees.rb +176 -0
  44. data/lib/repull/models/transaction_payout.rb +198 -0
  45. data/lib/repull/models/workspace.rb +265 -0
  46. data/lib/repull/version.rb +1 -1
  47. data/lib/repull.rb +19 -0
  48. data/openapi/v1.json +1008 -18
  49. metadata +21 -2
@@ -0,0 +1,202 @@
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` | unlimited (10 included, then billed per listing) | | `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
+ # The hotel the listing belongs to: a hotel PMS hotel (Cloudbeds, Mews) or a Booking.com property with several room types or rooms. `null` for a standalone home. `GET /v1/hotels/{id}` lists its room types.
18
+ class ListingHotel < ApiModelBase
19
+ # A Repull hotel id, or `booking:<hotelId>` for a Booking.com property.
20
+ attr_accessor :id
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :source
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'id' => :'id',
52
+ :'name' => :'name',
53
+ :'source' => :'source'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'id' => :'String',
71
+ :'name' => :'String',
72
+ :'source' => :'String'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ :'name',
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingHotel` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingHotel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'id')
100
+ self.id = attributes[:'id']
101
+ end
102
+
103
+ if attributes.key?(:'name')
104
+ self.name = attributes[:'name']
105
+ end
106
+
107
+ if attributes.key?(:'source')
108
+ self.source = attributes[:'source']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ source_validator = EnumAttributeValidator.new('String', ["pms", "booking"])
125
+ return false unless source_validator.valid?(@source)
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method checking allowed values (enum).
130
+ # @param [Object] source Object to be assigned
131
+ def source=(source)
132
+ validator = EnumAttributeValidator.new('String', ["pms", "booking"])
133
+ unless validator.valid?(source)
134
+ fail ArgumentError, "invalid value for \"source\", must be one of #{validator.allowable_values}."
135
+ end
136
+ @source = source
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ id == o.id &&
145
+ name == o.name &&
146
+ source == o.source
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [id, name, source].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ end
201
+
202
+ end
@@ -25,12 +25,16 @@ module Repull
25
25
  # Repull connection id (`X-Account-Id`), when the account has one. A string, like every id in API responses.
26
26
  attr_accessor :connection_id
27
27
 
28
+ # Booking.com only: the hotel (property) id the record belongs to. On a `booking_extranet` account, `externalAccountId` is the login, which can cover several hotels.
29
+ attr_accessor :hotel_id
30
+
28
31
  # Attribute mapping from ruby-style variable name to JSON key.
29
32
  def self.attribute_map
30
33
  {
31
34
  :'provider' => :'provider',
32
35
  :'external_account_id' => :'externalAccountId',
33
- :'connection_id' => :'connectionId'
36
+ :'connection_id' => :'connectionId',
37
+ :'hotel_id' => :'hotelId'
34
38
  }
35
39
  end
36
40
 
@@ -49,14 +53,15 @@ module Repull
49
53
  {
50
54
  :'provider' => :'String',
51
55
  :'external_account_id' => :'String',
52
- :'connection_id' => :'String'
56
+ :'connection_id' => :'String',
57
+ :'hotel_id' => :'String'
53
58
  }
54
59
  end
55
60
 
56
61
  # List of attributes with nullable: true
57
62
  def self.openapi_nullable
58
63
  Set.new([
59
- :'connection_id'
64
+ :'connection_id',
60
65
  ])
61
66
  end
62
67
 
@@ -87,6 +92,10 @@ module Repull
87
92
  if attributes.key?(:'connection_id')
88
93
  self.connection_id = attributes[:'connection_id']
89
94
  end
95
+
96
+ if attributes.key?(:'hotel_id')
97
+ self.hotel_id = attributes[:'hotel_id']
98
+ end
90
99
  end
91
100
 
92
101
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -111,7 +120,8 @@ module Repull
111
120
  self.class == o.class &&
112
121
  provider == o.provider &&
113
122
  external_account_id == o.external_account_id &&
114
- connection_id == o.connection_id
123
+ connection_id == o.connection_id &&
124
+ hotel_id == o.hotel_id
115
125
  end
116
126
 
117
127
  # @see the `==` method
@@ -123,7 +133,7 @@ module Repull
123
133
  # Calculates hash code according to all attributes.
124
134
  # @return [Integer] Hash code
125
135
  def hash
126
- [provider, external_account_id, connection_id].hash
136
+ [provider, external_account_id, connection_id, hotel_id].hash
127
137
  end
128
138
 
129
139
  # Builds the object from hash
@@ -38,6 +38,18 @@ module Repull
38
38
  # Local check-out time for this stay, `HH:MM` on a 24-hour clock in the property's own timezone. Pair with `checkOut` to schedule the turnover clean. `null` when unknown. This is the same field `PATCH /v1/reservations/{id}` writes.
39
39
  attr_accessor :check_out_time
40
40
 
41
+ # What the guest wrote with the booking, as the channel sent it. Booking.com puts the estimated arrival time and special requests here. Free text, never parsed. `null` when the guest left none.
42
+ attr_accessor :guest_notes
43
+
44
+ # The conversation with this guest — pass it to `GET /v1/conversations/{id}` and `/v1/conversations/{id}/messages`. It is the same conversation from inquiry through pre-approval to the confirmed booking, and the same id the message webhooks carry, so a booking links straight to the messages that led to it. `null` when the channel has no conversation for this booking.
45
+ attr_accessor :conversation_id
46
+
47
+ # The channel's own id for that conversation (Airbnb thread id, Booking.com conversation id, …). `null` when there is none.
48
+ attr_accessor :external_thread_id
49
+
50
+ # The inquiry this booking came from (`GET /v1/inquiries`), when the guest asked before booking. When an inquiry turns into a booking, `inquiry.updated` fires with `status: \"booked\"` and this reservation's id. `null` for bookings with no inquiry.
51
+ attr_accessor :inquiry_id
52
+
41
53
  # Lifecycle status. The API normalises a multi-decade internal taxonomy down to these four buckets, so the value you receive is always one of the enum constants. `completed` is derived from `checkOut < today`. A `pending` booking request the channel already let lapse — Airbnb expires an unanswered request 24 hours after the guest asks, and no request can be answered once its check-in has passed — is reported as `cancelled` with `statusDetail: \"request_expired\"`, even when the channel never told us. Every `cancelled` reservation says how it ended in `statusDetail` when the channel tells us.
42
54
  attr_accessor :status
43
55
 
@@ -102,6 +114,10 @@ module Repull
102
114
  :'check_out' => :'checkOut',
103
115
  :'check_in_time' => :'checkInTime',
104
116
  :'check_out_time' => :'checkOutTime',
117
+ :'guest_notes' => :'guestNotes',
118
+ :'conversation_id' => :'conversationId',
119
+ :'external_thread_id' => :'externalThreadId',
120
+ :'inquiry_id' => :'inquiryId',
105
121
  :'status' => :'status',
106
122
  :'status_detail' => :'statusDetail',
107
123
  :'pending_reason' => :'pendingReason',
@@ -144,6 +160,10 @@ module Repull
144
160
  :'check_out' => :'Date',
145
161
  :'check_in_time' => :'String',
146
162
  :'check_out_time' => :'String',
163
+ :'guest_notes' => :'String',
164
+ :'conversation_id' => :'String',
165
+ :'external_thread_id' => :'String',
166
+ :'inquiry_id' => :'String',
147
167
  :'status' => :'String',
148
168
  :'status_detail' => :'String',
149
169
  :'pending_reason' => :'String',
@@ -171,6 +191,10 @@ module Repull
171
191
  :'account',
172
192
  :'check_in_time',
173
193
  :'check_out_time',
194
+ :'guest_notes',
195
+ :'conversation_id',
196
+ :'external_thread_id',
197
+ :'inquiry_id',
174
198
  :'source',
175
199
  :'platform',
176
200
  :'unit',
@@ -235,6 +259,22 @@ module Repull
235
259
  self.check_out_time = attributes[:'check_out_time']
236
260
  end
237
261
 
262
+ if attributes.key?(:'guest_notes')
263
+ self.guest_notes = attributes[:'guest_notes']
264
+ end
265
+
266
+ if attributes.key?(:'conversation_id')
267
+ self.conversation_id = attributes[:'conversation_id']
268
+ end
269
+
270
+ if attributes.key?(:'external_thread_id')
271
+ self.external_thread_id = attributes[:'external_thread_id']
272
+ end
273
+
274
+ if attributes.key?(:'inquiry_id')
275
+ self.inquiry_id = attributes[:'inquiry_id']
276
+ end
277
+
238
278
  if attributes.key?(:'status')
239
279
  self.status = attributes[:'status']
240
280
  else
@@ -466,6 +506,10 @@ module Repull
466
506
  check_out == o.check_out &&
467
507
  check_in_time == o.check_in_time &&
468
508
  check_out_time == o.check_out_time &&
509
+ guest_notes == o.guest_notes &&
510
+ conversation_id == o.conversation_id &&
511
+ external_thread_id == o.external_thread_id &&
512
+ inquiry_id == o.inquiry_id &&
469
513
  status == o.status &&
470
514
  status_detail == o.status_detail &&
471
515
  pending_reason == o.pending_reason &&
@@ -495,7 +539,7 @@ module Repull
495
539
  # Calculates hash code according to all attributes.
496
540
  # @return [Integer] Hash code
497
541
  def hash
498
- [account, id, listing_id, guest_id, check_in, check_out, check_in_time, check_out_time, status, status_detail, pending_reason, respond_by, source, platform, confirmation_code, unit, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
542
+ [account, id, listing_id, guest_id, check_in, check_out, check_in_time, check_out_time, guest_notes, conversation_id, external_thread_id, inquiry_id, status, status_detail, pending_reason, respond_by, source, platform, confirmation_code, unit, primary_guest, occupancy, financials, total_price, currency, guest_details, created_at, updated_at, booked_at, guest_name].hash
499
543
  end
500
544
 
501
545
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Repull
17
17
  # Payload for `reservation.message.received`. A new inbound message arrived on a reservation thread.
18
18
  class ReservationMessageReceivedPayload < ApiModelBase
19
+ # Booking.com only: the hotel (property) id of the conversation's listing. Absent on other channels. A Booking.com Extranet login can cover several hotels, so use this to route the message.
20
+ attr_accessor :hotel_id
21
+
19
22
  attr_accessor :reservation_id
20
23
 
21
24
  attr_accessor :thread_id
@@ -33,6 +36,7 @@ module Repull
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
34
37
  def self.attribute_map
35
38
  {
39
+ :'hotel_id' => :'hotelId',
36
40
  :'reservation_id' => :'reservationId',
37
41
  :'thread_id' => :'threadId',
38
42
  :'from' => :'from',
@@ -55,6 +59,7 @@ module Repull
55
59
  # Attribute type mapping.
56
60
  def self.openapi_types
57
61
  {
62
+ :'hotel_id' => :'String',
58
63
  :'reservation_id' => :'Integer',
59
64
  :'thread_id' => :'String',
60
65
  :'from' => :'ReservationMessageReceivedPayloadFrom',
@@ -67,6 +72,7 @@ module Repull
67
72
  # List of attributes with nullable: true
68
73
  def self.openapi_nullable
69
74
  Set.new([
75
+ :'hotel_id',
70
76
  ])
71
77
  end
72
78
 
@@ -86,6 +92,10 @@ module Repull
86
92
  h[k.to_sym] = v
87
93
  }
88
94
 
95
+ if attributes.key?(:'hotel_id')
96
+ self.hotel_id = attributes[:'hotel_id']
97
+ end
98
+
89
99
  if attributes.key?(:'reservation_id')
90
100
  self.reservation_id = attributes[:'reservation_id']
91
101
  end
@@ -133,6 +143,7 @@ module Repull
133
143
  def ==(o)
134
144
  return true if self.equal?(o)
135
145
  self.class == o.class &&
146
+ hotel_id == o.hotel_id &&
136
147
  reservation_id == o.reservation_id &&
137
148
  thread_id == o.thread_id &&
138
149
  from == o.from &&
@@ -150,7 +161,7 @@ module Repull
150
161
  # Calculates hash code according to all attributes.
151
162
  # @return [Integer] Hash code
152
163
  def hash
153
- [reservation_id, thread_id, from, body, sent_at, attachments].hash
164
+ [hotel_id, reservation_id, thread_id, from, body, sent_at, attachments].hash
154
165
  end
155
166
 
156
167
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Repull
17
17
  # Payload for `reservation.message.sent`: a host-side message was sent on a reservation thread. Same fields as `reservation.message.received`, plus `source`.
18
18
  class ReservationMessageSentPayload < ApiModelBase
19
+ # Booking.com only: the hotel (property) id of the conversation's listing. Absent on other channels. A Booking.com Extranet login can cover several hotels, so use this to route the message.
20
+ attr_accessor :hotel_id
21
+
19
22
  attr_accessor :reservation_id
20
23
 
21
24
  attr_accessor :thread_id
@@ -48,6 +51,7 @@ module Repull
48
51
  # Attribute mapping from ruby-style variable name to JSON key.
49
52
  def self.attribute_map
50
53
  {
54
+ :'hotel_id' => :'hotelId',
51
55
  :'reservation_id' => :'reservationId',
52
56
  :'thread_id' => :'threadId',
53
57
  :'message_id' => :'messageId',
@@ -77,6 +81,7 @@ module Repull
77
81
  # Attribute type mapping.
78
82
  def self.openapi_types
79
83
  {
84
+ :'hotel_id' => :'String',
80
85
  :'reservation_id' => :'Integer',
81
86
  :'thread_id' => :'String',
82
87
  :'message_id' => :'String',
@@ -96,6 +101,7 @@ module Repull
96
101
  # List of attributes with nullable: true
97
102
  def self.openapi_nullable
98
103
  Set.new([
104
+ :'hotel_id',
99
105
  :'reservation_id',
100
106
  :'external_message_id',
101
107
  ])
@@ -117,6 +123,10 @@ module Repull
117
123
  h[k.to_sym] = v
118
124
  }
119
125
 
126
+ if attributes.key?(:'hotel_id')
127
+ self.hotel_id = attributes[:'hotel_id']
128
+ end
129
+
120
130
  if attributes.key?(:'reservation_id')
121
131
  self.reservation_id = attributes[:'reservation_id']
122
132
  end
@@ -192,6 +202,7 @@ module Repull
192
202
  def ==(o)
193
203
  return true if self.equal?(o)
194
204
  self.class == o.class &&
205
+ hotel_id == o.hotel_id &&
195
206
  reservation_id == o.reservation_id &&
196
207
  thread_id == o.thread_id &&
197
208
  message_id == o.message_id &&
@@ -216,7 +227,7 @@ module Repull
216
227
  # Calculates hash code according to all attributes.
217
228
  # @return [Integer] Hash code
218
229
  def hash
219
- [reservation_id, thread_id, message_id, external_message_id, channel, source, from, body, sent_at, direction, is_automated, ai_generated, attachments].hash
230
+ [hotel_id, reservation_id, thread_id, message_id, external_message_id, channel, source, from, body, sent_at, direction, is_automated, ai_generated, attachments].hash
220
231
  end
221
232
 
222
233
  # Builds the object from hash
@@ -16,6 +16,9 @@ require 'time'
16
16
  module Repull
17
17
  # Payload for `reservation.message.updated`: a message was edited on the channel. `body` is the new text; `previousBody` what it replaced. Read receipts and reactions do not fire it.
18
18
  class ReservationMessageUpdatedPayload < ApiModelBase
19
+ # Booking.com only: the hotel (property) id of the conversation's listing. Absent on other channels. A Booking.com Extranet login can cover several hotels, so use this to route the message.
20
+ attr_accessor :hotel_id
21
+
19
22
  attr_accessor :reservation_id
20
23
 
21
24
  attr_accessor :thread_id
@@ -45,6 +48,7 @@ module Repull
45
48
  # Attribute mapping from ruby-style variable name to JSON key.
46
49
  def self.attribute_map
47
50
  {
51
+ :'hotel_id' => :'hotelId',
48
52
  :'reservation_id' => :'reservationId',
49
53
  :'thread_id' => :'threadId',
50
54
  :'message_id' => :'messageId',
@@ -72,6 +76,7 @@ module Repull
72
76
  # Attribute type mapping.
73
77
  def self.openapi_types
74
78
  {
79
+ :'hotel_id' => :'String',
75
80
  :'reservation_id' => :'Integer',
76
81
  :'thread_id' => :'String',
77
82
  :'message_id' => :'String',
@@ -89,6 +94,7 @@ module Repull
89
94
  # List of attributes with nullable: true
90
95
  def self.openapi_nullable
91
96
  Set.new([
97
+ :'hotel_id',
92
98
  :'reservation_id',
93
99
  :'external_message_id',
94
100
  ])
@@ -110,6 +116,10 @@ module Repull
110
116
  h[k.to_sym] = v
111
117
  }
112
118
 
119
+ if attributes.key?(:'hotel_id')
120
+ self.hotel_id = attributes[:'hotel_id']
121
+ end
122
+
113
123
  if attributes.key?(:'reservation_id')
114
124
  self.reservation_id = attributes[:'reservation_id']
115
125
  end
@@ -175,6 +185,7 @@ module Repull
175
185
  def ==(o)
176
186
  return true if self.equal?(o)
177
187
  self.class == o.class &&
188
+ hotel_id == o.hotel_id &&
178
189
  reservation_id == o.reservation_id &&
179
190
  thread_id == o.thread_id &&
180
191
  message_id == o.message_id &&
@@ -197,7 +208,7 @@ module Repull
197
208
  # Calculates hash code according to all attributes.
198
209
  # @return [Integer] Hash code
199
210
  def hash
200
- [reservation_id, thread_id, message_id, external_message_id, channel, from, body, previous_body, edited_at, sent_at, direction].hash
211
+ [hotel_id, reservation_id, thread_id, message_id, external_message_id, channel, from, body, previous_body, edited_at, sent_at, direction].hash
201
212
  end
202
213
 
203
214
  # Builds the object from hash
@@ -49,6 +49,18 @@ module Repull
49
49
  # Local check-out time, `HH:MM` on a 24-hour clock in the property's own timezone. Pair it with `checkoutDate` to schedule the turnover. `null` when unknown.
50
50
  attr_accessor :check_out_time
51
51
 
52
+ # What the guest wrote with the booking — on Booking.com, the estimated arrival time and special requests. Free text. `null` when there were none.
53
+ attr_accessor :guest_notes
54
+
55
+ # The conversation with this guest — pass it to `GET /v1/conversations/{id}` and `/v1/conversations/{id}/messages`. It is the same conversation from inquiry through pre-approval to the confirmed booking, and the same id the message webhooks carry, so a booking links straight to the messages that led to it. `null` when the channel has no conversation for this booking.
56
+ attr_accessor :conversation_id
57
+
58
+ # The channel's own id for that conversation (Airbnb thread id, Booking.com conversation id, …). `null` when there is none.
59
+ attr_accessor :external_thread_id
60
+
61
+ # The inquiry this booking came from (`GET /v1/inquiries`), when the guest asked before booking. When an inquiry turns into a booking, `inquiry.updated` fires with `status: \"booked\"` and this reservation's id. `null` for bookings with no inquiry.
62
+ attr_accessor :inquiry_id
63
+
52
64
  # Attribute mapping from ruby-style variable name to JSON key.
53
65
  def self.attribute_map
54
66
  {
@@ -62,7 +74,11 @@ module Repull
62
74
  :'status' => :'status',
63
75
  :'cancellation_policy' => :'cancellationPolicy',
64
76
  :'check_in_time' => :'checkInTime',
65
- :'check_out_time' => :'checkOutTime'
77
+ :'check_out_time' => :'checkOutTime',
78
+ :'guest_notes' => :'guestNotes',
79
+ :'conversation_id' => :'conversationId',
80
+ :'external_thread_id' => :'externalThreadId',
81
+ :'inquiry_id' => :'inquiryId'
66
82
  }
67
83
  end
68
84
 
@@ -89,7 +105,11 @@ module Repull
89
105
  :'status' => :'String',
90
106
  :'cancellation_policy' => :'String',
91
107
  :'check_in_time' => :'String',
92
- :'check_out_time' => :'String'
108
+ :'check_out_time' => :'String',
109
+ :'guest_notes' => :'String',
110
+ :'conversation_id' => :'String',
111
+ :'external_thread_id' => :'String',
112
+ :'inquiry_id' => :'String'
93
113
  }
94
114
  end
95
115
 
@@ -98,7 +118,11 @@ module Repull
98
118
  Set.new([
99
119
  :'cancellation_policy',
100
120
  :'check_in_time',
101
- :'check_out_time'
121
+ :'check_out_time',
122
+ :'guest_notes',
123
+ :'conversation_id',
124
+ :'external_thread_id',
125
+ :'inquiry_id'
102
126
  ])
103
127
  end
104
128
 
@@ -177,6 +201,22 @@ module Repull
177
201
  if attributes.key?(:'check_out_time')
178
202
  self.check_out_time = attributes[:'check_out_time']
179
203
  end
204
+
205
+ if attributes.key?(:'guest_notes')
206
+ self.guest_notes = attributes[:'guest_notes']
207
+ end
208
+
209
+ if attributes.key?(:'conversation_id')
210
+ self.conversation_id = attributes[:'conversation_id']
211
+ end
212
+
213
+ if attributes.key?(:'external_thread_id')
214
+ self.external_thread_id = attributes[:'external_thread_id']
215
+ end
216
+
217
+ if attributes.key?(:'inquiry_id')
218
+ self.inquiry_id = attributes[:'inquiry_id']
219
+ end
180
220
  end
181
221
 
182
222
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -329,7 +369,11 @@ module Repull
329
369
  status == o.status &&
330
370
  cancellation_policy == o.cancellation_policy &&
331
371
  check_in_time == o.check_in_time &&
332
- check_out_time == o.check_out_time
372
+ check_out_time == o.check_out_time &&
373
+ guest_notes == o.guest_notes &&
374
+ conversation_id == o.conversation_id &&
375
+ external_thread_id == o.external_thread_id &&
376
+ inquiry_id == o.inquiry_id
333
377
  end
334
378
 
335
379
  # @see the `==` method
@@ -341,7 +385,7 @@ module Repull
341
385
  # Calculates hash code according to all attributes.
342
386
  # @return [Integer] Hash code
343
387
  def hash
344
- [id, uid, channel, listing_id, customer_id, checkin_date, checkout_date, status, cancellation_policy, check_in_time, check_out_time].hash
388
+ [id, uid, channel, listing_id, customer_id, checkin_date, checkout_date, status, cancellation_policy, check_in_time, check_out_time, guest_notes, conversation_id, external_thread_id, inquiry_id].hash
345
389
  end
346
390
 
347
391
  # Builds the object from hash
@@ -22,7 +22,7 @@ module Repull
22
22
 
23
23
  attr_accessor :pattern
24
24
 
25
- # Where to send the user next — OAuth consent, credentials form, activation checklist, or claim form.
25
+ # Where to send the user next — OAuth consent, credentials form, activation checklist, claim form, or (for a `request-only` PMS) the request form.
26
26
  attr_accessor :next_url
27
27
 
28
28
  # Attribute mapping from ruby-style variable name to JSON key.