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

import com.fasterxml.jackson.annotation.JsonTypeName;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;

@JsonTypeName("oidc-origin-check")
public class OpenIdConnectOriginCheckData {
   static final String JSON_TYPE_NAME = "oidc-origin-check";
   @Schema(description = "Whether the origin is allowed or not for this authorization server.")
   private boolean allowed;

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      return result * 59 + (this.allowed ? 79 : 97);
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "OpenIdConnectOriginCheckData(allowed=" + this.isAllowed() + ")";
   }
}
