repull 0.2.35 → 0.2.37

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +70 -2
  3. data/lib/repull/api/conversations_api.rb +2 -2
  4. data/lib/repull/api/listings_api.rb +8 -8
  5. data/lib/repull/api/migrate_api.rb +68 -0
  6. data/lib/repull/api/reservations_api.rb +4 -4
  7. data/lib/repull/models/account_disconnected_payload.rb +16 -4
  8. data/lib/repull/models/account_disconnected_payload_listings_inner.rb +157 -0
  9. data/lib/repull/models/airbnb_calendar_operation.rb +12 -12
  10. data/lib/repull/models/booking_unacknowledged_event.rb +281 -0
  11. data/lib/repull/models/booking_unacknowledged_payload.rb +229 -0
  12. data/lib/repull/models/channel_degraded_event.rb +279 -0
  13. data/lib/repull/models/channel_degraded_payload.rb +174 -0
  14. data/lib/repull/models/channel_degraded_payload_object.rb +262 -0
  15. data/lib/repull/models/channel_sync_failed_event.rb +280 -0
  16. data/lib/repull/models/channel_sync_failure_payload.rb +214 -0
  17. data/lib/repull/models/channel_sync_failure_payload_failures_inner.rb +213 -0
  18. data/lib/repull/models/channel_sync_failure_payload_object.rb +289 -0
  19. data/lib/repull/models/charge_per.rb +42 -0
  20. data/lib/repull/models/create_connect_session_request.rb +2 -2
  21. data/lib/repull/models/create_connection_request.rb +1 -1
  22. data/lib/repull/models/import_from_channex200_response.rb +147 -0
  23. data/lib/repull/models/import_from_channex200_response_data.rb +324 -0
  24. data/lib/repull/models/import_from_channex200_response_data_channels_inner.rb +263 -0
  25. data/lib/repull/models/import_from_channex200_response_data_properties_inner.rb +222 -0
  26. data/lib/repull/models/import_from_channex200_response_data_summary.rb +201 -0
  27. data/lib/repull/models/import_from_channex200_response_data_summary_bookings.rb +165 -0
  28. data/lib/repull/models/import_from_channex200_response_data_summary_properties.rb +165 -0
  29. data/lib/repull/models/import_from_channex_request.rb +223 -0
  30. data/lib/repull/models/inquiry_webhook_object.rb +10 -1
  31. data/lib/repull/models/inquiry_webhook_object_guest.rb +159 -0
  32. data/lib/repull/models/list_inquiries200_response_data_inner.rb +27 -1
  33. data/lib/repull/models/list_inquiries200_response_data_inner_guest.rb +160 -0
  34. data/lib/repull/models/listing.rb +82 -1
  35. data/lib/repull/models/listing_channel.rb +15 -4
  36. data/lib/repull/models/listing_content_photo.rb +206 -0
  37. data/lib/repull/models/listing_fee.rb +229 -0
  38. data/lib/repull/models/listing_policies.rb +257 -0
  39. data/lib/repull/models/listing_policies_check_in.rb +179 -0
  40. data/lib/repull/models/listing_policies_check_out.rb +148 -0
  41. data/lib/repull/models/listing_policies_quiet_hours.rb +156 -0
  42. data/lib/repull/models/listing_pricing_settings.rb +233 -0
  43. data/lib/repull/models/listing_room.rb +190 -0
  44. data/lib/repull/models/listing_room_beds_inner.rb +156 -0
  45. data/lib/repull/models/listing_rules.rb +212 -0
  46. data/lib/repull/models/listing_tax.rb +241 -0
  47. data/lib/repull/models/listing_webhook_object_channels_inner.rb +16 -5
  48. data/lib/repull/models/reservation.rb +25 -1
  49. data/lib/repull/models/reservation_access_code.rb +301 -0
  50. data/lib/repull/models/reservation_access_code_locks_inner.rb +190 -0
  51. data/lib/repull/models/reservation_thread_assigned_event.rb +279 -0
  52. data/lib/repull/models/reservation_thread_assigned_payload.rb +174 -0
  53. data/lib/repull/models/reservation_thread_assigned_payload_object.rb +249 -0
  54. data/lib/repull/models/submit_ciirus_credentials200_response.rb +213 -0
  55. data/lib/repull/models/submit_ciirus_credentials200_response_account_info.rb +159 -0
  56. data/lib/repull/models/submit_ciirus_credentials_request.rb +184 -0
  57. data/lib/repull/models/submit_ciirus_credentials_request_credentials.rb +203 -0
  58. data/lib/repull/models/webhook_event.rb +8 -0
  59. data/lib/repull/models/webhook_event_type.rb +5 -1
  60. data/lib/repull/version.rb +1 -1
  61. data/lib/repull.rb +41 -0
  62. data/openapi/v1.json +1937 -32
  63. data/scripts/regen.sh +1 -1
  64. metadata +43 -4
  65. data/spec/api/plumguide_api_spec.rb +0 -85
@@ -0,0 +1,160 @@
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
+ # Who asked. Airbnb shares only the guest’s first name before they book; the last name and phone number arrive on the reservation (`GET /v1/reservations/{id}`) once they do.
18
+ class ListInquiries200ResponseDataInnerGuest < ApiModelBase
19
+ # Repull guest id.
20
+ attr_accessor :id
21
+
22
+ attr_accessor :first_name
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'first_name' => :'firstName'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'id' => :'String',
46
+ :'first_name' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'id',
54
+ :'first_name'
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::ListInquiries200ResponseDataInnerGuest` 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::ListInquiries200ResponseDataInnerGuest`. 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?(:'id')
75
+ self.id = attributes[:'id']
76
+ end
77
+
78
+ if attributes.key?(:'first_name')
79
+ self.first_name = attributes[:'first_name']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ warn '[DEPRECATED] the `valid?` method is obsolete'
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ id == o.id &&
104
+ first_name == o.first_name
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [id, first_name].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ attributes = attributes.transform_keys(&:to_sym)
125
+ transformed_hash = {}
126
+ openapi_types.each_pair do |key, type|
127
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
134
+ end
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
137
+ end
138
+ end
139
+ new(transformed_hash)
140
+ end
141
+
142
+ # Returns the object in the form of hash
143
+ # @return [Hash] Returns the object in the form of hash
144
+ def to_hash
145
+ hash = {}
146
+ self.class.attribute_map.each_pair do |attr, param|
147
+ value = self.send(attr)
148
+ if value.nil?
149
+ is_nullable = self.class.openapi_nullable.include?(attr)
150
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
151
+ end
152
+
153
+ hash[param] = _to_hash(value)
154
+ end
155
+ hash
156
+ end
157
+
158
+ end
159
+
160
+ end
@@ -57,6 +57,27 @@ module Repull
57
57
  # **Only present when the caller passes `?include=details`.** Sourced from `listings_details`. `null` when the listing has no details row stored (vs the field being absent — that signals the caller did not opt into the expansion).
58
58
  attr_accessor :details
59
59
 
60
+ # **Only present with `?include=rooms`.** Each room and its beds. `[]` when none are stored.
61
+ attr_accessor :rooms
62
+
63
+ # **Only present with `?include=policies`.** Cancellation, house rules, check-in and check-out, pets/smoking/events/children, quiet hours, deposit.
64
+ attr_accessor :policies
65
+
66
+ # **Only present with `?include=rules`.** Stay rules: min/max nights, booking window, advance notice, preparation time, and whether booking requests are allowed.
67
+ attr_accessor :rules
68
+
69
+ # **Only present with `?include=pricing`.** Standing prices: base and weekend rate, cleaning and extra-guest fees, deposit, weekly/monthly discounts. `null` when none are stored.
70
+ attr_accessor :pricing
71
+
72
+ # **Only present with `?include=fees`.** Every fee, the cleaning fee included, whatever channel or PMS it came from. `[]` when none.
73
+ attr_accessor :fees
74
+
75
+ # **Only present with `?include=taxes`.** Taxes charged to the guest. `[]` when none.
76
+ attr_accessor :taxes
77
+
78
+ # **Only present with `?include=photos`.** The listing photos in display order.
79
+ attr_accessor :photos
80
+
60
81
  attr_accessor :created_at
61
82
 
62
83
  attr_accessor :updated_at
@@ -79,6 +100,13 @@ module Repull
79
100
  :'amenities' => :'amenities',
80
101
  :'content' => :'content',
81
102
  :'details' => :'details',
103
+ :'rooms' => :'rooms',
104
+ :'policies' => :'policies',
105
+ :'rules' => :'rules',
106
+ :'pricing' => :'pricing',
107
+ :'fees' => :'fees',
108
+ :'taxes' => :'taxes',
109
+ :'photos' => :'photos',
82
110
  :'created_at' => :'createdAt',
83
111
  :'updated_at' => :'updatedAt'
84
112
  }
@@ -112,6 +140,13 @@ module Repull
112
140
  :'amenities' => :'Array<ListingAmenity>',
113
141
  :'content' => :'ListingContent',
114
142
  :'details' => :'ListingDetails',
143
+ :'rooms' => :'Array<ListingRoom>',
144
+ :'policies' => :'ListingPolicies',
145
+ :'rules' => :'ListingRules',
146
+ :'pricing' => :'ListingPricingSettings',
147
+ :'fees' => :'Array<ListingFee>',
148
+ :'taxes' => :'Array<ListingTax>',
149
+ :'photos' => :'Array<ListingContentPhoto>',
115
150
  :'created_at' => :'Time',
116
151
  :'updated_at' => :'Time'
117
152
  }
@@ -125,6 +160,9 @@ module Repull
125
160
  :'thumbnail_url',
126
161
  :'content',
127
162
  :'details',
163
+ :'policies',
164
+ :'rules',
165
+ :'pricing',
128
166
  ])
129
167
  end
130
168
 
@@ -210,6 +248,42 @@ module Repull
210
248
  self.details = attributes[:'details']
211
249
  end
212
250
 
251
+ if attributes.key?(:'rooms')
252
+ if (value = attributes[:'rooms']).is_a?(Array)
253
+ self.rooms = value
254
+ end
255
+ end
256
+
257
+ if attributes.key?(:'policies')
258
+ self.policies = attributes[:'policies']
259
+ end
260
+
261
+ if attributes.key?(:'rules')
262
+ self.rules = attributes[:'rules']
263
+ end
264
+
265
+ if attributes.key?(:'pricing')
266
+ self.pricing = attributes[:'pricing']
267
+ end
268
+
269
+ if attributes.key?(:'fees')
270
+ if (value = attributes[:'fees']).is_a?(Array)
271
+ self.fees = value
272
+ end
273
+ end
274
+
275
+ if attributes.key?(:'taxes')
276
+ if (value = attributes[:'taxes']).is_a?(Array)
277
+ self.taxes = value
278
+ end
279
+ end
280
+
281
+ if attributes.key?(:'photos')
282
+ if (value = attributes[:'photos']).is_a?(Array)
283
+ self.photos = value
284
+ end
285
+ end
286
+
213
287
  if attributes.key?(:'created_at')
214
288
  self.created_at = attributes[:'created_at']
215
289
  end
@@ -273,6 +347,13 @@ module Repull
273
347
  amenities == o.amenities &&
274
348
  content == o.content &&
275
349
  details == o.details &&
350
+ rooms == o.rooms &&
351
+ policies == o.policies &&
352
+ rules == o.rules &&
353
+ pricing == o.pricing &&
354
+ fees == o.fees &&
355
+ taxes == o.taxes &&
356
+ photos == o.photos &&
276
357
  created_at == o.created_at &&
277
358
  updated_at == o.updated_at
278
359
  end
@@ -286,7 +367,7 @@ module Repull
286
367
  # Calculates hash code according to all attributes.
287
368
  # @return [Integer] Hash code
288
369
  def hash
289
- [capabilities, kind, hotel, unit_count, units, id, name, public_name, address, thumbnail_url, status, channels, amenities, content, details, created_at, updated_at].hash
370
+ [capabilities, kind, hotel, unit_count, units, id, name, public_name, address, thumbnail_url, status, channels, amenities, content, details, rooms, policies, rules, pricing, fees, taxes, photos, created_at, updated_at].hash
290
371
  end
291
372
 
292
373
  # Builds the object from hash
@@ -25,13 +25,17 @@ module Repull
25
25
 
26
26
  attr_accessor :sync_enabled
27
27
 
28
+ # The connected account this listing belongs to on this channel — for Airbnb the host account (`externalAccountId` is the Airbnb host id). The same account `account.disconnected` names, so a disconnect can be matched to its listings. Null when it cannot be resolved.
29
+ attr_accessor :account
30
+
28
31
  # Attribute mapping from ruby-style variable name to JSON key.
29
32
  def self.attribute_map
30
33
  {
31
34
  :'platform' => :'platform',
32
35
  :'external_id' => :'externalId',
33
36
  :'active' => :'active',
34
- :'sync_enabled' => :'syncEnabled'
37
+ :'sync_enabled' => :'syncEnabled',
38
+ :'account' => :'account'
35
39
  }
36
40
  end
37
41
 
@@ -51,13 +55,15 @@ module Repull
51
55
  :'platform' => :'String',
52
56
  :'external_id' => :'String',
53
57
  :'active' => :'Boolean',
54
- :'sync_enabled' => :'Boolean'
58
+ :'sync_enabled' => :'Boolean',
59
+ :'account' => :'RecordAccount'
55
60
  }
56
61
  end
57
62
 
58
63
  # List of attributes with nullable: true
59
64
  def self.openapi_nullable
60
65
  Set.new([
66
+ :'account'
61
67
  ])
62
68
  end
63
69
 
@@ -92,6 +98,10 @@ module Repull
92
98
  if attributes.key?(:'sync_enabled')
93
99
  self.sync_enabled = attributes[:'sync_enabled']
94
100
  end
101
+
102
+ if attributes.key?(:'account')
103
+ self.account = attributes[:'account']
104
+ end
95
105
  end
96
106
 
97
107
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -117,7 +127,8 @@ module Repull
117
127
  platform == o.platform &&
118
128
  external_id == o.external_id &&
119
129
  active == o.active &&
120
- sync_enabled == o.sync_enabled
130
+ sync_enabled == o.sync_enabled &&
131
+ account == o.account
121
132
  end
122
133
 
123
134
  # @see the `==` method
@@ -129,7 +140,7 @@ module Repull
129
140
  # Calculates hash code according to all attributes.
130
141
  # @return [Integer] Hash code
131
142
  def hash
132
- [platform, external_id, active, sync_enabled].hash
143
+ [platform, external_id, active, sync_enabled, account].hash
133
144
  end
134
145
 
135
146
  # Builds the object from hash
@@ -0,0 +1,206 @@
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
+ class ListingContentPhoto < ApiModelBase
18
+ attr_accessor :url
19
+
20
+ attr_accessor :thumbnail_url
21
+
22
+ attr_accessor :caption
23
+
24
+ attr_accessor :category
25
+
26
+ attr_accessor :width
27
+
28
+ attr_accessor :height
29
+
30
+ attr_accessor :sort_order
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'url' => :'url',
36
+ :'thumbnail_url' => :'thumbnailUrl',
37
+ :'caption' => :'caption',
38
+ :'category' => :'category',
39
+ :'width' => :'width',
40
+ :'height' => :'height',
41
+ :'sort_order' => :'sortOrder'
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
+ :'url' => :'String',
59
+ :'thumbnail_url' => :'String',
60
+ :'caption' => :'String',
61
+ :'category' => :'String',
62
+ :'width' => :'Integer',
63
+ :'height' => :'Integer',
64
+ :'sort_order' => :'Integer'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'thumbnail_url',
72
+ :'caption',
73
+ :'category',
74
+ :'width',
75
+ :'height',
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingContentPhoto` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingContentPhoto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'url')
96
+ self.url = attributes[:'url']
97
+ end
98
+
99
+ if attributes.key?(:'thumbnail_url')
100
+ self.thumbnail_url = attributes[:'thumbnail_url']
101
+ end
102
+
103
+ if attributes.key?(:'caption')
104
+ self.caption = attributes[:'caption']
105
+ end
106
+
107
+ if attributes.key?(:'category')
108
+ self.category = attributes[:'category']
109
+ end
110
+
111
+ if attributes.key?(:'width')
112
+ self.width = attributes[:'width']
113
+ end
114
+
115
+ if attributes.key?(:'height')
116
+ self.height = attributes[:'height']
117
+ end
118
+
119
+ if attributes.key?(:'sort_order')
120
+ self.sort_order = attributes[:'sort_order']
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
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ url == o.url &&
145
+ thumbnail_url == o.thumbnail_url &&
146
+ caption == o.caption &&
147
+ category == o.category &&
148
+ width == o.width &&
149
+ height == o.height &&
150
+ sort_order == o.sort_order
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [url, thumbnail_url, caption, category, width, height, sort_order].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ attributes = attributes.transform_keys(&:to_sym)
171
+ transformed_hash = {}
172
+ openapi_types.each_pair do |key, type|
173
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = nil
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[attribute_map[key]].is_a?(Array)
179
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
180
+ end
181
+ elsif !attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
183
+ end
184
+ end
185
+ new(transformed_hash)
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ end
205
+
206
+ end