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

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 = "Specifies an attribute and its value to be issued in the credential.", displayName = "SSI Attribute Mapping")
public final class SsiAttributeMapping {
   @StringProperty(description = "The name of the attribute as defined in the schema.", optional = false)
   private String attributeName;
   @StringProperty(description = "The key used to retrieve the attribute value from the value maps.", optional = false)
   private String valueMapKey;

   public String getAttributeName() {
      return this.attributeName;
   }

   public String getValueMapKey() {
      return this.valueMapKey;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public SsiAttributeMapping(String attributeName, String valueMapKey) {
      this.attributeName = attributeName;
      this.valueMapKey = valueMapKey;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public static class SsiAttributeMappingBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String attributeName;
      @SuppressFBWarnings(justification = "generated code")
      private String valueMapKey;

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

      @SuppressFBWarnings(justification = "generated code")
      public SsiAttributeMapping.SsiAttributeMappingBuilder attributeName(String attributeName) {
         this.attributeName = attributeName;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public SsiAttributeMapping.SsiAttributeMappingBuilder valueMapKey(String valueMapKey) {
         this.valueMapKey = valueMapKey;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public SsiAttributeMapping build() {
         return new SsiAttributeMapping(this.attributeName, this.valueMapKey);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "SsiAttributeMapping.SsiAttributeMappingBuilder(attributeName=" + this.attributeName + ", valueMapKey=" + this.valueMapKey + ")";
      }
   }
}
