encode<V> static method

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

Implementation

static V encode<V>(
  OutboundTransfersPaymentMethodDetails instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  TreasurySharedResourceBillingDetails.encode(
    instance.billingDetails,
    container.nestedSingleValueContainer('billing_details').encoder,
  );
  container.encodeString(
    'type',
    'us_bank_account',
  );
  if (instance.usBankAccount != null) {
    OutboundTransfersPaymentMethodDetailsUsBankAccount.encode(
      instance.usBankAccount!,
      container.nestedSingleValueContainer('us_bank_account').encoder,
    );
  }
  return container.value;
}