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

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

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * VoucherOpenApiVo
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:35:35.496+08:00[Asia/Shanghai]")

public class VoucherOpenApiVo   {
  @JsonProperty("id")
  private String id;

  @JsonProperty("code")
  private String code;

  @JsonProperty("createdTime")
  private Long createdTime;

  @JsonProperty("limitType")
  private Integer limitType;

  @JsonProperty("limitNum")
  private Integer limitNum;

  @JsonProperty("used")
  private Integer used;

  @JsonProperty("durationType")
  private Integer durationType;

  @JsonProperty("duration")
  private Long duration;

  @JsonProperty("timingType")
  private Integer timingType;

  @JsonProperty("expirationTime")
  private Long expirationTime;

  @JsonProperty("effectiveTime")
  private Long effectiveTime;

  @JsonProperty("description")
  private String description;

  @JsonProperty("rateLimit")
  private RateLimitOpenApiVo rateLimit;

  @JsonProperty("trafficLimitEnable")
  private Boolean trafficLimitEnable;

  @JsonProperty("trafficLimit")
  private Long trafficLimit;

  @JsonProperty("trafficLimitFrequency")
  private Integer trafficLimitFrequency;

  @JsonProperty("trafficLeft")
  private Boolean trafficLeft;

  @JsonProperty("startTime")
  private Long startTime;

  @JsonProperty("valid")
  private Boolean valid;

  @JsonProperty("trafficUsed")
  private Long trafficUsed;

  @JsonProperty("unitPrice")
  private String unitPrice;

  @JsonProperty("currency")
  private String currency;

  @JsonProperty("portalNames")
  @Valid
  private List<String> portalNames = null;

  @JsonProperty("logout")
  private Boolean logout;

  @JsonProperty("validity")
  private String validity;

  @JsonProperty("printComments")
  private String printComments;

  public VoucherOpenApiVo id(String id) {
    this.id = id;
    return this;
  }

  /**
   * Voucher ID
   * @return id
  */
  @ApiModelProperty(value = "Voucher ID")


  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public VoucherOpenApiVo code(String code) {
    this.code = code;
    return this;
  }

  /**
   * Voucher code
   * @return code
  */
  @ApiModelProperty(value = "Voucher code")


  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public VoucherOpenApiVo createdTime(Long createdTime) {
    this.createdTime = createdTime;
    return this;
  }

  /**
   * Create timestamp for the voucher, unit: millisecond
   * @return createdTime
  */
  @ApiModelProperty(value = "Create timestamp for the voucher, unit: millisecond")


  public Long getCreatedTime() {
    return createdTime;
  }

  public void setCreatedTime(Long createdTime) {
    this.createdTime = createdTime;
  }

  public VoucherOpenApiVo limitType(Integer limitType) {
    this.limitType = limitType;
    return this;
  }

  /**
   * The limitations of the voucher. It should be a value as follows: 0: Limited Usage Counts, 1: Limited Online Users, 2: Unlimited
   * @return limitType
  */
  @ApiModelProperty(value = "The limitations of the voucher. It should be a value as follows: 0: Limited Usage Counts, 1: Limited Online Users, 2: Unlimited")


  public Integer getLimitType() {
    return limitType;
  }

  public void setLimitType(Integer limitType) {
    this.limitType = limitType;
  }

  public VoucherOpenApiVo limitNum(Integer limitNum) {
    this.limitNum = limitNum;
    return this;
  }

  /**
   * The number of limitations. It should be within the range of 1–999. If Parameter [limitType] is 0 or 1, [limitNum] should not be null.When Parameter [limitType] is 0, [limitNum] represents the maximum number of times this voucher can be used.When Parameter [limitType] is 1, [limitNum] represents the maximum number of users this voucher can be used at the same time.
   * @return limitNum
  */
  @ApiModelProperty(value = "The number of limitations. It should be within the range of 1–999. If Parameter [limitType] is 0 or 1, [limitNum] should not be null.When Parameter [limitType] is 0, [limitNum] represents the maximum number of times this voucher can be used.When Parameter [limitType] is 1, [limitNum] represents the maximum number of users this voucher can be used at the same time.")


  public Integer getLimitNum() {
    return limitNum;
  }

  public void setLimitNum(Integer limitNum) {
    this.limitNum = limitNum;
  }

  public VoucherOpenApiVo used(Integer used) {
    this.used = used;
    return this;
  }

  /**
   * The number of times the voucher is used
   * @return used
  */
  @ApiModelProperty(value = "The number of times the voucher is used")


  public Integer getUsed() {
    return used;
  }

  public void setUsed(Integer used) {
    this.used = used;
  }

  public VoucherOpenApiVo durationType(Integer durationType) {
    this.durationType = durationType;
    return this;
  }

  /**
   * The duration type of the voucher. It should be a value as follows: 0: Client duration, each client expires after the duration is used. 1: Voucher duration, after reaching the voucher duration, clients using the voucher will expire
   * @return durationType
  */
  @ApiModelProperty(value = "The duration type of the voucher. It should be a value as follows: 0: Client duration, each client expires after the duration is used. 1: Voucher duration, after reaching the voucher duration, clients using the voucher will expire")


  public Integer getDurationType() {
    return durationType;
  }

  public void setDurationType(Integer durationType) {
    this.durationType = durationType;
  }

  public VoucherOpenApiVo duration(Long duration) {
    this.duration = duration;
    return this;
  }

  /**
   * Duration of one use, unit: minute. It should be within the range of 1–14400000.
   * @return duration
  */
  @ApiModelProperty(value = "Duration of one use, unit: minute. It should be within the range of 1–14400000.")


  public Long getDuration() {
    return duration;
  }

  public void setDuration(Long duration) {
    this.duration = duration;
  }

  public VoucherOpenApiVo timingType(Integer timingType) {
    this.timingType = timingType;
    return this;
  }

  /**
   * The timing type of the voucher. It should be a value as follows: 0: Timing by time, clients can use vouchers for specified time duration. 1: Timing by usage, clients can use vouchers for the duration of actual usage
   * @return timingType
  */
  @ApiModelProperty(value = "The timing type of the voucher. It should be a value as follows: 0: Timing by time, clients can use vouchers for specified time duration. 1: Timing by usage, clients can use vouchers for the duration of actual usage")


  public Integer getTimingType() {
    return timingType;
  }

  public void setTimingType(Integer timingType) {
    this.timingType = timingType;
  }

  public VoucherOpenApiVo expirationTime(Long expirationTime) {
    this.expirationTime = expirationTime;
    return this;
  }

  /**
   * The timestamp of the expiration of the voucher, unit: millisecond
   * @return expirationTime
  */
  @ApiModelProperty(value = "The timestamp of the expiration of the voucher, unit: millisecond")


  public Long getExpirationTime() {
    return expirationTime;
  }

  public void setExpirationTime(Long expirationTime) {
    this.expirationTime = expirationTime;
  }

  public VoucherOpenApiVo effectiveTime(Long effectiveTime) {
    this.effectiveTime = effectiveTime;
    return this;
  }

  /**
   * The timestamp when the voucher takes effect, unit: millisecond
   * @return effectiveTime
  */
  @ApiModelProperty(value = "The timestamp when the voucher takes effect, unit: millisecond")


  public Long getEffectiveTime() {
    return effectiveTime;
  }

  public void setEffectiveTime(Long effectiveTime) {
    this.effectiveTime = effectiveTime;
  }

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

  /**
   * Description of the voucher
   * @return description
  */
  @ApiModelProperty(value = "Description of the voucher")


  public String getDescription() {
    return description;
  }

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

  public VoucherOpenApiVo rateLimit(RateLimitOpenApiVo rateLimit) {
    this.rateLimit = rateLimit;
    return this;
  }

  /**
   * Get rateLimit
   * @return rateLimit
  */
  @ApiModelProperty(value = "")

  @Valid

  public RateLimitOpenApiVo getRateLimit() {
    return rateLimit;
  }

  public void setRateLimit(RateLimitOpenApiVo rateLimit) {
    this.rateLimit = rateLimit;
  }

  public VoucherOpenApiVo trafficLimitEnable(Boolean trafficLimitEnable) {
    this.trafficLimitEnable = trafficLimitEnable;
    return this;
  }

  /**
   * Whether to enable traffic limit
   * @return trafficLimitEnable
  */
  @ApiModelProperty(value = "Whether to enable traffic limit")


  public Boolean getTrafficLimitEnable() {
    return trafficLimitEnable;
  }

  public void setTrafficLimitEnable(Boolean trafficLimitEnable) {
    this.trafficLimitEnable = trafficLimitEnable;
  }

  public VoucherOpenApiVo trafficLimit(Long trafficLimit) {
    this.trafficLimit = trafficLimit;
    return this;
  }

  /**
   * Traffic limit in MB. It should be within the range of 1–10485760
   * @return trafficLimit
  */
  @ApiModelProperty(value = "Traffic limit in MB. It should be within the range of 1–10485760")


  public Long getTrafficLimit() {
    return trafficLimit;
  }

  public void setTrafficLimit(Long trafficLimit) {
    this.trafficLimit = trafficLimit;
  }

  public VoucherOpenApiVo trafficLimitFrequency(Integer trafficLimitFrequency) {
    this.trafficLimitFrequency = trafficLimitFrequency;
    return this;
  }

  /**
   * Frequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly.
   * @return trafficLimitFrequency
  */
  @ApiModelProperty(value = "Frequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly.")


  public Integer getTrafficLimitFrequency() {
    return trafficLimitFrequency;
  }

  public void setTrafficLimitFrequency(Integer trafficLimitFrequency) {
    this.trafficLimitFrequency = trafficLimitFrequency;
  }

  public VoucherOpenApiVo trafficLeft(Boolean trafficLeft) {
    this.trafficLeft = trafficLeft;
    return this;
  }

  /**
   * Is there remaining traffic of traffic for the voucher
   * @return trafficLeft
  */
  @ApiModelProperty(value = "Is there remaining traffic of traffic for the voucher")


  public Boolean getTrafficLeft() {
    return trafficLeft;
  }

  public void setTrafficLeft(Boolean trafficLeft) {
    this.trafficLeft = trafficLeft;
  }

  public VoucherOpenApiVo startTime(Long startTime) {
    this.startTime = startTime;
    return this;
  }

  /**
   * The expiration date of the voucher
   * @return startTime
  */
  @ApiModelProperty(value = "The expiration date of the voucher")


  public Long getStartTime() {
    return startTime;
  }

  public void setStartTime(Long startTime) {
    this.startTime = startTime;
  }

  public VoucherOpenApiVo valid(Boolean valid) {
    this.valid = valid;
    return this;
  }

  /**
   * Can the voucher still be used
   * @return valid
  */
  @ApiModelProperty(value = "Can the voucher still be used")


  public Boolean getValid() {
    return valid;
  }

  public void setValid(Boolean valid) {
    this.valid = valid;
  }

  public VoucherOpenApiVo trafficUsed(Long trafficUsed) {
    this.trafficUsed = trafficUsed;
    return this;
  }

  /**
   * Used traffic of the voucher, unit: Byte
   * @return trafficUsed
  */
  @ApiModelProperty(value = "Used traffic of the voucher, unit: Byte")


  public Long getTrafficUsed() {
    return trafficUsed;
  }

  public void setTrafficUsed(Long trafficUsed) {
    this.trafficUsed = trafficUsed;
  }

  public VoucherOpenApiVo unitPrice(String unitPrice) {
    this.unitPrice = unitPrice;
    return this;
  }

  /**
   * Price of single voucher. It should be within the range of 1–999999999
   * @return unitPrice
  */
  @ApiModelProperty(value = "Price of single voucher. It should be within the range of 1–999999999")


  public String getUnitPrice() {
    return unitPrice;
  }

  public void setUnitPrice(String unitPrice) {
    this.unitPrice = unitPrice;
  }

  public VoucherOpenApiVo currency(String currency) {
    this.currency = currency;
    return this;
  }

  /**
   * Currency Short Code of voucher. For the values of Currency Short Code, refer to section 5.4.2 of the Open API Access Guide.
   * @return currency
  */
  @ApiModelProperty(value = "Currency Short Code of voucher. For the values of Currency Short Code, refer to section 5.4.2 of the Open API Access Guide.")


  public String getCurrency() {
    return currency;
  }

  public void setCurrency(String currency) {
    this.currency = currency;
  }

  public VoucherOpenApiVo portalNames(List<String> portalNames) {
    this.portalNames = portalNames;
    return this;
  }

  public VoucherOpenApiVo addPortalNamesItem(String portalNamesItem) {
    if (this.portalNames == null) {
      this.portalNames = new ArrayList<>();
    }
    this.portalNames.add(portalNamesItem);
    return this;
  }

  /**
   * Bound portal name list
   * @return portalNames
  */
  @ApiModelProperty(value = "Bound portal name list")


  public List<String> getPortalNames() {
    return portalNames;
  }

  public void setPortalNames(List<String> portalNames) {
    this.portalNames = portalNames;
  }

  public VoucherOpenApiVo logout(Boolean logout) {
    this.logout = logout;
    return this;
  }

  /**
   * Whether the voucher support portal logout functionality
   * @return logout
  */
  @ApiModelProperty(value = "Whether the voucher support portal logout functionality")


  public Boolean getLogout() {
    return logout;
  }

  public void setLogout(Boolean logout) {
    this.logout = logout;
  }

  public VoucherOpenApiVo validity(String validity) {
    this.validity = validity;
    return this;
  }

  /**
   * Information on the validity period of the voucher
   * @return validity
  */
  @ApiModelProperty(value = "Information on the validity period of the voucher")


  public String getValidity() {
    return validity;
  }

  public void setValidity(String validity) {
    this.validity = validity;
  }

  public VoucherOpenApiVo printComments(String printComments) {
    this.printComments = printComments;
    return this;
  }

  /**
   * Customized print information for voters
   * @return printComments
  */
  @ApiModelProperty(value = "Customized print information for voters")


  public String getPrintComments() {
    return printComments;
  }

  public void setPrintComments(String printComments) {
    this.printComments = printComments;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    VoucherOpenApiVo voucherOpenApiVo = (VoucherOpenApiVo) o;
    return Objects.equals(this.id, voucherOpenApiVo.id) &&
        Objects.equals(this.code, voucherOpenApiVo.code) &&
        Objects.equals(this.createdTime, voucherOpenApiVo.createdTime) &&
        Objects.equals(this.limitType, voucherOpenApiVo.limitType) &&
        Objects.equals(this.limitNum, voucherOpenApiVo.limitNum) &&
        Objects.equals(this.used, voucherOpenApiVo.used) &&
        Objects.equals(this.durationType, voucherOpenApiVo.durationType) &&
        Objects.equals(this.duration, voucherOpenApiVo.duration) &&
        Objects.equals(this.timingType, voucherOpenApiVo.timingType) &&
        Objects.equals(this.expirationTime, voucherOpenApiVo.expirationTime) &&
        Objects.equals(this.effectiveTime, voucherOpenApiVo.effectiveTime) &&
        Objects.equals(this.description, voucherOpenApiVo.description) &&
        Objects.equals(this.rateLimit, voucherOpenApiVo.rateLimit) &&
        Objects.equals(this.trafficLimitEnable, voucherOpenApiVo.trafficLimitEnable) &&
        Objects.equals(this.trafficLimit, voucherOpenApiVo.trafficLimit) &&
        Objects.equals(this.trafficLimitFrequency, voucherOpenApiVo.trafficLimitFrequency) &&
        Objects.equals(this.trafficLeft, voucherOpenApiVo.trafficLeft) &&
        Objects.equals(this.startTime, voucherOpenApiVo.startTime) &&
        Objects.equals(this.valid, voucherOpenApiVo.valid) &&
        Objects.equals(this.trafficUsed, voucherOpenApiVo.trafficUsed) &&
        Objects.equals(this.unitPrice, voucherOpenApiVo.unitPrice) &&
        Objects.equals(this.currency, voucherOpenApiVo.currency) &&
        Objects.equals(this.portalNames, voucherOpenApiVo.portalNames) &&
        Objects.equals(this.logout, voucherOpenApiVo.logout) &&
        Objects.equals(this.validity, voucherOpenApiVo.validity) &&
        Objects.equals(this.printComments, voucherOpenApiVo.printComments);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, code, createdTime, limitType, limitNum, used, durationType, duration, timingType, expirationTime, effectiveTime, description, rateLimit, trafficLimitEnable, trafficLimit, trafficLimitFrequency, trafficLeft, startTime, valid, trafficUsed, unitPrice, currency, portalNames, logout, validity, printComments);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class VoucherOpenApiVo {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    createdTime: ").append(toIndentedString(createdTime)).append("\n");
    sb.append("    limitType: ").append(toIndentedString(limitType)).append("\n");
    sb.append("    limitNum: ").append(toIndentedString(limitNum)).append("\n");
    sb.append("    used: ").append(toIndentedString(used)).append("\n");
    sb.append("    durationType: ").append(toIndentedString(durationType)).append("\n");
    sb.append("    duration: ").append(toIndentedString(duration)).append("\n");
    sb.append("    timingType: ").append(toIndentedString(timingType)).append("\n");
    sb.append("    expirationTime: ").append(toIndentedString(expirationTime)).append("\n");
    sb.append("    effectiveTime: ").append(toIndentedString(effectiveTime)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    rateLimit: ").append(toIndentedString(rateLimit)).append("\n");
    sb.append("    trafficLimitEnable: ").append(toIndentedString(trafficLimitEnable)).append("\n");
    sb.append("    trafficLimit: ").append(toIndentedString(trafficLimit)).append("\n");
    sb.append("    trafficLimitFrequency: ").append(toIndentedString(trafficLimitFrequency)).append("\n");
    sb.append("    trafficLeft: ").append(toIndentedString(trafficLeft)).append("\n");
    sb.append("    startTime: ").append(toIndentedString(startTime)).append("\n");
    sb.append("    valid: ").append(toIndentedString(valid)).append("\n");
    sb.append("    trafficUsed: ").append(toIndentedString(trafficUsed)).append("\n");
    sb.append("    unitPrice: ").append(toIndentedString(unitPrice)).append("\n");
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
    sb.append("    portalNames: ").append(toIndentedString(portalNames)).append("\n");
    sb.append("    logout: ").append(toIndentedString(logout)).append("\n");
    sb.append("    validity: ").append(toIndentedString(validity)).append("\n");
    sb.append("    printComments: ").append(toIndentedString(printComments)).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    ");
  }
}

