repull 0.2.42 → 0.2.43
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.
- checksums.yaml +4 -4
- data/lib/repull/api/airbnb_api.rb +2 -2
- data/lib/repull/api/listings_api.rb +146 -6
- data/lib/repull/api/reservations_api.rb +93 -0
- data/lib/repull/models/account_disconnected_payload.rb +3 -2
- data/lib/repull/models/get_listing_markups200_response.rb +15 -4
- data/lib/repull/models/get_listing_markups200_response_vrbo_inner.rb +181 -0
- data/lib/repull/models/get_reservation_summary200_response.rb +353 -0
- data/lib/repull/models/get_reservation_summary200_response_totals_inner.rb +478 -0
- data/lib/repull/models/get_vrbo_publish_job200_response.rb +199 -0
- data/lib/repull/models/get_vrbo_publish_job200_response_job.rb +300 -0
- data/lib/repull/models/get_vrbo_publish_job200_response_job_rejected_photos_inner.rb +157 -0
- data/lib/repull/models/map_connect_booking_rooms_response.rb +44 -5
- data/lib/repull/models/message.rb +29 -5
- data/lib/repull/models/message_actor.rb +159 -0
- data/lib/repull/models/message_reaction.rb +178 -0
- data/lib/repull/models/publish_listing_to_vrbo_request.rb +158 -0
- data/lib/repull/models/reservation.rb +12 -1
- data/lib/repull/models/reservation_message_reaction_event.rb +281 -0
- data/lib/repull/models/reservation_message_reaction_payload.rb +225 -0
- data/lib/repull/models/reservation_message_reaction_payload_reaction.rb +175 -0
- data/lib/repull/models/reservation_message_read_event.rb +281 -0
- data/lib/repull/models/reservation_message_read_payload.rb +227 -0
- data/lib/repull/models/reservation_message_updated_payload.rb +1 -1
- data/lib/repull/models/set_listing_markup_request.rb +16 -6
- data/lib/repull/models/update_airbnb_message_request.rb +1 -1
- data/lib/repull/models/webhook_event.rb +4 -0
- data/lib/repull/models/webhook_event_type.rb +3 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +14 -0
- data/openapi/v1.json +1055 -14
- data/scripts/regen.sh +1 -1
- metadata +16 -2
|
@@ -0,0 +1,181 @@
|
|
|
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 listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`, or upgrade at `https://repull.dev/dashboard/billing` to activate them all. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\").
|
|
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 GetListingMarkups200ResponseVrboInner < ApiModelBase
|
|
18
|
+
# The Vrbo account, as its connection id (`vrbo:13`).
|
|
19
|
+
attr_accessor :account_id
|
|
20
|
+
|
|
21
|
+
# The Vrbo listing number this listing is linked to.
|
|
22
|
+
attr_accessor :vrbo_listing_number
|
|
23
|
+
|
|
24
|
+
# Percent added on Vrbo, for every listing linked on this account.
|
|
25
|
+
attr_accessor :markup_percent
|
|
26
|
+
|
|
27
|
+
# Listings in this workspace linked on this Vrbo account — all share this markup.
|
|
28
|
+
attr_accessor :listing_ids
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'account_id' => :'accountId',
|
|
34
|
+
:'vrbo_listing_number' => :'vrboListingNumber',
|
|
35
|
+
:'markup_percent' => :'markupPercent',
|
|
36
|
+
:'listing_ids' => :'listingIds'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'account_id' => :'String',
|
|
54
|
+
:'vrbo_listing_number' => :'String',
|
|
55
|
+
:'markup_percent' => :'Float',
|
|
56
|
+
:'listing_ids' => :'Array<String>'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
:'markup_percent',
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetListingMarkups200ResponseVrboInner` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetListingMarkups200ResponseVrboInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'account_id')
|
|
84
|
+
self.account_id = attributes[:'account_id']
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'vrbo_listing_number')
|
|
88
|
+
self.vrbo_listing_number = attributes[:'vrbo_listing_number']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'markup_percent')
|
|
92
|
+
self.markup_percent = attributes[:'markup_percent']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'listing_ids')
|
|
96
|
+
if (value = attributes[:'listing_ids']).is_a?(Array)
|
|
97
|
+
self.listing_ids = value
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
# @return Array for valid properties with the reasons
|
|
104
|
+
def list_invalid_properties
|
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
106
|
+
invalid_properties = Array.new
|
|
107
|
+
invalid_properties
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Check to see if the all the properties in the model are valid
|
|
111
|
+
# @return true if the model is valid
|
|
112
|
+
def valid?
|
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
+
true
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
account_id == o.account_id &&
|
|
123
|
+
vrbo_listing_number == o.vrbo_listing_number &&
|
|
124
|
+
markup_percent == o.markup_percent &&
|
|
125
|
+
listing_ids == o.listing_ids
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# @see the `==` method
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def eql?(o)
|
|
131
|
+
self == o
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Calculates hash code according to all attributes.
|
|
135
|
+
# @return [Integer] Hash code
|
|
136
|
+
def hash
|
|
137
|
+
[account_id, vrbo_listing_number, markup_percent, listing_ids].hash
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Builds the object from hash
|
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
142
|
+
# @return [Object] Returns the model itself
|
|
143
|
+
def self.build_from_hash(attributes)
|
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
|
145
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
146
|
+
transformed_hash = {}
|
|
147
|
+
openapi_types.each_pair do |key, type|
|
|
148
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
149
|
+
transformed_hash["#{key}"] = nil
|
|
150
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
151
|
+
# check to ensure the input is an array given that the attribute
|
|
152
|
+
# is documented as an array but the input is not
|
|
153
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
154
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
155
|
+
end
|
|
156
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
157
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
new(transformed_hash)
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Returns the object in the form of hash
|
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
|
165
|
+
def to_hash
|
|
166
|
+
hash = {}
|
|
167
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
168
|
+
value = self.send(attr)
|
|
169
|
+
if value.nil?
|
|
170
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
171
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
hash[param] = _to_hash(value)
|
|
175
|
+
end
|
|
176
|
+
hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
end
|
|
@@ -0,0 +1,353 @@
|
|
|
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 listing limits Each plan includes a number of **active listings**: | Tier | Active listings | |---|---| | `free` | 3 | | `starter` | no cap: 10 included, then billed per listing | | `custom` | no cap | Going over the plan never blocks your API calls. Listings beyond the plan are **held back**: they stay connected and keep syncing, but they are not served. A held-back listing answers `403 listing_inactive` with `reason: \"plan_limit\"`, and collection routes leave it out. Every JSON response then carries a `planNotice` and the `X-Repull-Listings-Held-Back` header, so you know there is more to see. Choose which listings are active with `POST /v1/listings/status`, or upgrade at `https://repull.dev/dashboard/billing` to activate them all. Only a call that would itself take you over the plan is refused, with **`402 listings_limit_exceeded`**: activating listings (`PATCH /v1/listings/{id}` with `{ \"active\": true }`, `POST /v1/listings/status`) or creating one (`POST /v1/listings`). Nothing else changes. The envelope carries the tier, the limit, the active count and an upgrade link next to the standard `code` / `message` / `fix` / `docs_url` / `request_id`. If an account has more active listings than its plan (for example after a downgrade), calls are still served and `planNotice` says so (code \"listings_over_plan\").
|
|
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 GetReservationSummary200Response < ApiModelBase
|
|
18
|
+
attr_accessor :from
|
|
19
|
+
|
|
20
|
+
attr_accessor :to
|
|
21
|
+
|
|
22
|
+
attr_accessor :basis
|
|
23
|
+
|
|
24
|
+
attr_accessor :group_by
|
|
25
|
+
|
|
26
|
+
attr_accessor :as_of
|
|
27
|
+
|
|
28
|
+
# Active listings covered (the occupancy denominator).
|
|
29
|
+
attr_accessor :listing_count
|
|
30
|
+
|
|
31
|
+
attr_accessor :totals
|
|
32
|
+
|
|
33
|
+
attr_accessor :groups
|
|
34
|
+
|
|
35
|
+
class EnumAttributeValidator
|
|
36
|
+
attr_reader :datatype
|
|
37
|
+
attr_reader :allowable_values
|
|
38
|
+
|
|
39
|
+
def initialize(datatype, allowable_values)
|
|
40
|
+
@allowable_values = allowable_values.map do |value|
|
|
41
|
+
case datatype.to_s
|
|
42
|
+
when /Integer/i
|
|
43
|
+
value.to_i
|
|
44
|
+
when /Float/i
|
|
45
|
+
value.to_f
|
|
46
|
+
else
|
|
47
|
+
value
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def valid?(value)
|
|
53
|
+
!value || allowable_values.include?(value)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
58
|
+
def self.attribute_map
|
|
59
|
+
{
|
|
60
|
+
:'from' => :'from',
|
|
61
|
+
:'to' => :'to',
|
|
62
|
+
:'basis' => :'basis',
|
|
63
|
+
:'group_by' => :'groupBy',
|
|
64
|
+
:'as_of' => :'asOf',
|
|
65
|
+
:'listing_count' => :'listingCount',
|
|
66
|
+
:'totals' => :'totals',
|
|
67
|
+
:'groups' => :'groups'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns attribute mapping this model knows about
|
|
72
|
+
def self.acceptable_attribute_map
|
|
73
|
+
attribute_map
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Returns all the JSON keys this model knows about
|
|
77
|
+
def self.acceptable_attributes
|
|
78
|
+
acceptable_attribute_map.values
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Attribute type mapping.
|
|
82
|
+
def self.openapi_types
|
|
83
|
+
{
|
|
84
|
+
:'from' => :'Date',
|
|
85
|
+
:'to' => :'Date',
|
|
86
|
+
:'basis' => :'String',
|
|
87
|
+
:'group_by' => :'Array<String>',
|
|
88
|
+
:'as_of' => :'Date',
|
|
89
|
+
:'listing_count' => :'Integer',
|
|
90
|
+
:'totals' => :'Array<GetReservationSummary200ResponseTotalsInner>',
|
|
91
|
+
:'groups' => :'Array<GetReservationSummary200ResponseTotalsInner>'
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# List of attributes with nullable: true
|
|
96
|
+
def self.openapi_nullable
|
|
97
|
+
Set.new([
|
|
98
|
+
:'as_of',
|
|
99
|
+
])
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Initializes the object
|
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
104
|
+
def initialize(attributes = {})
|
|
105
|
+
if (!attributes.is_a?(Hash))
|
|
106
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::GetReservationSummary200Response` initialize method"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
110
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
111
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
112
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
113
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::GetReservationSummary200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
114
|
+
end
|
|
115
|
+
h[k.to_sym] = v
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'from')
|
|
119
|
+
self.from = attributes[:'from']
|
|
120
|
+
else
|
|
121
|
+
self.from = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'to')
|
|
125
|
+
self.to = attributes[:'to']
|
|
126
|
+
else
|
|
127
|
+
self.to = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'basis')
|
|
131
|
+
self.basis = attributes[:'basis']
|
|
132
|
+
else
|
|
133
|
+
self.basis = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'group_by')
|
|
137
|
+
if (value = attributes[:'group_by']).is_a?(Array)
|
|
138
|
+
self.group_by = value
|
|
139
|
+
end
|
|
140
|
+
else
|
|
141
|
+
self.group_by = nil
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'as_of')
|
|
145
|
+
self.as_of = attributes[:'as_of']
|
|
146
|
+
else
|
|
147
|
+
self.as_of = nil
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'listing_count')
|
|
151
|
+
self.listing_count = attributes[:'listing_count']
|
|
152
|
+
else
|
|
153
|
+
self.listing_count = nil
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'totals')
|
|
157
|
+
if (value = attributes[:'totals']).is_a?(Array)
|
|
158
|
+
self.totals = value
|
|
159
|
+
end
|
|
160
|
+
else
|
|
161
|
+
self.totals = nil
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'groups')
|
|
165
|
+
if (value = attributes[:'groups']).is_a?(Array)
|
|
166
|
+
self.groups = value
|
|
167
|
+
end
|
|
168
|
+
else
|
|
169
|
+
self.groups = nil
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
174
|
+
# @return Array for valid properties with the reasons
|
|
175
|
+
def list_invalid_properties
|
|
176
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
177
|
+
invalid_properties = Array.new
|
|
178
|
+
if @from.nil?
|
|
179
|
+
invalid_properties.push('invalid value for "from", from cannot be nil.')
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if @to.nil?
|
|
183
|
+
invalid_properties.push('invalid value for "to", to cannot be nil.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
if @basis.nil?
|
|
187
|
+
invalid_properties.push('invalid value for "basis", basis cannot be nil.')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if @group_by.nil?
|
|
191
|
+
invalid_properties.push('invalid value for "group_by", group_by cannot be nil.')
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if @listing_count.nil?
|
|
195
|
+
invalid_properties.push('invalid value for "listing_count", listing_count cannot be nil.')
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
if @totals.nil?
|
|
199
|
+
invalid_properties.push('invalid value for "totals", totals cannot be nil.')
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if @groups.nil?
|
|
203
|
+
invalid_properties.push('invalid value for "groups", groups cannot be nil.')
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
invalid_properties
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Check to see if the all the properties in the model are valid
|
|
210
|
+
# @return true if the model is valid
|
|
211
|
+
def valid?
|
|
212
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
213
|
+
return false if @from.nil?
|
|
214
|
+
return false if @to.nil?
|
|
215
|
+
return false if @basis.nil?
|
|
216
|
+
basis_validator = EnumAttributeValidator.new('String', ["stay", "check_in", "booked"])
|
|
217
|
+
return false unless basis_validator.valid?(@basis)
|
|
218
|
+
return false if @group_by.nil?
|
|
219
|
+
return false if @listing_count.nil?
|
|
220
|
+
return false if @totals.nil?
|
|
221
|
+
return false if @groups.nil?
|
|
222
|
+
true
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Custom attribute writer method with validation
|
|
226
|
+
# @param [Object] from Value to be assigned
|
|
227
|
+
def from=(from)
|
|
228
|
+
if from.nil?
|
|
229
|
+
fail ArgumentError, 'from cannot be nil'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@from = from
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] to Value to be assigned
|
|
237
|
+
def to=(to)
|
|
238
|
+
if to.nil?
|
|
239
|
+
fail ArgumentError, 'to cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
@to = to
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
246
|
+
# @param [Object] basis Object to be assigned
|
|
247
|
+
def basis=(basis)
|
|
248
|
+
validator = EnumAttributeValidator.new('String', ["stay", "check_in", "booked"])
|
|
249
|
+
unless validator.valid?(basis)
|
|
250
|
+
fail ArgumentError, "invalid value for \"basis\", must be one of #{validator.allowable_values}."
|
|
251
|
+
end
|
|
252
|
+
@basis = basis
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Custom attribute writer method with validation
|
|
256
|
+
# @param [Object] listing_count Value to be assigned
|
|
257
|
+
def listing_count=(listing_count)
|
|
258
|
+
if listing_count.nil?
|
|
259
|
+
fail ArgumentError, 'listing_count cannot be nil'
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
@listing_count = listing_count
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Custom attribute writer method with validation
|
|
266
|
+
# @param [Object] totals Value to be assigned
|
|
267
|
+
def totals=(totals)
|
|
268
|
+
if totals.nil?
|
|
269
|
+
fail ArgumentError, 'totals cannot be nil'
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
@totals = totals
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Custom attribute writer method with validation
|
|
276
|
+
# @param [Object] groups Value to be assigned
|
|
277
|
+
def groups=(groups)
|
|
278
|
+
if groups.nil?
|
|
279
|
+
fail ArgumentError, 'groups cannot be nil'
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
@groups = groups
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Checks equality by comparing each attribute.
|
|
286
|
+
# @param [Object] Object to be compared
|
|
287
|
+
def ==(o)
|
|
288
|
+
return true if self.equal?(o)
|
|
289
|
+
self.class == o.class &&
|
|
290
|
+
from == o.from &&
|
|
291
|
+
to == o.to &&
|
|
292
|
+
basis == o.basis &&
|
|
293
|
+
group_by == o.group_by &&
|
|
294
|
+
as_of == o.as_of &&
|
|
295
|
+
listing_count == o.listing_count &&
|
|
296
|
+
totals == o.totals &&
|
|
297
|
+
groups == o.groups
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# @see the `==` method
|
|
301
|
+
# @param [Object] Object to be compared
|
|
302
|
+
def eql?(o)
|
|
303
|
+
self == o
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Calculates hash code according to all attributes.
|
|
307
|
+
# @return [Integer] Hash code
|
|
308
|
+
def hash
|
|
309
|
+
[from, to, basis, group_by, as_of, listing_count, totals, groups].hash
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Builds the object from hash
|
|
313
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
314
|
+
# @return [Object] Returns the model itself
|
|
315
|
+
def self.build_from_hash(attributes)
|
|
316
|
+
return nil unless attributes.is_a?(Hash)
|
|
317
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
318
|
+
transformed_hash = {}
|
|
319
|
+
openapi_types.each_pair do |key, type|
|
|
320
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
321
|
+
transformed_hash["#{key}"] = nil
|
|
322
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
323
|
+
# check to ensure the input is an array given that the attribute
|
|
324
|
+
# is documented as an array but the input is not
|
|
325
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
326
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
327
|
+
end
|
|
328
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
329
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
new(transformed_hash)
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
# Returns the object in the form of hash
|
|
336
|
+
# @return [Hash] Returns the object in the form of hash
|
|
337
|
+
def to_hash
|
|
338
|
+
hash = {}
|
|
339
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
340
|
+
value = self.send(attr)
|
|
341
|
+
if value.nil?
|
|
342
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
343
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
hash[param] = _to_hash(value)
|
|
347
|
+
end
|
|
348
|
+
hash
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
end
|