encode<V> static method
Implementation
static V encode<V>(
IssuingCardUpdateOptions instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.cancellationReason != null) {
container.encodeString(
'cancellation_reason',
instance.cancellationReason!,
);
}
if (instance.expand != null) {
container.encodeList(
'expand',
(container) =>
instance.expand!.forEach((el) => container.encodeString(el)),
);
}
if (instance.metadata != null) {
container.encodeMap(
'metadata',
(container) => instance.metadata!.forEach((
key,
value,
) =>
container.encodeString(
key,
value,
)),
);
}
if (instance.personalizationDesign != null) {
container.encodeString(
'personalization_design',
instance.personalizationDesign!,
);
}
if (instance.pin != null) {
CardPin.encode(
instance.pin!,
container.nestedSingleValueContainer('pin').encoder,
);
}
if (instance.spendingControls != null) {
CardSpendingControls.encode(
instance.spendingControls!,
container.nestedSingleValueContainer('spending_controls').encoder,
);
}
if (instance.status != null) {
IssuingCardStatus.encode(
instance.status!,
container.nestedSingleValueContainer('status').encoder,
);
}
return container.value;
}