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

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

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

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



public class CreateProvisioningTemplateRequest private constructor(builder: Builder) {
    /**
     * The description of the provisioning template.
     */
    public val description: kotlin.String? = builder.description
    /**
     * True to enable the provisioning template, otherwise false.
     */
    public val enabled: kotlin.Boolean? = builder.enabled
    /**
     * Creates a pre-provisioning hook template. Only supports template of type `FLEET_PROVISIONING`. For more information about provisioning template types, see [type](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateProvisioningTemplate.html#iot-CreateProvisioningTemplate-request-type).
     */
    public val preProvisioningHook: aws.sdk.kotlin.services.iot.model.ProvisioningHook? = builder.preProvisioningHook
    /**
     * The role ARN for the role associated with the provisioning template. This IoT role grants permission to provision a device.
     */
    public val provisioningRoleArn: kotlin.String? = builder.provisioningRoleArn
    /**
     * Metadata which can be used to manage the provisioning template.
     *
     * 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
    /**
     * The JSON formatted contents of the provisioning template.
     */
    public val templateBody: kotlin.String? = builder.templateBody
    /**
     * The name of the provisioning template.
     */
    public val templateName: kotlin.String? = builder.templateName
    /**
     * The type you define in a provisioning template. You can create a template with only one type. You can't change the template type after its creation. The default value is `FLEET_PROVISIONING`. For more information about provisioning template, see: [Provisioning template](https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html).
     */
    public val type: aws.sdk.kotlin.services.iot.model.TemplateType? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("CreateProvisioningTemplateRequest(")
        append("description=$description,")
        append("enabled=$enabled,")
        append("preProvisioningHook=$preProvisioningHook,")
        append("provisioningRoleArn=$provisioningRoleArn,")
        append("tags=$tags,")
        append("templateBody=$templateBody,")
        append("templateName=$templateName,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = description?.hashCode() ?: 0
        result = 31 * result + (enabled?.hashCode() ?: 0)
        result = 31 * result + (preProvisioningHook?.hashCode() ?: 0)
        result = 31 * result + (provisioningRoleArn?.hashCode() ?: 0)
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (templateBody?.hashCode() ?: 0)
        result = 31 * result + (templateName?.hashCode() ?: 0)
        result = 31 * result + (type?.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 CreateProvisioningTemplateRequest

        if (description != other.description) return false
        if (enabled != other.enabled) return false
        if (preProvisioningHook != other.preProvisioningHook) return false
        if (provisioningRoleArn != other.provisioningRoleArn) return false
        if (tags != other.tags) return false
        if (templateBody != other.templateBody) return false
        if (templateName != other.templateName) return false
        if (type != other.type) return false

        return true
    }

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

    public class Builder {
        /**
         * The description of the provisioning template.
         */
        public var description: kotlin.String? = null
        /**
         * True to enable the provisioning template, otherwise false.
         */
        public var enabled: kotlin.Boolean? = null
        /**
         * Creates a pre-provisioning hook template. Only supports template of type `FLEET_PROVISIONING`. For more information about provisioning template types, see [type](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateProvisioningTemplate.html#iot-CreateProvisioningTemplate-request-type).
         */
        public var preProvisioningHook: aws.sdk.kotlin.services.iot.model.ProvisioningHook? = null
        /**
         * The role ARN for the role associated with the provisioning template. This IoT role grants permission to provision a device.
         */
        public var provisioningRoleArn: kotlin.String? = null
        /**
         * Metadata which can be used to manage the provisioning template.
         *
         * 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
        /**
         * The JSON formatted contents of the provisioning template.
         */
        public var templateBody: kotlin.String? = null
        /**
         * The name of the provisioning template.
         */
        public var templateName: kotlin.String? = null
        /**
         * The type you define in a provisioning template. You can create a template with only one type. You can't change the template type after its creation. The default value is `FLEET_PROVISIONING`. For more information about provisioning template, see: [Provisioning template](https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html).
         */
        public var type: aws.sdk.kotlin.services.iot.model.TemplateType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.CreateProvisioningTemplateRequest) : this() {
            this.description = x.description
            this.enabled = x.enabled
            this.preProvisioningHook = x.preProvisioningHook
            this.provisioningRoleArn = x.provisioningRoleArn
            this.tags = x.tags
            this.templateBody = x.templateBody
            this.templateName = x.templateName
            this.type = x.type
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.iot.model.ProvisioningHook] inside the given [block]
         */
        public fun preProvisioningHook(block: aws.sdk.kotlin.services.iot.model.ProvisioningHook.Builder.() -> kotlin.Unit) {
            this.preProvisioningHook = aws.sdk.kotlin.services.iot.model.ProvisioningHook.invoke(block)
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy