repull 0.2.16 → 0.2.17

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +6 -6
  3. data/lib/repull/api/booking_com_api.rb +86 -2
  4. data/lib/repull/api/conversations_api.rb +8 -8
  5. data/lib/repull/api/listings_api.rb +182 -12
  6. data/lib/repull/api/reservations_api.rb +4 -4
  7. data/lib/repull/models/airbnb_publish_result.rb +41 -2
  8. data/lib/repull/models/booking_property_action_request.rb +176 -0
  9. data/lib/repull/models/booking_property_action_response.rb +281 -0
  10. data/lib/repull/models/booking_publish_result.rb +245 -0
  11. data/lib/repull/models/booking_publish_section_error.rb +220 -0
  12. data/lib/repull/models/booking_setup_request.rb +44 -5
  13. data/lib/repull/models/booking_setup_request_legal_entity.rb +235 -0
  14. data/lib/repull/models/channel_market_state_item.rb +291 -0
  15. data/lib/repull/models/error_error.rb +11 -1
  16. data/lib/repull/models/inquiry_updated_payload.rb +1 -1
  17. data/lib/repull/models/list_inquiries200_response_data_inner.rb +1 -1
  18. data/lib/repull/models/listing_address_readiness.rb +171 -0
  19. data/lib/repull/models/listing_content_update_request_address.rb +40 -3
  20. data/lib/repull/models/listing_create_request.rb +48 -2
  21. data/lib/repull/models/listing_market_state_request.rb +149 -0
  22. data/lib/repull/models/listing_market_state_response.rb +221 -0
  23. data/lib/repull/models/listing_publish_booking_request.rb +149 -0
  24. data/lib/repull/models/{listing_publish_response.rb → listing_publish_booking_response.rb} +4 -5
  25. data/lib/repull/models/listing_publish_status_channel.rb +32 -1
  26. data/lib/repull/models/listing_publish_status_connection.rb +17 -5
  27. data/lib/repull/models/listing_publish_status_response.rb +13 -1
  28. data/lib/repull/models/reservation_request_updated_payload.rb +1 -1
  29. data/lib/repull/version.rb +1 -1
  30. data/lib/repull.rb +11 -1
  31. data/openapi/v1.json +855 -72
  32. data/scripts/regen.sh +1 -1
  33. metadata +13 -3
@@ -0,0 +1,245 @@
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
+ Contact: ivan@vanio.ai
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
+ # A publish is not one call to Booking.com: it is several independent Content API calls (details, description, amenities, rooms, photos, pricing), each of which can fail on its own. A PARTIAL publish is normal — what succeeded stays applied; there is no rollback. Fix the failing sections and publish again; re-publishing an unchanged section is harmless. A property whose Content API credentials do not cover a section answers 403 for that section alone — the rest still land, and the failure is reported here rather than swallowed.
18
+ class BookingPublishResult < ApiModelBase
19
+ # True only when EVERY attempted section reached Booking.com.
20
+ attr_accessor :published
21
+
22
+ # Sections that landed on Booking.com.
23
+ attr_accessor :sections
24
+
25
+ # Per-section failures. Empty when `published` is true.
26
+ attr_accessor :errors
27
+
28
+ # Set when the publish never started at all — most often because the listing is not mapped to any Booking.com property yet. Finish the Connect flow (`POST /v1/connect/booking/map-rooms`) and publish again.
29
+ attr_accessor :reason
30
+
31
+ # The Booking.com property this publish wrote into — resolved from the listing's mapping, or the one you named. Always read it back: a listing can be mapped to several properties, and this states which one actually received the content. Null when the listing is mapped to no property, in which case nothing was pushed.
32
+ attr_accessor :hotel_id
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'published' => :'published',
38
+ :'sections' => :'sections',
39
+ :'errors' => :'errors',
40
+ :'reason' => :'reason',
41
+ :'hotel_id' => :'hotelId'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'published' => :'Boolean',
59
+ :'sections' => :'Array<String>',
60
+ :'errors' => :'Array<BookingPublishSectionError>',
61
+ :'reason' => :'String',
62
+ :'hotel_id' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ :'hotel_id'
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingPublishResult` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingPublishResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'published')
90
+ self.published = attributes[:'published']
91
+ else
92
+ self.published = nil
93
+ end
94
+
95
+ if attributes.key?(:'sections')
96
+ if (value = attributes[:'sections']).is_a?(Array)
97
+ self.sections = value
98
+ end
99
+ else
100
+ self.sections = nil
101
+ end
102
+
103
+ if attributes.key?(:'errors')
104
+ if (value = attributes[:'errors']).is_a?(Array)
105
+ self.errors = value
106
+ end
107
+ else
108
+ self.errors = nil
109
+ end
110
+
111
+ if attributes.key?(:'reason')
112
+ self.reason = attributes[:'reason']
113
+ end
114
+
115
+ if attributes.key?(:'hotel_id')
116
+ self.hotel_id = attributes[:'hotel_id']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ if @published.nil?
126
+ invalid_properties.push('invalid value for "published", published cannot be nil.')
127
+ end
128
+
129
+ if @sections.nil?
130
+ invalid_properties.push('invalid value for "sections", sections cannot be nil.')
131
+ end
132
+
133
+ if @errors.nil?
134
+ invalid_properties.push('invalid value for "errors", errors cannot be nil.')
135
+ end
136
+
137
+ invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ warn '[DEPRECATED] the `valid?` method is obsolete'
144
+ return false if @published.nil?
145
+ return false if @sections.nil?
146
+ return false if @errors.nil?
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] published Value to be assigned
152
+ def published=(published)
153
+ if published.nil?
154
+ fail ArgumentError, 'published cannot be nil'
155
+ end
156
+
157
+ @published = published
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] sections Value to be assigned
162
+ def sections=(sections)
163
+ if sections.nil?
164
+ fail ArgumentError, 'sections cannot be nil'
165
+ end
166
+
167
+ @sections = sections
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] errors Value to be assigned
172
+ def errors=(errors)
173
+ if errors.nil?
174
+ fail ArgumentError, 'errors cannot be nil'
175
+ end
176
+
177
+ @errors = errors
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if self.equal?(o)
184
+ self.class == o.class &&
185
+ published == o.published &&
186
+ sections == o.sections &&
187
+ errors == o.errors &&
188
+ reason == o.reason &&
189
+ hotel_id == o.hotel_id
190
+ end
191
+
192
+ # @see the `==` method
193
+ # @param [Object] Object to be compared
194
+ def eql?(o)
195
+ self == o
196
+ end
197
+
198
+ # Calculates hash code according to all attributes.
199
+ # @return [Integer] Hash code
200
+ def hash
201
+ [published, sections, errors, reason, hotel_id].hash
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def self.build_from_hash(attributes)
208
+ return nil unless attributes.is_a?(Hash)
209
+ attributes = attributes.transform_keys(&:to_sym)
210
+ transformed_hash = {}
211
+ openapi_types.each_pair do |key, type|
212
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
213
+ transformed_hash["#{key}"] = nil
214
+ elsif type =~ /\AArray<(.*)>/i
215
+ # check to ensure the input is an array given that the attribute
216
+ # is documented as an array but the input is not
217
+ if attributes[attribute_map[key]].is_a?(Array)
218
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
219
+ end
220
+ elsif !attributes[attribute_map[key]].nil?
221
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
222
+ end
223
+ end
224
+ new(transformed_hash)
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ end
244
+
245
+ end
@@ -0,0 +1,220 @@
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
+ Contact: ivan@vanio.ai
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
+ # One section of a publish that did not reach Booking.com.
18
+ class BookingPublishSectionError < ApiModelBase
19
+ # Which part of the listing this failure is about — e.g. `details`, `description`, `amenities`, `rooms`, `photos`, `pricing`.
20
+ attr_accessor :section
21
+
22
+ # Booking.com's own reason, verbatim, or ours when we refused to send an empty section.
23
+ attr_accessor :message
24
+
25
+ # `no_content` — there was nothing canonical to send for this section; write the content, then publish again. `rejected` — Booking.com refused the section as sent; fix the content, or the property's Content API permissions, and publish again. Airbnb's third code, `locked`, has no Booking.com counterpart and never appears here.
26
+ attr_accessor :code
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'section' => :'section',
32
+ :'message' => :'message',
33
+ :'code' => :'code'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'section' => :'String',
51
+ :'message' => :'String',
52
+ :'code' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::BookingPublishSectionError` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::BookingPublishSectionError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'section')
79
+ self.section = attributes[:'section']
80
+ else
81
+ self.section = nil
82
+ end
83
+
84
+ if attributes.key?(:'message')
85
+ self.message = attributes[:'message']
86
+ else
87
+ self.message = nil
88
+ end
89
+
90
+ if attributes.key?(:'code')
91
+ self.code = attributes[:'code']
92
+ else
93
+ self.code = nil
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ if @section.nil?
103
+ invalid_properties.push('invalid value for "section", section cannot be nil.')
104
+ end
105
+
106
+ if @message.nil?
107
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
108
+ end
109
+
110
+ if @code.nil?
111
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
112
+ end
113
+
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ warn '[DEPRECATED] the `valid?` method is obsolete'
121
+ return false if @section.nil?
122
+ return false if @message.nil?
123
+ return false if @code.nil?
124
+ true
125
+ end
126
+
127
+ # Custom attribute writer method with validation
128
+ # @param [Object] section Value to be assigned
129
+ def section=(section)
130
+ if section.nil?
131
+ fail ArgumentError, 'section cannot be nil'
132
+ end
133
+
134
+ @section = section
135
+ end
136
+
137
+ # Custom attribute writer method with validation
138
+ # @param [Object] message Value to be assigned
139
+ def message=(message)
140
+ if message.nil?
141
+ fail ArgumentError, 'message cannot be nil'
142
+ end
143
+
144
+ @message = message
145
+ end
146
+
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] code Value to be assigned
149
+ def code=(code)
150
+ if code.nil?
151
+ fail ArgumentError, 'code cannot be nil'
152
+ end
153
+
154
+ @code = code
155
+ end
156
+
157
+ # Checks equality by comparing each attribute.
158
+ # @param [Object] Object to be compared
159
+ def ==(o)
160
+ return true if self.equal?(o)
161
+ self.class == o.class &&
162
+ section == o.section &&
163
+ message == o.message &&
164
+ code == o.code
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [section, message, code].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ return nil unless attributes.is_a?(Hash)
184
+ attributes = attributes.transform_keys(&:to_sym)
185
+ transformed_hash = {}
186
+ openapi_types.each_pair do |key, type|
187
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[attribute_map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -17,10 +17,21 @@ module Repull
17
17
  class BookingSetupRequest < ApiModelBase
18
18
  attr_accessor :action
19
19
 
20
- # Booking.com property id — required for readiness/open/contacts/policies actions.
20
+ # Repull listing id — required for `create-property`, `add-room` and `add-unit`. NOT a Booking.com Hotel ID. `listingId` is accepted as an alias.
21
+ attr_accessor :listing_id
22
+
23
+ # Booking.com Hotel ID — required for `add-room`, `add-unit`, `advance`, and the readiness/open/contacts/policies actions.
21
24
  attr_accessor :property_id
22
25
 
23
- # Legal entity id — required for `check-legal-status`.
26
+ # Booking.com room id — required for `add-unit`. `GET /v1/channels/booking/properties/{listingId}/rooms` lists them. `roomId` is accepted as an alias.
27
+ attr_accessor :room_id
28
+
29
+ # Optional override for `create-property`. Omit it: the legal entity this workspace already uses is resolved automatically. An id that carries another workspace's properties is refused with `403 legal_entity_not_yours`. `legalEntityId` is accepted as an alias.
30
+ attr_accessor :legal_entity_id
31
+
32
+ attr_accessor :legal_entity
33
+
34
+ # Legal entity id — required for `check-legal-status`, which always answers 404.
24
35
  attr_accessor :leid
25
36
 
26
37
  # Contacts payload for `set-contacts`.
@@ -52,7 +63,11 @@ module Repull
52
63
  def self.attribute_map
53
64
  {
54
65
  :'action' => :'action',
66
+ :'listing_id' => :'listing_id',
55
67
  :'property_id' => :'property_id',
68
+ :'room_id' => :'room_id',
69
+ :'legal_entity_id' => :'legal_entity_id',
70
+ :'legal_entity' => :'legal_entity',
56
71
  :'leid' => :'leid',
57
72
  :'contacts' => :'contacts'
58
73
  }
@@ -72,7 +87,11 @@ module Repull
72
87
  def self.openapi_types
73
88
  {
74
89
  :'action' => :'String',
90
+ :'listing_id' => :'Integer',
75
91
  :'property_id' => :'String',
92
+ :'room_id' => :'Integer',
93
+ :'legal_entity_id' => :'Integer',
94
+ :'legal_entity' => :'BookingSetupRequestLegalEntity',
76
95
  :'leid' => :'Integer',
77
96
  :'contacts' => :'Array<Hash<String, Object>>'
78
97
  }
@@ -106,10 +125,26 @@ module Repull
106
125
  self.action = nil
107
126
  end
108
127
 
128
+ if attributes.key?(:'listing_id')
129
+ self.listing_id = attributes[:'listing_id']
130
+ end
131
+
109
132
  if attributes.key?(:'property_id')
110
133
  self.property_id = attributes[:'property_id']
111
134
  end
112
135
 
136
+ if attributes.key?(:'room_id')
137
+ self.room_id = attributes[:'room_id']
138
+ end
139
+
140
+ if attributes.key?(:'legal_entity_id')
141
+ self.legal_entity_id = attributes[:'legal_entity_id']
142
+ end
143
+
144
+ if attributes.key?(:'legal_entity')
145
+ self.legal_entity = attributes[:'legal_entity']
146
+ end
147
+
113
148
  if attributes.key?(:'leid')
114
149
  self.leid = attributes[:'leid']
115
150
  end
@@ -138,7 +173,7 @@ module Repull
138
173
  def valid?
139
174
  warn '[DEPRECATED] the `valid?` method is obsolete'
140
175
  return false if @action.nil?
141
- action_validator = EnumAttributeValidator.new('String', ["create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
176
+ action_validator = EnumAttributeValidator.new('String', ["create-property", "add-room", "add-unit", "advance", "create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
142
177
  return false unless action_validator.valid?(@action)
143
178
  true
144
179
  end
@@ -146,7 +181,7 @@ module Repull
146
181
  # Custom attribute writer method checking allowed values (enum).
147
182
  # @param [Object] action Object to be assigned
148
183
  def action=(action)
149
- validator = EnumAttributeValidator.new('String', ["create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
184
+ validator = EnumAttributeValidator.new('String', ["create-property", "add-room", "add-unit", "advance", "create-legal-entity", "check-legal-status", "check-readiness", "open-property", "set-contacts", "set-policies"])
150
185
  unless validator.valid?(action)
151
186
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
152
187
  end
@@ -159,7 +194,11 @@ module Repull
159
194
  return true if self.equal?(o)
160
195
  self.class == o.class &&
161
196
  action == o.action &&
197
+ listing_id == o.listing_id &&
162
198
  property_id == o.property_id &&
199
+ room_id == o.room_id &&
200
+ legal_entity_id == o.legal_entity_id &&
201
+ legal_entity == o.legal_entity &&
163
202
  leid == o.leid &&
164
203
  contacts == o.contacts
165
204
  end
@@ -173,7 +212,7 @@ module Repull
173
212
  # Calculates hash code according to all attributes.
174
213
  # @return [Integer] Hash code
175
214
  def hash
176
- [action, property_id, leid, contacts].hash
215
+ [action, listing_id, property_id, room_id, legal_entity_id, legal_entity, leid, contacts].hash
177
216
  end
178
217
 
179
218
  # Builds the object from hash