/*
 * 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.File;
import java.io.IOException;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Detailed information about a ruleset.
*/
    @ApiModel(description = "Detailed information about a ruleset.")

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

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

        public static final String SERIALIZED_NAME_RULESET_CONTENT = "rulesetContent";
        @SerializedName(SERIALIZED_NAME_RULESET_CONTENT)
            private File rulesetContent;

            /**
* Category the rules included in ruleset.
*/
    @JsonAdapter(RuleCategoryEnum.Adapter.class)
public enum RuleCategoryEnum {
        SPECTRAL("SPECTRAL");

private String value;

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

public String getValue() {
return value;
}

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

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

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

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

        public static final String SERIALIZED_NAME_RULE_CATEGORY = "ruleCategory";
        @SerializedName(SERIALIZED_NAME_RULE_CATEGORY)
            private RuleCategoryEnum ruleCategory = RuleCategoryEnum.SPECTRAL;

            /**
* Context or area to which the ruleset applies.
*/
    @JsonAdapter(RuleTypeEnum.Adapter.class)
public enum RuleTypeEnum {
        API_METADATA("API_METADATA"),
        
        API_DEFINITION("API_DEFINITION"),
        
        API_DOCUMENTATION("API_DOCUMENTATION");

private String value;

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

public String getValue() {
return value;
}

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

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

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

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

        public static final String SERIALIZED_NAME_RULE_TYPE = "ruleType";
        @SerializedName(SERIALIZED_NAME_RULE_TYPE)
            private RuleTypeEnum ruleType;

            /**
* The type of artifact that the ruleset validates.
*/
    @JsonAdapter(ArtifactTypeEnum.Adapter.class)
public enum ArtifactTypeEnum {
        REST_API("REST_API"),
        
        ASYNC_API("ASYNC_API");

private String value;

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

public String getValue() {
return value;
}

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

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

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

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

        public static final String SERIALIZED_NAME_ARTIFACT_TYPE = "artifactType";
        @SerializedName(SERIALIZED_NAME_ARTIFACT_TYPE)
            private ArtifactTypeEnum artifactType;

        public static final String SERIALIZED_NAME_DOCUMENTATION_LINK = "documentationLink";
        @SerializedName(SERIALIZED_NAME_DOCUMENTATION_LINK)
            private String documentationLink;

        public static final String SERIALIZED_NAME_PROVIDER = "provider";
        @SerializedName(SERIALIZED_NAME_PROVIDER)
            private String provider;


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

    /**
        * Name of the ruleset.
    * @return name
    **/
      @ApiModelProperty(example = "API Security Ruleset", required = true, value = "Name of the ruleset.")
    
    public String getName() {
        return name;
    }


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


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

    /**
        * A brief description of the ruleset.
    * @return description
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "A ruleset designed to enforce security standards for APIs.", value = "A brief description of the ruleset.")
    
    public String getDescription() {
        return description;
    }


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


        public RulesetInputDTO rulesetContent(File rulesetContent) {
        
        this.rulesetContent = rulesetContent;
        return this;
        }

    /**
        * The content of the ruleset file (YAML or JSON).
    * @return rulesetContent
    **/
      @ApiModelProperty(required = true, value = "The content of the ruleset file (YAML or JSON).")
    
    public File getRulesetContent() {
        return rulesetContent;
    }


    public void setRulesetContent(File rulesetContent) {
        this.rulesetContent = rulesetContent;
    }


        public RulesetInputDTO ruleCategory(RuleCategoryEnum ruleCategory) {
        
        this.ruleCategory = ruleCategory;
        return this;
        }

    /**
        * Category the rules included in ruleset.
    * @return ruleCategory
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "SPECTRAL", value = "Category the rules included in ruleset.")
    
    public RuleCategoryEnum getRuleCategory() {
        return ruleCategory;
    }


    public void setRuleCategory(RuleCategoryEnum ruleCategory) {
        this.ruleCategory = ruleCategory;
    }


        public RulesetInputDTO ruleType(RuleTypeEnum ruleType) {
        
        this.ruleType = ruleType;
        return this;
        }

    /**
        * Context or area to which the ruleset applies.
    * @return ruleType
    **/
      @ApiModelProperty(example = "API_DEFINITION", required = true, value = "Context or area to which the ruleset applies.")
    
    public RuleTypeEnum getRuleType() {
        return ruleType;
    }


    public void setRuleType(RuleTypeEnum ruleType) {
        this.ruleType = ruleType;
    }


        public RulesetInputDTO artifactType(ArtifactTypeEnum artifactType) {
        
        this.artifactType = artifactType;
        return this;
        }

    /**
        * The type of artifact that the ruleset validates.
    * @return artifactType
    **/
      @ApiModelProperty(example = "REST_API", required = true, value = "The type of artifact that the ruleset validates.")
    
    public ArtifactTypeEnum getArtifactType() {
        return artifactType;
    }


    public void setArtifactType(ArtifactTypeEnum artifactType) {
        this.artifactType = artifactType;
    }


        public RulesetInputDTO documentationLink(String documentationLink) {
        
        this.documentationLink = documentationLink;
        return this;
        }

    /**
        * URL to the documentation related to the ruleset.
    * @return documentationLink
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "https://example.com/docs/api-security-ruleset", value = "URL to the documentation related to the ruleset.")
    
    public String getDocumentationLink() {
        return documentationLink;
    }


    public void setDocumentationLink(String documentationLink) {
        this.documentationLink = documentationLink;
    }


        public RulesetInputDTO provider(String provider) {
        
        this.provider = provider;
        return this;
        }

    /**
        * Entity or individual providing the ruleset.
    * @return provider
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "TechWave", value = "Entity or individual providing the ruleset.")
    
    public String getProvider() {
        return provider;
    }


    public void setProvider(String provider) {
        this.provider = provider;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
        return true;
        }
        if (o == null || getClass() != o.getClass()) {
        return false;
        }
            RulesetInputDTO rulesetInput = (RulesetInputDTO) o;
            return Objects.equals(this.name, rulesetInput.name) &&
            Objects.equals(this.description, rulesetInput.description) &&
            Objects.equals(this.rulesetContent, rulesetInput.rulesetContent) &&
            Objects.equals(this.ruleCategory, rulesetInput.ruleCategory) &&
            Objects.equals(this.ruleType, rulesetInput.ruleType) &&
            Objects.equals(this.artifactType, rulesetInput.artifactType) &&
            Objects.equals(this.documentationLink, rulesetInput.documentationLink) &&
            Objects.equals(this.provider, rulesetInput.provider);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, description, rulesetContent, ruleCategory, ruleType, artifactType, documentationLink, provider);
    }


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RulesetInputDTO {\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    rulesetContent: ").append(toIndentedString(rulesetContent)).append("\n");
    sb.append("    ruleCategory: ").append(toIndentedString(ruleCategory)).append("\n");
    sb.append("    ruleType: ").append(toIndentedString(ruleType)).append("\n");
    sb.append("    artifactType: ").append(toIndentedString(artifactType)).append("\n");
    sb.append("    documentationLink: ").append(toIndentedString(documentationLink)).append("\n");
    sb.append("    provider: ").append(toIndentedString(provider)).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    ");
}

}

