package org.wfc.omada.api.account.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Objects;

/**
 * IdpMetadataOpenApiVo
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T10:44:52.771+08:00[Asia/Shanghai]")

public class IdpMetadataOpenApiVo   {
  @JsonProperty("name")
  private String name;

  @JsonProperty("description")
  private String description;

  @JsonProperty("entityId")
  private String entityId;

  @JsonProperty("loginUrl")
  private String loginUrl;

  @JsonProperty("x509Certificate")
  private String x509Certificate;

  public IdpMetadataOpenApiVo name(String name) {
    this.name = name;
    return this;
  }

  /**
   * IdP name should contain 1 to 32 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "IdP name should contain 1 to 32 characters.")
  @NotNull

@Pattern(regexp="^[^ ]$|^[^ ].{0,30}[^ ]$") 
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public IdpMetadataOpenApiVo description(String description) {
    this.description = description;
    return this;
  }

  /**
   * IdP description should contain 0 to 128 characters.
   * @return description
  */
  @ApiModelProperty(value = "IdP description should contain 0 to 128 characters.")

@Pattern(regexp="^$|^[^ ]$|^[^ ].{0,126}[^ ]$") 
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public IdpMetadataOpenApiVo entityId(String entityId) {
    this.entityId = entityId;
    return this;
  }

  /**
   * The IdP entity id which must be unique in same Omadac.
   * @return entityId
  */
  @ApiModelProperty(required = true, value = "The IdP entity id which must be unique in same Omadac.")
  @NotNull

@Pattern(regexp="^(?=^.{3,255}$)(http(s)?://)(www\\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\\d+)*(/[\\w-]*(\\.[\\w-]+)?)*([\\?&][\\w-]+=[\\w-]*)*$") 
  public String getEntityId() {
    return entityId;
  }

  public void setEntityId(String entityId) {
    this.entityId = entityId;
  }

  public IdpMetadataOpenApiVo loginUrl(String loginUrl) {
    this.loginUrl = loginUrl;
    return this;
  }

  /**
   * Login url
   * @return loginUrl
  */
  @ApiModelProperty(required = true, value = "Login url")
  @NotNull

@Pattern(regexp="^(?=^.{3,255}$)(http(s)?://)(www\\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\\d+)*(/[\\w-]*(\\.[\\w-]+)?)*([\\?&][\\w-]+=[\\w-]*)*$") 
  public String getLoginUrl() {
    return loginUrl;
  }

  public void setLoginUrl(String loginUrl) {
    this.loginUrl = loginUrl;
  }

  public IdpMetadataOpenApiVo x509Certificate(String x509Certificate) {
    this.x509Certificate = x509Certificate;
    return this;
  }

  /**
   * BASE64 encoded string of x509 certificate.
   * @return x509Certificate
  */
  @ApiModelProperty(required = true, value = "BASE64 encoded string of x509 certificate.")
  @NotNull


  public String getX509Certificate() {
    return x509Certificate;
  }

  public void setX509Certificate(String x509Certificate) {
    this.x509Certificate = x509Certificate;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    IdpMetadataOpenApiVo idpMetadataOpenApiVo = (IdpMetadataOpenApiVo) o;
    return Objects.equals(this.name, idpMetadataOpenApiVo.name) &&
        Objects.equals(this.description, idpMetadataOpenApiVo.description) &&
        Objects.equals(this.entityId, idpMetadataOpenApiVo.entityId) &&
        Objects.equals(this.loginUrl, idpMetadataOpenApiVo.loginUrl) &&
        Objects.equals(this.x509Certificate, idpMetadataOpenApiVo.x509Certificate);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, description, entityId, loginUrl, x509Certificate);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class IdpMetadataOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    entityId: ").append(toIndentedString(entityId)).append("\n");
    sb.append("    loginUrl: ").append(toIndentedString(loginUrl)).append("\n");
    sb.append("    x509Certificate: ").append(toIndentedString(x509Certificate)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

