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

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

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

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

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

  @JsonProperty("amount")
  private Integer amount;

  @JsonProperty("codeLength")
  private Integer codeLength;

  @JsonProperty("codeForm")
  @Valid
  private List<Integer> codeForm = new ArrayList<>();

  @JsonProperty("limitType")
  private Integer limitType;

  @JsonProperty("limitNum")
  private Integer limitNum;

  @JsonProperty("durationType")
  private Integer durationType;

  @JsonProperty("duration")
  private Long duration;

  @JsonProperty("timingType")
  private Integer timingType;

  @JsonProperty("rateLimit")
  private RateLimitOpenApiVo rateLimit;

  @JsonProperty("trafficLimitEnable")
  private Boolean trafficLimitEnable;

  @JsonProperty("trafficLimit")
  private Long trafficLimit;

  @JsonProperty("trafficLimitFrequency")
  private Integer trafficLimitFrequency;

  @JsonProperty("unitPrice")
  private Long unitPrice;

  @JsonProperty("currency")
  private String currency;

  @JsonProperty("applyToAllPortals")
  private Boolean applyToAllPortals;

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

  @JsonProperty("expirationTime")
  private Long expirationTime;

  @JsonProperty("effectiveTime")
  private Long effectiveTime;

  @JsonProperty("logout")
  private Boolean logout;

  @JsonProperty("description")
  private String description;

  @JsonProperty("printComments")
  private String printComments;

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

  /**
   * Voucher group name. It should contain 1-32 characters
   * @return name
  */
  @ApiModelProperty(required = true, value = "Voucher group name. It should contain 1-32 characters")
  @NotNull


  public String getName() {
    return name;
  }

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

  public CreateVoucherGroupOpenApiVo amount(Integer amount) {
    this.amount = amount;
    return this;
  }

  /**
   * The amount of vouchers created. It should be within the range of 1-500
   * @return amount
  */
  @ApiModelProperty(required = true, value = "The amount of vouchers created. It should be within the range of 1-500")
  @NotNull


  public Integer getAmount() {
    return amount;
  }

  public void setAmount(Integer amount) {
    this.amount = amount;
  }

  public CreateVoucherGroupOpenApiVo codeLength(Integer codeLength) {
    this.codeLength = codeLength;
    return this;
  }

  /**
   * The length of voucher code. It should be within the range of 6–10.
   * @return codeLength
  */
  @ApiModelProperty(required = true, value = "The length of voucher code. It should be within the range of 6–10.")
  @NotNull


  public Integer getCodeLength() {
    return codeLength;
  }

  public void setCodeLength(Integer codeLength) {
    this.codeLength = codeLength;
  }

  public CreateVoucherGroupOpenApiVo codeForm(List<Integer> codeForm) {
    this.codeForm = codeForm;
    return this;
  }

  public CreateVoucherGroupOpenApiVo addCodeFormItem(Integer codeFormItem) {
    this.codeForm.add(codeFormItem);
    return this;
  }

  /**
   * The character types contained in the voucher code. It should be a value as follows: 0: Number, 1: Letter. For example, [0] indicates that the code only contains numbers; [0, 1] indicates that the code contains numbers and letters
   * @return codeForm
  */
  @ApiModelProperty(required = true, value = "The character types contained in the voucher code. It should be a value as follows: 0: Number, 1: Letter. For example, [0] indicates that the code only contains numbers; [0, 1] indicates that the code contains numbers and letters")
  @NotNull


  public List<Integer> getCodeForm() {
    return codeForm;
  }

  public void setCodeForm(List<Integer> codeForm) {
    this.codeForm = codeForm;
  }

  public CreateVoucherGroupOpenApiVo 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(required = true, value = "The limitations of the voucher. It should be a value as follows: 0: Limited Usage Counts, 1: Limited Online Users, 2: Unlimited")
  @NotNull


  public Integer getLimitType() {
    return limitType;
  }

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

  public CreateVoucherGroupOpenApiVo 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 CreateVoucherGroupOpenApiVo 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(required = true, 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")
  @NotNull


  public Integer getDurationType() {
    return durationType;
  }

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

  public CreateVoucherGroupOpenApiVo 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(required = true, value = "Duration of one use, unit: minute. It should be within the range of 1–14400000.")
  @NotNull


  public Long getDuration() {
    return duration;
  }

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

  public CreateVoucherGroupOpenApiVo 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(required = true, 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")
  @NotNull


  public Integer getTimingType() {
    return timingType;
  }

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

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

  /**
   * Get rateLimit
   * @return rateLimit
  */
  @ApiModelProperty(required = true, value = "")
  @NotNull

  @Valid

  public RateLimitOpenApiVo getRateLimit() {
    return rateLimit;
  }

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

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

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


  public Boolean getTrafficLimitEnable() {
    return trafficLimitEnable;
  }

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

  public CreateVoucherGroupOpenApiVo 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 CreateVoucherGroupOpenApiVo 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 CreateVoucherGroupOpenApiVo unitPrice(Long 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 Long getUnitPrice() {
    return unitPrice;
  }

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

  public CreateVoucherGroupOpenApiVo 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 CreateVoucherGroupOpenApiVo applyToAllPortals(Boolean applyToAllPortals) {
    this.applyToAllPortals = applyToAllPortals;
    return this;
  }

  /**
   * Is the voucher effective for all portals, including all newly created portals
   * @return applyToAllPortals
  */
  @ApiModelProperty(required = true, value = "Is the voucher effective for all portals, including all newly created portals")
  @NotNull


  public Boolean getApplyToAllPortals() {
    return applyToAllPortals;
  }

  public void setApplyToAllPortals(Boolean applyToAllPortals) {
    this.applyToAllPortals = applyToAllPortals;
  }

  public CreateVoucherGroupOpenApiVo portals(List<String> portals) {
    this.portals = portals;
    return this;
  }

  public CreateVoucherGroupOpenApiVo addPortalsItem(String portalsItem) {
    if (this.portals == null) {
      this.portals = new ArrayList<>();
    }
    this.portals.add(portalsItem);
    return this;
  }

  /**
   * Bound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface
   * @return portals
  */
  @ApiModelProperty(value = "Bound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface")


  public List<String> getPortals() {
    return portals;
  }

  public void setPortals(List<String> portals) {
    this.portals = portals;
  }

  public CreateVoucherGroupOpenApiVo 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 CreateVoucherGroupOpenApiVo 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 CreateVoucherGroupOpenApiVo 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 CreateVoucherGroupOpenApiVo description(String description) {
    this.description = description;
    return this;
  }

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


  public String getDescription() {
    return description;
  }

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

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

  /**
   * Print comments of the voucher group
   * @return printComments
  */
  @ApiModelProperty(value = "Print comments of the voucher group")


  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;
    }
    CreateVoucherGroupOpenApiVo createVoucherGroupOpenApiVo = (CreateVoucherGroupOpenApiVo) o;
    return Objects.equals(this.name, createVoucherGroupOpenApiVo.name) &&
        Objects.equals(this.amount, createVoucherGroupOpenApiVo.amount) &&
        Objects.equals(this.codeLength, createVoucherGroupOpenApiVo.codeLength) &&
        Objects.equals(this.codeForm, createVoucherGroupOpenApiVo.codeForm) &&
        Objects.equals(this.limitType, createVoucherGroupOpenApiVo.limitType) &&
        Objects.equals(this.limitNum, createVoucherGroupOpenApiVo.limitNum) &&
        Objects.equals(this.durationType, createVoucherGroupOpenApiVo.durationType) &&
        Objects.equals(this.duration, createVoucherGroupOpenApiVo.duration) &&
        Objects.equals(this.timingType, createVoucherGroupOpenApiVo.timingType) &&
        Objects.equals(this.rateLimit, createVoucherGroupOpenApiVo.rateLimit) &&
        Objects.equals(this.trafficLimitEnable, createVoucherGroupOpenApiVo.trafficLimitEnable) &&
        Objects.equals(this.trafficLimit, createVoucherGroupOpenApiVo.trafficLimit) &&
        Objects.equals(this.trafficLimitFrequency, createVoucherGroupOpenApiVo.trafficLimitFrequency) &&
        Objects.equals(this.unitPrice, createVoucherGroupOpenApiVo.unitPrice) &&
        Objects.equals(this.currency, createVoucherGroupOpenApiVo.currency) &&
        Objects.equals(this.applyToAllPortals, createVoucherGroupOpenApiVo.applyToAllPortals) &&
        Objects.equals(this.portals, createVoucherGroupOpenApiVo.portals) &&
        Objects.equals(this.expirationTime, createVoucherGroupOpenApiVo.expirationTime) &&
        Objects.equals(this.effectiveTime, createVoucherGroupOpenApiVo.effectiveTime) &&
        Objects.equals(this.logout, createVoucherGroupOpenApiVo.logout) &&
        Objects.equals(this.description, createVoucherGroupOpenApiVo.description) &&
        Objects.equals(this.printComments, createVoucherGroupOpenApiVo.printComments);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, amount, codeLength, codeForm, limitType, limitNum, durationType, duration, timingType, rateLimit, trafficLimitEnable, trafficLimit, trafficLimitFrequency, unitPrice, currency, applyToAllPortals, portals, expirationTime, effectiveTime, logout, description, printComments);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateVoucherGroupOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
    sb.append("    codeLength: ").append(toIndentedString(codeLength)).append("\n");
    sb.append("    codeForm: ").append(toIndentedString(codeForm)).append("\n");
    sb.append("    limitType: ").append(toIndentedString(limitType)).append("\n");
    sb.append("    limitNum: ").append(toIndentedString(limitNum)).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("    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("    unitPrice: ").append(toIndentedString(unitPrice)).append("\n");
    sb.append("    currency: ").append(toIndentedString(currency)).append("\n");
    sb.append("    applyToAllPortals: ").append(toIndentedString(applyToAllPortals)).append("\n");
    sb.append("    portals: ").append(toIndentedString(portals)).append("\n");
    sb.append("    expirationTime: ").append(toIndentedString(expirationTime)).append("\n");
    sb.append("    effectiveTime: ").append(toIndentedString(effectiveTime)).append("\n");
    sb.append("    logout: ").append(toIndentedString(logout)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).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    ");
  }
}

