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

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

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

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



/**
 * The input for the CreatePolicy operation.
 */
public class CreatePolicyRequest private constructor(builder: Builder) {
    /**
     * The JSON document that describes the policy. **policyDocument** must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.
     */
    public val policyDocument: kotlin.String? = builder.policyDocument
    /**
     * The policy name.
     */
    public val policyName: kotlin.String? = builder.policyName
    /**
     * Metadata which can be used to manage the policy.
     *
     * For URI Request parameters use format: ...key1=value1&key2=value2...
     *
     * For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."
     *
     * For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
     */
    public val tags: List? = builder.tags

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

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

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

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

        return true
    }

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

    public class Builder {
        /**
         * The JSON document that describes the policy. **policyDocument** must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.
         */
        public var policyDocument: kotlin.String? = null
        /**
         * The policy name.
         */
        public var policyName: kotlin.String? = null
        /**
         * Metadata which can be used to manage the policy.
         *
         * For URI Request parameters use format: ...key1=value1&key2=value2...
         *
         * For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..."
         *
         * For the cli-input-json file use format: "tags": "key1=value1&key2=value2..."
         */
        public var tags: List? = null

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy