IssuingTransactionFlightData.fromJson constructor

IssuingTransactionFlightData.fromJson(
  1. Object? json
)

Implementation

factory IssuingTransactionFlightData.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return IssuingTransactionFlightData(
    departureAt: map['departure_at'] == null
        ? null
        : (map['departure_at'] as num).toInt(),
    passengerName: map['passenger_name'] == null
        ? null
        : (map['passenger_name'] as String),
    refundable:
        map['refundable'] == null ? null : (map['refundable'] as bool),
    segments: map['segments'] == null
        ? null
        : (map['segments'] as List<Object?>)
            .map((el) => IssuingTransactionFlightDataLeg.fromJson(el))
            .toList(),
    travelAgency: map['travel_agency'] == null
        ? null
        : (map['travel_agency'] as String),
  );
}