/*
 * 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 com.fasterxml.jackson.annotation.JsonCreator;
/**
* List of rules violated by the artifact under each severity.
*/
    @ApiModel(description = "List of rules violated by the artifact under each severity.")

public class SeverityBasedRuleViolationCountDTO {
            /**
* 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_RULES_COUNT = "violatedRulesCount";
        @SerializedName(SERIALIZED_NAME_VIOLATED_RULES_COUNT)
            private Integer violatedRulesCount;


        public SeverityBasedRuleViolationCountDTO 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 SeverityBasedRuleViolationCountDTO violatedRulesCount(Integer violatedRulesCount) {
        
        this.violatedRulesCount = violatedRulesCount;
        return this;
        }

    /**
        * Number of rules violated by the artifact under each severity.
    * @return violatedRulesCount
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "1", value = "Number of rules violated by the artifact under each severity.")
    
    public Integer getViolatedRulesCount() {
        return violatedRulesCount;
    }


    public void setViolatedRulesCount(Integer violatedRulesCount) {
        this.violatedRulesCount = violatedRulesCount;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
        return true;
        }
        if (o == null || getClass() != o.getClass()) {
        return false;
        }
            SeverityBasedRuleViolationCountDTO severityBasedRuleViolationCount = (SeverityBasedRuleViolationCountDTO) o;
            return Objects.equals(this.severity, severityBasedRuleViolationCount.severity) &&
            Objects.equals(this.violatedRulesCount, severityBasedRuleViolationCount.violatedRulesCount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(severity, violatedRulesCount);
    }


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

}

