package com.airlock.iam.saml2.application.configuration;

import com.airlock.iam.plugin.api.annotation.config.Plugin;
import com.airlock.iam.plugin.api.annotation.license.PluginLicenseRestriction;
import com.airlock.iam.plugin.api.annotation.property.StringProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@Plugin(description = "Configures the identifier for a SAML 2.0 Service Provider (SP).</p>", displayName = "SAML 2.0 Service Provider Entity ID")
@PluginLicenseRestriction(moduleAffiliation = {"SamlIdp", "SamlSp"})
public final class Saml2ServiceProviderIdConfig {
   @StringProperty(
      description = "The ID of the Service Provider. Needs to match the entity ID in the metadata files (see separate \"Metadata File\"  and \"Extended Metadata File\" properties within the Service Provider settings). Must be unique over all entities.",
      optional = false,
      displayName = "SP Entity ID",
      exampleValues = {"sp", "custom-sp"}
   )
   private String spEntityId;
   public static final String SP_ENTITY_ID_PROPERTY = "spEntityId";

   public String getSpEntityId() {
      return this.spEntityId;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static Saml2ServiceProviderIdConfig.Saml2ServiceProviderIdConfigBuilder builder() {
      return new Saml2ServiceProviderIdConfig.Saml2ServiceProviderIdConfigBuilder();
   }

   @SuppressFBWarnings(justification = "generated code")
   public Saml2ServiceProviderIdConfig(String spEntityId) {
      this.spEntityId = spEntityId;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public static class Saml2ServiceProviderIdConfigBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String spEntityId;

      @SuppressFBWarnings(justification = "generated code")
      Saml2ServiceProviderIdConfigBuilder() {
      }

      @SuppressFBWarnings(justification = "generated code")
      public Saml2ServiceProviderIdConfig.Saml2ServiceProviderIdConfigBuilder spEntityId(String spEntityId) {
         this.spEntityId = spEntityId;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public Saml2ServiceProviderIdConfig build() {
         return new Saml2ServiceProviderIdConfig(this.spEntityId);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "Saml2ServiceProviderIdConfig.Saml2ServiceProviderIdConfigBuilder(spEntityId=" + this.spEntityId + ")";
      }
   }
}
