package com.airlock.iam.admin.application.service.authentication;

import com.airlock.iam.common.api.domain.model.password.Password;
import com.airlock.iam.common.api.domain.model.password.PasswordPolicyViolation;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.List;
import java.util.Optional;

public interface AdminappAuthenticationService {
   AdminappAuthenticationService.PasswordCheckResult checkPassword(String var1, Password var2);

   AdminappAuthenticationService.PasswordCheckAndChangeResult checkAndChangePassword(String var1, Password var2, Password var3);

   boolean hasAuthenticatedSession();

   void logout();

   class PasswordCheckAndChangeResult {
      private final Optional<AdminappAuthenticationService.PasswordCheckResult> checkFailure;
      private final List<PasswordPolicyViolation> policyViolations;

      @SuppressFBWarnings(justification = "generated code")
      public PasswordCheckAndChangeResult(
         Optional<AdminappAuthenticationService.PasswordCheckResult> checkFailure, List<PasswordPolicyViolation> policyViolations
      ) {
         this.checkFailure = checkFailure;
         this.policyViolations = policyViolations;
      }

      @SuppressFBWarnings(justification = "generated code")
      public Optional<AdminappAuthenticationService.PasswordCheckResult> getCheckFailure() {
         return this.checkFailure;
      }

      @SuppressFBWarnings(justification = "generated code")
      public List<PasswordPolicyViolation> getPolicyViolations() {
         return this.policyViolations;
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public boolean equals(Object o) {
         if (o == this) {
            return true;
         } else if (!(o instanceof AdminappAuthenticationService.PasswordCheckAndChangeResult other)) {
            return false;
         } else if (!other.canEqual(this)) {
            return false;
         } else {
            Object this$checkFailure = this.checkFailure;
            Object other$checkFailure = other.checkFailure;
            if (this$checkFailure == null ? other$checkFailure == null : this$checkFailure.equals(other$checkFailure)) {
               Object this$policyViolations = this.policyViolations;
               Object other$policyViolations = other.policyViolations;
               return this$policyViolations == null ? other$policyViolations == null : this$policyViolations.equals(other$policyViolations);
            } else {
               return false;
            }
         }
      }

      @SuppressFBWarnings(justification = "generated code")
      protected boolean canEqual(Object other) {
         return other instanceof AdminappAuthenticationService.PasswordCheckAndChangeResult;
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public int hashCode() {
         int PRIME = 59;
         int result = 1;
         Object $checkFailure = this.checkFailure;
         result = result * 59 + ($checkFailure == null ? 43 : $checkFailure.hashCode());
         Object $policyViolations = this.policyViolations;
         return result * 59 + ($policyViolations == null ? 43 : $policyViolations.hashCode());
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "AdminappAuthenticationService.PasswordCheckAndChangeResult(checkFailure="
            + this.getCheckFailure()
            + ", policyViolations="
            + this.getPolicyViolations()
            + ")";
      }
   }

   enum PasswordCheckResult {
      OK,
      MANDATORY_PASSWORD_CHANGE,
      USERNAME_PASSWORD_WRONG,
      USER_LOCKED,
      USER_INVALID,
      SSO_TICKET_MISSING,
      USER_AMBIGUOUS,
      UNSPECIFIED;
   }
}
