Duffel.Schema.Passenger (Duffel v0.1.0)

Copy Markdown View Source

A passenger on an offer request, offer or order.

The fields are a superset of the offer-side passenger (id, type, age) and the booked order passenger (title, gender, born_on, contact details). Fields that do not apply to a given response are nil.

loyalty_programme_accounts and identity_documents are kept as raw maps.

Summary

Functions

Decodes a raw passenger map into a Duffel.Schema.Passenger.

Types

t()

@type t() :: %Duffel.Schema.Passenger{
  age: integer() | nil,
  born_on: String.t() | nil,
  email: String.t() | nil,
  family_name: String.t() | nil,
  fare_type: String.t() | nil,
  gender: String.t() | nil,
  given_name: String.t() | nil,
  id: String.t() | nil,
  identity_documents: [map()],
  infant_passenger_id: String.t() | nil,
  loyalty_programme_accounts: [map()],
  phone_number: String.t() | nil,
  title: String.t() | nil,
  type: String.t() | nil,
  user_id: String.t() | nil
}

Functions

from_map(decoded)

@spec from_map(map() | t()) :: t()

Decodes a raw passenger map into a Duffel.Schema.Passenger.