import { Client } from '../../Client'; import { ListParamsBookings, StaysBooking } from '../StaysTypes'; import { Resource } from '../../Resource'; import { DuffelResponse, PaginationMeta } from '../../types'; export interface StaysBookingPayload { quote_id: string; loyalty_programme_account_number?: string; guests: Array<{ given_name: string; family_name: string; /** * Creates an association between the guest and a previously created user. * This is intended to allow guests the ability to manage their own bookings. * @example ["icu_0000000000000000000000"] */ user_id?: string; }>; email: string; phone_number: string; accommodation_special_requests?: string; payment?: { card_id: string; } | { three_d_secure_session_id: string; }; metadata?: StaysBooking['metadata']; /** * The ids of users that would be allowed to manage the booking. * @example ["icu_0000000000000000000000"] */ users?: string[]; } export declare class Bookings extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Create a booking * @param {object} payload - The booking payload, including quote id and guest information */ create: (payload: StaysBookingPayload) => Promise>; /** * Get a booking * @param {string} bookingId - The ID of the booking */ get: (bookingId: string) => Promise>; /** * List bookings * @param {Object} [options] - Pagination options (optional: limit, after, before) * @link https://duffel.com/docs/api/bookings/list-bookings */ list: (options?: PaginationMeta & ListParamsBookings) => Promise>; /** * Retrieves a generator of all bookings. The results may be returned in any order. * @link https://duffel.com/docs/api/bookings/list-bookings */ listWithGenerator: (options?: ListParamsBookings) => AsyncGenerator, void, unknown>; /** * Cancel a booking * @param {string} bookingId - The ID of the booking */ cancel: (bookingId: string) => Promise>; }