repull 0.2.15 → 0.2.17

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +149 -54
  3. data/lib/repull/api/billing_api.rb +4 -4
  4. data/lib/repull/api/booking_com_api.rb +122 -29
  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 +186 -16
  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_publish_result.rb +41 -2
  16. data/lib/repull/models/airbnb_reservation_action200_response.rb +157 -0
  17. data/lib/repull/models/airbnb_reservation_action_request.rb +248 -0
  18. data/lib/repull/models/booking_availability_update.rb +4 -20
  19. data/lib/repull/models/booking_availability_update_date_range.rb +193 -0
  20. data/lib/repull/models/booking_availability_update_request.rb +14 -3
  21. data/lib/repull/models/booking_pricing_rate_update.rb +32 -4
  22. data/lib/repull/models/booking_pricing_rate_update_date_range.rb +3 -0
  23. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +10 -10
  24. data/lib/repull/models/booking_pricing_response.rb +16 -4
  25. data/lib/repull/models/booking_pricing_update_response.rb +82 -18
  26. data/lib/repull/models/booking_property.rb +107 -36
  27. data/lib/repull/models/booking_property_action_request.rb +176 -0
  28. data/lib/repull/models/booking_property_action_response.rb +281 -0
  29. data/lib/repull/models/booking_property_listings_inner.rb +244 -0
  30. data/lib/repull/models/booking_publish_result.rb +245 -0
  31. data/lib/repull/models/booking_publish_section_error.rb +220 -0
  32. data/lib/repull/models/booking_rate_write_occupancy.rb +187 -0
  33. data/lib/repull/models/booking_rate_write_price_half.rb +188 -0
  34. data/lib/repull/models/booking_rate_write_restriction_half.rb +212 -0
  35. data/lib/repull/models/booking_rate_write_verification.rb +200 -0
  36. data/lib/repull/models/booking_rate_write_verification_row.rb +196 -0
  37. data/lib/repull/models/booking_restriction_request_row.rb +199 -0
  38. data/lib/repull/models/booking_restriction_verification.rb +208 -0
  39. data/lib/repull/models/booking_restriction_verification_row.rb +203 -0
  40. data/lib/repull/models/booking_restriction_verification_row_booking_value.rb +105 -0
  41. data/lib/repull/models/booking_restriction_verification_row_expected.rb +105 -0
  42. data/lib/repull/models/booking_rooms_rates_response.rb +41 -7
  43. data/lib/repull/models/booking_rooms_rates_response_rooms_inner.rb +12 -1
  44. data/lib/repull/models/booking_rooms_rates_response_rooms_inner_rates_inner.rb +1 -0
  45. data/lib/repull/models/booking_setup_request.rb +44 -5
  46. data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -0
  47. data/lib/repull/models/booking_upstream_failure.rb +204 -0
  48. data/lib/repull/models/calendar_updated_event.rb +95 -31
  49. data/lib/repull/models/channel_market_state_item.rb +291 -0
  50. data/lib/repull/models/conversation_message_attachment.rb +28 -1
  51. data/lib/repull/models/create_airbnb_offer_request.rb +93 -8
  52. data/lib/repull/models/create_airbnb_offer_request_guest_details.rb +279 -0
  53. data/lib/repull/models/create_conversation_special_offer201_response.rb +293 -0
  54. data/lib/repull/models/create_conversation_special_offer201_response_guests.rb +189 -0
  55. data/lib/repull/models/create_conversation_special_offer_request.rb +263 -0
  56. data/lib/repull/models/create_conversation_special_offer_request_guests.rb +263 -0
  57. data/lib/repull/models/decline_reservation_request_request.rb +234 -0
  58. data/lib/repull/models/error_error.rb +11 -1
  59. data/lib/repull/models/get_airbnb_offer200_response.rb +289 -0
  60. data/lib/repull/models/get_usage_summary200_response.rb +10 -1
  61. data/lib/repull/models/get_usage_summary200_response_limits.rb +11 -1
  62. data/lib/repull/models/get_usage_summary200_response_remaining.rb +11 -1
  63. data/lib/repull/models/get_usage_summary200_response_used.rb +10 -1
  64. data/lib/repull/models/get_usage_tier200_response.rb +10 -1
  65. data/lib/repull/models/get_usage_tier200_response_limits.rb +11 -1
  66. data/lib/repull/models/get_usage_tier200_response_remaining.rb +11 -1
  67. data/lib/repull/models/get_usage_tier200_response_used.rb +10 -1
  68. data/lib/repull/models/inquiry_created_event.rb +281 -0
  69. data/lib/repull/models/inquiry_created_payload.rb +185 -0
  70. data/lib/repull/models/inquiry_updated_event.rb +281 -0
  71. data/lib/repull/models/inquiry_updated_payload.rb +213 -0
  72. data/lib/repull/models/inquiry_webhook_object.rb +323 -0
  73. data/lib/repull/models/inquiry_webhook_object_expected_payout.rb +158 -0
  74. data/lib/repull/models/inquiry_webhook_object_guests.rb +188 -0
  75. data/lib/repull/models/list_airbnb_thread_messages200_response.rb +170 -0
  76. data/lib/repull/models/list_airbnb_thread_messages200_response_data_inner.rb +274 -0
  77. data/lib/repull/models/list_airbnb_thread_messages200_response_pagination.rb +158 -0
  78. data/lib/repull/models/list_inquiries200_response.rb +192 -0
  79. data/lib/repull/models/list_inquiries200_response_data_inner.rb +418 -0
  80. data/lib/repull/models/list_inquiries200_response_data_inner_expected_payout.rb +159 -0
  81. data/lib/repull/models/list_inquiries200_response_data_inner_guests.rb +188 -0
  82. data/lib/repull/models/listing_address_readiness.rb +171 -0
  83. data/lib/repull/models/listing_content_update_request_address.rb +40 -3
  84. data/lib/repull/models/listing_create_request.rb +48 -2
  85. data/lib/repull/models/listing_created_event.rb +95 -31
  86. data/lib/repull/models/listing_deleted_event.rb +95 -31
  87. data/lib/repull/models/listing_deleted_payload.rb +55 -21
  88. data/lib/repull/models/listing_market_state_request.rb +149 -0
  89. data/lib/repull/models/listing_market_state_response.rb +221 -0
  90. data/lib/repull/models/listing_publish_booking_request.rb +149 -0
  91. data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
  92. data/lib/repull/models/listing_publish_status_channel.rb +32 -1
  93. data/lib/repull/models/listing_publish_status_connection.rb +17 -5
  94. data/lib/repull/models/listing_publish_status_response.rb +13 -1
  95. data/lib/repull/models/listing_reactivated_event.rb +281 -0
  96. data/lib/repull/models/listing_suspended_event.rb +281 -0
  97. data/lib/repull/models/listing_suspension_payload.rb +202 -0
  98. data/lib/repull/models/listing_updated_event.rb +95 -31
  99. data/lib/repull/models/listing_updated_payload.rb +50 -22
  100. data/lib/repull/models/listing_webhook_object.rb +291 -0
  101. data/lib/repull/models/listing_webhook_object_address.rb +168 -0
  102. data/lib/repull/models/listing_webhook_object_channels_inner.rb +184 -0
  103. data/lib/repull/models/message.rb +1 -0
  104. data/lib/repull/models/payment_completed_event.rb +95 -31
  105. data/lib/repull/models/payment_completed_payload.rb +46 -44
  106. data/lib/repull/models/payment_refunded_event.rb +95 -31
  107. data/lib/repull/models/payment_refunded_payload.rb +46 -44
  108. data/lib/repull/models/payment_webhook_object.rb +351 -0
  109. data/lib/repull/models/preapprove_conversation201_response.rb +253 -0
  110. data/lib/repull/models/preapprove_conversation_request.rb +150 -0
  111. data/lib/repull/models/replay_webhook_delivery_request.rb +150 -0
  112. data/lib/repull/models/repull_ping_event.rb +95 -31
  113. data/lib/repull/models/reservation.rb +22 -2
  114. data/lib/repull/models/reservation_alteration_created_event.rb +95 -31
  115. data/lib/repull/models/reservation_alteration_responded_event.rb +95 -31
  116. data/lib/repull/models/reservation_cancelled_event.rb +95 -31
  117. data/lib/repull/models/reservation_created_event.rb +95 -32
  118. data/lib/repull/models/reservation_message_received_event.rb +95 -31
  119. data/lib/repull/models/reservation_message_received_payload.rb +17 -4
  120. data/lib/repull/models/reservation_request_created_event.rb +281 -0
  121. data/lib/repull/models/reservation_request_created_payload.rb +224 -0
  122. data/lib/repull/models/reservation_request_updated_event.rb +281 -0
  123. data/lib/repull/models/reservation_request_updated_payload.rb +251 -0
  124. data/lib/repull/models/reservation_updated_event.rb +95 -31
  125. data/lib/repull/models/review_created_event.rb +95 -31
  126. data/lib/repull/models/review_responded_event.rb +95 -31
  127. data/lib/repull/models/send_airbnb_message201_response.rb +104 -0
  128. data/lib/repull/models/send_airbnb_message_request.rb +4 -20
  129. data/lib/repull/models/send_message_attachment.rb +225 -0
  130. data/lib/repull/models/send_message_part.rb +201 -0
  131. data/lib/repull/models/send_message_request.rb +44 -19
  132. data/lib/repull/models/send_message_response.rb +29 -5
  133. data/lib/repull/models/sent_attachment.rb +196 -0
  134. data/lib/repull/models/usage_quota_warning_event.rb +281 -0
  135. data/lib/repull/models/usage_quota_warning_payload.rb +224 -0
  136. data/lib/repull/models/usage_quota_warning_payload_top_operation.rb +167 -0
  137. data/lib/repull/models/webhook_event.rb +17 -3
  138. data/lib/repull/models/webhook_event_account.rb +171 -0
  139. data/lib/repull/models/webhook_event_type.rb +8 -1
  140. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +240 -0
  141. data/lib/repull/version.rb +1 -1
  142. data/lib/repull.rb +71 -1
  143. data/openapi/v1.json +19706 -13248
  144. data/scripts/regen.sh +1 -1
  145. metadata +73 -3
@@ -14,25 +14,29 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # A single (room, rate-plan, date-range) update pushed to Booking.com via the rates API.
17
+ # A single (room, rate-plan, date-range) price update. The amount is written against the party size in `occupancy`, for every night from `dateRange.start` to `dateRange.end` inclusive.
18
18
  class BookingPricingRateUpdate < ApiModelBase
19
- # Booking.com room ID for the rate plan. Comes from `listings_booking_rooms` mapping.
19
+ # Booking.com room id the rate plan sells. `GET /v1/channels/booking/properties/{id}/rooms` lists them.
20
20
  attr_accessor :room_id
21
21
 
22
- # Booking.com rate-plan ID.
22
+ # Booking.com rate-plan id.
23
23
  attr_accessor :rate_id
24
24
 
25
25
  attr_accessor :date_range
26
26
 
27
+ # Nightly amount, in `currency`, for a party of `occupancy`.
27
28
  attr_accessor :price
28
29
 
30
+ # Currency the rate plan is sold in.
29
31
  attr_accessor :currency
30
32
 
33
+ # Optional single-occupancy amount, written alongside the main amount.
31
34
  attr_accessor :single_price
32
35
 
36
+ # The party size this rate plan prices — a key, not a preference. Booking.com stores the amount against this number: above the rate plan's own maximum it declines the price in silence and the night keeps its old value; below it, it answers 400 and the old price stays published. Omit it and Repull resolves it from Booking.com's own data for this (room, rate plan) and echoes the value and its source back in `occupancy[]`. When it cannot be resolved the write is refused with `422` naming `updates[N].occupancy` — a price is never sent at a guessed party size.
33
37
  attr_accessor :occupancy
34
38
 
35
- # Rooms to sell for the date range. Set to `0` to stop-sell this room/rate on the rates endpoint (Booking's dedicated `<closed>` stop-sell flag lives on the availability endpoint — see `BookingAvailabilityUpdate.closed`).
39
+ # Refused. A rate update carries prices only; sending this returns `422 inventory_not_in_rate_update` naming `updates[N].roomsToSell`. Write inventory with `type: \"availability\"` and `availableRooms` (plus `closed: true` for a stop-sell).
36
40
  attr_accessor :rooms_to_sell
37
41
 
38
42
  attr_accessor :restrictions
@@ -170,10 +174,18 @@ module Repull
170
174
  invalid_properties.push('invalid value for "price", price cannot be nil.')
171
175
  end
172
176
 
177
+ if @price < 0
178
+ invalid_properties.push('invalid value for "price", must be greater than or equal to 0.')
179
+ end
180
+
173
181
  if @currency.nil?
174
182
  invalid_properties.push('invalid value for "currency", currency cannot be nil.')
175
183
  end
176
184
 
185
+ if !@occupancy.nil? && @occupancy < 1
186
+ invalid_properties.push('invalid value for "occupancy", must be greater than or equal to 1.')
187
+ end
188
+
177
189
  invalid_properties
178
190
  end
179
191
 
@@ -185,7 +197,9 @@ module Repull
185
197
  return false if @rate_id.nil?
186
198
  return false if @date_range.nil?
187
199
  return false if @price.nil?
200
+ return false if @price < 0
188
201
  return false if @currency.nil?
202
+ return false if !@occupancy.nil? && @occupancy < 1
189
203
  true
190
204
  end
191
205
 
@@ -226,6 +240,10 @@ module Repull
226
240
  fail ArgumentError, 'price cannot be nil'
227
241
  end
228
242
 
243
+ if price < 0
244
+ fail ArgumentError, 'invalid value for "price", must be greater than or equal to 0.'
245
+ end
246
+
229
247
  @price = price
230
248
  end
231
249
 
@@ -239,6 +257,16 @@ module Repull
239
257
  @currency = currency
240
258
  end
241
259
 
260
+ # Custom attribute writer method with validation
261
+ # @param [Object] occupancy Value to be assigned
262
+ def occupancy=(occupancy)
263
+ if !occupancy.nil? && occupancy < 1
264
+ fail ArgumentError, 'invalid value for "occupancy", must be greater than or equal to 1.'
265
+ end
266
+
267
+ @occupancy = occupancy
268
+ end
269
+
242
270
  # Checks equality by comparing each attribute.
243
271
  # @param [Object] Object to be compared
244
272
  def ==(o)
@@ -14,9 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
+ # The nights this update applies to. **Both ends are inclusive**: `{ \"start\": \"2026-11-04\", \"end\": \"2026-11-04\" }` writes exactly one night.
17
18
  class BookingPricingRateUpdateDateRange < ApiModelBase
19
+ # First night, YYYY-MM-DD.
18
20
  attr_accessor :start
19
21
 
22
+ # Last night, YYYY-MM-DD, inclusive — the same date as `start` for a single night.
20
23
  attr_accessor :_end
21
24
 
22
25
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -14,33 +14,33 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Optional length-of-stay / availability restrictions for one rate update. Every field here is forwarded verbatim into Booking.com's rates XML (`minimumstay`, `maximumstay`, `closedonarrival`, `closedondeparture`, …) — omit a field to leave that restriction untouched.
17
+ # Length-of-stay and arrival restrictions for the nights in this update. Omit a field to leave that restriction untouched — nothing you do not state is changed. These are written on Booking.com's availability notification, which is the wire that carries a restriction when no inventory changes hands. Sending them alongside a price is supported: the prices and the restrictions are two writes, and the response reports each one separately (`price` and `restrictions`), so a half that lands is never reported as a failure and a half that is refused is never reported as applied. Three restrictions are refused with `422 restriction_not_supported` naming the field: Booking.com's notification has no element for them, and dropping a restriction you stated would be worse than refusing it. Set those on the rate plan in the Booking.com Extranet.
18
18
  class BookingPricingRateUpdateRestrictions < ApiModelBase
19
- # Minimum length of stay (`minimumstay`).
19
+ # Minimum length of stay. Booking.com stores a 1-night minimum as no minimum at all, so `minStay: 1` reads back as `0` and is reported as applied.
20
20
  attr_accessor :min_stay
21
21
 
22
- # Maximum length of stay (`maximumstay`).
22
+ # Maximum length of stay.
23
23
  attr_accessor :max_stay
24
24
 
25
- # Closed-to-arrival — guests may not check in on the affected dates (`closedonarrival`).
25
+ # Closed-to-arrival — guests may not check in on these nights. `false` clears the flag; omit the field to leave it as it is.
26
26
  attr_accessor :closed_to_arrival
27
27
 
28
- # Closed-to-departure — guests may not check out on the affected dates (`closedondeparture`).
28
+ # Closed-to-departure — guests may not check out on these nights. `false` clears the flag; omit the field to leave it as it is.
29
29
  attr_accessor :closed_to_departure
30
30
 
31
- # Arrival-based minimum length of stay (`minimumstay_arrival`).
31
+ # Arrival-based minimum length of stay — applies to stays that START on these nights, rather than any stay covering them.
32
32
  attr_accessor :min_stay_arrival
33
33
 
34
- # Arrival-based maximum length of stay (`maximumstay_arrival`).
34
+ # Arrival-based maximum length of stay.
35
35
  attr_accessor :max_stay_arrival
36
36
 
37
- # Arrival-based exact length of stay (`exactstay_arrival`).
37
+ # Refused. Booking.com's restriction notification has no element for an exact arrival-based stay length, so it cannot be written through the API; sending it returns `422 restriction_not_supported` naming `updates[N].restrictions.exactStayArrival`. Set it on the rate plan in the Booking.com Extranet.
38
38
  attr_accessor :exact_stay_arrival
39
39
 
40
- # Minimum advance-reservation window, format `XDY` (X days Y hours) — `min_advance_res`.
40
+ # Refused, for the same reason as `exactStayArrival` — returns `422 restriction_not_supported`. Set the minimum advance-reservation window on the rate plan in the Booking.com Extranet.
41
41
  attr_accessor :min_advance_res
42
42
 
43
- # Maximum advance-reservation window, format `XDY` (X days Y hours) — `max_advance_res`.
43
+ # Refused, for the same reason as `exactStayArrival` — returns `422 restriction_not_supported`. Set the maximum advance-reservation window on the rate plan in the Booking.com Extranet.
44
44
  attr_accessor :max_advance_res
45
45
 
46
46
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -20,11 +20,15 @@ module Repull
20
20
 
21
21
  attr_accessor :listing_id
22
22
 
23
+ # Other Booking.com properties this listing is also published under. Empty in the normal case. Pass one as `?hotel_id=` to read its pricing instead.
24
+ attr_accessor :other_hotel_ids
25
+
23
26
  # Attribute mapping from ruby-style variable name to JSON key.
24
27
  def self.attribute_map
25
28
  {
26
29
  :'hotel_id' => :'hotelId',
27
- :'listing_id' => :'listingId'
30
+ :'listing_id' => :'listingId',
31
+ :'other_hotel_ids' => :'otherHotelIds'
28
32
  }
29
33
  end
30
34
 
@@ -42,7 +46,8 @@ module Repull
42
46
  def self.openapi_types
43
47
  {
44
48
  :'hotel_id' => :'String',
45
- :'listing_id' => :'String'
49
+ :'listing_id' => :'String',
50
+ :'other_hotel_ids' => :'Array<String>'
46
51
  }
47
52
  end
48
53
 
@@ -75,6 +80,12 @@ module Repull
75
80
  if attributes.key?(:'listing_id')
76
81
  self.listing_id = attributes[:'listing_id']
77
82
  end
83
+
84
+ if attributes.key?(:'other_hotel_ids')
85
+ if (value = attributes[:'other_hotel_ids']).is_a?(Array)
86
+ self.other_hotel_ids = value
87
+ end
88
+ end
78
89
  end
79
90
 
80
91
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -98,7 +109,8 @@ module Repull
98
109
  return true if self.equal?(o)
99
110
  self.class == o.class &&
100
111
  hotel_id == o.hotel_id &&
101
- listing_id == o.listing_id
112
+ listing_id == o.listing_id &&
113
+ other_hotel_ids == o.other_hotel_ids
102
114
  end
103
115
 
104
116
  # @see the `==` method
@@ -110,7 +122,7 @@ module Repull
110
122
  # Calculates hash code according to all attributes.
111
123
  # @return [Integer] Hash code
112
124
  def hash
113
- [hotel_id, listing_id].hash
125
+ [hotel_id, listing_id, other_hotel_ids].hash
114
126
  end
115
127
 
116
128
  # Builds the object from hash
@@ -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