repull 0.2.15 → 0.2.16

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 (126) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +147 -52
  3. data/lib/repull/api/billing_api.rb +4 -4
  4. data/lib/repull/api/booking_com_api.rb +36 -27
  5. data/lib/repull/api/conversations_api.rb +398 -4
  6. data/lib/repull/api/guests_api.rb +2 -2
  7. data/lib/repull/api/listings_api.rb +4 -4
  8. data/lib/repull/api/reservations_api.rb +157 -6
  9. data/lib/repull/api/webhooks_api.rb +10 -3
  10. data/lib/repull/models/accept_reservation_request200_response.rb +321 -0
  11. data/lib/repull/models/account_created_event.rb +95 -31
  12. data/lib/repull/models/account_disconnected_event.rb +95 -31
  13. data/lib/repull/models/ai_operation_completed_event.rb +95 -31
  14. data/lib/repull/models/ai_operation_failed_event.rb +95 -31
  15. data/lib/repull/models/airbnb_reservation_action200_response.rb +157 -0
  16. data/lib/repull/models/airbnb_reservation_action_request.rb +248 -0
  17. data/lib/repull/models/booking_availability_update.rb +4 -20
  18. data/lib/repull/models/booking_availability_update_date_range.rb +193 -0
  19. data/lib/repull/models/booking_availability_update_request.rb +14 -3
  20. data/lib/repull/models/booking_pricing_rate_update.rb +32 -4
  21. data/lib/repull/models/booking_pricing_rate_update_date_range.rb +3 -0
  22. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +10 -10
  23. data/lib/repull/models/booking_pricing_response.rb +16 -4
  24. data/lib/repull/models/booking_pricing_update_response.rb +82 -18
  25. data/lib/repull/models/booking_property.rb +107 -36
  26. data/lib/repull/models/booking_property_listings_inner.rb +244 -0
  27. data/lib/repull/models/booking_rate_write_occupancy.rb +187 -0
  28. data/lib/repull/models/booking_rate_write_price_half.rb +188 -0
  29. data/lib/repull/models/booking_rate_write_restriction_half.rb +212 -0
  30. data/lib/repull/models/booking_rate_write_verification.rb +200 -0
  31. data/lib/repull/models/booking_rate_write_verification_row.rb +196 -0
  32. data/lib/repull/models/booking_restriction_request_row.rb +199 -0
  33. data/lib/repull/models/booking_restriction_verification.rb +208 -0
  34. data/lib/repull/models/booking_restriction_verification_row.rb +203 -0
  35. data/lib/repull/models/booking_restriction_verification_row_booking_value.rb +105 -0
  36. data/lib/repull/models/booking_restriction_verification_row_expected.rb +105 -0
  37. data/lib/repull/models/booking_rooms_rates_response.rb +41 -7
  38. data/lib/repull/models/booking_rooms_rates_response_rooms_inner.rb +12 -1
  39. data/lib/repull/models/booking_rooms_rates_response_rooms_inner_rates_inner.rb +1 -0
  40. data/lib/repull/models/booking_upstream_failure.rb +204 -0
  41. data/lib/repull/models/calendar_updated_event.rb +95 -31
  42. data/lib/repull/models/conversation_message_attachment.rb +28 -1
  43. data/lib/repull/models/create_airbnb_offer_request.rb +93 -8
  44. data/lib/repull/models/create_airbnb_offer_request_guest_details.rb +279 -0
  45. data/lib/repull/models/create_conversation_special_offer201_response.rb +293 -0
  46. data/lib/repull/models/create_conversation_special_offer201_response_guests.rb +189 -0
  47. data/lib/repull/models/create_conversation_special_offer_request.rb +263 -0
  48. data/lib/repull/models/create_conversation_special_offer_request_guests.rb +263 -0
  49. data/lib/repull/models/decline_reservation_request_request.rb +234 -0
  50. data/lib/repull/models/get_airbnb_offer200_response.rb +289 -0
  51. data/lib/repull/models/get_usage_summary200_response.rb +10 -1
  52. data/lib/repull/models/get_usage_summary200_response_limits.rb +11 -1
  53. data/lib/repull/models/get_usage_summary200_response_remaining.rb +11 -1
  54. data/lib/repull/models/get_usage_summary200_response_used.rb +10 -1
  55. data/lib/repull/models/get_usage_tier200_response.rb +10 -1
  56. data/lib/repull/models/get_usage_tier200_response_limits.rb +11 -1
  57. data/lib/repull/models/get_usage_tier200_response_remaining.rb +11 -1
  58. data/lib/repull/models/get_usage_tier200_response_used.rb +10 -1
  59. data/lib/repull/models/inquiry_created_event.rb +281 -0
  60. data/lib/repull/models/inquiry_created_payload.rb +185 -0
  61. data/lib/repull/models/inquiry_updated_event.rb +281 -0
  62. data/lib/repull/models/inquiry_updated_payload.rb +213 -0
  63. data/lib/repull/models/inquiry_webhook_object.rb +323 -0
  64. data/lib/repull/models/inquiry_webhook_object_expected_payout.rb +158 -0
  65. data/lib/repull/models/inquiry_webhook_object_guests.rb +188 -0
  66. data/lib/repull/models/list_airbnb_thread_messages200_response.rb +170 -0
  67. data/lib/repull/models/list_airbnb_thread_messages200_response_data_inner.rb +274 -0
  68. data/lib/repull/models/list_airbnb_thread_messages200_response_pagination.rb +158 -0
  69. data/lib/repull/models/list_inquiries200_response.rb +192 -0
  70. data/lib/repull/models/list_inquiries200_response_data_inner.rb +418 -0
  71. data/lib/repull/models/list_inquiries200_response_data_inner_expected_payout.rb +159 -0
  72. data/lib/repull/models/list_inquiries200_response_data_inner_guests.rb +188 -0
  73. data/lib/repull/models/listing_created_event.rb +95 -31
  74. data/lib/repull/models/listing_deleted_event.rb +95 -31
  75. data/lib/repull/models/listing_deleted_payload.rb +55 -21
  76. data/lib/repull/models/listing_reactivated_event.rb +281 -0
  77. data/lib/repull/models/listing_suspended_event.rb +281 -0
  78. data/lib/repull/models/listing_suspension_payload.rb +202 -0
  79. data/lib/repull/models/listing_updated_event.rb +95 -31
  80. data/lib/repull/models/listing_updated_payload.rb +50 -22
  81. data/lib/repull/models/listing_webhook_object.rb +291 -0
  82. data/lib/repull/models/listing_webhook_object_address.rb +168 -0
  83. data/lib/repull/models/listing_webhook_object_channels_inner.rb +184 -0
  84. data/lib/repull/models/message.rb +1 -0
  85. data/lib/repull/models/payment_completed_event.rb +95 -31
  86. data/lib/repull/models/payment_completed_payload.rb +46 -44
  87. data/lib/repull/models/payment_refunded_event.rb +95 -31
  88. data/lib/repull/models/payment_refunded_payload.rb +46 -44
  89. data/lib/repull/models/payment_webhook_object.rb +351 -0
  90. data/lib/repull/models/preapprove_conversation201_response.rb +253 -0
  91. data/lib/repull/models/preapprove_conversation_request.rb +150 -0
  92. data/lib/repull/models/replay_webhook_delivery_request.rb +150 -0
  93. data/lib/repull/models/repull_ping_event.rb +95 -31
  94. data/lib/repull/models/reservation.rb +22 -2
  95. data/lib/repull/models/reservation_alteration_created_event.rb +95 -31
  96. data/lib/repull/models/reservation_alteration_responded_event.rb +95 -31
  97. data/lib/repull/models/reservation_cancelled_event.rb +95 -31
  98. data/lib/repull/models/reservation_created_event.rb +95 -32
  99. data/lib/repull/models/reservation_message_received_event.rb +95 -31
  100. data/lib/repull/models/reservation_message_received_payload.rb +17 -4
  101. data/lib/repull/models/reservation_request_created_event.rb +281 -0
  102. data/lib/repull/models/reservation_request_created_payload.rb +224 -0
  103. data/lib/repull/models/reservation_request_updated_event.rb +281 -0
  104. data/lib/repull/models/reservation_request_updated_payload.rb +251 -0
  105. data/lib/repull/models/reservation_updated_event.rb +95 -31
  106. data/lib/repull/models/review_created_event.rb +95 -31
  107. data/lib/repull/models/review_responded_event.rb +95 -31
  108. data/lib/repull/models/send_airbnb_message201_response.rb +104 -0
  109. data/lib/repull/models/send_airbnb_message_request.rb +4 -20
  110. data/lib/repull/models/send_message_attachment.rb +225 -0
  111. data/lib/repull/models/send_message_part.rb +201 -0
  112. data/lib/repull/models/send_message_request.rb +44 -19
  113. data/lib/repull/models/send_message_response.rb +29 -5
  114. data/lib/repull/models/sent_attachment.rb +196 -0
  115. data/lib/repull/models/usage_quota_warning_event.rb +281 -0
  116. data/lib/repull/models/usage_quota_warning_payload.rb +224 -0
  117. data/lib/repull/models/usage_quota_warning_payload_top_operation.rb +167 -0
  118. data/lib/repull/models/webhook_event.rb +17 -3
  119. data/lib/repull/models/webhook_event_account.rb +171 -0
  120. data/lib/repull/models/webhook_event_type.rb +8 -1
  121. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +240 -0
  122. data/lib/repull/version.rb +1 -1
  123. data/lib/repull.rb +60 -0
  124. data/openapi/v1.json +19295 -13620
  125. data/scripts/regen.sh +1 -1
  126. metadata +62 -2
@@ -14,31 +14,53 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
+ # What a Booking.com rate write actually did. Returned by `PUT /v1/channels/booking/listings/{id}/pricing` and by `PUT /v1/channels/booking/availability` with `type: \"rates\"`. Prices and restrictions are two writes on two of Booking.com's wires, and Booking.com can take one and refuse the other. The response says so: `price` and `restrictions` each carry their own state, their own read-back and — when refused — Booking.com's own reason. The top-level `applied` summarises them, and is `partial` when they disagree. A half that landed is never reported as a failure.
17
18
  class BookingPricingUpdateResponse < ApiModelBase
18
19
  attr_accessor :hotel_id
19
20
 
20
21
  attr_accessor :listing_id
21
22
 
22
- # Number of updates Booking.com accepted as `success`. Falls back to total update count when Booking omits per-update status on full success.
23
- attr_accessor :pushed
23
+ # Echoed back by `PUT /v1/channels/booking/availability`.
24
+ attr_accessor :property_id
24
25
 
26
+ # How many updates were sent.
25
27
  attr_accessor :requested
26
28
 
27
- # Per-update failure rows from Booking — shape mirrors the Booking rates API response.
29
+ attr_accessor :occupancy
30
+
31
+ # What is known about the nights now. `verified` — read back, every night carries what was sent. `mismatch` — read back, some do not (`verification.rows` / `restrictions.verification.rows` name them). `rejected` — Booking.com refused everything that was sent. `partial` — one half landed and the other did not; read `price.applied` and `restrictions.applied` to see which, and `restrictions.rejection.message` for Booking.com's reason. `unverified` — Booking.com acknowledged the request and no read-back ran: an unknown, not a success. A bare acknowledgement is never reported as \"all applied\".
32
+ attr_accessor :applied
33
+
34
+ attr_accessor :price
35
+
36
+ attr_accessor :restrictions
37
+
38
+ attr_accessor :verification
39
+
40
+ # Booking.com's own answers, verbatim: `rates` (the rate-amount notification) and `restrictions` (the availability notification, when the updates carried any restriction).
41
+ attr_accessor :booking
42
+
43
+ # Failures Booking.com named, across both wires. Empty means Booking.com named none — not that the nights changed; that is what `applied` is for.
28
44
  attr_accessor :errors
29
45
 
30
- # Verbatim Booking response envelope for debugging.
31
- attr_accessor :raw
46
+ # Present when Booking.com's rate-plan read did not complete, so an occupancy fell back to the room definition.
47
+ attr_accessor :rate_plan_read_error
32
48
 
33
49
  # Attribute mapping from ruby-style variable name to JSON key.
34
50
  def self.attribute_map
35
51
  {
36
52
  :'hotel_id' => :'hotelId',
37
53
  :'listing_id' => :'listingId',
38
- :'pushed' => :'pushed',
54
+ :'property_id' => :'propertyId',
39
55
  :'requested' => :'requested',
56
+ :'occupancy' => :'occupancy',
57
+ :'applied' => :'applied',
58
+ :'price' => :'price',
59
+ :'restrictions' => :'restrictions',
60
+ :'verification' => :'verification',
61
+ :'booking' => :'booking',
40
62
  :'errors' => :'errors',
41
- :'raw' => :'raw'
63
+ :'rate_plan_read_error' => :'ratePlanReadError'
42
64
  }
43
65
  end
44
66
 
@@ -57,16 +79,26 @@ module Repull
57
79
  {
58
80
  :'hotel_id' => :'String',
59
81
  :'listing_id' => :'String',
60
- :'pushed' => :'Integer',
82
+ :'property_id' => :'String',
61
83
  :'requested' => :'Integer',
84
+ :'occupancy' => :'Array<BookingRateWriteOccupancy>',
85
+ :'applied' => :'String',
86
+ :'price' => :'BookingRateWritePriceHalf',
87
+ :'restrictions' => :'BookingRateWriteRestrictionHalf',
88
+ :'verification' => :'BookingRateWriteVerification',
89
+ :'booking' => :'Hash<String, Object>',
62
90
  :'errors' => :'Array<Hash<String, Object>>',
63
- :'raw' => :'Hash<String, Object>'
91
+ :'rate_plan_read_error' => :'String'
64
92
  }
65
93
  end
66
94
 
67
95
  # List of attributes with nullable: true
68
96
  def self.openapi_nullable
69
97
  Set.new([
98
+ :'hotel_id',
99
+ :'listing_id',
100
+ :'property_id',
101
+ :'rate_plan_read_error'
70
102
  ])
71
103
  end
72
104
 
@@ -94,24 +126,50 @@ module Repull
94
126
  self.listing_id = attributes[:'listing_id']
95
127
  end
96
128
 
97
- if attributes.key?(:'pushed')
98
- self.pushed = attributes[:'pushed']
129
+ if attributes.key?(:'property_id')
130
+ self.property_id = attributes[:'property_id']
99
131
  end
100
132
 
101
133
  if attributes.key?(:'requested')
102
134
  self.requested = attributes[:'requested']
103
135
  end
104
136
 
137
+ if attributes.key?(:'occupancy')
138
+ if (value = attributes[:'occupancy']).is_a?(Array)
139
+ self.occupancy = value
140
+ end
141
+ end
142
+
143
+ if attributes.key?(:'applied')
144
+ self.applied = attributes[:'applied']
145
+ end
146
+
147
+ if attributes.key?(:'price')
148
+ self.price = attributes[:'price']
149
+ end
150
+
151
+ if attributes.key?(:'restrictions')
152
+ self.restrictions = attributes[:'restrictions']
153
+ end
154
+
155
+ if attributes.key?(:'verification')
156
+ self.verification = attributes[:'verification']
157
+ end
158
+
159
+ if attributes.key?(:'booking')
160
+ if (value = attributes[:'booking']).is_a?(Hash)
161
+ self.booking = value
162
+ end
163
+ end
164
+
105
165
  if attributes.key?(:'errors')
106
166
  if (value = attributes[:'errors']).is_a?(Array)
107
167
  self.errors = value
108
168
  end
109
169
  end
110
170
 
111
- if attributes.key?(:'raw')
112
- if (value = attributes[:'raw']).is_a?(Hash)
113
- self.raw = value
114
- end
171
+ if attributes.key?(:'rate_plan_read_error')
172
+ self.rate_plan_read_error = attributes[:'rate_plan_read_error']
115
173
  end
116
174
  end
117
175
 
@@ -137,10 +195,16 @@ module Repull
137
195
  self.class == o.class &&
138
196
  hotel_id == o.hotel_id &&
139
197
  listing_id == o.listing_id &&
140
- pushed == o.pushed &&
198
+ property_id == o.property_id &&
141
199
  requested == o.requested &&
200
+ occupancy == o.occupancy &&
201
+ applied == o.applied &&
202
+ price == o.price &&
203
+ restrictions == o.restrictions &&
204
+ verification == o.verification &&
205
+ booking == o.booking &&
142
206
  errors == o.errors &&
143
- raw == o.raw
207
+ rate_plan_read_error == o.rate_plan_read_error
144
208
  end
145
209
 
146
210
  # @see the `==` method
@@ -152,7 +216,7 @@ module Repull
152
216
  # Calculates hash code according to all attributes.
153
217
  # @return [Integer] Hash code
154
218
  def hash
155
- [hotel_id, listing_id, pushed, requested, errors, raw].hash
219
+ [hotel_id, listing_id, property_id, requested, occupancy, applied, price, restrictions, verification, booking, errors, rate_plan_read_error].hash
156
220
  end
157
221
 
158
222
  # Builds the object from hash
@@ -14,27 +14,51 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # A property registered in the Booking.com extranet for the connected hotel ID.
17
+ # A Booking.com property this workspace holds, with the Repull listings mapped under it. A property is a building; its rooms are what guests book, and each room maps to one Repull listing — so one property commonly carries many listings.
18
18
  class BookingProperty < ApiModelBase
19
- # Booking.com hotel/property ID
20
- attr_accessor :id
19
+ # Repull-side id for this Booking.com connection.
20
+ attr_accessor :connection_id
21
21
 
22
- attr_accessor :name
22
+ # Booking.com hotel/property id. This is what `/v1/channels/booking/availability` takes as `property_id`.
23
+ attr_accessor :hotel_id
23
24
 
24
- attr_accessor :status
25
+ attr_accessor :active
25
26
 
26
- attr_accessor :country
27
+ attr_accessor :sync_enabled
27
28
 
28
- attr_accessor :city
29
+ attr_accessor :booking_url
30
+
31
+ attr_accessor :markup
32
+
33
+ attr_accessor :sync_category
34
+
35
+ attr_accessor :suspended_at
36
+
37
+ attr_accessor :suspension_reason
38
+
39
+ attr_accessor :created_at
40
+
41
+ # `mapped` — at least one room points at a listing. `unmapped` — the property is claimed but its rooms are not mapped yet, so `listings` is empty; finish `POST /v1/connect/booking/map-rooms`. An unmapped property is listed rather than hidden, so a half-finished connection is visible instead of looking like no connection at all.
42
+ attr_accessor :mapping_status
43
+
44
+ # The Repull listings mapped under this property. Empty when `mappingStatus` is `unmapped`. Inactive listings are left out.
45
+ attr_accessor :listings
29
46
 
30
47
  # Attribute mapping from ruby-style variable name to JSON key.
31
48
  def self.attribute_map
32
49
  {
33
- :'id' => :'id',
34
- :'name' => :'name',
35
- :'status' => :'status',
36
- :'country' => :'country',
37
- :'city' => :'city'
50
+ :'connection_id' => :'connectionId',
51
+ :'hotel_id' => :'hotelId',
52
+ :'active' => :'active',
53
+ :'sync_enabled' => :'syncEnabled',
54
+ :'booking_url' => :'bookingUrl',
55
+ :'markup' => :'markup',
56
+ :'sync_category' => :'syncCategory',
57
+ :'suspended_at' => :'suspendedAt',
58
+ :'suspension_reason' => :'suspensionReason',
59
+ :'created_at' => :'createdAt',
60
+ :'mapping_status' => :'mappingStatus',
61
+ :'listings' => :'listings'
38
62
  }
39
63
  end
40
64
 
@@ -51,20 +75,30 @@ module Repull
51
75
  # Attribute type mapping.
52
76
  def self.openapi_types
53
77
  {
54
- :'id' => :'String',
55
- :'name' => :'String',
56
- :'status' => :'String',
57
- :'country' => :'String',
58
- :'city' => :'String'
78
+ :'connection_id' => :'String',
79
+ :'hotel_id' => :'String',
80
+ :'active' => :'Boolean',
81
+ :'sync_enabled' => :'Boolean',
82
+ :'booking_url' => :'String',
83
+ :'markup' => :'String',
84
+ :'sync_category' => :'String',
85
+ :'suspended_at' => :'Time',
86
+ :'suspension_reason' => :'String',
87
+ :'created_at' => :'Time',
88
+ :'mapping_status' => :'String',
89
+ :'listings' => :'Array<BookingPropertyListingsInner>'
59
90
  }
60
91
  end
61
92
 
62
93
  # List of attributes with nullable: true
63
94
  def self.openapi_nullable
64
95
  Set.new([
65
- :'status',
66
- :'country',
67
- :'city'
96
+ :'booking_url',
97
+ :'markup',
98
+ :'sync_category',
99
+ :'suspended_at',
100
+ :'suspension_reason',
101
+ :'created_at',
68
102
  ])
69
103
  end
70
104
 
@@ -84,24 +118,54 @@ module Repull
84
118
  h[k.to_sym] = v
85
119
  }
86
120
 
87
- if attributes.key?(:'id')
88
- self.id = attributes[:'id']
121
+ if attributes.key?(:'connection_id')
122
+ self.connection_id = attributes[:'connection_id']
123
+ end
124
+
125
+ if attributes.key?(:'hotel_id')
126
+ self.hotel_id = attributes[:'hotel_id']
127
+ end
128
+
129
+ if attributes.key?(:'active')
130
+ self.active = attributes[:'active']
89
131
  end
90
132
 
91
- if attributes.key?(:'name')
92
- self.name = attributes[:'name']
133
+ if attributes.key?(:'sync_enabled')
134
+ self.sync_enabled = attributes[:'sync_enabled']
93
135
  end
94
136
 
95
- if attributes.key?(:'status')
96
- self.status = attributes[:'status']
137
+ if attributes.key?(:'booking_url')
138
+ self.booking_url = attributes[:'booking_url']
97
139
  end
98
140
 
99
- if attributes.key?(:'country')
100
- self.country = attributes[:'country']
141
+ if attributes.key?(:'markup')
142
+ self.markup = attributes[:'markup']
101
143
  end
102
144
 
103
- if attributes.key?(:'city')
104
- self.city = attributes[:'city']
145
+ if attributes.key?(:'sync_category')
146
+ self.sync_category = attributes[:'sync_category']
147
+ end
148
+
149
+ if attributes.key?(:'suspended_at')
150
+ self.suspended_at = attributes[:'suspended_at']
151
+ end
152
+
153
+ if attributes.key?(:'suspension_reason')
154
+ self.suspension_reason = attributes[:'suspension_reason']
155
+ end
156
+
157
+ if attributes.key?(:'created_at')
158
+ self.created_at = attributes[:'created_at']
159
+ end
160
+
161
+ if attributes.key?(:'mapping_status')
162
+ self.mapping_status = attributes[:'mapping_status']
163
+ end
164
+
165
+ if attributes.key?(:'listings')
166
+ if (value = attributes[:'listings']).is_a?(Array)
167
+ self.listings = value
168
+ end
105
169
  end
106
170
  end
107
171
 
@@ -125,11 +189,18 @@ module Repull
125
189
  def ==(o)
126
190
  return true if self.equal?(o)
127
191
  self.class == o.class &&
128
- id == o.id &&
129
- name == o.name &&
130
- status == o.status &&
131
- country == o.country &&
132
- city == o.city
192
+ connection_id == o.connection_id &&
193
+ hotel_id == o.hotel_id &&
194
+ active == o.active &&
195
+ sync_enabled == o.sync_enabled &&
196
+ booking_url == o.booking_url &&
197
+ markup == o.markup &&
198
+ sync_category == o.sync_category &&
199
+ suspended_at == o.suspended_at &&
200
+ suspension_reason == o.suspension_reason &&
201
+ created_at == o.created_at &&
202
+ mapping_status == o.mapping_status &&
203
+ listings == o.listings
133
204
  end
134
205
 
135
206
  # @see the `==` method
@@ -141,7 +212,7 @@ module Repull
141
212
  # Calculates hash code according to all attributes.
142
213
  # @return [Integer] Hash code
143
214
  def hash
144
- [id, name, status, country, city].hash
215
+ [connection_id, hotel_id, active, sync_enabled, booking_url, markup, sync_category, suspended_at, suspension_reason, created_at, mapping_status, listings].hash
145
216
  end
146
217
 
147
218
  # Builds the object from hash
@@ -0,0 +1,244 @@
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
+ Contact: ivan@vanio.ai
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ class BookingPropertyListingsInner < ApiModelBase
18
+ # Repull listing id — what `/v1/channels/booking/properties/{id}` and `/v1/channels/booking/listings/{id}/pricing` take.
19
+ attr_accessor :listing_id
20
+
21
+ attr_accessor :name
22
+
23
+ attr_accessor :city
24
+
25
+ # Repull-side room row id, as used by `POST /v1/connect/booking/map-rooms`.
26
+ attr_accessor :room_id
27
+
28
+ # Booking.com's own room id — the `roomId` an ARI write takes.
29
+ attr_accessor :room_booking_id
30
+
31
+ attr_accessor :room_name
32
+
33
+ # Which record carries the mapping: the room mapping written by Connect, or the legacy property-level link.
34
+ attr_accessor :mapped_via
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'listing_id' => :'listingId',
62
+ :'name' => :'name',
63
+ :'city' => :'city',
64
+ :'room_id' => :'roomId',
65
+ :'room_booking_id' => :'roomBookingId',
66
+ :'room_name' => :'roomName',
67
+ :'mapped_via' => :'mappedVia'
68
+ }
69
+ end
70
+
71
+ # Returns attribute mapping this model knows about
72
+ def self.acceptable_attribute_map
73
+ attribute_map
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ acceptable_attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'listing_id' => :'String',
85
+ :'name' => :'String',
86
+ :'city' => :'String',
87
+ :'room_id' => :'String',
88
+ :'room_booking_id' => :'String',
89
+ :'room_name' => :'String',
90
+ :'mapped_via' => :'String'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ :'name',
98
+ :'city',
99
+ :'room_id',
100
+ :'room_booking_id',
101
+ :'room_name',
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ if (!attributes.is_a?(Hash))
109
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingPropertyListingsInner` initialize method"
110
+ end
111
+
112
+ # check to see if the attribute exists and convert string to symbol for hash key
113
+ acceptable_attribute_map = self.class.acceptable_attribute_map
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!acceptable_attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingPropertyListingsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'listing_id')
122
+ self.listing_id = attributes[:'listing_id']
123
+ end
124
+
125
+ if attributes.key?(:'name')
126
+ self.name = attributes[:'name']
127
+ end
128
+
129
+ if attributes.key?(:'city')
130
+ self.city = attributes[:'city']
131
+ end
132
+
133
+ if attributes.key?(:'room_id')
134
+ self.room_id = attributes[:'room_id']
135
+ end
136
+
137
+ if attributes.key?(:'room_booking_id')
138
+ self.room_booking_id = attributes[:'room_booking_id']
139
+ end
140
+
141
+ if attributes.key?(:'room_name')
142
+ self.room_name = attributes[:'room_name']
143
+ end
144
+
145
+ if attributes.key?(:'mapped_via')
146
+ self.mapped_via = attributes[:'mapped_via']
147
+ end
148
+ end
149
+
150
+ # Show invalid properties with the reasons. Usually used together with valid?
151
+ # @return Array for valid properties with the reasons
152
+ def list_invalid_properties
153
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
154
+ invalid_properties = Array.new
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ warn '[DEPRECATED] the `valid?` method is obsolete'
162
+ mapped_via_validator = EnumAttributeValidator.new('String', ["room", "property"])
163
+ return false unless mapped_via_validator.valid?(@mapped_via)
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method checking allowed values (enum).
168
+ # @param [Object] mapped_via Object to be assigned
169
+ def mapped_via=(mapped_via)
170
+ validator = EnumAttributeValidator.new('String', ["room", "property"])
171
+ unless validator.valid?(mapped_via)
172
+ fail ArgumentError, "invalid value for \"mapped_via\", must be one of #{validator.allowable_values}."
173
+ end
174
+ @mapped_via = mapped_via
175
+ end
176
+
177
+ # Checks equality by comparing each attribute.
178
+ # @param [Object] Object to be compared
179
+ def ==(o)
180
+ return true if self.equal?(o)
181
+ self.class == o.class &&
182
+ listing_id == o.listing_id &&
183
+ name == o.name &&
184
+ city == o.city &&
185
+ room_id == o.room_id &&
186
+ room_booking_id == o.room_booking_id &&
187
+ room_name == o.room_name &&
188
+ mapped_via == o.mapped_via
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [listing_id, name, city, room_id, room_booking_id, room_name, mapped_via].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ return nil unless attributes.is_a?(Hash)
208
+ attributes = attributes.transform_keys(&:to_sym)
209
+ transformed_hash = {}
210
+ openapi_types.each_pair do |key, type|
211
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = nil
213
+ elsif type =~ /\AArray<(.*)>/i
214
+ # check to ensure the input is an array given that the attribute
215
+ # is documented as an array but the input is not
216
+ if attributes[attribute_map[key]].is_a?(Array)
217
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
218
+ end
219
+ elsif !attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
221
+ end
222
+ end
223
+ new(transformed_hash)
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ end
243
+
244
+ end