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

commonMain.aws.sdk.kotlin.services.snowdevicemanagement.model.CreateTaskRequest.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.snowdevicemanagement.model



public class CreateTaskRequest private constructor(builder: Builder) {
    /**
     * A token ensuring that the action is called only once with the specified details.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The task to be performed. Only one task is executed on a device at a time.
     */
    public val command: aws.sdk.kotlin.services.snowdevicemanagement.model.Command? = builder.command
    /**
     * A description of the task and its targets.
     */
    public val description: kotlin.String? = builder.description
    /**
     * Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
     */
    public val tags: Map? = builder.tags
    /**
     * A list of managed device IDs.
     */
    public val targets: List = requireNotNull(builder.targets) { "A non-null value must be provided for targets" }

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

    override fun toString(): kotlin.String = buildString {
        append("CreateTaskRequest(")
        append("clientToken=$clientToken,")
        append("command=$command,")
        append("description=$description,")
        append("tags=$tags,")
        append("targets=$targets")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = clientToken?.hashCode() ?: 0
        result = 31 * result + (command?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (targets.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 CreateTaskRequest

        if (clientToken != other.clientToken) return false
        if (command != other.command) return false
        if (description != other.description) return false
        if (tags != other.tags) return false
        if (targets != other.targets) return false

        return true
    }

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

    public class Builder {
        /**
         * A token ensuring that the action is called only once with the specified details.
         */
        public var clientToken: kotlin.String? = null
        /**
         * The task to be performed. Only one task is executed on a device at a time.
         */
        public var command: aws.sdk.kotlin.services.snowdevicemanagement.model.Command? = null
        /**
         * A description of the task and its targets.
         */
        public var description: kotlin.String? = null
        /**
         * Optional metadata that you assign to a resource. You can use tags to categorize a resource in different ways, such as by purpose, owner, or environment.
         */
        public var tags: Map? = null
        /**
         * A list of managed device IDs.
         */
        public var targets: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.snowdevicemanagement.model.CreateTaskRequest) : this() {
            this.clientToken = x.clientToken
            this.command = x.command
            this.description = x.description
            this.tags = x.tags
            this.targets = x.targets
        }

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

        internal fun correctErrors(): Builder {
            if (targets == null) targets = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy