encode<V> static method

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

Implementation

static V encode<V>(
  PaymentMethodUsBankAccount 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.financialConnectionsAccount != null) {
    container.encodeString(
      'financial_connections_account',
      instance.financialConnectionsAccount!,
    );
  }
  if (instance.fingerprint != null) {
    container.encodeString(
      'fingerprint',
      instance.fingerprint!,
    );
  }
  if (instance.last4 != null) {
    container.encodeString(
      'last4',
      instance.last4!,
    );
  }
  if (instance.networks != null) {
    PaymentMethodUsBankAccountNetworks.encode(
      instance.networks!,
      container.nestedSingleValueContainer('networks').encoder,
    );
  }
  if (instance.routingNumber != null) {
    container.encodeString(
      'routing_number',
      instance.routingNumber!,
    );
  }
  if (instance.statusDetails != null) {
    PaymentMethodUsBankAccountStatusDetails.encode(
      instance.statusDetails!,
      container.nestedSingleValueContainer('status_details').encoder,
    );
  }
  return container.value;
}