repull 0.2.8 → 0.2.10

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +1443 -182
  3. data/lib/repull/api/availability_api.rb +24 -92
  4. data/lib/repull/api/billing_api.rb +186 -15
  5. data/lib/repull/api/booking_com_api.rb +532 -41
  6. data/lib/repull/api/listings_api.rb +74 -0
  7. data/lib/repull/api/plumguide_api.rb +245 -0
  8. data/lib/repull/api/reservations_api.rb +0 -197
  9. data/lib/repull/api/sandbox_api.rb +136 -0
  10. data/lib/repull/api/vrbo_api.rb +0 -126
  11. data/lib/repull/models/acknowledge_booking_reservations_request.rb +176 -0
  12. data/lib/repull/models/{create_studio_project201_response_data.rb → airbnb_alteration.rb} +44 -52
  13. data/lib/repull/models/airbnb_amenity.rb +171 -0
  14. data/lib/repull/models/{get_studio_deployment200_response.rb → airbnb_availability_write_request.rb} +52 -10
  15. data/lib/repull/models/airbnb_calendar_operation.rb +250 -0
  16. data/lib/repull/models/airbnb_listing_action_request.rb +198 -0
  17. data/lib/repull/models/{update_availability_request.rb → airbnb_pricing_write_request.rb} +100 -11
  18. data/lib/repull/models/booking_availability_update.rb +276 -0
  19. data/lib/repull/models/booking_availability_update_request.rb +230 -0
  20. data/lib/repull/models/{generate_studio_completion_request_project_id.rb → booking_availability_update_request_property_id.rb} +2 -2
  21. data/lib/repull/models/booking_availability_update_request_updates_inner.rb +104 -0
  22. data/lib/repull/models/booking_pricing_rate_update.rb +1 -0
  23. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +65 -6
  24. data/lib/repull/models/booking_setup_request.rb +220 -0
  25. data/lib/repull/models/create_airbnb_alteration_request.rb +195 -0
  26. data/lib/repull/models/{create_studio_deployment201_response_data.rb → create_airbnb_offer_request.rb} +42 -30
  27. data/lib/repull/models/{create_studio_project_request.rb → create_booking_webhook_request.rb} +36 -47
  28. data/lib/repull/models/{generate_studio_completion200_response.rb → delete_airbnb_listing_photo200_response.rb} +10 -10
  29. data/lib/repull/models/{delete_studio_project200_response.rb → get_airbnb_alteration200_response.rb} +50 -7
  30. data/lib/repull/models/{delete_studio_project_file200_response.rb → get_airbnb_listing_quality200_response.rb} +37 -7
  31. data/lib/repull/models/{create_studio_project_generation201_response.rb → get_airbnb_listing_settings200_response.rb} +37 -7
  32. data/lib/repull/models/{delete_studio_deployment200_response.rb → get_airbnb_thread200_response.rb} +50 -7
  33. data/lib/repull/models/{list_studio_deployments200_response.rb → get_usage_logs200_response.rb} +17 -8
  34. data/lib/repull/models/get_usage_logs200_response_data_inner.rb +264 -0
  35. data/lib/repull/models/{create_studio_deployment201_response.rb → get_usage_logs200_response_pagination.rb} +29 -10
  36. data/lib/repull/models/get_usage_summary200_response.rb +232 -0
  37. data/lib/repull/models/get_usage_summary200_response_breakdown_inner.rb +183 -0
  38. data/lib/repull/models/{delete_studio_deployment200_response_data.rb → get_usage_summary200_response_limits.rb} +18 -16
  39. data/lib/repull/models/{delete_studio_project200_response_data.rb → get_usage_summary200_response_remaining.rb} +18 -16
  40. data/lib/repull/models/{create_studio_project_generation201_response_data.rb → get_usage_summary200_response_status_distribution.rb} +31 -22
  41. data/lib/repull/models/{upsert_studio_project_file_request.rb → get_usage_summary200_response_timeline_inner.rb} +28 -28
  42. data/lib/repull/models/{create_studio_project_generation_request.rb → get_usage_summary200_response_totals.rb} +28 -28
  43. data/lib/repull/models/{create_studio_project201_response.rb → get_usage_summary200_response_used.rb} +19 -10
  44. data/lib/repull/models/get_usage_tier200_response.rb +183 -0
  45. data/lib/repull/models/{list_studio_projects200_response.rb → get_usage_tier200_response_limits.rb} +31 -12
  46. data/lib/repull/models/{update_reservation_request.rb → get_usage_tier200_response_remaining.rb} +25 -31
  47. data/lib/repull/models/{get_studio_project200_response.rb → get_usage_tier200_response_used.rb} +28 -10
  48. data/lib/repull/models/list_airbnb_alterations200_response.rb +192 -0
  49. data/lib/repull/models/list_airbnb_listing_amenities200_response.rb +190 -0
  50. data/lib/repull/models/{create_studio_deployment_request.rb → list_airbnb_listing_amenities200_response_data.rb} +23 -28
  51. data/lib/repull/models/{list_studio_project_files200_response.rb → list_airbnb_transactions200_response.rb} +50 -7
  52. data/lib/repull/models/listing_content_update_request.rb +243 -0
  53. data/lib/repull/models/{upsert_studio_project_file200_response.rb → listing_content_update_request_address.rb} +53 -10
  54. data/lib/repull/models/listing_content_update_request_amenities.rb +105 -0
  55. data/lib/repull/models/listing_content_update_request_amenities_one_of_inner.rb +196 -0
  56. data/lib/repull/models/listing_content_update_request_occupancy.rb +179 -0
  57. data/lib/repull/{api/ai_api.rb → models/listing_content_update_request_photos_inner.rb} +77 -59
  58. data/lib/repull/models/{generate_studio_completion200_response_data.rb → listing_content_update_request_photos_inner_one_of.rb} +81 -66
  59. data/lib/repull/models/listing_content_update_request_policies.rb +253 -0
  60. data/lib/repull/models/{create_ai_operation200_response.rb → listing_content_update_response.rb} +32 -16
  61. data/lib/repull/models/map_airbnb_listing_request.rb +215 -0
  62. data/lib/repull/models/{create_reservation_request.rb → map_airbnb_listing_response.rb} +137 -116
  63. data/lib/repull/models/property.rb +42 -69
  64. data/lib/repull/models/property_availability.rb +222 -0
  65. data/lib/repull/models/property_availability_day.rb +247 -0
  66. data/lib/repull/models/reservation.rb +28 -1
  67. data/lib/repull/models/sandbox_fixture_ref.rb +193 -0
  68. data/lib/repull/models/{delete_studio_project_file200_response_data.rb → sandbox_reset_result.rb} +72 -11
  69. data/lib/repull/models/sandbox_reset_result_deleted.rb +216 -0
  70. data/lib/repull/models/sandbox_seed_result.rb +278 -0
  71. data/lib/repull/models/{update_studio_project_request.rb → update_airbnb_message_request.rb} +43 -24
  72. data/lib/repull/models/update_booking_charges_request.rb +194 -0
  73. data/lib/repull/version.rb +1 -1
  74. data/lib/repull.rb +59 -34
  75. data/openapi/v1.json +3956 -2522
  76. metadata +61 -36
  77. data/lib/repull/api/studio_api.rb +0 -1094
  78. data/lib/repull/models/generate_studio_completion_request.rb +0 -305
  79. data/lib/repull/models/upsert_studio_project_file200_response_data.rb +0 -147
@@ -0,0 +1,198 @@
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_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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 `resets_at` 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/airbnb/listings/{id}`.
18
+ class AirbnbListingActionRequest < ApiModelBase
19
+ # `delete` deactivates the Repull record. `push`/`publish` push content to Airbnb.
20
+ attr_accessor :action
21
+
22
+ # For `push`/`publish`: the Airbnb connection to update (from `GET /v1/channels/airbnb/listings/{id}`). Pass this OR `hostId`.
23
+ attr_accessor :airbnb_connection_id
24
+
25
+ # For `push`/`publish`: create + publish a new Airbnb listing under this host. Pass this OR `airbnbConnectionId`.
26
+ attr_accessor :host_id
27
+
28
+ # For `push`/`publish`: re-push every field, ignoring dirty-field tracking.
29
+ attr_accessor :force
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'action' => :'action',
35
+ :'airbnb_connection_id' => :'airbnbConnectionId',
36
+ :'host_id' => :'hostId',
37
+ :'force' => :'force'
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
+ :'action' => :'String',
55
+ :'airbnb_connection_id' => :'String',
56
+ :'host_id' => :'String',
57
+ :'force' => :'Boolean'
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::AirbnbListingActionRequest` 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::AirbnbListingActionRequest`. 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?(:'action')
84
+ self.action = attributes[:'action']
85
+ else
86
+ self.action = nil
87
+ end
88
+
89
+ if attributes.key?(:'airbnb_connection_id')
90
+ self.airbnb_connection_id = attributes[:'airbnb_connection_id']
91
+ end
92
+
93
+ if attributes.key?(:'host_id')
94
+ self.host_id = attributes[:'host_id']
95
+ end
96
+
97
+ if attributes.key?(:'force')
98
+ self.force = attributes[:'force']
99
+ else
100
+ self.force = false
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ if @action.nil?
110
+ invalid_properties.push('invalid value for "action", action cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @action.nil?
121
+ true
122
+ end
123
+
124
+ # Custom attribute writer method with validation
125
+ # @param [Object] action Value to be assigned
126
+ def action=(action)
127
+ if action.nil?
128
+ fail ArgumentError, 'action cannot be nil'
129
+ end
130
+
131
+ @action = action
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] Object to be compared
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ action == o.action &&
140
+ airbnb_connection_id == o.airbnb_connection_id &&
141
+ host_id == o.host_id &&
142
+ force == o.force
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [action, airbnb_connection_id, host_id, force].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
172
+ end
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
175
+ end
176
+ end
177
+ new(transformed_hash)
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ end
197
+
198
+ end
@@ -14,13 +14,38 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- class UpdateAvailabilityRequest < ApiModelBase
18
- attr_accessor :dates
17
+ # Body for `PUT /v1/channels/airbnb/listings/{id}/pricing`. The `type` discriminator selects the pricing sub-resource. `type: \"calendar\"` shares the same per-date restriction shape as the availability endpoint (min/max nights, closed-to-arrival/departure, stop-sell via `availability: \"unavailable\"`).
18
+ class AirbnbPricingWriteRequest < ApiModelBase
19
+ attr_accessor :type
20
+
21
+ # Required when `type: \"calendar\"`. Batch of per-date price + restriction operations.
22
+ attr_accessor :operations
23
+
24
+ # Required when `type: \"model\"` — the pricing-availability model to switch the listing to.
25
+ attr_accessor :model_type
26
+
27
+ # Required for `type: \"standard\" | \"rate-plan\" | \"fees\"` — the pricing-settings object to PUT.
28
+ attr_accessor :settings
29
+
30
+ # Required for `type: \"los\"` — length-of-stay records.
31
+ attr_accessor :records
32
+
33
+ # Required for `type: \"currency\"` — ISO 4217 code.
34
+ attr_accessor :currency
35
+
36
+ # Required for `type: \"rule\"` — a single pricing rule appended to the listing.
37
+ attr_accessor :rule
19
38
 
20
39
  # Attribute mapping from ruby-style variable name to JSON key.
21
40
  def self.attribute_map
22
41
  {
23
- :'dates' => :'dates'
42
+ :'type' => :'type',
43
+ :'operations' => :'operations',
44
+ :'model_type' => :'modelType',
45
+ :'settings' => :'settings',
46
+ :'records' => :'records',
47
+ :'currency' => :'currency',
48
+ :'rule' => :'rule'
24
49
  }
25
50
  end
26
51
 
@@ -37,13 +62,24 @@ module Repull
37
62
  # Attribute type mapping.
38
63
  def self.openapi_types
39
64
  {
40
- :'dates' => :'Array<CalendarDay>'
65
+ :'type' => :'String',
66
+ :'operations' => :'Array<AirbnbCalendarOperation>',
67
+ :'model_type' => :'String',
68
+ :'settings' => :'Hash<String, Object>',
69
+ :'records' => :'Array<Hash<String, Object>>',
70
+ :'currency' => :'String',
71
+ :'rule' => :'Hash<String, Object>'
41
72
  }
42
73
  end
43
74
 
44
75
  # List of attributes with nullable: true
45
76
  def self.openapi_nullable
46
77
  Set.new([
78
+ :'model_type',
79
+ :'settings',
80
+ :'records',
81
+ :'currency',
82
+ :'rule'
47
83
  ])
48
84
  end
49
85
 
@@ -51,21 +87,53 @@ module Repull
51
87
  # @param [Hash] attributes Model attributes in the form of hash
52
88
  def initialize(attributes = {})
53
89
  if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::UpdateAvailabilityRequest` initialize method"
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbPricingWriteRequest` initialize method"
55
91
  end
56
92
 
57
93
  # check to see if the attribute exists and convert string to symbol for hash key
58
94
  acceptable_attribute_map = self.class.acceptable_attribute_map
59
95
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
96
  if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::UpdateAvailabilityRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbPricingWriteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
98
  end
63
99
  h[k.to_sym] = v
64
100
  }
65
101
 
66
- if attributes.key?(:'dates')
67
- if (value = attributes[:'dates']).is_a?(Array)
68
- self.dates = value
102
+ if attributes.key?(:'type')
103
+ self.type = attributes[:'type']
104
+ else
105
+ self.type = nil
106
+ end
107
+
108
+ if attributes.key?(:'operations')
109
+ if (value = attributes[:'operations']).is_a?(Array)
110
+ self.operations = value
111
+ end
112
+ end
113
+
114
+ if attributes.key?(:'model_type')
115
+ self.model_type = attributes[:'model_type']
116
+ end
117
+
118
+ if attributes.key?(:'settings')
119
+ if (value = attributes[:'settings']).is_a?(Hash)
120
+ self.settings = value
121
+ end
122
+ end
123
+
124
+ if attributes.key?(:'records')
125
+ if (value = attributes[:'records']).is_a?(Array)
126
+ self.records = value
127
+ end
128
+ end
129
+
130
+ if attributes.key?(:'currency')
131
+ self.currency = attributes[:'currency']
132
+ end
133
+
134
+ if attributes.key?(:'rule')
135
+ if (value = attributes[:'rule']).is_a?(Hash)
136
+ self.rule = value
69
137
  end
70
138
  end
71
139
  end
@@ -75,6 +143,10 @@ module Repull
75
143
  def list_invalid_properties
76
144
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
145
  invalid_properties = Array.new
146
+ if @type.nil?
147
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
148
+ end
149
+
78
150
  invalid_properties
79
151
  end
80
152
 
@@ -82,15 +154,32 @@ module Repull
82
154
  # @return true if the model is valid
83
155
  def valid?
84
156
  warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if @type.nil?
85
158
  true
86
159
  end
87
160
 
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] type Value to be assigned
163
+ def type=(type)
164
+ if type.nil?
165
+ fail ArgumentError, 'type cannot be nil'
166
+ end
167
+
168
+ @type = type
169
+ end
170
+
88
171
  # Checks equality by comparing each attribute.
89
172
  # @param [Object] Object to be compared
90
173
  def ==(o)
91
174
  return true if self.equal?(o)
92
175
  self.class == o.class &&
93
- dates == o.dates
176
+ type == o.type &&
177
+ operations == o.operations &&
178
+ model_type == o.model_type &&
179
+ settings == o.settings &&
180
+ records == o.records &&
181
+ currency == o.currency &&
182
+ rule == o.rule
94
183
  end
95
184
 
96
185
  # @see the `==` method
@@ -102,7 +191,7 @@ module Repull
102
191
  # Calculates hash code according to all attributes.
103
192
  # @return [Integer] Hash code
104
193
  def hash
105
- [dates].hash
194
+ [type, operations, model_type, settings, records, currency, rule].hash
106
195
  end
107
196
 
108
197
  # Builds the object from hash
@@ -0,0 +1,276 @@
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_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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 `resets_at` 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 (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.
18
+ class BookingAvailabilityUpdate < ApiModelBase
19
+ # Booking.com room id.
20
+ attr_accessor :room_id
21
+
22
+ # Booking.com rate-plan id.
23
+ attr_accessor :rate_id
24
+
25
+ attr_accessor :date_range
26
+
27
+ # Rooms to sell (`roomstosell`). `0` blocks the room for the range.
28
+ attr_accessor :available_rooms
29
+
30
+ attr_accessor :status
31
+
32
+ # Dedicated stop-sell flag (`<closed>` in Booking's XML). `true` fully stops sale for the room/date-range regardless of `availableRooms`.
33
+ attr_accessor :closed
34
+
35
+ attr_accessor :restrictions
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'room_id' => :'roomId',
41
+ :'rate_id' => :'rateId',
42
+ :'date_range' => :'dateRange',
43
+ :'available_rooms' => :'availableRooms',
44
+ :'status' => :'status',
45
+ :'closed' => :'closed',
46
+ :'restrictions' => :'restrictions'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'room_id' => :'String',
64
+ :'rate_id' => :'String',
65
+ :'date_range' => :'BookingPricingRateUpdateDateRange',
66
+ :'available_rooms' => :'Integer',
67
+ :'status' => :'String',
68
+ :'closed' => :'Boolean',
69
+ :'restrictions' => :'BookingPricingRateUpdateRestrictions'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'status',
77
+ :'closed',
78
+ ])
79
+ end
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ def initialize(attributes = {})
84
+ if (!attributes.is_a?(Hash))
85
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingAvailabilityUpdate` initialize method"
86
+ end
87
+
88
+ # check to see if the attribute exists and convert string to symbol for hash key
89
+ acceptable_attribute_map = self.class.acceptable_attribute_map
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!acceptable_attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingAvailabilityUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'room_id')
98
+ self.room_id = attributes[:'room_id']
99
+ else
100
+ self.room_id = nil
101
+ end
102
+
103
+ if attributes.key?(:'rate_id')
104
+ self.rate_id = attributes[:'rate_id']
105
+ else
106
+ self.rate_id = nil
107
+ end
108
+
109
+ if attributes.key?(:'date_range')
110
+ self.date_range = attributes[:'date_range']
111
+ else
112
+ self.date_range = nil
113
+ end
114
+
115
+ if attributes.key?(:'available_rooms')
116
+ self.available_rooms = attributes[:'available_rooms']
117
+ else
118
+ self.available_rooms = nil
119
+ end
120
+
121
+ if attributes.key?(:'status')
122
+ self.status = attributes[:'status']
123
+ end
124
+
125
+ if attributes.key?(:'closed')
126
+ self.closed = attributes[:'closed']
127
+ end
128
+
129
+ if attributes.key?(:'restrictions')
130
+ self.restrictions = attributes[:'restrictions']
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
138
+ invalid_properties = Array.new
139
+ if @room_id.nil?
140
+ invalid_properties.push('invalid value for "room_id", room_id cannot be nil.')
141
+ end
142
+
143
+ if @rate_id.nil?
144
+ invalid_properties.push('invalid value for "rate_id", rate_id cannot be nil.')
145
+ end
146
+
147
+ if @date_range.nil?
148
+ invalid_properties.push('invalid value for "date_range", date_range cannot be nil.')
149
+ end
150
+
151
+ if @available_rooms.nil?
152
+ invalid_properties.push('invalid value for "available_rooms", available_rooms cannot be nil.')
153
+ end
154
+
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ warn '[DEPRECATED] the `valid?` method is obsolete'
162
+ return false if @room_id.nil?
163
+ return false if @rate_id.nil?
164
+ return false if @date_range.nil?
165
+ return false if @available_rooms.nil?
166
+ true
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] room_id Value to be assigned
171
+ def room_id=(room_id)
172
+ if room_id.nil?
173
+ fail ArgumentError, 'room_id cannot be nil'
174
+ end
175
+
176
+ @room_id = room_id
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] rate_id Value to be assigned
181
+ def rate_id=(rate_id)
182
+ if rate_id.nil?
183
+ fail ArgumentError, 'rate_id cannot be nil'
184
+ end
185
+
186
+ @rate_id = rate_id
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] date_range Value to be assigned
191
+ def date_range=(date_range)
192
+ if date_range.nil?
193
+ fail ArgumentError, 'date_range cannot be nil'
194
+ end
195
+
196
+ @date_range = date_range
197
+ end
198
+
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
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ room_id == o.room_id &&
215
+ rate_id == o.rate_id &&
216
+ date_range == o.date_range &&
217
+ available_rooms == o.available_rooms &&
218
+ status == o.status &&
219
+ closed == o.closed &&
220
+ restrictions == o.restrictions
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(o)
226
+ self == o
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Integer] Hash code
231
+ def hash
232
+ [room_id, rate_id, date_range, available_rooms, status, closed, restrictions].hash
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def self.build_from_hash(attributes)
239
+ return nil unless attributes.is_a?(Hash)
240
+ attributes = attributes.transform_keys(&:to_sym)
241
+ transformed_hash = {}
242
+ openapi_types.each_pair do |key, type|
243
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
244
+ transformed_hash["#{key}"] = nil
245
+ elsif type =~ /\AArray<(.*)>/i
246
+ # check to ensure the input is an array given that the attribute
247
+ # is documented as an array but the input is not
248
+ if attributes[attribute_map[key]].is_a?(Array)
249
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
250
+ end
251
+ elsif !attributes[attribute_map[key]].nil?
252
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
253
+ end
254
+ end
255
+ new(transformed_hash)
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ end
275
+
276
+ end