/*
 * 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.RuleValidationResultViolatedPathDTO;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Result of the rule validation.
*/
    @ApiModel(description = "Result of the rule validation.")

public class RuleValidationResultDTO {
        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 rule validation.
*/
    @JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
        PASSED("PASSED"),
        
        FAILED("FAILED");

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;

            /**
* Severity level of the rule violation.
*/
    @JsonAdapter(SeverityEnum.Adapter.class)
public enum SeverityEnum {
        ERROR("ERROR"),
        
        WARN("WARN"),
        
        INFO("INFO");

private String value;

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

public String getValue() {
return value;
}

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

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

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

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

        public static final String SERIALIZED_NAME_SEVERITY = "severity";
        @SerializedName(SERIALIZED_NAME_SEVERITY)
            private SeverityEnum severity;

        public static final String SERIALIZED_NAME_VIOLATED_PATH = "violatedPath";
        @SerializedName(SERIALIZED_NAME_VIOLATED_PATH)
            private RuleValidationResultViolatedPathDTO violatedPath;

        public static final String SERIALIZED_NAME_MESSAGE = "message";
        @SerializedName(SERIALIZED_NAME_MESSAGE)
            private String message;

        public static final String SERIALIZED_NAME_DESCRIPTION = "description";
        @SerializedName(SERIALIZED_NAME_DESCRIPTION)
            private String description;


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

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


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


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

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


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


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

    /**
        * Status of the rule validation.
    * @return status
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "FAILED", value = "Status of the rule validation.")
    
    public StatusEnum getStatus() {
        return status;
    }


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


        public RuleValidationResultDTO severity(SeverityEnum severity) {
        
        this.severity = severity;
        return this;
        }

    /**
        * Severity level of the rule violation.
    * @return severity
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "WARN", value = "Severity level of the rule violation.")
    
    public SeverityEnum getSeverity() {
        return severity;
    }


    public void setSeverity(SeverityEnum severity) {
        this.severity = severity;
    }


        public RuleValidationResultDTO violatedPath(RuleValidationResultViolatedPathDTO violatedPath) {
        
        this.violatedPath = violatedPath;
        return this;
        }

    /**
        * Get violatedPath
    * @return violatedPath
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(value = "")
    
    public RuleValidationResultViolatedPathDTO getViolatedPath() {
        return violatedPath;
    }


    public void setViolatedPath(RuleValidationResultViolatedPathDTO violatedPath) {
        this.violatedPath = violatedPath;
    }


        public RuleValidationResultDTO message(String message) {
        
        this.message = message;
        return this;
        }

    /**
        * Message to be displayed when the rule is violated.
    * @return message
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "API name can not be too long or short", value = "Message to be displayed when the rule is violated.")
    
    public String getMessage() {
        return message;
    }


    public void setMessage(String message) {
        this.message = message;
    }


        public RuleValidationResultDTO description(String description) {
        
        this.description = description;
        return this;
        }

    /**
        * Description of the rule.
    * @return description
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "API name should be between 5 to 50 characters", value = "Description of the rule.")
    
    public String getDescription() {
        return description;
    }


    public void setDescription(String description) {
        this.description = description;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
        return true;
        }
        if (o == null || getClass() != o.getClass()) {
        return false;
        }
            RuleValidationResultDTO ruleValidationResult = (RuleValidationResultDTO) o;
            return Objects.equals(this.id, ruleValidationResult.id) &&
            Objects.equals(this.name, ruleValidationResult.name) &&
            Objects.equals(this.status, ruleValidationResult.status) &&
            Objects.equals(this.severity, ruleValidationResult.severity) &&
            Objects.equals(this.violatedPath, ruleValidationResult.violatedPath) &&
            Objects.equals(this.message, ruleValidationResult.message) &&
            Objects.equals(this.description, ruleValidationResult.description);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, status, severity, violatedPath, message, description);
    }


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RuleValidationResultDTO {\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("    severity: ").append(toIndentedString(severity)).append("\n");
    sb.append("    violatedPath: ").append(toIndentedString(violatedPath)).append("\n");
    sb.append("    message: ").append(toIndentedString(message)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).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    ");
}

}

