repull 0.2.16 → 0.2.18

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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +10 -10
  3. data/lib/repull/api/booking_com_api.rb +86 -2
  4. data/lib/repull/api/conversations_api.rb +8 -8
  5. data/lib/repull/api/health_api.rb +0 -57
  6. data/lib/repull/api/listings_api.rb +182 -12
  7. data/lib/repull/api/migrate_api.rb +552 -0
  8. data/lib/repull/api/reservations_api.rb +6 -6
  9. data/lib/repull/models/airbnb_permits_response.rb +1 -1
  10. data/lib/repull/models/airbnb_permits_write_request.rb +1 -1
  11. data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +43 -4
  12. data/lib/repull/models/{airbnb_permits_write_request_permits_inner_answers_inner.rb → airbnb_permits_write_request_permits_inner_answers_value.rb} +22 -34
  13. data/lib/repull/models/airbnb_publish_result.rb +41 -2
  14. data/lib/repull/models/booking_property_action_request.rb +176 -0
  15. data/lib/repull/models/booking_property_action_response.rb +281 -0
  16. data/lib/repull/models/booking_publish_result.rb +245 -0
  17. data/lib/repull/models/booking_publish_section_error.rb +220 -0
  18. data/lib/repull/models/booking_setup_request.rb +44 -5
  19. data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -0
  20. data/lib/repull/models/channel_market_state_item.rb +291 -0
  21. data/lib/repull/models/check_migration_cutover200_response.rb +147 -0
  22. data/lib/repull/models/check_migration_cutover_request.rb +175 -0
  23. data/lib/repull/models/check_migration_cutover_request_reservations_inner.rb +216 -0
  24. data/lib/repull/models/connect_provider.rb +18 -5
  25. data/lib/repull/models/connect_session.rb +25 -5
  26. data/lib/repull/models/create_connect_session_request.rb +81 -5
  27. data/lib/repull/models/create_connect_session_request_copy.rb +251 -0
  28. data/lib/repull/models/create_connect_session_request_workspace.rb +196 -0
  29. data/lib/repull/models/delete_migration200_response.rb +147 -0
  30. data/lib/repull/models/delete_migration200_response_data.rb +165 -0
  31. data/lib/repull/models/error_error.rb +11 -1
  32. data/lib/repull/models/get_migration200_response.rb +147 -0
  33. data/lib/repull/models/get_migration_channel_map200_response.rb +147 -0
  34. data/lib/repull/models/get_migration_report200_response.rb +147 -0
  35. data/lib/repull/models/inquiry_updated_payload.rb +1 -1
  36. data/lib/repull/models/list_inquiries200_response_data_inner.rb +1 -1
  37. data/lib/repull/models/list_migrations200_response.rb +158 -0
  38. data/lib/repull/models/listing_address_readiness.rb +171 -0
  39. data/lib/repull/models/listing_content_update_request.rb +10 -1
  40. data/lib/repull/models/listing_content_update_request_address.rb +40 -3
  41. data/lib/repull/models/listing_content_update_request_pricing.rb +235 -0
  42. data/lib/repull/models/listing_content_update_response.rb +1 -1
  43. data/lib/repull/models/listing_create_request.rb +71 -2
  44. data/lib/repull/models/listing_create_response.rb +14 -4
  45. data/lib/repull/models/listing_market_state_request.rb +149 -0
  46. data/lib/repull/models/listing_market_state_response.rb +221 -0
  47. data/lib/repull/models/listing_publish_booking_request.rb +149 -0
  48. data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
  49. data/lib/repull/models/listing_publish_status_channel.rb +32 -1
  50. data/lib/repull/models/listing_publish_status_connection.rb +17 -5
  51. data/lib/repull/models/listing_publish_status_response.rb +13 -1
  52. data/lib/repull/models/migration.rb +303 -0
  53. data/lib/repull/models/migration_channel_map.rb +169 -0
  54. data/lib/repull/models/migration_channel_map_listings_inner.rb +208 -0
  55. data/lib/repull/models/migration_channel_map_listings_inner_airbnb.rb +156 -0
  56. data/lib/repull/models/migration_channel_map_listings_inner_booking.rb +156 -0
  57. data/lib/repull/models/migration_channel_map_sources_inner.rb +167 -0
  58. data/lib/repull/models/migration_completed_event.rb +309 -0
  59. data/lib/repull/models/migration_connections_inner.rb +195 -0
  60. data/lib/repull/models/migration_counts.rb +183 -0
  61. data/lib/repull/models/migration_cutover_check.rb +200 -0
  62. data/lib/repull/models/migration_cutover_check_mismatched_inner.rb +156 -0
  63. data/lib/repull/models/migration_failed_event.rb +309 -0
  64. data/lib/repull/models/migration_import_payload.rb +225 -0
  65. data/lib/repull/models/migration_import_payload_results_inner.rb +165 -0
  66. data/lib/repull/models/migration_import_run.rb +202 -0
  67. data/lib/repull/models/migration_import_run_results_inner.rb +165 -0
  68. data/lib/repull/models/migration_report.rb +179 -0
  69. data/lib/repull/models/migration_report_issues_inner.rb +229 -0
  70. data/lib/repull/models/migration_reservation_ref.rb +184 -0
  71. data/lib/repull/models/reservation.rb +12 -2
  72. data/lib/repull/models/reservation_request_updated_payload.rb +1 -1
  73. data/lib/repull/models/run_migration_import202_response.rb +147 -0
  74. data/lib/repull/models/run_migration_import202_response_data.rb +158 -0
  75. data/lib/repull/models/run_migration_import202_response_data_queued_inner.rb +174 -0
  76. data/lib/repull/models/run_migration_import_request.rb +182 -0
  77. data/lib/repull/models/webhook_event.rb +4 -0
  78. data/lib/repull/models/webhook_event_type.rb +3 -1
  79. data/lib/repull/version.rb +1 -1
  80. data/lib/repull.rb +48 -2
  81. data/openapi/v1.json +2398 -433
  82. data/scripts/regen.sh +1 -1
  83. metadata +50 -4
@@ -0,0 +1,220 @@
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
+ # One section of a publish that did not reach Booking.com.
18
+ class BookingPublishSectionError < ApiModelBase
19
+ # Which part of the listing this failure is about — e.g. `details`, `description`, `amenities`, `rooms`, `photos`, `pricing`.
20
+ attr_accessor :section
21
+
22
+ # Booking.com's own reason, verbatim, or ours when we refused to send an empty section.
23
+ attr_accessor :message
24
+
25
+ # `no_content` — there was nothing canonical to send for this section; write the content, then publish again. `rejected` — Booking.com refused the section as sent; fix the content, or the property's Content API permissions, and publish again. Airbnb's third code, `locked`, has no Booking.com counterpart and never appears here.
26
+ attr_accessor :code
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'section' => :'section',
32
+ :'message' => :'message',
33
+ :'code' => :'code'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'section' => :'String',
51
+ :'message' => :'String',
52
+ :'code' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingPublishSectionError` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingPublishSectionError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'section')
79
+ self.section = attributes[:'section']
80
+ else
81
+ self.section = nil
82
+ end
83
+
84
+ if attributes.key?(:'message')
85
+ self.message = attributes[:'message']
86
+ else
87
+ self.message = nil
88
+ end
89
+
90
+ if attributes.key?(:'code')
91
+ self.code = attributes[:'code']
92
+ else
93
+ self.code = nil
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ if @section.nil?
103
+ invalid_properties.push('invalid value for "section", section cannot be nil.')
104
+ end
105
+
106
+ if @message.nil?
107
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
108
+ end
109
+
110
+ if @code.nil?
111
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ warn '[DEPRECATED] the `valid?` method is obsolete'
121
+ return false if @section.nil?
122
+ return false if @message.nil?
123
+ return false if @code.nil?
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] section Value to be assigned
129
+ def section=(section)
130
+ if section.nil?
131
+ fail ArgumentError, 'section cannot be nil'
132
+ end
133
+
134
+ @section = section
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] message Value to be assigned
139
+ def message=(message)
140
+ if message.nil?
141
+ fail ArgumentError, 'message cannot be nil'
142
+ end
143
+
144
+ @message = message
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] code Value to be assigned
149
+ def code=(code)
150
+ if code.nil?
151
+ fail ArgumentError, 'code cannot be nil'
152
+ end
153
+
154
+ @code = code
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ section == o.section &&
163
+ message == o.message &&
164
+ code == o.code
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [section, message, code].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -17,10 +17,21 @@ module Repull
17
17
  class BookingSetupRequest < ApiModelBase
18
18
  attr_accessor :action
19
19
 
20
- # Booking.com property id — required for readiness/open/contacts/policies actions.
20
+ # Repull listing id — required for `create-property`, `add-room` and `add-unit`. NOT a Booking.com Hotel ID. `listingId` is accepted as an alias.
21
+ attr_accessor :listing_id
22
+
23
+ # Booking.com Hotel ID — required for `add-room`, `add-unit`, `advance`, and the readiness/open/contacts/policies actions.
21
24
  attr_accessor :property_id
22
25
 
23
- # Legal entity id — required for `check-legal-status`.
26
+ # Booking.com room id — required for `add-unit`. `GET /v1/channels/booking/properties/{listingId}/rooms` lists them. `roomId` is accepted as an alias.
27
+ attr_accessor :room_id
28
+
29
+ # Optional override for `create-property`. Omit it: the legal entity this workspace already uses is resolved automatically. An id that carries another workspace's properties is refused with `403 legal_entity_not_yours`. `legalEntityId` is accepted as an alias.
30
+ attr_accessor :legal_entity_id
31
+
32
+ attr_accessor :legal_entity
33
+
34
+ # Legal entity id — required for `check-legal-status`, which always answers 404.
24
35
  attr_accessor :leid
25
36
 
26
37
  # Contacts payload for `set-contacts`.
@@ -52,7 +63,11 @@ module Repull
52
63
  def self.attribute_map
53
64
  {
54
65
  :'action' => :'action',
66
+ :'listing_id' => :'listing_id',
55
67
  :'property_id' => :'property_id',
68
+ :'room_id' => :'room_id',
69
+ :'legal_entity_id' => :'legal_entity_id',
70
+ :'legal_entity' => :'legal_entity',
56
71
  :'leid' => :'leid',
57
72
  :'contacts' => :'contacts'
58
73
  }
@@ -72,7 +87,11 @@ module Repull
72
87
  def self.openapi_types
73
88
  {
74
89
  :'action' => :'String',
90
+ :'listing_id' => :'Integer',
75
91
  :'property_id' => :'String',
92
+ :'room_id' => :'Integer',
93
+ :'legal_entity_id' => :'Integer',
94
+ :'legal_entity' => :'BookingSetupRequestLegalEntity',
76
95
  :'leid' => :'Integer',
77
96
  :'contacts' => :'Array<Hash<String, Object>>'
78
97
  }
@@ -106,10 +125,26 @@ module Repull
106
125
  self.action = nil
107
126
  end
108
127
 
128
+ if attributes.key?(:'listing_id')
129
+ self.listing_id = attributes[:'listing_id']
130
+ end
131
+
109
132
  if attributes.key?(:'property_id')
110
133
  self.property_id = attributes[:'property_id']
111
134
  end
112
135
 
136
+ if attributes.key?(:'room_id')
137
+ self.room_id = attributes[:'room_id']
138
+ end
139
+
140
+ if attributes.key?(:'legal_entity_id')
141
+ self.legal_entity_id = attributes[:'legal_entity_id']
142
+ end
143
+
144
+ if attributes.key?(:'legal_entity')
145
+ self.legal_entity = attributes[:'legal_entity']
146
+ end
147
+
113
148
  if attributes.key?(:'leid')
114
149
  self.leid = attributes[:'leid']
115
150
  end
@@ -138,7 +173,7 @@ module Repull
138
173
  def valid?
139
174
  warn '[DEPRECATED] the `valid?` method is obsolete'
140
175
  return false if @action.nil?
141
- action_validator = EnumAttributeValidator.new('String', ["create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
176
+ action_validator = EnumAttributeValidator.new('String', ["create-property", "add-room", "add-unit", "advance", "create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
142
177
  return false unless action_validator.valid?(@action)
143
178
  true
144
179
  end
@@ -146,7 +181,7 @@ module Repull
146
181
  # Custom attribute writer method checking allowed values (enum).
147
182
  # @param [Object] action Object to be assigned
148
183
  def action=(action)
149
- validator = EnumAttributeValidator.new('String', ["create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
184
+ validator = EnumAttributeValidator.new('String', ["create-property", "add-room", "add-unit", "advance", "create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
150
185
  unless validator.valid?(action)
151
186
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
152
187
  end
@@ -159,7 +194,11 @@ module Repull
159
194
  return true if self.equal?(o)
160
195
  self.class == o.class &&
161
196
  action == o.action &&
197
+ listing_id == o.listing_id &&
162
198
  property_id == o.property_id &&
199
+ room_id == o.room_id &&
200
+ legal_entity_id == o.legal_entity_id &&
201
+ legal_entity == o.legal_entity &&
163
202
  leid == o.leid &&
164
203
  contacts == o.contacts
165
204
  end
@@ -173,7 +212,7 @@ module Repull
173
212
  # Calculates hash code according to all attributes.
174
213
  # @return [Integer] Hash code
175
214
  def hash
176
- [action, property_id, leid, contacts].hash
215
+ [action, listing_id, property_id, room_id, legal_entity_id, legal_entity, leid, contacts].hash
177
216
  end
178
217
 
179
218
  # Builds the object from hash
@@ -0,0 +1,235 @@
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
+ # Used by `create-property` ONLY when this workspace has no legal entity yet — one is registered with Booking.com from these details and used for the property. Ignored when the workspace already has one, so a second is never registered.
18
+ class BookingSetupRequestLegalEntity < ApiModelBase
19
+ attr_accessor :company_name
20
+
21
+ attr_accessor :legal_contact_name
22
+
23
+ attr_accessor :legal_contact_email
24
+
25
+ attr_accessor :country
26
+
27
+ attr_accessor :city
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'company_name' => :'company_name',
33
+ :'legal_contact_name' => :'legal_contact_name',
34
+ :'legal_contact_email' => :'legal_contact_email',
35
+ :'country' => :'country',
36
+ :'city' => :'city'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'company_name' => :'String',
54
+ :'legal_contact_name' => :'String',
55
+ :'legal_contact_email' => :'String',
56
+ :'country' => :'String',
57
+ :'city' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingSetupRequestLegalEntity` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingSetupRequestLegalEntity`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'company_name')
84
+ self.company_name = attributes[:'company_name']
85
+ else
86
+ self.company_name = nil
87
+ end
88
+
89
+ if attributes.key?(:'legal_contact_name')
90
+ self.legal_contact_name = attributes[:'legal_contact_name']
91
+ else
92
+ self.legal_contact_name = nil
93
+ end
94
+
95
+ if attributes.key?(:'legal_contact_email')
96
+ self.legal_contact_email = attributes[:'legal_contact_email']
97
+ else
98
+ self.legal_contact_email = nil
99
+ end
100
+
101
+ if attributes.key?(:'country')
102
+ self.country = attributes[:'country']
103
+ end
104
+
105
+ if attributes.key?(:'city')
106
+ self.city = attributes[:'city']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ if @company_name.nil?
116
+ invalid_properties.push('invalid value for "company_name", company_name cannot be nil.')
117
+ end
118
+
119
+ if @legal_contact_name.nil?
120
+ invalid_properties.push('invalid value for "legal_contact_name", legal_contact_name cannot be nil.')
121
+ end
122
+
123
+ if @legal_contact_email.nil?
124
+ invalid_properties.push('invalid value for "legal_contact_email", legal_contact_email cannot be nil.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
+ return false if @company_name.nil?
135
+ return false if @legal_contact_name.nil?
136
+ return false if @legal_contact_email.nil?
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] company_name Value to be assigned
142
+ def company_name=(company_name)
143
+ if company_name.nil?
144
+ fail ArgumentError, 'company_name cannot be nil'
145
+ end
146
+
147
+ @company_name = company_name
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] legal_contact_name Value to be assigned
152
+ def legal_contact_name=(legal_contact_name)
153
+ if legal_contact_name.nil?
154
+ fail ArgumentError, 'legal_contact_name cannot be nil'
155
+ end
156
+
157
+ @legal_contact_name = legal_contact_name
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] legal_contact_email Value to be assigned
162
+ def legal_contact_email=(legal_contact_email)
163
+ if legal_contact_email.nil?
164
+ fail ArgumentError, 'legal_contact_email cannot be nil'
165
+ end
166
+
167
+ @legal_contact_email = legal_contact_email
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ company_name == o.company_name &&
176
+ legal_contact_name == o.legal_contact_name &&
177
+ legal_contact_email == o.legal_contact_email &&
178
+ country == o.country &&
179
+ city == o.city
180
+ end
181
+
182
+ # @see the `==` method
183
+ # @param [Object] Object to be compared
184
+ def eql?(o)
185
+ self == o
186
+ end
187
+
188
+ # Calculates hash code according to all attributes.
189
+ # @return [Integer] Hash code
190
+ def hash
191
+ [company_name, legal_contact_name, legal_contact_email, country, city].hash
192
+ end
193
+
194
+ # Builds the object from hash
195
+ # @param [Hash] attributes Model attributes in the form of hash
196
+ # @return [Object] Returns the model itself
197
+ def self.build_from_hash(attributes)
198
+ return nil unless attributes.is_a?(Hash)
199
+ attributes = attributes.transform_keys(&:to_sym)
200
+ transformed_hash = {}
201
+ openapi_types.each_pair do |key, type|
202
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = nil
204
+ elsif type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the attribute
206
+ # is documented as an array but the input is not
207
+ if attributes[attribute_map[key]].is_a?(Array)
208
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
209
+ end
210
+ elsif !attributes[attribute_map[key]].nil?
211
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
212
+ end
213
+ end
214
+ new(transformed_hash)
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ end
234
+
235
+ end