repull 0.2.24 → 0.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +617 -0
  3. data/lib/repull/api/connections_api.rb +312 -0
  4. data/lib/repull/api/conversations_api.rb +151 -18
  5. data/lib/repull/api/health_api.rb +5 -5
  6. data/lib/repull/api/listings_api.rb +67 -4
  7. data/lib/repull/api/reviews_api.rb +2 -2
  8. data/lib/repull/models/apply_connection_mappings200_response.rb +167 -0
  9. data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +184 -0
  10. data/lib/repull/models/apply_connection_mappings_request.rb +175 -0
  11. data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +193 -0
  12. data/lib/repull/models/auto_map_connection_units200_response.rb +176 -0
  13. data/lib/repull/models/auto_map_connection_units_request.rb +156 -0
  14. data/lib/repull/models/channel_market_state_item.rb +15 -4
  15. data/lib/repull/models/connect_status.rb +25 -5
  16. data/lib/repull/models/connect_status_accounts_inner.rb +71 -4
  17. data/lib/repull/models/conversation_capabilities.rb +260 -0
  18. data/lib/repull/models/conversation_detail.rb +14 -5
  19. data/lib/repull/models/create_connect_session_request.rb +23 -1
  20. data/lib/repull/models/create_conversation_special_offer201_response.rb +127 -4
  21. data/lib/repull/models/create_conversation_special_offer201_response_fees_inner.rb +166 -0
  22. data/lib/repull/models/create_conversation_special_offer201_response_lines_inner.rb +157 -0
  23. data/lib/repull/models/create_conversation_special_offer_request.rb +91 -52
  24. data/lib/repull/models/create_conversation_special_offer_request_fees_inner.rb +199 -0
  25. data/lib/repull/models/get_booking_extranet_login_config200_response.rb +147 -0
  26. data/lib/repull/models/get_booking_extranet_login_status200_response.rb +192 -0
  27. data/lib/repull/models/get_channel_health200_response.rb +190 -0
  28. data/lib/repull/models/get_channel_health200_response_vrbo.rb +197 -0
  29. data/lib/repull/models/get_connect_write_policy200_response.rb +166 -0
  30. data/lib/repull/models/get_listing_calendar_sync200_response.rb +192 -0
  31. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +331 -0
  32. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_problems_inner.rb +157 -0
  33. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue.rb +212 -0
  34. data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue_last_push.rb +268 -0
  35. data/lib/repull/models/invite_booking_extranet_user200_response.rb +174 -0
  36. data/lib/repull/models/invite_booking_extranet_user_request.rb +173 -0
  37. data/lib/repull/models/list_connection_units200_response.rb +242 -0
  38. data/lib/repull/models/list_connection_units200_response_listing_options_inner.rb +165 -0
  39. data/lib/repull/models/list_connection_units200_response_units_inner.rb +194 -0
  40. data/lib/repull/models/listing_publish_status_connection.rb +34 -1
  41. data/lib/repull/models/pms_write_policy.rb +191 -0
  42. data/lib/repull/models/pms_write_policy_calendar.rb +219 -0
  43. data/lib/repull/models/pms_write_policy_reservations.rb +219 -0
  44. data/lib/repull/models/preapprove_conversation201_response.rb +47 -6
  45. data/lib/repull/models/preapprove_conversation_request.rb +34 -5
  46. data/lib/repull/models/preview_conversation_special_offer_request.rb +231 -0
  47. data/lib/repull/models/preview_conversation_special_offer_request_fees_inner.rb +199 -0
  48. data/lib/repull/models/preview_conversation_special_offer_request_guests.rb +250 -0
  49. data/lib/repull/models/reply_to_review_request.rb +33 -4
  50. data/lib/repull/models/search_connect_session_listing_options200_response.rb +158 -0
  51. data/lib/repull/models/search_connect_session_listing_options200_response_data_inner.rb +166 -0
  52. data/lib/repull/models/search_connection_listing_options200_response.rb +159 -0
  53. data/lib/repull/models/send_message_request.rb +1 -1
  54. data/lib/repull/models/start_booking_extranet_login200_response.rb +174 -0
  55. data/lib/repull/models/start_booking_extranet_login_request.rb +225 -0
  56. data/lib/repull/models/submit_cloudbeds_credentials200_response.rb +10 -1
  57. data/lib/repull/models/submit_cloudbeds_credentials_request.rb +11 -1
  58. data/lib/repull/models/submit_mews_credentials200_response.rb +10 -1
  59. data/lib/repull/models/submit_mews_credentials_request.rb +11 -1
  60. data/lib/repull/models/update_connect_write_policy_request.rb +157 -0
  61. data/lib/repull/models/update_connect_write_policy_request_calendar.rb +165 -0
  62. data/lib/repull/models/update_connect_write_policy_request_reservations.rb +165 -0
  63. data/lib/repull/models/vrbo_import_status.rb +249 -0
  64. data/lib/repull/models/vrbo_login200_response.rb +235 -0
  65. data/lib/repull/models/vrbo_login_request.rb +271 -0
  66. data/lib/repull/models/withdraw_conversation_preapproval200_response.rb +226 -0
  67. data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +29 -1
  68. data/lib/repull/version.rb +1 -1
  69. data/lib/repull.rb +44 -0
  70. data/openapi/v1.json +4693 -2114
  71. data/scripts/regen.sh +1 -1
  72. metadata +46 -2
@@ -0,0 +1,219 @@
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 PmsWritePolicyCalendar < ApiModelBase
18
+ # Open and close nights. Off also means the PMS's bookings never block the calendar on other channels.
19
+ attr_accessor :availability
20
+
21
+ # Nightly prices.
22
+ attr_accessor :rates
23
+
24
+ # Minimum stay and other stay restrictions.
25
+ attr_accessor :restrictions
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'availability' => :'availability',
31
+ :'rates' => :'rates',
32
+ :'restrictions' => :'restrictions'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'availability' => :'Boolean',
50
+ :'rates' => :'Boolean',
51
+ :'restrictions' => :'Boolean'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PmsWritePolicyCalendar` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PmsWritePolicyCalendar`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'availability')
78
+ self.availability = attributes[:'availability']
79
+ else
80
+ self.availability = nil
81
+ end
82
+
83
+ if attributes.key?(:'rates')
84
+ self.rates = attributes[:'rates']
85
+ else
86
+ self.rates = nil
87
+ end
88
+
89
+ if attributes.key?(:'restrictions')
90
+ self.restrictions = attributes[:'restrictions']
91
+ else
92
+ self.restrictions = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @availability.nil?
102
+ invalid_properties.push('invalid value for "availability", availability cannot be nil.')
103
+ end
104
+
105
+ if @rates.nil?
106
+ invalid_properties.push('invalid value for "rates", rates cannot be nil.')
107
+ end
108
+
109
+ if @restrictions.nil?
110
+ invalid_properties.push('invalid value for "restrictions", restrictions cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @availability.nil?
121
+ return false if @rates.nil?
122
+ return false if @restrictions.nil?
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] availability Value to be assigned
128
+ def availability=(availability)
129
+ if availability.nil?
130
+ fail ArgumentError, 'availability cannot be nil'
131
+ end
132
+
133
+ @availability = availability
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] rates Value to be assigned
138
+ def rates=(rates)
139
+ if rates.nil?
140
+ fail ArgumentError, 'rates cannot be nil'
141
+ end
142
+
143
+ @rates = rates
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] restrictions Value to be assigned
148
+ def restrictions=(restrictions)
149
+ if restrictions.nil?
150
+ fail ArgumentError, 'restrictions cannot be nil'
151
+ end
152
+
153
+ @restrictions = restrictions
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ availability == o.availability &&
162
+ rates == o.rates &&
163
+ restrictions == o.restrictions
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [availability, rates, restrictions].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -0,0 +1,219 @@
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 PmsWritePolicyReservations < ApiModelBase
18
+ # Create bookings from booking websites.
19
+ attr_accessor :website
20
+
21
+ # Change and cancel bookings from the dashboard.
22
+ attr_accessor :dashboard
23
+
24
+ # Create, change and cancel bookings through the reservations API.
25
+ attr_accessor :api
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'website' => :'website',
31
+ :'dashboard' => :'dashboard',
32
+ :'api' => :'api'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'website' => :'Boolean',
50
+ :'dashboard' => :'Boolean',
51
+ :'api' => :'Boolean'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PmsWritePolicyReservations` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PmsWritePolicyReservations`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'website')
78
+ self.website = attributes[:'website']
79
+ else
80
+ self.website = nil
81
+ end
82
+
83
+ if attributes.key?(:'dashboard')
84
+ self.dashboard = attributes[:'dashboard']
85
+ else
86
+ self.dashboard = nil
87
+ end
88
+
89
+ if attributes.key?(:'api')
90
+ self.api = attributes[:'api']
91
+ else
92
+ self.api = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @website.nil?
102
+ invalid_properties.push('invalid value for "website", website cannot be nil.')
103
+ end
104
+
105
+ if @dashboard.nil?
106
+ invalid_properties.push('invalid value for "dashboard", dashboard cannot be nil.')
107
+ end
108
+
109
+ if @api.nil?
110
+ invalid_properties.push('invalid value for "api", api cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @website.nil?
121
+ return false if @dashboard.nil?
122
+ return false if @api.nil?
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] website Value to be assigned
128
+ def website=(website)
129
+ if website.nil?
130
+ fail ArgumentError, 'website cannot be nil'
131
+ end
132
+
133
+ @website = website
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] dashboard Value to be assigned
138
+ def dashboard=(dashboard)
139
+ if dashboard.nil?
140
+ fail ArgumentError, 'dashboard cannot be nil'
141
+ end
142
+
143
+ @dashboard = dashboard
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] api Value to be assigned
148
+ def api=(api)
149
+ if api.nil?
150
+ fail ArgumentError, 'api cannot be nil'
151
+ end
152
+
153
+ @api = api
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ website == o.website &&
162
+ dashboard == o.dashboard &&
163
+ api == o.api
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [website, dashboard, api].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -17,13 +17,18 @@ module Repull
17
17
  class PreapproveConversation201Response < ApiModelBase
18
18
  attr_accessor :conversation_id
19
19
 
20
+ attr_accessor :channel
21
+
20
22
  attr_accessor :status
21
23
 
22
24
  attr_accessor :block_instant_booking
23
25
 
24
- # When the guest can no longer book on the pre-approval, if Airbnb reported it.
26
+ # When the guest can no longer book on the pre-approval, if the channel reported it.
25
27
  attr_accessor :expires_at
26
28
 
29
+ # The message sent to the guest with the pre-approval (VRBO).
30
+ attr_accessor :message
31
+
27
32
  class EnumAttributeValidator
28
33
  attr_reader :datatype
29
34
  attr_reader :allowable_values
@@ -50,9 +55,11 @@ module Repull
50
55
  def self.attribute_map
51
56
  {
52
57
  :'conversation_id' => :'conversationId',
58
+ :'channel' => :'channel',
53
59
  :'status' => :'status',
54
60
  :'block_instant_booking' => :'blockInstantBooking',
55
- :'expires_at' => :'expiresAt'
61
+ :'expires_at' => :'expiresAt',
62
+ :'message' => :'message'
56
63
  }
57
64
  end
58
65
 
@@ -70,16 +77,19 @@ module Repull
70
77
  def self.openapi_types
71
78
  {
72
79
  :'conversation_id' => :'String',
80
+ :'channel' => :'String',
73
81
  :'status' => :'String',
74
82
  :'block_instant_booking' => :'Boolean',
75
- :'expires_at' => :'Time'
83
+ :'expires_at' => :'Time',
84
+ :'message' => :'String'
76
85
  }
77
86
  end
78
87
 
79
88
  # List of attributes with nullable: true
80
89
  def self.openapi_nullable
81
90
  Set.new([
82
- :'expires_at'
91
+ :'expires_at',
92
+ :'message'
83
93
  ])
84
94
  end
85
95
 
@@ -105,6 +115,12 @@ module Repull
105
115
  self.conversation_id = nil
106
116
  end
107
117
 
118
+ if attributes.key?(:'channel')
119
+ self.channel = attributes[:'channel']
120
+ else
121
+ self.channel = nil
122
+ end
123
+
108
124
  if attributes.key?(:'status')
109
125
  self.status = attributes[:'status']
110
126
  else
@@ -122,6 +138,12 @@ module Repull
122
138
  else
123
139
  self.expires_at = nil
124
140
  end
141
+
142
+ if attributes.key?(:'message')
143
+ self.message = attributes[:'message']
144
+ else
145
+ self.message = nil
146
+ end
125
147
  end
126
148
 
127
149
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -133,6 +155,10 @@ module Repull
133
155
  invalid_properties.push('invalid value for "conversation_id", conversation_id cannot be nil.')
134
156
  end
135
157
 
158
+ if @channel.nil?
159
+ invalid_properties.push('invalid value for "channel", channel cannot be nil.')
160
+ end
161
+
136
162
  if @status.nil?
137
163
  invalid_properties.push('invalid value for "status", status cannot be nil.')
138
164
  end
@@ -149,6 +175,9 @@ module Repull
149
175
  def valid?
150
176
  warn '[DEPRECATED] the `valid?` method is obsolete'
151
177
  return false if @conversation_id.nil?
178
+ return false if @channel.nil?
179
+ channel_validator = EnumAttributeValidator.new('String', ["airbnb", "vrbo"])
180
+ return false unless channel_validator.valid?(@channel)
152
181
  return false if @status.nil?
153
182
  status_validator = EnumAttributeValidator.new('String', ["pre_approved"])
154
183
  return false unless status_validator.valid?(@status)
@@ -166,6 +195,16 @@ module Repull
166
195
  @conversation_id = conversation_id
167
196
  end
168
197
 
198
+ # Custom attribute writer method checking allowed values (enum).
199
+ # @param [Object] channel Object to be assigned
200
+ def channel=(channel)
201
+ validator = EnumAttributeValidator.new('String', ["airbnb", "vrbo"])
202
+ unless validator.valid?(channel)
203
+ fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
204
+ end
205
+ @channel = channel
206
+ end
207
+
169
208
  # Custom attribute writer method checking allowed values (enum).
170
209
  # @param [Object] status Object to be assigned
171
210
  def status=(status)
@@ -192,9 +231,11 @@ module Repull
192
231
  return true if self.equal?(o)
193
232
  self.class == o.class &&
194
233
  conversation_id == o.conversation_id &&
234
+ channel == o.channel &&
195
235
  status == o.status &&
196
236
  block_instant_booking == o.block_instant_booking &&
197
- expires_at == o.expires_at
237
+ expires_at == o.expires_at &&
238
+ message == o.message
198
239
  end
199
240
 
200
241
  # @see the `==` method
@@ -206,7 +247,7 @@ module Repull
206
247
  # Calculates hash code according to all attributes.
207
248
  # @return [Integer] Hash code
208
249
  def hash
209
- [conversation_id, status, block_instant_booking, expires_at].hash
250
+ [conversation_id, channel, status, block_instant_booking, expires_at, message].hash
210
251
  end
211
252
 
212
253
  # Builds the object from hash
@@ -15,13 +15,17 @@ require 'time'
15
15
 
16
16
  module Repull
17
17
  class PreapproveConversationRequest < ApiModelBase
18
- # When `true`, the guest cannot Instant Book the listing and must book through this pre-approval. Leave `false` unless you need that.
18
+ # Airbnb: when `true`, the guest cannot Instant Book the listing and must book through this pre-approval. Leave `false` unless you need that.
19
19
  attr_accessor :block_instant_booking
20
20
 
21
+ # VRBO: the message sent to the guest with the pre-approval (a friendly default otherwise).
22
+ attr_accessor :message
23
+
21
24
  # Attribute mapping from ruby-style variable name to JSON key.
22
25
  def self.attribute_map
23
26
  {
24
- :'block_instant_booking' => :'blockInstantBooking'
27
+ :'block_instant_booking' => :'blockInstantBooking',
28
+ :'message' => :'message'
25
29
  }
26
30
  end
27
31
 
@@ -38,7 +42,8 @@ module Repull
38
42
  # Attribute type mapping.
39
43
  def self.openapi_types
40
44
  {
41
- :'block_instant_booking' => :'Boolean'
45
+ :'block_instant_booking' => :'Boolean',
46
+ :'message' => :'String'
42
47
  }
43
48
  end
44
49
 
@@ -69,6 +74,10 @@ module Repull
69
74
  else
70
75
  self.block_instant_booking = false
71
76
  end
77
+
78
+ if attributes.key?(:'message')
79
+ self.message = attributes[:'message']
80
+ end
72
81
  end
73
82
 
74
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -76,6 +85,10 @@ module Repull
76
85
  def list_invalid_properties
77
86
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
87
  invalid_properties = Array.new
88
+ if !@message.nil? && @message.to_s.length > 2000
89
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 2000.')
90
+ end
91
+
79
92
  invalid_properties
80
93
  end
81
94
 
@@ -83,15 +96,31 @@ module Repull
83
96
  # @return true if the model is valid
84
97
  def valid?
85
98
  warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if !@message.nil? && @message.to_s.length > 2000
86
100
  true
87
101
  end
88
102
 
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] message Value to be assigned
105
+ def message=(message)
106
+ if message.nil?
107
+ fail ArgumentError, 'message cannot be nil'
108
+ end
109
+
110
+ if message.to_s.length > 2000
111
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 2000.'
112
+ end
113
+
114
+ @message = message
115
+ end
116
+
89
117
  # Checks equality by comparing each attribute.
90
118
  # @param [Object] Object to be compared
91
119
  def ==(o)
92
120
  return true if self.equal?(o)
93
121
  self.class == o.class &&
94
- block_instant_booking == o.block_instant_booking
122
+ block_instant_booking == o.block_instant_booking &&
123
+ message == o.message
95
124
  end
96
125
 
97
126
  # @see the `==` method
@@ -103,7 +132,7 @@ module Repull
103
132
  # Calculates hash code according to all attributes.
104
133
  # @return [Integer] Hash code
105
134
  def hash
106
- [block_instant_booking].hash
135
+ [block_instant_booking, message].hash
107
136
  end
108
137
 
109
138
  # Builds the object from hash