/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v50</h1>       <p>Introduced in Cloudera Manager 7.8.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.8.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package com.cloudera.api.swagger.model;

import java.util.Objects;
import com.cloudera.api.swagger.model.ApiParcelUsageParcel;
import com.cloudera.api.swagger.model.ApiParcelUsageRack;
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.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * This object provides a complete view of the usage of parcels in a given cluster - particularly which parcels are in use for which roles.
 */
@ApiModel(description = "This object provides a complete view of the usage of parcels in a given cluster - particularly which parcels are in use for which roles.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiParcelUsage {
  @SerializedName("racks")
  private List<ApiParcelUsageRack> racks = null;

  @SerializedName("parcels")
  private List<ApiParcelUsageParcel> parcels = null;

  public ApiParcelUsage racks(List<ApiParcelUsageRack> racks) {
    this.racks = racks;
    return this;
  }

  public ApiParcelUsage addRacksItem(ApiParcelUsageRack racksItem) {
    if (this.racks == null) {
      this.racks = new ArrayList<ApiParcelUsageRack>();
    }
    this.racks.add(racksItem);
    return this;
  }

   /**
   * The racks that contain hosts that are part of this cluster.
   * @return racks
  **/
  @ApiModelProperty(value = "The racks that contain hosts that are part of this cluster.")
  public List<ApiParcelUsageRack> getRacks() {
    return racks;
  }

  public void setRacks(List<ApiParcelUsageRack> racks) {
    this.racks = racks;
  }

  public ApiParcelUsage parcels(List<ApiParcelUsageParcel> parcels) {
    this.parcels = parcels;
    return this;
  }

  public ApiParcelUsage addParcelsItem(ApiParcelUsageParcel parcelsItem) {
    if (this.parcels == null) {
      this.parcels = new ArrayList<ApiParcelUsageParcel>();
    }
    this.parcels.add(parcelsItem);
    return this;
  }

   /**
   * The parcel&#39;s that are activated and/or in-use on this cluster.
   * @return parcels
  **/
  @ApiModelProperty(value = "The parcel's that are activated and/or in-use on this cluster.")
  public List<ApiParcelUsageParcel> getParcels() {
    return parcels;
  }

  public void setParcels(List<ApiParcelUsageParcel> parcels) {
    this.parcels = parcels;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiParcelUsage apiParcelUsage = (ApiParcelUsage) o;
    return Objects.equals(this.racks, apiParcelUsage.racks) &&
        Objects.equals(this.parcels, apiParcelUsage.parcels);
  }

  @Override
  public int hashCode() {
    return Objects.hash(racks, parcels);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiParcelUsage {\n");
    
    sb.append("    racks: ").append(toIndentedString(racks)).append("\n");
    sb.append("    parcels: ").append(toIndentedString(parcels)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
  
}

