package com.airlock.iam.flow.shared.application.configuration.condition;

import com.airlock.iam.core.misc.impl.authen.mtan.MtanHandler;
import com.airlock.iam.flow.api.application.configuration.selection.FlowConditionConfig;
import com.airlock.iam.plugin.api.annotation.config.Plugin;
import com.airlock.iam.plugin.api.annotation.property.PluginProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@Plugin(
   description = "Flow selection condition that selects the subflow depending on whether the user has an mTAN activation letter.",
   displayName = "Has mTAN Activation Letter"
)
public class MtanHasActivationLetterConditionConfig implements FlowConditionConfig {
   @PluginProperty(description = "The mTAN handler to load the user's mTAN tokens.", optional = false, displayName = "MTAN Handler")
   private MtanHandler mtanHandler;

   public MtanHandler getMtanHandler() {
      return this.mtanHandler;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public MtanHasActivationLetterConditionConfig(MtanHandler mtanHandler) {
      this.mtanHandler = mtanHandler;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public static class MtanHasActivationLetterConditionConfigBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private MtanHandler mtanHandler;

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

      @SuppressFBWarnings(justification = "generated code")
      public MtanHasActivationLetterConditionConfig.MtanHasActivationLetterConditionConfigBuilder mtanHandler(MtanHandler mtanHandler) {
         this.mtanHandler = mtanHandler;
         return this;
      }

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

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "MtanHasActivationLetterConditionConfig.MtanHasActivationLetterConditionConfigBuilder(mtanHandler=" + this.mtanHandler + ")";
      }
   }
}
