/*
 * 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.ApiRangerPolicyResource;
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.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Holds information about a policy defined in Ranger.
 */
@Schema(description = "Holds information about a policy defined in Ranger.")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiRangerPolicy {
  @SerializedName("service")
  private String service = null;

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

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

  @SerializedName("resources")
  private Map<String, ApiRangerPolicyResource> resources = null;

  public ApiRangerPolicy service(String service) {
    this.service = service;
    return this;
  }

   /**
   * Get service
   * @return service
  **/
  @Schema(description = "")
  public String getService() {
    return service;
  }

  public void setService(String service) {
    this.service = service;
  }

  public ApiRangerPolicy serviceType(String serviceType) {
    this.serviceType = serviceType;
    return this;
  }

   /**
   * Get serviceType
   * @return serviceType
  **/
  @Schema(description = "")
  public String getServiceType() {
    return serviceType;
  }

  public void setServiceType(String serviceType) {
    this.serviceType = serviceType;
  }

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

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

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

  public ApiRangerPolicy resources(Map<String, ApiRangerPolicyResource> resources) {
    this.resources = resources;
    return this;
  }

  public ApiRangerPolicy putResourcesItem(String key, ApiRangerPolicyResource resourcesItem) {
    if (this.resources == null) {
      this.resources = new HashMap<>();
    }
    this.resources.put(key, resourcesItem);
    return this;
  }

   /**
   * Get resources
   * @return resources
  **/
  @Schema(description = "")
  public Map<String, ApiRangerPolicyResource> getResources() {
    return resources;
  }

  public void setResources(Map<String, ApiRangerPolicyResource> resources) {
    this.resources = resources;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiRangerPolicy apiRangerPolicy = (ApiRangerPolicy) o;
    return Objects.equals(this.service, apiRangerPolicy.service) &&
        Objects.equals(this.serviceType, apiRangerPolicy.serviceType) &&
        Objects.equals(this.name, apiRangerPolicy.name) &&
        Objects.equals(this.resources, apiRangerPolicy.resources);
  }

  @Override
  public int hashCode() {
    return Objects.hash(service, serviceType, name, resources);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiRangerPolicy {\n");
    
    sb.append("    service: ").append(toIndentedString(service)).append("\n");
    sb.append("    serviceType: ").append(toIndentedString(serviceType)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    resources: ").append(toIndentedString(resources)).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    ");
  }

}
