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

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.Set;

public class OAuth2LocalConsentGrantRequest {
   @ArraySchema(arraySchema = @Schema(description = "Scopes to grant. Can be empty to allow access but not grant any scopes."))
   @NotNull
   @Valid
   private Set<@Size(min = 1, max = 1000) String> scopes;

   @SuppressFBWarnings(justification = "generated code")
   public Set<@Size(min = 1, max = 1000) String> getScopes() {
      return this.scopes;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setScopes(Set<@Size(min = 1, max = 1000) String> scopes) {
      this.scopes = scopes;
   }

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

         Object this$scopes = this.scopes;
         Object other$scopes = other.scopes;
         return this$scopes == null ? other$scopes == null : this$scopes.equals(other$scopes);
      }
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "OAuth2LocalConsentGrantRequest(scopes=" + this.getScopes() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public OAuth2LocalConsentGrantRequest() {
   }

   @SuppressFBWarnings(justification = "generated code")
   public OAuth2LocalConsentGrantRequest(Set<@Size(min = 1, max = 1000) String> scopes) {
      this.scopes = scopes;
   }
}
