encode<V> static method

V encode<V>(
  1. BillingPortalConfigurationUpdateOptionsFeaturesCustomerUpdate instance,
  2. Encoder<V> encoder
)

Implementation

static V encode<V>(
  BillingPortalConfigurationUpdateOptionsFeaturesCustomerUpdate instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.allowedUpdates != null) {
    container.encodeList(
      'allowed_updates',
      (container) => instance.allowedUpdates!
          .forEach((el) => PortalCustomerUpdateAllowedUpdatesItem.encode(
                el,
                container.nestedSingleValueContainer().encoder,
              )),
    );
  }
  if (instance.enabled != null) {
    container.encodeBool(
      'enabled',
      instance.enabled!,
    );
  }
  return container.value;
}