repull 0.2.33 → 0.2.35

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +4 -4
  3. data/lib/repull/api/health_api.rb +3 -3
  4. data/lib/repull/api/promotions_api.rb +574 -0
  5. data/lib/repull/models/connect_session_completed_payload.rb +1 -1
  6. data/lib/repull/models/connect_status_accounts_inner.rb +12 -1
  7. data/lib/repull/models/create_connect_session_request.rb +25 -1
  8. data/lib/repull/models/create_connection_request.rb +2 -22
  9. data/lib/repull/models/list_connection_units200_response.rb +12 -1
  10. data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -0
  11. data/lib/repull/models/listing_address.rb +62 -5
  12. data/lib/repull/models/listing_updated_payload.rb +2 -2
  13. data/lib/repull/models/message.rb +24 -1
  14. data/lib/repull/models/postal_address.rb +216 -0
  15. data/lib/repull/models/promotion.rb +344 -0
  16. data/lib/repull/models/promotion_applies_to.rb +161 -0
  17. data/lib/repull/models/promotion_bulk_request.rb +236 -0
  18. data/lib/repull/models/{plumguide_listing_list_response.rb → promotion_bulk_response.rb} +11 -11
  19. data/lib/repull/models/{calendar_updated_payload.rb → promotion_bulk_response_data_inner.rb} +23 -33
  20. data/lib/repull/models/promotion_bulk_response_data_inner_error.rb +165 -0
  21. data/lib/repull/models/promotion_bulk_response_summary.rb +156 -0
  22. data/lib/repull/models/{plumguide_listing.rb → promotion_catalog.rb} +18 -27
  23. data/lib/repull/models/promotion_catalog_channels_inner.rb +222 -0
  24. data/lib/repull/models/promotion_catalog_entry.rb +265 -0
  25. data/lib/repull/models/promotion_catalog_field.rb +205 -0
  26. data/lib/repull/models/{calendar_updated_payload_range.rb → promotion_catalog_field_options_inner.rb} +16 -16
  27. data/lib/repull/models/promotion_catalog_response.rb +147 -0
  28. data/lib/repull/models/promotion_create_request.rb +258 -0
  29. data/lib/repull/models/promotion_delete_response.rb +147 -0
  30. data/lib/repull/models/promotion_delete_response_data.rb +156 -0
  31. data/lib/repull/models/promotion_discount.rb +191 -0
  32. data/lib/repull/models/promotion_input.rb +241 -0
  33. data/lib/repull/models/promotion_list_response.rb +170 -0
  34. data/lib/repull/models/promotion_refresh_response.rb +170 -0
  35. data/lib/repull/models/promotion_response.rb +147 -0
  36. data/lib/repull/models/{calendar_updated_event.rb → promotion_rules.rb} +113 -104
  37. data/lib/repull/models/promotion_rules_blackout_dates_quota.rb +156 -0
  38. data/lib/repull/models/promotion_rules_booking_window.rb +230 -0
  39. data/lib/repull/models/promotion_rules_last_minute.rb +218 -0
  40. data/lib/repull/models/promotion_rules_stay_window.rb +211 -0
  41. data/lib/repull/models/promotion_type.rb +47 -0
  42. data/lib/repull/models/promotion_update_request.rb +175 -0
  43. data/lib/repull/models/promotion_usage.rb +193 -0
  44. data/lib/repull/models/promotion_usage_revenue.rb +156 -0
  45. data/lib/repull/models/property.rb +12 -2
  46. data/lib/repull/models/reservation_money_line.rb +14 -4
  47. data/lib/repull/models/webhook_event.rb +0 -2
  48. data/lib/repull/models/webhook_event_type.rb +1 -2
  49. data/lib/repull/version.rb +1 -1
  50. data/lib/repull.rb +32 -6
  51. data/openapi/v1.json +1193 -357
  52. data/scripts/regen.sh +1 -1
  53. metadata +34 -8
  54. data/lib/repull/api/plumguide_api.rb +0 -552
@@ -24,6 +24,9 @@ module Repull
24
24
  # Airbnb — how many months of past reservations the first import pulls (1–60). Omit it for the default window. Upcoming stays are always imported. A wider window takes longer to import, because every extra month is more stays to fetch.
25
25
  attr_accessor :reservation_history_months
26
26
 
27
+ # Where the channel's units get linked to listings. `hosted` (default): after a Vrbo or Booking.com Extranet sign-in, Connect shows a mapping step and returns to `redirectUrl` when it's confirmed. `api`: Connect skips that step and finishes right after sign-in. The connection reaches you in the `connect.session.completed` webhook (and as `connectionId` in the popup message), its handle is `vrbo:{connectionId}` or `booking_extranet:{connectionId}`; you list the units with `GET /v1/connections/{id}/units` and link them with `POST /v1/connections/{id}/mappings`. Nothing is imported until you post the mappings. Other providers ignore it.
28
+ attr_accessor :mapping
29
+
27
30
  # 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`).
28
31
  attr_accessor :access_type
29
32
 
@@ -74,6 +77,7 @@ module Repull
74
77
  :'redirect_url' => :'redirectUrl',
75
78
  :'state' => :'state',
76
79
  :'reservation_history_months' => :'reservationHistoryMonths',
80
+ :'mapping' => :'mapping',
77
81
  :'access_type' => :'accessType',
78
82
  :'allowed_providers' => :'allowedProviders',
79
83
  :'include_request_only' => :'includeRequestOnly',
@@ -101,6 +105,7 @@ module Repull
101
105
  :'redirect_url' => :'String',
102
106
  :'state' => :'String',
103
107
  :'reservation_history_months' => :'Integer',
108
+ :'mapping' => :'String',
104
109
  :'access_type' => :'String',
105
110
  :'allowed_providers' => :'Array<String>',
106
111
  :'include_request_only' => :'Boolean',
@@ -151,6 +156,12 @@ module Repull
151
156
  self.reservation_history_months = attributes[:'reservation_history_months']
152
157
  end
153
158
 
159
+ if attributes.key?(:'mapping')
160
+ self.mapping = attributes[:'mapping']
161
+ else
162
+ self.mapping = 'hosted'
163
+ end
164
+
154
165
  if attributes.key?(:'access_type')
155
166
  self.access_type = attributes[:'access_type']
156
167
  end
@@ -219,6 +230,8 @@ module Repull
219
230
  return false if @redirect_url.nil?
220
231
  return false if !@reservation_history_months.nil? && @reservation_history_months > 60
221
232
  return false if !@reservation_history_months.nil? && @reservation_history_months < 1
233
+ mapping_validator = EnumAttributeValidator.new('String', ["hosted", "api"])
234
+ return false unless mapping_validator.valid?(@mapping)
222
235
  access_type_validator = EnumAttributeValidator.new('String', ["full_access", "messaging", "read_only"])
223
236
  return false unless access_type_validator.valid?(@access_type)
224
237
  purpose_validator = EnumAttributeValidator.new('String', ["connect", "migrate"])
@@ -254,6 +267,16 @@ module Repull
254
267
  @reservation_history_months = reservation_history_months
255
268
  end
256
269
 
270
+ # Custom attribute writer method checking allowed values (enum).
271
+ # @param [Object] mapping Object to be assigned
272
+ def mapping=(mapping)
273
+ validator = EnumAttributeValidator.new('String', ["hosted", "api"])
274
+ unless validator.valid?(mapping)
275
+ fail ArgumentError, "invalid value for \"mapping\", must be one of #{validator.allowable_values}."
276
+ end
277
+ @mapping = mapping
278
+ end
279
+
257
280
  # Custom attribute writer method checking allowed values (enum).
258
281
  # @param [Object] access_type Object to be assigned
259
282
  def access_type=(access_type)
@@ -282,6 +305,7 @@ module Repull
282
305
  redirect_url == o.redirect_url &&
283
306
  state == o.state &&
284
307
  reservation_history_months == o.reservation_history_months &&
308
+ mapping == o.mapping &&
285
309
  access_type == o.access_type &&
286
310
  allowed_providers == o.allowed_providers &&
287
311
  include_request_only == o.include_request_only &&
@@ -301,7 +325,7 @@ module Repull
301
325
  # Calculates hash code according to all attributes.
302
326
  # @return [Integer] Hash code
303
327
  def hash
304
- [redirect_url, state, reservation_history_months, access_type, allowed_providers, include_request_only, locale, purpose, workspace, copy, scope].hash
328
+ [redirect_url, state, reservation_history_months, mapping, access_type, allowed_providers, include_request_only, locale, purpose, workspace, copy, scope].hash
305
329
  end
306
330
 
307
331
  # Builds the object from hash
@@ -19,7 +19,7 @@ module Repull
19
19
  # Airbnb + Booking.com — where to redirect the user after they finish the hosted connect flow.
20
20
  attr_accessor :redirect_url
21
21
 
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.
22
+ # Airbnb only — selects the OAuth scope set. 'read_only' grants read-only scopes; 'messaging' (shown to hosts as \"Messaging & reviews\") grants read scopes plus message read/send and review writes (reply to guest reviews, submit host reviews — Airbnb's reviews_write) but NOT property management, so it can coexist with another app (e.g. an existing PMS) that already holds property management on the same Airbnb account; 'full_access' (default) grants full host scopes including the exclusive property management (only one app per Airbnb account can hold it). The hosted consent screen normally lets the host pick a tier; passing `accessType` explicitly fixes the tier and hides that choice, so the host can only continue with the tier you requested. Omit it to let the host choose.
23
23
  attr_accessor :access_type
24
24
 
25
25
  # Airbnb — how many months of past reservations the first import pulls (1–60). Omit it for the default window. Upcoming stays are always imported. A wider window takes longer to import, because every extra month is more stays to fetch.
@@ -28,12 +28,6 @@ module Repull
28
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.
29
29
  attr_accessor :state
30
30
 
31
- # Plumguide — client ID.
32
- attr_accessor :client_id
33
-
34
- # Plumguide — client secret.
35
- attr_accessor :client_secret
36
-
37
31
  # Airbnb only — optional UI language for the hosted Connect pages. Accepts any supported locale code (currently `en`, `fr`); unknown codes are ignored and resolution falls back to the workspace `default_language`, then `Accept-Language`, then `en`.
38
32
  attr_accessor :locale
39
33
 
@@ -66,8 +60,6 @@ module Repull
66
60
  :'access_type' => :'accessType',
67
61
  :'reservation_history_months' => :'reservationHistoryMonths',
68
62
  :'state' => :'state',
69
- :'client_id' => :'clientId',
70
- :'client_secret' => :'clientSecret',
71
63
  :'locale' => :'locale'
72
64
  }
73
65
  end
@@ -89,8 +81,6 @@ module Repull
89
81
  :'access_type' => :'String',
90
82
  :'reservation_history_months' => :'Integer',
91
83
  :'state' => :'String',
92
- :'client_id' => :'String',
93
- :'client_secret' => :'String',
94
84
  :'locale' => :'String'
95
85
  }
96
86
  end
@@ -136,14 +126,6 @@ module Repull
136
126
  self.state = attributes[:'state']
137
127
  end
138
128
 
139
- if attributes.key?(:'client_id')
140
- self.client_id = attributes[:'client_id']
141
- end
142
-
143
- if attributes.key?(:'client_secret')
144
- self.client_secret = attributes[:'client_secret']
145
- end
146
-
147
129
  if attributes.key?(:'locale')
148
130
  self.locale = attributes[:'locale']
149
131
  end
@@ -213,8 +195,6 @@ module Repull
213
195
  access_type == o.access_type &&
214
196
  reservation_history_months == o.reservation_history_months &&
215
197
  state == o.state &&
216
- client_id == o.client_id &&
217
- client_secret == o.client_secret &&
218
198
  locale == o.locale
219
199
  end
220
200
 
@@ -227,7 +207,7 @@ module Repull
227
207
  # Calculates hash code according to all attributes.
228
208
  # @return [Integer] Hash code
229
209
  def hash
230
- [redirect_url, access_type, reservation_history_months, state, client_id, client_secret, locale].hash
210
+ [redirect_url, access_type, reservation_history_months, state, locale].hash
231
211
  end
232
212
 
233
213
  # Builds the object from hash
@@ -21,6 +21,9 @@ module Repull
21
21
 
22
22
  attr_accessor :status
23
23
 
24
+ # Vrbo only. Ask the host to add this address on Vrbo as a secondary email, with message and reservation notifications on. It is how new bookings, inquiries and guest messages reach Repull within a minute; without it they arrive at the next scheduled check. Hosted Connect asks for it on its mapping screen, so show it in your own flow when you map with `mapping: \"api\"`.
25
+ attr_accessor :notification_email
26
+
24
27
  attr_accessor :units
25
28
 
26
29
  attr_accessor :listing_options
@@ -58,6 +61,7 @@ module Repull
58
61
  :'connection_id' => :'connection_id',
59
62
  :'channel' => :'channel',
60
63
  :'status' => :'status',
64
+ :'notification_email' => :'notification_email',
61
65
  :'units' => :'units',
62
66
  :'listing_options' => :'listing_options',
63
67
  :'missing_capabilities' => :'missing_capabilities',
@@ -81,6 +85,7 @@ module Repull
81
85
  :'connection_id' => :'String',
82
86
  :'channel' => :'String',
83
87
  :'status' => :'String',
88
+ :'notification_email' => :'String',
84
89
  :'units' => :'Array<ListConnectionUnits200ResponseUnitsInner>',
85
90
  :'listing_options' => :'Array<ListConnectionUnits200ResponseListingOptionsInner>',
86
91
  :'missing_capabilities' => :'Array<String>',
@@ -91,6 +96,7 @@ module Repull
91
96
  # List of attributes with nullable: true
92
97
  def self.openapi_nullable
93
98
  Set.new([
99
+ :'notification_email',
94
100
  ])
95
101
  end
96
102
 
@@ -122,6 +128,10 @@ module Repull
122
128
  self.status = attributes[:'status']
123
129
  end
124
130
 
131
+ if attributes.key?(:'notification_email')
132
+ self.notification_email = attributes[:'notification_email']
133
+ end
134
+
125
135
  if attributes.key?(:'units')
126
136
  if (value = attributes[:'units']).is_a?(Array)
127
137
  self.units = value
@@ -180,6 +190,7 @@ module Repull
180
190
  connection_id == o.connection_id &&
181
191
  channel == o.channel &&
182
192
  status == o.status &&
193
+ notification_email == o.notification_email &&
183
194
  units == o.units &&
184
195
  listing_options == o.listing_options &&
185
196
  missing_capabilities == o.missing_capabilities &&
@@ -195,7 +206,7 @@ module Repull
195
206
  # Calculates hash code according to all attributes.
196
207
  # @return [Integer] Hash code
197
208
  def hash
198
- [connection_id, channel, status, units, listing_options, missing_capabilities, listing_options_total].hash
209
+ [connection_id, channel, status, notification_email, units, listing_options, missing_capabilities, listing_options_total].hash
199
210
  end
200
211
 
201
212
  # Builds the object from hash
@@ -25,6 +25,7 @@ module Repull
25
25
 
26
26
  attr_accessor :suggested_listing_id
27
27
 
28
+ # Channel details that identify the unit. Booking.com Extranet: `hotel` (property name), `hotelId` (Booking.com property ID), `roomId` (Booking.com room ID), `city`. Vrbo: `headline`, `address`, `vrboStatus`; the Vrbo listing ID is `unit_id`.
28
29
  attr_accessor :meta
29
30
 
30
31
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,16 +14,38 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
+ # The listing's postal address, unit included. Each part is read from the listing first, then from the connected channels (Airbnb, Vrbo, Booking.com). On an inactive row only `city` is present.
17
18
  class ListingAddress < ApiModelBase
19
+ # Street line as stored on the listing. Kept for existing integrations; same value as `line1` unless the listing has no street of its own.
18
20
  attr_accessor :street
19
21
 
22
+ # Street address: number and street.
23
+ attr_accessor :line1
24
+
25
+ # Apartment, unit, suite or building.
26
+ attr_accessor :line2
27
+
20
28
  attr_accessor :city
21
29
 
30
+ # State, province or region.
31
+ attr_accessor :state
32
+
33
+ # Postal or ZIP code.
34
+ attr_accessor :postal_code
35
+
36
+ # ISO 3166-1 alpha-2 country code.
37
+ attr_accessor :country_code
38
+
22
39
  # Attribute mapping from ruby-style variable name to JSON key.
23
40
  def self.attribute_map
24
41
  {
25
42
  :'street' => :'street',
26
- :'city' => :'city'
43
+ :'line1' => :'line1',
44
+ :'line2' => :'line2',
45
+ :'city' => :'city',
46
+ :'state' => :'state',
47
+ :'postal_code' => :'postalCode',
48
+ :'country_code' => :'countryCode'
27
49
  }
28
50
  end
29
51
 
@@ -41,7 +63,12 @@ module Repull
41
63
  def self.openapi_types
42
64
  {
43
65
  :'street' => :'String',
44
- :'city' => :'String'
66
+ :'line1' => :'String',
67
+ :'line2' => :'String',
68
+ :'city' => :'String',
69
+ :'state' => :'String',
70
+ :'postal_code' => :'String',
71
+ :'country_code' => :'String'
45
72
  }
46
73
  end
47
74
 
@@ -49,7 +76,12 @@ module Repull
49
76
  def self.openapi_nullable
50
77
  Set.new([
51
78
  :'street',
52
- :'city'
79
+ :'line1',
80
+ :'line2',
81
+ :'city',
82
+ :'state',
83
+ :'postal_code',
84
+ :'country_code'
53
85
  ])
54
86
  end
55
87
 
@@ -73,9 +105,29 @@ module Repull
73
105
  self.street = attributes[:'street']
74
106
  end
75
107
 
108
+ if attributes.key?(:'line1')
109
+ self.line1 = attributes[:'line1']
110
+ end
111
+
112
+ if attributes.key?(:'line2')
113
+ self.line2 = attributes[:'line2']
114
+ end
115
+
76
116
  if attributes.key?(:'city')
77
117
  self.city = attributes[:'city']
78
118
  end
119
+
120
+ if attributes.key?(:'state')
121
+ self.state = attributes[:'state']
122
+ end
123
+
124
+ if attributes.key?(:'postal_code')
125
+ self.postal_code = attributes[:'postal_code']
126
+ end
127
+
128
+ if attributes.key?(:'country_code')
129
+ self.country_code = attributes[:'country_code']
130
+ end
79
131
  end
80
132
 
81
133
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -99,7 +151,12 @@ module Repull
99
151
  return true if self.equal?(o)
100
152
  self.class == o.class &&
101
153
  street == o.street &&
102
- city == o.city
154
+ line1 == o.line1 &&
155
+ line2 == o.line2 &&
156
+ city == o.city &&
157
+ state == o.state &&
158
+ postal_code == o.postal_code &&
159
+ country_code == o.country_code
103
160
  end
104
161
 
105
162
  # @see the `==` method
@@ -111,7 +168,7 @@ module Repull
111
168
  # Calculates hash code according to all attributes.
112
169
  # @return [Integer] Hash code
113
170
  def hash
114
- [street, city].hash
171
+ [street, line1, line2, city, state, postal_code, country_code].hash
115
172
  end
116
173
 
117
174
  # Builds the object from hash
@@ -14,11 +14,11 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Payload for `listing.updated`. Something about the listing changed on the channel — content, pricing, booking settings, house rules, availability or sync settings.
17
+ # Payload for `listing.updated`. Something about the listing changed on the channel — content, pricing, booking settings, house rules, availability, sync settings or promotions.
18
18
  class ListingUpdatedPayload < ApiModelBase
19
19
  attr_accessor :object
20
20
 
21
- # Which part moved. Airbnb sends one notification per area rather than a diff, so this is the signal for what to re-read.
21
+ # Which part moved. Airbnb sends one notification per area rather than a diff, so this is the signal for what to re-read. `promotions`: the listing’s Airbnb or Booking.com promotions changed — re-read `GET /v1/listings/{id}/promotions`.
22
22
  attr_accessor :area
23
23
 
24
24
  # Fields that changed and their prior values, when the source reports them.
@@ -23,6 +23,12 @@ module Repull
23
23
 
24
24
  attr_accessor :direction
25
25
 
26
+ # Delivery state. Inbound messages are `received`. An outbound message is `sending` while it is queued to the channel, `sent` once the channel accepted it, or `failed`. Only `sent` (or `received`) means the guest can see it.
27
+ attr_accessor :status
28
+
29
+ # Why a message is still `sending` or `failed`, in plain words. `null` otherwise.
30
+ attr_accessor :status_reason
31
+
26
32
  # Free-form sender role from the channel (e.g. `guest`, `host`, `system`, `airbnb`). Use `direction` for binary inbound/outbound logic.
27
33
  attr_accessor :sender_type
28
34
 
@@ -50,6 +56,7 @@ module Repull
50
56
 
51
57
  attr_accessor :sent_at
52
58
 
59
+ # When the message reached the channel. `null` while it is `sending` or when it `failed`.
53
60
  attr_accessor :delivered_at
54
61
 
55
62
  attr_accessor :read_at
@@ -60,6 +67,8 @@ module Repull
60
67
  :'id' => :'id',
61
68
  :'external_message_id' => :'externalMessageId',
62
69
  :'direction' => :'direction',
70
+ :'status' => :'status',
71
+ :'status_reason' => :'statusReason',
63
72
  :'sender_type' => :'senderType',
64
73
  :'sender_name' => :'senderName',
65
74
  :'sender_avatar' => :'senderAvatar',
@@ -91,6 +100,8 @@ module Repull
91
100
  :'id' => :'String',
92
101
  :'external_message_id' => :'String',
93
102
  :'direction' => :'String',
103
+ :'status' => :'String',
104
+ :'status_reason' => :'String',
94
105
  :'sender_type' => :'String',
95
106
  :'sender_name' => :'String',
96
107
  :'sender_avatar' => :'String',
@@ -110,10 +121,12 @@ module Repull
110
121
  def self.openapi_nullable
111
122
  Set.new([
112
123
  :'external_message_id',
124
+ :'status_reason',
113
125
  :'sender_type',
114
126
  :'sender_avatar',
115
127
  :'channel',
116
128
  :'translated_body',
129
+ :'delivered_at',
117
130
  :'read_at'
118
131
  ])
119
132
  end
@@ -146,6 +159,14 @@ module Repull
146
159
  self.direction = attributes[:'direction']
147
160
  end
148
161
 
162
+ if attributes.key?(:'status')
163
+ self.status = attributes[:'status']
164
+ end
165
+
166
+ if attributes.key?(:'status_reason')
167
+ self.status_reason = attributes[:'status_reason']
168
+ end
169
+
149
170
  if attributes.key?(:'sender_type')
150
171
  self.sender_type = attributes[:'sender_type']
151
172
  end
@@ -220,6 +241,8 @@ module Repull
220
241
  id == o.id &&
221
242
  external_message_id == o.external_message_id &&
222
243
  direction == o.direction &&
244
+ status == o.status &&
245
+ status_reason == o.status_reason &&
223
246
  sender_type == o.sender_type &&
224
247
  sender_name == o.sender_name &&
225
248
  sender_avatar == o.sender_avatar &&
@@ -243,7 +266,7 @@ module Repull
243
266
  # Calculates hash code according to all attributes.
244
267
  # @return [Integer] Hash code
245
268
  def hash
246
- [id, external_message_id, direction, sender_type, sender_name, sender_avatar, channel, body, translated_body, attachments, is_automated, ai_generated, sent_at, delivered_at, read_at].hash
269
+ [id, external_message_id, direction, status, status_reason, sender_type, sender_name, sender_avatar, channel, body, translated_body, attachments, is_automated, ai_generated, sent_at, delivered_at, read_at].hash
247
270
  end
248
271
 
249
272
  # Builds the object from hash
@@ -0,0 +1,216 @@
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 full postal address, unit included. Returned on every active row of `GET /v1/properties`, `GET /v1/properties/{id}`, `GET /v1/listings` and `GET /v1/listings/{id}` (on listings, these fields sit inside `address`). Each part is read from the listing first, then from the connected channels (Airbnb, Vrbo, Booking.com), so `line2` carries the apartment or unit number that tells units in the same building apart. A part nobody has stored is `null`.
18
+ class PostalAddress < ApiModelBase
19
+ # Street address: number and street.
20
+ attr_accessor :line1
21
+
22
+ # Apartment, unit, suite or building.
23
+ attr_accessor :line2
24
+
25
+ attr_accessor :city
26
+
27
+ # State, province or region.
28
+ attr_accessor :state
29
+
30
+ # Postal or ZIP code.
31
+ attr_accessor :postal_code
32
+
33
+ # ISO 3166-1 alpha-2 country code.
34
+ attr_accessor :country_code
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'line1' => :'line1',
40
+ :'line2' => :'line2',
41
+ :'city' => :'city',
42
+ :'state' => :'state',
43
+ :'postal_code' => :'postalCode',
44
+ :'country_code' => :'countryCode'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'line1' => :'String',
62
+ :'line2' => :'String',
63
+ :'city' => :'String',
64
+ :'state' => :'String',
65
+ :'postal_code' => :'String',
66
+ :'country_code' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ :'line1',
74
+ :'line2',
75
+ :'city',
76
+ :'state',
77
+ :'postal_code',
78
+ :'country_code'
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PostalAddress` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PostalAddress`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'line1')
99
+ self.line1 = attributes[:'line1']
100
+ else
101
+ self.line1 = nil
102
+ end
103
+
104
+ if attributes.key?(:'line2')
105
+ self.line2 = attributes[:'line2']
106
+ else
107
+ self.line2 = nil
108
+ end
109
+
110
+ if attributes.key?(:'city')
111
+ self.city = attributes[:'city']
112
+ else
113
+ self.city = nil
114
+ end
115
+
116
+ if attributes.key?(:'state')
117
+ self.state = attributes[:'state']
118
+ else
119
+ self.state = nil
120
+ end
121
+
122
+ if attributes.key?(:'postal_code')
123
+ self.postal_code = attributes[:'postal_code']
124
+ else
125
+ self.postal_code = nil
126
+ end
127
+
128
+ if attributes.key?(:'country_code')
129
+ self.country_code = attributes[:'country_code']
130
+ else
131
+ self.country_code = nil
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ true
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ line1 == o.line1 &&
156
+ line2 == o.line2 &&
157
+ city == o.city &&
158
+ state == o.state &&
159
+ postal_code == o.postal_code &&
160
+ country_code == o.country_code
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [line1, line2, city, state, postal_code, country_code].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end