import { Client } from '../../Client'; import { Resource } from '../../Resource'; import { DuffelResponse, GetOfferPricedParams, ListOffersParams, Offer, OfferPriced, LoyaltyProgrammeAccounts, UpdateOffer } from '../../types'; interface UpdateOfferBodyParameters { loyalty_programme_accounts: LoyaltyProgrammeAccounts[]; given_name: string; family_name: string; } /** * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria. * @class * @link https://duffel.com/docs/api/offers */ export declare class Offers extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Retrieves an offer by its ID * @param {string} id - Duffel's unique identifier for the offer * @param {string} return_available_services - When set to true, the offer resource returned will include all the available_services returned by the airline. If set to false, the offer resource won't include any available_services. * @link https:/duffel.com/docs/api/offers/get-offer-by-id */ get: (id: string, params?: { return_available_services: boolean; }) => Promise>; /** * Retrieves a page of offers. The results may be returned in any order. * @param {Object.} params - Endpoint options (optional: limit, after, before, max_connections, sort) * @param {string} params.offer_request_id - Duffel's unique identifier for the offer request, returned when it was created * @link https://duffel.com/docs/api/offers/get-offers */ list: ({ offer_request_id, ...params }: ListOffersParams) => Promise>; /** * Retrieves a generator of all offers. The results may be returned in any order. * @param {Object.} params - Endpoint options (optional: limit, after, before, max_connections, sort) * @param {string} params.offer_request_id - Duffel's unique identifier for the offer request, returned when it was created * @link https://duffel.com/docs/api/offers/get-offers */ listWithGenerator: ({ offer_request_id, ...params }: ListOffersParams) => AsyncGenerator, void, unknown>; /** * Some offer passenger fields are updateable. Each field that can be updated is detailed in the request object. * @param {string} offerId - Duffel's unique identifier for the offer * @param {string} passengerId - The identifier for the passenger. This ID will be generated by Duffel * @param {string} params.family_name - The passenger's family name. Only space, -, ', and letters from the ASCII, Latin-1 Supplement and Latin Extended-A (with the exceptions of Æ, æ, IJ, ij, Œ, œ, Þ, and ð) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters. * @param {string} params.given_name - The passenger's given name. Only space, -, ', and letters from the ASCII, Latin-1 Supplement and Latin Extended-A (with the exceptions of Æ, æ, IJ, ij, Œ, œ, Þ, and ð) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters. * @param {Object.} params.loyalty_programme_accounts - The Loyalty Programme Accounts for this passenger */ update: (offerId: string, passengerId: string, params: UpdateOfferBodyParameters) => Promise>; /** * Price the offer with intended payment methods and intended services. This will return the total amount that will be charged to the customer, including any applicable surcharges. * @param {string} offerId - Duffel's unique identifier for the offer * @param {Object.} params - The intended payment methods and services of the offer */ getPriced: (offerId: string, params: GetOfferPricedParams) => Promise>; /** * Retrieve all fare brands given a basic fare offer. Applicable only for some airlines. All of the returned offers have the same itinerary. * @param {string} offerId - Duffel's unique identifier for the offer */ upsellFares: (offerId: string) => Promise>; } export {};