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

import com.airlock.iam.flow.ui.infrastructure.transfer.response.UiSettingsData;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;

@JsonTypeName("ui.public-self-service.on-completed")
public class OnCompletedPublicSelfServiceData implements UiSettingsData {
   public static final String ON_COMPLETED_PASSWORD_RESET_TYPE = "ui.public-self-service.on-completed";
   @Schema(description = "Whether the confirmation page should be shown.")
   private boolean showConfirmationPage;
   @Nullable
   @Schema(description = "Target URI after completed public self-service flow.")
   private String targetUri;
   @Nullable
   @Schema(description = "Tenant ID for the UI.")
   @JsonInclude(Include.NON_NULL)
   private String uiTenantId;

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

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public String getTargetUri() {
      return this.targetUri;
   }

   @Nullable
   @SuppressFBWarnings(justification = "generated code")
   public String getUiTenantId() {
      return this.uiTenantId;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public void setTargetUri(@Nullable String targetUri) {
      this.targetUri = targetUri;
   }

   @SuppressFBWarnings(justification = "generated code")
   public void setUiTenantId(@Nullable String uiTenantId) {
      this.uiTenantId = uiTenantId;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof OnCompletedPublicSelfServiceData other)) {
         return false;
      } else if (!other.canEqual(this)) {
         return false;
      } else if (this.showConfirmationPage != other.showConfirmationPage) {
         return false;
      } else {
         Object this$targetUri = this.targetUri;
         Object other$targetUri = other.targetUri;
         if (this$targetUri == null ? other$targetUri == null : this$targetUri.equals(other$targetUri)) {
            Object this$uiTenantId = this.uiTenantId;
            Object other$uiTenantId = other.uiTenantId;
            return this$uiTenantId == null ? other$uiTenantId == null : this$uiTenantId.equals(other$uiTenantId);
         } else {
            return false;
         }
      }
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "OnCompletedPublicSelfServiceData(showConfirmationPage="
         + this.isShowConfirmationPage()
         + ", targetUri="
         + this.getTargetUri()
         + ", uiTenantId="
         + this.getUiTenantId()
         + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public OnCompletedPublicSelfServiceData(boolean showConfirmationPage, @Nullable String targetUri, @Nullable String uiTenantId) {
      this.showConfirmationPage = showConfirmationPage;
      this.targetUri = targetUri;
      this.uiTenantId = uiTenantId;
   }

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