encode<V> static method
Implementation
static V encode<V>(
SubscriptionCreateOptionsPaymentSettings instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.paymentMethodOptions != null) {
SubscriptionPaymentMethodOptions.encode(
instance.paymentMethodOptions!,
container.nestedSingleValueContainer('payment_method_options').encoder,
);
}
if (instance.paymentMethodTypes != null) {
container.encodeList(
'payment_method_types',
(container) => instance.paymentMethodTypes!.forEach(
(el) => InvoicesPaymentSettingsPaymentMethodTypesItem.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
if (instance.saveDefaultPaymentMethod != null) {
container.encodeString(
'save_default_payment_method',
instance.saveDefaultPaymentMethod!,
);
}
return container.value;
}