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

commonMain.aws.sdk.kotlin.services.iot.model.CreatePolicyVersionRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iot.model



/**
 * The input for the CreatePolicyVersion operation.
 */
public class CreatePolicyVersionRequest private constructor(builder: Builder) {
    /**
     * The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.
     */
    public val policyDocument: kotlin.String? = builder.policyDocument
    /**
     * The policy name.
     */
    public val policyName: kotlin.String? = builder.policyName
    /**
     * Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).
     */
    public val setAsDefault: kotlin.Boolean? = builder.setAsDefault

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

    override fun toString(): kotlin.String = buildString {
        append("CreatePolicyVersionRequest(")
        append("policyDocument=$policyDocument,")
        append("policyName=$policyName,")
        append("setAsDefault=$setAsDefault")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = policyDocument?.hashCode() ?: 0
        result = 31 * result + (policyName?.hashCode() ?: 0)
        result = 31 * result + (setAsDefault?.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 CreatePolicyVersionRequest

        if (policyDocument != other.policyDocument) return false
        if (policyName != other.policyName) return false
        if (setAsDefault != other.setAsDefault) return false

        return true
    }

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

    public class Builder {
        /**
         * The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.
         */
        public var policyDocument: kotlin.String? = null
        /**
         * The policy name.
         */
        public var policyName: kotlin.String? = null
        /**
         * Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).
         */
        public var setAsDefault: kotlin.Boolean? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.CreatePolicyVersionRequest) : this() {
            this.policyDocument = x.policyDocument
            this.policyName = x.policyName
            this.setAsDefault = x.setAsDefault
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy