/*
 * Internal Utility API
 * This API allows you to access internal data.
 *
 * OpenAPI spec version: 1.0.0
 * 
 *
 * 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 org.wso2.am.integration.clients.internal.api.dto;

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.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.wso2.am.integration.clients.internal.api.dto.ApiPolicyConditionGroupDTO;
import org.wso2.am.integration.clients.internal.api.dto.PolicyDTO;
import org.wso2.am.integration.clients.internal.api.dto.ThrottleLimitDTO;

/**
 * ApiPolicyDTO
 */

public class ApiPolicyDTO {
  @SerializedName("id")
  private Integer id = null;

  @SerializedName("tenantId")
  private Integer tenantId = null;

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

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

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

  @SerializedName("conditionGroups")
  private List<ApiPolicyConditionGroupDTO> conditionGroups = null;

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

  @SerializedName("defaultLimit")
  private ThrottleLimitDTO defaultLimit = null;

  public ApiPolicyDTO id(Integer id) {
    this.id = id;
    return this;
  }

   /**
   * Get id
   * @return id
  **/
  @ApiModelProperty(value = "")
  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  public ApiPolicyDTO tenantId(Integer tenantId) {
    this.tenantId = tenantId;
    return this;
  }

   /**
   * Get tenantId
   * @return tenantId
  **/
  @ApiModelProperty(value = "")
  public Integer getTenantId() {
    return tenantId;
  }

  public void setTenantId(Integer tenantId) {
    this.tenantId = tenantId;
  }

  public ApiPolicyDTO tenantDomain(String tenantDomain) {
    this.tenantDomain = tenantDomain;
    return this;
  }

   /**
   * Get tenantDomain
   * @return tenantDomain
  **/
  @ApiModelProperty(value = "")
  public String getTenantDomain() {
    return tenantDomain;
  }

  public void setTenantDomain(String tenantDomain) {
    this.tenantDomain = tenantDomain;
  }

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

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

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

  public ApiPolicyDTO quotaType(String quotaType) {
    this.quotaType = quotaType;
    return this;
  }

   /**
   * Get quotaType
   * @return quotaType
  **/
  @ApiModelProperty(value = "")
  public String getQuotaType() {
    return quotaType;
  }

  public void setQuotaType(String quotaType) {
    this.quotaType = quotaType;
  }

  public ApiPolicyDTO conditionGroups(List<ApiPolicyConditionGroupDTO> conditionGroups) {
    this.conditionGroups = conditionGroups;
    return this;
  }

  public ApiPolicyDTO addConditionGroupsItem(ApiPolicyConditionGroupDTO conditionGroupsItem) {
    if (this.conditionGroups == null) {
      this.conditionGroups = new ArrayList<>();
    }
    this.conditionGroups.add(conditionGroupsItem);
    return this;
  }

   /**
   * Get conditionGroups
   * @return conditionGroups
  **/
  @ApiModelProperty(value = "")
  public List<ApiPolicyConditionGroupDTO> getConditionGroups() {
    return conditionGroups;
  }

  public void setConditionGroups(List<ApiPolicyConditionGroupDTO> conditionGroups) {
    this.conditionGroups = conditionGroups;
  }

  public ApiPolicyDTO applicableLevel(String applicableLevel) {
    this.applicableLevel = applicableLevel;
    return this;
  }

   /**
   * Get applicableLevel
   * @return applicableLevel
  **/
  @ApiModelProperty(value = "")
  public String getApplicableLevel() {
    return applicableLevel;
  }

  public void setApplicableLevel(String applicableLevel) {
    this.applicableLevel = applicableLevel;
  }

  public ApiPolicyDTO defaultLimit(ThrottleLimitDTO defaultLimit) {
    this.defaultLimit = defaultLimit;
    return this;
  }

   /**
   * Get defaultLimit
   * @return defaultLimit
  **/
  @ApiModelProperty(value = "")
  public ThrottleLimitDTO getDefaultLimit() {
    return defaultLimit;
  }

  public void setDefaultLimit(ThrottleLimitDTO defaultLimit) {
    this.defaultLimit = defaultLimit;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiPolicyDTO apiPolicy = (ApiPolicyDTO) o;
    return Objects.equals(this.id, apiPolicy.id) &&
        Objects.equals(this.tenantId, apiPolicy.tenantId) &&
        Objects.equals(this.tenantDomain, apiPolicy.tenantDomain) &&
        Objects.equals(this.name, apiPolicy.name) &&
        Objects.equals(this.quotaType, apiPolicy.quotaType) &&
        Objects.equals(this.conditionGroups, apiPolicy.conditionGroups) &&
        Objects.equals(this.applicableLevel, apiPolicy.applicableLevel) &&
        Objects.equals(this.defaultLimit, apiPolicy.defaultLimit);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, tenantId, tenantDomain, name, quotaType, conditionGroups, applicableLevel, defaultLimit);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiPolicyDTO {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    tenantId: ").append(toIndentedString(tenantId)).append("\n");
    sb.append("    tenantDomain: ").append(toIndentedString(tenantDomain)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    quotaType: ").append(toIndentedString(quotaType)).append("\n");
    sb.append("    conditionGroups: ").append(toIndentedString(conditionGroups)).append("\n");
    sb.append("    applicableLevel: ").append(toIndentedString(applicableLevel)).append("\n");
    sb.append("    defaultLimit: ").append(toIndentedString(defaultLimit)).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    ");
  }

}

