repull 0.2.17 → 0.2.19

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +4 -4
  3. data/lib/repull/api/booking_com_api.rb +113 -17
  4. data/lib/repull/api/health_api.rb +0 -57
  5. data/lib/repull/api/migrate_api.rb +552 -0
  6. data/lib/repull/api/reservations_api.rb +2 -2
  7. data/lib/repull/models/airbnb_permits_response.rb +1 -1
  8. data/lib/repull/models/airbnb_permits_write_request.rb +1 -1
  9. data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +43 -4
  10. data/lib/repull/models/{airbnb_permits_write_request_permits_inner_answers_inner.rb → airbnb_permits_write_request_permits_inner_answers_value.rb} +22 -34
  11. data/lib/repull/models/check_migration_cutover200_response.rb +147 -0
  12. data/lib/repull/models/check_migration_cutover_request.rb +175 -0
  13. data/lib/repull/models/check_migration_cutover_request_reservations_inner.rb +216 -0
  14. data/lib/repull/models/connect_provider.rb +18 -5
  15. data/lib/repull/models/connect_session.rb +25 -5
  16. data/lib/repull/models/create_connect_session_request.rb +81 -5
  17. data/lib/repull/models/create_connect_session_request_copy.rb +251 -0
  18. data/lib/repull/models/create_connect_session_request_workspace.rb +196 -0
  19. data/lib/repull/models/delete_migration200_response.rb +147 -0
  20. data/lib/repull/models/delete_migration200_response_data.rb +165 -0
  21. data/lib/repull/models/get_migration200_response.rb +147 -0
  22. data/lib/repull/models/get_migration_channel_map200_response.rb +147 -0
  23. data/lib/repull/models/get_migration_report200_response.rb +147 -0
  24. data/lib/repull/models/list_migrations200_response.rb +158 -0
  25. data/lib/repull/models/listing_content_update_request.rb +36 -1
  26. data/lib/repull/models/listing_content_update_request_checkout_tasks_inner.rb +210 -0
  27. data/lib/repull/models/listing_content_update_request_pricing.rb +283 -0
  28. data/lib/repull/models/listing_content_update_request_rooms_inner.rb +225 -0
  29. data/lib/repull/models/listing_content_update_request_rooms_inner_beds_inner.rb +209 -0
  30. data/lib/repull/models/listing_content_update_response.rb +1 -1
  31. data/lib/repull/models/listing_create_request.rb +24 -1
  32. data/lib/repull/models/listing_create_response.rb +14 -4
  33. data/lib/repull/models/map_booking_room_request.rb +201 -0
  34. data/lib/repull/models/map_booking_room_response.rb +315 -0
  35. data/lib/repull/models/migration.rb +303 -0
  36. data/lib/repull/models/migration_channel_map.rb +169 -0
  37. data/lib/repull/models/migration_channel_map_listings_inner.rb +208 -0
  38. data/lib/repull/models/migration_channel_map_listings_inner_airbnb.rb +156 -0
  39. data/lib/repull/models/migration_channel_map_listings_inner_booking.rb +156 -0
  40. data/lib/repull/models/migration_channel_map_sources_inner.rb +167 -0
  41. data/lib/repull/models/migration_completed_event.rb +309 -0
  42. data/lib/repull/models/migration_connections_inner.rb +195 -0
  43. data/lib/repull/models/migration_counts.rb +183 -0
  44. data/lib/repull/models/migration_cutover_check.rb +200 -0
  45. data/lib/repull/models/migration_cutover_check_mismatched_inner.rb +156 -0
  46. data/lib/repull/models/migration_failed_event.rb +309 -0
  47. data/lib/repull/models/migration_import_payload.rb +225 -0
  48. data/lib/repull/models/migration_import_payload_results_inner.rb +165 -0
  49. data/lib/repull/models/migration_import_run.rb +202 -0
  50. data/lib/repull/models/migration_import_run_results_inner.rb +165 -0
  51. data/lib/repull/models/migration_report.rb +179 -0
  52. data/lib/repull/models/migration_report_issues_inner.rb +229 -0
  53. data/lib/repull/models/migration_reservation_ref.rb +184 -0
  54. data/lib/repull/models/reservation.rb +12 -2
  55. data/lib/repull/models/run_migration_import202_response.rb +147 -0
  56. data/lib/repull/models/run_migration_import202_response_data.rb +158 -0
  57. data/lib/repull/models/run_migration_import202_response_data_queued_inner.rb +174 -0
  58. data/lib/repull/models/run_migration_import_request.rb +182 -0
  59. data/lib/repull/models/update_booking_content_request.rb +359 -0
  60. data/lib/repull/models/update_booking_content_request_content_data_inner.rb +156 -0
  61. data/lib/repull/models/update_booking_content_request_photos_inner.rb +164 -0
  62. data/lib/repull/models/webhook_event.rb +4 -0
  63. data/lib/repull/models/webhook_event_type.rb +3 -1
  64. data/lib/repull/version.rb +1 -1
  65. data/lib/repull.rb +45 -1
  66. data/openapi/v1.json +3855 -2272
  67. metadata +47 -3
@@ -0,0 +1,209 @@
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 ListingContentUpdateRequestRoomsInnerBedsInner < ApiModelBase
18
+ # e.g. `king_bed`, `queen_bed`, `double_bed`, `single_bed`, `sofa_bed`, `bunk_bed`.
19
+ attr_accessor :bed_type
20
+
21
+ attr_accessor :quantity
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'bed_type' => :'bedType',
27
+ :'quantity' => :'quantity'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'bed_type' => :'String',
45
+ :'quantity' => :'Integer'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingContentUpdateRequestRoomsInnerBedsInner` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingContentUpdateRequestRoomsInnerBedsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'bed_type')
72
+ self.bed_type = attributes[:'bed_type']
73
+ else
74
+ self.bed_type = nil
75
+ end
76
+
77
+ if attributes.key?(:'quantity')
78
+ self.quantity = attributes[:'quantity']
79
+ else
80
+ self.quantity = nil
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
88
+ invalid_properties = Array.new
89
+ if @bed_type.nil?
90
+ invalid_properties.push('invalid value for "bed_type", bed_type cannot be nil.')
91
+ end
92
+
93
+ if @quantity.nil?
94
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
95
+ end
96
+
97
+ if @quantity > 20
98
+ invalid_properties.push('invalid value for "quantity", must be smaller than or equal to 20.')
99
+ end
100
+
101
+ if @quantity < 1
102
+ invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ warn '[DEPRECATED] the `valid?` method is obsolete'
112
+ return false if @bed_type.nil?
113
+ return false if @quantity.nil?
114
+ return false if @quantity > 20
115
+ return false if @quantity < 1
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] bed_type Value to be assigned
121
+ def bed_type=(bed_type)
122
+ if bed_type.nil?
123
+ fail ArgumentError, 'bed_type cannot be nil'
124
+ end
125
+
126
+ @bed_type = bed_type
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] quantity Value to be assigned
131
+ def quantity=(quantity)
132
+ if quantity.nil?
133
+ fail ArgumentError, 'quantity cannot be nil'
134
+ end
135
+
136
+ if quantity > 20
137
+ fail ArgumentError, 'invalid value for "quantity", must be smaller than or equal to 20.'
138
+ end
139
+
140
+ if quantity < 1
141
+ fail ArgumentError, 'invalid value for "quantity", must be greater than or equal to 1.'
142
+ end
143
+
144
+ @quantity = quantity
145
+ end
146
+
147
+ # Checks equality by comparing each attribute.
148
+ # @param [Object] Object to be compared
149
+ def ==(o)
150
+ return true if self.equal?(o)
151
+ self.class == o.class &&
152
+ bed_type == o.bed_type &&
153
+ quantity == o.quantity
154
+ end
155
+
156
+ # @see the `==` method
157
+ # @param [Object] Object to be compared
158
+ def eql?(o)
159
+ self == o
160
+ end
161
+
162
+ # Calculates hash code according to all attributes.
163
+ # @return [Integer] Hash code
164
+ def hash
165
+ [bed_type, quantity].hash
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def self.build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ transformed_hash = {}
175
+ openapi_types.each_pair do |key, type|
176
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = nil
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[attribute_map[key]].is_a?(Array)
182
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
183
+ end
184
+ elsif !attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
186
+ end
187
+ end
188
+ new(transformed_hash)
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = self.send(attr)
197
+ if value.nil?
198
+ is_nullable = self.class.openapi_nullable.include?(attr)
199
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
200
+ end
201
+
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ end
208
+
209
+ end
@@ -18,7 +18,7 @@ module Repull
18
18
  # The listing id (serialized as a string to preserve precision).
19
19
  attr_accessor :id
20
20
 
21
- # Content slabs that were actually written, e.g. [\"title\",\"occupancy\",\"amenities\"]. A non-English write also reports `locale:<tag>` so you can see which row was written.
21
+ # Content slabs that were actually written, e.g. [\"title\",\"occupancy\",\"amenities\"]. A non-English write also reports `locale:<tag>` so you can see which row was written. A rate change reports `pricing`, and `calendar` as well when nights on the calendar moved to the new rate.
22
22
  attr_accessor :changed
23
23
 
24
24
  # Provided-but-not-applied fields — e.g. \"photos\" when a non-empty photos array carried no valid http(s) URL.
@@ -63,8 +63,15 @@ module Repull
63
63
 
64
64
  attr_accessor :description
65
65
 
66
+ # Nightly rate for every night that is not a weekend night. Stating it is what gives the new listing a calendar: 365 nights are written from it, and that calendar is what a publish sends to the channel. Without a price the listing has no availability to publish, which Booking.com refuses with \"No availability pushed\".
66
67
  attr_accessor :default_daily_price
67
68
 
69
+ # Nightly rate for Saturday and Sunday nights (UTC). Omit it and those nights take `defaultDailyPrice`. It is the same rate the direct-booking quoter charges for a weekend night, so the calendar and a quote cannot disagree.
70
+ attr_accessor :weekend_price
71
+
72
+ # Charged per guest above the number included in the nightly rate.
73
+ attr_accessor :price_per_extra_guest
74
+
68
75
  attr_accessor :cleaning_fee
69
76
 
70
77
  attr_accessor :cancellation_policy
@@ -103,6 +110,8 @@ module Repull
103
110
  :'summary' => :'summary',
104
111
  :'description' => :'description',
105
112
  :'default_daily_price' => :'defaultDailyPrice',
113
+ :'weekend_price' => :'weekendPrice',
114
+ :'price_per_extra_guest' => :'pricePerExtraGuest',
106
115
  :'cleaning_fee' => :'cleaningFee',
107
116
  :'cancellation_policy' => :'cancellationPolicy',
108
117
  :'check_in_time_start' => :'checkInTimeStart',
@@ -146,6 +155,8 @@ module Repull
146
155
  :'summary' => :'String',
147
156
  :'description' => :'String',
148
157
  :'default_daily_price' => :'Float',
158
+ :'weekend_price' => :'Float',
159
+ :'price_per_extra_guest' => :'Float',
149
160
  :'cleaning_fee' => :'Float',
150
161
  :'cancellation_policy' => :'String',
151
162
  :'check_in_time_start' => :'String',
@@ -160,6 +171,8 @@ module Repull
160
171
  # List of attributes with nullable: true
161
172
  def self.openapi_nullable
162
173
  Set.new([
174
+ :'weekend_price',
175
+ :'price_per_extra_guest',
163
176
  ])
164
177
  end
165
178
 
@@ -257,6 +270,14 @@ module Repull
257
270
  self.default_daily_price = attributes[:'default_daily_price']
258
271
  end
259
272
 
273
+ if attributes.key?(:'weekend_price')
274
+ self.weekend_price = attributes[:'weekend_price']
275
+ end
276
+
277
+ if attributes.key?(:'price_per_extra_guest')
278
+ self.price_per_extra_guest = attributes[:'price_per_extra_guest']
279
+ end
280
+
260
281
  if attributes.key?(:'cleaning_fee')
261
282
  self.cleaning_fee = attributes[:'cleaning_fee']
262
283
  end
@@ -344,6 +365,8 @@ module Repull
344
365
  summary == o.summary &&
345
366
  description == o.description &&
346
367
  default_daily_price == o.default_daily_price &&
368
+ weekend_price == o.weekend_price &&
369
+ price_per_extra_guest == o.price_per_extra_guest &&
347
370
  cleaning_fee == o.cleaning_fee &&
348
371
  cancellation_policy == o.cancellation_policy &&
349
372
  check_in_time_start == o.check_in_time_start &&
@@ -363,7 +386,7 @@ module Repull
363
386
  # Calculates hash code according to all attributes.
364
387
  # @return [Integer] Hash code
365
388
  def hash
366
- [name, property_type, room_type_category, property_type_category, street, city, state, postal_code, zipcode, country_code, lat, lng, bedrooms, bathrooms, beds, person_capacity, summary, description, default_daily_price, cleaning_fee, cancellation_policy, check_in_time_start, check_out_time, allows_pets, allows_smoking, allows_children, allows_events].hash
389
+ [name, property_type, room_type_category, property_type_category, street, city, state, postal_code, zipcode, country_code, lat, lng, bedrooms, bathrooms, beds, person_capacity, summary, description, default_daily_price, weekend_price, price_per_extra_guest, cleaning_fee, cancellation_policy, check_in_time_start, check_out_time, allows_pets, allows_smoking, allows_children, allows_events].hash
367
390
  end
368
391
 
369
392
  # Builds the object from hash
@@ -18,10 +18,14 @@ module Repull
18
18
  # New listing ID — use for follow-up generate-content / publish calls
19
19
  attr_accessor :id
20
20
 
21
+ # Nights of calendar written from the price you stated. `0` means the listing has no calendar and a publish will send no availability — state `defaultDailyPrice` on the create, or set it later with `PUT /v1/listings/{id}/content` under `pricing`.
22
+ attr_accessor :calendar_days_seeded
23
+
21
24
  # Attribute mapping from ruby-style variable name to JSON key.
22
25
  def self.attribute_map
23
26
  {
24
- :'id' => :'id'
27
+ :'id' => :'id',
28
+ :'calendar_days_seeded' => :'calendarDaysSeeded'
25
29
  }
26
30
  end
27
31
 
@@ -38,7 +42,8 @@ module Repull
38
42
  # Attribute type mapping.
39
43
  def self.openapi_types
40
44
  {
41
- :'id' => :'String'
45
+ :'id' => :'String',
46
+ :'calendar_days_seeded' => :'Integer'
42
47
  }
43
48
  end
44
49
 
@@ -67,6 +72,10 @@ module Repull
67
72
  if attributes.key?(:'id')
68
73
  self.id = attributes[:'id']
69
74
  end
75
+
76
+ if attributes.key?(:'calendar_days_seeded')
77
+ self.calendar_days_seeded = attributes[:'calendar_days_seeded']
78
+ end
70
79
  end
71
80
 
72
81
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -89,7 +98,8 @@ module Repull
89
98
  def ==(o)
90
99
  return true if self.equal?(o)
91
100
  self.class == o.class &&
92
- id == o.id
101
+ id == o.id &&
102
+ calendar_days_seeded == o.calendar_days_seeded
93
103
  end
94
104
 
95
105
  # @see the `==` method
@@ -101,7 +111,7 @@ module Repull
101
111
  # Calculates hash code according to all attributes.
102
112
  # @return [Integer] Hash code
103
113
  def hash
104
- [id].hash
114
+ [id, calendar_days_seeded].hash
105
115
  end
106
116
 
107
117
  # Builds the object from hash
@@ -0,0 +1,201 @@
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
+ # Body for `POST /v1/channels/booking/listings/map`.
18
+ class MapBookingRoomRequest < ApiModelBase
19
+ # Booking.com's own room id. Discover it via `GET /v1/channels/booking/properties/{id}/rooms` (`rooms[].roomId`). A number is also accepted.
20
+ attr_accessor :room_booking_id
21
+
22
+ # Canonical Repull listing id to link the room to. Must belong to your workspace and be active. `null` unmaps the room and removes its channel link. The field is required — omitting it is a 422, not an unmap.
23
+ attr_accessor :listing_id
24
+
25
+ # Optional. When present, must be the Booking.com property the room belongs to — guards against mapping a room of the wrong property when looping over several.
26
+ attr_accessor :hotel_id
27
+
28
+ # Whether the resulting channel link has sync enabled.
29
+ attr_accessor :sync_enabled
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'room_booking_id' => :'roomBookingId',
35
+ :'listing_id' => :'listingId',
36
+ :'hotel_id' => :'hotelId',
37
+ :'sync_enabled' => :'syncEnabled'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'room_booking_id' => :'String',
55
+ :'listing_id' => :'Integer',
56
+ :'hotel_id' => :'String',
57
+ :'sync_enabled' => :'Boolean'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'listing_id',
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::MapBookingRoomRequest` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::MapBookingRoomRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'room_booking_id')
85
+ self.room_booking_id = attributes[:'room_booking_id']
86
+ else
87
+ self.room_booking_id = nil
88
+ end
89
+
90
+ if attributes.key?(:'listing_id')
91
+ self.listing_id = attributes[:'listing_id']
92
+ else
93
+ self.listing_id = nil
94
+ end
95
+
96
+ if attributes.key?(:'hotel_id')
97
+ self.hotel_id = attributes[:'hotel_id']
98
+ end
99
+
100
+ if attributes.key?(:'sync_enabled')
101
+ self.sync_enabled = attributes[:'sync_enabled']
102
+ else
103
+ self.sync_enabled = true
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @room_booking_id.nil?
113
+ invalid_properties.push('invalid value for "room_booking_id", room_booking_id cannot be nil.')
114
+ end
115
+
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ return false if @room_booking_id.nil?
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] room_booking_id Value to be assigned
129
+ def room_booking_id=(room_booking_id)
130
+ if room_booking_id.nil?
131
+ fail ArgumentError, 'room_booking_id cannot be nil'
132
+ end
133
+
134
+ @room_booking_id = room_booking_id
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ room_booking_id == o.room_booking_id &&
143
+ listing_id == o.listing_id &&
144
+ hotel_id == o.hotel_id &&
145
+ sync_enabled == o.sync_enabled
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [room_booking_id, listing_id, hotel_id, sync_enabled].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ attributes = attributes.transform_keys(&:to_sym)
166
+ transformed_hash = {}
167
+ openapi_types.each_pair do |key, type|
168
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = nil
170
+ elsif type =~ /\AArray<(.*)>/i
171
+ # check to ensure the input is an array given that the attribute
172
+ # is documented as an array but the input is not
173
+ if attributes[attribute_map[key]].is_a?(Array)
174
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
+ end
176
+ elsif !attributes[attribute_map[key]].nil?
177
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
+ end
179
+ end
180
+ new(transformed_hash)
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ end
200
+
201
+ end