/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.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 java.util.Arrays;
import com.cloudera.api.swagger.model.ApiConfigEnforcement;
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.v3.oas.annotations.media.Schema;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
 * ApiConfigPolicy
 */

@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiConfigPolicy {
  @SerializedName("name")
  private String name = null;

  @SerializedName("version")
  private String version = null;

  @SerializedName("description")
  private String description = null;

  @SerializedName("configEnforcements")
  private List<ApiConfigEnforcement> configEnforcements = null;

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

   /**
   * The policy name.
   * @return name
  **/
  @Schema(description = "The policy name.")
  public String getName() {
    return name;
  }

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

  public ApiConfigPolicy version(String version) {
    this.version = version;
    return this;
  }

   /**
   * The policy version. Useful to differentiate different versions of the same policy. Optional
   * @return version
  **/
  @Schema(description = "The policy version. Useful to differentiate different versions of the same policy. Optional")
  public String getVersion() {
    return version;
  }

  public void setVersion(String version) {
    this.version = version;
  }

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

   /**
   * A human readable version of what this policy does. Optional
   * @return description
  **/
  @Schema(description = "A human readable version of what this policy does. Optional")
  public String getDescription() {
    return description;
  }

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

  public ApiConfigPolicy configEnforcements(List<ApiConfigEnforcement> configEnforcements) {
    this.configEnforcements = configEnforcements;
    return this;
  }

  public ApiConfigPolicy addConfigEnforcementsItem(ApiConfigEnforcement configEnforcementsItem) {
    if (this.configEnforcements == null) {
      this.configEnforcements = new ArrayList<>();
    }
    this.configEnforcements.add(configEnforcementsItem);
    return this;
  }

   /**
   * A list of configuration enforcements.
   * @return configEnforcements
  **/
  @Schema(description = "A list of configuration enforcements.")
  public List<ApiConfigEnforcement> getConfigEnforcements() {
    return configEnforcements;
  }

  public void setConfigEnforcements(List<ApiConfigEnforcement> configEnforcements) {
    this.configEnforcements = configEnforcements;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiConfigPolicy apiConfigPolicy = (ApiConfigPolicy) o;
    return Objects.equals(this.name, apiConfigPolicy.name) &&
        Objects.equals(this.version, apiConfigPolicy.version) &&
        Objects.equals(this.description, apiConfigPolicy.description) &&
        Objects.equals(this.configEnforcements, apiConfigPolicy.configEnforcements);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, version, description, configEnforcements);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiConfigPolicy {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    configEnforcements: ").append(toIndentedString(configEnforcements)).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    ");
  }

}
