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

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

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

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



/**
 * Parameters to define a mitigation action that adds a blank policy to restrict permissions.
 */
public class ReplaceDefaultPolicyVersionParams private constructor(builder: Builder) {
    /**
     * The name of the template to be applied. The only supported value is `BLANK_POLICY`.
     */
    public val templateName: aws.sdk.kotlin.services.iot.model.PolicyTemplateName = requireNotNull(builder.templateName) { "A non-null value must be provided for templateName" }

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

    override fun toString(): kotlin.String = buildString {
        append("ReplaceDefaultPolicyVersionParams(")
        append("templateName=$templateName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = templateName.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 ReplaceDefaultPolicyVersionParams

        if (templateName != other.templateName) return false

        return true
    }

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

    public class Builder {
        /**
         * The name of the template to be applied. The only supported value is `BLANK_POLICY`.
         */
        public var templateName: aws.sdk.kotlin.services.iot.model.PolicyTemplateName? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.ReplaceDefaultPolicyVersionParams) : this() {
            this.templateName = x.templateName
        }

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

        internal fun correctErrors(): Builder {
            if (templateName == null) templateName = PolicyTemplateName.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy