All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.crashteam.openapi.uzumanalytics.model.PromoCode Maven / Gradle / Ivy

Go to download

Generates jar artifact containing compiled openapi classes based on generated openapi yaml files

There is a newer version: 1.23-f484458-server
Show newest version
/*
 * CrashTeam Uzum Analytics API
 * CrashTeam Dev Uzum Analytics API 
 *
 * The version of the OpenAPI document: 0.0.1
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package dev.crashteam.openapi.uzumanalytics.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import dev.crashteam.openapi.uzumanalytics.model.PromoCodeContext;
import java.time.OffsetDateTime;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * Промокод для применения при покупке
 */
@JsonPropertyOrder({
  PromoCode.JSON_PROPERTY_CODE,
  PromoCode.JSON_PROPERTY_PREFIX,
  PromoCode.JSON_PROPERTY_DESCRIPTION,
  PromoCode.JSON_PROPERTY_VALID_UNTIL,
  PromoCode.JSON_PROPERTY_USE_LIMIT,
  PromoCode.JSON_PROPERTY_CONTEXT
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-02-21T16:53:18.489277710Z[Etc/UTC]")
public class PromoCode {
  public static final String JSON_PROPERTY_CODE = "code";
  private String code;

  public static final String JSON_PROPERTY_PREFIX = "prefix";
  private String prefix;

  public static final String JSON_PROPERTY_DESCRIPTION = "description";
  private String description;

  public static final String JSON_PROPERTY_VALID_UNTIL = "validUntil";
  private OffsetDateTime validUntil;

  public static final String JSON_PROPERTY_USE_LIMIT = "useLimit";
  private Integer useLimit;

  public static final String JSON_PROPERTY_CONTEXT = "context";
  private PromoCodeContext context;

  public PromoCode() {
  }

  @JsonCreator
  public PromoCode(
    @JsonProperty(JSON_PROPERTY_CODE) String code
  ) {
    this();
    this.code = code;
  }

   /**
   * Get code
   * @return code
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CODE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getCode() {
    return code;
  }




  public PromoCode prefix(String prefix) {
    
    this.prefix = prefix;
    return this;
  }

   /**
   * Префикс для промокода
   * @return prefix
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PREFIX)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getPrefix() {
    return prefix;
  }


  @JsonProperty(JSON_PROPERTY_PREFIX)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPrefix(String prefix) {
    this.prefix = prefix;
  }


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

   /**
   * Get description
   * @return description
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getDescription() {
    return description;
  }


  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDescription(String description) {
    this.description = description;
  }


  public PromoCode validUntil(OffsetDateTime validUntil) {
    
    this.validUntil = validUntil;
    return this;
  }

   /**
   * Дата окончания действия промокода
   * @return validUntil
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_VALID_UNTIL)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public OffsetDateTime getValidUntil() {
    return validUntil;
  }


  @JsonProperty(JSON_PROPERTY_VALID_UNTIL)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setValidUntil(OffsetDateTime validUntil) {
    this.validUntil = validUntil;
  }


  public PromoCode useLimit(Integer useLimit) {
    
    this.useLimit = useLimit;
    return this;
  }

   /**
   * Максимальное кол-во использований промокода
   * @return useLimit
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_USE_LIMIT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Integer getUseLimit() {
    return useLimit;
  }


  @JsonProperty(JSON_PROPERTY_USE_LIMIT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setUseLimit(Integer useLimit) {
    this.useLimit = useLimit;
  }


  public PromoCode context(PromoCodeContext context) {
    
    this.context = context;
    return this;
  }

   /**
   * Get context
   * @return context
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_CONTEXT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public PromoCodeContext getContext() {
    return context;
  }


  @JsonProperty(JSON_PROPERTY_CONTEXT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setContext(PromoCodeContext context) {
    this.context = context;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PromoCode promoCode = (PromoCode) o;
    return Objects.equals(this.code, promoCode.code) &&
        Objects.equals(this.prefix, promoCode.prefix) &&
        Objects.equals(this.description, promoCode.description) &&
        Objects.equals(this.validUntil, promoCode.validUntil) &&
        Objects.equals(this.useLimit, promoCode.useLimit) &&
        Objects.equals(this.context, promoCode.context);
  }

  @Override
  public int hashCode() {
    return Objects.hash(code, prefix, description, validUntil, useLimit, context);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PromoCode {\n");
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    prefix: ").append(toIndentedString(prefix)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    validUntil: ").append(toIndentedString(validUntil)).append("\n");
    sb.append("    useLimit: ").append(toIndentedString(useLimit)).append("\n");
    sb.append("    context: ").append(toIndentedString(context)).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    ");
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy