repull 0.2.24 → 0.2.26

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 (85) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +619 -2
  3. data/lib/repull/api/connections_api.rb +312 -0
  4. data/lib/repull/api/conversations_api.rb +154 -18
  5. data/lib/repull/api/health_api.rb +5 -5
  6. data/lib/repull/api/listings_api.rb +67 -4
  7. data/lib/repull/api/properties_api.rb +3 -0
  8. data/lib/repull/api/reservations_api.rb +3 -0
  9. data/lib/repull/api/reviews_api.rb +5 -2
  10. data/lib/repull/api/vrbo_api.rb +4 -4
  11. data/lib/repull/models/apply_connection_mappings200_response.rb +167 -0
  12. data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +184 -0
  13. data/lib/repull/models/apply_connection_mappings_request.rb +175 -0
  14. data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +193 -0
  15. data/lib/repull/models/auto_map_connection_units200_response.rb +176 -0
  16. data/lib/repull/models/auto_map_connection_units_request.rb +156 -0
  17. data/lib/repull/models/channel_market_state_item.rb +15 -4
  18. data/lib/repull/models/connect_session_completed_event.rb +281 -0
  19. data/lib/repull/models/connect_session_completed_payload.rb +210 -0
  20. data/lib/repull/models/connect_status.rb +25 -5
  21. data/lib/repull/models/connect_status_accounts_inner.rb +71 -4
  22. data/lib/repull/models/conversation.rb +12 -1
  23. data/lib/repull/models/conversation_capabilities.rb +260 -0
  24. data/lib/repull/models/conversation_detail.rb +25 -5
  25. data/lib/repull/models/create_connect_session_request.rb +24 -2
  26. data/lib/repull/models/create_connection_request.rb +8 -8
  27. data/lib/repull/models/create_conversation_special_offer201_response.rb +127 -4
  28. data/lib/repull/models/create_conversation_special_offer201_response_fees_inner.rb +166 -0
  29. data/lib/repull/models/create_conversation_special_offer201_response_lines_inner.rb +157 -0
  30. data/lib/repull/models/create_conversation_special_offer_request.rb +91 -52
  31. data/lib/repull/models/create_conversation_special_offer_request_fees_inner.rb +199 -0
  32. data/lib/repull/models/get_booking_extranet_login_config200_response.rb +147 -0
  33. data/lib/repull/models/get_booking_extranet_login_status200_response.rb +192 -0
  34. data/lib/repull/models/get_channel_health200_response.rb +190 -0
  35. data/lib/repull/models/get_channel_health200_response_vrbo.rb +197 -0
  36. data/lib/repull/models/get_connect_write_policy200_response.rb +166 -0
  37. data/lib/repull/models/get_listing_calendar_sync200_response.rb +192 -0
  38. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +331 -0
  39. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_problems_inner.rb +157 -0
  40. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue.rb +212 -0
  41. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue_last_push.rb +268 -0
  42. data/lib/repull/models/invite_booking_extranet_user200_response.rb +174 -0
  43. data/lib/repull/models/invite_booking_extranet_user_request.rb +173 -0
  44. data/lib/repull/models/list_connection_units200_response.rb +242 -0
  45. data/lib/repull/models/list_connection_units200_response_listing_options_inner.rb +165 -0
  46. data/lib/repull/models/list_connection_units200_response_units_inner.rb +194 -0
  47. data/lib/repull/models/listing_publish_status_connection.rb +34 -1
  48. data/lib/repull/models/pms_write_policy.rb +191 -0
  49. data/lib/repull/models/pms_write_policy_calendar.rb +219 -0
  50. data/lib/repull/models/pms_write_policy_reservations.rb +219 -0
  51. data/lib/repull/models/preapprove_conversation201_response.rb +47 -6
  52. data/lib/repull/models/preapprove_conversation_request.rb +34 -5
  53. data/lib/repull/models/preview_conversation_special_offer_request.rb +231 -0
  54. data/lib/repull/models/preview_conversation_special_offer_request_fees_inner.rb +199 -0
  55. data/lib/repull/models/preview_conversation_special_offer_request_guests.rb +250 -0
  56. data/lib/repull/models/property.rb +14 -2
  57. data/lib/repull/models/record_account.rb +170 -0
  58. data/lib/repull/models/reply_to_review_request.rb +33 -4
  59. data/lib/repull/models/reservation.rb +12 -1
  60. data/lib/repull/models/review.rb +12 -1
  61. data/lib/repull/models/search_connect_session_listing_options200_response.rb +158 -0
  62. data/lib/repull/models/search_connect_session_listing_options200_response_data_inner.rb +166 -0
  63. data/lib/repull/models/search_connection_listing_options200_response.rb +159 -0
  64. data/lib/repull/models/send_message_request.rb +1 -1
  65. data/lib/repull/models/start_booking_extranet_login200_response.rb +174 -0
  66. data/lib/repull/models/start_booking_extranet_login_request.rb +225 -0
  67. data/lib/repull/models/submit_cloudbeds_credentials200_response.rb +10 -1
  68. data/lib/repull/models/submit_cloudbeds_credentials_request.rb +11 -1
  69. data/lib/repull/models/submit_mews_credentials200_response.rb +10 -1
  70. data/lib/repull/models/submit_mews_credentials_request.rb +11 -1
  71. data/lib/repull/models/update_connect_write_policy_request.rb +157 -0
  72. data/lib/repull/models/update_connect_write_policy_request_calendar.rb +165 -0
  73. data/lib/repull/models/update_connect_write_policy_request_reservations.rb +165 -0
  74. data/lib/repull/models/vrbo_import_status.rb +249 -0
  75. data/lib/repull/models/vrbo_login200_response.rb +235 -0
  76. data/lib/repull/models/vrbo_login_request.rb +271 -0
  77. data/lib/repull/models/webhook_event.rb +2 -0
  78. data/lib/repull/models/webhook_event_type.rb +2 -1
  79. data/lib/repull/models/withdraw_conversation_preapproval200_response.rb +226 -0
  80. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +29 -1
  81. data/lib/repull/version.rb +1 -1
  82. data/lib/repull.rb +47 -0
  83. data/openapi/v1.json +2810 -74
  84. data/scripts/regen.sh +1 -1
  85. metadata +49 -2
@@ -0,0 +1,281 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ class ConnectSessionCompletedEvent < ApiModelBase
18
+ # The event name. This field is `event`, not `type`.
19
+ attr_accessor :event
20
+
21
+ # Stable across every delivery and replay of this logical event — dedupe on it.
22
+ attr_accessor :event_id
23
+
24
+ attr_accessor :api_version
25
+
26
+ # When this delivery was built.
27
+ attr_accessor :timestamp
28
+
29
+ attr_accessor :account
30
+
31
+ attr_accessor :data
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'event' => :'event',
37
+ :'event_id' => :'eventId',
38
+ :'api_version' => :'apiVersion',
39
+ :'timestamp' => :'timestamp',
40
+ :'account' => :'account',
41
+ :'data' => :'data'
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
+ :'event' => :'String',
59
+ :'event_id' => :'String',
60
+ :'api_version' => :'String',
61
+ :'timestamp' => :'Time',
62
+ :'account' => :'WebhookEventAccount',
63
+ :'data' => :'ConnectSessionCompletedPayload'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ :'account',
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectSessionCompletedEvent` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ acceptable_attribute_map = self.class.acceptable_attribute_map
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!acceptable_attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectSessionCompletedEvent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'event')
91
+ self.event = attributes[:'event']
92
+ else
93
+ self.event = nil
94
+ end
95
+
96
+ if attributes.key?(:'event_id')
97
+ self.event_id = attributes[:'event_id']
98
+ else
99
+ self.event_id = nil
100
+ end
101
+
102
+ if attributes.key?(:'api_version')
103
+ self.api_version = attributes[:'api_version']
104
+ else
105
+ self.api_version = nil
106
+ end
107
+
108
+ if attributes.key?(:'timestamp')
109
+ self.timestamp = attributes[:'timestamp']
110
+ else
111
+ self.timestamp = nil
112
+ end
113
+
114
+ if attributes.key?(:'account')
115
+ self.account = attributes[:'account']
116
+ end
117
+
118
+ if attributes.key?(:'data')
119
+ self.data = attributes[:'data']
120
+ else
121
+ self.data = nil
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @event.nil?
131
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
132
+ end
133
+
134
+ if @event_id.nil?
135
+ invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
136
+ end
137
+
138
+ if @api_version.nil?
139
+ invalid_properties.push('invalid value for "api_version", api_version cannot be nil.')
140
+ end
141
+
142
+ if @timestamp.nil?
143
+ invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
144
+ end
145
+
146
+ if @data.nil?
147
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if @event.nil?
158
+ return false if @event_id.nil?
159
+ return false if @api_version.nil?
160
+ return false if @timestamp.nil?
161
+ return false if @data.nil?
162
+ true
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] event Value to be assigned
167
+ def event=(event)
168
+ if event.nil?
169
+ fail ArgumentError, 'event cannot be nil'
170
+ end
171
+
172
+ @event = event
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] event_id Value to be assigned
177
+ def event_id=(event_id)
178
+ if event_id.nil?
179
+ fail ArgumentError, 'event_id cannot be nil'
180
+ end
181
+
182
+ @event_id = event_id
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] api_version Value to be assigned
187
+ def api_version=(api_version)
188
+ if api_version.nil?
189
+ fail ArgumentError, 'api_version cannot be nil'
190
+ end
191
+
192
+ @api_version = api_version
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] timestamp Value to be assigned
197
+ def timestamp=(timestamp)
198
+ if timestamp.nil?
199
+ fail ArgumentError, 'timestamp cannot be nil'
200
+ end
201
+
202
+ @timestamp = timestamp
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] data Value to be assigned
207
+ def data=(data)
208
+ if data.nil?
209
+ fail ArgumentError, 'data cannot be nil'
210
+ end
211
+
212
+ @data = data
213
+ end
214
+
215
+ # Checks equality by comparing each attribute.
216
+ # @param [Object] Object to be compared
217
+ def ==(o)
218
+ return true if self.equal?(o)
219
+ self.class == o.class &&
220
+ event == o.event &&
221
+ event_id == o.event_id &&
222
+ api_version == o.api_version &&
223
+ timestamp == o.timestamp &&
224
+ account == o.account &&
225
+ data == o.data
226
+ end
227
+
228
+ # @see the `==` method
229
+ # @param [Object] Object to be compared
230
+ def eql?(o)
231
+ self == o
232
+ end
233
+
234
+ # Calculates hash code according to all attributes.
235
+ # @return [Integer] Hash code
236
+ def hash
237
+ [event, event_id, api_version, timestamp, account, data].hash
238
+ end
239
+
240
+ # Builds the object from hash
241
+ # @param [Hash] attributes Model attributes in the form of hash
242
+ # @return [Object] Returns the model itself
243
+ def self.build_from_hash(attributes)
244
+ return nil unless attributes.is_a?(Hash)
245
+ attributes = attributes.transform_keys(&:to_sym)
246
+ transformed_hash = {}
247
+ openapi_types.each_pair do |key, type|
248
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
249
+ transformed_hash["#{key}"] = nil
250
+ elsif type =~ /\AArray<(.*)>/i
251
+ # check to ensure the input is an array given that the attribute
252
+ # is documented as an array but the input is not
253
+ if attributes[attribute_map[key]].is_a?(Array)
254
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
255
+ end
256
+ elsif !attributes[attribute_map[key]].nil?
257
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
258
+ end
259
+ end
260
+ new(transformed_hash)
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #Repull API
3
+
4
+ #The unified API for vacation rental tech. Connect to 50+ PMS platforms and 4 OTA channels through one REST API. Built-in AI operations for guest communication, pricing, and listing optimization. ## Designed for AI agents Every error response on this API includes machine-parseable fields so an LLM (Claude in MCP, Cursor, Cline, GPT, etc.) can self-recover without escalating to a human: - `error.code` — stable string identifier (e.g. `invalid_params`, `rate_limit_exceeded`) - `error.message` — human-readable cause - `error.fix` — exact recovery steps (e.g. \"Pass `check_in_after` as ISO 8601: `?check_in_after=2026-01-15`\") - `error.docs_url` — link to the canonical write-up at `https://repull.dev/docs/errors/{code}` - `error.request_id` — id to correlate with server-side logs - `error.field` / `error.value_received` / `error.valid_values` / `error.did_you_mean` — when the error is parameter-specific - `error.retry_after` — seconds to wait before retrying (rate-limit + transient upstream) `Access-Control-Expose-Headers` lists `x-request-id` and the `X-RateLimit-*` family so browsers can read them on cross-origin responses. ## Quick Start 1. Get an API key at https://repull.dev/dashboard 2. Connect a PMS: `POST /v1/connect/{provider}` 3. List properties: `GET /v1/properties` 4. Get reservations: `GET /v1/reservations` ## Authentication All requests require a Bearer token: ``` Authorization: Bearer sk_live_YOUR_API_KEY ``` ## Request Correlation (X-Request-ID) Every response carries an `X-Request-ID` header, e.g. `X-Request-ID: req_01HXY...`. Include this id in support tickets and bug reports — we can trace the full request lifecycle (auth, rate limit, handler, downstream calls, log row) from a single id. You may set the header on the inbound request to forward your own trace id; we will echo it back instead of generating a new one. Accepted format: `^[\\\\w.-]{1,128}$`. The id is also embedded in error envelopes as `request_id` so server-side log diffs work even when the response headers are stripped by an intermediate proxy. ## Rate Limits The public API enforces a per-API-key sliding-window rate limit on top of the per-tier monthly + daily-AI quotas. **Default policy:** 600 requests per 60 seconds, per API key. Sliding window — there is no fixed-minute boundary you can burst across. Every response includes: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | Requests permitted in the current window. | | `X-RateLimit-Remaining` | Requests left in the current window after this call. | | `X-RateLimit-Reset` | Unix epoch (seconds) when the next slot opens. | | `X-RateLimit-Policy` | Machine-readable policy descriptor, e.g. `600;w=60`. | | `Retry-After` | Seconds to wait before retrying. **Only present on 429 responses.** | **On 429 (rate_limit_exceeded):** the response body matches the standard error envelope with `code: \"rate_limit_exceeded\"`, plus `limit`, `window_seconds`, `retry_after`, and `request_id` fields. SDKs MUST honor `Retry-After` and use exponential backoff with jitter on subsequent retries — never a tight loop. Recommended backoff: ``` sleep_ms = (Retry-After * 1000) + random(0..250) ``` Monthly + daily-AI tier quotas (`free`, `starter`, `custom`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resetsAt` fields. ## Plan Limits (402 — `listings_limit_exceeded`) The Repull API also enforces a per-tier cap on **active listings**: | Tier | Active listings cap | |---|---| | `free` | 3 | | `starter` | 50 | | `custom` | unlimited | When a customer's active-listing count is above their tier cap, the API returns **`402 Payment Required`** with `error.code = \"listings_limit_exceeded\"` on every route EXCEPT: - `/v1/health` — uptime probes are never gated. - `/v1/usage/*` — so dashboards can render the over-cap state. - Any `DELETE` — so the customer can trim listings to get back under the cap without paying. Unlike 429, 402 is NOT a \"wait and retry\" condition — `Retry-After` is not set. The only paths back to 200 are: 1. `DELETE` enough listings to come back under the cap, or 2. Upgrade at `https://repull.dev/dashboard/billing`. The server-side usage cache is 60s, so the first 200 after an upgrade may take up to a minute. The envelope mirrors `rate_limit_exceeded` for SDK ergonomics: `tier`, `limit`, `active_listings`, `upgrade_url`, plus the standard `code` / `message` / `fix` / `docs_url` / `request_id`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Repull
17
+ # Payload for `connect.session.completed`. A user finished a Connect session, on any channel or PMS. Use `state` (your token from session creation) or `sessionId` to tie the connection to your own user; the account it names is keyed the same way as every other event's `account` block.
18
+ class ConnectSessionCompletedPayload < ApiModelBase
19
+ attr_accessor :session_id
20
+
21
+ # The `state` you passed when creating the session.
22
+ attr_accessor :state
23
+
24
+ # Channel or PMS: airbnb, booking, booking_extranet, vrbo, plumguide, hostaway, …
25
+ attr_accessor :provider
26
+
27
+ # The provider's own account id — Airbnb host id, Booking.com hotel id, Vrbo account id, or the PMS account.
28
+ attr_accessor :external_account_id
29
+
30
+ # Repull connection id, when the account has one (the `X-Account-Id` value).
31
+ attr_accessor :connection_id
32
+
33
+ attr_accessor :purpose
34
+
35
+ attr_accessor :completed_at
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'session_id' => :'sessionId',
41
+ :'state' => :'state',
42
+ :'provider' => :'provider',
43
+ :'external_account_id' => :'externalAccountId',
44
+ :'connection_id' => :'connectionId',
45
+ :'purpose' => :'purpose',
46
+ :'completed_at' => :'completedAt'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'session_id' => :'String',
64
+ :'state' => :'String',
65
+ :'provider' => :'String',
66
+ :'external_account_id' => :'String',
67
+ :'connection_id' => :'Integer',
68
+ :'purpose' => :'String',
69
+ :'completed_at' => :'Time'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ :'state',
77
+ :'provider',
78
+ :'external_account_id',
79
+ :'connection_id',
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ConnectSessionCompletedPayload` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ acceptable_attribute_map = self.class.acceptable_attribute_map
92
+ attributes = attributes.each_with_object({}) { |(k, v), h|
93
+ if (!acceptable_attribute_map.key?(k.to_sym))
94
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ConnectSessionCompletedPayload`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
95
+ end
96
+ h[k.to_sym] = v
97
+ }
98
+
99
+ if attributes.key?(:'session_id')
100
+ self.session_id = attributes[:'session_id']
101
+ end
102
+
103
+ if attributes.key?(:'state')
104
+ self.state = attributes[:'state']
105
+ end
106
+
107
+ if attributes.key?(:'provider')
108
+ self.provider = attributes[:'provider']
109
+ end
110
+
111
+ if attributes.key?(:'external_account_id')
112
+ self.external_account_id = attributes[:'external_account_id']
113
+ end
114
+
115
+ if attributes.key?(:'connection_id')
116
+ self.connection_id = attributes[:'connection_id']
117
+ end
118
+
119
+ if attributes.key?(:'purpose')
120
+ self.purpose = attributes[:'purpose']
121
+ end
122
+
123
+ if attributes.key?(:'completed_at')
124
+ self.completed_at = attributes[:'completed_at']
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ warn '[DEPRECATED] the `valid?` method is obsolete'
140
+ true
141
+ end
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ session_id == o.session_id &&
149
+ state == o.state &&
150
+ provider == o.provider &&
151
+ external_account_id == o.external_account_id &&
152
+ connection_id == o.connection_id &&
153
+ purpose == o.purpose &&
154
+ completed_at == o.completed_at
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [session_id, state, provider, external_account_id, connection_id, purpose, completed_at].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ transformed_hash = {}
176
+ openapi_types.each_pair do |key, type|
177
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[attribute_map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
+ end
185
+ elsif !attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
+ end
188
+ end
189
+ new(transformed_hash)
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ end
209
+
210
+ end
@@ -33,9 +33,15 @@ module Repull
33
33
  # Host metadata, populated for Airbnb when the host row exists. Null for other providers (per-provider enrichment is incremental).
34
34
  attr_accessor :host
35
35
 
36
- # Airbnb only: every Airbnb account this workspace has connected, including ones since disconnected. Pass `externalAccountId` as `accountId` to `DELETE /v1/connect/airbnb` to disconnect one account.
36
+ # Airbnb: every Airbnb account this workspace has connected, including ones since disconnected. Pass `externalAccountId` as `accountId` to `DELETE /v1/connect/airbnb` to disconnect one account. Vrbo (`GET /v1/connect/vrbo-login`): every signed-in Vrbo account, each with `accessType` and `import` (a `VrboImportStatus`), plus a top-level `dataFreshness`.
37
37
  attr_accessor :accounts
38
38
 
39
+ # PMS connections only: what the app may change in the PMS. Change it with `PATCH /v1/connect/{provider}/write-policy`.
40
+ attr_accessor :write_policy
41
+
42
+ # Vrbo only: the same freshness envelope the Airbnb read endpoints return, per account and in aggregate. Its reason is never_synced until a mapping is confirmed and importing while upcoming bookings come in.
43
+ attr_accessor :data_freshness
44
+
39
45
  # Attribute mapping from ruby-style variable name to JSON key.
40
46
  def self.attribute_map
41
47
  {
@@ -46,7 +52,9 @@ module Repull
46
52
  :'external_account_id' => :'externalAccountId',
47
53
  :'created_at' => :'createdAt',
48
54
  :'host' => :'host',
49
- :'accounts' => :'accounts'
55
+ :'accounts' => :'accounts',
56
+ :'write_policy' => :'writePolicy',
57
+ :'data_freshness' => :'dataFreshness'
50
58
  }
51
59
  end
52
60
 
@@ -70,7 +78,9 @@ module Repull
70
78
  :'external_account_id' => :'String',
71
79
  :'created_at' => :'Time',
72
80
  :'host' => :'ConnectHost',
73
- :'accounts' => :'Array<ConnectStatusAccountsInner>'
81
+ :'accounts' => :'Array<ConnectStatusAccountsInner>',
82
+ :'write_policy' => :'PmsWritePolicy',
83
+ :'data_freshness' => :'Object'
74
84
  }
75
85
  end
76
86
 
@@ -131,6 +141,14 @@ module Repull
131
141
  self.accounts = value
132
142
  end
133
143
  end
144
+
145
+ if attributes.key?(:'write_policy')
146
+ self.write_policy = attributes[:'write_policy']
147
+ end
148
+
149
+ if attributes.key?(:'data_freshness')
150
+ self.data_freshness = attributes[:'data_freshness']
151
+ end
134
152
  end
135
153
 
136
154
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -160,7 +178,9 @@ module Repull
160
178
  external_account_id == o.external_account_id &&
161
179
  created_at == o.created_at &&
162
180
  host == o.host &&
163
- accounts == o.accounts
181
+ accounts == o.accounts &&
182
+ write_policy == o.write_policy &&
183
+ data_freshness == o.data_freshness
164
184
  end
165
185
 
166
186
  # @see the `==` method
@@ -172,7 +192,7 @@ module Repull
172
192
  # Calculates hash code according to all attributes.
173
193
  # @return [Integer] Hash code
174
194
  def hash
175
- [connected, provider, id, status, external_account_id, created_at, host, accounts].hash
195
+ [connected, provider, id, status, external_account_id, created_at, host, accounts, write_policy, data_freshness].hash
176
196
  end
177
197
 
178
198
  # Builds the object from hash