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

com.dominodatalab.pub.model.HardwareTierOverProvisioningV1 Maven / Gradle / Ivy

/*
 * Domino Public API
 * Domino Public API Endpoints
 *
 * The version of the OpenAPI document: 0.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package com.dominodatalab.pub.model;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
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 java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


import com.dominodatalab.pub.invoker.ApiClient;
/**
 * Over provisioning settings for a hardware tier
 */
@JsonPropertyOrder({
  HardwareTierOverProvisioningV1.JSON_PROPERTY_DAYS_OF_WEEK,
  HardwareTierOverProvisioningV1.JSON_PROPERTY_FROM_TIME,
  HardwareTierOverProvisioningV1.JSON_PROPERTY_INSTANCES,
  HardwareTierOverProvisioningV1.JSON_PROPERTY_SCHEDULING_ENABLED,
  HardwareTierOverProvisioningV1.JSON_PROPERTY_TIMEZONE,
  HardwareTierOverProvisioningV1.JSON_PROPERTY_TO_TIME
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-04T16:37:28.765500600-04:00[America/New_York]", comments = "Generator version: 7.8.0")
public class HardwareTierOverProvisioningV1 {
  public static final String JSON_PROPERTY_DAYS_OF_WEEK = "daysOfWeek";
  private List daysOfWeek = new ArrayList<>();

  public static final String JSON_PROPERTY_FROM_TIME = "fromTime";
  private String fromTime;

  public static final String JSON_PROPERTY_INSTANCES = "instances";
  private Integer instances;

  public static final String JSON_PROPERTY_SCHEDULING_ENABLED = "schedulingEnabled";
  private Boolean schedulingEnabled;

  public static final String JSON_PROPERTY_TIMEZONE = "timezone";
  private String timezone;

  public static final String JSON_PROPERTY_TO_TIME = "toTime";
  private String toTime;

  public HardwareTierOverProvisioningV1() { 
  }

  public HardwareTierOverProvisioningV1 daysOfWeek(List daysOfWeek) {
    this.daysOfWeek = daysOfWeek;
    return this;
  }

  public HardwareTierOverProvisioningV1 addDaysOfWeekItem(String daysOfWeekItem) {
    if (this.daysOfWeek == null) {
      this.daysOfWeek = new ArrayList<>();
    }
    this.daysOfWeek.add(daysOfWeekItem);
    return this;
  }

  /**
   * Get daysOfWeek
   * @return daysOfWeek
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_DAYS_OF_WEEK)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public List getDaysOfWeek() {
    return daysOfWeek;
  }


  @JsonProperty(JSON_PROPERTY_DAYS_OF_WEEK)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setDaysOfWeek(List daysOfWeek) {
    this.daysOfWeek = daysOfWeek;
  }


  public HardwareTierOverProvisioningV1 fromTime(String fromTime) {
    this.fromTime = fromTime;
    return this;
  }

  /**
   * Get fromTime
   * @return fromTime
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_FROM_TIME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getFromTime() {
    return fromTime;
  }


  @JsonProperty(JSON_PROPERTY_FROM_TIME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setFromTime(String fromTime) {
    this.fromTime = fromTime;
  }


  public HardwareTierOverProvisioningV1 instances(Integer instances) {
    this.instances = instances;
    return this;
  }

  /**
   * Get instances
   * @return instances
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_INSTANCES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public Integer getInstances() {
    return instances;
  }


  @JsonProperty(JSON_PROPERTY_INSTANCES)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setInstances(Integer instances) {
    this.instances = instances;
  }


  public HardwareTierOverProvisioningV1 schedulingEnabled(Boolean schedulingEnabled) {
    this.schedulingEnabled = schedulingEnabled;
    return this;
  }

  /**
   * Get schedulingEnabled
   * @return schedulingEnabled
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_SCHEDULING_ENABLED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public Boolean getSchedulingEnabled() {
    return schedulingEnabled;
  }


  @JsonProperty(JSON_PROPERTY_SCHEDULING_ENABLED)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setSchedulingEnabled(Boolean schedulingEnabled) {
    this.schedulingEnabled = schedulingEnabled;
  }


  public HardwareTierOverProvisioningV1 timezone(String timezone) {
    this.timezone = timezone;
    return this;
  }

  /**
   * Get timezone
   * @return timezone
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_TIMEZONE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getTimezone() {
    return timezone;
  }


  @JsonProperty(JSON_PROPERTY_TIMEZONE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setTimezone(String timezone) {
    this.timezone = timezone;
  }


  public HardwareTierOverProvisioningV1 toTime(String toTime) {
    this.toTime = toTime;
    return this;
  }

  /**
   * Get toTime
   * @return toTime
   */
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_TO_TIME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public String getToTime() {
    return toTime;
  }


  @JsonProperty(JSON_PROPERTY_TO_TIME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setToTime(String toTime) {
    this.toTime = toTime;
  }


  /**
   * Return true if this HardwareTierOverProvisioningV1 object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    HardwareTierOverProvisioningV1 hardwareTierOverProvisioningV1 = (HardwareTierOverProvisioningV1) o;
    return Objects.equals(this.daysOfWeek, hardwareTierOverProvisioningV1.daysOfWeek) &&
        Objects.equals(this.fromTime, hardwareTierOverProvisioningV1.fromTime) &&
        Objects.equals(this.instances, hardwareTierOverProvisioningV1.instances) &&
        Objects.equals(this.schedulingEnabled, hardwareTierOverProvisioningV1.schedulingEnabled) &&
        Objects.equals(this.timezone, hardwareTierOverProvisioningV1.timezone) &&
        Objects.equals(this.toTime, hardwareTierOverProvisioningV1.toTime);
  }

  @Override
  public int hashCode() {
    return Objects.hash(daysOfWeek, fromTime, instances, schedulingEnabled, timezone, toTime);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class HardwareTierOverProvisioningV1 {\n");
    sb.append("    daysOfWeek: ").append(toIndentedString(daysOfWeek)).append("\n");
    sb.append("    fromTime: ").append(toIndentedString(fromTime)).append("\n");
    sb.append("    instances: ").append(toIndentedString(instances)).append("\n");
    sb.append("    schedulingEnabled: ").append(toIndentedString(schedulingEnabled)).append("\n");
    sb.append("    timezone: ").append(toIndentedString(timezone)).append("\n");
    sb.append("    toTime: ").append(toIndentedString(toTime)).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    ");
  }

  /**
   * Convert the instance into URL query string.
   *
   * @return URL query string
   */
  public String toUrlQueryString() {
    return toUrlQueryString(null);
  }

  /**
   * Convert the instance into URL query string.
   *
   * @param prefix prefix of the query string
   * @return URL query string
   */
  public String toUrlQueryString(String prefix) {
    String suffix = "";
    String containerSuffix = "";
    String containerPrefix = "";
    if (prefix == null) {
      // style=form, explode=true, e.g. /pet?name=cat&type=manx
      prefix = "";
    } else {
      // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
      prefix = prefix + "[";
      suffix = "]";
      containerSuffix = "]";
      containerPrefix = "[";
    }

    StringJoiner joiner = new StringJoiner("&");

    // add `daysOfWeek` to the URL query string
    if (getDaysOfWeek() != null) {
      for (int i = 0; i < getDaysOfWeek().size(); i++) {
        joiner.add(String.format("%sdaysOfWeek%s%s=%s", prefix, suffix,
            "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix),
            URLEncoder.encode(ApiClient.valueToString(getDaysOfWeek().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
      }
    }

    // add `fromTime` to the URL query string
    if (getFromTime() != null) {
      joiner.add(String.format("%sfromTime%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getFromTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `instances` to the URL query string
    if (getInstances() != null) {
      joiner.add(String.format("%sinstances%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getInstances()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `schedulingEnabled` to the URL query string
    if (getSchedulingEnabled() != null) {
      joiner.add(String.format("%sschedulingEnabled%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getSchedulingEnabled()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `timezone` to the URL query string
    if (getTimezone() != null) {
      joiner.add(String.format("%stimezone%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getTimezone()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    // add `toTime` to the URL query string
    if (getToTime() != null) {
      joiner.add(String.format("%stoTime%s=%s", prefix, suffix, URLEncoder.encode(ApiClient.valueToString(getToTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
    }

    return joiner.toString();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy