package com.airlock.iam.flow.shared.domain.model.cronto;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class CrontoSelfManagementServiceSettings {
   private final boolean userCanDisableAllDevices;
   private final boolean provideDeactivationChallenge;

   @SuppressFBWarnings(justification = "generated code")
   CrontoSelfManagementServiceSettings(boolean userCanDisableAllDevices, boolean provideDeactivationChallenge) {
      this.userCanDisableAllDevices = userCanDisableAllDevices;
      this.provideDeactivationChallenge = provideDeactivationChallenge;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public boolean isUserCanDisableAllDevices() {
      return this.userCanDisableAllDevices;
   }

   @SuppressFBWarnings(justification = "generated code")
   public boolean isProvideDeactivationChallenge() {
      return this.provideDeactivationChallenge;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof CrontoSelfManagementServiceSettings other)) {
         return false;
      } else {
         return this.userCanDisableAllDevices != other.userCanDisableAllDevices
            ? false
            : this.provideDeactivationChallenge == other.provideDeactivationChallenge;
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.userCanDisableAllDevices ? 79 : 97);
      return result * 59 + (this.provideDeactivationChallenge ? 79 : 97);
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "CrontoSelfManagementServiceSettings(userCanDisableAllDevices="
         + this.isUserCanDisableAllDevices()
         + ", provideDeactivationChallenge="
         + this.isProvideDeactivationChallenge()
         + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class CrontoSelfManagementServiceSettingsBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private boolean userCanDisableAllDevices;
      @SuppressFBWarnings(justification = "generated code")
      private boolean provideDeactivationChallenge;

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

      @SuppressFBWarnings(justification = "generated code")
      public CrontoSelfManagementServiceSettings.CrontoSelfManagementServiceSettingsBuilder userCanDisableAllDevices(boolean userCanDisableAllDevices) {
         this.userCanDisableAllDevices = userCanDisableAllDevices;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public CrontoSelfManagementServiceSettings.CrontoSelfManagementServiceSettingsBuilder provideDeactivationChallenge(boolean provideDeactivationChallenge) {
         this.provideDeactivationChallenge = provideDeactivationChallenge;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public CrontoSelfManagementServiceSettings build() {
         return new CrontoSelfManagementServiceSettings(this.userCanDisableAllDevices, this.provideDeactivationChallenge);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "CrontoSelfManagementServiceSettings.CrontoSelfManagementServiceSettingsBuilder(userCanDisableAllDevices="
            + this.userCanDisableAllDevices
            + ", provideDeactivationChallenge="
            + this.provideDeactivationChallenge
            + ")";
      }
   }
}
