UNPKG

@revolugo/booking-api-client

Version:

Javascript Revolugo Booking API Client (browser + server)

114 lines (113 loc) 13 kB
import { CurrencyClient, HotelOffersApiResponse, Locale } from '../models/index.ts'; import { TPollerCallback } from '@revolugo/common/utils'; /** * Revolugo Booking API Reference * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.5.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime.ts'; export interface HotelOffersListPayload { currency: CurrencyClient; hotelOfferRequestId: string; endingBefore?: string | null; filterByPrice?: string; filterByReviewRating?: number; filterByStar?: string; hotelRoomOffersLimit?: number; includeHotelContentDetails?: boolean | null; lang?: Locale; limit?: number; onlyRecommendedHotelOffers?: boolean | null; priceHistogramStepCount?: number; sortBy?: HotelOffersSortByEnum; sortByOrder?: HotelOffersSortByOrderEnum; startingAfter?: string | null; } /** * HotelOffers - interface * * @export * @interface HotelOffersInterface */ export interface HotelOffersInterface { /** * You\'ll then make a call to the **Hotel Offers** endpoint to retrieve a list of **Hotel Offers** associated with your **Hotel Offer Request**. We\'ll send your search to a pool of hotels matching the search parameters you provided previously. The **Hotel Offers** endpoint will return hotels with available rates as **Hotel Room Offers** objects for each hotel in the list. For a detailed overview of the **Hotel Room Offer** object, see **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. ⚠️ **IMPORTANT**: The **Hotel Room Offers** included in each **Hotel Offer** returned by the **[Retrieve Hotel Offers](/v1/documentation#operation/getV1Hotel_offers)** endpoint might be **<span style=\"color:red\">cached data</span>**. In that case, the returned prices/availability may be slightly different from actual live inventory. In order to retrieve accurate and live **Hotel Room Offers** for a specific hotel you need to make a call to the **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. We do not recommend to systematically call **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** for each hotel offer retrieved as it may trigger rate limiting on your API calls. Rather we recommend to do this as an explicit two-step process: first you check **Hotel Offers** around a location, then, once your customer shows interest in a specific **Hotel Offer**, you check **Hotel Room Offers** on that specific hotel. This endpoint requires ⚛️ **[Polling](/v1/documentation#tag/Polling)**. * @summary ⚛️ Retrieve Hotel Offers * @param {CurrencyClient} currency ISO 4217 currency code. * @param {string} hotelOfferRequestId id of the **Hotel Offer Request** previously created via [Create Hotel Offer Request](/v1/documentation#operation/postV1Hotel_offer_requests). * @param {string} [endingBefore] A cursor to use in pagination. &#x60;ending_before&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with &#x60;obj_bar&#x60;, your subsequent call can include &#x60;ending_before&#x3D;obj_bar&#x60; in order to fetch the previous page of the list. ⚠️ Has no effect when **only_recommended_hotel_offers** &#x3D; **true** (default). * @param {string} [filterByPrice] Filter hotel offers by price per night interval. e.g.: \&quot;200-400\&quot; or \&quot;-400\&quot; or \&quot;100\&quot;. ⚠️ Has no effect when **only_recommended_hotel_offers** &#x3D; **true** (default). * @param {number} [filterByReviewRating] Filter hotels that have guest reviews over 6/10. * @param {string} [filterByStar] Filter hotel offers by star rating. e.g.: \&quot;1,2,3\&quot; will return only hotels with 1, 2 or 3 star rating. * @param {number} [hotelRoomOffersLimit] Limit the number of **Hotel Room Offers**, embedded on each **Hotel Offer** object, sorted by price. * @param {boolean} [includeHotelContentDetails] Include hotel content details on each **Hotel Offer** object. * @param {Locale} [lang] Set the language for the returned content using a valid language code. * @param {number} [limit] Limit the number of **Hotel Offers** returned. Limit can range between 1 and 100. ⚠️ Has no effect when **only_recommended_hotel_offers** &#x3D; **true** (default). * @param {boolean} [onlyRecommendedHotelOffers] By default, filtering and sorting of returned **Hotel Offer** list is performed by our own **Search Engine** algorithm in order to maximize conversion rate. 💡 &lt;span style&#x3D;\&quot;color:green\&quot;&gt;When turned on, the endpoint returns a list limited to 10 **Hotel Offers**&lt;/span&gt; Set it to **false** in order to disable this feature. * @param {number} [priceHistogramStepCount] Number of price steps to be included in the returned **price_histogram** dataset. e.g.: \&quot;15\&quot; will return a dataset with 15 price steps. * @param {'distance' | 'price' | 'rating' | 'review_rating' | 'top_picks'} [sortBy] Sort the returned **Hotel Offer** list. The sorting feature can only perform sorting based on 1 type whichever specified first. ⚠️ Has no effect when **only_recommended_hotel_offers** &#x3D; **true** (default). * @param {'asc' | 'desc'} [sortByOrder] Sort **Hotel Offer** list in **asc**ending or **desc**ending order. ⚠️ Has no effect when **only_recommended_hotel_offers** &#x3D; **true** (default). * @param {string} [startingAfter] A cursor to use in pagination. &#x60;starting_after&#x60; is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with &#x60;obj_foo&#x60;, your subsequent call can include &#x60;starting_after&#x3D;obj_foo&#x60; in order to fetch the next page of the list. ⚠️ Has no effect when **only_recommended_hotel_offers** &#x3D; **true** (default). * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof HotelOffersInterface */ listRaw(requestParameters: HotelOffersListPayload, initOverrides?: RequestInit & { minCallCount?: number; maxCallCount?: number; }): Promise<runtime.ApiResponse<HotelOffersApiResponse>>; /** * You\'ll then make a call to the **Hotel Offers** endpoint to retrieve a list of **Hotel Offers** associated with your **Hotel Offer Request**. We\'ll send your search to a pool of hotels matching the search parameters you provided previously. The **Hotel Offers** endpoint will return hotels with available rates as **Hotel Room Offers** objects for each hotel in the list. For a detailed overview of the **Hotel Room Offer** object, see **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. ⚠️ **IMPORTANT**: The **Hotel Room Offers** included in each **Hotel Offer** returned by the **[Retrieve Hotel Offers](/v1/documentation#operation/getV1Hotel_offers)** endpoint might be **<span style=\"color:red\">cached data</span>**. In that case, the returned prices/availability may be slightly different from actual live inventory. In order to retrieve accurate and live **Hotel Room Offers** for a specific hotel you need to make a call to the **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. We do not recommend to systematically call **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** for each hotel offer retrieved as it may trigger rate limiting on your API calls. Rather we recommend to do this as an explicit two-step process: first you check **Hotel Offers** around a location, then, once your customer shows interest in a specific **Hotel Offer**, you check **Hotel Room Offers** on that specific hotel. This endpoint requires ⚛️ **[Polling](/v1/documentation#tag/Polling)**. * ⚛️ Retrieve Hotel Offers */ list(requestParameters: HotelOffersListPayload, pollerCallback?: TPollerCallback<HotelOffersApiResponse>, initOverrides?: RequestInit & { minCallCount?: number; maxCallCount?: number; }): Promise<HotelOffersApiResponse>; } /** * */ export declare class HotelOffers extends runtime.BaseAPI implements HotelOffersInterface { /** * You\'ll then make a call to the **Hotel Offers** endpoint to retrieve a list of **Hotel Offers** associated with your **Hotel Offer Request**. We\'ll send your search to a pool of hotels matching the search parameters you provided previously. The **Hotel Offers** endpoint will return hotels with available rates as **Hotel Room Offers** objects for each hotel in the list. For a detailed overview of the **Hotel Room Offer** object, see **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. ⚠️ **IMPORTANT**: The **Hotel Room Offers** included in each **Hotel Offer** returned by the **[Retrieve Hotel Offers](/v1/documentation#operation/getV1Hotel_offers)** endpoint might be **<span style=\"color:red\">cached data</span>**. In that case, the returned prices/availability may be slightly different from actual live inventory. In order to retrieve accurate and live **Hotel Room Offers** for a specific hotel you need to make a call to the **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. We do not recommend to systematically call **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** for each hotel offer retrieved as it may trigger rate limiting on your API calls. Rather we recommend to do this as an explicit two-step process: first you check **Hotel Offers** around a location, then, once your customer shows interest in a specific **Hotel Offer**, you check **Hotel Room Offers** on that specific hotel. This endpoint requires ⚛️ **[Polling](/v1/documentation#tag/Polling)**. * ⚛️ Retrieve Hotel Offers */ listRaw(requestParameters: HotelOffersListPayload, initOverrides?: RequestInit & { minCallCount?: number; maxCallCount?: number; }): Promise<runtime.ApiResponse<HotelOffersApiResponse>>; /** * You\'ll then make a call to the **Hotel Offers** endpoint to retrieve a list of **Hotel Offers** associated with your **Hotel Offer Request**. We\'ll send your search to a pool of hotels matching the search parameters you provided previously. The **Hotel Offers** endpoint will return hotels with available rates as **Hotel Room Offers** objects for each hotel in the list. For a detailed overview of the **Hotel Room Offer** object, see **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. ⚠️ **IMPORTANT**: The **Hotel Room Offers** included in each **Hotel Offer** returned by the **[Retrieve Hotel Offers](/v1/documentation#operation/getV1Hotel_offers)** endpoint might be **<span style=\"color:red\">cached data</span>**. In that case, the returned prices/availability may be slightly different from actual live inventory. In order to retrieve accurate and live **Hotel Room Offers** for a specific hotel you need to make a call to the **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** endpoint. We do not recommend to systematically call **[Retrieve Hotel Room Offers](/v1/documentation#operation/getV1Hotel_room_offers)** for each hotel offer retrieved as it may trigger rate limiting on your API calls. Rather we recommend to do this as an explicit two-step process: first you check **Hotel Offers** around a location, then, once your customer shows interest in a specific **Hotel Offer**, you check **Hotel Room Offers** on that specific hotel. This endpoint requires ⚛️ **[Polling](/v1/documentation#tag/Polling)**. * ⚛️ Retrieve Hotel Offers */ list(requestParameters: HotelOffersListPayload, pollerCallback?: TPollerCallback<HotelOffersApiResponse>, initOverrides?: RequestInit & { minCallCount?: number; maxCallCount?: number; }): Promise<HotelOffersApiResponse>; } /** * @export */ export declare const HotelOffersSortByEnum: { Distance: "distance"; Price: "price"; Rating: "rating"; ReviewRating: "review_rating"; TopPicks: "top_picks"; }; export type HotelOffersSortByEnum = typeof HotelOffersSortByEnum[keyof typeof HotelOffersSortByEnum]; /** * @export */ export declare const HotelOffersSortByOrderEnum: { Asc: "asc"; Desc: "desc"; }; export type HotelOffersSortByOrderEnum = typeof HotelOffersSortByOrderEnum[keyof typeof HotelOffersSortByOrderEnum];