encode<V> static method

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

Implementation

static V encode<V>(
  SepaDebitGeneratedFrom instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.charge != null) {
    ChargeOrId.encode(
      instance.charge!,
      container.nestedSingleValueContainer('charge').encoder,
    );
  }
  if (instance.setupAttempt != null) {
    SetupAttemptOrId.encode(
      instance.setupAttempt!,
      container.nestedSingleValueContainer('setup_attempt').encoder,
    );
  }
  return container.value;
}