repull 0.2.32 → 0.2.33

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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/repull/api/connections_api.rb +77 -0
  4. data/lib/repull/api/resolutions_api.rb +236 -0
  5. data/lib/repull/api/transactions_api.rb +73 -0
  6. data/lib/repull/models/account_import.rb +237 -0
  7. data/lib/repull/models/account_import_completed_event.rb +282 -0
  8. data/lib/repull/models/account_import_counts.rb +193 -0
  9. data/lib/repull/models/account_import_failed_event.rb +282 -0
  10. data/lib/repull/models/account_import_finished_payload.rb +224 -0
  11. data/lib/repull/models/account_import_stage.rb +177 -0
  12. data/lib/repull/models/account_import_started_event.rb +282 -0
  13. data/lib/repull/models/account_import_started_payload.rb +177 -0
  14. data/lib/repull/models/connection.rb +16 -5
  15. data/lib/repull/models/list_airbnb_resolutions200_response.rb +192 -0
  16. data/lib/repull/models/list_connection_imports200_response.rb +158 -0
  17. data/lib/repull/models/refresh_airbnb_resolutions200_response.rb +219 -0
  18. data/lib/repull/models/refresh_airbnb_resolutions200_response_accounts_inner.rb +200 -0
  19. data/lib/repull/models/refresh_airbnb_resolutions200_response_accounts_inner_error.rb +156 -0
  20. data/lib/repull/models/refresh_airbnb_resolutions_request.rb +192 -0
  21. data/lib/repull/models/resolution.rb +329 -0
  22. data/lib/repull/models/transaction_payout.rb +17 -6
  23. data/lib/repull/models/webhook_event.rb +6 -0
  24. data/lib/repull/models/webhook_event_type.rb +4 -1
  25. data/lib/repull/version.rb +1 -1
  26. data/lib/repull.rb +16 -0
  27. data/openapi/v1.json +845 -78
  28. data/scripts/regen.sh +1 -1
  29. metadata +18 -2
@@ -0,0 +1,282 @@
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
+ # An account import began.
18
+ class AccountImportStartedEvent < ApiModelBase
19
+ # The event name. This field is `event`, not `type`.
20
+ attr_accessor :event
21
+
22
+ # Stable across every delivery and replay of this logical event — dedupe on it.
23
+ attr_accessor :event_id
24
+
25
+ attr_accessor :api_version
26
+
27
+ # When this delivery was built.
28
+ attr_accessor :timestamp
29
+
30
+ attr_accessor :account
31
+
32
+ attr_accessor :data
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'event' => :'event',
38
+ :'event_id' => :'eventId',
39
+ :'api_version' => :'apiVersion',
40
+ :'timestamp' => :'timestamp',
41
+ :'account' => :'account',
42
+ :'data' => :'data'
43
+ }
44
+ end
45
+
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ acceptable_attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'event' => :'String',
60
+ :'event_id' => :'String',
61
+ :'api_version' => :'String',
62
+ :'timestamp' => :'Time',
63
+ :'account' => :'WebhookEventAccount',
64
+ :'data' => :'AccountImportStartedPayload'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'account',
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AccountImportStartedEvent` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AccountImportStartedEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'event')
92
+ self.event = attributes[:'event']
93
+ else
94
+ self.event = nil
95
+ end
96
+
97
+ if attributes.key?(:'event_id')
98
+ self.event_id = attributes[:'event_id']
99
+ else
100
+ self.event_id = nil
101
+ end
102
+
103
+ if attributes.key?(:'api_version')
104
+ self.api_version = attributes[:'api_version']
105
+ else
106
+ self.api_version = nil
107
+ end
108
+
109
+ if attributes.key?(:'timestamp')
110
+ self.timestamp = attributes[:'timestamp']
111
+ else
112
+ self.timestamp = nil
113
+ end
114
+
115
+ if attributes.key?(:'account')
116
+ self.account = attributes[:'account']
117
+ end
118
+
119
+ if attributes.key?(:'data')
120
+ self.data = attributes[:'data']
121
+ else
122
+ self.data = nil
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
+ invalid_properties = Array.new
131
+ if @event.nil?
132
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
133
+ end
134
+
135
+ if @event_id.nil?
136
+ invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
137
+ end
138
+
139
+ if @api_version.nil?
140
+ invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
141
+ end
142
+
143
+ if @timestamp.nil?
144
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
145
+ end
146
+
147
+ if @data.nil?
148
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
149
+ end
150
+
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ warn '[DEPRECATED] the `valid?` method is obsolete'
158
+ return false if @event.nil?
159
+ return false if @event_id.nil?
160
+ return false if @api_version.nil?
161
+ return false if @timestamp.nil?
162
+ return false if @data.nil?
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] event Value to be assigned
168
+ def event=(event)
169
+ if event.nil?
170
+ fail ArgumentError, 'event cannot be nil'
171
+ end
172
+
173
+ @event = event
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] event_id Value to be assigned
178
+ def event_id=(event_id)
179
+ if event_id.nil?
180
+ fail ArgumentError, 'event_id cannot be nil'
181
+ end
182
+
183
+ @event_id = event_id
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] api_version Value to be assigned
188
+ def api_version=(api_version)
189
+ if api_version.nil?
190
+ fail ArgumentError, 'api_version cannot be nil'
191
+ end
192
+
193
+ @api_version = api_version
194
+ end
195
+
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] timestamp Value to be assigned
198
+ def timestamp=(timestamp)
199
+ if timestamp.nil?
200
+ fail ArgumentError, 'timestamp cannot be nil'
201
+ end
202
+
203
+ @timestamp = timestamp
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] data Value to be assigned
208
+ def data=(data)
209
+ if data.nil?
210
+ fail ArgumentError, 'data cannot be nil'
211
+ end
212
+
213
+ @data = data
214
+ end
215
+
216
+ # Checks equality by comparing each attribute.
217
+ # @param [Object] Object to be compared
218
+ def ==(o)
219
+ return true if self.equal?(o)
220
+ self.class == o.class &&
221
+ event == o.event &&
222
+ event_id == o.event_id &&
223
+ api_version == o.api_version &&
224
+ timestamp == o.timestamp &&
225
+ account == o.account &&
226
+ data == o.data
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Integer] Hash code
237
+ def hash
238
+ [event, event_id, api_version, timestamp, account, data].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def self.build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ transformed_hash = {}
248
+ openapi_types.each_pair do |key, type|
249
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = nil
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[attribute_map[key]].is_a?(Array)
255
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
256
+ end
257
+ elsif !attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
259
+ end
260
+ end
261
+ new(transformed_hash)
262
+ end
263
+
264
+ # Returns the object in the form of hash
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_hash
267
+ hash = {}
268
+ self.class.attribute_map.each_pair do |attr, param|
269
+ value = self.send(attr)
270
+ if value.nil?
271
+ is_nullable = self.class.openapi_nullable.include?(attr)
272
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
273
+ end
274
+
275
+ hash[param] = _to_hash(value)
276
+ end
277
+ hash
278
+ end
279
+
280
+ end
281
+
282
+ end
@@ -0,0 +1,177 @@
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 AccountImportStartedPayload < ApiModelBase
18
+ attr_accessor :import_id
19
+
20
+ attr_accessor :trigger
21
+
22
+ attr_accessor :started_at
23
+
24
+ # The stages this import will run.
25
+ attr_accessor :stages
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'import_id' => :'importId',
31
+ :'trigger' => :'trigger',
32
+ :'started_at' => :'startedAt',
33
+ :'stages' => :'stages'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'import_id' => :'String',
51
+ :'trigger' => :'String',
52
+ :'started_at' => :'Time',
53
+ :'stages' => :'Array<String>'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AccountImportStartedPayload` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AccountImportStartedPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'import_id')
80
+ self.import_id = attributes[:'import_id']
81
+ end
82
+
83
+ if attributes.key?(:'trigger')
84
+ self.trigger = attributes[:'trigger']
85
+ end
86
+
87
+ if attributes.key?(:'started_at')
88
+ self.started_at = attributes[:'started_at']
89
+ end
90
+
91
+ if attributes.key?(:'stages')
92
+ if (value = attributes[:'stages']).is_a?(Array)
93
+ self.stages = value
94
+ end
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ import_id == o.import_id &&
119
+ trigger == o.trigger &&
120
+ started_at == o.started_at &&
121
+ stages == o.stages
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [import_id, trigger, started_at, stages].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ if value.nil?
166
+ is_nullable = self.class.openapi_nullable.include?(attr)
167
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
168
+ end
169
+
170
+ hash[param] = _to_hash(value)
171
+ end
172
+ hash
173
+ end
174
+
175
+ end
176
+
177
+ end
@@ -35,6 +35,9 @@ module Repull
35
35
  # Durable link that reopens the hosted Connect flow bound to this account on the fix screen — send the host here to resolve `action`. Present only when `action.required` is true; `null` otherwise.
36
36
  attr_accessor :fix_url
37
37
 
38
+ # 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`.
39
+ attr_accessor :import
40
+
38
41
  # Attribute mapping from ruby-style variable name to JSON key.
39
42
  def self.attribute_map
40
43
  {
@@ -45,7 +48,8 @@ module Repull
45
48
  :'created_at' => :'createdAt',
46
49
  :'host' => :'host',
47
50
  :'action' => :'action',
48
- :'fix_url' => :'fixUrl'
51
+ :'fix_url' => :'fixUrl',
52
+ :'import' => :'import'
49
53
  }
50
54
  end
51
55
 
@@ -69,7 +73,8 @@ module Repull
69
73
  :'created_at' => :'Time',
70
74
  :'host' => :'ConnectHost',
71
75
  :'action' => :'ConnectionAction',
72
- :'fix_url' => :'String'
76
+ :'fix_url' => :'String',
77
+ :'import' => :'AccountImport'
73
78
  }
74
79
  end
75
80
 
@@ -79,7 +84,8 @@ module Repull
79
84
  :'external_account_id',
80
85
  :'host',
81
86
  :'action',
82
- :'fix_url'
87
+ :'fix_url',
88
+ :'import'
83
89
  ])
84
90
  end
85
91
 
@@ -130,6 +136,10 @@ module Repull
130
136
  if attributes.key?(:'fix_url')
131
137
  self.fix_url = attributes[:'fix_url']
132
138
  end
139
+
140
+ if attributes.key?(:'import')
141
+ self.import = attributes[:'import']
142
+ end
133
143
  end
134
144
 
135
145
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -159,7 +169,8 @@ module Repull
159
169
  created_at == o.created_at &&
160
170
  host == o.host &&
161
171
  action == o.action &&
162
- fix_url == o.fix_url
172
+ fix_url == o.fix_url &&
173
+ import == o.import
163
174
  end
164
175
 
165
176
  # @see the `==` method
@@ -171,7 +182,7 @@ module Repull
171
182
  # Calculates hash code according to all attributes.
172
183
  # @return [Integer] Hash code
173
184
  def hash
174
- [id, provider, status, external_account_id, created_at, host, action, fix_url].hash
185
+ [id, provider, status, external_account_id, created_at, host, action, fix_url, import].hash
175
186
  end
176
187
 
177
188
  # Builds the object from hash