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

commonMain.aws.sdk.kotlin.services.verifiedpermissions.model.StaticPolicyDefinition.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.verifiedpermissions.model



/**
 * Contains information about a static policy.
 *
 * This data type is used as a field that is part of the [PolicyDefinitionDetail](https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinitionDetail.html) type.
 */
public class StaticPolicyDefinition private constructor(builder: Builder) {
    /**
     * The description of the static policy.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The policy content of the static policy, written in the Cedar policy language.
     */
    public val statement: kotlin.String = requireNotNull(builder.statement) { "A non-null value must be provided for statement" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.verifiedpermissions.model.StaticPolicyDefinition = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("StaticPolicyDefinition(")
        append("description=*** Sensitive Data Redacted ***,")
        append("statement=*** Sensitive Data Redacted ***")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = description?.hashCode() ?: 0
        result = 31 * result + (statement.hashCode())
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as StaticPolicyDefinition

        if (description != other.description) return false
        if (statement != other.statement) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.verifiedpermissions.model.StaticPolicyDefinition = Builder(this).apply(block).build()

    public class Builder {
        /**
         * The description of the static policy.
         */
        public var description: kotlin.String? = null
        /**
         * The policy content of the static policy, written in the Cedar policy language.
         */
        public var statement: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.verifiedpermissions.model.StaticPolicyDefinition) : this() {
            this.description = x.description
            this.statement = x.statement
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.verifiedpermissions.model.StaticPolicyDefinition = StaticPolicyDefinition(this)

        internal fun correctErrors(): Builder {
            if (statement == null) statement = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy