/*
 * 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.ArtifactComplianceForPolicyDTO;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Provides adherence details of a policy.
*/
    @ApiModel(description = "Provides adherence details of a policy.")

public class PolicyAdherenceDetailsDTO {
        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");

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_EVALUATED_ARTIFACTS = "evaluatedArtifacts";
        @SerializedName(SERIALIZED_NAME_EVALUATED_ARTIFACTS)
            private List<ArtifactComplianceForPolicyDTO> evaluatedArtifacts = null;


        public PolicyAdherenceDetailsDTO 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 PolicyAdherenceDetailsDTO 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 PolicyAdherenceDetailsDTO 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 PolicyAdherenceDetailsDTO evaluatedArtifacts(List<ArtifactComplianceForPolicyDTO> evaluatedArtifacts) {
        
        this.evaluatedArtifacts = evaluatedArtifacts;
        return this;
        }

    /**
        * Compliance status of the artifacts evaluated against the policy.
    * @return evaluatedArtifacts
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "Compliance status of the artifacts evaluated against the policy.")
    
    public List<ArtifactComplianceForPolicyDTO> getEvaluatedArtifacts() {
        return evaluatedArtifacts;
    }


    public void setEvaluatedArtifacts(List<ArtifactComplianceForPolicyDTO> evaluatedArtifacts) {
        this.evaluatedArtifacts = evaluatedArtifacts;
    }


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

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


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PolicyAdherenceDetailsDTO {\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("    evaluatedArtifacts: ").append(toIndentedString(evaluatedArtifacts)).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    ");
}

}

