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.
- checksums.yaml +7 -0
- data/Gemfile +10 -0
- data/LICENSE +21 -0
- data/README.md +121 -0
- data/Rakefile +10 -0
- data/examples/connect_airbnb.rb +33 -0
- data/examples/quickstart.rb +22 -0
- data/lib/repull/api/ai_api.rb +86 -0
- data/lib/repull/api/airbnb_api.rb +1155 -0
- data/lib/repull/api/atlas_api.rb +194 -0
- data/lib/repull/api/availability_api.rb +167 -0
- data/lib/repull/api/billing_api.rb +139 -0
- data/lib/repull/api/booking_com_api.rb +617 -0
- data/lib/repull/api/connect_api.rb +672 -0
- data/lib/repull/api/conversations_api.rb +263 -0
- data/lib/repull/api/guests_api.rb +171 -0
- data/lib/repull/api/listings_api.rb +509 -0
- data/lib/repull/api/markets_api.rb +320 -0
- data/lib/repull/api/plumguide_api.rb +299 -0
- data/lib/repull/api/pricing_api.rb +453 -0
- data/lib/repull/api/properties_api.rb +166 -0
- data/lib/repull/api/reservations_api.rb +387 -0
- data/lib/repull/api/reviews_api.rb +208 -0
- data/lib/repull/api/schema_api.rb +347 -0
- data/lib/repull/api/system_api.rb +79 -0
- data/lib/repull/api/vrbo_api.rb +262 -0
- data/lib/repull/api/webhooks_api.rb +867 -0
- data/lib/repull/api_client.rb +397 -0
- data/lib/repull/api_error.rb +58 -0
- data/lib/repull/api_model_base.rb +88 -0
- data/lib/repull/configuration.rb +313 -0
- data/lib/repull/models/ai_operation.rb +158 -0
- data/lib/repull/models/airbnb_listing.rb +229 -0
- data/lib/repull/models/airbnb_listing_list_response.rb +158 -0
- data/lib/repull/models/airbnb_reservation.rb +224 -0
- data/lib/repull/models/airbnb_reservation_list_response.rb +158 -0
- data/lib/repull/models/airbnb_review.rb +222 -0
- data/lib/repull/models/airbnb_review_list_response.rb +158 -0
- data/lib/repull/models/airbnb_thread.rb +188 -0
- data/lib/repull/models/airbnb_thread_list_response.rb +158 -0
- data/lib/repull/models/booking_connect_listing_option.rb +201 -0
- data/lib/repull/models/booking_connect_room.rb +251 -0
- data/lib/repull/models/booking_connect_rooms_response.rb +274 -0
- data/lib/repull/models/booking_conversation.rb +178 -0
- data/lib/repull/models/booking_conversation_list_response.rb +158 -0
- data/lib/repull/models/booking_pricing_rate_update.rb +310 -0
- data/lib/repull/models/booking_pricing_rate_update_date_range.rb +190 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +179 -0
- data/lib/repull/models/booking_pricing_response.rb +157 -0
- data/lib/repull/models/booking_pricing_update_request.rb +176 -0
- data/lib/repull/models/booking_pricing_update_response.rb +199 -0
- data/lib/repull/models/booking_property.rb +188 -0
- data/lib/repull/models/booking_property_list_response.rb +158 -0
- data/lib/repull/models/booking_room_mapping.rb +177 -0
- data/lib/repull/models/booking_verify_hotel_request.rb +193 -0
- data/lib/repull/models/booking_verify_hotel_response.rb +285 -0
- data/lib/repull/models/bulk_pricing_failure.rb +177 -0
- data/lib/repull/models/bulk_pricing_item.rb +202 -0
- data/lib/repull/models/bulk_pricing_request.rb +212 -0
- data/lib/repull/models/bulk_pricing_response.rb +170 -0
- data/lib/repull/models/calendar_day.rb +174 -0
- data/lib/repull/models/calendar_response.rb +149 -0
- data/lib/repull/models/connect_host.rb +194 -0
- data/lib/repull/models/connect_provider.rb +365 -0
- data/lib/repull/models/connect_provider_list_response.rb +149 -0
- data/lib/repull/models/connect_session.rb +228 -0
- data/lib/repull/models/connect_status.rb +207 -0
- data/lib/repull/models/connection.rb +195 -0
- data/lib/repull/models/connection_list_response.rb +158 -0
- data/lib/repull/models/conversation.rb +257 -0
- data/lib/repull/models/conversation_detail.rb +284 -0
- data/lib/repull/models/conversation_guest.rb +178 -0
- data/lib/repull/models/conversation_guest_contact.rb +174 -0
- data/lib/repull/models/conversation_host.rb +186 -0
- data/lib/repull/models/conversation_list_response.rb +159 -0
- data/lib/repull/models/conversation_message_attachment.rb +174 -0
- data/lib/repull/models/create_ai_operation200_response.rb +156 -0
- data/lib/repull/models/create_billing_checkout_request.rb +181 -0
- data/lib/repull/models/create_connect_session_request.rb +189 -0
- data/lib/repull/models/create_connection_request.rb +225 -0
- data/lib/repull/models/create_reservation_request.rb +313 -0
- data/lib/repull/models/create_webhook_request.rb +211 -0
- data/lib/repull/models/custom_schema.rb +303 -0
- data/lib/repull/models/custom_schema_create.rb +253 -0
- data/lib/repull/models/custom_schema_create_response.rb +300 -0
- data/lib/repull/models/custom_schema_delete_response.rb +164 -0
- data/lib/repull/models/custom_schema_list_response.rb +159 -0
- data/lib/repull/models/custom_schema_summary.rb +300 -0
- data/lib/repull/models/custom_schema_update.rb +199 -0
- data/lib/repull/models/error.rb +165 -0
- data/lib/repull/models/error_error.rb +357 -0
- data/lib/repull/models/error_error_support.rb +167 -0
- data/lib/repull/models/get_health200_response.rb +156 -0
- data/lib/repull/models/guest.rb +271 -0
- data/lib/repull/models/guest_contact.rb +186 -0
- data/lib/repull/models/guest_flag.rb +179 -0
- data/lib/repull/models/guest_list_response.rb +159 -0
- data/lib/repull/models/guest_note.rb +187 -0
- data/lib/repull/models/guest_profile.rb +337 -0
- data/lib/repull/models/guest_reservations_summary.rb +175 -0
- data/lib/repull/models/listing.rb +216 -0
- data/lib/repull/models/listing_address.rb +158 -0
- data/lib/repull/models/listing_channel.rb +176 -0
- data/lib/repull/models/listing_comp.rb +272 -0
- data/lib/repull/models/listing_comp_nightly.rb +166 -0
- data/lib/repull/models/listing_comp_ratings.rb +157 -0
- data/lib/repull/models/listing_comps_response.rb +197 -0
- data/lib/repull/models/listing_content.rb +249 -0
- data/lib/repull/models/listing_create_request.rb +364 -0
- data/lib/repull/models/listing_create_response.rb +148 -0
- data/lib/repull/models/listing_generate_content_request.rb +192 -0
- data/lib/repull/models/listing_generate_content_response.rb +165 -0
- data/lib/repull/models/listing_list_response.rb +158 -0
- data/lib/repull/models/listing_pricing_apply_request.rb +193 -0
- data/lib/repull/models/listing_pricing_apply_response.rb +169 -0
- data/lib/repull/models/listing_pricing_history_entry.rb +212 -0
- data/lib/repull/models/listing_pricing_history_response.rb +159 -0
- data/lib/repull/models/listing_pricing_recommendation.rb +269 -0
- data/lib/repull/models/listing_pricing_response.rb +187 -0
- data/lib/repull/models/listing_pricing_response_comp_summary.rb +178 -0
- data/lib/repull/models/listing_pricing_response_date_range.rb +156 -0
- data/lib/repull/models/listing_pricing_response_listing.rb +191 -0
- data/lib/repull/models/listing_pricing_strategy.rb +317 -0
- data/lib/repull/models/listing_pricing_strategy_input.rb +264 -0
- data/lib/repull/models/listing_publish_airbnb_request.rb +171 -0
- data/lib/repull/models/listing_publish_response.rb +166 -0
- data/lib/repull/models/listing_publish_status_channel.rb +197 -0
- data/lib/repull/models/listing_publish_status_response.rb +158 -0
- data/lib/repull/models/listing_quality_tier.rb +175 -0
- data/lib/repull/models/listing_segment.rb +229 -0
- data/lib/repull/models/listing_segment_recommendation.rb +170 -0
- data/lib/repull/models/listing_segments_response.rb +230 -0
- data/lib/repull/models/listing_segments_response_scope.rb +159 -0
- data/lib/repull/models/map_connect_booking_rooms_request.rb +202 -0
- data/lib/repull/models/map_connect_booking_rooms_response.rb +243 -0
- data/lib/repull/models/market_browse_category.rb +158 -0
- data/lib/repull/models/market_browse_entry.rb +197 -0
- data/lib/repull/models/market_browse_featured.rb +188 -0
- data/lib/repull/models/market_browse_response.rb +158 -0
- data/lib/repull/models/market_calendar_day.rb +257 -0
- data/lib/repull/models/market_calendar_day_events_inner.rb +177 -0
- data/lib/repull/models/market_calendar_response.rb +178 -0
- data/lib/repull/models/market_detail_response.rb +269 -0
- data/lib/repull/models/market_detail_response_price_distribution_inner.rb +186 -0
- data/lib/repull/models/market_detail_response_property_type_mix_inner.rb +166 -0
- data/lib/repull/models/market_detail_response_supply_trend_inner.rb +156 -0
- data/lib/repull/models/market_detail_response_top_comps.rb +187 -0
- data/lib/repull/models/market_event.rb +257 -0
- data/lib/repull/models/market_my_listing.rb +242 -0
- data/lib/repull/models/market_summary.rb +259 -0
- data/lib/repull/models/market_top_comp.rb +275 -0
- data/lib/repull/models/markets_overview_response.rb +219 -0
- data/lib/repull/models/markets_overview_response_browse.rb +173 -0
- data/lib/repull/models/markets_overview_response_subscriptions.rb +157 -0
- data/lib/repull/models/markets_overview_response_totals.rb +165 -0
- data/lib/repull/models/message.rb +289 -0
- data/lib/repull/models/message_list_response.rb +159 -0
- data/lib/repull/models/pagination.rb +188 -0
- data/lib/repull/models/plumguide_listing.rb +167 -0
- data/lib/repull/models/plumguide_listing_list_response.rb +158 -0
- data/lib/repull/models/property.rb +271 -0
- data/lib/repull/models/property_list_response.rb +158 -0
- data/lib/repull/models/reservation.rb +457 -0
- data/lib/repull/models/reservation_list_response.rb +159 -0
- data/lib/repull/models/review.rb +357 -0
- data/lib/repull/models/review_category.rb +169 -0
- data/lib/repull/models/review_list_response.rb +159 -0
- data/lib/repull/models/review_response.rb +158 -0
- data/lib/repull/models/rotate_webhook_secret200_response.rb +165 -0
- data/lib/repull/models/select_connect_provider_request.rb +165 -0
- data/lib/repull/models/select_provider_response.rb +176 -0
- data/lib/repull/models/test_webhook_request.rb +165 -0
- data/lib/repull/models/update_availability_request.rb +149 -0
- data/lib/repull/models/update_listing_pricing_strategy200_response.rb +147 -0
- data/lib/repull/models/update_reservation_request.rb +174 -0
- data/lib/repull/models/update_webhook_request.rb +211 -0
- data/lib/repull/models/vrbo_listing.rb +167 -0
- data/lib/repull/models/vrbo_listing_list_response.rb +158 -0
- data/lib/repull/models/vrbo_reservation.rb +185 -0
- data/lib/repull/models/vrbo_reservation_list_response.rb +158 -0
- data/lib/repull/models/webhook_delivery.rb +243 -0
- data/lib/repull/models/webhook_delivery_detail.rb +261 -0
- data/lib/repull/models/webhook_delivery_list_response.rb +158 -0
- data/lib/repull/models/webhook_event_catalog.rb +149 -0
- data/lib/repull/models/webhook_event_catalog_domains_inner.rb +167 -0
- data/lib/repull/models/webhook_event_catalog_domains_inner_events_inner.rb +183 -0
- data/lib/repull/models/webhook_list_response.rb +158 -0
- data/lib/repull/models/webhook_subscription.rb +294 -0
- data/lib/repull/version.rb +15 -0
- data/lib/repull.rb +217 -0
- data/openapi/v1.json +8923 -0
- data/repull.gemspec +43 -0
- data/scripts/regen.sh +55 -0
- data/spec/api/ai_api_spec.rb +47 -0
- data/spec/api/airbnb_api_spec.rb +238 -0
- data/spec/api/availability_api_spec.rb +62 -0
- data/spec/api/billing_api_spec.rb +57 -0
- data/spec/api/booking_com_api_spec.rb +115 -0
- data/spec/api/connect_api_spec.rb +82 -0
- data/spec/api/conversations_api_spec.rb +68 -0
- data/spec/api/guests_api_spec.rb +59 -0
- data/spec/api/plumguide_api_spec.rb +85 -0
- data/spec/api/properties_api_spec.rb +60 -0
- data/spec/api/reservations_api_spec.rb +97 -0
- data/spec/api/system_api_spec.rb +45 -0
- data/spec/api/vrbo_api_spec.rb +55 -0
- data/spec/api/webhooks_api_spec.rb +69 -0
- data/spec/models/ai_operation_spec.rb +46 -0
- data/spec/models/calendar_day_spec.rb +54 -0
- data/spec/models/connect_host_spec.rb +60 -0
- data/spec/models/connect_status_spec.rb +76 -0
- data/spec/models/connection_spec.rb +70 -0
- data/spec/models/conversation_spec.rb +66 -0
- data/spec/models/error_error_spec.rb +54 -0
- data/spec/models/error_spec.rb +36 -0
- data/spec/models/guest_spec.rb +72 -0
- data/spec/models/message_spec.rb +70 -0
- data/spec/models/property_spec.rb +114 -0
- data/spec/models/reservation_spec.rb +128 -0
- data/spec/models/webhook_subscription_spec.rb +60 -0
- data/spec/spec_helper.rb +111 -0
- metadata +337 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 73fcfa6042094c4266377e8d4331247b4987bdf4aa624ae09dc072ddfb0dde24
|
|
4
|
+
data.tar.gz: fd1da4ddbb5378b56ead52e6ecff3bf9f7e2aa9231cbcffdba7db3986f2e5edb
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: ab35981f126809d52a3050174f550d40a9fdcc7b556fe18f6b67f9de69497a4460ff36f18cd163b779f28a19fcdf777c7fe1a10ae263cae444a6b961296a9628
|
|
7
|
+
data.tar.gz: cfac2df0b68ef3f0b12109cdeab14d5b6d38355d0c664c4c74f3c2fa9fc2228d27126a707c57fb8e70bd01fedc81362f152a5c5e3d880945c01e13c5d3542e80
|
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Divanova Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Repull Ruby SDK
|
|
2
|
+
|
|
3
|
+
> **Status:** v0.1.0 — alpha. RubyGems listing pending.
|
|
4
|
+
|
|
5
|
+
Ruby SDK for [Repull](https://repull.dev) — the unified API for vacation-rental tech (50+ PMS platforms, Airbnb / Booking.com / VRBO / Plumguide channels, AI ops, white-label OAuth Connect). Generated from [api.repull.dev/openapi.json](https://api.repull.dev/openapi.json).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Once published to RubyGems:
|
|
11
|
+
gem install repull
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
> **Not yet on RubyGems.** Until then, use the gem directly from this repo:
|
|
15
|
+
>
|
|
16
|
+
> ```ruby
|
|
17
|
+
> # Gemfile
|
|
18
|
+
> gem 'repull', git: 'https://github.com/ivannikolovbg/repull-ruby', branch: 'main'
|
|
19
|
+
> ```
|
|
20
|
+
>
|
|
21
|
+
> Or build locally:
|
|
22
|
+
>
|
|
23
|
+
> ```bash
|
|
24
|
+
> git clone https://github.com/ivannikolovbg/repull-ruby
|
|
25
|
+
> cd repull-ruby
|
|
26
|
+
> bundle install
|
|
27
|
+
> gem build repull.gemspec
|
|
28
|
+
> gem install ./repull-0.1.0.gem
|
|
29
|
+
> ```
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
```ruby
|
|
34
|
+
require 'repull'
|
|
35
|
+
|
|
36
|
+
config = Repull::Configuration.new
|
|
37
|
+
config.access_token = ENV['REPULL_API_KEY']
|
|
38
|
+
config.host = 'api.repull.dev'
|
|
39
|
+
|
|
40
|
+
api = Repull::ReservationsApi.new(Repull::ApiClient.new(config))
|
|
41
|
+
result = api.v1_reservations_get(limit: 10)
|
|
42
|
+
|
|
43
|
+
result.data.each do |r|
|
|
44
|
+
puts "#{r.id}\t#{r.check_in} -> #{r.check_out}\t#{r.platform}"
|
|
45
|
+
end
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
See [`examples/quickstart.rb`](./examples/quickstart.rb) and [`examples/connect_airbnb.rb`](./examples/connect_airbnb.rb) for runnable scripts.
|
|
49
|
+
|
|
50
|
+
## Authentication
|
|
51
|
+
|
|
52
|
+
All requests use a Bearer token. Get an API key from [repull.dev/dashboard](https://repull.dev/dashboard). Sandbox keys start with `sk_test_`, production keys with `sk_live_`.
|
|
53
|
+
|
|
54
|
+
```ruby
|
|
55
|
+
Repull.configure do |c|
|
|
56
|
+
c.access_token = ENV['REPULL_API_KEY']
|
|
57
|
+
end
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The SDK adds the `Authorization: Bearer ...` header automatically on every request.
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
| Script | What it does |
|
|
65
|
+
|---|---|
|
|
66
|
+
| [`examples/quickstart.rb`](./examples/quickstart.rb) | Health check + list reservations. |
|
|
67
|
+
| [`examples/connect_airbnb.rb`](./examples/connect_airbnb.rb) | Mint an Airbnb OAuth Connect session and poll its status. |
|
|
68
|
+
|
|
69
|
+
Run them:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
export REPULL_API_KEY=sk_test_...
|
|
73
|
+
bundle exec ruby examples/quickstart.rb
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## What's in the box
|
|
77
|
+
|
|
78
|
+
The SDK is generated from the OpenAPI spec snapshotted at [`openapi/v1.json`](./openapi/v1.json). It exposes one API class per tag:
|
|
79
|
+
|
|
80
|
+
- `Repull::AIApi`
|
|
81
|
+
- `Repull::AirbnbApi`
|
|
82
|
+
- `Repull::AvailabilityApi`
|
|
83
|
+
- `Repull::BillingApi`
|
|
84
|
+
- `Repull::BookingComApi`
|
|
85
|
+
- `Repull::ConnectApi`
|
|
86
|
+
- `Repull::ConversationsApi`
|
|
87
|
+
- `Repull::GuestsApi`
|
|
88
|
+
- `Repull::PlumguideApi`
|
|
89
|
+
- `Repull::PropertiesApi`
|
|
90
|
+
- `Repull::ReservationsApi`
|
|
91
|
+
- `Repull::SystemApi`
|
|
92
|
+
- `Repull::VRBOApi`
|
|
93
|
+
- `Repull::WebhooksApi`
|
|
94
|
+
|
|
95
|
+
Per-class method docs live in [`docs/`](./docs).
|
|
96
|
+
|
|
97
|
+
## Reference
|
|
98
|
+
|
|
99
|
+
Full API reference at [repull.dev/docs](https://repull.dev/docs).
|
|
100
|
+
|
|
101
|
+
## Regenerating
|
|
102
|
+
|
|
103
|
+
The generated client tracks the live OpenAPI spec. To refresh:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
./scripts/regen.sh
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
This re-snapshots `openapi/v1.json` from `https://api.repull.dev/openapi.json` and regenerates `lib/repull/`.
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
[MIT](./LICENSE).
|
|
114
|
+
|
|
115
|
+
## Status
|
|
116
|
+
|
|
117
|
+
v0.1.0 — alpha. API surface may shift before v1.0. RubyGems listing pending. File issues at [github.com/ivannikolovbg/repull-ruby/issues](https://github.com/ivannikolovbg/repull-ruby/issues).
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
Powered by [Repull](https://repull.dev). AI features powered by [Vanio AI](https://vanio.ai).
|
data/Rakefile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# Connect a customer to Airbnb via Repull's hosted OAuth flow.
|
|
5
|
+
#
|
|
6
|
+
# Flow:
|
|
7
|
+
# 1. POST /v1/connect/airbnb with redirectUrl + accessType — Repull mints a
|
|
8
|
+
# hosted OAuth session and returns a Connection record (and, server-side,
|
|
9
|
+
# logs an oauth_url to send the user to).
|
|
10
|
+
# 2. The user completes consent at connect.repull.dev and lands on redirectUrl.
|
|
11
|
+
# 3. Poll GET /v1/connect/airbnb to see the linked account.
|
|
12
|
+
#
|
|
13
|
+
# Usage: REPULL_API_KEY=sk_test_... bundle exec ruby examples/connect_airbnb.rb
|
|
14
|
+
|
|
15
|
+
require 'repull'
|
|
16
|
+
|
|
17
|
+
config = Repull::Configuration.new
|
|
18
|
+
config.access_token = ENV.fetch('REPULL_API_KEY')
|
|
19
|
+
config.host = 'api.repull.dev'
|
|
20
|
+
|
|
21
|
+
api = Repull::ConnectApi.new(Repull::ApiClient.new(config))
|
|
22
|
+
|
|
23
|
+
req = Repull::V1ConnectProviderPostRequest.new(
|
|
24
|
+
redirect_url: 'https://example.com/airbnb/return',
|
|
25
|
+
access_type: 'full_access'
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
connection = api.v1_connect_provider_post('airbnb', v1_connect_provider_post_request: req)
|
|
29
|
+
puts "connection id=#{connection.id} status=#{connection.status}"
|
|
30
|
+
puts "host: #{connection.host&.to_hash}" if connection.host
|
|
31
|
+
|
|
32
|
+
status = api.v1_connect_provider_get('airbnb')
|
|
33
|
+
puts "current airbnb status: #{status.to_hash}"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# Quickstart: health check + list 10 reservations from api.repull.dev.
|
|
5
|
+
# Usage: REPULL_API_KEY=sk_test_... bundle exec ruby examples/quickstart.rb
|
|
6
|
+
|
|
7
|
+
require 'repull'
|
|
8
|
+
|
|
9
|
+
config = Repull::Configuration.new
|
|
10
|
+
config.access_token = ENV.fetch('REPULL_API_KEY')
|
|
11
|
+
config.host = 'api.repull.dev'
|
|
12
|
+
|
|
13
|
+
client = Repull::ApiClient.new(config)
|
|
14
|
+
|
|
15
|
+
health = Repull::SystemApi.new(client).v1_health_get
|
|
16
|
+
puts "health: #{health.status}"
|
|
17
|
+
|
|
18
|
+
result = Repull::ReservationsApi.new(client).v1_reservations_get(limit: 10)
|
|
19
|
+
puts "reservations: #{result.data.size} (total #{result.pagination&.total})"
|
|
20
|
+
result.data.each do |r|
|
|
21
|
+
puts " #{r.id}\t#{r.check_in} -> #{r.check_out}\t#{r.platform}"
|
|
22
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Repull
|
|
16
|
+
class AIApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# AI operation
|
|
23
|
+
# Perform an AI-powered operation. Operations: - `respond-to-guest` — Generate a contextual guest response - `classify-intent` — Classify the intent of a guest message - `generate-listing` — Generate optimized listing description - `review-response` — Generate a review response - `price-suggestion` — Get AI pricing suggestions
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [AIOperation] :ai_operation
|
|
26
|
+
# @return [CreateAiOperation200Response]
|
|
27
|
+
def create_ai_operation(opts = {})
|
|
28
|
+
data, _status_code, _headers = create_ai_operation_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# AI operation
|
|
33
|
+
# Perform an AI-powered operation. Operations: - `respond-to-guest` — Generate a contextual guest response - `classify-intent` — Classify the intent of a guest message - `generate-listing` — Generate optimized listing description - `review-response` — Generate a review response - `price-suggestion` — Get AI pricing suggestions
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @option opts [AIOperation] :ai_operation
|
|
36
|
+
# @return [Array<(CreateAiOperation200Response, Integer, Hash)>] CreateAiOperation200Response data, response status code and response headers
|
|
37
|
+
def create_ai_operation_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AIApi.create_ai_operation ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/v1/ai'
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
51
|
+
# HTTP header 'Content-Type'
|
|
52
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
53
|
+
if !content_type.nil?
|
|
54
|
+
header_params['Content-Type'] = content_type
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# form parameters
|
|
58
|
+
form_params = opts[:form_params] || {}
|
|
59
|
+
|
|
60
|
+
# http body (model)
|
|
61
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ai_operation'])
|
|
62
|
+
|
|
63
|
+
# return_type
|
|
64
|
+
return_type = opts[:debug_return_type] || 'CreateAiOperation200Response'
|
|
65
|
+
|
|
66
|
+
# auth_names
|
|
67
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
68
|
+
|
|
69
|
+
new_options = opts.merge(
|
|
70
|
+
:operation => :"AIApi.create_ai_operation",
|
|
71
|
+
:header_params => header_params,
|
|
72
|
+
:query_params => query_params,
|
|
73
|
+
:form_params => form_params,
|
|
74
|
+
:body => post_body,
|
|
75
|
+
:auth_names => auth_names,
|
|
76
|
+
:return_type => return_type
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
80
|
+
if @api_client.config.debugging
|
|
81
|
+
@api_client.config.logger.debug "API called: AIApi#create_ai_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
82
|
+
end
|
|
83
|
+
return data, status_code, headers
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|