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

io.harness.cf.model.Distribution Maven / Gradle / Ivy

The newest version!
/*
 * Harness feature flag service client apis
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package io.harness.cf.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.harness.cf.model.WeightedVariation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

/**
 * Describes a distribution rule
 */
@ApiModel(description = "Describes a distribution rule")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T14:30:44.890314Z[GMT]")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Distribution implements Serializable {
  private static final long serialVersionUID = 1L;

  public static final String SERIALIZED_NAME_BUCKET_BY = "bucketBy";
  @SerializedName(SERIALIZED_NAME_BUCKET_BY)
  private String bucketBy;

  public static final String SERIALIZED_NAME_VARIATIONS = "variations";
  @SerializedName(SERIALIZED_NAME_VARIATIONS)
  private List variations = new ArrayList<>();


  public Distribution bucketBy(String bucketBy) {
    
    this.bucketBy = bucketBy;
    return this;
  }

   /**
   * The attribute to use when distributing targets across buckets
   * @return bucketBy
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "The attribute to use when distributing targets across buckets")

  public String getBucketBy() {
    return bucketBy;
  }


  public void setBucketBy(String bucketBy) {
    this.bucketBy = bucketBy;
  }


  public Distribution variations(List variations) {
    
    this.variations = variations;
    return this;
  }

   /**
   * A list of variations and the weight that should be given to each
   * @return variations
  **/
  @javax.annotation.Nonnull
  @ApiModelProperty(required = true, value = "A list of variations and the weight that should be given to each")

  public List getVariations() {
    return variations;
  }


  public void setVariations(List variations) {
    this.variations = variations;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Distribution distribution = (Distribution) o;
    return Objects.equals(this.bucketBy, distribution.bucketBy) &&
        Objects.equals(this.variations, distribution.variations);
  }

  @Override
  public int hashCode() {
    return Objects.hash(bucketBy, variations);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Distribution {\n");
    sb.append("    bucketBy: ").append(toIndentedString(bucketBy)).append("\n");
    sb.append("    variations: ").append(toIndentedString(variations)).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 - 2024 Weber Informatics LLC | Privacy Policy