repull 0.2.14 → 0.2.15

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 (110) hide show
  1. checksums.yaml +4 -4
  2. data/lib/repull/api/airbnb_api.rb +1265 -125
  3. data/lib/repull/api/availability_api.rb +2 -2
  4. data/lib/repull/api/connect_api.rb +4 -4
  5. data/lib/repull/api/listings_api.rb +97 -13
  6. data/lib/repull/models/airbnb_account_freshness.rb +239 -0
  7. data/lib/repull/models/airbnb_alteration.rb +46 -2
  8. data/lib/repull/models/airbnb_alteration_create_request.rb +264 -0
  9. data/lib/repull/models/airbnb_connection.rb +69 -2
  10. data/lib/repull/models/airbnb_connection_host.rb +1 -1
  11. data/lib/repull/models/airbnb_content_write_response.rb +275 -0
  12. data/lib/repull/models/airbnb_data_freshness.rb +22 -10
  13. data/lib/repull/models/{create_airbnb_alteration_request.rb → airbnb_description_write_request.rb} +44 -47
  14. data/lib/repull/models/airbnb_description_write_request_description.rb +365 -0
  15. data/lib/repull/models/airbnb_listing.rb +12 -1
  16. data/lib/repull/models/airbnb_listing_action200_response.rb +105 -0
  17. data/lib/repull/models/airbnb_listing_action200_response_one_of.rb +157 -0
  18. data/lib/repull/models/airbnb_listing_action200_response_one_of1.rb +175 -0
  19. data/lib/repull/models/airbnb_listing_action_request.rb +2 -2
  20. data/lib/repull/models/airbnb_listing_details_response.rb +284 -0
  21. data/lib/repull/models/airbnb_listing_details_write_request.rb +209 -0
  22. data/lib/repull/models/airbnb_listing_details_write_request_check_in_option.rb +214 -0
  23. data/lib/repull/models/airbnb_listing_details_write_request_quiet_hours_inner.rb +190 -0
  24. data/lib/repull/models/airbnb_listing_lifecycle_response.rb +196 -0
  25. data/lib/repull/models/airbnb_permits_response.rb +163 -0
  26. data/lib/repull/models/airbnb_permits_response_cached_inner.rb +200 -0
  27. data/lib/repull/models/airbnb_permits_write_request.rb +176 -0
  28. data/lib/repull/models/airbnb_permits_write_request_permits_inner.rb +228 -0
  29. data/lib/repull/models/airbnb_permits_write_request_permits_inner_answers_inner.rb +198 -0
  30. data/lib/repull/models/airbnb_photo_position.rb +159 -0
  31. data/lib/repull/models/airbnb_publish_result.rb +263 -0
  32. data/lib/repull/models/airbnb_reservation.rb +23 -1
  33. data/lib/repull/models/airbnb_reservation_list_response.rb +13 -4
  34. data/lib/repull/models/airbnb_review.rb +23 -1
  35. data/lib/repull/models/airbnb_review_list_response.rb +13 -4
  36. data/lib/repull/models/airbnb_safety_disclosure.rb +202 -0
  37. data/lib/repull/models/airbnb_safety_disclosures_response.rb +162 -0
  38. data/lib/repull/models/airbnb_safety_disclosures_write_request.rb +176 -0
  39. data/lib/repull/models/airbnb_thread.rb +23 -1
  40. data/lib/repull/models/airbnb_thread_list_response.rb +13 -4
  41. data/lib/repull/models/airbnb_transaction.rb +23 -1
  42. data/lib/repull/models/create_airbnb_listing_room_request.rb +315 -0
  43. data/lib/repull/models/delete_airbnb_listing_photo200_response.rb +14 -4
  44. data/lib/repull/models/delete_airbnb_listing_room200_response.rb +157 -0
  45. data/lib/repull/models/error_error.rb +31 -1
  46. data/lib/repull/models/get_airbnb_booking_settings200_response.rb +190 -0
  47. data/lib/repull/models/get_airbnb_booking_settings200_response_data.rb +246 -0
  48. data/lib/repull/models/get_airbnb_booking_settings200_response_data_advance_notice.rb +172 -0
  49. data/lib/repull/models/get_airbnb_booking_settings200_response_data_booking_window.rb +160 -0
  50. data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation.rb +203 -0
  51. data/lib/repull/models/get_airbnb_booking_settings200_response_data_cancellation_non_refundable.rb +218 -0
  52. data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in.rb +159 -0
  53. data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_in_start.rb +104 -0
  54. data/lib/repull/models/get_airbnb_booking_settings200_response_data_check_out.rb +172 -0
  55. data/lib/repull/models/get_airbnb_booking_settings200_response_data_instant_book.rb +206 -0
  56. data/lib/repull/models/get_airbnb_booking_settings200_response_data_preparation_time.rb +173 -0
  57. data/lib/repull/models/get_airbnb_listing_details200_response.rb +192 -0
  58. data/lib/repull/models/list_airbnb_listing_permits200_response.rb +190 -0
  59. data/lib/repull/models/list_airbnb_listing_safety_disclosures200_response.rb +190 -0
  60. data/lib/repull/models/listing.rb +2 -1
  61. data/lib/repull/models/listing_content.rb +13 -2
  62. data/lib/repull/models/listing_content_update_request.rb +21 -2
  63. data/lib/repull/models/listing_content_update_request_details.rb +206 -0
  64. data/lib/repull/models/listing_content_update_request_policies.rb +95 -5
  65. data/lib/repull/models/listing_content_update_response.rb +1 -1
  66. data/lib/repull/models/listing_publish_airbnb_response.rb +165 -0
  67. data/lib/repull/models/listing_pull_airbnb_request.rb +149 -0
  68. data/lib/repull/models/listing_pull_response.rb +231 -0
  69. data/lib/repull/models/publish_section_error.rb +232 -0
  70. data/lib/repull/models/reorder_airbnb_listing_photos200_response.rb +191 -0
  71. data/lib/repull/models/reorder_airbnb_listing_photos200_response_data.rb +172 -0
  72. data/lib/repull/models/reorder_airbnb_listing_photos_request.rb +185 -0
  73. data/lib/repull/models/reservation.rb +23 -1
  74. data/lib/repull/models/reservation_webhook_object.rb +38 -5
  75. data/lib/repull/models/set_airbnb_listing_cover_photo200_response.rb +191 -0
  76. data/lib/repull/models/set_airbnb_listing_cover_photo200_response_data.rb +171 -0
  77. data/lib/repull/models/set_airbnb_listing_cover_photo_request.rb +165 -0
  78. data/lib/repull/models/update_airbnb_booking_settings200_response.rb +164 -0
  79. data/lib/repull/models/update_airbnb_booking_settings200_response_data.rb +205 -0
  80. data/lib/repull/models/update_airbnb_booking_settings_request.rb +202 -0
  81. data/lib/repull/models/update_airbnb_booking_settings_request_advance_notice.rb +183 -0
  82. data/lib/repull/models/update_airbnb_booking_settings_request_booking_window.rb +183 -0
  83. data/lib/repull/models/update_airbnb_booking_settings_request_cancellation.rb +201 -0
  84. data/lib/repull/models/update_airbnb_booking_settings_request_cancellation_non_refundable.rb +183 -0
  85. data/lib/repull/models/update_airbnb_booking_settings_request_check_in.rb +159 -0
  86. data/lib/repull/models/update_airbnb_booking_settings_request_check_out.rb +182 -0
  87. data/lib/repull/models/update_airbnb_booking_settings_request_instant_book.rb +203 -0
  88. data/lib/repull/models/update_airbnb_booking_settings_request_preparation_time.rb +182 -0
  89. data/lib/repull/models/update_airbnb_listing_amenities200_response.rb +191 -0
  90. data/lib/repull/models/update_airbnb_listing_amenities200_response_data.rb +158 -0
  91. data/lib/repull/models/update_airbnb_listing_amenities_request.rb +199 -0
  92. data/lib/repull/models/update_airbnb_listing_amenities_request_accessibility_amenities_inner.rb +246 -0
  93. data/lib/repull/models/update_airbnb_listing_amenities_request_amenities_inner.rb +218 -0
  94. data/lib/repull/models/update_airbnb_listing_permits200_response.rb +168 -0
  95. data/lib/repull/models/update_airbnb_listing_photo200_response.rb +194 -0
  96. data/lib/repull/models/update_airbnb_listing_photo_request.rb +242 -0
  97. data/lib/repull/models/update_airbnb_listing_room200_response.rb +194 -0
  98. data/lib/repull/models/update_airbnb_listing_room_request.rb +293 -0
  99. data/lib/repull/models/update_airbnb_listing_room_request_beds_inner.rb +209 -0
  100. data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner.rb +182 -0
  101. data/lib/repull/models/update_airbnb_listing_room_request_room_amenities_inner_value.rb +105 -0
  102. data/lib/repull/models/update_airbnb_listing_safety_disclosures200_response.rb +180 -0
  103. data/lib/repull/models/upload_airbnb_listing_photos_request.rb +184 -0
  104. data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner.rb +305 -0
  105. data/lib/repull/models/upload_airbnb_listing_photos_request_photos_inner_listing_id.rb +105 -0
  106. data/lib/repull/version.rb +1 -1
  107. data/lib/repull.rb +78 -1
  108. data/openapi/v1.json +4523 -1282
  109. data/scripts/regen.sh +1 -1
  110. metadata +80 -3
@@ -0,0 +1,159 @@
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 photo's position in the tour. `sortOrder` is a relative sort key, not an address — lower sorts earlier.
18
+ class AirbnbPhotoPosition < ApiModelBase
19
+ # Airbnb-side photo id.
20
+ attr_accessor :photo_id
21
+
22
+ # Position in the tour, 1 first.
23
+ attr_accessor :sort_order
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'photo_id' => :'photoId',
29
+ :'sort_order' => :'sortOrder'
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
+ :'photo_id' => :'String',
47
+ :'sort_order' => :'Integer'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::AirbnbPhotoPosition` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::AirbnbPhotoPosition`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'photo_id')
74
+ self.photo_id = attributes[:'photo_id']
75
+ end
76
+
77
+ if attributes.key?(:'sort_order')
78
+ self.sort_order = attributes[:'sort_order']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ photo_id == o.photo_id &&
103
+ sort_order == o.sort_order
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [photo_id, sort_order].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Returns the object in the form of hash
142
+ # @return [Hash] Returns the object in the form of hash
143
+ def to_hash
144
+ hash = {}
145
+ self.class.attribute_map.each_pair do |attr, param|
146
+ value = self.send(attr)
147
+ if value.nil?
148
+ is_nullable = self.class.openapi_nullable.include?(attr)
149
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
150
+ end
151
+
152
+ hash[param] = _to_hash(value)
153
+ end
154
+ hash
155
+ end
156
+
157
+ end
158
+
159
+ end
@@ -0,0 +1,263 @@
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 Airbnb: it is up to eight independent ones (details, description, amenities, rooms, policies, photos, pricing, checkout_tasks), each of which can fail on its own. A PARTIAL publish is normal — what succeeded stays applied; there is no rollback.
18
+ class AirbnbPublishResult < ApiModelBase
19
+ # True only when EVERY attempted section reached Airbnb.
20
+ attr_accessor :published
21
+
22
+ # Sections that landed on Airbnb.
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 (no connection, address missing, subscription gate).
29
+ attr_accessor :reason
30
+
31
+ # Fields Airbnb will not let this listing change — collected from the failures above and from the `locked_attributes` Airbnb recorded for the listing. Sending them again returns success and changes nothing.
32
+ attr_accessor :locked_fields
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
+ :'locked_fields' => :'lockedFields'
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<PublishSectionError>',
61
+ :'reason' => :'String',
62
+ :'locked_fields' => :'Array<String>'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
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::AirbnbPublishResult` 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::AirbnbPublishResult`. 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?(:'published')
89
+ self.published = attributes[:'published']
90
+ else
91
+ self.published = nil
92
+ end
93
+
94
+ if attributes.key?(:'sections')
95
+ if (value = attributes[:'sections']).is_a?(Array)
96
+ self.sections = value
97
+ end
98
+ else
99
+ self.sections = nil
100
+ end
101
+
102
+ if attributes.key?(:'errors')
103
+ if (value = attributes[:'errors']).is_a?(Array)
104
+ self.errors = value
105
+ end
106
+ else
107
+ self.errors = nil
108
+ end
109
+
110
+ if attributes.key?(:'reason')
111
+ self.reason = attributes[:'reason']
112
+ end
113
+
114
+ if attributes.key?(:'locked_fields')
115
+ if (value = attributes[:'locked_fields']).is_a?(Array)
116
+ self.locked_fields = value
117
+ end
118
+ else
119
+ self.locked_fields = nil
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @published.nil?
129
+ invalid_properties.push('invalid value for "published", published cannot be nil.')
130
+ end
131
+
132
+ if @sections.nil?
133
+ invalid_properties.push('invalid value for "sections", sections cannot be nil.')
134
+ end
135
+
136
+ if @errors.nil?
137
+ invalid_properties.push('invalid value for "errors", errors cannot be nil.')
138
+ end
139
+
140
+ if @locked_fields.nil?
141
+ invalid_properties.push('invalid value for "locked_fields", locked_fields cannot be nil.')
142
+ end
143
+
144
+ invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ warn '[DEPRECATED] the `valid?` method is obsolete'
151
+ return false if @published.nil?
152
+ return false if @sections.nil?
153
+ return false if @errors.nil?
154
+ return false if @locked_fields.nil?
155
+ true
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] published Value to be assigned
160
+ def published=(published)
161
+ if published.nil?
162
+ fail ArgumentError, 'published cannot be nil'
163
+ end
164
+
165
+ @published = published
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] sections Value to be assigned
170
+ def sections=(sections)
171
+ if sections.nil?
172
+ fail ArgumentError, 'sections cannot be nil'
173
+ end
174
+
175
+ @sections = sections
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] errors Value to be assigned
180
+ def errors=(errors)
181
+ if errors.nil?
182
+ fail ArgumentError, 'errors cannot be nil'
183
+ end
184
+
185
+ @errors = errors
186
+ end
187
+
188
+ # Custom attribute writer method with validation
189
+ # @param [Object] locked_fields Value to be assigned
190
+ def locked_fields=(locked_fields)
191
+ if locked_fields.nil?
192
+ fail ArgumentError, 'locked_fields cannot be nil'
193
+ end
194
+
195
+ @locked_fields = locked_fields
196
+ end
197
+
198
+ # Checks equality by comparing each attribute.
199
+ # @param [Object] Object to be compared
200
+ def ==(o)
201
+ return true if self.equal?(o)
202
+ self.class == o.class &&
203
+ published == o.published &&
204
+ sections == o.sections &&
205
+ errors == o.errors &&
206
+ reason == o.reason &&
207
+ locked_fields == o.locked_fields
208
+ end
209
+
210
+ # @see the `==` method
211
+ # @param [Object] Object to be compared
212
+ def eql?(o)
213
+ self == o
214
+ end
215
+
216
+ # Calculates hash code according to all attributes.
217
+ # @return [Integer] Hash code
218
+ def hash
219
+ [published, sections, errors, reason, locked_fields].hash
220
+ end
221
+
222
+ # Builds the object from hash
223
+ # @param [Hash] attributes Model attributes in the form of hash
224
+ # @return [Object] Returns the model itself
225
+ def self.build_from_hash(attributes)
226
+ return nil unless attributes.is_a?(Hash)
227
+ attributes = attributes.transform_keys(&:to_sym)
228
+ transformed_hash = {}
229
+ openapi_types.each_pair do |key, type|
230
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
231
+ transformed_hash["#{key}"] = nil
232
+ elsif type =~ /\AArray<(.*)>/i
233
+ # check to ensure the input is an array given that the attribute
234
+ # is documented as an array but the input is not
235
+ if attributes[attribute_map[key]].is_a?(Array)
236
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
237
+ end
238
+ elsif !attributes[attribute_map[key]].nil?
239
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
240
+ end
241
+ end
242
+ new(transformed_hash)
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ end
262
+
263
+ end
@@ -20,6 +20,12 @@ module Repull
20
20
 
21
21
  attr_accessor :listing_id
22
22
 
23
+ # Which connected Airbnb account this row belongs to — the Airbnb host id, as a string (they exceed 2^53). The same value `?account_id=` accepts and `GET /v1/connect/airbnb` returns as `accounts[].externalAccountId`.
24
+ attr_accessor :account_id
25
+
26
+ # Display name of that connected Airbnb account.
27
+ attr_accessor :account_name
28
+
23
29
  attr_accessor :status
24
30
 
25
31
  attr_accessor :check_in
@@ -39,6 +45,8 @@ module Repull
39
45
  {
40
46
  :'confirmation_code' => :'confirmationCode',
41
47
  :'listing_id' => :'listingId',
48
+ :'account_id' => :'accountId',
49
+ :'account_name' => :'accountName',
42
50
  :'status' => :'status',
43
51
  :'check_in' => :'checkIn',
44
52
  :'check_out' => :'checkOut',
@@ -64,6 +72,8 @@ module Repull
64
72
  {
65
73
  :'confirmation_code' => :'String',
66
74
  :'listing_id' => :'String',
75
+ :'account_id' => :'String',
76
+ :'account_name' => :'String',
67
77
  :'status' => :'String',
68
78
  :'check_in' => :'Date',
69
79
  :'check_out' => :'Date',
@@ -77,6 +87,8 @@ module Repull
77
87
  # List of attributes with nullable: true
78
88
  def self.openapi_nullable
79
89
  Set.new([
90
+ :'account_id',
91
+ :'account_name',
80
92
  :'guest_name',
81
93
  :'guest_count',
82
94
  :'total_price',
@@ -108,6 +120,14 @@ module Repull
108
120
  self.listing_id = attributes[:'listing_id']
109
121
  end
110
122
 
123
+ if attributes.key?(:'account_id')
124
+ self.account_id = attributes[:'account_id']
125
+ end
126
+
127
+ if attributes.key?(:'account_name')
128
+ self.account_name = attributes[:'account_name']
129
+ end
130
+
111
131
  if attributes.key?(:'status')
112
132
  self.status = attributes[:'status']
113
133
  end
@@ -159,6 +179,8 @@ module Repull
159
179
  self.class == o.class &&
160
180
  confirmation_code == o.confirmation_code &&
161
181
  listing_id == o.listing_id &&
182
+ account_id == o.account_id &&
183
+ account_name == o.account_name &&
162
184
  status == o.status &&
163
185
  check_in == o.check_in &&
164
186
  check_out == o.check_out &&
@@ -177,7 +199,7 @@ module Repull
177
199
  # Calculates hash code according to all attributes.
178
200
  # @return [Integer] Hash code
179
201
  def hash
180
- [confirmation_code, listing_id, status, check_in, check_out, guest_name, guest_count, total_price, currency].hash
202
+ [confirmation_code, listing_id, account_id, account_name, status, check_in, check_out, guest_name, guest_count, total_price, currency].hash
181
203
  end
182
204
 
183
205
  # Builds the object from hash
@@ -20,11 +20,14 @@ module Repull
20
20
 
21
21
  attr_accessor :pagination
22
22
 
23
+ attr_accessor :data_freshness
24
+
23
25
  # Attribute mapping from ruby-style variable name to JSON key.
24
26
  def self.attribute_map
25
27
  {
26
28
  :'data' => :'data',
27
- :'pagination' => :'pagination'
29
+ :'pagination' => :'pagination',
30
+ :'data_freshness' => :'dataFreshness'
28
31
  }
29
32
  end
30
33
 
@@ -42,7 +45,8 @@ module Repull
42
45
  def self.openapi_types
43
46
  {
44
47
  :'data' => :'Array<AirbnbReservation>',
45
- :'pagination' => :'Pagination'
48
+ :'pagination' => :'Pagination',
49
+ :'data_freshness' => :'AirbnbDataFreshness'
46
50
  }
47
51
  end
48
52
 
@@ -77,6 +81,10 @@ module Repull
77
81
  if attributes.key?(:'pagination')
78
82
  self.pagination = attributes[:'pagination']
79
83
  end
84
+
85
+ if attributes.key?(:'data_freshness')
86
+ self.data_freshness = attributes[:'data_freshness']
87
+ end
80
88
  end
81
89
 
82
90
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -100,7 +108,8 @@ module Repull
100
108
  return true if self.equal?(o)
101
109
  self.class == o.class &&
102
110
  data == o.data &&
103
- pagination == o.pagination
111
+ pagination == o.pagination &&
112
+ data_freshness == o.data_freshness
104
113
  end
105
114
 
106
115
  # @see the `==` method
@@ -112,7 +121,7 @@ module Repull
112
121
  # Calculates hash code according to all attributes.
113
122
  # @return [Integer] Hash code
114
123
  def hash
115
- [data, pagination].hash
124
+ [data, pagination, data_freshness].hash
116
125
  end
117
126
 
118
127
  # Builds the object from hash
@@ -20,6 +20,12 @@ module Repull
20
20
 
21
21
  attr_accessor :reservation_code
22
22
 
23
+ # Which connected Airbnb account this row belongs to — the Airbnb host id, as a string (they exceed 2^53). The same value `?account_id=` accepts and `GET /v1/connect/airbnb` returns as `accounts[].externalAccountId`.
24
+ attr_accessor :account_id
25
+
26
+ # Display name of that connected Airbnb account.
27
+ attr_accessor :account_name
28
+
23
29
  attr_accessor :rating
24
30
 
25
31
  attr_accessor :comment
@@ -33,6 +39,8 @@ module Repull
33
39
  {
34
40
  :'id' => :'id',
35
41
  :'reservation_code' => :'reservationCode',
42
+ :'account_id' => :'accountId',
43
+ :'account_name' => :'accountName',
36
44
  :'rating' => :'rating',
37
45
  :'comment' => :'comment',
38
46
  :'response' => :'response',
@@ -55,6 +63,8 @@ module Repull
55
63
  {
56
64
  :'id' => :'String',
57
65
  :'reservation_code' => :'String',
66
+ :'account_id' => :'String',
67
+ :'account_name' => :'String',
58
68
  :'rating' => :'Integer',
59
69
  :'comment' => :'String',
60
70
  :'response' => :'String',
@@ -66,6 +76,8 @@ module Repull
66
76
  def self.openapi_nullable
67
77
  Set.new([
68
78
  :'reservation_code',
79
+ :'account_id',
80
+ :'account_name',
69
81
  :'rating',
70
82
  :'comment',
71
83
  :'response',
@@ -97,6 +109,14 @@ module Repull
97
109
  self.reservation_code = attributes[:'reservation_code']
98
110
  end
99
111
 
112
+ if attributes.key?(:'account_id')
113
+ self.account_id = attributes[:'account_id']
114
+ end
115
+
116
+ if attributes.key?(:'account_name')
117
+ self.account_name = attributes[:'account_name']
118
+ end
119
+
100
120
  if attributes.key?(:'rating')
101
121
  self.rating = attributes[:'rating']
102
122
  end
@@ -160,6 +180,8 @@ module Repull
160
180
  self.class == o.class &&
161
181
  id == o.id &&
162
182
  reservation_code == o.reservation_code &&
183
+ account_id == o.account_id &&
184
+ account_name == o.account_name &&
163
185
  rating == o.rating &&
164
186
  comment == o.comment &&
165
187
  response == o.response &&
@@ -175,7 +197,7 @@ module Repull
175
197
  # Calculates hash code according to all attributes.
176
198
  # @return [Integer] Hash code
177
199
  def hash
178
- [id, reservation_code, rating, comment, response, created_at].hash
200
+ [id, reservation_code, account_id, account_name, rating, comment, response, created_at].hash
179
201
  end
180
202
 
181
203
  # Builds the object from hash
@@ -19,11 +19,14 @@ module Repull
19
19
 
20
20
  attr_accessor :pagination
21
21
 
22
+ attr_accessor :data_freshness
23
+
22
24
  # Attribute mapping from ruby-style variable name to JSON key.
23
25
  def self.attribute_map
24
26
  {
25
27
  :'data' => :'data',
26
- :'pagination' => :'pagination'
28
+ :'pagination' => :'pagination',
29
+ :'data_freshness' => :'dataFreshness'
27
30
  }
28
31
  end
29
32
 
@@ -41,7 +44,8 @@ module Repull
41
44
  def self.openapi_types
42
45
  {
43
46
  :'data' => :'Array<AirbnbReview>',
44
- :'pagination' => :'Pagination'
47
+ :'pagination' => :'Pagination',
48
+ :'data_freshness' => :'AirbnbDataFreshness'
45
49
  }
46
50
  end
47
51
 
@@ -76,6 +80,10 @@ module Repull
76
80
  if attributes.key?(:'pagination')
77
81
  self.pagination = attributes[:'pagination']
78
82
  end
83
+
84
+ if attributes.key?(:'data_freshness')
85
+ self.data_freshness = attributes[:'data_freshness']
86
+ end
79
87
  end
80
88
 
81
89
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -99,7 +107,8 @@ module Repull
99
107
  return true if self.equal?(o)
100
108
  self.class == o.class &&
101
109
  data == o.data &&
102
- pagination == o.pagination
110
+ pagination == o.pagination &&
111
+ data_freshness == o.data_freshness
103
112
  end
104
113
 
105
114
  # @see the `==` method
@@ -111,7 +120,7 @@ module Repull
111
120
  # Calculates hash code according to all attributes.
112
121
  # @return [Integer] Hash code
113
122
  def hash
114
- [data, pagination].hash
123
+ [data, pagination, data_freshness].hash
115
124
  end
116
125
 
117
126
  # Builds the object from hash