encode<V> static method
Implementation
static V encode<V>(
CardSpendingControls instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.allowedCategories != null) {
container.encodeList(
'allowed_categories',
(container) => instance.allowedCategories!.forEach((el) =>
IssuingCardholderSpendingControlsAllowedCategoriesItem.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
if (instance.blockedCategories != null) {
container.encodeList(
'blocked_categories',
(container) => instance.blockedCategories!.forEach((el) =>
IssuingCardholderSpendingControlsAllowedCategoriesItem.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
if (instance.spendingLimits != null) {
container.encodeList(
'spending_limits',
(container) => instance.spendingLimits!
.forEach((el) => CardholderSpendingLimitsItem.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
return container.value;
}