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

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
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 jakarta.validation.constraints.NotNull;
import java.util.Map;

@JsonPropertyOrder("active")
public final class OAuth2TokenIntrospectionResponseData {
   @NotNull
   @Schema(description = "Indicates whether or not the presented token is currently active.")
   private boolean active;
   @Schema(description = "Space-separated list of scopes associated with this token.")
   private String scope;
   @JsonProperty("client_id")
   @Schema(description = "Client identifier for the OAuth 2.0 client that requested this token.")
   private String clientId;
   @Schema(description = "Subject of the token, usually a machine-readable identifier of the resource owner who authorized this token.")
   private String sub;
   @Schema(
      description = "Human-readable identifier for the resource owner who authorized this token.",
      extensions = @Extension(properties = @ExtensionProperty(name = "x-internal", value = "true"))
   )
   private String username;
   @Schema(
      description = "Type of the token as defined in Section 5.1 of OAuth 2.0 [RFC6749].",
      extensions = @Extension(properties = @ExtensionProperty(name = "x-internal", value = "true"))
   )
   @JsonProperty("token_type")
   private String tokenType;
   @Schema(description = "Timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token will expire.")
   private Long exp;
   @Schema(description = "Timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token was originally issued.")
   private Long iat;
   @Schema(
      description = "Timestamp, measured in the number of seconds since January 1 1970 UTC, indicating when this token is not to be used before.",
      extensions = @Extension(properties = @ExtensionProperty(name = "x-internal", value = "true"))
   )
   private Long nbf;
   @Schema(
      description = "Service-specific identifier or list of identifiers representing the intended audience for this token.",
      extensions = @Extension(properties = @ExtensionProperty(name = "x-internal", value = "true"))
   )
   private String aud;
   @Schema(description = "The issuer of this token.", extensions = @Extension(properties = @ExtensionProperty(name = "x-internal", value = "true")))
   private String iss;
   @Schema(description = "The identifier for the token.", extensions = @Extension(properties = @ExtensionProperty(name = "x-internal", value = "true")))
   private String jti;
   @Schema(description = "The JWT confirmation method. Used with certificate-bound access tokens.")
   private Map<String, String> cnf;

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

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

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   public Long getExp() {
      return this.exp;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Long getIat() {
      return this.iat;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Long getNbf() {
      return this.nbf;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   public Map<String, String> getCnf() {
      return this.cnf;
   }

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

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

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

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   public void setExp(Long exp) {
      this.exp = exp;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setIat(Long iat) {
      this.iat = iat;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setNbf(Long nbf) {
      this.nbf = nbf;
   }

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

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

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

   @SuppressFBWarnings(justification = "generated code")
   public void setCnf(Map<String, String> cnf) {
      this.cnf = cnf;
   }

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

         Object this$exp = this.exp;
         Object other$exp = other.exp;
         if (this$exp == null ? other$exp == null : this$exp.equals(other$exp)) {
            Object this$iat = this.iat;
            Object other$iat = other.iat;
            if (this$iat == null ? other$iat == null : this$iat.equals(other$iat)) {
               Object this$nbf = this.nbf;
               Object other$nbf = other.nbf;
               if (this$nbf == null ? other$nbf == null : this$nbf.equals(other$nbf)) {
                  Object this$scope = this.scope;
                  Object other$scope = other.scope;
                  if (this$scope == null ? other$scope == null : this$scope.equals(other$scope)) {
                     Object this$clientId = this.clientId;
                     Object other$clientId = other.clientId;
                     if (this$clientId == null ? other$clientId == null : this$clientId.equals(other$clientId)) {
                        Object this$sub = this.sub;
                        Object other$sub = other.sub;
                        if (this$sub == null ? other$sub == null : this$sub.equals(other$sub)) {
                           Object this$username = this.username;
                           Object other$username = other.username;
                           if (this$username == null ? other$username == null : this$username.equals(other$username)) {
                              Object this$tokenType = this.tokenType;
                              Object other$tokenType = other.tokenType;
                              if (this$tokenType == null ? other$tokenType == null : this$tokenType.equals(other$tokenType)) {
                                 Object this$aud = this.aud;
                                 Object other$aud = other.aud;
                                 if (this$aud == null ? other$aud == null : this$aud.equals(other$aud)) {
                                    Object this$iss = this.iss;
                                    Object other$iss = other.iss;
                                    if (this$iss == null ? other$iss == null : this$iss.equals(other$iss)) {
                                       Object this$jti = this.jti;
                                       Object other$jti = other.jti;
                                       if (this$jti == null ? other$jti == null : this$jti.equals(other$jti)) {
                                          Object this$cnf = this.cnf;
                                          Object other$cnf = other.cnf;
                                          return this$cnf == null ? other$cnf == null : this$cnf.equals(other$cnf);
                                       } else {
                                          return false;
                                       }
                                    } else {
                                       return false;
                                    }
                                 } else {
                                    return false;
                                 }
                              } else {
                                 return false;
                              }
                           } else {
                              return false;
                           }
                        } else {
                           return false;
                        }
                     } else {
                        return false;
                     }
                  } else {
                     return false;
                  }
               } else {
                  return false;
               }
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.active ? 79 : 97);
      Object $exp = this.exp;
      result = result * 59 + ($exp == null ? 43 : $exp.hashCode());
      Object $iat = this.iat;
      result = result * 59 + ($iat == null ? 43 : $iat.hashCode());
      Object $nbf = this.nbf;
      result = result * 59 + ($nbf == null ? 43 : $nbf.hashCode());
      Object $scope = this.scope;
      result = result * 59 + ($scope == null ? 43 : $scope.hashCode());
      Object $clientId = this.clientId;
      result = result * 59 + ($clientId == null ? 43 : $clientId.hashCode());
      Object $sub = this.sub;
      result = result * 59 + ($sub == null ? 43 : $sub.hashCode());
      Object $username = this.username;
      result = result * 59 + ($username == null ? 43 : $username.hashCode());
      Object $tokenType = this.tokenType;
      result = result * 59 + ($tokenType == null ? 43 : $tokenType.hashCode());
      Object $aud = this.aud;
      result = result * 59 + ($aud == null ? 43 : $aud.hashCode());
      Object $iss = this.iss;
      result = result * 59 + ($iss == null ? 43 : $iss.hashCode());
      Object $jti = this.jti;
      result = result * 59 + ($jti == null ? 43 : $jti.hashCode());
      Object $cnf = this.cnf;
      return result * 59 + ($cnf == null ? 43 : $cnf.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "OAuth2TokenIntrospectionResponseData(active="
         + this.isActive()
         + ", scope="
         + this.getScope()
         + ", clientId="
         + this.getClientId()
         + ", sub="
         + this.getSub()
         + ", username="
         + this.getUsername()
         + ", tokenType="
         + this.getTokenType()
         + ", exp="
         + this.getExp()
         + ", iat="
         + this.getIat()
         + ", nbf="
         + this.getNbf()
         + ", aud="
         + this.getAud()
         + ", iss="
         + this.getIss()
         + ", jti="
         + this.getJti()
         + ", cnf="
         + this.getCnf()
         + ")";
   }
}
