All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.okta.sdk.resource.model.Policy Maven / Gradle / Ivy

Go to download

The Okta Java SDK API .jar provides a Java API that your code can use to make calls to the Okta API. This .jar is the only compile-time dependency within the Okta SDK project that your code should depend on. Implementations of this API (implementation .jars) should be runtime dependencies only.

There is a newer version: 21.0.0
Show newest version
package com.okta.sdk.resource.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.okta.sdk.resource.model.LifecycleStatus;
import com.okta.sdk.resource.model.PolicyLinks;
import com.okta.sdk.resource.model.PolicyType;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;

/**
 * Policy
 */
@JsonPropertyOrder({ Policy.JSON_PROPERTY_CREATED, Policy.JSON_PROPERTY_DESCRIPTION, Policy.JSON_PROPERTY_ID,
        Policy.JSON_PROPERTY_LAST_UPDATED, Policy.JSON_PROPERTY_NAME, Policy.JSON_PROPERTY_PRIORITY,
        Policy.JSON_PROPERTY_STATUS, Policy.JSON_PROPERTY_SYSTEM, Policy.JSON_PROPERTY_TYPE,
        Policy.JSON_PROPERTY_EMBEDDED, Policy.JSON_PROPERTY_LINKS })
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-11-15T08:48:47.130589-06:00[America/Chicago]", comments = "Generator version: 7.8.0")
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true, defaultImpl = Policy.class)
@JsonSubTypes({ @JsonSubTypes.Type(value = AccessPolicy.class, name = "ACCESS_POLICY"),
        @JsonSubTypes.Type(value = EntityRiskPolicy.class, name = "ENTITY_RISK"),
        @JsonSubTypes.Type(value = IdpDiscoveryPolicy.class, name = "IDP_DISCOVERY"),
        @JsonSubTypes.Type(value = AuthenticatorEnrollmentPolicy.class, name = "MFA_ENROLL"),
        @JsonSubTypes.Type(value = OktaSignOnPolicy.class, name = "OKTA_SIGN_ON"),
        @JsonSubTypes.Type(value = PasswordPolicy.class, name = "PASSWORD"),
        @JsonSubTypes.Type(value = PostAuthSessionPolicy.class, name = "POST_AUTH_SESSION"),
        @JsonSubTypes.Type(value = ProfileEnrollmentPolicy.class, name = "PROFILE_ENROLLMENT"), })

public class Policy implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final String JSON_PROPERTY_CREATED = "created";
    private OffsetDateTime created;

    public static final String JSON_PROPERTY_DESCRIPTION = "description";
    private String description;

    public static final String JSON_PROPERTY_ID = "id";
    private String id = "Assigned";

    public static final String JSON_PROPERTY_LAST_UPDATED = "lastUpdated";
    private OffsetDateTime lastUpdated;

    public static final String JSON_PROPERTY_NAME = "name";
    private String name;

    public static final String JSON_PROPERTY_PRIORITY = "priority";
    private Integer priority;

    public static final String JSON_PROPERTY_STATUS = "status";
    private LifecycleStatus status;

    public static final String JSON_PROPERTY_SYSTEM = "system";
    private Boolean system = false;

    public static final String JSON_PROPERTY_TYPE = "type";
    protected PolicyType type;

    public static final String JSON_PROPERTY_EMBEDDED = "_embedded";
    private Map embedded = null;

    public static final String JSON_PROPERTY_LINKS = "_links";
    private PolicyLinks links;

    public Policy() {
    }

    /*
     * @JsonCreator public Policy(
     *
     * @JsonProperty(JSON_PROPERTY_CREATED) OffsetDateTime created,
     *
     * @JsonProperty(JSON_PROPERTY_ID) String id,
     *
     * @JsonProperty(JSON_PROPERTY_LAST_UPDATED) OffsetDateTime lastUpdated,
     *
     * @JsonProperty(JSON_PROPERTY_EMBEDDED) Map embedded ) { this(); this.created = created; this.id =
     * id; this.lastUpdated = lastUpdated; this.embedded = embedded; }
     */

    /**
     * Timestamp when the Policy was created
     *
     * @return created
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Timestamp when the Policy was created")
    @JsonProperty(JSON_PROPERTY_CREATED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public OffsetDateTime getCreated() {
        return created;
    }

    public Policy description(String description) {

        this.description = description;
        return this;
    }

    /**
     * Description of the Policy
     *
     * @return description
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Description of the Policy")
    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public String getDescription() {
        return description;
    }

    @JsonProperty(JSON_PROPERTY_DESCRIPTION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Identifier of the Policy
     *
     * @return id
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Identifier of the Policy")
    @JsonProperty(JSON_PROPERTY_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public String getId() {
        return id;
    }

    /**
     * Timestamp when the Policy was last modified
     *
     * @return lastUpdated
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Timestamp when the Policy was last modified")
    @JsonProperty(JSON_PROPERTY_LAST_UPDATED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public OffsetDateTime getLastUpdated() {
        return lastUpdated;
    }

    public Policy name(String name) {

        this.name = name;
        return this;
    }

    /**
     * Name of the Policy
     *
     * @return name
     **/
    @javax.annotation.Nonnull
    @ApiModelProperty(required = true, value = "Name of the Policy")
    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)

    public String getName() {
        return name;
    }

    @JsonProperty(JSON_PROPERTY_NAME)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setName(String name) {
        this.name = name;
    }

    public Policy priority(Integer priority) {

        this.priority = priority;
        return this;
    }

    /**
     * Specifies the order in which this Policy is evaluated in relation to the other policies
     *
     * @return priority
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Specifies the order in which this Policy is evaluated in relation to the other policies")
    @JsonProperty(JSON_PROPERTY_PRIORITY)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public Integer getPriority() {
        return priority;
    }

    @JsonProperty(JSON_PROPERTY_PRIORITY)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public Policy status(LifecycleStatus status) {

        this.status = status;
        return this;
    }

    /**
     * Get status
     *
     * @return status
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
    @JsonProperty(JSON_PROPERTY_STATUS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public LifecycleStatus getStatus() {
        return status;
    }

    @JsonProperty(JSON_PROPERTY_STATUS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setStatus(LifecycleStatus status) {
        this.status = status;
    }

    public Policy system(Boolean system) {

        this.system = system;
        return this;
    }

    /**
     * Specifies whether Okta created the Policy
     *
     * @return system
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "Specifies whether Okta created the Policy")
    @JsonProperty(JSON_PROPERTY_SYSTEM)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public Boolean getSystem() {
        return system;
    }

    @JsonProperty(JSON_PROPERTY_SYSTEM)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setSystem(Boolean system) {
        this.system = system;
    }

    public Policy type(PolicyType type) {

        this.type = type;
        return this;
    }

    /**
     * Get type
     *
     * @return type
     **/
    @javax.annotation.Nonnull
    @ApiModelProperty(required = true, value = "")
    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)

    public PolicyType getType() {
        return type;
    }

    @JsonProperty(JSON_PROPERTY_TYPE)
    @JsonInclude(value = JsonInclude.Include.ALWAYS)
    public void setType(PolicyType type) {
        this.type = type;
    }

    /**
     * Get embedded
     *
     * @return embedded
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
    @JsonProperty(JSON_PROPERTY_EMBEDDED)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public Map getEmbedded() {
        return embedded;
    }

    public Policy links(PolicyLinks links) {

        this.links = links;
        return this;
    }

    /**
     * Get links
     *
     * @return links
     **/
    @javax.annotation.Nullable
    @ApiModelProperty(value = "")
    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

    public PolicyLinks getLinks() {
        return links;
    }

    @JsonProperty(JSON_PROPERTY_LINKS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setLinks(PolicyLinks links) {
        this.links = links;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Policy policy = (Policy) o;
        return Objects.equals(this.created, policy.created) && Objects.equals(this.description, policy.description)
                && Objects.equals(this.id, policy.id) && Objects.equals(this.lastUpdated, policy.lastUpdated)
                && Objects.equals(this.name, policy.name) && Objects.equals(this.priority, policy.priority)
                && Objects.equals(this.status, policy.status) && Objects.equals(this.system, policy.system)
                && Objects.equals(this.type, policy.type) && Objects.equals(this.embedded, policy.embedded)
                && Objects.equals(this.links, policy.links);
        // ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(created, description, id, lastUpdated, name, priority, status, system, type, embedded,
                links);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class Policy {\n");
        sb.append("    created: ").append(toIndentedString(created)).append("\n");
        sb.append("    description: ").append(toIndentedString(description)).append("\n");
        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    lastUpdated: ").append(toIndentedString(lastUpdated)).append("\n");
        sb.append("    name: ").append(toIndentedString(name)).append("\n");
        sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
        sb.append("    status: ").append(toIndentedString(status)).append("\n");
        sb.append("    system: ").append(toIndentedString(system)).append("\n");
        sb.append("    type: ").append(toIndentedString(type)).append("\n");
        sb.append("    embedded: ").append(toIndentedString(embedded)).append("\n");
        sb.append("    links: ").append(toIndentedString(links)).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    ");
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy