repull 0.2.34 → 0.2.36

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/connect_api.rb +6 -6
  3. data/lib/repull/api/health_api.rb +3 -3
  4. data/lib/repull/api/listings_api.rb +8 -8
  5. data/lib/repull/api/migrate_api.rb +68 -0
  6. data/lib/repull/models/{calendar_updated_event.rb → booking_unacknowledged_event.rb} +4 -4
  7. data/lib/repull/models/booking_unacknowledged_payload.rb +229 -0
  8. data/lib/repull/models/channel_degraded_event.rb +279 -0
  9. data/lib/repull/models/channel_degraded_payload.rb +174 -0
  10. data/lib/repull/models/channel_degraded_payload_object.rb +262 -0
  11. data/lib/repull/models/channel_sync_failed_event.rb +280 -0
  12. data/lib/repull/models/channel_sync_failure_payload.rb +214 -0
  13. data/lib/repull/models/channel_sync_failure_payload_failures_inner.rb +213 -0
  14. data/lib/repull/models/channel_sync_failure_payload_object.rb +289 -0
  15. data/lib/repull/models/charge_per.rb +42 -0
  16. data/lib/repull/models/connect_session_completed_payload.rb +1 -1
  17. data/lib/repull/models/connect_status_accounts_inner.rb +12 -1
  18. data/lib/repull/models/create_connect_session_request.rb +26 -2
  19. data/lib/repull/models/create_connection_request.rb +3 -23
  20. data/lib/repull/models/{plumguide_listing_list_response.rb → import_from_channex200_response.rb} +8 -19
  21. data/lib/repull/models/import_from_channex200_response_data.rb +324 -0
  22. data/lib/repull/models/import_from_channex200_response_data_channels_inner.rb +263 -0
  23. data/lib/repull/models/import_from_channex200_response_data_properties_inner.rb +222 -0
  24. data/lib/repull/models/import_from_channex200_response_data_summary.rb +201 -0
  25. data/lib/repull/models/import_from_channex200_response_data_summary_bookings.rb +165 -0
  26. data/lib/repull/models/import_from_channex200_response_data_summary_properties.rb +165 -0
  27. data/lib/repull/models/import_from_channex_request.rb +223 -0
  28. data/lib/repull/models/list_connection_units200_response.rb +12 -1
  29. data/lib/repull/models/list_connection_units200_response_units_inner.rb +1 -0
  30. data/lib/repull/models/listing.rb +82 -1
  31. data/lib/repull/models/listing_address.rb +62 -5
  32. data/lib/repull/models/listing_content_photo.rb +206 -0
  33. data/lib/repull/models/listing_fee.rb +229 -0
  34. data/lib/repull/models/listing_policies.rb +257 -0
  35. data/lib/repull/models/{calendar_updated_payload.rb → listing_policies_check_in.rb} +33 -38
  36. data/lib/repull/models/listing_policies_check_out.rb +148 -0
  37. data/lib/repull/models/{calendar_updated_payload_range.rb → listing_policies_quiet_hours.rb} +5 -5
  38. data/lib/repull/models/listing_pricing_settings.rb +233 -0
  39. data/lib/repull/models/listing_room.rb +190 -0
  40. data/lib/repull/models/{plumguide_listing.rb → listing_room_beds_inner.rb} +16 -27
  41. data/lib/repull/models/listing_rules.rb +212 -0
  42. data/lib/repull/models/listing_tax.rb +241 -0
  43. data/lib/repull/models/message.rb +24 -1
  44. data/lib/repull/models/postal_address.rb +216 -0
  45. data/lib/repull/models/property.rb +12 -2
  46. data/lib/repull/models/reservation_thread_assigned_event.rb +279 -0
  47. data/lib/repull/models/reservation_thread_assigned_payload.rb +174 -0
  48. data/lib/repull/models/reservation_thread_assigned_payload_object.rb +249 -0
  49. data/lib/repull/models/webhook_event.rb +8 -2
  50. data/lib/repull/models/webhook_event_type.rb +5 -2
  51. data/lib/repull/version.rb +1 -1
  52. data/lib/repull.rb +33 -6
  53. data/openapi/v1.json +1712 -352
  54. metadata +35 -10
  55. data/lib/repull/api/plumguide_api.rb +0 -552
  56. data/spec/api/plumguide_api_spec.rb +0 -85
@@ -0,0 +1,233 @@
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
+ # The listing's standing prices. Nightly rates per date are on `GET /v1/availability/{propertyId}`.
18
+ class ListingPricingSettings < ApiModelBase
19
+ attr_accessor :currency
20
+
21
+ # Default nightly rate.
22
+ attr_accessor :base_price
23
+
24
+ attr_accessor :weekend_price
25
+
26
+ attr_accessor :cleaning_fee
27
+
28
+ # Per extra guest per night, above `guestsIncluded`.
29
+ attr_accessor :extra_guest_fee
30
+
31
+ attr_accessor :guests_included
32
+
33
+ attr_accessor :security_deposit
34
+
35
+ # Percent off for 7+ nights: `10` is 10%.
36
+ attr_accessor :weekly_discount_percent
37
+
38
+ # Percent off for 28+ nights.
39
+ attr_accessor :monthly_discount_percent
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'currency' => :'currency',
45
+ :'base_price' => :'basePrice',
46
+ :'weekend_price' => :'weekendPrice',
47
+ :'cleaning_fee' => :'cleaningFee',
48
+ :'extra_guest_fee' => :'extraGuestFee',
49
+ :'guests_included' => :'guestsIncluded',
50
+ :'security_deposit' => :'securityDeposit',
51
+ :'weekly_discount_percent' => :'weeklyDiscountPercent',
52
+ :'monthly_discount_percent' => :'monthlyDiscountPercent'
53
+ }
54
+ end
55
+
56
+ # Returns attribute mapping this model knows about
57
+ def self.acceptable_attribute_map
58
+ attribute_map
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ acceptable_attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'currency' => :'String',
70
+ :'base_price' => :'Float',
71
+ :'weekend_price' => :'Float',
72
+ :'cleaning_fee' => :'Float',
73
+ :'extra_guest_fee' => :'Float',
74
+ :'guests_included' => :'Integer',
75
+ :'security_deposit' => :'Float',
76
+ :'weekly_discount_percent' => :'Float',
77
+ :'monthly_discount_percent' => :'Float'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ :'currency',
85
+ :'base_price',
86
+ :'weekend_price',
87
+ :'cleaning_fee',
88
+ :'extra_guest_fee',
89
+ :'guests_included',
90
+ :'security_deposit',
91
+ :'weekly_discount_percent',
92
+ :'monthly_discount_percent'
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingPricingSettings` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ acceptable_attribute_map = self.class.acceptable_attribute_map
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!acceptable_attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingPricingSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'currency')
113
+ self.currency = attributes[:'currency']
114
+ end
115
+
116
+ if attributes.key?(:'base_price')
117
+ self.base_price = attributes[:'base_price']
118
+ end
119
+
120
+ if attributes.key?(:'weekend_price')
121
+ self.weekend_price = attributes[:'weekend_price']
122
+ end
123
+
124
+ if attributes.key?(:'cleaning_fee')
125
+ self.cleaning_fee = attributes[:'cleaning_fee']
126
+ end
127
+
128
+ if attributes.key?(:'extra_guest_fee')
129
+ self.extra_guest_fee = attributes[:'extra_guest_fee']
130
+ end
131
+
132
+ if attributes.key?(:'guests_included')
133
+ self.guests_included = attributes[:'guests_included']
134
+ end
135
+
136
+ if attributes.key?(:'security_deposit')
137
+ self.security_deposit = attributes[:'security_deposit']
138
+ end
139
+
140
+ if attributes.key?(:'weekly_discount_percent')
141
+ self.weekly_discount_percent = attributes[:'weekly_discount_percent']
142
+ end
143
+
144
+ if attributes.key?(:'monthly_discount_percent')
145
+ self.monthly_discount_percent = attributes[:'monthly_discount_percent']
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
153
+ invalid_properties = Array.new
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
+ true
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ currency == o.currency &&
170
+ base_price == o.base_price &&
171
+ weekend_price == o.weekend_price &&
172
+ cleaning_fee == o.cleaning_fee &&
173
+ extra_guest_fee == o.extra_guest_fee &&
174
+ guests_included == o.guests_included &&
175
+ security_deposit == o.security_deposit &&
176
+ weekly_discount_percent == o.weekly_discount_percent &&
177
+ monthly_discount_percent == o.monthly_discount_percent
178
+ end
179
+
180
+ # @see the `==` method
181
+ # @param [Object] Object to be compared
182
+ def eql?(o)
183
+ self == o
184
+ end
185
+
186
+ # Calculates hash code according to all attributes.
187
+ # @return [Integer] Hash code
188
+ def hash
189
+ [currency, base_price, weekend_price, cleaning_fee, extra_guest_fee, guests_included, security_deposit, weekly_discount_percent, monthly_discount_percent].hash
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def self.build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ attributes = attributes.transform_keys(&:to_sym)
198
+ transformed_hash = {}
199
+ openapi_types.each_pair do |key, type|
200
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = nil
202
+ elsif type =~ /\AArray<(.*)>/i
203
+ # check to ensure the input is an array given that the attribute
204
+ # is documented as an array but the input is not
205
+ if attributes[attribute_map[key]].is_a?(Array)
206
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
207
+ end
208
+ elsif !attributes[attribute_map[key]].nil?
209
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
210
+ end
211
+ end
212
+ new(transformed_hash)
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ end
232
+
233
+ end
@@ -0,0 +1,190 @@
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 ListingRoom < ApiModelBase
18
+ # Room kind, Airbnb spelling: `bedroom`, `living_room`, `full_bathroom`, `kitchen`, …
19
+ attr_accessor :type
20
+
21
+ attr_accessor :name
22
+
23
+ # Position among rooms of the same type (bedroom 1, 2, …).
24
+ attr_accessor :number
25
+
26
+ attr_accessor :is_private
27
+
28
+ attr_accessor :beds
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'type' => :'type',
34
+ :'name' => :'name',
35
+ :'number' => :'number',
36
+ :'is_private' => :'isPrivate',
37
+ :'beds' => :'beds'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'type' => :'String',
55
+ :'name' => :'String',
56
+ :'number' => :'Integer',
57
+ :'is_private' => :'Boolean',
58
+ :'beds' => :'Array<ListingRoomBedsInner>'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ :'name',
66
+ :'number',
67
+ :'is_private',
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingRoom` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingRoom`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'type')
88
+ self.type = attributes[:'type']
89
+ end
90
+
91
+ if attributes.key?(:'name')
92
+ self.name = attributes[:'name']
93
+ end
94
+
95
+ if attributes.key?(:'number')
96
+ self.number = attributes[:'number']
97
+ end
98
+
99
+ if attributes.key?(:'is_private')
100
+ self.is_private = attributes[:'is_private']
101
+ end
102
+
103
+ if attributes.key?(:'beds')
104
+ if (value = attributes[:'beds']).is_a?(Array)
105
+ self.beds = value
106
+ end
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
122
+ true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ type == o.type &&
131
+ name == o.name &&
132
+ number == o.number &&
133
+ is_private == o.is_private &&
134
+ beds == o.beds
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [type, name, number, is_private, beds].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.openapi_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ end
189
+
190
+ end
@@ -14,20 +14,16 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # A Plumguide listing.
18
- class PlumguideListing < ApiModelBase
19
- attr_accessor :id
17
+ class ListingRoomBedsInner < ApiModelBase
18
+ attr_accessor :type
20
19
 
21
- attr_accessor :name
22
-
23
- attr_accessor :status
20
+ attr_accessor :quantity
24
21
 
25
22
  # Attribute mapping from ruby-style variable name to JSON key.
26
23
  def self.attribute_map
27
24
  {
28
- :'id' => :'id',
29
- :'name' => :'name',
30
- :'status' => :'status'
25
+ :'type' => :'type',
26
+ :'quantity' => :'quantity'
31
27
  }
32
28
  end
33
29
 
@@ -44,16 +40,14 @@ module Repull
44
40
  # Attribute type mapping.
45
41
  def self.openapi_types
46
42
  {
47
- :'id' => :'String',
48
- :'name' => :'String',
49
- :'status' => :'String'
43
+ :'type' => :'String',
44
+ :'quantity' => :'Integer'
50
45
  }
51
46
  end
52
47
 
53
48
  # List of attributes with nullable: true
54
49
  def self.openapi_nullable
55
50
  Set.new([
56
- :'status'
57
51
  ])
58
52
  end
59
53
 
@@ -61,28 +55,24 @@ module Repull
61
55
  # @param [Hash] attributes Model attributes in the form of hash
62
56
  def initialize(attributes = {})
63
57
  if (!attributes.is_a?(Hash))
64
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PlumguideListing` initialize method"
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingRoomBedsInner` initialize method"
65
59
  end
66
60
 
67
61
  # check to see if the attribute exists and convert string to symbol for hash key
68
62
  acceptable_attribute_map = self.class.acceptable_attribute_map
69
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
70
64
  if (!acceptable_attribute_map.key?(k.to_sym))
71
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PlumguideListing`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingRoomBedsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
72
66
  end
73
67
  h[k.to_sym] = v
74
68
  }
75
69
 
76
- if attributes.key?(:'id')
77
- self.id = attributes[:'id']
78
- end
79
-
80
- if attributes.key?(:'name')
81
- self.name = attributes[:'name']
70
+ if attributes.key?(:'type')
71
+ self.type = attributes[:'type']
82
72
  end
83
73
 
84
- if attributes.key?(:'status')
85
- self.status = attributes[:'status']
74
+ if attributes.key?(:'quantity')
75
+ self.quantity = attributes[:'quantity']
86
76
  end
87
77
  end
88
78
 
@@ -106,9 +96,8 @@ module Repull
106
96
  def ==(o)
107
97
  return true if self.equal?(o)
108
98
  self.class == o.class &&
109
- id == o.id &&
110
- name == o.name &&
111
- status == o.status
99
+ type == o.type &&
100
+ quantity == o.quantity
112
101
  end
113
102
 
114
103
  # @see the `==` method
@@ -120,7 +109,7 @@ module Repull
120
109
  # Calculates hash code according to all attributes.
121
110
  # @return [Integer] Hash code
122
111
  def hash
123
- [id, name, status].hash
112
+ [type, quantity].hash
124
113
  end
125
114
 
126
115
  # Builds the object from hash