package com.airlock.iam.admin.infrastructure.transfer.response;

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

@JsonTypeName("license.data")
public class LicenseData {
   public static final String LICENSE_DATA_TYPE = "license.data";
   @NotNull
   @Schema(description = "The license key used for activation.")
   private String licenseKey;
   @NotNull
   @Schema(description = "The owner of the license.")
   private String owner;
   @Schema(description = "The date the license was created on.")
   private LocalDate issuedOn;
   @Schema(description = "The date from which the license will become valid - If not set, the license is already valid.")
   private LocalDate validFrom;
   @Schema(description = "The date until the license will be or has been valid - If not set, the license is always valid.")
   private LocalDate validUntil;
   @NotNull
   @Schema(description = "Describes the environment the license will run on.")
   private String environment;
   @Schema(description = "The maximum number of allowed users on the system - If not set, there are no restrictions on the number of allowed users.")
   private Integer licensedUsers;
   @Schema(description = "The current number of users on the system counting towards the license.")
   private Integer currentUsers;
   @Schema(description = "The maximum number of allowed instances on the system - If not set, there are no restrictions on the number of allowed instances.")
   private Integer licensedInstances;
   @ArraySchema(arraySchema = @Schema(description = "A list of licensed IAM tags."))
   private Set<String> licensedTags;
   @ArraySchema(arraySchema = @Schema(description = "A list of licensed IAM bundles."))
   private Set<String> bundles;
   @ArraySchema(arraySchema = @Schema(description = "Defines the MAC addresses of the system on which the license is valid."))
   private Set<String> licensedMac48Addresses;

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

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

   @SuppressFBWarnings(justification = "generated code")
   public LocalDate getIssuedOn() {
      return this.issuedOn;
   }

   @SuppressFBWarnings(justification = "generated code")
   public LocalDate getValidFrom() {
      return this.validFrom;
   }

   @SuppressFBWarnings(justification = "generated code")
   public LocalDate getValidUntil() {
      return this.validUntil;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public Integer getLicensedUsers() {
      return this.licensedUsers;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Integer getCurrentUsers() {
      return this.currentUsers;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Integer getLicensedInstances() {
      return this.licensedInstances;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Set<String> getLicensedTags() {
      return this.licensedTags;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Set<String> getBundles() {
      return this.bundles;
   }

   @SuppressFBWarnings(justification = "generated code")
   public Set<String> getLicensedMac48Addresses() {
      return this.licensedMac48Addresses;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   public void setIssuedOn(LocalDate issuedOn) {
      this.issuedOn = issuedOn;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setValidFrom(LocalDate validFrom) {
      this.validFrom = validFrom;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setValidUntil(LocalDate validUntil) {
      this.validUntil = validUntil;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public void setLicensedUsers(Integer licensedUsers) {
      this.licensedUsers = licensedUsers;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setCurrentUsers(Integer currentUsers) {
      this.currentUsers = currentUsers;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setLicensedInstances(Integer licensedInstances) {
      this.licensedInstances = licensedInstances;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setLicensedTags(Set<String> licensedTags) {
      this.licensedTags = licensedTags;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setBundles(Set<String> bundles) {
      this.bundles = bundles;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setLicensedMac48Addresses(Set<String> licensedMac48Addresses) {
      this.licensedMac48Addresses = licensedMac48Addresses;
   }

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

         Object this$licensedUsers = this.licensedUsers;
         Object other$licensedUsers = other.licensedUsers;
         if (this$licensedUsers == null ? other$licensedUsers == null : this$licensedUsers.equals(other$licensedUsers)) {
            Object this$currentUsers = this.currentUsers;
            Object other$currentUsers = other.currentUsers;
            if (this$currentUsers == null ? other$currentUsers == null : this$currentUsers.equals(other$currentUsers)) {
               Object this$licensedInstances = this.licensedInstances;
               Object other$licensedInstances = other.licensedInstances;
               if (this$licensedInstances == null ? other$licensedInstances == null : this$licensedInstances.equals(other$licensedInstances)) {
                  Object this$licenseKey = this.licenseKey;
                  Object other$licenseKey = other.licenseKey;
                  if (this$licenseKey == null ? other$licenseKey == null : this$licenseKey.equals(other$licenseKey)) {
                     Object this$owner = this.owner;
                     Object other$owner = other.owner;
                     if (this$owner == null ? other$owner == null : this$owner.equals(other$owner)) {
                        Object this$issuedOn = this.issuedOn;
                        Object other$issuedOn = other.issuedOn;
                        if (this$issuedOn == null ? other$issuedOn == null : this$issuedOn.equals(other$issuedOn)) {
                           Object this$validFrom = this.validFrom;
                           Object other$validFrom = other.validFrom;
                           if (this$validFrom == null ? other$validFrom == null : this$validFrom.equals(other$validFrom)) {
                              Object this$validUntil = this.validUntil;
                              Object other$validUntil = other.validUntil;
                              if (this$validUntil == null ? other$validUntil == null : this$validUntil.equals(other$validUntil)) {
                                 Object this$environment = this.environment;
                                 Object other$environment = other.environment;
                                 if (this$environment == null ? other$environment == null : this$environment.equals(other$environment)) {
                                    Object this$licensedTags = this.licensedTags;
                                    Object other$licensedTags = other.licensedTags;
                                    if (this$licensedTags == null ? other$licensedTags == null : this$licensedTags.equals(other$licensedTags)) {
                                       Object this$bundles = this.bundles;
                                       Object other$bundles = other.bundles;
                                       if (this$bundles == null ? other$bundles == null : this$bundles.equals(other$bundles)) {
                                          Object this$licensedMac48Addresses = this.licensedMac48Addresses;
                                          Object other$licensedMac48Addresses = other.licensedMac48Addresses;
                                          return this$licensedMac48Addresses == null
                                             ? other$licensedMac48Addresses == null
                                             : this$licensedMac48Addresses.equals(other$licensedMac48Addresses);
                                       } else {
                                          return false;
                                       }
                                    } else {
                                       return false;
                                    }
                                 } else {
                                    return false;
                                 }
                              } else {
                                 return false;
                              }
                           } else {
                              return false;
                           }
                        } else {
                           return false;
                        }
                     } else {
                        return false;
                     }
                  } else {
                     return false;
                  }
               } else {
                  return false;
               }
            } else {
               return false;
            }
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   protected boolean canEqual(Object other) {
      return other instanceof LicenseData;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $licensedUsers = this.licensedUsers;
      result = result * 59 + ($licensedUsers == null ? 43 : $licensedUsers.hashCode());
      Object $currentUsers = this.currentUsers;
      result = result * 59 + ($currentUsers == null ? 43 : $currentUsers.hashCode());
      Object $licensedInstances = this.licensedInstances;
      result = result * 59 + ($licensedInstances == null ? 43 : $licensedInstances.hashCode());
      Object $licenseKey = this.licenseKey;
      result = result * 59 + ($licenseKey == null ? 43 : $licenseKey.hashCode());
      Object $owner = this.owner;
      result = result * 59 + ($owner == null ? 43 : $owner.hashCode());
      Object $issuedOn = this.issuedOn;
      result = result * 59 + ($issuedOn == null ? 43 : $issuedOn.hashCode());
      Object $validFrom = this.validFrom;
      result = result * 59 + ($validFrom == null ? 43 : $validFrom.hashCode());
      Object $validUntil = this.validUntil;
      result = result * 59 + ($validUntil == null ? 43 : $validUntil.hashCode());
      Object $environment = this.environment;
      result = result * 59 + ($environment == null ? 43 : $environment.hashCode());
      Object $licensedTags = this.licensedTags;
      result = result * 59 + ($licensedTags == null ? 43 : $licensedTags.hashCode());
      Object $bundles = this.bundles;
      result = result * 59 + ($bundles == null ? 43 : $bundles.hashCode());
      Object $licensedMac48Addresses = this.licensedMac48Addresses;
      return result * 59 + ($licensedMac48Addresses == null ? 43 : $licensedMac48Addresses.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "LicenseData(licenseKey="
         + this.getLicenseKey()
         + ", owner="
         + this.getOwner()
         + ", issuedOn="
         + this.getIssuedOn()
         + ", validFrom="
         + this.getValidFrom()
         + ", validUntil="
         + this.getValidUntil()
         + ", environment="
         + this.getEnvironment()
         + ", licensedUsers="
         + this.getLicensedUsers()
         + ", currentUsers="
         + this.getCurrentUsers()
         + ", licensedInstances="
         + this.getLicensedInstances()
         + ", licensedTags="
         + this.getLicensedTags()
         + ", bundles="
         + this.getBundles()
         + ", licensedMac48Addresses="
         + this.getLicensedMac48Addresses()
         + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public LicenseData(
      String licenseKey,
      String owner,
      LocalDate issuedOn,
      LocalDate validFrom,
      LocalDate validUntil,
      String environment,
      Integer licensedUsers,
      Integer currentUsers,
      Integer licensedInstances,
      Set<String> licensedTags,
      Set<String> bundles,
      Set<String> licensedMac48Addresses
   ) {
      this.licenseKey = licenseKey;
      this.owner = owner;
      this.issuedOn = issuedOn;
      this.validFrom = validFrom;
      this.validUntil = validUntil;
      this.environment = environment;
      this.licensedUsers = licensedUsers;
      this.currentUsers = currentUsers;
      this.licensedInstances = licensedInstances;
      this.licensedTags = licensedTags;
      this.bundles = bundles;
      this.licensedMac48Addresses = licensedMac48Addresses;
   }

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