package com.airlock.iam.common.application.configuration.user;

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

@Plugin(
   description = "<p>User Management Extensions are added as a tab in the User Management of the Adminapp.</p>\n<p>For someone to see the User Management Extension, they need to have the corresponding access rights.\nThis has to be set in the Adminapp Access Control.</p>\n<p>Please consult the official Airlock IAM documentation for more information</p>"
)
public final class UserManagementExtensionConfig {
   public static final String USER_MANAGEMENT_EXTENSIONS_DESCRIPTION = "<p>User Management Extensions are added as a tab in the User Management of the Adminapp.</p>\n<p>For someone to see the User Management Extension, they need to have the corresponding access rights.\nThis has to be set in the Adminapp Access Control.</p>\n<p>Please consult the official Airlock IAM documentation for more information</p>";
   private static final String HTML_ID_PATTERN = "[a-zA-Z0-9]+";
   @StringProperty(
      description = "An identifier which must be unique across all User Management Extensions.\nThis identifier is also used to determine the translation for the name of the tab in the\nuser details page (defined as the key '<tt>user.user-management-extension.title.&lt;id&gt;</tt>').",
      displayName = "ID",
      optional = false,
      validationRegex = "[a-zA-Z0-9]+"
   )
   private String id;
   public static final String USER_MANAGEMENT_EXTENSION_ID_PROPERTY = "id";
   public static final String USER_MANAGEMENT_EXTENSION_ID_DISPLAY_NAME = "ID";

   public String getId() {
      return this.id;
   }

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

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

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

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

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

      @SuppressFBWarnings(justification = "generated code")
      public UserManagementExtensionConfig.UserManagementExtensionConfigBuilder id(String id) {
         this.id = id;
         return this;
      }

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

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "UserManagementExtensionConfig.UserManagementExtensionConfigBuilder(id=" + this.id + ")";
      }
   }
}
