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

aws.sdk.kotlin.services.lexmodelsv2.model.CreateResourcePolicyStatementRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lexmodelsv2.model



class CreateResourcePolicyStatementRequest private constructor(builder: Builder) {
    /**
     * The Amazon Lex action that this policy either allows or denies. The
     * action must apply to the resource type of the specified ARN. For more
     * information, see 
     * Actions, resources, and condition keys for Amazon Lex V2.
     */
    val action: List? = builder.action
    /**
     * Specifies a condition when the policy is in effect. If the principal
     * of the policy is a service principal, you must provide two condition
     * blocks, one with a SourceAccount global condition key and one with a
     * SourceArn global condition key.
     * For more information, see IAM JSON policy elements: Condition .
     */
    val condition: Map>? = builder.condition
    /**
     * Determines whether the statement allows or denies access to the
     * resource.
     */
    val effect: aws.sdk.kotlin.services.lexmodelsv2.model.Effect? = builder.effect
    /**
     * The identifier of the revision of the policy to edit. If this
     * revision ID doesn't match the current revision ID, Amazon Lex throws an
     * exception.
     * If you don't specify a revision, Amazon Lex overwrites the contents of
     * the policy with the new values.
     */
    val expectedRevisionId: kotlin.String? = builder.expectedRevisionId
    /**
     * An IAM principal, such as an IAM users, IAM roles, or AWS services
     * that is allowed or denied access to a resource. For more information,
     * see AWS JSON policy elements: Principal.
     */
    val principal: List? = builder.principal
    /**
     * The Amazon Resource Name (ARN) of the bot or bot alias that the
     * resource policy is attached to.
     */
    val resourceArn: kotlin.String? = builder.resourceArn
    /**
     * The name of the statement. The ID is the same as the
     * Sid IAM property. The statement name must be unique
     * within the policy. For more information, see IAM
     * JSON policy elements: Sid.
     */
    val statementId: kotlin.String? = builder.statementId

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

    override fun toString(): kotlin.String = buildString {
        append("CreateResourcePolicyStatementRequest(")
        append("action=$action,")
        append("condition=$condition,")
        append("effect=$effect,")
        append("expectedRevisionId=$expectedRevisionId,")
        append("principal=$principal,")
        append("resourceArn=$resourceArn,")
        append("statementId=$statementId)")
    }

    override fun hashCode(): kotlin.Int {
        var result = action?.hashCode() ?: 0
        result = 31 * result + (condition?.hashCode() ?: 0)
        result = 31 * result + (effect?.hashCode() ?: 0)
        result = 31 * result + (expectedRevisionId?.hashCode() ?: 0)
        result = 31 * result + (principal?.hashCode() ?: 0)
        result = 31 * result + (resourceArn?.hashCode() ?: 0)
        result = 31 * result + (statementId?.hashCode() ?: 0)
        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 CreateResourcePolicyStatementRequest

        if (action != other.action) return false
        if (condition != other.condition) return false
        if (effect != other.effect) return false
        if (expectedRevisionId != other.expectedRevisionId) return false
        if (principal != other.principal) return false
        if (resourceArn != other.resourceArn) return false
        if (statementId != other.statementId) return false

        return true
    }

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

    class Builder {
        /**
         * The Amazon Lex action that this policy either allows or denies. The
         * action must apply to the resource type of the specified ARN. For more
         * information, see 
         * Actions, resources, and condition keys for Amazon Lex V2.
         */
        var action: List? = null
        /**
         * Specifies a condition when the policy is in effect. If the principal
         * of the policy is a service principal, you must provide two condition
         * blocks, one with a SourceAccount global condition key and one with a
         * SourceArn global condition key.
         * For more information, see IAM JSON policy elements: Condition .
         */
        var condition: Map>? = null
        /**
         * Determines whether the statement allows or denies access to the
         * resource.
         */
        var effect: aws.sdk.kotlin.services.lexmodelsv2.model.Effect? = null
        /**
         * The identifier of the revision of the policy to edit. If this
         * revision ID doesn't match the current revision ID, Amazon Lex throws an
         * exception.
         * If you don't specify a revision, Amazon Lex overwrites the contents of
         * the policy with the new values.
         */
        var expectedRevisionId: kotlin.String? = null
        /**
         * An IAM principal, such as an IAM users, IAM roles, or AWS services
         * that is allowed or denied access to a resource. For more information,
         * see AWS JSON policy elements: Principal.
         */
        var principal: List? = null
        /**
         * The Amazon Resource Name (ARN) of the bot or bot alias that the
         * resource policy is attached to.
         */
        var resourceArn: kotlin.String? = null
        /**
         * The name of the statement. The ID is the same as the
         * Sid IAM property. The statement name must be unique
         * within the policy. For more information, see IAM
         * JSON policy elements: Sid.
         */
        var statementId: kotlin.String? = null

        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexmodelsv2.model.CreateResourcePolicyStatementRequest) : this() {
            this.action = x.action
            this.condition = x.condition
            this.effect = x.effect
            this.expectedRevisionId = x.expectedRevisionId
            this.principal = x.principal
            this.resourceArn = x.resourceArn
            this.statementId = x.statementId
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.lexmodelsv2.model.CreateResourcePolicyStatementRequest = CreateResourcePolicyStatementRequest(this)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy