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,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # One (room, rate-plan, date-range) availability update. Carries inventory (`availableRooms`), the dedicated stop-sell flag (`closed`), and the same length-of-stay / arrival restrictions as a rate update.
17
+ # One (room, rate-plan, date-range) availability update. Carries inventory (`availableRooms`), the dedicated stop-sell flag (`closed`), and length-of-stay / arrival restrictions. Omit `availableRooms` and `closed` for a restriction-only write — inventory is then left untouched.
18
18
  class BookingAvailabilityUpdate < ApiModelBase
19
19
  # Booking.com room id.
20
20
  attr_accessor :room_id
@@ -24,7 +24,7 @@ module Repull
24
24
 
25
25
  attr_accessor :date_range
26
26
 
27
- # Rooms to sell (`roomstosell`). `0` blocks the room for the range.
27
+ # Rooms to sell (`roomstosell`). `0` blocks the room for the range. Omit it to leave inventory alone — `0` is a stop-sell, not a no-op.
28
28
  attr_accessor :available_rooms
29
29
 
30
30
  attr_accessor :status
@@ -62,7 +62,7 @@ module Repull
62
62
  {
63
63
  :'room_id' => :'String',
64
64
  :'rate_id' => :'String',
65
- :'date_range' => :'BookingPricingRateUpdateDateRange',
65
+ :'date_range' => :'BookingAvailabilityUpdateDateRange',
66
66
  :'available_rooms' => :'Integer',
67
67
  :'status' => :'String',
68
68
  :'closed' => :'Boolean',
@@ -73,6 +73,7 @@ module Repull
73
73
  # List of attributes with nullable: true
74
74
  def self.openapi_nullable
75
75
  Set.new([
76
+ :'available_rooms',
76
77
  :'status',
77
78
  :'closed',
78
79
  ])
@@ -114,8 +115,6 @@ module Repull
114
115
 
115
116
  if attributes.key?(:'available_rooms')
116
117
  self.available_rooms = attributes[:'available_rooms']
117
- else
118
- self.available_rooms = nil
119
118
  end
120
119
 
121
120
  if attributes.key?(:'status')
@@ -148,10 +147,6 @@ module Repull
148
147
  invalid_properties.push('invalid value for "date_range", date_range cannot be nil.')
149
148
  end
150
149
 
151
- if @available_rooms.nil?
152
- invalid_properties.push('invalid value for "available_rooms", available_rooms cannot be nil.')
153
- end
154
-
155
150
  invalid_properties
156
151
  end
157
152
 
@@ -162,7 +157,6 @@ module Repull
162
157
  return false if @room_id.nil?
163
158
  return false if @rate_id.nil?
164
159
  return false if @date_range.nil?
165
- return false if @available_rooms.nil?
166
160
  true
167
161
  end
168
162
 
@@ -196,16 +190,6 @@ module Repull
196
190
  @date_range = date_range
197
191
  end
198
192
 
199
- # Custom attribute writer method with validation
200
- # @param [Object] available_rooms Value to be assigned
201
- def available_rooms=(available_rooms)
202
- if available_rooms.nil?
203
- fail ArgumentError, 'available_rooms cannot be nil'
204
- end
205
-
206
- @available_rooms = available_rooms
207
- end
208
-
209
193
  # Checks equality by comparing each attribute.
210
194
  # @param [Object] Object to be compared
211
195
  def ==(o)
@@ -0,0 +1,193 @@
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
+ # The nights this update applies to. **Both ends are inclusive** — `start` equal to `end` is one night.
18
+ class BookingAvailabilityUpdateDateRange < ApiModelBase
19
+ # First night, YYYY-MM-DD.
20
+ attr_accessor :start
21
+
22
+ # Last night, YYYY-MM-DD, inclusive.
23
+ attr_accessor :_end
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'start' => :'start',
29
+ :'_end' => :'end'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'start' => :'Date',
47
+ :'_end' => :'Date'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingAvailabilityUpdateDateRange` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingAvailabilityUpdateDateRange`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'start')
74
+ self.start = attributes[:'start']
75
+ else
76
+ self.start = nil
77
+ end
78
+
79
+ if attributes.key?(:'_end')
80
+ self._end = attributes[:'_end']
81
+ else
82
+ self._end = nil
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @start.nil?
92
+ invalid_properties.push('invalid value for "start", start cannot be nil.')
93
+ end
94
+
95
+ if @_end.nil?
96
+ invalid_properties.push('invalid value for "_end", _end cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @start.nil?
107
+ return false if @_end.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] start Value to be assigned
113
+ def start=(start)
114
+ if start.nil?
115
+ fail ArgumentError, 'start cannot be nil'
116
+ end
117
+
118
+ @start = start
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] _end Value to be assigned
123
+ def _end=(_end)
124
+ if _end.nil?
125
+ fail ArgumentError, '_end cannot be nil'
126
+ end
127
+
128
+ @_end = _end
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ start == o.start &&
137
+ _end == o._end
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [start, _end].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ end
@@ -14,11 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Body for `PUT /v1/channels/booking/availability`. Selects one of Booking's three ARI write paths via `type` and forwards `updates` verbatim to the connector.
17
+ # Body for `PUT /v1/channels/booking/availability`. `type` selects which of Booking.com's writes to perform. Date ranges are inclusive at both ends everywhere in this body.
18
18
  class BookingAvailabilityUpdateRequest < ApiModelBase
19
- # `rates` → price + restrictions (`updateRates`); `availability` → inventory + stop-sell + restrictions (`updateAvailability`); `derived-pricing` → occupancy-derived pricing rules (`updateDerivedPricing`).
19
+ # `rates` → nightly prices (+ any restrictions sent with them), written at an explicit `occupancy`; `availability` → inventory, stop-sell and restrictions; `derived-pricing` → occupancy-derived pricing rules. A rates update may not carry `roomsToSell`: inventory is an `availability` write.
20
20
  attr_accessor :type
21
21
 
22
+ # Only for `type: \"rates\"`. Default `true`: after the write the affected nights are read back off Booking.com so `applied` can say `verified` or `mismatch`. Send `false` to skip the read (one fewer Booking.com call); the response then reports `applied: \"unverified\"`.
23
+ attr_accessor :verify
24
+
22
25
  attr_accessor :property_id
23
26
 
24
27
  # For `type: \"rates\"` each item is a `BookingPricingRateUpdate`; for `type: \"availability\"` a `BookingAvailabilityUpdate`; for `type: \"derived-pricing\"` a derived-price rule set.
@@ -28,6 +31,7 @@ module Repull
28
31
  def self.attribute_map
29
32
  {
30
33
  :'type' => :'type',
34
+ :'verify' => :'verify',
31
35
  :'property_id' => :'property_id',
32
36
  :'updates' => :'updates'
33
37
  }
@@ -47,6 +51,7 @@ module Repull
47
51
  def self.openapi_types
48
52
  {
49
53
  :'type' => :'String',
54
+ :'verify' => :'Boolean',
50
55
  :'property_id' => :'BookingAvailabilityUpdateRequestPropertyId',
51
56
  :'updates' => :'Array<BookingAvailabilityUpdateRequestUpdatesInner>'
52
57
  }
@@ -55,6 +60,7 @@ module Repull
55
60
  # List of attributes with nullable: true
56
61
  def self.openapi_nullable
57
62
  Set.new([
63
+ :'verify',
58
64
  ])
59
65
  end
60
66
 
@@ -80,6 +86,10 @@ module Repull
80
86
  self.type = nil
81
87
  end
82
88
 
89
+ if attributes.key?(:'verify')
90
+ self.verify = attributes[:'verify']
91
+ end
92
+
83
93
  if attributes.key?(:'property_id')
84
94
  self.property_id = attributes[:'property_id']
85
95
  else
@@ -170,6 +180,7 @@ module Repull
170
180
  return true if self.equal?(o)
171
181
  self.class == o.class &&
172
182
  type == o.type &&
183
+ verify == o.verify &&
173
184
  property_id == o.property_id &&
174
185
  updates == o.updates
175
186
  end
@@ -183,7 +194,7 @@ module Repull
183
194
  # Calculates hash code according to all attributes.
184
195
  # @return [Integer] Hash code
185
196
  def hash
186
- [type, property_id, updates].hash
197
+ [type, verify, property_id, updates].hash
187
198
  end
188
199
 
189
200
  # Builds the object from hash
@@ -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