encode<V> static method
Implementation
static V encode<V>(
AuthorizationPurchaseDetails instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.flight != null) {
AuthorizationFlight.encode(
instance.flight!,
container.nestedSingleValueContainer('flight').encoder,
);
}
if (instance.fuel != null) {
AuthorizationFuel.encode(
instance.fuel!,
container.nestedSingleValueContainer('fuel').encoder,
);
}
if (instance.lodging != null) {
AuthorizationLodging.encode(
instance.lodging!,
container.nestedSingleValueContainer('lodging').encoder,
);
}
if (instance.receipt != null) {
container.encodeList(
'receipt',
(container) =>
instance.receipt!.forEach((el) => AuthorizationReceiptItem.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
if (instance.reference != null) {
container.encodeString(
'reference',
instance.reference!,
);
}
return container.value;
}