Batched flight search: create returns immediately with total_batches;
poll get/3 to receive offers batch by batch as airlines respond.
get/3 long-polls until the next batch is available or all batches
have been returned.
See the Duffel documentation.
Summary
Functions
@spec create(Duffel.Client.t(), map(), keyword()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Creates a batch offer request.
Takes the same search parameters as Duffel.OfferRequests.create/3.
Options
:params- query string parameters, e.g.params: [supplier_timeout: 10_000]
@spec get(Duffel.Client.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Duffel.Error.t()}
Long-polls for the next batch of offers.
Call repeatedly until remaining_batches reaches zero.
Options
:params- query string parameters.view: "itineraries"groups the offers into slices, itineraries and brands with shared airlines, places and aircraft in top-level reference maps, instead of the flat list of offersview: "offers"(the default) returns
Examples
Duffel.BatchOfferRequests.get(client, "brq_123", params: [view: "itineraries"])Decode that shape with Duffel.Schema.ItineraryView.from_map/1.