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

import com.airlock.iam.core.misc.cronto.CrontoHandler;
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.license.PluginLicenseRestriction;
import com.airlock.iam.plugin.api.annotation.property.PluginProperty;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

@Plugin(description = "Condition that decides whether the user has a Cronto account.", displayName = "Has Cronto Account")
@PluginLicenseRestriction(moduleAffiliation = "Cronto")
public final class CrontoAccountConditionConfig implements FlowConditionConfig {
   @PluginProperty(description = "Plugin to handle all Cronto-specific actions.", globalPluginReference = "globalCrontoSettings", optional = false)
   private CrontoHandler crontoHandler;

   public CrontoHandler getCrontoHandler() {
      return this.crontoHandler;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   public CrontoAccountConditionConfig(CrontoHandler crontoHandler) {
      this.crontoHandler = crontoHandler;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class CrontoAccountConditionConfigBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private CrontoHandler crontoHandler;

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

      @SuppressFBWarnings(justification = "generated code")
      public CrontoAccountConditionConfig.CrontoAccountConditionConfigBuilder crontoHandler(CrontoHandler crontoHandler) {
         this.crontoHandler = crontoHandler;
         return this;
      }

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

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "CrontoAccountConditionConfig.CrontoAccountConditionConfigBuilder(crontoHandler=" + this.crontoHandler + ")";
      }
   }
}
