encode<V> static method

V encode<V>(
  1. IssuingTransactionFlightDataLeg instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  IssuingTransactionFlightDataLeg instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.arrivalAirportCode != null) {
    container.encodeString(
      'arrival_airport_code',
      instance.arrivalAirportCode!,
    );
  }
  if (instance.carrier != null) {
    container.encodeString(
      'carrier',
      instance.carrier!,
    );
  }
  if (instance.departureAirportCode != null) {
    container.encodeString(
      'departure_airport_code',
      instance.departureAirportCode!,
    );
  }
  if (instance.flightNumber != null) {
    container.encodeString(
      'flight_number',
      instance.flightNumber!,
    );
  }
  if (instance.serviceClass != null) {
    container.encodeString(
      'service_class',
      instance.serviceClass!,
    );
  }
  if (instance.stopoverAllowed != null) {
    container.encodeBool(
      'stopover_allowed',
      instance.stopoverAllowed!,
    );
  }
  return container.value;
}