encode<V> static method

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

Implementation

static V encode<V>(
  CardholderIndividual instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.cardIssuing != null) {
    CardholderCardIssuing.encode(
      instance.cardIssuing!,
      container.nestedSingleValueContainer('card_issuing').encoder,
    );
  }
  if (instance.dob != null) {
    AccountDob.encode(
      instance.dob!,
      container.nestedSingleValueContainer('dob').encoder,
    );
  }
  if (instance.firstName != null) {
    container.encodeString(
      'first_name',
      instance.firstName!,
    );
  }
  if (instance.lastName != null) {
    container.encodeString(
      'last_name',
      instance.lastName!,
    );
  }
  if (instance.verification != null) {
    AccountVerification.encode(
      instance.verification!,
      container.nestedSingleValueContainer('verification').encoder,
    );
  }
  return container.value;
}