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.
- checksums.yaml +4 -4
- data/lib/repull/api/connect_api.rb +617 -0
- data/lib/repull/api/connections_api.rb +312 -0
- data/lib/repull/api/conversations_api.rb +151 -18
- data/lib/repull/api/health_api.rb +5 -5
- data/lib/repull/api/listings_api.rb +67 -4
- data/lib/repull/api/reviews_api.rb +2 -2
- data/lib/repull/models/apply_connection_mappings200_response.rb +167 -0
- data/lib/repull/models/apply_connection_mappings200_response_results_inner.rb +184 -0
- data/lib/repull/models/apply_connection_mappings_request.rb +175 -0
- data/lib/repull/models/apply_connection_mappings_request_mappings_inner.rb +193 -0
- data/lib/repull/models/auto_map_connection_units200_response.rb +176 -0
- data/lib/repull/models/auto_map_connection_units_request.rb +156 -0
- data/lib/repull/models/channel_market_state_item.rb +15 -4
- data/lib/repull/models/connect_status.rb +25 -5
- data/lib/repull/models/connect_status_accounts_inner.rb +71 -4
- data/lib/repull/models/conversation_capabilities.rb +260 -0
- data/lib/repull/models/conversation_detail.rb +14 -5
- data/lib/repull/models/create_connect_session_request.rb +23 -1
- data/lib/repull/models/create_conversation_special_offer201_response.rb +127 -4
- data/lib/repull/models/create_conversation_special_offer201_response_fees_inner.rb +166 -0
- data/lib/repull/models/create_conversation_special_offer201_response_lines_inner.rb +157 -0
- data/lib/repull/models/create_conversation_special_offer_request.rb +91 -52
- data/lib/repull/models/create_conversation_special_offer_request_fees_inner.rb +199 -0
- data/lib/repull/models/get_booking_extranet_login_config200_response.rb +147 -0
- data/lib/repull/models/get_booking_extranet_login_status200_response.rb +192 -0
- data/lib/repull/models/get_channel_health200_response.rb +190 -0
- data/lib/repull/models/get_channel_health200_response_vrbo.rb +197 -0
- data/lib/repull/models/get_connect_write_policy200_response.rb +166 -0
- data/lib/repull/models/get_listing_calendar_sync200_response.rb +192 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner.rb +331 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_problems_inner.rb +157 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue.rb +212 -0
- data/lib/repull/models/get_listing_calendar_sync200_response_channels_inner_queue_last_push.rb +268 -0
- data/lib/repull/models/invite_booking_extranet_user200_response.rb +174 -0
- data/lib/repull/models/invite_booking_extranet_user_request.rb +173 -0
- data/lib/repull/models/list_connection_units200_response.rb +242 -0
- data/lib/repull/models/list_connection_units200_response_listing_options_inner.rb +165 -0
- data/lib/repull/models/list_connection_units200_response_units_inner.rb +194 -0
- data/lib/repull/models/listing_publish_status_connection.rb +34 -1
- data/lib/repull/models/pms_write_policy.rb +191 -0
- data/lib/repull/models/pms_write_policy_calendar.rb +219 -0
- data/lib/repull/models/pms_write_policy_reservations.rb +219 -0
- data/lib/repull/models/preapprove_conversation201_response.rb +47 -6
- data/lib/repull/models/preapprove_conversation_request.rb +34 -5
- data/lib/repull/models/preview_conversation_special_offer_request.rb +231 -0
- data/lib/repull/models/preview_conversation_special_offer_request_fees_inner.rb +199 -0
- data/lib/repull/models/preview_conversation_special_offer_request_guests.rb +250 -0
- data/lib/repull/models/reply_to_review_request.rb +33 -4
- data/lib/repull/models/search_connect_session_listing_options200_response.rb +158 -0
- data/lib/repull/models/search_connect_session_listing_options200_response_data_inner.rb +166 -0
- data/lib/repull/models/search_connection_listing_options200_response.rb +159 -0
- data/lib/repull/models/send_message_request.rb +1 -1
- data/lib/repull/models/start_booking_extranet_login200_response.rb +174 -0
- data/lib/repull/models/start_booking_extranet_login_request.rb +225 -0
- data/lib/repull/models/submit_cloudbeds_credentials200_response.rb +10 -1
- data/lib/repull/models/submit_cloudbeds_credentials_request.rb +11 -1
- data/lib/repull/models/submit_mews_credentials200_response.rb +10 -1
- data/lib/repull/models/submit_mews_credentials_request.rb +11 -1
- data/lib/repull/models/update_connect_write_policy_request.rb +157 -0
- data/lib/repull/models/update_connect_write_policy_request_calendar.rb +165 -0
- data/lib/repull/models/update_connect_write_policy_request_reservations.rb +165 -0
- data/lib/repull/models/vrbo_import_status.rb +249 -0
- data/lib/repull/models/vrbo_login200_response.rb +235 -0
- data/lib/repull/models/vrbo_login_request.rb +271 -0
- data/lib/repull/models/withdraw_conversation_preapproval200_response.rb +226 -0
- data/lib/repull/models/withdraw_conversation_special_offer200_response.rb +29 -1
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +44 -0
- data/openapi/v1.json +4693 -2114
- data/scripts/regen.sh +1 -1
- metadata +46 -2
|
@@ -0,0 +1,165 @@
|
|
|
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 ListConnectionUnits200ResponseListingOptionsInner < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
attr_accessor :city
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'id' => :'id',
|
|
28
|
+
:'name' => :'name',
|
|
29
|
+
:'city' => :'city'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'id' => :'Integer',
|
|
47
|
+
:'name' => :'String',
|
|
48
|
+
:'city' => :'String'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListConnectionUnits200ResponseListingOptionsInner` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListConnectionUnits200ResponseListingOptionsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'id')
|
|
75
|
+
self.id = attributes[:'id']
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'name')
|
|
79
|
+
self.name = attributes[:'name']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'city')
|
|
83
|
+
self.city = attributes[:'city']
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
88
|
+
# @return Array for valid properties with the reasons
|
|
89
|
+
def list_invalid_properties
|
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
91
|
+
invalid_properties = Array.new
|
|
92
|
+
invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
99
|
+
true
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Checks equality by comparing each attribute.
|
|
103
|
+
# @param [Object] Object to be compared
|
|
104
|
+
def ==(o)
|
|
105
|
+
return true if self.equal?(o)
|
|
106
|
+
self.class == o.class &&
|
|
107
|
+
id == o.id &&
|
|
108
|
+
name == o.name &&
|
|
109
|
+
city == o.city
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Integer] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[id, name, city].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def self.build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
130
|
+
transformed_hash = {}
|
|
131
|
+
openapi_types.each_pair do |key, type|
|
|
132
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = nil
|
|
134
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
138
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
141
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
new(transformed_hash)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Returns the object in the form of hash
|
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
|
149
|
+
def to_hash
|
|
150
|
+
hash = {}
|
|
151
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
152
|
+
value = self.send(attr)
|
|
153
|
+
if value.nil?
|
|
154
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
155
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
hash[param] = _to_hash(value)
|
|
159
|
+
end
|
|
160
|
+
hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
end
|
|
@@ -0,0 +1,194 @@
|
|
|
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 ListConnectionUnits200ResponseUnitsInner < ApiModelBase
|
|
18
|
+
attr_accessor :unit_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :unit_name
|
|
21
|
+
|
|
22
|
+
attr_accessor :grain
|
|
23
|
+
|
|
24
|
+
attr_accessor :current_listing_id
|
|
25
|
+
|
|
26
|
+
attr_accessor :suggested_listing_id
|
|
27
|
+
|
|
28
|
+
attr_accessor :meta
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'unit_id' => :'unit_id',
|
|
34
|
+
:'unit_name' => :'unit_name',
|
|
35
|
+
:'grain' => :'grain',
|
|
36
|
+
:'current_listing_id' => :'current_listing_id',
|
|
37
|
+
:'suggested_listing_id' => :'suggested_listing_id',
|
|
38
|
+
:'meta' => :'meta'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns attribute mapping this model knows about
|
|
43
|
+
def self.acceptable_attribute_map
|
|
44
|
+
attribute_map
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
|
48
|
+
def self.acceptable_attributes
|
|
49
|
+
acceptable_attribute_map.values
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.openapi_types
|
|
54
|
+
{
|
|
55
|
+
:'unit_id' => :'String',
|
|
56
|
+
:'unit_name' => :'String',
|
|
57
|
+
:'grain' => :'String',
|
|
58
|
+
:'current_listing_id' => :'Integer',
|
|
59
|
+
:'suggested_listing_id' => :'Integer',
|
|
60
|
+
:'meta' => :'Object'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# List of attributes with nullable: true
|
|
65
|
+
def self.openapi_nullable
|
|
66
|
+
Set.new([
|
|
67
|
+
:'current_listing_id',
|
|
68
|
+
:'suggested_listing_id',
|
|
69
|
+
])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListConnectionUnits200ResponseUnitsInner` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListConnectionUnits200ResponseUnitsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
|
+
end
|
|
85
|
+
h[k.to_sym] = v
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'unit_id')
|
|
89
|
+
self.unit_id = attributes[:'unit_id']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'unit_name')
|
|
93
|
+
self.unit_name = attributes[:'unit_name']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'grain')
|
|
97
|
+
self.grain = attributes[:'grain']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'current_listing_id')
|
|
101
|
+
self.current_listing_id = attributes[:'current_listing_id']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'suggested_listing_id')
|
|
105
|
+
self.suggested_listing_id = attributes[:'suggested_listing_id']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'meta')
|
|
109
|
+
self.meta = attributes[:'meta']
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
114
|
+
# @return Array for valid properties with the reasons
|
|
115
|
+
def list_invalid_properties
|
|
116
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
117
|
+
invalid_properties = Array.new
|
|
118
|
+
invalid_properties
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Check to see if the all the properties in the model are valid
|
|
122
|
+
# @return true if the model is valid
|
|
123
|
+
def valid?
|
|
124
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
125
|
+
true
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
unit_id == o.unit_id &&
|
|
134
|
+
unit_name == o.unit_name &&
|
|
135
|
+
grain == o.grain &&
|
|
136
|
+
current_listing_id == o.current_listing_id &&
|
|
137
|
+
suggested_listing_id == o.suggested_listing_id &&
|
|
138
|
+
meta == o.meta
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# @see the `==` method
|
|
142
|
+
# @param [Object] Object to be compared
|
|
143
|
+
def eql?(o)
|
|
144
|
+
self == o
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Calculates hash code according to all attributes.
|
|
148
|
+
# @return [Integer] Hash code
|
|
149
|
+
def hash
|
|
150
|
+
[unit_id, unit_name, grain, current_listing_id, suggested_listing_id, meta].hash
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Builds the object from hash
|
|
154
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
155
|
+
# @return [Object] Returns the model itself
|
|
156
|
+
def self.build_from_hash(attributes)
|
|
157
|
+
return nil unless attributes.is_a?(Hash)
|
|
158
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
159
|
+
transformed_hash = {}
|
|
160
|
+
openapi_types.each_pair do |key, type|
|
|
161
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
162
|
+
transformed_hash["#{key}"] = nil
|
|
163
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
164
|
+
# check to ensure the input is an array given that the attribute
|
|
165
|
+
# is documented as an array but the input is not
|
|
166
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
167
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
168
|
+
end
|
|
169
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
170
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
new(transformed_hash)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Returns the object in the form of hash
|
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
|
178
|
+
def to_hash
|
|
179
|
+
hash = {}
|
|
180
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
181
|
+
value = self.send(attr)
|
|
182
|
+
if value.nil?
|
|
183
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
184
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
hash[param] = _to_hash(value)
|
|
188
|
+
end
|
|
189
|
+
hash
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
end
|
|
@@ -28,6 +28,15 @@ module Repull
|
|
|
28
28
|
# ISO timestamp the connection was first established.
|
|
29
29
|
attr_accessor :since
|
|
30
30
|
|
|
31
|
+
# The listing's id on the channel — Airbnb listing id, Booking.com room/property id, VRBO listing number.
|
|
32
|
+
attr_accessor :platform_id
|
|
33
|
+
|
|
34
|
+
# Where the listing stands on the channel itself, when the channel reports it (VRBO): `online` — live and bookable; `offline` — hidden by the owner (`POST /v1/listings/{id}/online` brings it back); `not_live` — expired, new, still onboarding or deactivated by the channel (see `channelStatusDetail`). Null when not reported.
|
|
35
|
+
attr_accessor :channel_status
|
|
36
|
+
|
|
37
|
+
# The channel's own status word behind `channelStatus` (VRBO: `LIVE`, `InactiveByOwnerRequest`, `Expired`, `New`, …).
|
|
38
|
+
attr_accessor :channel_status_detail
|
|
39
|
+
|
|
31
40
|
# Fields the channel will not let this listing change. **Airbnb only** — present on the `airbnb` entry and absent on every other channel, because no other channel has the concept. Airbnb does not refuse a write to a locked field: the request returns 200, reports the field as locked, and applies nothing. So a write to one of these looks exactly like a write that worked. Read this before you let a user edit — it is here, rather than only on `GET /v1/channels/airbnb/listings/{id}`, because this is the endpoint a listing editor already calls. Empty for a listing with nothing locked, and for one that has not synced since we began recording them — the two are not distinguished, because a caller acts the same way on both. This is what Airbnb last told us, not a promise: a lock can appear between syncs, which is why a publish result also reports `lockedFields`.
|
|
32
41
|
attr_accessor :locked_fields
|
|
33
42
|
|
|
@@ -38,6 +47,9 @@ module Repull
|
|
|
38
47
|
:'connected' => :'connected',
|
|
39
48
|
:'sync_enabled' => :'syncEnabled',
|
|
40
49
|
:'since' => :'since',
|
|
50
|
+
:'platform_id' => :'platformId',
|
|
51
|
+
:'channel_status' => :'channelStatus',
|
|
52
|
+
:'channel_status_detail' => :'channelStatusDetail',
|
|
41
53
|
:'locked_fields' => :'lockedFields'
|
|
42
54
|
}
|
|
43
55
|
end
|
|
@@ -59,6 +71,9 @@ module Repull
|
|
|
59
71
|
:'connected' => :'Boolean',
|
|
60
72
|
:'sync_enabled' => :'Boolean',
|
|
61
73
|
:'since' => :'Time',
|
|
74
|
+
:'platform_id' => :'String',
|
|
75
|
+
:'channel_status' => :'String',
|
|
76
|
+
:'channel_status_detail' => :'String',
|
|
62
77
|
:'locked_fields' => :'Array<String>'
|
|
63
78
|
}
|
|
64
79
|
end
|
|
@@ -67,6 +82,9 @@ module Repull
|
|
|
67
82
|
def self.openapi_nullable
|
|
68
83
|
Set.new([
|
|
69
84
|
:'since',
|
|
85
|
+
:'platform_id',
|
|
86
|
+
:'channel_status',
|
|
87
|
+
:'channel_status_detail',
|
|
70
88
|
])
|
|
71
89
|
end
|
|
72
90
|
|
|
@@ -102,6 +120,18 @@ module Repull
|
|
|
102
120
|
self.since = attributes[:'since']
|
|
103
121
|
end
|
|
104
122
|
|
|
123
|
+
if attributes.key?(:'platform_id')
|
|
124
|
+
self.platform_id = attributes[:'platform_id']
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'channel_status')
|
|
128
|
+
self.channel_status = attributes[:'channel_status']
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'channel_status_detail')
|
|
132
|
+
self.channel_status_detail = attributes[:'channel_status_detail']
|
|
133
|
+
end
|
|
134
|
+
|
|
105
135
|
if attributes.key?(:'locked_fields')
|
|
106
136
|
if (value = attributes[:'locked_fields']).is_a?(Array)
|
|
107
137
|
self.locked_fields = value
|
|
@@ -133,6 +163,9 @@ module Repull
|
|
|
133
163
|
connected == o.connected &&
|
|
134
164
|
sync_enabled == o.sync_enabled &&
|
|
135
165
|
since == o.since &&
|
|
166
|
+
platform_id == o.platform_id &&
|
|
167
|
+
channel_status == o.channel_status &&
|
|
168
|
+
channel_status_detail == o.channel_status_detail &&
|
|
136
169
|
locked_fields == o.locked_fields
|
|
137
170
|
end
|
|
138
171
|
|
|
@@ -145,7 +178,7 @@ module Repull
|
|
|
145
178
|
# Calculates hash code according to all attributes.
|
|
146
179
|
# @return [Integer] Hash code
|
|
147
180
|
def hash
|
|
148
|
-
[channel, connected, sync_enabled, since, locked_fields].hash
|
|
181
|
+
[channel, connected, sync_enabled, since, platform_id, channel_status, channel_status_detail, locked_fields].hash
|
|
149
182
|
end
|
|
150
183
|
|
|
151
184
|
# Builds the object from hash
|
|
@@ -0,0 +1,191 @@
|
|
|
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
|
+
# What the app may change in a connected PMS. Hotel PMSs (Cloudbeds, Mews) start with every `calendar` switch off, because the PMS owns its room inventory; every other PMS starts with everything on. Reading from the PMS is never affected.
|
|
18
|
+
class PmsWritePolicy < ApiModelBase
|
|
19
|
+
attr_accessor :calendar
|
|
20
|
+
|
|
21
|
+
attr_accessor :reservations
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'calendar' => :'calendar',
|
|
27
|
+
:'reservations' => :'reservations'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'calendar' => :'PmsWritePolicyCalendar',
|
|
45
|
+
:'reservations' => :'PmsWritePolicyReservations'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initializes the object
|
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
|
+
def initialize(attributes = {})
|
|
58
|
+
if (!attributes.is_a?(Hash))
|
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::PmsWritePolicy` initialize method"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::PmsWritePolicy`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'calendar')
|
|
72
|
+
self.calendar = attributes[:'calendar']
|
|
73
|
+
else
|
|
74
|
+
self.calendar = nil
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'reservations')
|
|
78
|
+
self.reservations = attributes[:'reservations']
|
|
79
|
+
else
|
|
80
|
+
self.reservations = nil
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
85
|
+
# @return Array for valid properties with the reasons
|
|
86
|
+
def list_invalid_properties
|
|
87
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
88
|
+
invalid_properties = Array.new
|
|
89
|
+
if @calendar.nil?
|
|
90
|
+
invalid_properties.push('invalid value for "calendar", calendar cannot be nil.')
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if @reservations.nil?
|
|
94
|
+
invalid_properties.push('invalid value for "reservations", reservations cannot be nil.')
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
104
|
+
return false if @calendar.nil?
|
|
105
|
+
return false if @reservations.nil?
|
|
106
|
+
true
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Custom attribute writer method with validation
|
|
110
|
+
# @param [Object] calendar Value to be assigned
|
|
111
|
+
def calendar=(calendar)
|
|
112
|
+
if calendar.nil?
|
|
113
|
+
fail ArgumentError, 'calendar cannot be nil'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
@calendar = calendar
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Custom attribute writer method with validation
|
|
120
|
+
# @param [Object] reservations Value to be assigned
|
|
121
|
+
def reservations=(reservations)
|
|
122
|
+
if reservations.nil?
|
|
123
|
+
fail ArgumentError, 'reservations cannot be nil'
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
@reservations = reservations
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Checks equality by comparing each attribute.
|
|
130
|
+
# @param [Object] Object to be compared
|
|
131
|
+
def ==(o)
|
|
132
|
+
return true if self.equal?(o)
|
|
133
|
+
self.class == o.class &&
|
|
134
|
+
calendar == o.calendar &&
|
|
135
|
+
reservations == o.reservations
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# @see the `==` method
|
|
139
|
+
# @param [Object] Object to be compared
|
|
140
|
+
def eql?(o)
|
|
141
|
+
self == o
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Calculates hash code according to all attributes.
|
|
145
|
+
# @return [Integer] Hash code
|
|
146
|
+
def hash
|
|
147
|
+
[calendar, reservations].hash
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Builds the object from hash
|
|
151
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
152
|
+
# @return [Object] Returns the model itself
|
|
153
|
+
def self.build_from_hash(attributes)
|
|
154
|
+
return nil unless attributes.is_a?(Hash)
|
|
155
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
156
|
+
transformed_hash = {}
|
|
157
|
+
openapi_types.each_pair do |key, type|
|
|
158
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
159
|
+
transformed_hash["#{key}"] = nil
|
|
160
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
161
|
+
# check to ensure the input is an array given that the attribute
|
|
162
|
+
# is documented as an array but the input is not
|
|
163
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
164
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
165
|
+
end
|
|
166
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
new(transformed_hash)
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Returns the object in the form of hash
|
|
174
|
+
# @return [Hash] Returns the object in the form of hash
|
|
175
|
+
def to_hash
|
|
176
|
+
hash = {}
|
|
177
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
178
|
+
value = self.send(attr)
|
|
179
|
+
if value.nil?
|
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
hash[param] = _to_hash(value)
|
|
185
|
+
end
|
|
186
|
+
hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|