package com.airlock.iam.flow.shared.domain.model.captcha;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public class CaptchaValidationResponse {
   private boolean success;
   private String hostname;
   private String credit;
   @JsonProperty("challenge_ts")
   private String challengeTimestamp;
   @JsonProperty("error-codes")
   private List<String> errorCodes;

   @SuppressFBWarnings(justification = "generated code")
   public boolean isSuccess() {
      return this.success;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   public List<String> getErrorCodes() {
      return this.errorCodes;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setSuccess(boolean success) {
      this.success = success;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   public void setErrorCodes(List<String> errorCodes) {
      this.errorCodes = errorCodes;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof CaptchaValidationResponse other)) {
         return false;
      } else {
         if (!other.canEqual(this)) {
            return false;
         }

         if (this.success != other.success) {
            return false;
         }

         Object this$hostname = this.hostname;
         Object other$hostname = other.hostname;
         if (this$hostname == null ? other$hostname == null : this$hostname.equals(other$hostname)) {
            Object this$credit = this.credit;
            Object other$credit = other.credit;
            if (this$credit == null ? other$credit == null : this$credit.equals(other$credit)) {
               Object this$challengeTimestamp = this.challengeTimestamp;
               Object other$challengeTimestamp = other.challengeTimestamp;
               if (this$challengeTimestamp == null ? other$challengeTimestamp == null : this$challengeTimestamp.equals(other$challengeTimestamp)) {
                  Object this$errorCodes = this.errorCodes;
                  Object other$errorCodes = other.errorCodes;
                  return this$errorCodes == null ? other$errorCodes == null : this$errorCodes.equals(other$errorCodes);
               } else {
                  return false;
               }
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.success ? 79 : 97);
      Object $hostname = this.hostname;
      result = result * 59 + ($hostname == null ? 43 : $hostname.hashCode());
      Object $credit = this.credit;
      result = result * 59 + ($credit == null ? 43 : $credit.hashCode());
      Object $challengeTimestamp = this.challengeTimestamp;
      result = result * 59 + ($challengeTimestamp == null ? 43 : $challengeTimestamp.hashCode());
      Object $errorCodes = this.errorCodes;
      return result * 59 + ($errorCodes == null ? 43 : $errorCodes.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "CaptchaValidationResponse(success="
         + this.isSuccess()
         + ", hostname="
         + this.getHostname()
         + ", credit="
         + this.getCredit()
         + ", challengeTimestamp="
         + this.getChallengeTimestamp()
         + ", errorCodes="
         + this.getErrorCodes()
         + ")";
   }
}
