repull 0.2.30 → 0.2.31

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +2 -2
  3. data/lib/repull/api/billing_api.rb +68 -9
  4. data/lib/repull/api/connect_api.rb +139 -0
  5. data/lib/repull/api/conversations_api.rb +5 -2
  6. data/lib/repull/api/health_api.rb +2 -2
  7. data/lib/repull/api/hotels_api.rb +142 -0
  8. data/lib/repull/api/workspaces_api.rb +96 -0
  9. data/lib/repull/configuration.rb +0 -4
  10. data/lib/repull/models/availability_batch_write_request.rb +30 -1
  11. data/lib/repull/models/availability_write_request.rb +30 -1
  12. data/lib/repull/models/availability_write_settings.rb +33 -4
  13. data/lib/repull/models/connect_provider.rb +2 -2
  14. data/lib/repull/models/connect_session.rb +12 -2
  15. data/lib/repull/models/create_billing_checkout200_response.rb +156 -0
  16. data/lib/repull/models/create_billing_checkout_request.rb +2 -2
  17. data/lib/repull/models/create_connect_session_request.rb +13 -1
  18. data/lib/repull/models/create_connect_session_request_workspace.rb +1 -1
  19. data/lib/repull/models/get_billing200_response.rb +183 -0
  20. data/lib/repull/models/get_billing200_response_limits.rb +160 -0
  21. data/lib/repull/models/get_billing200_response_used.rb +156 -0
  22. data/lib/repull/models/get_channel_health200_response_vrbo.rb +11 -1
  23. data/lib/repull/models/get_hotel200_response.rb +252 -0
  24. data/lib/repull/models/get_hotel200_response_room_types_inner.rb +168 -0
  25. data/lib/repull/models/get_usage_summary200_response.rb +10 -1
  26. data/lib/repull/models/get_usage_summary200_response_credits.rb +186 -0
  27. data/lib/repull/models/list_hotels200_response.rb +158 -0
  28. data/lib/repull/models/list_hotels200_response_data_inner.rb +241 -0
  29. data/lib/repull/models/list_workspaces200_response.rb +158 -0
  30. data/lib/repull/models/listing.rb +50 -1
  31. data/lib/repull/models/listing_hotel.rb +202 -0
  32. data/lib/repull/models/record_account.rb +15 -5
  33. data/lib/repull/models/reservation_message_received_payload.rb +12 -1
  34. data/lib/repull/models/reservation_message_sent_payload.rb +12 -1
  35. data/lib/repull/models/reservation_message_updated_payload.rb +12 -1
  36. data/lib/repull/models/select_provider_response.rb +1 -1
  37. data/lib/repull/models/workspace.rb +265 -0
  38. data/lib/repull/version.rb +1 -1
  39. data/lib/repull.rb +14 -0
  40. data/openapi/v1.json +633 -18
  41. metadata +16 -2
@@ -0,0 +1,265 @@
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` | unlimited (10 included, then billed per listing) | | `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
+
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
+ # A sub-workspace: one customer of yours, with its own connections, listings and data. Send its `workspaceId` as `X-Workspace-Id` to act on it.
18
+ class Workspace < ApiModelBase
19
+ attr_accessor :workspace_id
20
+
21
+ attr_accessor :name
22
+
23
+ # Your own id for this customer, as you sent it.
24
+ attr_accessor :external_ref
25
+
26
+ # `connect` — opened by a Connect session; `migrate` — opened by Repull Migrate.
27
+ attr_accessor :created_via
28
+
29
+ attr_accessor :active
30
+
31
+ attr_accessor :created_at
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'workspace_id' => :'workspaceId',
37
+ :'name' => :'name',
38
+ :'external_ref' => :'externalRef',
39
+ :'created_via' => :'createdVia',
40
+ :'active' => :'active',
41
+ :'created_at' => :'createdAt'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'workspace_id' => :'String',
59
+ :'name' => :'String',
60
+ :'external_ref' => :'String',
61
+ :'created_via' => :'String',
62
+ :'active' => :'Boolean',
63
+ :'created_at' => :'Time'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ :'external_ref',
71
+ :'created_via',
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::Workspace` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::Workspace`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'workspace_id')
92
+ self.workspace_id = attributes[:'workspace_id']
93
+ else
94
+ self.workspace_id = nil
95
+ end
96
+
97
+ if attributes.key?(:'name')
98
+ self.name = attributes[:'name']
99
+ else
100
+ self.name = nil
101
+ end
102
+
103
+ if attributes.key?(:'external_ref')
104
+ self.external_ref = attributes[:'external_ref']
105
+ end
106
+
107
+ if attributes.key?(:'created_via')
108
+ self.created_via = attributes[:'created_via']
109
+ end
110
+
111
+ if attributes.key?(:'active')
112
+ self.active = attributes[:'active']
113
+ else
114
+ self.active = nil
115
+ end
116
+
117
+ if attributes.key?(:'created_at')
118
+ self.created_at = attributes[:'created_at']
119
+ else
120
+ self.created_at = nil
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
128
+ invalid_properties = Array.new
129
+ if @workspace_id.nil?
130
+ invalid_properties.push('invalid value for "workspace_id", workspace_id cannot be nil.')
131
+ end
132
+
133
+ if @name.nil?
134
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
135
+ end
136
+
137
+ if @active.nil?
138
+ invalid_properties.push('invalid value for "active", active cannot be nil.')
139
+ end
140
+
141
+ if @created_at.nil?
142
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
143
+ end
144
+
145
+ invalid_properties
146
+ end
147
+
148
+ # Check to see if the all the properties in the model are valid
149
+ # @return true if the model is valid
150
+ def valid?
151
+ warn '[DEPRECATED] the `valid?` method is obsolete'
152
+ return false if @workspace_id.nil?
153
+ return false if @name.nil?
154
+ return false if @active.nil?
155
+ return false if @created_at.nil?
156
+ true
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] workspace_id Value to be assigned
161
+ def workspace_id=(workspace_id)
162
+ if workspace_id.nil?
163
+ fail ArgumentError, 'workspace_id cannot be nil'
164
+ end
165
+
166
+ @workspace_id = workspace_id
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] name Value to be assigned
171
+ def name=(name)
172
+ if name.nil?
173
+ fail ArgumentError, 'name cannot be nil'
174
+ end
175
+
176
+ @name = name
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] active Value to be assigned
181
+ def active=(active)
182
+ if active.nil?
183
+ fail ArgumentError, 'active cannot be nil'
184
+ end
185
+
186
+ @active = active
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] created_at Value to be assigned
191
+ def created_at=(created_at)
192
+ if created_at.nil?
193
+ fail ArgumentError, 'created_at cannot be nil'
194
+ end
195
+
196
+ @created_at = created_at
197
+ end
198
+
199
+ # Checks equality by comparing each attribute.
200
+ # @param [Object] Object to be compared
201
+ def ==(o)
202
+ return true if self.equal?(o)
203
+ self.class == o.class &&
204
+ workspace_id == o.workspace_id &&
205
+ name == o.name &&
206
+ external_ref == o.external_ref &&
207
+ created_via == o.created_via &&
208
+ active == o.active &&
209
+ created_at == o.created_at
210
+ end
211
+
212
+ # @see the `==` method
213
+ # @param [Object] Object to be compared
214
+ def eql?(o)
215
+ self == o
216
+ end
217
+
218
+ # Calculates hash code according to all attributes.
219
+ # @return [Integer] Hash code
220
+ def hash
221
+ [workspace_id, name, external_ref, created_via, active, created_at].hash
222
+ end
223
+
224
+ # Builds the object from hash
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ # @return [Object] Returns the model itself
227
+ def self.build_from_hash(attributes)
228
+ return nil unless attributes.is_a?(Hash)
229
+ attributes = attributes.transform_keys(&:to_sym)
230
+ transformed_hash = {}
231
+ openapi_types.each_pair do |key, type|
232
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
233
+ transformed_hash["#{key}"] = nil
234
+ elsif type =~ /\AArray<(.*)>/i
235
+ # check to ensure the input is an array given that the attribute
236
+ # is documented as an array but the input is not
237
+ if attributes[attribute_map[key]].is_a?(Array)
238
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
239
+ end
240
+ elsif !attributes[attribute_map[key]].nil?
241
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
242
+ end
243
+ end
244
+ new(transformed_hash)
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ end
264
+
265
+ end
@@ -11,5 +11,5 @@ Generator version: 7.22.0
11
11
  =end
12
12
 
13
13
  module Repull
14
- VERSION = '0.2.30'
14
+ VERSION = '0.2.31'
15
15
  end
data/lib/repull.rb CHANGED
@@ -177,6 +177,7 @@ require 'repull/models/conversation_message_attachment'
177
177
  require 'repull/models/create_airbnb_listing_room_request'
178
178
  require 'repull/models/create_airbnb_offer_request'
179
179
  require 'repull/models/create_airbnb_offer_request_guest_details'
180
+ require 'repull/models/create_billing_checkout200_response'
180
181
  require 'repull/models/create_billing_checkout_request'
181
182
  require 'repull/models/create_booking_webhook_request'
182
183
  require 'repull/models/create_connect_session_request'
@@ -227,12 +228,17 @@ require 'repull/models/get_airbnb_listing_quality200_response'
227
228
  require 'repull/models/get_airbnb_listing_settings200_response'
228
229
  require 'repull/models/get_airbnb_offer200_response'
229
230
  require 'repull/models/get_airbnb_thread200_response'
231
+ require 'repull/models/get_billing200_response'
232
+ require 'repull/models/get_billing200_response_limits'
233
+ require 'repull/models/get_billing200_response_used'
230
234
  require 'repull/models/get_booking_extranet_login_config200_response'
231
235
  require 'repull/models/get_booking_extranet_login_status200_response'
232
236
  require 'repull/models/get_channel_health200_response'
233
237
  require 'repull/models/get_channel_health200_response_vrbo'
234
238
  require 'repull/models/get_connect_write_policy200_response'
235
239
  require 'repull/models/get_health200_response'
240
+ require 'repull/models/get_hotel200_response'
241
+ require 'repull/models/get_hotel200_response_room_types_inner'
236
242
  require 'repull/models/get_listing_calendar_sync200_response'
237
243
  require 'repull/models/get_listing_calendar_sync200_response_channels_inner'
238
244
  require 'repull/models/get_listing_calendar_sync200_response_channels_inner_problems_inner'
@@ -249,6 +255,7 @@ require 'repull/models/get_usage_logs200_response_data_inner'
249
255
  require 'repull/models/get_usage_logs200_response_pagination'
250
256
  require 'repull/models/get_usage_summary200_response'
251
257
  require 'repull/models/get_usage_summary200_response_breakdown_inner'
258
+ require 'repull/models/get_usage_summary200_response_credits'
252
259
  require 'repull/models/get_usage_summary200_response_limits'
253
260
  require 'repull/models/get_usage_summary200_response_remaining'
254
261
  require 'repull/models/get_usage_summary200_response_status_distribution'
@@ -295,6 +302,8 @@ require 'repull/models/list_booking_reservations200_response'
295
302
  require 'repull/models/list_connection_units200_response'
296
303
  require 'repull/models/list_connection_units200_response_listing_options_inner'
297
304
  require 'repull/models/list_connection_units200_response_units_inner'
305
+ require 'repull/models/list_hotels200_response'
306
+ require 'repull/models/list_hotels200_response_data_inner'
298
307
  require 'repull/models/list_inquiries200_response'
299
308
  require 'repull/models/list_inquiries200_response_data_inner'
300
309
  require 'repull/models/list_inquiries200_response_data_inner_expected_payout'
@@ -305,6 +314,7 @@ require 'repull/models/list_kv200_response_pagination'
305
314
  require 'repull/models/list_listing_units200_response'
306
315
  require 'repull/models/list_listing_units200_response_data_inner'
307
316
  require 'repull/models/list_migrations200_response'
317
+ require 'repull/models/list_workspaces200_response'
308
318
  require 'repull/models/listing'
309
319
  require 'repull/models/listing_active_request'
310
320
  require 'repull/models/listing_active_response'
@@ -344,6 +354,7 @@ require 'repull/models/listing_deleted_payload'
344
354
  require 'repull/models/listing_details'
345
355
  require 'repull/models/listing_generate_content_request'
346
356
  require 'repull/models/listing_generate_content_response'
357
+ require 'repull/models/listing_hotel'
347
358
  require 'repull/models/listing_list_response'
348
359
  require 'repull/models/listing_market_state_request'
349
360
  require 'repull/models/listing_market_state_response'
@@ -665,6 +676,7 @@ require 'repull/models/webhook_list_response'
665
676
  require 'repull/models/webhook_subscription'
666
677
  require 'repull/models/withdraw_conversation_preapproval200_response'
667
678
  require 'repull/models/withdraw_conversation_special_offer200_response'
679
+ require 'repull/models/workspace'
668
680
 
669
681
  # APIs
670
682
  require 'repull/api/airbnb_api'
@@ -677,6 +689,7 @@ require 'repull/api/connections_api'
677
689
  require 'repull/api/conversations_api'
678
690
  require 'repull/api/guests_api'
679
691
  require 'repull/api/health_api'
692
+ require 'repull/api/hotels_api'
680
693
  require 'repull/api/kv_api'
681
694
  require 'repull/api/listings_api'
682
695
  require 'repull/api/markets_api'
@@ -691,6 +704,7 @@ require 'repull/api/schema_api'
691
704
  require 'repull/api/system_api'
692
705
  require 'repull/api/vrbo_api'
693
706
  require 'repull/api/webhooks_api'
707
+ require 'repull/api/workspaces_api'
694
708
 
695
709
  module Repull
696
710
  class << self