toFailureReason method

FailureReason toFailureReason()

Implementation

FailureReason toFailureReason() {
  switch (this) {
    case 'NO_AVAILABLE_CONTACTS':
      return FailureReason.noAvailableContacts;
    case 'ADDITIONAL_VERIFICATION_REQUIRED':
      return FailureReason.additionalVerificationRequired;
    case 'DOMAIN_NOT_ALLOWED':
      return FailureReason.domainNotAllowed;
    case 'INVALID_PUBLIC_DOMAIN':
      return FailureReason.invalidPublicDomain;
    case 'DOMAIN_VALIDATION_DENIED':
      return FailureReason.domainValidationDenied;
    case 'CAA_ERROR':
      return FailureReason.caaError;
    case 'PCA_LIMIT_EXCEEDED':
      return FailureReason.pcaLimitExceeded;
    case 'PCA_INVALID_ARN':
      return FailureReason.pcaInvalidArn;
    case 'PCA_INVALID_STATE':
      return FailureReason.pcaInvalidState;
    case 'PCA_REQUEST_FAILED':
      return FailureReason.pcaRequestFailed;
    case 'PCA_NAME_CONSTRAINTS_VALIDATION':
      return FailureReason.pcaNameConstraintsValidation;
    case 'PCA_RESOURCE_NOT_FOUND':
      return FailureReason.pcaResourceNotFound;
    case 'PCA_INVALID_ARGS':
      return FailureReason.pcaInvalidArgs;
    case 'PCA_INVALID_DURATION':
      return FailureReason.pcaInvalidDuration;
    case 'PCA_ACCESS_DENIED':
      return FailureReason.pcaAccessDenied;
    case 'SLR_NOT_FOUND':
      return FailureReason.slrNotFound;
    case 'OTHER':
      return FailureReason.other;
  }
  throw Exception('$this is not known in enum FailureReason');
}