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
|
@@ -0,0 +1,672 @@
|
|
|
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 ConnectApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a multi-channel Connect picker session
|
|
23
|
+
# Mints a session that lands the user on the channel picker at `connect.repull.dev/{sessionId}` instead of jumping straight to a single provider. The user picks a channel from the registry, the picker page POSTs `selectConnectProvider` to bind the choice, and the per-provider flow takes over. Use this when you want one entry point for all 13 channels. Use `POST /v1/connect/{provider}` instead when your UI already knows which channel to connect.
|
|
24
|
+
# @param create_connect_session_request [CreateConnectSessionRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [ConnectSession]
|
|
27
|
+
def create_connect_session(create_connect_session_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_connect_session_with_http_info(create_connect_session_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create a multi-channel Connect picker session
|
|
33
|
+
# Mints a session that lands the user on the channel picker at `connect.repull.dev/{sessionId}` instead of jumping straight to a single provider. The user picks a channel from the registry, the picker page POSTs `selectConnectProvider` to bind the choice, and the per-provider flow takes over. Use this when you want one entry point for all 13 channels. Use `POST /v1/connect/{provider}` instead when your UI already knows which channel to connect.
|
|
34
|
+
# @param create_connect_session_request [CreateConnectSessionRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(ConnectSession, Integer, Hash)>] ConnectSession data, response status code and response headers
|
|
37
|
+
def create_connect_session_with_http_info(create_connect_session_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.create_connect_session ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'create_connect_session_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && create_connect_session_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_connect_session_request' when calling ConnectApi.create_connect_session"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/connect'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connect_session_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'ConnectSession'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"ConnectApi.create_connect_session",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: ConnectApi#create_connect_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Connect to PMS/OTA provider
|
|
91
|
+
# Establish a connection to a PMS or OTA platform. Credentials vary by provider — see docs for each provider. Airbnb-specific: pass `redirectUrl` (where to send the user after consent) and optionally `accessType` (`read_only` for calendar-only OAuth scopes, or `full_access` — the default — for full host scopes). The response returns a hosted `oauthUrl` to redirect the user to.
|
|
92
|
+
# @param provider [String] PMS provider slug (e.g., hostaway, guesty, ownerrez)
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @option opts [CreateConnectionRequest] :create_connection_request
|
|
95
|
+
# @return [Connection]
|
|
96
|
+
def create_connection(provider, opts = {})
|
|
97
|
+
data, _status_code, _headers = create_connection_with_http_info(provider, opts)
|
|
98
|
+
data
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Connect to PMS/OTA provider
|
|
102
|
+
# Establish a connection to a PMS or OTA platform. Credentials vary by provider — see docs for each provider. Airbnb-specific: pass `redirectUrl` (where to send the user after consent) and optionally `accessType` (`read_only` for calendar-only OAuth scopes, or `full_access` — the default — for full host scopes). The response returns a hosted `oauthUrl` to redirect the user to.
|
|
103
|
+
# @param provider [String] PMS provider slug (e.g., hostaway, guesty, ownerrez)
|
|
104
|
+
# @param [Hash] opts the optional parameters
|
|
105
|
+
# @option opts [CreateConnectionRequest] :create_connection_request
|
|
106
|
+
# @return [Array<(Connection, Integer, Hash)>] Connection data, response status code and response headers
|
|
107
|
+
def create_connection_with_http_info(provider, opts = {})
|
|
108
|
+
if @api_client.config.debugging
|
|
109
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.create_connection ...'
|
|
110
|
+
end
|
|
111
|
+
# verify the required parameter 'provider' is set
|
|
112
|
+
if @api_client.config.client_side_validation && provider.nil?
|
|
113
|
+
fail ArgumentError, "Missing the required parameter 'provider' when calling ConnectApi.create_connection"
|
|
114
|
+
end
|
|
115
|
+
# resource path
|
|
116
|
+
local_var_path = '/v1/connect/{provider}'.sub('{provider}', CGI.escape(provider.to_s))
|
|
117
|
+
|
|
118
|
+
# query parameters
|
|
119
|
+
query_params = opts[:query_params] || {}
|
|
120
|
+
|
|
121
|
+
# header parameters
|
|
122
|
+
header_params = opts[:header_params] || {}
|
|
123
|
+
# HTTP header 'Accept' (if needed)
|
|
124
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
125
|
+
# HTTP header 'Content-Type'
|
|
126
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
127
|
+
if !content_type.nil?
|
|
128
|
+
header_params['Content-Type'] = content_type
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# form parameters
|
|
132
|
+
form_params = opts[:form_params] || {}
|
|
133
|
+
|
|
134
|
+
# http body (model)
|
|
135
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_connection_request'])
|
|
136
|
+
|
|
137
|
+
# return_type
|
|
138
|
+
return_type = opts[:debug_return_type] || 'Connection'
|
|
139
|
+
|
|
140
|
+
# auth_names
|
|
141
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
142
|
+
|
|
143
|
+
new_options = opts.merge(
|
|
144
|
+
:operation => :"ConnectApi.create_connection",
|
|
145
|
+
:header_params => header_params,
|
|
146
|
+
:query_params => query_params,
|
|
147
|
+
:form_params => form_params,
|
|
148
|
+
:body => post_body,
|
|
149
|
+
:auth_names => auth_names,
|
|
150
|
+
:return_type => return_type
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
154
|
+
if @api_client.config.debugging
|
|
155
|
+
@api_client.config.logger.debug "API called: ConnectApi#create_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
156
|
+
end
|
|
157
|
+
return data, status_code, headers
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Disconnect provider
|
|
161
|
+
# Disconnect a PMS or OTA from this workspace. Revokes the OAuth token (where applicable), purges credentials, and stops all sync jobs. Resources synced from the provider remain queryable but become read-only and stop receiving updates.
|
|
162
|
+
# @param provider [String] PMS provider slug (e.g., hostaway, guesty, ownerrez)
|
|
163
|
+
# @param [Hash] opts the optional parameters
|
|
164
|
+
# @return [nil]
|
|
165
|
+
def delete_connection(provider, opts = {})
|
|
166
|
+
delete_connection_with_http_info(provider, opts)
|
|
167
|
+
nil
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Disconnect provider
|
|
171
|
+
# Disconnect a PMS or OTA from this workspace. Revokes the OAuth token (where applicable), purges credentials, and stops all sync jobs. Resources synced from the provider remain queryable but become read-only and stop receiving updates.
|
|
172
|
+
# @param provider [String] PMS provider slug (e.g., hostaway, guesty, ownerrez)
|
|
173
|
+
# @param [Hash] opts the optional parameters
|
|
174
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
175
|
+
def delete_connection_with_http_info(provider, opts = {})
|
|
176
|
+
if @api_client.config.debugging
|
|
177
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.delete_connection ...'
|
|
178
|
+
end
|
|
179
|
+
# verify the required parameter 'provider' is set
|
|
180
|
+
if @api_client.config.client_side_validation && provider.nil?
|
|
181
|
+
fail ArgumentError, "Missing the required parameter 'provider' when calling ConnectApi.delete_connection"
|
|
182
|
+
end
|
|
183
|
+
# resource path
|
|
184
|
+
local_var_path = '/v1/connect/{provider}'.sub('{provider}', CGI.escape(provider.to_s))
|
|
185
|
+
|
|
186
|
+
# query parameters
|
|
187
|
+
query_params = opts[:query_params] || {}
|
|
188
|
+
|
|
189
|
+
# header parameters
|
|
190
|
+
header_params = opts[:header_params] || {}
|
|
191
|
+
|
|
192
|
+
# form parameters
|
|
193
|
+
form_params = opts[:form_params] || {}
|
|
194
|
+
|
|
195
|
+
# http body (model)
|
|
196
|
+
post_body = opts[:debug_body]
|
|
197
|
+
|
|
198
|
+
# return_type
|
|
199
|
+
return_type = opts[:debug_return_type]
|
|
200
|
+
|
|
201
|
+
# auth_names
|
|
202
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
203
|
+
|
|
204
|
+
new_options = opts.merge(
|
|
205
|
+
:operation => :"ConnectApi.delete_connection",
|
|
206
|
+
:header_params => header_params,
|
|
207
|
+
:query_params => query_params,
|
|
208
|
+
:form_params => form_params,
|
|
209
|
+
:body => post_body,
|
|
210
|
+
:auth_names => auth_names,
|
|
211
|
+
:return_type => return_type
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
215
|
+
if @api_client.config.debugging
|
|
216
|
+
@api_client.config.logger.debug "API called: ConnectApi#delete_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
217
|
+
end
|
|
218
|
+
return data, status_code, headers
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Get connection status
|
|
222
|
+
# Returns the current connection status for a provider, including host metadata (display name + avatar) for Airbnb so clients can render an account-level confirmation UI.
|
|
223
|
+
# @param provider [String] PMS provider slug (e.g., hostaway, guesty, ownerrez)
|
|
224
|
+
# @param [Hash] opts the optional parameters
|
|
225
|
+
# @return [ConnectStatus]
|
|
226
|
+
def get_connect_status(provider, opts = {})
|
|
227
|
+
data, _status_code, _headers = get_connect_status_with_http_info(provider, opts)
|
|
228
|
+
data
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Get connection status
|
|
232
|
+
# Returns the current connection status for a provider, including host metadata (display name + avatar) for Airbnb so clients can render an account-level confirmation UI.
|
|
233
|
+
# @param provider [String] PMS provider slug (e.g., hostaway, guesty, ownerrez)
|
|
234
|
+
# @param [Hash] opts the optional parameters
|
|
235
|
+
# @return [Array<(ConnectStatus, Integer, Hash)>] ConnectStatus data, response status code and response headers
|
|
236
|
+
def get_connect_status_with_http_info(provider, opts = {})
|
|
237
|
+
if @api_client.config.debugging
|
|
238
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.get_connect_status ...'
|
|
239
|
+
end
|
|
240
|
+
# verify the required parameter 'provider' is set
|
|
241
|
+
if @api_client.config.client_side_validation && provider.nil?
|
|
242
|
+
fail ArgumentError, "Missing the required parameter 'provider' when calling ConnectApi.get_connect_status"
|
|
243
|
+
end
|
|
244
|
+
# resource path
|
|
245
|
+
local_var_path = '/v1/connect/{provider}'.sub('{provider}', CGI.escape(provider.to_s))
|
|
246
|
+
|
|
247
|
+
# query parameters
|
|
248
|
+
query_params = opts[:query_params] || {}
|
|
249
|
+
|
|
250
|
+
# header parameters
|
|
251
|
+
header_params = opts[:header_params] || {}
|
|
252
|
+
# HTTP header 'Accept' (if needed)
|
|
253
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
254
|
+
|
|
255
|
+
# form parameters
|
|
256
|
+
form_params = opts[:form_params] || {}
|
|
257
|
+
|
|
258
|
+
# http body (model)
|
|
259
|
+
post_body = opts[:debug_body]
|
|
260
|
+
|
|
261
|
+
# return_type
|
|
262
|
+
return_type = opts[:debug_return_type] || 'ConnectStatus'
|
|
263
|
+
|
|
264
|
+
# auth_names
|
|
265
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
266
|
+
|
|
267
|
+
new_options = opts.merge(
|
|
268
|
+
:operation => :"ConnectApi.get_connect_status",
|
|
269
|
+
:header_params => header_params,
|
|
270
|
+
:query_params => query_params,
|
|
271
|
+
:form_params => form_params,
|
|
272
|
+
:body => post_body,
|
|
273
|
+
:auth_names => auth_names,
|
|
274
|
+
:return_type => return_type
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
278
|
+
if @api_client.config.debugging
|
|
279
|
+
@api_client.config.logger.debug "API called: ConnectApi#get_connect_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
280
|
+
end
|
|
281
|
+
return data, status_code, headers
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# List Booking.com rooms imported for a Connect session
|
|
285
|
+
# Returns the rooms imported from the Booking.com hotel claimed in this Connect session, plus the customer's listing options for the mapping dropdowns. Hosted-picker pages poll this endpoint every ~2s after `verifyBookingHotel` succeeds; once rooms appear the page transitions to the mapping UI. No API key required — the `sessionId` query param is the capability token.
|
|
286
|
+
# @param session_id [String] The Connect session ID returned by `createConnectSession`.
|
|
287
|
+
# @param [Hash] opts the optional parameters
|
|
288
|
+
# @return [BookingConnectRoomsResponse]
|
|
289
|
+
def list_connect_booking_rooms(session_id, opts = {})
|
|
290
|
+
data, _status_code, _headers = list_connect_booking_rooms_with_http_info(session_id, opts)
|
|
291
|
+
data
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# List Booking.com rooms imported for a Connect session
|
|
295
|
+
# Returns the rooms imported from the Booking.com hotel claimed in this Connect session, plus the customer's listing options for the mapping dropdowns. Hosted-picker pages poll this endpoint every ~2s after `verifyBookingHotel` succeeds; once rooms appear the page transitions to the mapping UI. No API key required — the `sessionId` query param is the capability token.
|
|
296
|
+
# @param session_id [String] The Connect session ID returned by `createConnectSession`.
|
|
297
|
+
# @param [Hash] opts the optional parameters
|
|
298
|
+
# @return [Array<(BookingConnectRoomsResponse, Integer, Hash)>] BookingConnectRoomsResponse data, response status code and response headers
|
|
299
|
+
def list_connect_booking_rooms_with_http_info(session_id, opts = {})
|
|
300
|
+
if @api_client.config.debugging
|
|
301
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.list_connect_booking_rooms ...'
|
|
302
|
+
end
|
|
303
|
+
# verify the required parameter 'session_id' is set
|
|
304
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
|
305
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling ConnectApi.list_connect_booking_rooms"
|
|
306
|
+
end
|
|
307
|
+
# resource path
|
|
308
|
+
local_var_path = '/v1/connect/booking/rooms'
|
|
309
|
+
|
|
310
|
+
# query parameters
|
|
311
|
+
query_params = opts[:query_params] || {}
|
|
312
|
+
query_params[:'sessionId'] = session_id
|
|
313
|
+
|
|
314
|
+
# header parameters
|
|
315
|
+
header_params = opts[:header_params] || {}
|
|
316
|
+
# HTTP header 'Accept' (if needed)
|
|
317
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
318
|
+
|
|
319
|
+
# form parameters
|
|
320
|
+
form_params = opts[:form_params] || {}
|
|
321
|
+
|
|
322
|
+
# http body (model)
|
|
323
|
+
post_body = opts[:debug_body]
|
|
324
|
+
|
|
325
|
+
# return_type
|
|
326
|
+
return_type = opts[:debug_return_type] || 'BookingConnectRoomsResponse'
|
|
327
|
+
|
|
328
|
+
# auth_names
|
|
329
|
+
auth_names = opts[:debug_auth_names] || []
|
|
330
|
+
|
|
331
|
+
new_options = opts.merge(
|
|
332
|
+
:operation => :"ConnectApi.list_connect_booking_rooms",
|
|
333
|
+
:header_params => header_params,
|
|
334
|
+
:query_params => query_params,
|
|
335
|
+
:form_params => form_params,
|
|
336
|
+
:body => post_body,
|
|
337
|
+
:auth_names => auth_names,
|
|
338
|
+
:return_type => return_type
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
342
|
+
if @api_client.config.debugging
|
|
343
|
+
@api_client.config.logger.debug "API called: ConnectApi#list_connect_booking_rooms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
344
|
+
end
|
|
345
|
+
return data, status_code, headers
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
# List Connect channels
|
|
349
|
+
# Returns the public registry of every channel the picker supports. No customer-specific data — display metadata only. Cached for 5 minutes at the edge.
|
|
350
|
+
# @param [Hash] opts the optional parameters
|
|
351
|
+
# @return [ConnectProviderListResponse]
|
|
352
|
+
def list_connect_providers(opts = {})
|
|
353
|
+
data, _status_code, _headers = list_connect_providers_with_http_info(opts)
|
|
354
|
+
data
|
|
355
|
+
end
|
|
356
|
+
|
|
357
|
+
# List Connect channels
|
|
358
|
+
# Returns the public registry of every channel the picker supports. No customer-specific data — display metadata only. Cached for 5 minutes at the edge.
|
|
359
|
+
# @param [Hash] opts the optional parameters
|
|
360
|
+
# @return [Array<(ConnectProviderListResponse, Integer, Hash)>] ConnectProviderListResponse data, response status code and response headers
|
|
361
|
+
def list_connect_providers_with_http_info(opts = {})
|
|
362
|
+
if @api_client.config.debugging
|
|
363
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.list_connect_providers ...'
|
|
364
|
+
end
|
|
365
|
+
# resource path
|
|
366
|
+
local_var_path = '/v1/connect/providers'
|
|
367
|
+
|
|
368
|
+
# query parameters
|
|
369
|
+
query_params = opts[:query_params] || {}
|
|
370
|
+
|
|
371
|
+
# header parameters
|
|
372
|
+
header_params = opts[:header_params] || {}
|
|
373
|
+
# HTTP header 'Accept' (if needed)
|
|
374
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
375
|
+
|
|
376
|
+
# form parameters
|
|
377
|
+
form_params = opts[:form_params] || {}
|
|
378
|
+
|
|
379
|
+
# http body (model)
|
|
380
|
+
post_body = opts[:debug_body]
|
|
381
|
+
|
|
382
|
+
# return_type
|
|
383
|
+
return_type = opts[:debug_return_type] || 'ConnectProviderListResponse'
|
|
384
|
+
|
|
385
|
+
# auth_names
|
|
386
|
+
auth_names = opts[:debug_auth_names] || []
|
|
387
|
+
|
|
388
|
+
new_options = opts.merge(
|
|
389
|
+
:operation => :"ConnectApi.list_connect_providers",
|
|
390
|
+
:header_params => header_params,
|
|
391
|
+
:query_params => query_params,
|
|
392
|
+
:form_params => form_params,
|
|
393
|
+
:body => post_body,
|
|
394
|
+
:auth_names => auth_names,
|
|
395
|
+
:return_type => return_type
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
399
|
+
if @api_client.config.debugging
|
|
400
|
+
@api_client.config.logger.debug "API called: ConnectApi#list_connect_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
401
|
+
end
|
|
402
|
+
return data, status_code, headers
|
|
403
|
+
end
|
|
404
|
+
|
|
405
|
+
# List PMS/OTA connections
|
|
406
|
+
# Returns all active connections to PMS and OTA platforms.
|
|
407
|
+
# @param [Hash] opts the optional parameters
|
|
408
|
+
# @return [ConnectionListResponse]
|
|
409
|
+
def list_connections(opts = {})
|
|
410
|
+
data, _status_code, _headers = list_connections_with_http_info(opts)
|
|
411
|
+
data
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# List PMS/OTA connections
|
|
415
|
+
# Returns all active connections to PMS and OTA platforms.
|
|
416
|
+
# @param [Hash] opts the optional parameters
|
|
417
|
+
# @return [Array<(ConnectionListResponse, Integer, Hash)>] ConnectionListResponse data, response status code and response headers
|
|
418
|
+
def list_connections_with_http_info(opts = {})
|
|
419
|
+
if @api_client.config.debugging
|
|
420
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.list_connections ...'
|
|
421
|
+
end
|
|
422
|
+
# resource path
|
|
423
|
+
local_var_path = '/v1/connect'
|
|
424
|
+
|
|
425
|
+
# query parameters
|
|
426
|
+
query_params = opts[:query_params] || {}
|
|
427
|
+
|
|
428
|
+
# header parameters
|
|
429
|
+
header_params = opts[:header_params] || {}
|
|
430
|
+
# HTTP header 'Accept' (if needed)
|
|
431
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
432
|
+
|
|
433
|
+
# form parameters
|
|
434
|
+
form_params = opts[:form_params] || {}
|
|
435
|
+
|
|
436
|
+
# http body (model)
|
|
437
|
+
post_body = opts[:debug_body]
|
|
438
|
+
|
|
439
|
+
# return_type
|
|
440
|
+
return_type = opts[:debug_return_type] || 'ConnectionListResponse'
|
|
441
|
+
|
|
442
|
+
# auth_names
|
|
443
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
444
|
+
|
|
445
|
+
new_options = opts.merge(
|
|
446
|
+
:operation => :"ConnectApi.list_connections",
|
|
447
|
+
:header_params => header_params,
|
|
448
|
+
:query_params => query_params,
|
|
449
|
+
:form_params => form_params,
|
|
450
|
+
:body => post_body,
|
|
451
|
+
:auth_names => auth_names,
|
|
452
|
+
:return_type => return_type
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
456
|
+
if @api_client.config.debugging
|
|
457
|
+
@api_client.config.logger.debug "API called: ConnectApi#list_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
458
|
+
end
|
|
459
|
+
return data, status_code, headers
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
# Submit room→listing mappings for a Booking.com Connect session
|
|
463
|
+
# Submits the customer's room→listing mapping choices in one transaction. For each mapping, updates `listings_booking_rooms.listing_id` and replaces the corresponding `listing_platform_links` row. Pass `listingId: null` to explicitly unmap a room. On success the Connect session is marked `completed` and the hosted picker page emits a `repull:connect:completed` postMessage to the embedding window. No API key required — the `sessionId` in the body is the capability token. Each mapping's `roomId` must belong to the customer's claimed hotel; mismatched IDs are rejected with 403.
|
|
464
|
+
# @param map_connect_booking_rooms_request [MapConnectBookingRoomsRequest]
|
|
465
|
+
# @param [Hash] opts the optional parameters
|
|
466
|
+
# @return [MapConnectBookingRoomsResponse]
|
|
467
|
+
def map_connect_booking_rooms(map_connect_booking_rooms_request, opts = {})
|
|
468
|
+
data, _status_code, _headers = map_connect_booking_rooms_with_http_info(map_connect_booking_rooms_request, opts)
|
|
469
|
+
data
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# Submit room→listing mappings for a Booking.com Connect session
|
|
473
|
+
# Submits the customer's room→listing mapping choices in one transaction. For each mapping, updates `listings_booking_rooms.listing_id` and replaces the corresponding `listing_platform_links` row. Pass `listingId: null` to explicitly unmap a room. On success the Connect session is marked `completed` and the hosted picker page emits a `repull:connect:completed` postMessage to the embedding window. No API key required — the `sessionId` in the body is the capability token. Each mapping's `roomId` must belong to the customer's claimed hotel; mismatched IDs are rejected with 403.
|
|
474
|
+
# @param map_connect_booking_rooms_request [MapConnectBookingRoomsRequest]
|
|
475
|
+
# @param [Hash] opts the optional parameters
|
|
476
|
+
# @return [Array<(MapConnectBookingRoomsResponse, Integer, Hash)>] MapConnectBookingRoomsResponse data, response status code and response headers
|
|
477
|
+
def map_connect_booking_rooms_with_http_info(map_connect_booking_rooms_request, opts = {})
|
|
478
|
+
if @api_client.config.debugging
|
|
479
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.map_connect_booking_rooms ...'
|
|
480
|
+
end
|
|
481
|
+
# verify the required parameter 'map_connect_booking_rooms_request' is set
|
|
482
|
+
if @api_client.config.client_side_validation && map_connect_booking_rooms_request.nil?
|
|
483
|
+
fail ArgumentError, "Missing the required parameter 'map_connect_booking_rooms_request' when calling ConnectApi.map_connect_booking_rooms"
|
|
484
|
+
end
|
|
485
|
+
# resource path
|
|
486
|
+
local_var_path = '/v1/connect/booking/map-rooms'
|
|
487
|
+
|
|
488
|
+
# query parameters
|
|
489
|
+
query_params = opts[:query_params] || {}
|
|
490
|
+
|
|
491
|
+
# header parameters
|
|
492
|
+
header_params = opts[:header_params] || {}
|
|
493
|
+
# HTTP header 'Accept' (if needed)
|
|
494
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
495
|
+
# HTTP header 'Content-Type'
|
|
496
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
497
|
+
if !content_type.nil?
|
|
498
|
+
header_params['Content-Type'] = content_type
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
# form parameters
|
|
502
|
+
form_params = opts[:form_params] || {}
|
|
503
|
+
|
|
504
|
+
# http body (model)
|
|
505
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(map_connect_booking_rooms_request)
|
|
506
|
+
|
|
507
|
+
# return_type
|
|
508
|
+
return_type = opts[:debug_return_type] || 'MapConnectBookingRoomsResponse'
|
|
509
|
+
|
|
510
|
+
# auth_names
|
|
511
|
+
auth_names = opts[:debug_auth_names] || []
|
|
512
|
+
|
|
513
|
+
new_options = opts.merge(
|
|
514
|
+
:operation => :"ConnectApi.map_connect_booking_rooms",
|
|
515
|
+
:header_params => header_params,
|
|
516
|
+
:query_params => query_params,
|
|
517
|
+
:form_params => form_params,
|
|
518
|
+
:body => post_body,
|
|
519
|
+
:auth_names => auth_names,
|
|
520
|
+
:return_type => return_type
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
524
|
+
if @api_client.config.debugging
|
|
525
|
+
@api_client.config.logger.debug "API called: ConnectApi#map_connect_booking_rooms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
526
|
+
end
|
|
527
|
+
return data, status_code, headers
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
# Bind a picker session to a provider
|
|
531
|
+
# Called by the hosted picker page once the user clicks a channel card. Validates the provider exists and is permitted by the session's `allowed_providers` whitelist (if any), then returns the next-step URL the picker should navigate to. No API key required — the session ID is the capability token. The session must still be pending and unexpired.
|
|
532
|
+
# @param session_id [String] The picker session ID returned by `createConnectSession`.
|
|
533
|
+
# @param select_connect_provider_request [SelectConnectProviderRequest]
|
|
534
|
+
# @param [Hash] opts the optional parameters
|
|
535
|
+
# @return [SelectProviderResponse]
|
|
536
|
+
def select_connect_provider(session_id, select_connect_provider_request, opts = {})
|
|
537
|
+
data, _status_code, _headers = select_connect_provider_with_http_info(session_id, select_connect_provider_request, opts)
|
|
538
|
+
data
|
|
539
|
+
end
|
|
540
|
+
|
|
541
|
+
# Bind a picker session to a provider
|
|
542
|
+
# Called by the hosted picker page once the user clicks a channel card. Validates the provider exists and is permitted by the session's `allowed_providers` whitelist (if any), then returns the next-step URL the picker should navigate to. No API key required — the session ID is the capability token. The session must still be pending and unexpired.
|
|
543
|
+
# @param session_id [String] The picker session ID returned by `createConnectSession`.
|
|
544
|
+
# @param select_connect_provider_request [SelectConnectProviderRequest]
|
|
545
|
+
# @param [Hash] opts the optional parameters
|
|
546
|
+
# @return [Array<(SelectProviderResponse, Integer, Hash)>] SelectProviderResponse data, response status code and response headers
|
|
547
|
+
def select_connect_provider_with_http_info(session_id, select_connect_provider_request, opts = {})
|
|
548
|
+
if @api_client.config.debugging
|
|
549
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.select_connect_provider ...'
|
|
550
|
+
end
|
|
551
|
+
# verify the required parameter 'session_id' is set
|
|
552
|
+
if @api_client.config.client_side_validation && session_id.nil?
|
|
553
|
+
fail ArgumentError, "Missing the required parameter 'session_id' when calling ConnectApi.select_connect_provider"
|
|
554
|
+
end
|
|
555
|
+
# verify the required parameter 'select_connect_provider_request' is set
|
|
556
|
+
if @api_client.config.client_side_validation && select_connect_provider_request.nil?
|
|
557
|
+
fail ArgumentError, "Missing the required parameter 'select_connect_provider_request' when calling ConnectApi.select_connect_provider"
|
|
558
|
+
end
|
|
559
|
+
# resource path
|
|
560
|
+
local_var_path = '/v1/connect/sessions/{sessionId}/select-provider'.sub('{sessionId}', CGI.escape(session_id.to_s))
|
|
561
|
+
|
|
562
|
+
# query parameters
|
|
563
|
+
query_params = opts[:query_params] || {}
|
|
564
|
+
|
|
565
|
+
# header parameters
|
|
566
|
+
header_params = opts[:header_params] || {}
|
|
567
|
+
# HTTP header 'Accept' (if needed)
|
|
568
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
569
|
+
# HTTP header 'Content-Type'
|
|
570
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
571
|
+
if !content_type.nil?
|
|
572
|
+
header_params['Content-Type'] = content_type
|
|
573
|
+
end
|
|
574
|
+
|
|
575
|
+
# form parameters
|
|
576
|
+
form_params = opts[:form_params] || {}
|
|
577
|
+
|
|
578
|
+
# http body (model)
|
|
579
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(select_connect_provider_request)
|
|
580
|
+
|
|
581
|
+
# return_type
|
|
582
|
+
return_type = opts[:debug_return_type] || 'SelectProviderResponse'
|
|
583
|
+
|
|
584
|
+
# auth_names
|
|
585
|
+
auth_names = opts[:debug_auth_names] || []
|
|
586
|
+
|
|
587
|
+
new_options = opts.merge(
|
|
588
|
+
:operation => :"ConnectApi.select_connect_provider",
|
|
589
|
+
:header_params => header_params,
|
|
590
|
+
:query_params => query_params,
|
|
591
|
+
:form_params => form_params,
|
|
592
|
+
:body => post_body,
|
|
593
|
+
:auth_names => auth_names,
|
|
594
|
+
:return_type => return_type
|
|
595
|
+
)
|
|
596
|
+
|
|
597
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
598
|
+
if @api_client.config.debugging
|
|
599
|
+
@api_client.config.logger.debug "API called: ConnectApi#select_connect_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
600
|
+
end
|
|
601
|
+
return data, status_code, headers
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
# Verify a Booking.com hotel ID for a Connect session
|
|
605
|
+
# Manual-paste fallback that closes the Booking.com claim flow. Call this after the customer completes Stage 1 designation in their Booking Extranet (ticking FantasticStay/Repull as their connectivity provider) and pastes their Hotel ID into the hosted picker. Validates the hotel against Booking's property API, persists the `pms_connections` row, kicks off the room import, and transitions the Connect session to `awaiting_room_mapping`. No API key required — the `sessionId` is the capability token. Sessions in any terminal state are rejected.
|
|
606
|
+
# @param booking_verify_hotel_request [BookingVerifyHotelRequest]
|
|
607
|
+
# @param [Hash] opts the optional parameters
|
|
608
|
+
# @return [BookingVerifyHotelResponse]
|
|
609
|
+
def verify_booking_hotel(booking_verify_hotel_request, opts = {})
|
|
610
|
+
data, _status_code, _headers = verify_booking_hotel_with_http_info(booking_verify_hotel_request, opts)
|
|
611
|
+
data
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
# Verify a Booking.com hotel ID for a Connect session
|
|
615
|
+
# Manual-paste fallback that closes the Booking.com claim flow. Call this after the customer completes Stage 1 designation in their Booking Extranet (ticking FantasticStay/Repull as their connectivity provider) and pastes their Hotel ID into the hosted picker. Validates the hotel against Booking's property API, persists the `pms_connections` row, kicks off the room import, and transitions the Connect session to `awaiting_room_mapping`. No API key required — the `sessionId` is the capability token. Sessions in any terminal state are rejected.
|
|
616
|
+
# @param booking_verify_hotel_request [BookingVerifyHotelRequest]
|
|
617
|
+
# @param [Hash] opts the optional parameters
|
|
618
|
+
# @return [Array<(BookingVerifyHotelResponse, Integer, Hash)>] BookingVerifyHotelResponse data, response status code and response headers
|
|
619
|
+
def verify_booking_hotel_with_http_info(booking_verify_hotel_request, opts = {})
|
|
620
|
+
if @api_client.config.debugging
|
|
621
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.verify_booking_hotel ...'
|
|
622
|
+
end
|
|
623
|
+
# verify the required parameter 'booking_verify_hotel_request' is set
|
|
624
|
+
if @api_client.config.client_side_validation && booking_verify_hotel_request.nil?
|
|
625
|
+
fail ArgumentError, "Missing the required parameter 'booking_verify_hotel_request' when calling ConnectApi.verify_booking_hotel"
|
|
626
|
+
end
|
|
627
|
+
# resource path
|
|
628
|
+
local_var_path = '/v1/connect/booking/verify'
|
|
629
|
+
|
|
630
|
+
# query parameters
|
|
631
|
+
query_params = opts[:query_params] || {}
|
|
632
|
+
|
|
633
|
+
# header parameters
|
|
634
|
+
header_params = opts[:header_params] || {}
|
|
635
|
+
# HTTP header 'Accept' (if needed)
|
|
636
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
637
|
+
# HTTP header 'Content-Type'
|
|
638
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
639
|
+
if !content_type.nil?
|
|
640
|
+
header_params['Content-Type'] = content_type
|
|
641
|
+
end
|
|
642
|
+
|
|
643
|
+
# form parameters
|
|
644
|
+
form_params = opts[:form_params] || {}
|
|
645
|
+
|
|
646
|
+
# http body (model)
|
|
647
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(booking_verify_hotel_request)
|
|
648
|
+
|
|
649
|
+
# return_type
|
|
650
|
+
return_type = opts[:debug_return_type] || 'BookingVerifyHotelResponse'
|
|
651
|
+
|
|
652
|
+
# auth_names
|
|
653
|
+
auth_names = opts[:debug_auth_names] || []
|
|
654
|
+
|
|
655
|
+
new_options = opts.merge(
|
|
656
|
+
:operation => :"ConnectApi.verify_booking_hotel",
|
|
657
|
+
:header_params => header_params,
|
|
658
|
+
:query_params => query_params,
|
|
659
|
+
:form_params => form_params,
|
|
660
|
+
:body => post_body,
|
|
661
|
+
:auth_names => auth_names,
|
|
662
|
+
:return_type => return_type
|
|
663
|
+
)
|
|
664
|
+
|
|
665
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
666
|
+
if @api_client.config.debugging
|
|
667
|
+
@api_client.config.logger.debug "API called: ConnectApi#verify_booking_hotel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
668
|
+
end
|
|
669
|
+
return data, status_code, headers
|
|
670
|
+
end
|
|
671
|
+
end
|
|
672
|
+
end
|