encode<V> static method

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

Implementation

static V encode<V>(
  OutboundPaymentsPaymentMethodDetailsUsBankAccount instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.accountHolderType != null) {
    InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType.encode(
      instance.accountHolderType!,
      container.nestedSingleValueContainer('account_holder_type').encoder,
    );
  }
  if (instance.accountType != null) {
    InboundTransfersPaymentMethodDetailsUsBankAccountAccountType.encode(
      instance.accountType!,
      container.nestedSingleValueContainer('account_type').encoder,
    );
  }
  if (instance.bankName != null) {
    container.encodeString(
      'bank_name',
      instance.bankName!,
    );
  }
  if (instance.fingerprint != null) {
    container.encodeString(
      'fingerprint',
      instance.fingerprint!,
    );
  }
  if (instance.last4 != null) {
    container.encodeString(
      'last4',
      instance.last4!,
    );
  }
  if (instance.mandate != null) {
    MandateOrId.encode(
      instance.mandate!,
      container.nestedSingleValueContainer('mandate').encoder,
    );
  }
  container.encodeString(
    'network',
    instance.network,
  );
  if (instance.routingNumber != null) {
    container.encodeString(
      'routing_number',
      instance.routingNumber!,
    );
  }
  return container.value;
}