encode<V> static method
Implementation
static V encode<V>(
ConfigurationSubscriptionCancel instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
if (instance.cancellationReason != null) {
ConfigurationCancellationReason.encode(
instance.cancellationReason!,
container.nestedSingleValueContainer('cancellation_reason').encoder,
);
}
container.encodeBool(
'enabled',
instance.enabled,
);
if (instance.mode != null) {
PortalSubscriptionCancelMode.encode(
instance.mode!,
container.nestedSingleValueContainer('mode').encoder,
);
}
if (instance.prorationBehavior != null) {
PortalSubscriptionCancelProrationBehavior.encode(
instance.prorationBehavior!,
container.nestedSingleValueContainer('proration_behavior').encoder,
);
}
return container.value;
}