/*
 * 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.ActionDTO;
import com.fasterxml.jackson.annotation.JsonCreator;
/**
* Detailed information about a governance policy.
*/
    @ApiModel(description = "Detailed information about a governance policy.")

public class APIMGovernancePolicyDTO {
        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;

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

                /**
* The state at which an governance policy should be enforced.
*/
    @JsonAdapter(GovernableStatesEnum.Adapter.class)
public enum GovernableStatesEnum {
        API_CREATE("API_CREATE"),
        
        API_UPDATE("API_UPDATE"),
        
        API_DEPLOY("API_DEPLOY"),
        
        API_PUBLISH("API_PUBLISH");

private String value;

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

public String getValue() {
return value;
}

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

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

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

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

        public static final String SERIALIZED_NAME_GOVERNABLE_STATES = "governableStates";
        @SerializedName(SERIALIZED_NAME_GOVERNABLE_STATES)
            private List<GovernableStatesEnum> governableStates = new ArrayList<GovernableStatesEnum>();

        public static final String SERIALIZED_NAME_ACTIONS = "actions";
        @SerializedName(SERIALIZED_NAME_ACTIONS)
            private List<ActionDTO> actions = new ArrayList<ActionDTO>();

        public static final String SERIALIZED_NAME_RULESETS = "rulesets";
        @SerializedName(SERIALIZED_NAME_RULESETS)
            private List<String> rulesets = new ArrayList<String>();

        public static final String SERIALIZED_NAME_LABELS = "labels";
        @SerializedName(SERIALIZED_NAME_LABELS)
            private List<String> labels = new ArrayList<String>();

        public static final String SERIALIZED_NAME_CREATED_BY = "createdBy";
        @SerializedName(SERIALIZED_NAME_CREATED_BY)
            private String createdBy;

        public static final String SERIALIZED_NAME_CREATED_TIME = "createdTime";
        @SerializedName(SERIALIZED_NAME_CREATED_TIME)
            private String createdTime;

        public static final String SERIALIZED_NAME_UPDATED_BY = "updatedBy";
        @SerializedName(SERIALIZED_NAME_UPDATED_BY)
            private String updatedBy;

        public static final String SERIALIZED_NAME_UPDATED_TIME = "updatedTime";
        @SerializedName(SERIALIZED_NAME_UPDATED_TIME)
            private String updatedTime;


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

    /**
        * UUID of the governance policy.
    * @return id
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "987e6543-d21b-34d5-b678-912345678900", value = "UUID of the governance policy.")
    
    public String getId() {
        return id;
    }


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


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

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


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


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

    /**
        * A brief description of the governance policy.
    * @return description
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "Policy for enforcing security standards across all APIs.", value = "A brief description of the governance policy.")
    
    public String getDescription() {
        return description;
    }


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


        public APIMGovernancePolicyDTO governableStates(List<GovernableStatesEnum> governableStates) {
        
        this.governableStates = governableStates;
        return this;
        }

    /**
        * List of states at which the governance policy should be enforced.
    * @return governableStates
    **/
      @ApiModelProperty(required = true, value = "List of states at which the governance policy should be enforced.")
    
    public List<GovernableStatesEnum> getGovernableStates() {
        return governableStates;
    }


    public void setGovernableStates(List<GovernableStatesEnum> governableStates) {
        this.governableStates = governableStates;
    }


        public APIMGovernancePolicyDTO actions(List<ActionDTO> actions) {
        
        this.actions = actions;
        return this;
        }

    /**
        * List of actions taken when the governance policy is violated. An action is defined by the state and rule severity. If an action is not specified to each state and rule severity, the default action is &#x60;NOTIFY&#x60;.
    * @return actions
    **/
      @ApiModelProperty(required = true, value = "List of actions taken when the governance policy is violated. An action is defined by the state and rule severity. If an action is not specified to each state and rule severity, the default action is `NOTIFY`.")
    
    public List<ActionDTO> getActions() {
        return actions;
    }


    public void setActions(List<ActionDTO> actions) {
        this.actions = actions;
    }


        public APIMGovernancePolicyDTO rulesets(List<String> rulesets) {
        
        this.rulesets = rulesets;
        return this;
        }

    /**
        * List of rulesets associated with the governance policy.
    * @return rulesets
    **/
      @ApiModelProperty(required = true, value = "List of rulesets associated with the governance policy.")
    
    public List<String> getRulesets() {
        return rulesets;
    }


    public void setRulesets(List<String> rulesets) {
        this.rulesets = rulesets;
    }


        public APIMGovernancePolicyDTO labels(List<String> labels) {
        
        this.labels = labels;
        return this;
        }

    /**
        * List of labels IDs associated with the governance policy.
    * @return labels
    **/
      @ApiModelProperty(example = "[\"54d5833a-ca86-44bb-bcda-5b9fcdacd79d\"]", required = true, value = "List of labels IDs associated with the governance policy.")
    
    public List<String> getLabels() {
        return labels;
    }


    public void setLabels(List<String> labels) {
        this.labels = labels;
    }


        public APIMGovernancePolicyDTO createdBy(String createdBy) {
        
        this.createdBy = createdBy;
        return this;
        }

    /**
        * Identifier of the user who created the governance policy.
    * @return createdBy
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "admin@wso2.com", value = "Identifier of the user who created the governance policy.")
    
    public String getCreatedBy() {
        return createdBy;
    }


    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }


        public APIMGovernancePolicyDTO createdTime(String createdTime) {
        
        this.createdTime = createdTime;
        return this;
        }

    /**
        * Timestamp when the governance policy was created.
    * @return createdTime
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "2024-08-01T12:00:00Z", value = "Timestamp when the governance policy was created.")
    
    public String getCreatedTime() {
        return createdTime;
    }


    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }


        public APIMGovernancePolicyDTO updatedBy(String updatedBy) {
        
        this.updatedBy = updatedBy;
        return this;
        }

    /**
        * Identifier of the user who last updated the governance policy.
    * @return updatedBy
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "admin@wso2.com", value = "Identifier of the user who last updated the governance policy.")
    
    public String getUpdatedBy() {
        return updatedBy;
    }


    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }


        public APIMGovernancePolicyDTO updatedTime(String updatedTime) {
        
        this.updatedTime = updatedTime;
        return this;
        }

    /**
        * Timestamp when the governance policy was last updated.
    * @return updatedTime
    **/
        @javax.annotation.Nullable
      @ApiModelProperty(example = "2024-08-02T12:00:00Z", value = "Timestamp when the governance policy was last updated.")
    
    public String getUpdatedTime() {
        return updatedTime;
    }


    public void setUpdatedTime(String updatedTime) {
        this.updatedTime = updatedTime;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
        return true;
        }
        if (o == null || getClass() != o.getClass()) {
        return false;
        }
            APIMGovernancePolicyDTO apIMGovernancePolicy = (APIMGovernancePolicyDTO) o;
            return Objects.equals(this.id, apIMGovernancePolicy.id) &&
            Objects.equals(this.name, apIMGovernancePolicy.name) &&
            Objects.equals(this.description, apIMGovernancePolicy.description) &&
            Objects.equals(this.governableStates, apIMGovernancePolicy.governableStates) &&
            Objects.equals(this.actions, apIMGovernancePolicy.actions) &&
            Objects.equals(this.rulesets, apIMGovernancePolicy.rulesets) &&
            Objects.equals(this.labels, apIMGovernancePolicy.labels) &&
            Objects.equals(this.createdBy, apIMGovernancePolicy.createdBy) &&
            Objects.equals(this.createdTime, apIMGovernancePolicy.createdTime) &&
            Objects.equals(this.updatedBy, apIMGovernancePolicy.updatedBy) &&
            Objects.equals(this.updatedTime, apIMGovernancePolicy.updatedTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, description, governableStates, actions, rulesets, labels, createdBy, createdTime, updatedBy, updatedTime);
    }


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class APIMGovernancePolicyDTO {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    governableStates: ").append(toIndentedString(governableStates)).append("\n");
    sb.append("    actions: ").append(toIndentedString(actions)).append("\n");
    sb.append("    rulesets: ").append(toIndentedString(rulesets)).append("\n");
    sb.append("    labels: ").append(toIndentedString(labels)).append("\n");
    sb.append("    createdBy: ").append(toIndentedString(createdBy)).append("\n");
    sb.append("    createdTime: ").append(toIndentedString(createdTime)).append("\n");
    sb.append("    updatedBy: ").append(toIndentedString(updatedBy)).append("\n");
    sb.append("    updatedTime: ").append(toIndentedString(updatedTime)).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    ");
}

}

