Class: Repull::ConnectApi
- Inherits:
-
Object
- Object
- Repull::ConnectApi
- Defined in:
- lib/repull/api/connect_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_connect_session(create_connect_session_request, opts = {}) ⇒ ConnectSession
Create a multi-channel Connect picker session Mints a session that lands the user on the channel picker at ‘connect.repull.dev/sessionId` instead of jumping straight to a single provider.
-
#create_connect_session_with_http_info(create_connect_session_request, opts = {}) ⇒ Array<(ConnectSession, Integer, Hash)>
Create a multi-channel Connect picker session Mints a session that lands the user on the channel picker at `connect.repull.dev/sessionId` instead of jumping straight to a single provider.
-
#create_connection(provider, opts = {}) ⇒ Connection
Connect to PMS/OTA provider Establish a connection to a PMS or OTA platform.
-
#create_connection_with_http_info(provider, opts = {}) ⇒ Array<(Connection, Integer, Hash)>
Connect to PMS/OTA provider Establish a connection to a PMS or OTA platform.
-
#delete_connection(provider, opts = {}) ⇒ nil
Disconnect provider Disconnect a PMS or OTA from this workspace.
-
#delete_connection_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Disconnect provider Disconnect a PMS or OTA from this workspace.
-
#get_connect_status(provider, opts = {}) ⇒ ConnectStatus
Get connection status 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.
-
#get_connect_status_with_http_info(provider, opts = {}) ⇒ Array<(ConnectStatus, Integer, Hash)>
Get connection status 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.
-
#initialize(api_client = ApiClient.default) ⇒ ConnectApi
constructor
A new instance of ConnectApi.
-
#list_connect_booking_rooms(session_id, opts = {}) ⇒ BookingConnectRoomsResponse
List Booking.com rooms imported for a Connect session Returns the rooms imported from the Booking.com hotel claimed in this Connect session, plus the customer’s listing options for the mapping dropdowns.
-
#list_connect_booking_rooms_with_http_info(session_id, opts = {}) ⇒ Array<(BookingConnectRoomsResponse, Integer, Hash)>
List Booking.com rooms imported for a Connect session Returns the rooms imported from the Booking.com hotel claimed in this Connect session, plus the customer's listing options for the mapping dropdowns.
-
#list_connect_providers(opts = {}) ⇒ ConnectProviderListResponse
List Connect channels Returns the public registry of every channel the picker supports.
-
#list_connect_providers_with_http_info(opts = {}) ⇒ Array<(ConnectProviderListResponse, Integer, Hash)>
List Connect channels Returns the public registry of every channel the picker supports.
-
#list_connections(opts = {}) ⇒ ConnectionListResponse
List PMS/OTA connections Returns all active connections to PMS and OTA platforms.
-
#list_connections_with_http_info(opts = {}) ⇒ Array<(ConnectionListResponse, Integer, Hash)>
List PMS/OTA connections Returns all active connections to PMS and OTA platforms.
-
#map_connect_booking_rooms(map_connect_booking_rooms_request, opts = {}) ⇒ MapConnectBookingRoomsResponse
Submit room→listing mappings for a Booking.com Connect session Submits the customer’s room→listing mapping choices in one transaction.
-
#map_connect_booking_rooms_with_http_info(map_connect_booking_rooms_request, opts = {}) ⇒ Array<(MapConnectBookingRoomsResponse, Integer, Hash)>
Submit room→listing mappings for a Booking.com Connect session Submits the customer's room→listing mapping choices in one transaction.
-
#select_connect_provider(session_id, select_connect_provider_request, opts = {}) ⇒ SelectProviderResponse
Bind a picker session to a provider Called by the hosted picker page once the user clicks a channel card.
-
#select_connect_provider_with_http_info(session_id, select_connect_provider_request, opts = {}) ⇒ Array<(SelectProviderResponse, Integer, Hash)>
Bind a picker session to a provider Called by the hosted picker page once the user clicks a channel card.
-
#verify_booking_hotel(booking_verify_hotel_request, opts = {}) ⇒ BookingVerifyHotelResponse
Verify a Booking.com hotel ID for a Connect session Manual-paste fallback that closes the Booking.com claim flow.
-
#verify_booking_hotel_with_http_info(booking_verify_hotel_request, opts = {}) ⇒ Array<(BookingVerifyHotelResponse, Integer, Hash)>
Verify a Booking.com hotel ID for a Connect session Manual-paste fallback that closes the Booking.com claim flow.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ConnectApi
Returns a new instance of ConnectApi.
19 20 21 |
# File 'lib/repull/api/connect_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/repull/api/connect_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_connect_session(create_connect_session_request, opts = {}) ⇒ ConnectSession
Create a multi-channel Connect picker session 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.
27 28 29 30 |
# File 'lib/repull/api/connect_api.rb', line 27 def create_connect_session(create_connect_session_request, opts = {}) data, _status_code, _headers = create_connect_session_with_http_info(create_connect_session_request, opts) data end |
#create_connect_session_with_http_info(create_connect_session_request, opts = {}) ⇒ Array<(ConnectSession, Integer, Hash)>
Create a multi-channel Connect picker session 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.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/repull/api/connect_api.rb', line 37 def create_connect_session_with_http_info(create_connect_session_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.create_connect_session ...' end # verify the required parameter 'create_connect_session_request' is set if @api_client.config.client_side_validation && create_connect_session_request.nil? fail ArgumentError, "Missing the required parameter 'create_connect_session_request' when calling ConnectApi.create_connect_session" end # resource path local_var_path = '/v1/connect' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_connect_session_request) # return_type return_type = opts[:debug_return_type] || 'ConnectSession' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConnectApi.create_connect_session", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#create_connect_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_connection(provider, opts = {}) ⇒ Connection
Connect to PMS/OTA provider 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.
96 97 98 99 |
# File 'lib/repull/api/connect_api.rb', line 96 def create_connection(provider, opts = {}) data, _status_code, _headers = create_connection_with_http_info(provider, opts) data end |
#create_connection_with_http_info(provider, opts = {}) ⇒ Array<(Connection, Integer, Hash)>
Connect to PMS/OTA provider 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.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/repull/api/connect_api.rb', line 107 def create_connection_with_http_info(provider, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.create_connection ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling ConnectApi.create_connection" end # resource path local_var_path = '/v1/connect/{provider}'.sub('{provider}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_connection_request']) # return_type return_type = opts[:debug_return_type] || 'Connection' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConnectApi.create_connection", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#create_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_connection(provider, opts = {}) ⇒ nil
Disconnect provider 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.
165 166 167 168 |
# File 'lib/repull/api/connect_api.rb', line 165 def delete_connection(provider, opts = {}) delete_connection_with_http_info(provider, opts) nil end |
#delete_connection_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Disconnect provider 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.
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/repull/api/connect_api.rb', line 175 def delete_connection_with_http_info(provider, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.delete_connection ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling ConnectApi.delete_connection" end # resource path local_var_path = '/v1/connect/{provider}'.sub('{provider}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConnectApi.delete_connection", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#delete_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_connect_status(provider, opts = {}) ⇒ ConnectStatus
Get connection status 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.
226 227 228 229 |
# File 'lib/repull/api/connect_api.rb', line 226 def get_connect_status(provider, opts = {}) data, _status_code, _headers = get_connect_status_with_http_info(provider, opts) data end |
#get_connect_status_with_http_info(provider, opts = {}) ⇒ Array<(ConnectStatus, Integer, Hash)>
Get connection status 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.
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/repull/api/connect_api.rb', line 236 def get_connect_status_with_http_info(provider, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.get_connect_status ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling ConnectApi.get_connect_status" end # resource path local_var_path = '/v1/connect/{provider}'.sub('{provider}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ConnectStatus' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConnectApi.get_connect_status", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#get_connect_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_connect_booking_rooms(session_id, opts = {}) ⇒ BookingConnectRoomsResponse
List Booking.com rooms imported for a Connect session 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.
289 290 291 292 |
# File 'lib/repull/api/connect_api.rb', line 289 def list_connect_booking_rooms(session_id, opts = {}) data, _status_code, _headers = list_connect_booking_rooms_with_http_info(session_id, opts) data end |
#list_connect_booking_rooms_with_http_info(session_id, opts = {}) ⇒ Array<(BookingConnectRoomsResponse, Integer, Hash)>
List Booking.com rooms imported for a Connect session 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.
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
# File 'lib/repull/api/connect_api.rb', line 299 def list_connect_booking_rooms_with_http_info(session_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.list_connect_booking_rooms ...' end # verify the required parameter 'session_id' is set if @api_client.config.client_side_validation && session_id.nil? fail ArgumentError, "Missing the required parameter 'session_id' when calling ConnectApi.list_connect_booking_rooms" end # resource path local_var_path = '/v1/connect/booking/rooms' # query parameters query_params = opts[:query_params] || {} query_params[:'sessionId'] = session_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'BookingConnectRoomsResponse' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"ConnectApi.list_connect_booking_rooms", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#list_connect_booking_rooms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_connect_providers(opts = {}) ⇒ ConnectProviderListResponse
List Connect channels Returns the public registry of every channel the picker supports. No customer-specific data — display metadata only. Cached for 5 minutes at the edge.
352 353 354 355 |
# File 'lib/repull/api/connect_api.rb', line 352 def list_connect_providers(opts = {}) data, _status_code, _headers = list_connect_providers_with_http_info(opts) data end |
#list_connect_providers_with_http_info(opts = {}) ⇒ Array<(ConnectProviderListResponse, Integer, Hash)>
List Connect channels Returns the public registry of every channel the picker supports. No customer-specific data — display metadata only. Cached for 5 minutes at the edge.
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/repull/api/connect_api.rb', line 361 def list_connect_providers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.list_connect_providers ...' end # resource path local_var_path = '/v1/connect/providers' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ConnectProviderListResponse' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"ConnectApi.list_connect_providers", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#list_connect_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_connections(opts = {}) ⇒ ConnectionListResponse
List PMS/OTA connections Returns all active connections to PMS and OTA platforms.
409 410 411 412 |
# File 'lib/repull/api/connect_api.rb', line 409 def list_connections(opts = {}) data, _status_code, _headers = list_connections_with_http_info(opts) data end |
#list_connections_with_http_info(opts = {}) ⇒ Array<(ConnectionListResponse, Integer, Hash)>
List PMS/OTA connections Returns all active connections to PMS and OTA platforms.
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/repull/api/connect_api.rb', line 418 def list_connections_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.list_connections ...' end # resource path local_var_path = '/v1/connect' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ConnectionListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"ConnectApi.list_connections", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#list_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#map_connect_booking_rooms(map_connect_booking_rooms_request, opts = {}) ⇒ MapConnectBookingRoomsResponse
Submit room→listing mappings for a Booking.com Connect session 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.
467 468 469 470 |
# File 'lib/repull/api/connect_api.rb', line 467 def map_connect_booking_rooms(map_connect_booking_rooms_request, opts = {}) data, _status_code, _headers = map_connect_booking_rooms_with_http_info(map_connect_booking_rooms_request, opts) data end |
#map_connect_booking_rooms_with_http_info(map_connect_booking_rooms_request, opts = {}) ⇒ Array<(MapConnectBookingRoomsResponse, Integer, Hash)>
Submit room→listing mappings for a Booking.com Connect session 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.
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
# File 'lib/repull/api/connect_api.rb', line 477 def map_connect_booking_rooms_with_http_info(map_connect_booking_rooms_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.map_connect_booking_rooms ...' end # verify the required parameter 'map_connect_booking_rooms_request' is set if @api_client.config.client_side_validation && map_connect_booking_rooms_request.nil? fail ArgumentError, "Missing the required parameter 'map_connect_booking_rooms_request' when calling ConnectApi.map_connect_booking_rooms" end # resource path local_var_path = '/v1/connect/booking/map-rooms' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(map_connect_booking_rooms_request) # return_type return_type = opts[:debug_return_type] || 'MapConnectBookingRoomsResponse' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"ConnectApi.map_connect_booking_rooms", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#map_connect_booking_rooms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#select_connect_provider(session_id, select_connect_provider_request, opts = {}) ⇒ SelectProviderResponse
Bind a picker session to a provider 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.
536 537 538 539 |
# File 'lib/repull/api/connect_api.rb', line 536 def select_connect_provider(session_id, select_connect_provider_request, opts = {}) data, _status_code, _headers = select_connect_provider_with_http_info(session_id, select_connect_provider_request, opts) data end |
#select_connect_provider_with_http_info(session_id, select_connect_provider_request, opts = {}) ⇒ Array<(SelectProviderResponse, Integer, Hash)>
Bind a picker session to a provider 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.
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/repull/api/connect_api.rb', line 547 def select_connect_provider_with_http_info(session_id, select_connect_provider_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.select_connect_provider ...' end # verify the required parameter 'session_id' is set if @api_client.config.client_side_validation && session_id.nil? fail ArgumentError, "Missing the required parameter 'session_id' when calling ConnectApi.select_connect_provider" end # verify the required parameter 'select_connect_provider_request' is set if @api_client.config.client_side_validation && select_connect_provider_request.nil? fail ArgumentError, "Missing the required parameter 'select_connect_provider_request' when calling ConnectApi.select_connect_provider" end # resource path local_var_path = '/v1/connect/sessions/{sessionId}/select-provider'.sub('{sessionId}', CGI.escape(session_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(select_connect_provider_request) # return_type return_type = opts[:debug_return_type] || 'SelectProviderResponse' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"ConnectApi.select_connect_provider", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#select_connect_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#verify_booking_hotel(booking_verify_hotel_request, opts = {}) ⇒ BookingVerifyHotelResponse
Verify a Booking.com hotel ID for a Connect session 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.
609 610 611 612 |
# File 'lib/repull/api/connect_api.rb', line 609 def verify_booking_hotel(booking_verify_hotel_request, opts = {}) data, _status_code, _headers = verify_booking_hotel_with_http_info(booking_verify_hotel_request, opts) data end |
#verify_booking_hotel_with_http_info(booking_verify_hotel_request, opts = {}) ⇒ Array<(BookingVerifyHotelResponse, Integer, Hash)>
Verify a Booking.com hotel ID for a Connect session 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.
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 |
# File 'lib/repull/api/connect_api.rb', line 619 def verify_booking_hotel_with_http_info(booking_verify_hotel_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ConnectApi.verify_booking_hotel ...' end # verify the required parameter 'booking_verify_hotel_request' is set if @api_client.config.client_side_validation && booking_verify_hotel_request.nil? fail ArgumentError, "Missing the required parameter 'booking_verify_hotel_request' when calling ConnectApi.verify_booking_hotel" end # resource path local_var_path = '/v1/connect/booking/verify' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(booking_verify_hotel_request) # return_type return_type = opts[:debug_return_type] || 'BookingVerifyHotelResponse' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"ConnectApi.verify_booking_hotel", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ConnectApi#verify_booking_hotel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |