package com.airlock.iam.authentication.infrastructure.transfer.request;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import java.util.Map;

public final class DeviceTokenRegistrationRequest {
   @NotNull
   @Schema(
      description = "The public key attributes according to the JSON web-key specification RFC7517 (at the moment only keys of type \"EC\" are supported)."
   )
   private Map<String, String> publicJwk;
   @Schema(description = "A device description (for example \"My office phone\") used to identify a device by the user or help desk (optional).")
   private String label;
   @Schema(description = "A device serial number (for example \"XYZ10983482347\") used to identify a device by the user or help desk (optional).")
   private String serial;

   private DeviceTokenRegistrationRequest() {
   }

   @SuppressFBWarnings(justification = "generated code")
   public Map<String, String> getPublicJwk() {
      return this.publicJwk;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   public void setPublicJwk(Map<String, String> publicJwk) {
      this.publicJwk = publicJwk;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof DeviceTokenRegistrationRequest other)) {
         return false;
      } else {
         Object this$publicJwk = this.publicJwk;
         Object other$publicJwk = other.publicJwk;
         if (this$publicJwk == null ? other$publicJwk == null : this$publicJwk.equals(other$publicJwk)) {
            Object this$label = this.label;
            Object other$label = other.label;
            if (this$label == null ? other$label == null : this$label.equals(other$label)) {
               Object this$serial = this.serial;
               Object other$serial = other.serial;
               return this$serial == null ? other$serial == null : this$serial.equals(other$serial);
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "DeviceTokenRegistrationRequest(publicJwk=" + this.getPublicJwk() + ", label=" + this.getLabel() + ", serial=" + this.getSerial() + ")";
   }
}
