repull 0.2.24 → 0.2.25

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 (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +617 -0
  3. data/lib/repull/api/connections_api.rb +312 -0
  4. data/lib/repull/api/conversations_api.rb +151 -18
  5. data/lib/repull/api/health_api.rb +5 -5
  6. data/lib/repull/api/listings_api.rb +67 -4
  7. data/lib/repull/api/reviews_api.rb +2 -2
  8. data/lib/repull/models/apply_connection_mappings200_response.rb +167 -0
  9. data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +184 -0
  10. data/lib/repull/models/apply_connection_mappings_request.rb +175 -0
  11. data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +193 -0
  12. data/lib/repull/models/auto_map_connection_units200_response.rb +176 -0
  13. data/lib/repull/models/auto_map_connection_units_request.rb +156 -0
  14. data/lib/repull/models/channel_market_state_item.rb +15 -4
  15. data/lib/repull/models/connect_status.rb +25 -5
  16. data/lib/repull/models/connect_status_accounts_inner.rb +71 -4
  17. data/lib/repull/models/conversation_capabilities.rb +260 -0
  18. data/lib/repull/models/conversation_detail.rb +14 -5
  19. data/lib/repull/models/create_connect_session_request.rb +23 -1
  20. data/lib/repull/models/create_conversation_special_offer201_response.rb +127 -4
  21. data/lib/repull/models/create_conversation_special_offer201_response_fees_inner.rb +166 -0
  22. data/lib/repull/models/create_conversation_special_offer201_response_lines_inner.rb +157 -0
  23. data/lib/repull/models/create_conversation_special_offer_request.rb +91 -52
  24. data/lib/repull/models/create_conversation_special_offer_request_fees_inner.rb +199 -0
  25. data/lib/repull/models/get_booking_extranet_login_config200_response.rb +147 -0
  26. data/lib/repull/models/get_booking_extranet_login_status200_response.rb +192 -0
  27. data/lib/repull/models/get_channel_health200_response.rb +190 -0
  28. data/lib/repull/models/get_channel_health200_response_vrbo.rb +197 -0
  29. data/lib/repull/models/get_connect_write_policy200_response.rb +166 -0
  30. data/lib/repull/models/get_listing_calendar_sync200_response.rb +192 -0
  31. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +331 -0
  32. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_problems_inner.rb +157 -0
  33. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue.rb +212 -0
  34. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue_last_push.rb +268 -0
  35. data/lib/repull/models/invite_booking_extranet_user200_response.rb +174 -0
  36. data/lib/repull/models/invite_booking_extranet_user_request.rb +173 -0
  37. data/lib/repull/models/list_connection_units200_response.rb +242 -0
  38. data/lib/repull/models/list_connection_units200_response_listing_options_inner.rb +165 -0
  39. data/lib/repull/models/list_connection_units200_response_units_inner.rb +194 -0
  40. data/lib/repull/models/listing_publish_status_connection.rb +34 -1
  41. data/lib/repull/models/pms_write_policy.rb +191 -0
  42. data/lib/repull/models/pms_write_policy_calendar.rb +219 -0
  43. data/lib/repull/models/pms_write_policy_reservations.rb +219 -0
  44. data/lib/repull/models/preapprove_conversation201_response.rb +47 -6
  45. data/lib/repull/models/preapprove_conversation_request.rb +34 -5
  46. data/lib/repull/models/preview_conversation_special_offer_request.rb +231 -0
  47. data/lib/repull/models/preview_conversation_special_offer_request_fees_inner.rb +199 -0
  48. data/lib/repull/models/preview_conversation_special_offer_request_guests.rb +250 -0
  49. data/lib/repull/models/reply_to_review_request.rb +33 -4
  50. data/lib/repull/models/search_connect_session_listing_options200_response.rb +158 -0
  51. data/lib/repull/models/search_connect_session_listing_options200_response_data_inner.rb +166 -0
  52. data/lib/repull/models/search_connection_listing_options200_response.rb +159 -0
  53. data/lib/repull/models/send_message_request.rb +1 -1
  54. data/lib/repull/models/start_booking_extranet_login200_response.rb +174 -0
  55. data/lib/repull/models/start_booking_extranet_login_request.rb +225 -0
  56. data/lib/repull/models/submit_cloudbeds_credentials200_response.rb +10 -1
  57. data/lib/repull/models/submit_cloudbeds_credentials_request.rb +11 -1
  58. data/lib/repull/models/submit_mews_credentials200_response.rb +10 -1
  59. data/lib/repull/models/submit_mews_credentials_request.rb +11 -1
  60. data/lib/repull/models/update_connect_write_policy_request.rb +157 -0
  61. data/lib/repull/models/update_connect_write_policy_request_calendar.rb +165 -0
  62. data/lib/repull/models/update_connect_write_policy_request_reservations.rb +165 -0
  63. data/lib/repull/models/vrbo_import_status.rb +249 -0
  64. data/lib/repull/models/vrbo_login200_response.rb +235 -0
  65. data/lib/repull/models/vrbo_login_request.rb +271 -0
  66. data/lib/repull/models/withdraw_conversation_preapproval200_response.rb +226 -0
  67. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +29 -1
  68. data/lib/repull/version.rb +1 -1
  69. data/lib/repull.rb +44 -0
  70. data/openapi/v1.json +4693 -2114
  71. data/scripts/regen.sh +1 -1
  72. metadata +46 -2
@@ -18,12 +18,16 @@ module Repull
18
18
  # Connect session id from `POST /v1/connect/cloudbeds`. Omit when calling with your API key.
19
19
  attr_accessor :session_id
20
20
 
21
+ # Optional: what the app may change in the PMS, set before the first sync. Same shape as `PATCH /v1/connect/{provider}/write-policy`; switches you leave out keep the provider default (calendar off for hotel PMSs, bookings on).
22
+ attr_accessor :write_policy
23
+
21
24
  attr_accessor :credentials
22
25
 
23
26
  # Attribute mapping from ruby-style variable name to JSON key.
24
27
  def self.attribute_map
25
28
  {
26
29
  :'session_id' => :'sessionId',
30
+ :'write_policy' => :'writePolicy',
27
31
  :'credentials' => :'credentials'
28
32
  }
29
33
  end
@@ -42,6 +46,7 @@ module Repull
42
46
  def self.openapi_types
43
47
  {
44
48
  :'session_id' => :'String',
49
+ :'write_policy' => :'Object',
45
50
  :'credentials' => :'SubmitCloudbedsCredentialsRequestCredentials'
46
51
  }
47
52
  end
@@ -72,6 +77,10 @@ module Repull
72
77
  self.session_id = attributes[:'session_id']
73
78
  end
74
79
 
80
+ if attributes.key?(:'write_policy')
81
+ self.write_policy = attributes[:'write_policy']
82
+ end
83
+
75
84
  if attributes.key?(:'credentials')
76
85
  self.credentials = attributes[:'credentials']
77
86
  else
@@ -115,6 +124,7 @@ module Repull
115
124
  return true if self.equal?(o)
116
125
  self.class == o.class &&
117
126
  session_id == o.session_id &&
127
+ write_policy == o.write_policy &&
118
128
  credentials == o.credentials
119
129
  end
120
130
 
@@ -127,7 +137,7 @@ module Repull
127
137
  # Calculates hash code according to all attributes.
128
138
  # @return [Integer] Hash code
129
139
  def hash
130
- [session_id, credentials].hash
140
+ [session_id, write_policy, credentials].hash
131
141
  end
132
142
 
133
143
  # Builds the object from hash
@@ -19,6 +19,8 @@ module Repull
19
19
 
20
20
  attr_accessor :connected
21
21
 
22
+ attr_accessor :write_policy
23
+
22
24
  # Id of the stored connection.
23
25
  attr_accessor :pms_connection_id
24
26
 
@@ -36,6 +38,7 @@ module Repull
36
38
  {
37
39
  :'provider' => :'provider',
38
40
  :'connected' => :'connected',
41
+ :'write_policy' => :'writePolicy',
39
42
  :'pms_connection_id' => :'pmsConnectionId',
40
43
  :'created' => :'created',
41
44
  :'session_id' => :'sessionId',
@@ -59,6 +62,7 @@ module Repull
59
62
  {
60
63
  :'provider' => :'String',
61
64
  :'connected' => :'Boolean',
65
+ :'write_policy' => :'PmsWritePolicy',
62
66
  :'pms_connection_id' => :'String',
63
67
  :'created' => :'Boolean',
64
68
  :'session_id' => :'String',
@@ -98,6 +102,10 @@ module Repull
98
102
  self.connected = attributes[:'connected']
99
103
  end
100
104
 
105
+ if attributes.key?(:'write_policy')
106
+ self.write_policy = attributes[:'write_policy']
107
+ end
108
+
101
109
  if attributes.key?(:'pms_connection_id')
102
110
  self.pms_connection_id = attributes[:'pms_connection_id']
103
111
  end
@@ -141,6 +149,7 @@ module Repull
141
149
  self.class == o.class &&
142
150
  provider == o.provider &&
143
151
  connected == o.connected &&
152
+ write_policy == o.write_policy &&
144
153
  pms_connection_id == o.pms_connection_id &&
145
154
  created == o.created &&
146
155
  session_id == o.session_id &&
@@ -157,7 +166,7 @@ module Repull
157
166
  # Calculates hash code according to all attributes.
158
167
  # @return [Integer] Hash code
159
168
  def hash
160
- [provider, connected, pms_connection_id, created, session_id, account_info, webhooks].hash
169
+ [provider, connected, write_policy, pms_connection_id, created, session_id, account_info, webhooks].hash
161
170
  end
162
171
 
163
172
  # Builds the object from hash
@@ -18,12 +18,16 @@ module Repull
18
18
  # Connect session id from `POST /v1/connect/mews`. Omit when calling with your API key.
19
19
  attr_accessor :session_id
20
20
 
21
+ # Optional: what the app may change in the PMS, set before the first sync. Same shape as `PATCH /v1/connect/{provider}/write-policy`; switches you leave out keep the provider default (calendar off for hotel PMSs, bookings on).
22
+ attr_accessor :write_policy
23
+
21
24
  attr_accessor :credentials
22
25
 
23
26
  # Attribute mapping from ruby-style variable name to JSON key.
24
27
  def self.attribute_map
25
28
  {
26
29
  :'session_id' => :'sessionId',
30
+ :'write_policy' => :'writePolicy',
27
31
  :'credentials' => :'credentials'
28
32
  }
29
33
  end
@@ -42,6 +46,7 @@ module Repull
42
46
  def self.openapi_types
43
47
  {
44
48
  :'session_id' => :'String',
49
+ :'write_policy' => :'Object',
45
50
  :'credentials' => :'SubmitMewsCredentialsRequestCredentials'
46
51
  }
47
52
  end
@@ -72,6 +77,10 @@ module Repull
72
77
  self.session_id = attributes[:'session_id']
73
78
  end
74
79
 
80
+ if attributes.key?(:'write_policy')
81
+ self.write_policy = attributes[:'write_policy']
82
+ end
83
+
75
84
  if attributes.key?(:'credentials')
76
85
  self.credentials = attributes[:'credentials']
77
86
  else
@@ -115,6 +124,7 @@ module Repull
115
124
  return true if self.equal?(o)
116
125
  self.class == o.class &&
117
126
  session_id == o.session_id &&
127
+ write_policy == o.write_policy &&
118
128
  credentials == o.credentials
119
129
  end
120
130
 
@@ -127,7 +137,7 @@ module Repull
127
137
  # Calculates hash code according to all attributes.
128
138
  # @return [Integer] Hash code
129
139
  def hash
130
- [session_id, credentials].hash
140
+ [session_id, write_policy, credentials].hash
131
141
  end
132
142
 
133
143
  # Builds the object from hash
@@ -0,0 +1,157 @@
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
+
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
+ # Only the switches you send change. Every value must be a boolean.
18
+ class UpdateConnectWritePolicyRequest < ApiModelBase
19
+ attr_accessor :calendar
20
+
21
+ attr_accessor :reservations
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'calendar' => :'calendar',
27
+ :'reservations' => :'reservations'
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
+ :'calendar' => :'UpdateConnectWritePolicyRequestCalendar',
45
+ :'reservations' => :'UpdateConnectWritePolicyRequestReservations'
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::UpdateConnectWritePolicyRequest` 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::UpdateConnectWritePolicyRequest`. 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?(:'calendar')
72
+ self.calendar = attributes[:'calendar']
73
+ end
74
+
75
+ if attributes.key?(:'reservations')
76
+ self.reservations = attributes[:'reservations']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ calendar == o.calendar &&
101
+ reservations == o.reservations
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [calendar, reservations].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end
@@ -0,0 +1,165 @@
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
+
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 UpdateConnectWritePolicyRequestCalendar < ApiModelBase
18
+ attr_accessor :availability
19
+
20
+ attr_accessor :rates
21
+
22
+ attr_accessor :restrictions
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'availability' => :'availability',
28
+ :'rates' => :'rates',
29
+ :'restrictions' => :'restrictions'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'availability' => :'Boolean',
47
+ :'rates' => :'Boolean',
48
+ :'restrictions' => :'Boolean'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::UpdateConnectWritePolicyRequestCalendar` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::UpdateConnectWritePolicyRequestCalendar`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'availability')
75
+ self.availability = attributes[:'availability']
76
+ end
77
+
78
+ if attributes.key?(:'rates')
79
+ self.rates = attributes[:'rates']
80
+ end
81
+
82
+ if attributes.key?(:'restrictions')
83
+ self.restrictions = attributes[:'restrictions']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ availability == o.availability &&
108
+ rates == o.rates &&
109
+ restrictions == o.restrictions
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [availability, rates, restrictions].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end
@@ -0,0 +1,165 @@
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
+
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 UpdateConnectWritePolicyRequestReservations < ApiModelBase
18
+ attr_accessor :website
19
+
20
+ attr_accessor :dashboard
21
+
22
+ attr_accessor :api
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'website' => :'website',
28
+ :'dashboard' => :'dashboard',
29
+ :'api' => :'api'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'website' => :'Boolean',
47
+ :'dashboard' => :'Boolean',
48
+ :'api' => :'Boolean'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::UpdateConnectWritePolicyRequestReservations` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::UpdateConnectWritePolicyRequestReservations`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'website')
75
+ self.website = attributes[:'website']
76
+ end
77
+
78
+ if attributes.key?(:'dashboard')
79
+ self.dashboard = attributes[:'dashboard']
80
+ end
81
+
82
+ if attributes.key?(:'api')
83
+ self.api = attributes[:'api']
84
+ end
85
+ end
86
+
87
+ # Show invalid properties with the reasons. Usually used together with valid?
88
+ # @return Array for valid properties with the reasons
89
+ def list_invalid_properties
90
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
91
+ invalid_properties = Array.new
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ website == o.website &&
108
+ dashboard == o.dashboard &&
109
+ api == o.api
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [website, dashboard, api].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end