AuthorizationPurchaseDetails.fromJson constructor

AuthorizationPurchaseDetails.fromJson(
  1. Object? json
)

Implementation

factory AuthorizationPurchaseDetails.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return AuthorizationPurchaseDetails(
    flight: map['flight'] == null
        ? null
        : AuthorizationFlight.fromJson(map['flight']),
    fuel:
        map['fuel'] == null ? null : AuthorizationFuel.fromJson(map['fuel']),
    lodging: map['lodging'] == null
        ? null
        : AuthorizationLodging.fromJson(map['lodging']),
    receipt: map['receipt'] == null
        ? null
        : (map['receipt'] as List<Object?>)
            .map((el) => AuthorizationReceiptItem.fromJson(el))
            .toList(),
    reference: map['reference'] == null ? null : (map['reference'] as String),
  );
}