employmentVerificationStatusFromJson function

EmploymentVerificationStatus employmentVerificationStatusFromJson(
  1. Object? employmentVerificationStatus, [
  2. EmploymentVerificationStatus? defaultValue
])

Implementation

enums.EmploymentVerificationStatus employmentVerificationStatusFromJson(
  Object? employmentVerificationStatus, [
  enums.EmploymentVerificationStatus? defaultValue,
]) {
  if (employmentVerificationStatus is String) {
    return enums.$EmploymentVerificationStatusMap.entries
        .firstWhere(
            (element) =>
                element.value.toLowerCase() ==
                employmentVerificationStatus.toLowerCase(),
            orElse: () => const MapEntry(
                enums.EmploymentVerificationStatus.swaggerGeneratedUnknown, ''))
        .key;
  }

  final parsedResult = defaultValue == null
      ? null
      : enums.$EmploymentVerificationStatusMap.entries
          .firstWhereOrNull((element) => element.value == defaultValue)
          ?.key;

  return parsedResult ??
      defaultValue ??
      enums.EmploymentVerificationStatus.swaggerGeneratedUnknown;
}