encode<V> static method
Implementation
static V encode<V>(
PortalSubscriptionUpdate instance,
Encoder<V> encoder,
) {
final container = encoder.container<String>();
container.encodeList(
'default_allowed_updates',
(container) => instance.defaultAllowedUpdates
.forEach((el) => container.encodeString(el)),
);
container.encodeBool(
'enabled',
instance.enabled,
);
if (instance.products != null) {
container.encodeList(
'products',
(container) => instance.products!
.forEach((el) => PortalSubscriptionUpdateProduct.encode(
el,
container.nestedSingleValueContainer().encoder,
)),
);
}
PortalSubscriptionCancelProrationBehavior.encode(
instance.prorationBehavior,
container.nestedSingleValueContainer('proration_behavior').encoder,
);
return container.value;
}