encode<V> static method

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

Implementation

static V encode<V>(
  GelatoVerifiedOutputs instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.address != null) {
    Address.encode(
      instance.address!,
      container.nestedSingleValueContainer('address').encoder,
    );
  }
  if (instance.dob != null) {
    GelatoDataVerifiedOutputsDate.encode(
      instance.dob!,
      container.nestedSingleValueContainer('dob').encoder,
    );
  }
  if (instance.firstName != null) {
    container.encodeString(
      'first_name',
      instance.firstName!,
    );
  }
  if (instance.idNumber != null) {
    container.encodeString(
      'id_number',
      instance.idNumber!,
    );
  }
  if (instance.idNumberType != null) {
    GelatoIdNumberReportIdNumberType.encode(
      instance.idNumberType!,
      container.nestedSingleValueContainer('id_number_type').encoder,
    );
  }
  if (instance.lastName != null) {
    container.encodeString(
      'last_name',
      instance.lastName!,
    );
  }
  return container.value;
}