repull 0.2.0

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 (222) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +10 -0
  3. data/LICENSE +21 -0
  4. data/README.md +121 -0
  5. data/Rakefile +10 -0
  6. data/examples/connect_airbnb.rb +33 -0
  7. data/examples/quickstart.rb +22 -0
  8. data/lib/repull/api/ai_api.rb +86 -0
  9. data/lib/repull/api/airbnb_api.rb +1155 -0
  10. data/lib/repull/api/atlas_api.rb +194 -0
  11. data/lib/repull/api/availability_api.rb +167 -0
  12. data/lib/repull/api/billing_api.rb +139 -0
  13. data/lib/repull/api/booking_com_api.rb +617 -0
  14. data/lib/repull/api/connect_api.rb +672 -0
  15. data/lib/repull/api/conversations_api.rb +263 -0
  16. data/lib/repull/api/guests_api.rb +171 -0
  17. data/lib/repull/api/listings_api.rb +509 -0
  18. data/lib/repull/api/markets_api.rb +320 -0
  19. data/lib/repull/api/plumguide_api.rb +299 -0
  20. data/lib/repull/api/pricing_api.rb +453 -0
  21. data/lib/repull/api/properties_api.rb +166 -0
  22. data/lib/repull/api/reservations_api.rb +387 -0
  23. data/lib/repull/api/reviews_api.rb +208 -0
  24. data/lib/repull/api/schema_api.rb +347 -0
  25. data/lib/repull/api/system_api.rb +79 -0
  26. data/lib/repull/api/vrbo_api.rb +262 -0
  27. data/lib/repull/api/webhooks_api.rb +867 -0
  28. data/lib/repull/api_client.rb +397 -0
  29. data/lib/repull/api_error.rb +58 -0
  30. data/lib/repull/api_model_base.rb +88 -0
  31. data/lib/repull/configuration.rb +313 -0
  32. data/lib/repull/models/ai_operation.rb +158 -0
  33. data/lib/repull/models/airbnb_listing.rb +229 -0
  34. data/lib/repull/models/airbnb_listing_list_response.rb +158 -0
  35. data/lib/repull/models/airbnb_reservation.rb +224 -0
  36. data/lib/repull/models/airbnb_reservation_list_response.rb +158 -0
  37. data/lib/repull/models/airbnb_review.rb +222 -0
  38. data/lib/repull/models/airbnb_review_list_response.rb +158 -0
  39. data/lib/repull/models/airbnb_thread.rb +188 -0
  40. data/lib/repull/models/airbnb_thread_list_response.rb +158 -0
  41. data/lib/repull/models/booking_connect_listing_option.rb +201 -0
  42. data/lib/repull/models/booking_connect_room.rb +251 -0
  43. data/lib/repull/models/booking_connect_rooms_response.rb +274 -0
  44. data/lib/repull/models/booking_conversation.rb +178 -0
  45. data/lib/repull/models/booking_conversation_list_response.rb +158 -0
  46. data/lib/repull/models/booking_pricing_rate_update.rb +310 -0
  47. data/lib/repull/models/booking_pricing_rate_update_date_range.rb +190 -0
  48. data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +179 -0
  49. data/lib/repull/models/booking_pricing_response.rb +157 -0
  50. data/lib/repull/models/booking_pricing_update_request.rb +176 -0
  51. data/lib/repull/models/booking_pricing_update_response.rb +199 -0
  52. data/lib/repull/models/booking_property.rb +188 -0
  53. data/lib/repull/models/booking_property_list_response.rb +158 -0
  54. data/lib/repull/models/booking_room_mapping.rb +177 -0
  55. data/lib/repull/models/booking_verify_hotel_request.rb +193 -0
  56. data/lib/repull/models/booking_verify_hotel_response.rb +285 -0
  57. data/lib/repull/models/bulk_pricing_failure.rb +177 -0
  58. data/lib/repull/models/bulk_pricing_item.rb +202 -0
  59. data/lib/repull/models/bulk_pricing_request.rb +212 -0
  60. data/lib/repull/models/bulk_pricing_response.rb +170 -0
  61. data/lib/repull/models/calendar_day.rb +174 -0
  62. data/lib/repull/models/calendar_response.rb +149 -0
  63. data/lib/repull/models/connect_host.rb +194 -0
  64. data/lib/repull/models/connect_provider.rb +365 -0
  65. data/lib/repull/models/connect_provider_list_response.rb +149 -0
  66. data/lib/repull/models/connect_session.rb +228 -0
  67. data/lib/repull/models/connect_status.rb +207 -0
  68. data/lib/repull/models/connection.rb +195 -0
  69. data/lib/repull/models/connection_list_response.rb +158 -0
  70. data/lib/repull/models/conversation.rb +257 -0
  71. data/lib/repull/models/conversation_detail.rb +284 -0
  72. data/lib/repull/models/conversation_guest.rb +178 -0
  73. data/lib/repull/models/conversation_guest_contact.rb +174 -0
  74. data/lib/repull/models/conversation_host.rb +186 -0
  75. data/lib/repull/models/conversation_list_response.rb +159 -0
  76. data/lib/repull/models/conversation_message_attachment.rb +174 -0
  77. data/lib/repull/models/create_ai_operation200_response.rb +156 -0
  78. data/lib/repull/models/create_billing_checkout_request.rb +181 -0
  79. data/lib/repull/models/create_connect_session_request.rb +189 -0
  80. data/lib/repull/models/create_connection_request.rb +225 -0
  81. data/lib/repull/models/create_reservation_request.rb +313 -0
  82. data/lib/repull/models/create_webhook_request.rb +211 -0
  83. data/lib/repull/models/custom_schema.rb +303 -0
  84. data/lib/repull/models/custom_schema_create.rb +253 -0
  85. data/lib/repull/models/custom_schema_create_response.rb +300 -0
  86. data/lib/repull/models/custom_schema_delete_response.rb +164 -0
  87. data/lib/repull/models/custom_schema_list_response.rb +159 -0
  88. data/lib/repull/models/custom_schema_summary.rb +300 -0
  89. data/lib/repull/models/custom_schema_update.rb +199 -0
  90. data/lib/repull/models/error.rb +165 -0
  91. data/lib/repull/models/error_error.rb +357 -0
  92. data/lib/repull/models/error_error_support.rb +167 -0
  93. data/lib/repull/models/get_health200_response.rb +156 -0
  94. data/lib/repull/models/guest.rb +271 -0
  95. data/lib/repull/models/guest_contact.rb +186 -0
  96. data/lib/repull/models/guest_flag.rb +179 -0
  97. data/lib/repull/models/guest_list_response.rb +159 -0
  98. data/lib/repull/models/guest_note.rb +187 -0
  99. data/lib/repull/models/guest_profile.rb +337 -0
  100. data/lib/repull/models/guest_reservations_summary.rb +175 -0
  101. data/lib/repull/models/listing.rb +216 -0
  102. data/lib/repull/models/listing_address.rb +158 -0
  103. data/lib/repull/models/listing_channel.rb +176 -0
  104. data/lib/repull/models/listing_comp.rb +272 -0
  105. data/lib/repull/models/listing_comp_nightly.rb +166 -0
  106. data/lib/repull/models/listing_comp_ratings.rb +157 -0
  107. data/lib/repull/models/listing_comps_response.rb +197 -0
  108. data/lib/repull/models/listing_content.rb +249 -0
  109. data/lib/repull/models/listing_create_request.rb +364 -0
  110. data/lib/repull/models/listing_create_response.rb +148 -0
  111. data/lib/repull/models/listing_generate_content_request.rb +192 -0
  112. data/lib/repull/models/listing_generate_content_response.rb +165 -0
  113. data/lib/repull/models/listing_list_response.rb +158 -0
  114. data/lib/repull/models/listing_pricing_apply_request.rb +193 -0
  115. data/lib/repull/models/listing_pricing_apply_response.rb +169 -0
  116. data/lib/repull/models/listing_pricing_history_entry.rb +212 -0
  117. data/lib/repull/models/listing_pricing_history_response.rb +159 -0
  118. data/lib/repull/models/listing_pricing_recommendation.rb +269 -0
  119. data/lib/repull/models/listing_pricing_response.rb +187 -0
  120. data/lib/repull/models/listing_pricing_response_comp_summary.rb +178 -0
  121. data/lib/repull/models/listing_pricing_response_date_range.rb +156 -0
  122. data/lib/repull/models/listing_pricing_response_listing.rb +191 -0
  123. data/lib/repull/models/listing_pricing_strategy.rb +317 -0
  124. data/lib/repull/models/listing_pricing_strategy_input.rb +264 -0
  125. data/lib/repull/models/listing_publish_airbnb_request.rb +171 -0
  126. data/lib/repull/models/listing_publish_response.rb +166 -0
  127. data/lib/repull/models/listing_publish_status_channel.rb +197 -0
  128. data/lib/repull/models/listing_publish_status_response.rb +158 -0
  129. data/lib/repull/models/listing_quality_tier.rb +175 -0
  130. data/lib/repull/models/listing_segment.rb +229 -0
  131. data/lib/repull/models/listing_segment_recommendation.rb +170 -0
  132. data/lib/repull/models/listing_segments_response.rb +230 -0
  133. data/lib/repull/models/listing_segments_response_scope.rb +159 -0
  134. data/lib/repull/models/map_connect_booking_rooms_request.rb +202 -0
  135. data/lib/repull/models/map_connect_booking_rooms_response.rb +243 -0
  136. data/lib/repull/models/market_browse_category.rb +158 -0
  137. data/lib/repull/models/market_browse_entry.rb +197 -0
  138. data/lib/repull/models/market_browse_featured.rb +188 -0
  139. data/lib/repull/models/market_browse_response.rb +158 -0
  140. data/lib/repull/models/market_calendar_day.rb +257 -0
  141. data/lib/repull/models/market_calendar_day_events_inner.rb +177 -0
  142. data/lib/repull/models/market_calendar_response.rb +178 -0
  143. data/lib/repull/models/market_detail_response.rb +269 -0
  144. data/lib/repull/models/market_detail_response_price_distribution_inner.rb +186 -0
  145. data/lib/repull/models/market_detail_response_property_type_mix_inner.rb +166 -0
  146. data/lib/repull/models/market_detail_response_supply_trend_inner.rb +156 -0
  147. data/lib/repull/models/market_detail_response_top_comps.rb +187 -0
  148. data/lib/repull/models/market_event.rb +257 -0
  149. data/lib/repull/models/market_my_listing.rb +242 -0
  150. data/lib/repull/models/market_summary.rb +259 -0
  151. data/lib/repull/models/market_top_comp.rb +275 -0
  152. data/lib/repull/models/markets_overview_response.rb +219 -0
  153. data/lib/repull/models/markets_overview_response_browse.rb +173 -0
  154. data/lib/repull/models/markets_overview_response_subscriptions.rb +157 -0
  155. data/lib/repull/models/markets_overview_response_totals.rb +165 -0
  156. data/lib/repull/models/message.rb +289 -0
  157. data/lib/repull/models/message_list_response.rb +159 -0
  158. data/lib/repull/models/pagination.rb +188 -0
  159. data/lib/repull/models/plumguide_listing.rb +167 -0
  160. data/lib/repull/models/plumguide_listing_list_response.rb +158 -0
  161. data/lib/repull/models/property.rb +271 -0
  162. data/lib/repull/models/property_list_response.rb +158 -0
  163. data/lib/repull/models/reservation.rb +457 -0
  164. data/lib/repull/models/reservation_list_response.rb +159 -0
  165. data/lib/repull/models/review.rb +357 -0
  166. data/lib/repull/models/review_category.rb +169 -0
  167. data/lib/repull/models/review_list_response.rb +159 -0
  168. data/lib/repull/models/review_response.rb +158 -0
  169. data/lib/repull/models/rotate_webhook_secret200_response.rb +165 -0
  170. data/lib/repull/models/select_connect_provider_request.rb +165 -0
  171. data/lib/repull/models/select_provider_response.rb +176 -0
  172. data/lib/repull/models/test_webhook_request.rb +165 -0
  173. data/lib/repull/models/update_availability_request.rb +149 -0
  174. data/lib/repull/models/update_listing_pricing_strategy200_response.rb +147 -0
  175. data/lib/repull/models/update_reservation_request.rb +174 -0
  176. data/lib/repull/models/update_webhook_request.rb +211 -0
  177. data/lib/repull/models/vrbo_listing.rb +167 -0
  178. data/lib/repull/models/vrbo_listing_list_response.rb +158 -0
  179. data/lib/repull/models/vrbo_reservation.rb +185 -0
  180. data/lib/repull/models/vrbo_reservation_list_response.rb +158 -0
  181. data/lib/repull/models/webhook_delivery.rb +243 -0
  182. data/lib/repull/models/webhook_delivery_detail.rb +261 -0
  183. data/lib/repull/models/webhook_delivery_list_response.rb +158 -0
  184. data/lib/repull/models/webhook_event_catalog.rb +149 -0
  185. data/lib/repull/models/webhook_event_catalog_domains_inner.rb +167 -0
  186. data/lib/repull/models/webhook_event_catalog_domains_inner_events_inner.rb +183 -0
  187. data/lib/repull/models/webhook_list_response.rb +158 -0
  188. data/lib/repull/models/webhook_subscription.rb +294 -0
  189. data/lib/repull/version.rb +15 -0
  190. data/lib/repull.rb +217 -0
  191. data/openapi/v1.json +8923 -0
  192. data/repull.gemspec +43 -0
  193. data/scripts/regen.sh +55 -0
  194. data/spec/api/ai_api_spec.rb +47 -0
  195. data/spec/api/airbnb_api_spec.rb +238 -0
  196. data/spec/api/availability_api_spec.rb +62 -0
  197. data/spec/api/billing_api_spec.rb +57 -0
  198. data/spec/api/booking_com_api_spec.rb +115 -0
  199. data/spec/api/connect_api_spec.rb +82 -0
  200. data/spec/api/conversations_api_spec.rb +68 -0
  201. data/spec/api/guests_api_spec.rb +59 -0
  202. data/spec/api/plumguide_api_spec.rb +85 -0
  203. data/spec/api/properties_api_spec.rb +60 -0
  204. data/spec/api/reservations_api_spec.rb +97 -0
  205. data/spec/api/system_api_spec.rb +45 -0
  206. data/spec/api/vrbo_api_spec.rb +55 -0
  207. data/spec/api/webhooks_api_spec.rb +69 -0
  208. data/spec/models/ai_operation_spec.rb +46 -0
  209. data/spec/models/calendar_day_spec.rb +54 -0
  210. data/spec/models/connect_host_spec.rb +60 -0
  211. data/spec/models/connect_status_spec.rb +76 -0
  212. data/spec/models/connection_spec.rb +70 -0
  213. data/spec/models/conversation_spec.rb +66 -0
  214. data/spec/models/error_error_spec.rb +54 -0
  215. data/spec/models/error_spec.rb +36 -0
  216. data/spec/models/guest_spec.rb +72 -0
  217. data/spec/models/message_spec.rb +70 -0
  218. data/spec/models/property_spec.rb +114 -0
  219. data/spec/models/reservation_spec.rb +128 -0
  220. data/spec/models/webhook_subscription_spec.rb +60 -0
  221. data/spec/spec_helper.rb +111 -0
  222. metadata +337 -0
@@ -0,0 +1,317 @@
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_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
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
+ # Strategy that constrains the Atlas pricing model for one listing.
18
+ class ListingPricingStrategy < ApiModelBase
19
+ attr_accessor :id
20
+
21
+ attr_accessor :listing_id
22
+
23
+ attr_accessor :customer_id
24
+
25
+ # `recommend` surfaces suggestions; `auto` applies them on the next sync.
26
+ attr_accessor :mode
27
+
28
+ attr_accessor :min_price
29
+
30
+ attr_accessor :max_price
31
+
32
+ # Max day-over-day swing in %.
33
+ attr_accessor :max_daily_change_pct
34
+
35
+ # % bump applied on Fri/Sat.
36
+ attr_accessor :weekend_markup_pct
37
+
38
+ # Multiplier per ISO weekday key (0..6).
39
+ attr_accessor :day_of_week_multipliers
40
+
41
+ attr_accessor :target_occupancy_pct
42
+
43
+ attr_accessor :target_monthly_revenue
44
+
45
+ attr_accessor :owner_min_monthly_payout
46
+
47
+ attr_accessor :comp_position_target
48
+
49
+ # Extra adjustment vs comp median (-30..+30).
50
+ attr_accessor :comp_adjust_pct
51
+
52
+ attr_accessor :event_boost_enabled
53
+
54
+ attr_accessor :event_boost_max_pct
55
+
56
+ # true when no row exists yet and the response is server-side defaults.
57
+ attr_accessor :is_default
58
+
59
+ # Attribute mapping from ruby-style variable name to JSON key.
60
+ def self.attribute_map
61
+ {
62
+ :'id' => :'id',
63
+ :'listing_id' => :'listingId',
64
+ :'customer_id' => :'customerId',
65
+ :'mode' => :'mode',
66
+ :'min_price' => :'minPrice',
67
+ :'max_price' => :'maxPrice',
68
+ :'max_daily_change_pct' => :'maxDailyChangePct',
69
+ :'weekend_markup_pct' => :'weekendMarkupPct',
70
+ :'day_of_week_multipliers' => :'dayOfWeekMultipliers',
71
+ :'target_occupancy_pct' => :'targetOccupancyPct',
72
+ :'target_monthly_revenue' => :'targetMonthlyRevenue',
73
+ :'owner_min_monthly_payout' => :'ownerMinMonthlyPayout',
74
+ :'comp_position_target' => :'compPositionTarget',
75
+ :'comp_adjust_pct' => :'compAdjustPct',
76
+ :'event_boost_enabled' => :'eventBoostEnabled',
77
+ :'event_boost_max_pct' => :'eventBoostMaxPct',
78
+ :'is_default' => :'isDefault'
79
+ }
80
+ end
81
+
82
+ # Returns attribute mapping this model knows about
83
+ def self.acceptable_attribute_map
84
+ attribute_map
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ acceptable_attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'id' => :'String',
96
+ :'listing_id' => :'String',
97
+ :'customer_id' => :'String',
98
+ :'mode' => :'String',
99
+ :'min_price' => :'Float',
100
+ :'max_price' => :'Float',
101
+ :'max_daily_change_pct' => :'Float',
102
+ :'weekend_markup_pct' => :'Float',
103
+ :'day_of_week_multipliers' => :'Hash<String, Float>',
104
+ :'target_occupancy_pct' => :'Float',
105
+ :'target_monthly_revenue' => :'Float',
106
+ :'owner_min_monthly_payout' => :'Float',
107
+ :'comp_position_target' => :'String',
108
+ :'comp_adjust_pct' => :'Float',
109
+ :'event_boost_enabled' => :'Boolean',
110
+ :'event_boost_max_pct' => :'Float',
111
+ :'is_default' => :'Boolean'
112
+ }
113
+ end
114
+
115
+ # List of attributes with nullable: true
116
+ def self.openapi_nullable
117
+ Set.new([
118
+ :'id',
119
+ :'min_price',
120
+ :'max_price',
121
+ :'weekend_markup_pct',
122
+ :'target_occupancy_pct',
123
+ :'target_monthly_revenue',
124
+ :'owner_min_monthly_payout',
125
+ ])
126
+ end
127
+
128
+ # Initializes the object
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ def initialize(attributes = {})
131
+ if (!attributes.is_a?(Hash))
132
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingPricingStrategy` initialize method"
133
+ end
134
+
135
+ # check to see if the attribute exists and convert string to symbol for hash key
136
+ acceptable_attribute_map = self.class.acceptable_attribute_map
137
+ attributes = attributes.each_with_object({}) { |(k, v), h|
138
+ if (!acceptable_attribute_map.key?(k.to_sym))
139
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingPricingStrategy`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
140
+ end
141
+ h[k.to_sym] = v
142
+ }
143
+
144
+ if attributes.key?(:'id')
145
+ self.id = attributes[:'id']
146
+ end
147
+
148
+ if attributes.key?(:'listing_id')
149
+ self.listing_id = attributes[:'listing_id']
150
+ end
151
+
152
+ if attributes.key?(:'customer_id')
153
+ self.customer_id = attributes[:'customer_id']
154
+ end
155
+
156
+ if attributes.key?(:'mode')
157
+ self.mode = attributes[:'mode']
158
+ end
159
+
160
+ if attributes.key?(:'min_price')
161
+ self.min_price = attributes[:'min_price']
162
+ end
163
+
164
+ if attributes.key?(:'max_price')
165
+ self.max_price = attributes[:'max_price']
166
+ end
167
+
168
+ if attributes.key?(:'max_daily_change_pct')
169
+ self.max_daily_change_pct = attributes[:'max_daily_change_pct']
170
+ else
171
+ self.max_daily_change_pct = 15
172
+ end
173
+
174
+ if attributes.key?(:'weekend_markup_pct')
175
+ self.weekend_markup_pct = attributes[:'weekend_markup_pct']
176
+ end
177
+
178
+ if attributes.key?(:'day_of_week_multipliers')
179
+ if (value = attributes[:'day_of_week_multipliers']).is_a?(Hash)
180
+ self.day_of_week_multipliers = value
181
+ end
182
+ end
183
+
184
+ if attributes.key?(:'target_occupancy_pct')
185
+ self.target_occupancy_pct = attributes[:'target_occupancy_pct']
186
+ end
187
+
188
+ if attributes.key?(:'target_monthly_revenue')
189
+ self.target_monthly_revenue = attributes[:'target_monthly_revenue']
190
+ end
191
+
192
+ if attributes.key?(:'owner_min_monthly_payout')
193
+ self.owner_min_monthly_payout = attributes[:'owner_min_monthly_payout']
194
+ end
195
+
196
+ if attributes.key?(:'comp_position_target')
197
+ self.comp_position_target = attributes[:'comp_position_target']
198
+ else
199
+ self.comp_position_target = 'match'
200
+ end
201
+
202
+ if attributes.key?(:'comp_adjust_pct')
203
+ self.comp_adjust_pct = attributes[:'comp_adjust_pct']
204
+ else
205
+ self.comp_adjust_pct = 0
206
+ end
207
+
208
+ if attributes.key?(:'event_boost_enabled')
209
+ self.event_boost_enabled = attributes[:'event_boost_enabled']
210
+ else
211
+ self.event_boost_enabled = true
212
+ end
213
+
214
+ if attributes.key?(:'event_boost_max_pct')
215
+ self.event_boost_max_pct = attributes[:'event_boost_max_pct']
216
+ else
217
+ self.event_boost_max_pct = 30
218
+ end
219
+
220
+ if attributes.key?(:'is_default')
221
+ self.is_default = attributes[:'is_default']
222
+ end
223
+ end
224
+
225
+ # Show invalid properties with the reasons. Usually used together with valid?
226
+ # @return Array for valid properties with the reasons
227
+ def list_invalid_properties
228
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
229
+ invalid_properties = Array.new
230
+ invalid_properties
231
+ end
232
+
233
+ # Check to see if the all the properties in the model are valid
234
+ # @return true if the model is valid
235
+ def valid?
236
+ warn '[DEPRECATED] the `valid?` method is obsolete'
237
+ true
238
+ end
239
+
240
+ # Checks equality by comparing each attribute.
241
+ # @param [Object] Object to be compared
242
+ def ==(o)
243
+ return true if self.equal?(o)
244
+ self.class == o.class &&
245
+ id == o.id &&
246
+ listing_id == o.listing_id &&
247
+ customer_id == o.customer_id &&
248
+ mode == o.mode &&
249
+ min_price == o.min_price &&
250
+ max_price == o.max_price &&
251
+ max_daily_change_pct == o.max_daily_change_pct &&
252
+ weekend_markup_pct == o.weekend_markup_pct &&
253
+ day_of_week_multipliers == o.day_of_week_multipliers &&
254
+ target_occupancy_pct == o.target_occupancy_pct &&
255
+ target_monthly_revenue == o.target_monthly_revenue &&
256
+ owner_min_monthly_payout == o.owner_min_monthly_payout &&
257
+ comp_position_target == o.comp_position_target &&
258
+ comp_adjust_pct == o.comp_adjust_pct &&
259
+ event_boost_enabled == o.event_boost_enabled &&
260
+ event_boost_max_pct == o.event_boost_max_pct &&
261
+ is_default == o.is_default
262
+ end
263
+
264
+ # @see the `==` method
265
+ # @param [Object] Object to be compared
266
+ def eql?(o)
267
+ self == o
268
+ end
269
+
270
+ # Calculates hash code according to all attributes.
271
+ # @return [Integer] Hash code
272
+ def hash
273
+ [id, listing_id, customer_id, mode, min_price, max_price, max_daily_change_pct, weekend_markup_pct, day_of_week_multipliers, target_occupancy_pct, target_monthly_revenue, owner_min_monthly_payout, comp_position_target, comp_adjust_pct, event_boost_enabled, event_boost_max_pct, is_default].hash
274
+ end
275
+
276
+ # Builds the object from hash
277
+ # @param [Hash] attributes Model attributes in the form of hash
278
+ # @return [Object] Returns the model itself
279
+ def self.build_from_hash(attributes)
280
+ return nil unless attributes.is_a?(Hash)
281
+ attributes = attributes.transform_keys(&:to_sym)
282
+ transformed_hash = {}
283
+ openapi_types.each_pair do |key, type|
284
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
285
+ transformed_hash["#{key}"] = nil
286
+ elsif type =~ /\AArray<(.*)>/i
287
+ # check to ensure the input is an array given that the attribute
288
+ # is documented as an array but the input is not
289
+ if attributes[attribute_map[key]].is_a?(Array)
290
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
291
+ end
292
+ elsif !attributes[attribute_map[key]].nil?
293
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
294
+ end
295
+ end
296
+ new(transformed_hash)
297
+ end
298
+
299
+ # Returns the object in the form of hash
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_hash
302
+ hash = {}
303
+ self.class.attribute_map.each_pair do |attr, param|
304
+ value = self.send(attr)
305
+ if value.nil?
306
+ is_nullable = self.class.openapi_nullable.include?(attr)
307
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
308
+ end
309
+
310
+ hash[param] = _to_hash(value)
311
+ end
312
+ hash
313
+ end
314
+
315
+ end
316
+
317
+ end
@@ -0,0 +1,264 @@
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_test_YOUR_API_KEY ``` Sandbox keys start with `sk_test_`, production with `sk_live_`. ## 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`, `pro`, `enterprise`) are enforced separately and also surface as 429s; they include `tier`, `scope`, and `resets_at` fields.
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
+ # Same shape as `ListingPricingStrategy` minus the read-only fields. Send only fields you want to change.
18
+ class ListingPricingStrategyInput < ApiModelBase
19
+ attr_accessor :mode
20
+
21
+ attr_accessor :min_price
22
+
23
+ attr_accessor :max_price
24
+
25
+ attr_accessor :max_daily_change_pct
26
+
27
+ attr_accessor :weekend_markup_pct
28
+
29
+ attr_accessor :day_of_week_multipliers
30
+
31
+ attr_accessor :target_occupancy_pct
32
+
33
+ attr_accessor :target_monthly_revenue
34
+
35
+ attr_accessor :owner_min_monthly_payout
36
+
37
+ attr_accessor :comp_position_target
38
+
39
+ attr_accessor :comp_adjust_pct
40
+
41
+ attr_accessor :event_boost_enabled
42
+
43
+ attr_accessor :event_boost_max_pct
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'mode' => :'mode',
49
+ :'min_price' => :'minPrice',
50
+ :'max_price' => :'maxPrice',
51
+ :'max_daily_change_pct' => :'maxDailyChangePct',
52
+ :'weekend_markup_pct' => :'weekendMarkupPct',
53
+ :'day_of_week_multipliers' => :'dayOfWeekMultipliers',
54
+ :'target_occupancy_pct' => :'targetOccupancyPct',
55
+ :'target_monthly_revenue' => :'targetMonthlyRevenue',
56
+ :'owner_min_monthly_payout' => :'ownerMinMonthlyPayout',
57
+ :'comp_position_target' => :'compPositionTarget',
58
+ :'comp_adjust_pct' => :'compAdjustPct',
59
+ :'event_boost_enabled' => :'eventBoostEnabled',
60
+ :'event_boost_max_pct' => :'eventBoostMaxPct'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'mode' => :'String',
78
+ :'min_price' => :'Float',
79
+ :'max_price' => :'Float',
80
+ :'max_daily_change_pct' => :'Float',
81
+ :'weekend_markup_pct' => :'Float',
82
+ :'day_of_week_multipliers' => :'Hash<String, Float>',
83
+ :'target_occupancy_pct' => :'Float',
84
+ :'target_monthly_revenue' => :'Float',
85
+ :'owner_min_monthly_payout' => :'Float',
86
+ :'comp_position_target' => :'String',
87
+ :'comp_adjust_pct' => :'Float',
88
+ :'event_boost_enabled' => :'Boolean',
89
+ :'event_boost_max_pct' => :'Float'
90
+ }
91
+ end
92
+
93
+ # List of attributes with nullable: true
94
+ def self.openapi_nullable
95
+ Set.new([
96
+ :'min_price',
97
+ :'max_price',
98
+ :'weekend_markup_pct',
99
+ :'target_occupancy_pct',
100
+ :'target_monthly_revenue',
101
+ :'owner_min_monthly_payout',
102
+ ])
103
+ end
104
+
105
+ # Initializes the object
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ def initialize(attributes = {})
108
+ if (!attributes.is_a?(Hash))
109
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Repull::ListingPricingStrategyInput` initialize method"
110
+ end
111
+
112
+ # check to see if the attribute exists and convert string to symbol for hash key
113
+ acceptable_attribute_map = self.class.acceptable_attribute_map
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!acceptable_attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Repull::ListingPricingStrategyInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'mode')
122
+ self.mode = attributes[:'mode']
123
+ end
124
+
125
+ if attributes.key?(:'min_price')
126
+ self.min_price = attributes[:'min_price']
127
+ end
128
+
129
+ if attributes.key?(:'max_price')
130
+ self.max_price = attributes[:'max_price']
131
+ end
132
+
133
+ if attributes.key?(:'max_daily_change_pct')
134
+ self.max_daily_change_pct = attributes[:'max_daily_change_pct']
135
+ end
136
+
137
+ if attributes.key?(:'weekend_markup_pct')
138
+ self.weekend_markup_pct = attributes[:'weekend_markup_pct']
139
+ end
140
+
141
+ if attributes.key?(:'day_of_week_multipliers')
142
+ if (value = attributes[:'day_of_week_multipliers']).is_a?(Hash)
143
+ self.day_of_week_multipliers = value
144
+ end
145
+ end
146
+
147
+ if attributes.key?(:'target_occupancy_pct')
148
+ self.target_occupancy_pct = attributes[:'target_occupancy_pct']
149
+ end
150
+
151
+ if attributes.key?(:'target_monthly_revenue')
152
+ self.target_monthly_revenue = attributes[:'target_monthly_revenue']
153
+ end
154
+
155
+ if attributes.key?(:'owner_min_monthly_payout')
156
+ self.owner_min_monthly_payout = attributes[:'owner_min_monthly_payout']
157
+ end
158
+
159
+ if attributes.key?(:'comp_position_target')
160
+ self.comp_position_target = attributes[:'comp_position_target']
161
+ end
162
+
163
+ if attributes.key?(:'comp_adjust_pct')
164
+ self.comp_adjust_pct = attributes[:'comp_adjust_pct']
165
+ end
166
+
167
+ if attributes.key?(:'event_boost_enabled')
168
+ self.event_boost_enabled = attributes[:'event_boost_enabled']
169
+ end
170
+
171
+ if attributes.key?(:'event_boost_max_pct')
172
+ self.event_boost_max_pct = attributes[:'event_boost_max_pct']
173
+ end
174
+ end
175
+
176
+ # Show invalid properties with the reasons. Usually used together with valid?
177
+ # @return Array for valid properties with the reasons
178
+ def list_invalid_properties
179
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
180
+ invalid_properties = Array.new
181
+ invalid_properties
182
+ end
183
+
184
+ # Check to see if the all the properties in the model are valid
185
+ # @return true if the model is valid
186
+ def valid?
187
+ warn '[DEPRECATED] the `valid?` method is obsolete'
188
+ true
189
+ end
190
+
191
+ # Checks equality by comparing each attribute.
192
+ # @param [Object] Object to be compared
193
+ def ==(o)
194
+ return true if self.equal?(o)
195
+ self.class == o.class &&
196
+ mode == o.mode &&
197
+ min_price == o.min_price &&
198
+ max_price == o.max_price &&
199
+ max_daily_change_pct == o.max_daily_change_pct &&
200
+ weekend_markup_pct == o.weekend_markup_pct &&
201
+ day_of_week_multipliers == o.day_of_week_multipliers &&
202
+ target_occupancy_pct == o.target_occupancy_pct &&
203
+ target_monthly_revenue == o.target_monthly_revenue &&
204
+ owner_min_monthly_payout == o.owner_min_monthly_payout &&
205
+ comp_position_target == o.comp_position_target &&
206
+ comp_adjust_pct == o.comp_adjust_pct &&
207
+ event_boost_enabled == o.event_boost_enabled &&
208
+ event_boost_max_pct == o.event_boost_max_pct
209
+ end
210
+
211
+ # @see the `==` method
212
+ # @param [Object] Object to be compared
213
+ def eql?(o)
214
+ self == o
215
+ end
216
+
217
+ # Calculates hash code according to all attributes.
218
+ # @return [Integer] Hash code
219
+ def hash
220
+ [mode, min_price, max_price, max_daily_change_pct, weekend_markup_pct, day_of_week_multipliers, target_occupancy_pct, target_monthly_revenue, owner_min_monthly_payout, comp_position_target, comp_adjust_pct, event_boost_enabled, event_boost_max_pct].hash
221
+ end
222
+
223
+ # Builds the object from hash
224
+ # @param [Hash] attributes Model attributes in the form of hash
225
+ # @return [Object] Returns the model itself
226
+ def self.build_from_hash(attributes)
227
+ return nil unless attributes.is_a?(Hash)
228
+ attributes = attributes.transform_keys(&:to_sym)
229
+ transformed_hash = {}
230
+ openapi_types.each_pair do |key, type|
231
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
232
+ transformed_hash["#{key}"] = nil
233
+ elsif type =~ /\AArray<(.*)>/i
234
+ # check to ensure the input is an array given that the attribute
235
+ # is documented as an array but the input is not
236
+ if attributes[attribute_map[key]].is_a?(Array)
237
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
238
+ end
239
+ elsif !attributes[attribute_map[key]].nil?
240
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
241
+ end
242
+ end
243
+ new(transformed_hash)
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ end
263
+
264
+ end