package com.airlock.iam.publicselfservice.infrastructure.transfer;

import com.fasterxml.jackson.annotation.JsonTypeName;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

@JsonTypeName("public-self-service.approval.cronto.push-device")
public final class PublicSelfServiceCrontoPushDeviceData {
   public static final String CRONTO_PUSH_DEVICE_TYPE = "public-self-service.approval.cronto.push-device";
   @NotNull
   @Schema(description = "Label of the push device.")
   private String label;
   @NotNull
   @Schema(description = "Indicates, whether this is the default device.")
   private boolean defaultDevice;

   @SuppressFBWarnings(justification = "generated code")
   public String getLabel() {
      return this.label;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public void setLabel(String label) {
      this.label = label;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setDefaultDevice(boolean defaultDevice) {
      this.defaultDevice = defaultDevice;
   }

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

         Object this$label = this.label;
         Object other$label = other.label;
         return this$label == null ? other$label == null : this$label.equals(other$label);
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.defaultDevice ? 79 : 97);
      Object $label = this.label;
      return result * 59 + ($label == null ? 43 : $label.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "PublicSelfServiceCrontoPushDeviceData(label=" + this.getLabel() + ", defaultDevice=" + this.isDefaultDevice() + ")";
   }
}
