encode<V> static method

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

Implementation

static V encode<V>(
  BillingPortalConfigurationUpdateOptionsFeatures instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.customerUpdate != null) {
    BillingPortalConfigurationUpdateOptionsFeaturesCustomerUpdate.encode(
      instance.customerUpdate!,
      container.nestedSingleValueContainer('customer_update').encoder,
    );
  }
  if (instance.invoiceHistory != null) {
    PortalSubscriptionPause.encode(
      instance.invoiceHistory!,
      container.nestedSingleValueContainer('invoice_history').encoder,
    );
  }
  if (instance.paymentMethodUpdate != null) {
    PortalSubscriptionPause.encode(
      instance.paymentMethodUpdate!,
      container.nestedSingleValueContainer('payment_method_update').encoder,
    );
  }
  if (instance.subscriptionCancel != null) {
    BillingPortalConfigurationUpdateOptionsFeaturesSubscriptionCancel.encode(
      instance.subscriptionCancel!,
      container.nestedSingleValueContainer('subscription_cancel').encoder,
    );
  }
  if (instance.subscriptionPause != null) {
    CheckoutCardInstallmentsOptions.encode(
      instance.subscriptionPause!,
      container.nestedSingleValueContainer('subscription_pause').encoder,
    );
  }
  if (instance.subscriptionUpdate != null) {
    BillingPortalConfigurationUpdateOptionsFeaturesSubscriptionUpdate.encode(
      instance.subscriptionUpdate!,
      container.nestedSingleValueContainer('subscription_update').encoder,
    );
  }
  return container.value;
}