package com.airlock.iam.oauth2.domain.model;

import com.airlock.iam.oauth2.api.domain.model.OAuth2Scope;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Collections;
import java.util.List;

public final class AllowedScopes {
   private final boolean filterRequestedScopes;
   private final List<OAuth2Scope> allowedScopes;

   public boolean isFilterRequestedScopes() {
      return this.filterRequestedScopes;
   }

   public List<OAuth2Scope> explicitlyAllowedScopes() {
      return this.allowedScopes;
   }

   public static AllowedScopes noAllowedScopes() {
      return new AllowedScopes(true, Collections.emptyList());
   }

   public static AllowedScopes allScopesAllowed() {
      return new AllowedScopes(false, Collections.emptyList());
   }

   @SuppressFBWarnings(justification = "generated code")
   public AllowedScopes(boolean filterRequestedScopes, List<OAuth2Scope> allowedScopes) {
      this.filterRequestedScopes = filterRequestedScopes;
      this.allowedScopes = allowedScopes;
   }
}
