encode<V> static method

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

Implementation

static V encode<V>(
  GelatoIdNumberReport instance,
  Encoder<V> encoder,
) {
  final container = encoder.container<String>();
  if (instance.dob != null) {
    GelatoDataVerifiedOutputsDate.encode(
      instance.dob!,
      container.nestedSingleValueContainer('dob').encoder,
    );
  }
  if (instance.error != null) {
    GelatoIdNumberReportError.encode(
      instance.error!,
      container.nestedSingleValueContainer('error').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) {
    container.encodeString(
      'id_number_type',
      instance.idNumberType!,
    );
  }
  if (instance.lastName != null) {
    container.encodeString(
      'last_name',
      instance.lastName!,
    );
  }
  GelatoDocumentReportStatus.encode(
    instance.status,
    container.nestedSingleValueContainer('status').encoder,
  );
  return container.value;
}