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

public class PolicyAdherenceStatusDTO {
        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_ARTIFACT_COMPLIANCE_SUMMARY = "artifactComplianceSummary";
        @SerializedName(SERIALIZED_NAME_ARTIFACT_COMPLIANCE_SUMMARY)
            private ArtifactComplianceSummaryForPolicyDTO artifactComplianceSummary;


        public PolicyAdherenceStatusDTO 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 PolicyAdherenceStatusDTO 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 PolicyAdherenceStatusDTO 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 PolicyAdherenceStatusDTO artifactComplianceSummary(ArtifactComplianceSummaryForPolicyDTO artifactComplianceSummary) {
        
        this.artifactComplianceSummary = artifactComplianceSummary;
        return this;
        }

    /**
        * Get artifactComplianceSummary
    * @return artifactComplianceSummary
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "")
    
    public ArtifactComplianceSummaryForPolicyDTO getArtifactComplianceSummary() {
        return artifactComplianceSummary;
    }


    public void setArtifactComplianceSummary(ArtifactComplianceSummaryForPolicyDTO artifactComplianceSummary) {
        this.artifactComplianceSummary = artifactComplianceSummary;
    }


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

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


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

}

