/*
 * WSO2 API Manager - Governance
 * This document specifies a **RESTful API** for WSO2 **API Manager** - Governance. 
 *
 * The version of the OpenAPI document: v1.1
 * Contact: architecture@wso2.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.wso2.am.integration.clients.governance.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.governance.api.dto.RulesetValidationResultWithoutRulesDTO;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Adherence status of a policy with ruleset details.
*/
    @ApiModel(description = "Adherence status of a policy with ruleset details.")

public class PolicyAdherenceWithRulesetsDTO {
        public static final String SERIALIZED_NAME_ID = "id";
        @SerializedName(SERIALIZED_NAME_ID)
            private String id;

        public static final String SERIALIZED_NAME_NAME = "name";
        @SerializedName(SERIALIZED_NAME_NAME)
            private String name;

            /**
* Status of the policy&#39;s governance compliance.
*/
    @JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
        FOLLOWED("FOLLOWED"),
        
        VIOLATED("VIOLATED"),
        
        UNAPPLIED("UNAPPLIED"),
        
        PENDING("PENDING");

private String value;

StatusEnum(String value) {
this.value = value;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

public static StatusEnum fromValue(String value) {
    for (StatusEnum b : StatusEnum.values()) {
    if (b.name().equals(value)) {
        return b;
    }
}
    throw new IllegalArgumentException("Unexpected value '" + value + "'");
}

    public static class Adapter extends TypeAdapter<StatusEnum> {
    @Override
    public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
    jsonWriter.value(enumeration.getValue());
    }

    @Override
    public StatusEnum read(final JsonReader jsonReader) throws IOException {
    String value =  jsonReader.nextString();
    return StatusEnum.fromValue(value);
    }
    }
}

        public static final String SERIALIZED_NAME_STATUS = "status";
        @SerializedName(SERIALIZED_NAME_STATUS)
            private StatusEnum status;

        public static final String SERIALIZED_NAME_RULESET_VALIDATION_RESULTS = "rulesetValidationResults";
        @SerializedName(SERIALIZED_NAME_RULESET_VALIDATION_RESULTS)
            private List<RulesetValidationResultWithoutRulesDTO> rulesetValidationResults = null;


        public PolicyAdherenceWithRulesetsDTO id(String id) {
        
        this.id = id;
        return this;
        }

    /**
        * UUID of the policy.
    * @return id
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "123e4567-e89b-12d3-a456-426614174000", value = "UUID of the policy.")
    
    public String getId() {
        return id;
    }


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


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

    /**
        * Name of the policy.
    * @return name
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "Policy1", value = "Name of the policy.")
    
    public String getName() {
        return name;
    }


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


        public PolicyAdherenceWithRulesetsDTO status(StatusEnum status) {
        
        this.status = status;
        return this;
        }

    /**
        * Status of the policy&#39;s governance compliance.
    * @return status
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "FOLLOWED", value = "Status of the policy's governance compliance.")
    
    public StatusEnum getStatus() {
        return status;
    }


    public void setStatus(StatusEnum status) {
        this.status = status;
    }


        public PolicyAdherenceWithRulesetsDTO rulesetValidationResults(List<RulesetValidationResultWithoutRulesDTO> rulesetValidationResults) {
        
        this.rulesetValidationResults = rulesetValidationResults;
        return this;
        }

    /**
        * List of ruleset validation information.
    * @return rulesetValidationResults
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "List of ruleset validation information.")
    
    public List<RulesetValidationResultWithoutRulesDTO> getRulesetValidationResults() {
        return rulesetValidationResults;
    }


    public void setRulesetValidationResults(List<RulesetValidationResultWithoutRulesDTO> rulesetValidationResults) {
        this.rulesetValidationResults = rulesetValidationResults;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
        return true;
        }
        if (o == null || getClass() != o.getClass()) {
        return false;
        }
            PolicyAdherenceWithRulesetsDTO policyAdherenceWithRulesets = (PolicyAdherenceWithRulesetsDTO) o;
            return Objects.equals(this.id, policyAdherenceWithRulesets.id) &&
            Objects.equals(this.name, policyAdherenceWithRulesets.name) &&
            Objects.equals(this.status, policyAdherenceWithRulesets.status) &&
            Objects.equals(this.rulesetValidationResults, policyAdherenceWithRulesets.rulesetValidationResults);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, status, rulesetValidationResults);
    }


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PolicyAdherenceWithRulesetsDTO {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    rulesetValidationResults: ").append(toIndentedString(rulesetValidationResults)).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    ");
}

}

