package com.airlock.iam.admin.domain.model.analytics;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;
import java.util.Set;
import lombok.NonNull;

public record StructuredLicenseAnalytics(
   @NonNull Optional<String> owner,
   @NonNull Optional<String> issuedOn,
   @NonNull Optional<String> validFrom,
   @NonNull Optional<String> validUntil,
   @NonNull Optional<String> environment,
   @NonNull Optional<Integer> licensedUsers,
   @NonNull Optional<Integer> licensedInstances,
   @NonNull Set<String> licensedTags,
   @NonNull Set<String> bundles,
   @NonNull Set<String> licensedMac48Addresses
) {
   @SuppressFBWarnings(justification = "generated code")
   public StructuredLicenseAnalytics {
      if (owner == null) {
         throw new NullPointerException("owner is marked non-null but is null");
      }

      if (issuedOn == null) {
         throw new NullPointerException("issuedOn is marked non-null but is null");
      }

      if (validFrom == null) {
         throw new NullPointerException("validFrom is marked non-null but is null");
      }

      if (validUntil == null) {
         throw new NullPointerException("validUntil is marked non-null but is null");
      }

      if (environment == null) {
         throw new NullPointerException("environment is marked non-null but is null");
      }

      if (licensedUsers == null) {
         throw new NullPointerException("licensedUsers is marked non-null but is null");
      }

      if (licensedInstances == null) {
         throw new NullPointerException("licensedInstances is marked non-null but is null");
      }

      if (licensedTags == null) {
         throw new NullPointerException("licensedTags is marked non-null but is null");
      }

      if (bundles == null) {
         throw new NullPointerException("bundles is marked non-null but is null");
      }

      if (licensedMac48Addresses == null) {
         throw new NullPointerException("licensedMac48Addresses is marked non-null but is null");
      }
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public static class StructuredLicenseAnalyticsBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> owner;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> issuedOn;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> validFrom;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> validUntil;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<String> environment;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<Integer> licensedUsers;
      @SuppressFBWarnings(justification = "generated code")
      private Optional<Integer> licensedInstances;
      @SuppressFBWarnings(justification = "generated code")
      private Set<String> licensedTags;
      @SuppressFBWarnings(justification = "generated code")
      private Set<String> bundles;
      @SuppressFBWarnings(justification = "generated code")
      private Set<String> licensedMac48Addresses;

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

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder owner(@NonNull Optional<String> owner) {
         if (owner == null) {
            throw new NullPointerException("owner is marked non-null but is null");
         }

         this.owner = owner;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder issuedOn(@NonNull Optional<String> issuedOn) {
         if (issuedOn == null) {
            throw new NullPointerException("issuedOn is marked non-null but is null");
         }

         this.issuedOn = issuedOn;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder validFrom(@NonNull Optional<String> validFrom) {
         if (validFrom == null) {
            throw new NullPointerException("validFrom is marked non-null but is null");
         }

         this.validFrom = validFrom;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder validUntil(@NonNull Optional<String> validUntil) {
         if (validUntil == null) {
            throw new NullPointerException("validUntil is marked non-null but is null");
         }

         this.validUntil = validUntil;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder environment(@NonNull Optional<String> environment) {
         if (environment == null) {
            throw new NullPointerException("environment is marked non-null but is null");
         }

         this.environment = environment;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder licensedUsers(@NonNull Optional<Integer> licensedUsers) {
         if (licensedUsers == null) {
            throw new NullPointerException("licensedUsers is marked non-null but is null");
         }

         this.licensedUsers = licensedUsers;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder licensedInstances(@NonNull Optional<Integer> licensedInstances) {
         if (licensedInstances == null) {
            throw new NullPointerException("licensedInstances is marked non-null but is null");
         }

         this.licensedInstances = licensedInstances;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder licensedTags(@NonNull Set<String> licensedTags) {
         if (licensedTags == null) {
            throw new NullPointerException("licensedTags is marked non-null but is null");
         }

         this.licensedTags = licensedTags;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder bundles(@NonNull Set<String> bundles) {
         if (bundles == null) {
            throw new NullPointerException("bundles is marked non-null but is null");
         }

         this.bundles = bundles;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder licensedMac48Addresses(@NonNull Set<String> licensedMac48Addresses) {
         if (licensedMac48Addresses == null) {
            throw new NullPointerException("licensedMac48Addresses is marked non-null but is null");
         }

         this.licensedMac48Addresses = licensedMac48Addresses;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public StructuredLicenseAnalytics build() {
         return new StructuredLicenseAnalytics(
            this.owner,
            this.issuedOn,
            this.validFrom,
            this.validUntil,
            this.environment,
            this.licensedUsers,
            this.licensedInstances,
            this.licensedTags,
            this.bundles,
            this.licensedMac48Addresses
         );
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "StructuredLicenseAnalytics.StructuredLicenseAnalyticsBuilder(owner="
            + this.owner
            + ", issuedOn="
            + this.issuedOn
            + ", validFrom="
            + this.validFrom
            + ", validUntil="
            + this.validUntil
            + ", environment="
            + this.environment
            + ", licensedUsers="
            + this.licensedUsers
            + ", licensedInstances="
            + this.licensedInstances
            + ", licensedTags="
            + this.licensedTags
            + ", bundles="
            + this.bundles
            + ", licensedMac48Addresses="
            + this.licensedMac48Addresses
            + ")";
      }
   }
}
