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,221 @@
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
+ # The per-item result of a fan-out. **There is deliberately no top-level success flag**: a listing can sit on two Airbnb connections and a Booking.com property, they fail independently, and partial success is the ordinary outcome — any single boolean would be wrong for exactly the calls that need reading. Walk `channels` and check each `ok`. Nothing here is rolled back. What landed stays landed; re-send the same request to retry the items that did not, which is safe.
18
+ class ListingMarketStateResponse < ApiModelBase
19
+ attr_accessor :listing_id
20
+
21
+ # The state you asked for. Compare each item's own `state` against it.
22
+ attr_accessor :state
23
+
24
+ # One entry per channel item acted on — Airbnb connections first, then the Booking.com property. Never empty: a listing connected to nothing is refused with `422 no_connected_channels` rather than answered with an empty array.
25
+ attr_accessor :channels
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'listing_id' => :'listingId',
31
+ :'state' => :'state',
32
+ :'channels' => :'channels'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'listing_id' => :'String',
50
+ :'state' => :'String',
51
+ :'channels' => :'Array<ChannelMarketStateItem>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingMarketStateResponse` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingMarketStateResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'listing_id')
78
+ self.listing_id = attributes[:'listing_id']
79
+ else
80
+ self.listing_id = nil
81
+ end
82
+
83
+ if attributes.key?(:'state')
84
+ self.state = attributes[:'state']
85
+ else
86
+ self.state = nil
87
+ end
88
+
89
+ if attributes.key?(:'channels')
90
+ if (value = attributes[:'channels']).is_a?(Array)
91
+ self.channels = value
92
+ end
93
+ else
94
+ self.channels = nil
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ if @listing_id.nil?
104
+ invalid_properties.push('invalid value for "listing_id", listing_id cannot be nil.')
105
+ end
106
+
107
+ if @state.nil?
108
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
109
+ end
110
+
111
+ if @channels.nil?
112
+ invalid_properties.push('invalid value for "channels", channels cannot be nil.')
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ warn '[DEPRECATED] the `valid?` method is obsolete'
122
+ return false if @listing_id.nil?
123
+ return false if @state.nil?
124
+ return false if @channels.nil?
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] listing_id Value to be assigned
130
+ def listing_id=(listing_id)
131
+ if listing_id.nil?
132
+ fail ArgumentError, 'listing_id cannot be nil'
133
+ end
134
+
135
+ @listing_id = listing_id
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] state Value to be assigned
140
+ def state=(state)
141
+ if state.nil?
142
+ fail ArgumentError, 'state cannot be nil'
143
+ end
144
+
145
+ @state = state
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] channels Value to be assigned
150
+ def channels=(channels)
151
+ if channels.nil?
152
+ fail ArgumentError, 'channels cannot be nil'
153
+ end
154
+
155
+ @channels = channels
156
+ end
157
+
158
+ # Checks equality by comparing each attribute.
159
+ # @param [Object] Object to be compared
160
+ def ==(o)
161
+ return true if self.equal?(o)
162
+ self.class == o.class &&
163
+ listing_id == o.listing_id &&
164
+ state == o.state &&
165
+ channels == o.channels
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [listing_id, state, channels].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
+ end
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
199
+ end
200
+ new(transformed_hash)
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,149 @@
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
+ # Optional. Omit the body entirely when the listing is mapped to exactly one Booking.com property.
18
+ class ListingPublishBookingRequest < ApiModelBase
19
+ # Booking.com property to publish into. Required when this listing is mapped to more than one — without it the push is refused with `409 ambiguous_booking_mapping` rather than written into a property chosen for you. `GET /v1/channels/booking/properties` lists every property in the workspace with the listings mapped under it. `?hotel_id=` in the query string is accepted as well and means the same thing; the body wins if you send both.
20
+ attr_accessor :hotel_id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'hotel_id' => :'hotelId'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'hotel_id' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingPublishBookingRequest` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingPublishBookingRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'hotel_id')
69
+ self.hotel_id = attributes[:'hotel_id']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ hotel_id == o.hotel_id
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [hotel_id].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end
@@ -14,12 +14,11 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- class ListingPublishResponse < ApiModelBase
17
+ class ListingPublishBookingResponse < ApiModelBase
18
18
  attr_accessor :listing_id
19
19
 
20
20
  attr_accessor :channel
21
21
 
22
- # Channel-specific push result (sections pushed, errors, etc.)
23
22
  attr_accessor :result
24
23
 
25
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -46,7 +45,7 @@ module Repull
46
45
  {
47
46
  :'listing_id' => :'String',
48
47
  :'channel' => :'String',
49
- :'result' => :'Object'
48
+ :'result' => :'BookingPublishResult'
50
49
  }
51
50
  end
52
51
 
@@ -60,14 +59,14 @@ module Repull
60
59
  # @param [Hash] attributes Model attributes in the form of hash
61
60
  def initialize(attributes = {})
62
61
  if (!attributes.is_a?(Hash))
63
- fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingPublishResponse` initialize method"
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingPublishBookingResponse` initialize method"
64
63
  end
65
64
 
66
65
  # check to see if the attribute exists and convert string to symbol for hash key
67
66
  acceptable_attribute_map = self.class.acceptable_attribute_map
68
67
  attributes = attributes.each_with_object({}) { |(k, v), h|
69
68
  if (!acceptable_attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingPublishResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingPublishBookingResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
70
  end
72
71
  h[k.to_sym] = v
73
72
  }
@@ -14,11 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
+ # Sync activity for one channel. `pushStatus` says whether the last push landed; `pushError` says why it did not.
17
18
  class ListingPublishStatusChannel < ApiModelBase
18
19
  attr_accessor :platform
19
20
 
20
21
  attr_accessor :push_status
21
22
 
23
+ # Why the last push failed — the channel's own reason, verbatim, sanitised for display. This is the field to render when `pushStatus` is `error`. It carries what Airbnb or Booking.com actually objected to, which is almost always something the operator can fix in the listing content: `\"Airbnb error (400): We can't save your info yet. Links and contact info can't be shared.\"`, `\"Check-in start time must be before end time\"`, `\"property_type_group must be one of [apartments, houses, …]\"`, `\"Rate limited by provider\"`. **Free text, not an enum.** It is written by the channel and changes without notice: show it to a human, log it, put it next to the retry button — but never parse it or branch on its contents. When a push fails for several reasons at once the reasons are joined with `; `. `null` when the last push succeeded, and when no push has run yet — the two are told apart by `pushStatus` and `lastPushedAt`, not by this field.
24
+ attr_accessor :push_error
25
+
22
26
  attr_accessor :last_pushed_at
23
27
 
24
28
  attr_accessor :last_pulled_at
@@ -32,6 +36,7 @@ module Repull
32
36
  {
33
37
  :'platform' => :'platform',
34
38
  :'push_status' => :'pushStatus',
39
+ :'push_error' => :'pushError',
35
40
  :'last_pushed_at' => :'lastPushedAt',
36
41
  :'last_pulled_at' => :'lastPulledAt',
37
42
  :'dirty_fields' => :'dirtyFields',
@@ -54,6 +59,7 @@ module Repull
54
59
  {
55
60
  :'platform' => :'String',
56
61
  :'push_status' => :'String',
62
+ :'push_error' => :'String',
57
63
  :'last_pushed_at' => :'Time',
58
64
  :'last_pulled_at' => :'Time',
59
65
  :'dirty_fields' => :'Array<String>',
@@ -65,6 +71,7 @@ module Repull
65
71
  def self.openapi_nullable
66
72
  Set.new([
67
73
  :'push_status',
74
+ :'push_error',
68
75
  :'last_pushed_at',
69
76
  :'last_pulled_at',
70
77
  ])
@@ -88,12 +95,20 @@ module Repull
88
95
 
89
96
  if attributes.key?(:'platform')
90
97
  self.platform = attributes[:'platform']
98
+ else
99
+ self.platform = nil
91
100
  end
92
101
 
93
102
  if attributes.key?(:'push_status')
94
103
  self.push_status = attributes[:'push_status']
95
104
  end
96
105
 
106
+ if attributes.key?(:'push_error')
107
+ self.push_error = attributes[:'push_error']
108
+ else
109
+ self.push_error = nil
110
+ end
111
+
97
112
  if attributes.key?(:'last_pushed_at')
98
113
  self.last_pushed_at = attributes[:'last_pushed_at']
99
114
  end
@@ -118,6 +133,10 @@ module Repull
118
133
  def list_invalid_properties
119
134
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
135
  invalid_properties = Array.new
136
+ if @platform.nil?
137
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
138
+ end
139
+
121
140
  invalid_properties
122
141
  end
123
142
 
@@ -125,9 +144,20 @@ module Repull
125
144
  # @return true if the model is valid
126
145
  def valid?
127
146
  warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @platform.nil?
128
148
  true
129
149
  end
130
150
 
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] platform Value to be assigned
153
+ def platform=(platform)
154
+ if platform.nil?
155
+ fail ArgumentError, 'platform cannot be nil'
156
+ end
157
+
158
+ @platform = platform
159
+ end
160
+
131
161
  # Checks equality by comparing each attribute.
132
162
  # @param [Object] Object to be compared
133
163
  def ==(o)
@@ -135,6 +165,7 @@ module Repull
135
165
  self.class == o.class &&
136
166
  platform == o.platform &&
137
167
  push_status == o.push_status &&
168
+ push_error == o.push_error &&
138
169
  last_pushed_at == o.last_pushed_at &&
139
170
  last_pulled_at == o.last_pulled_at &&
140
171
  dirty_fields == o.dirty_fields &&
@@ -150,7 +181,7 @@ module Repull
150
181
  # Calculates hash code according to all attributes.
151
182
  # @return [Integer] Hash code
152
183
  def hash
153
- [platform, push_status, last_pushed_at, last_pulled_at, dirty_fields, platform_has_changes].hash
184
+ [platform, push_status, push_error, last_pushed_at, last_pulled_at, dirty_fields, platform_has_changes].hash
154
185
  end
155
186
 
156
187
  # Builds the object from hash
@@ -28,13 +28,17 @@ module Repull
28
28
  # ISO timestamp the connection was first established.
29
29
  attr_accessor :since
30
30
 
31
+ # 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
+ attr_accessor :locked_fields
33
+
31
34
  # Attribute mapping from ruby-style variable name to JSON key.
32
35
  def self.attribute_map
33
36
  {
34
37
  :'channel' => :'channel',
35
38
  :'connected' => :'connected',
36
39
  :'sync_enabled' => :'syncEnabled',
37
- :'since' => :'since'
40
+ :'since' => :'since',
41
+ :'locked_fields' => :'lockedFields'
38
42
  }
39
43
  end
40
44
 
@@ -54,14 +58,15 @@ module Repull
54
58
  :'channel' => :'String',
55
59
  :'connected' => :'Boolean',
56
60
  :'sync_enabled' => :'Boolean',
57
- :'since' => :'Time'
61
+ :'since' => :'Time',
62
+ :'locked_fields' => :'Array<String>'
58
63
  }
59
64
  end
60
65
 
61
66
  # List of attributes with nullable: true
62
67
  def self.openapi_nullable
63
68
  Set.new([
64
- :'since'
69
+ :'since',
65
70
  ])
66
71
  end
67
72
 
@@ -96,6 +101,12 @@ module Repull
96
101
  if attributes.key?(:'since')
97
102
  self.since = attributes[:'since']
98
103
  end
104
+
105
+ if attributes.key?(:'locked_fields')
106
+ if (value = attributes[:'locked_fields']).is_a?(Array)
107
+ self.locked_fields = value
108
+ end
109
+ end
99
110
  end
100
111
 
101
112
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -121,7 +132,8 @@ module Repull
121
132
  channel == o.channel &&
122
133
  connected == o.connected &&
123
134
  sync_enabled == o.sync_enabled &&
124
- since == o.since
135
+ since == o.since &&
136
+ locked_fields == o.locked_fields
125
137
  end
126
138
 
127
139
  # @see the `==` method
@@ -133,7 +145,7 @@ module Repull
133
145
  # Calculates hash code according to all attributes.
134
146
  # @return [Integer] Hash code
135
147
  def hash
136
- [channel, connected, sync_enabled, since].hash
148
+ [channel, connected, sync_enabled, since, locked_fields].hash
137
149
  end
138
150
 
139
151
  # Builds the object from hash
@@ -17,6 +17,9 @@ module Repull
17
17
  class ListingPublishStatusResponse < ApiModelBase
18
18
  attr_accessor :listing_id
19
19
 
20
+ # Address readiness per channel, keyed by channel name (`airbnb` today). Airbnb requires `street` and `city` for every country and additionally `state` and `postalCode` for a **US** property — and a listing with no `countryCode` behaves as US. Check this BEFORE calling a publish endpoint: an incomplete address is refused at the create preflight and never reaches the channel. It sits here rather than inside `channels[]` because `channels` reports sync activity and is empty for a listing that has never been pushed — exactly the listing whose address blocker you need to see. Repair a gap with `PUT /v1/listings/{id}/content`, sending only the missing parts under `address`. An empty object means readiness was not reported; it never means ready.
21
+ attr_accessor :address_readiness
22
+
20
23
  # Sync activity per channel — empty if the listing has never been pushed/pulled. Empty does NOT mean \"not connected\"; check `connections` for that.
21
24
  attr_accessor :channels
22
25
 
@@ -27,6 +30,7 @@ module Repull
27
30
  def self.attribute_map
28
31
  {
29
32
  :'listing_id' => :'listingId',
33
+ :'address_readiness' => :'addressReadiness',
30
34
  :'channels' => :'channels',
31
35
  :'connections' => :'connections'
32
36
  }
@@ -46,6 +50,7 @@ module Repull
46
50
  def self.openapi_types
47
51
  {
48
52
  :'listing_id' => :'String',
53
+ :'address_readiness' => :'Hash<String, ListingAddressReadiness>',
49
54
  :'channels' => :'Array<ListingPublishStatusChannel>',
50
55
  :'connections' => :'Array<ListingPublishStatusConnection>'
51
56
  }
@@ -77,6 +82,12 @@ module Repull
77
82
  self.listing_id = attributes[:'listing_id']
78
83
  end
79
84
 
85
+ if attributes.key?(:'address_readiness')
86
+ if (value = attributes[:'address_readiness']).is_a?(Hash)
87
+ self.address_readiness = value
88
+ end
89
+ end
90
+
80
91
  if attributes.key?(:'channels')
81
92
  if (value = attributes[:'channels']).is_a?(Array)
82
93
  self.channels = value
@@ -111,6 +122,7 @@ module Repull
111
122
  return true if self.equal?(o)
112
123
  self.class == o.class &&
113
124
  listing_id == o.listing_id &&
125
+ address_readiness == o.address_readiness &&
114
126
  channels == o.channels &&
115
127
  connections == o.connections
116
128
  end
@@ -124,7 +136,7 @@ module Repull
124
136
  # Calculates hash code according to all attributes.
125
137
  # @return [Integer] Hash code
126
138
  def hash
127
- [listing_id, channels, connections].hash
139
+ [listing_id, address_readiness, channels, connections].hash
128
140
  end
129
141
 
130
142
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Repull
17
- # Payload for `reservation.request.updated`. A booking request stopped waiting on the host. `requestStatus` says how; `data.object` is the reservation after the change (`status` `confirmed` once accepted, `cancelled` otherwise). An accepted request also fires `reservation.created`. Fires when the channel reports the outcome, whoever acted — the API, the Vanio dashboard or the channel's own app.
17
+ # Payload for `reservation.request.updated`. A booking request stopped waiting on the host. `requestStatus` says how; `data.object` is the reservation after the change (`status` `confirmed` once accepted, `cancelled` otherwise). An accepted request also fires `reservation.created`. Fires when the channel reports the outcome, whoever acted — the API, a connected app or the channel's own app.
18
18
  class ReservationRequestUpdatedPayload < ApiModelBase
19
19
  attr_accessor :object
20
20
 
@@ -11,5 +11,5 @@ Generator version: 7.22.0
11
11
  =end
12
12
 
13
13
  module Repull
14
- VERSION = '0.2.16'
14
+ VERSION = '0.2.17'
15
15
  end