encode<V> static method
Implementation
static V encode<V>(
PersonRequirements instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.alternatives != null) {
container.encodeList(
'alternatives',
(container) => instance.alternatives!
.forEach((el) => AccountRequirementsAlternative.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
container.encodeList(
'currently_due',
(container) =>
instance.currentlyDue.forEach((el) => container.encodeString(el)),
);
container.encodeList(
'errors',
(container) =>
instance.errors.forEach((el) => AccountRequirementsError.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
container.encodeList(
'eventually_due',
(container) =>
instance.eventuallyDue.forEach((el) => container.encodeString(el)),
);
container.encodeList(
'past_due',
(container) =>
instance.pastDue.forEach((el) => container.encodeString(el)),
);
container.encodeList(
'pending_verification',
(container) => instance.pendingVerification
.forEach((el) => container.encodeString(el)),
);
return container.value;
}