encode<V> static method

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

Implementation

static V encode<V>(
  MandateAcssDebit instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.defaultFor != null) {
    container.encodeList(
      'default_for',
      (container) => instance.defaultFor!.forEach(
          (el) => CheckoutAcssDebitMandateOptionsDefaultForItem.encode(
                el,
                container.nestedSingleValueContainer().encoder,
              )),
    );
  }
  if (instance.intervalDescription != null) {
    container.encodeString(
      'interval_description',
      instance.intervalDescription!,
    );
  }
  container.encodeString(
    'payment_schedule',
    instance.paymentSchedule,
  );
  container.encodeString(
    'transaction_type',
    instance.transactionType,
  );
  return container.value;
}