package com.airlock.iam.authentication.infrastructure.transfer.response;

import com.fasterxml.jackson.annotation.JsonTypeName;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Date;

@JsonTypeName("authentication.data")
public class AuthenticationData {
   public static final String AUTHENTICATION_DATA_TYPE = "authentication.data";
   @Schema(description = "The timestamp of the latest successful authentication, only if there has already been one, otherwise null.")
   private Date latestSuccessfulAuthentication;
   @Schema(description = "The technical ID of this user.", extensions = @Extension(properties = @ExtensionProperty(name = "x-internal", value = "true")))
   private String userId;

   @SuppressFBWarnings(justification = "generated code")
   public Date getLatestSuccessfulAuthentication() {
      return this.latestSuccessfulAuthentication;
   }

   @SuppressFBWarnings(justification = "generated code")
   public String getUserId() {
      return this.userId;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setLatestSuccessfulAuthentication(Date latestSuccessfulAuthentication) {
      this.latestSuccessfulAuthentication = latestSuccessfulAuthentication;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setUserId(String userId) {
      this.userId = userId;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "AuthenticationData(latestSuccessfulAuthentication=" + this.getLatestSuccessfulAuthentication() + ", userId=" + this.getUserId() + ")";
   }
}
