encode<V> static method

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

Implementation

static V encode<V>(
  SubscriptionMandateOptions instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.amount != null) {
    container.encodeInt(
      'amount',
      instance.amount!,
    );
  }
  if (instance.amountType != null) {
    PaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType.encode(
      instance.amountType!,
      container.nestedSingleValueContainer('amount_type').encoder,
    );
  }
  if (instance.description != null) {
    container.encodeString(
      'description',
      instance.description!,
    );
  }
  return container.value;
}