repull 0.2.57 → 0.2.59

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +137 -6
  3. data/lib/repull/models/account_calendar_access_changed_event.rb +11 -1
  4. data/lib/repull/models/account_created_event.rb +11 -1
  5. data/lib/repull/models/account_disconnected_event.rb +11 -1
  6. data/lib/repull/models/account_import_completed_event.rb +11 -1
  7. data/lib/repull/models/account_import_failed_event.rb +11 -1
  8. data/lib/repull/models/account_import_started_event.rb +11 -1
  9. data/lib/repull/models/account_notifications_missing_event.rb +11 -1
  10. data/lib/repull/models/account_units_added_event.rb +11 -1
  11. data/lib/repull/models/ai_operation_completed_event.rb +11 -1
  12. data/lib/repull/models/ai_operation_failed_event.rb +11 -1
  13. data/lib/repull/models/app_connection_health.rb +301 -0
  14. data/lib/repull/models/app_connection_health_recent_errors_inner.rb +184 -0
  15. data/lib/repull/models/app_connection_health_writes_per_day_inner.rb +156 -0
  16. data/lib/repull/models/booking_unacknowledged_event.rb +11 -1
  17. data/lib/repull/models/channel_degraded_event.rb +11 -1
  18. data/lib/repull/models/channel_sync_failed_event.rb +11 -1
  19. data/lib/repull/models/connect_provider.rb +2 -2
  20. data/lib/repull/models/connect_session_abandoned_event.rb +11 -1
  21. data/lib/repull/models/connect_session_completed_event.rb +11 -1
  22. data/lib/repull/models/connect_status.rb +1 -1
  23. data/lib/repull/models/connection.rb +81 -5
  24. data/lib/repull/models/conversation_message_status_changed_event.rb +11 -1
  25. data/lib/repull/models/create_connection_request.rb +10 -1
  26. data/lib/repull/models/create_connection_request_workspace.rb +203 -0
  27. data/lib/repull/models/create_price_labs_key201_response.rb +399 -0
  28. data/lib/repull/models/create_price_labs_key201_response_all_of_instructions.rb +159 -0
  29. data/lib/repull/models/create_price_labs_key_request.rb +207 -0
  30. data/lib/repull/models/get_price_labs_session_status200_response.rb +192 -0
  31. data/lib/repull/models/inquiry_created_event.rb +11 -1
  32. data/lib/repull/models/inquiry_updated_event.rb +11 -1
  33. data/lib/repull/models/listing_created_event.rb +11 -1
  34. data/lib/repull/models/listing_deleted_event.rb +11 -1
  35. data/lib/repull/models/listing_ical_feed_changed_event.rb +11 -1
  36. data/lib/repull/models/listing_reactivated_event.rb +11 -1
  37. data/lib/repull/models/listing_suspended_event.rb +11 -1
  38. data/lib/repull/models/listing_updated_event.rb +11 -1
  39. data/lib/repull/models/migration_completed_event.rb +1 -1
  40. data/lib/repull/models/migration_failed_event.rb +1 -1
  41. data/lib/repull/models/payment_completed_event.rb +11 -1
  42. data/lib/repull/models/payment_refunded_event.rb +11 -1
  43. data/lib/repull/models/payout_completed_event.rb +11 -1
  44. data/lib/repull/models/repull_ping_event.rb +11 -1
  45. data/lib/repull/models/reservation_alteration_created_event.rb +11 -1
  46. data/lib/repull/models/reservation_alteration_responded_event.rb +11 -1
  47. data/lib/repull/models/reservation_cancelled_event.rb +11 -1
  48. data/lib/repull/models/reservation_created_event.rb +11 -1
  49. data/lib/repull/models/reservation_message_reaction_event.rb +11 -1
  50. data/lib/repull/models/reservation_message_read_event.rb +11 -1
  51. data/lib/repull/models/reservation_message_received_event.rb +11 -1
  52. data/lib/repull/models/reservation_message_sent_event.rb +11 -1
  53. data/lib/repull/models/reservation_message_updated_event.rb +11 -1
  54. data/lib/repull/models/reservation_request_created_event.rb +11 -1
  55. data/lib/repull/models/reservation_request_updated_event.rb +11 -1
  56. data/lib/repull/models/reservation_thread_assigned_event.rb +11 -1
  57. data/lib/repull/models/reservation_updated_event.rb +11 -1
  58. data/lib/repull/models/review_created_event.rb +11 -1
  59. data/lib/repull/models/review_responded_event.rb +11 -1
  60. data/lib/repull/models/usage_quota_warning_event.rb +11 -1
  61. data/lib/repull/version.rb +1 -1
  62. data/lib/repull.rb +8 -0
  63. data/openapi/v1.json +576 -8
  64. metadata +10 -2
@@ -28,6 +28,8 @@ module Repull
28
28
  # Airbnb + Booking.com — your own correlation token, e.g. your user id (at most 500 characters). Echoed on the redirect back (`&state=`) and in the `connect.session.completed` webhook.
29
29
  attr_accessor :state
30
30
 
31
+ attr_accessor :workspace
32
+
31
33
  # Airbnb and Booking.com — optional UI language for the hosted Connect pages. Accepts any supported locale code (currently `en`, `fr`, `de`, `es`, `it`, `nl`); unknown codes are ignored and resolution falls back to the workspace `default_language`, then `Accept-Language`, then `en`.
32
34
  attr_accessor :locale
33
35
 
@@ -60,6 +62,7 @@ module Repull
60
62
  :'access_type' => :'accessType',
61
63
  :'reservation_history_months' => :'reservationHistoryMonths',
62
64
  :'state' => :'state',
65
+ :'workspace' => :'workspace',
63
66
  :'locale' => :'locale'
64
67
  }
65
68
  end
@@ -81,6 +84,7 @@ module Repull
81
84
  :'access_type' => :'String',
82
85
  :'reservation_history_months' => :'Integer',
83
86
  :'state' => :'String',
87
+ :'workspace' => :'CreateConnectionRequestWorkspace',
84
88
  :'locale' => :'String'
85
89
  }
86
90
  end
@@ -126,6 +130,10 @@ module Repull
126
130
  self.state = attributes[:'state']
127
131
  end
128
132
 
133
+ if attributes.key?(:'workspace')
134
+ self.workspace = attributes[:'workspace']
135
+ end
136
+
129
137
  if attributes.key?(:'locale')
130
138
  self.locale = attributes[:'locale']
131
139
  end
@@ -195,6 +203,7 @@ module Repull
195
203
  access_type == o.access_type &&
196
204
  reservation_history_months == o.reservation_history_months &&
197
205
  state == o.state &&
206
+ workspace == o.workspace &&
198
207
  locale == o.locale
199
208
  end
200
209
 
@@ -207,7 +216,7 @@ module Repull
207
216
  # Calculates hash code according to all attributes.
208
217
  # @return [Integer] Hash code
209
218
  def hash
210
- [redirect_url, access_type, reservation_history_months, state, locale].hash
219
+ [redirect_url, access_type, reservation_history_months, state, workspace, locale].hash
211
220
  end
212
221
 
213
222
  # Builds the object from hash
@@ -0,0 +1,203 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## 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`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
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
+ # PriceLabs only: open a new sub-workspace for this host and connect PriceLabs there (its id is returned as `workspaceId`). Don't send it together with `X-Workspace-Id`.
18
+ class CreateConnectionRequestWorkspace < ApiModelBase
19
+ attr_accessor :name
20
+
21
+ # Your own id for this host.
22
+ attr_accessor :external_ref
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'name' => :'name',
28
+ :'external_ref' => :'externalRef'
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
+ :'name' => :'String',
46
+ :'external_ref' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::CreateConnectionRequestWorkspace` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::CreateConnectionRequestWorkspace`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ else
75
+ self.name = nil
76
+ end
77
+
78
+ if attributes.key?(:'external_ref')
79
+ self.external_ref = attributes[:'external_ref']
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
+ if @name.nil?
89
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
90
+ end
91
+
92
+ if @name.to_s.length > 120
93
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 120.')
94
+ end
95
+
96
+ if !@external_ref.nil? && @external_ref.to_s.length > 120
97
+ invalid_properties.push('invalid value for "external_ref", the character length must be smaller than or equal to 120.')
98
+ end
99
+
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ return false if @name.nil?
108
+ return false if @name.to_s.length > 120
109
+ return false if !@external_ref.nil? && @external_ref.to_s.length > 120
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] name Value to be assigned
115
+ def name=(name)
116
+ if name.nil?
117
+ fail ArgumentError, 'name cannot be nil'
118
+ end
119
+
120
+ if name.to_s.length > 120
121
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 120.'
122
+ end
123
+
124
+ @name = name
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] external_ref Value to be assigned
129
+ def external_ref=(external_ref)
130
+ if external_ref.nil?
131
+ fail ArgumentError, 'external_ref cannot be nil'
132
+ end
133
+
134
+ if external_ref.to_s.length > 120
135
+ fail ArgumentError, 'invalid value for "external_ref", the character length must be smaller than or equal to 120.'
136
+ end
137
+
138
+ @external_ref = external_ref
139
+ end
140
+
141
+ # Checks equality by comparing each attribute.
142
+ # @param [Object] Object to be compared
143
+ def ==(o)
144
+ return true if self.equal?(o)
145
+ self.class == o.class &&
146
+ name == o.name &&
147
+ external_ref == o.external_ref
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [name, external_ref].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ transformed_hash = {}
169
+ openapi_types.each_pair do |key, type|
170
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = nil
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[attribute_map[key]].is_a?(Array)
176
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
177
+ end
178
+ elsif !attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
180
+ end
181
+ end
182
+ new(transformed_hash)
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ end
202
+
203
+ end
@@ -0,0 +1,399 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect Airbnb, Booking.com, Vrbo and more channels, plus 14 PMS platforms, through one REST API. ## 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`, `limit`, `used` and `resets_at` fields. **The way past a request quota.** The monthly quota refusal (`429 rate_limit_exceeded` with `scope: \"monthly\"`), `402 credits_exhausted` and `429 daily_limit_exceeded` also carry `upgrade` (the cheapest plan that covers your usage: its exact monthly price for your listings, its request quotas and a `checkout_url` that opens checkout for that price; `plan: \"custom\"` with a `contact_email` when no self-serve plan covers it), `credits` (pay-as-you-go: `usd_per_1000_requests`, `top_up_url`, your `balance_usd`), `resets_at` and `projected_monthly_requests`. The per-minute 429 (`scope: \"per_api_key\"`) carries none of these: wait `Retry-After`. ## Plan listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`. Upgrading at `https://repull.dev/dashboard/billing` lifts the cap but does not switch held-back listings on: you choose which to activate afterwards, with the same call or from the dashboard, and each one you switch on is billed from then. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\"). ## Failed payments If your plan's renewal payment fails, nothing is blocked: your API calls keep working while Stripe retries the card. Every successful JSON response then carries a `billingNotice` (code `payment_failed`) with the amount, when it failed, the next automatic retry (`nextRetryAt`) and `payUrl`, the invoice to pay. It disappears once the invoice is paid.
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 CreatePriceLabsKey201Response < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :provider
21
+
22
+ # `active` — connected and working. `pending` — still settling. `needs_permissions` — connected but the host must grant more access before it works (see `action`/`fixUrl`). An `active` connection can also carry an `action` (e.g. a Smoobu legacy API key that must be replaced with a key + secret before October 31, 2026). `error` — the last operation failed. `disconnected` — revoked or superseded.
23
+ attr_accessor :status
24
+
25
+ # The platform's own account id: Airbnb host id; Booking.com hotel id (`booking`); the Booking.com account id behind the Extranet login (`booking_extranet`); Vrbo's account id (`vrbo`); the PMS's own account or company id. `null` when the platform id is not known yet (a Vrbo sign-in before its account id is captured, a PMS that does not expose one); never a Repull id. Use `id` for our record.
26
+ attr_accessor :external_account_id
27
+
28
+ # What this connection may do: `read_only`, `messaging` or `full_access` (see `ConnectionAccessType` for the meaning per provider). Airbnb: the tier of the host in `externalAccountId`. `null` when unknown.
29
+ attr_accessor :access_type
30
+
31
+ attr_accessor :created_at
32
+
33
+ # Host metadata for the linked account. Currently populated for Airbnb only; null for other providers.
34
+ attr_accessor :host
35
+
36
+ # Set when the host must do something before the connection works (e.g. grant the invited Booking.com Extranet user full access), or has units still to map (`reason: needs_mapping` — Booking.com Extranet rooms, Vrbo units; `required` is false when only some Vrbo units are left). `null` when no action is pending.
37
+ attr_accessor :action
38
+
39
+ # Durable link that reopens the hosted Connect flow bound to this account on the fix screen — send the host here to resolve `action`. For `needs_mapping` it opens the unit mapping directly (no new sign-in). Present whenever `action` is set; `null` otherwise.
40
+ attr_accessor :fix_url
41
+
42
+ # The account's latest import — `status: running` while the first sync (or a later one) is going, then `completed` or `failed`. `null` when no import has been recorded. The same run is announced by the `account.import.*` webhooks; the history is on `GET /v1/connections/{id}/imports`.
43
+ attr_accessor :import
44
+
45
+ # Apps (`pricelabs`) only. `workspace`: every listing of the workspace, including listings added later. `listings`: only `listingIds`.
46
+ attr_accessor :scope
47
+
48
+ # Apps only: the listings a `listings`-scoped connection covers; `null` for `workspace`.
49
+ attr_accessor :listing_ids
50
+
51
+ # Apps only: listings the connection covers now.
52
+ attr_accessor :listing_count
53
+
54
+ # Apps only: the key the app uses, masked. The key itself is shown once, when created.
55
+ attr_accessor :key_masked
56
+
57
+ # Apps only: the name given to the key.
58
+ attr_accessor :label
59
+
60
+ # Apps only: when the connection was revoked.
61
+ attr_accessor :disconnected_at
62
+
63
+ # Apps only: how the app is doing on this connection. `null` once disconnected.
64
+ attr_accessor :health
65
+
66
+ # The key to paste into PriceLabs. Returned only here.
67
+ attr_accessor :key
68
+
69
+ attr_accessor :instructions
70
+
71
+ class EnumAttributeValidator
72
+ attr_reader :datatype
73
+ attr_reader :allowable_values
74
+
75
+ def initialize(datatype, allowable_values)
76
+ @allowable_values = allowable_values.map do |value|
77
+ case datatype.to_s
78
+ when /Integer/i
79
+ value.to_i
80
+ when /Float/i
81
+ value.to_f
82
+ else
83
+ value
84
+ end
85
+ end
86
+ end
87
+
88
+ def valid?(value)
89
+ !value || allowable_values.include?(value)
90
+ end
91
+ end
92
+
93
+ # Attribute mapping from ruby-style variable name to JSON key.
94
+ def self.attribute_map
95
+ {
96
+ :'id' => :'id',
97
+ :'provider' => :'provider',
98
+ :'status' => :'status',
99
+ :'external_account_id' => :'externalAccountId',
100
+ :'access_type' => :'accessType',
101
+ :'created_at' => :'createdAt',
102
+ :'host' => :'host',
103
+ :'action' => :'action',
104
+ :'fix_url' => :'fixUrl',
105
+ :'import' => :'import',
106
+ :'scope' => :'scope',
107
+ :'listing_ids' => :'listingIds',
108
+ :'listing_count' => :'listingCount',
109
+ :'key_masked' => :'keyMasked',
110
+ :'label' => :'label',
111
+ :'disconnected_at' => :'disconnectedAt',
112
+ :'health' => :'health',
113
+ :'key' => :'key',
114
+ :'instructions' => :'instructions'
115
+ }
116
+ end
117
+
118
+ # Returns attribute mapping this model knows about
119
+ def self.acceptable_attribute_map
120
+ attribute_map
121
+ end
122
+
123
+ # Returns all the JSON keys this model knows about
124
+ def self.acceptable_attributes
125
+ acceptable_attribute_map.values
126
+ end
127
+
128
+ # Attribute type mapping.
129
+ def self.openapi_types
130
+ {
131
+ :'id' => :'String',
132
+ :'provider' => :'String',
133
+ :'status' => :'String',
134
+ :'external_account_id' => :'String',
135
+ :'access_type' => :'ConnectionAccessType',
136
+ :'created_at' => :'Time',
137
+ :'host' => :'ConnectHost',
138
+ :'action' => :'ConnectionAction',
139
+ :'fix_url' => :'String',
140
+ :'import' => :'AccountImport',
141
+ :'scope' => :'String',
142
+ :'listing_ids' => :'Array<String>',
143
+ :'listing_count' => :'Integer',
144
+ :'key_masked' => :'String',
145
+ :'label' => :'String',
146
+ :'disconnected_at' => :'Time',
147
+ :'health' => :'AppConnectionHealth',
148
+ :'key' => :'String',
149
+ :'instructions' => :'CreatePriceLabsKey201ResponseAllOfInstructions'
150
+ }
151
+ end
152
+
153
+ # List of attributes with nullable: true
154
+ def self.openapi_nullable
155
+ Set.new([
156
+ :'external_account_id',
157
+ :'access_type',
158
+ :'host',
159
+ :'action',
160
+ :'fix_url',
161
+ :'import',
162
+ :'listing_ids',
163
+ :'label',
164
+ :'disconnected_at',
165
+ :'health',
166
+ ])
167
+ end
168
+
169
+ # List of class defined in allOf (OpenAPI v3)
170
+ def self.openapi_all_of
171
+ [
172
+ :'Connection'
173
+ ]
174
+ end
175
+
176
+ # Initializes the object
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ def initialize(attributes = {})
179
+ if (!attributes.is_a?(Hash))
180
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::CreatePriceLabsKey201Response` initialize method"
181
+ end
182
+
183
+ # check to see if the attribute exists and convert string to symbol for hash key
184
+ acceptable_attribute_map = self.class.acceptable_attribute_map
185
+ attributes = attributes.each_with_object({}) { |(k, v), h|
186
+ if (!acceptable_attribute_map.key?(k.to_sym))
187
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::CreatePriceLabsKey201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
188
+ end
189
+ h[k.to_sym] = v
190
+ }
191
+
192
+ if attributes.key?(:'id')
193
+ self.id = attributes[:'id']
194
+ end
195
+
196
+ if attributes.key?(:'provider')
197
+ self.provider = attributes[:'provider']
198
+ end
199
+
200
+ if attributes.key?(:'status')
201
+ self.status = attributes[:'status']
202
+ end
203
+
204
+ if attributes.key?(:'external_account_id')
205
+ self.external_account_id = attributes[:'external_account_id']
206
+ end
207
+
208
+ if attributes.key?(:'access_type')
209
+ self.access_type = attributes[:'access_type']
210
+ end
211
+
212
+ if attributes.key?(:'created_at')
213
+ self.created_at = attributes[:'created_at']
214
+ end
215
+
216
+ if attributes.key?(:'host')
217
+ self.host = attributes[:'host']
218
+ end
219
+
220
+ if attributes.key?(:'action')
221
+ self.action = attributes[:'action']
222
+ end
223
+
224
+ if attributes.key?(:'fix_url')
225
+ self.fix_url = attributes[:'fix_url']
226
+ end
227
+
228
+ if attributes.key?(:'import')
229
+ self.import = attributes[:'import']
230
+ end
231
+
232
+ if attributes.key?(:'scope')
233
+ self.scope = attributes[:'scope']
234
+ end
235
+
236
+ if attributes.key?(:'listing_ids')
237
+ if (value = attributes[:'listing_ids']).is_a?(Array)
238
+ self.listing_ids = value
239
+ end
240
+ end
241
+
242
+ if attributes.key?(:'listing_count')
243
+ self.listing_count = attributes[:'listing_count']
244
+ end
245
+
246
+ if attributes.key?(:'key_masked')
247
+ self.key_masked = attributes[:'key_masked']
248
+ end
249
+
250
+ if attributes.key?(:'label')
251
+ self.label = attributes[:'label']
252
+ end
253
+
254
+ if attributes.key?(:'disconnected_at')
255
+ self.disconnected_at = attributes[:'disconnected_at']
256
+ end
257
+
258
+ if attributes.key?(:'health')
259
+ self.health = attributes[:'health']
260
+ end
261
+
262
+ if attributes.key?(:'key')
263
+ self.key = attributes[:'key']
264
+ else
265
+ self.key = nil
266
+ end
267
+
268
+ if attributes.key?(:'instructions')
269
+ self.instructions = attributes[:'instructions']
270
+ else
271
+ self.instructions = nil
272
+ end
273
+ end
274
+
275
+ # Show invalid properties with the reasons. Usually used together with valid?
276
+ # @return Array for valid properties with the reasons
277
+ def list_invalid_properties
278
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
279
+ invalid_properties = Array.new
280
+ if @key.nil?
281
+ invalid_properties.push('invalid value for "key", key cannot be nil.')
282
+ end
283
+
284
+ if @instructions.nil?
285
+ invalid_properties.push('invalid value for "instructions", instructions cannot be nil.')
286
+ end
287
+
288
+ invalid_properties
289
+ end
290
+
291
+ # Check to see if the all the properties in the model are valid
292
+ # @return true if the model is valid
293
+ def valid?
294
+ warn '[DEPRECATED] the `valid?` method is obsolete'
295
+ return false if @key.nil?
296
+ return false if @instructions.nil?
297
+ true
298
+ end
299
+
300
+ # Custom attribute writer method with validation
301
+ # @param [Object] key Value to be assigned
302
+ def key=(key)
303
+ if key.nil?
304
+ fail ArgumentError, 'key cannot be nil'
305
+ end
306
+
307
+ @key = key
308
+ end
309
+
310
+ # Custom attribute writer method with validation
311
+ # @param [Object] instructions Value to be assigned
312
+ def instructions=(instructions)
313
+ if instructions.nil?
314
+ fail ArgumentError, 'instructions cannot be nil'
315
+ end
316
+
317
+ @instructions = instructions
318
+ end
319
+
320
+ # Checks equality by comparing each attribute.
321
+ # @param [Object] Object to be compared
322
+ def ==(o)
323
+ return true if self.equal?(o)
324
+ self.class == o.class &&
325
+ id == o.id &&
326
+ provider == o.provider &&
327
+ status == o.status &&
328
+ external_account_id == o.external_account_id &&
329
+ access_type == o.access_type &&
330
+ created_at == o.created_at &&
331
+ host == o.host &&
332
+ action == o.action &&
333
+ fix_url == o.fix_url &&
334
+ import == o.import &&
335
+ scope == o.scope &&
336
+ listing_ids == o.listing_ids &&
337
+ listing_count == o.listing_count &&
338
+ key_masked == o.key_masked &&
339
+ label == o.label &&
340
+ disconnected_at == o.disconnected_at &&
341
+ health == o.health &&
342
+ key == o.key &&
343
+ instructions == o.instructions
344
+ end
345
+
346
+ # @see the `==` method
347
+ # @param [Object] Object to be compared
348
+ def eql?(o)
349
+ self == o
350
+ end
351
+
352
+ # Calculates hash code according to all attributes.
353
+ # @return [Integer] Hash code
354
+ def hash
355
+ [id, provider, status, external_account_id, access_type, created_at, host, action, fix_url, import, scope, listing_ids, listing_count, key_masked, label, disconnected_at, health, key, instructions].hash
356
+ end
357
+
358
+ # Builds the object from hash
359
+ # @param [Hash] attributes Model attributes in the form of hash
360
+ # @return [Object] Returns the model itself
361
+ def self.build_from_hash(attributes)
362
+ return nil unless attributes.is_a?(Hash)
363
+ attributes = attributes.transform_keys(&:to_sym)
364
+ transformed_hash = {}
365
+ openapi_types.each_pair do |key, type|
366
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
367
+ transformed_hash["#{key}"] = nil
368
+ elsif type =~ /\AArray<(.*)>/i
369
+ # check to ensure the input is an array given that the attribute
370
+ # is documented as an array but the input is not
371
+ if attributes[attribute_map[key]].is_a?(Array)
372
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
373
+ end
374
+ elsif !attributes[attribute_map[key]].nil?
375
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
376
+ end
377
+ end
378
+ new(transformed_hash)
379
+ end
380
+
381
+ # Returns the object in the form of hash
382
+ # @return [Hash] Returns the object in the form of hash
383
+ def to_hash
384
+ hash = {}
385
+ self.class.attribute_map.each_pair do |attr, param|
386
+ value = self.send(attr)
387
+ if value.nil?
388
+ is_nullable = self.class.openapi_nullable.include?(attr)
389
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
390
+ end
391
+
392
+ hash[param] = _to_hash(value)
393
+ end
394
+ hash
395
+ end
396
+
397
+ end
398
+
399
+ end