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

commonMain.aws.sdk.kotlin.services.wellarchitected.model.CreateMilestoneRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.wellarchitected.model



/**
 * Input for milestone creation.
 */
public class CreateMilestoneRequest private constructor(builder: Builder) {
    /**
     * A unique case-sensitive string used to ensure that this request is idempotent (executes only once).
     *
     * You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.
     *
     * This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.
     */
    public val clientRequestToken: kotlin.String? = builder.clientRequestToken
    /**
     * The name of the milestone in a workload.
     *
     * Milestone names must be unique within a workload.
     */
    public val milestoneName: kotlin.String? = builder.milestoneName
    /**
     * The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.
     */
    public val workloadId: kotlin.String? = requireNotNull(builder.workloadId) { "A non-null value must be provided for workloadId" }

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

    override fun toString(): kotlin.String = buildString {
        append("CreateMilestoneRequest(")
        append("clientRequestToken=$clientRequestToken,")
        append("milestoneName=$milestoneName,")
        append("workloadId=$workloadId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = clientRequestToken?.hashCode() ?: 0
        result = 31 * result + (milestoneName?.hashCode() ?: 0)
        result = 31 * result + (workloadId?.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 CreateMilestoneRequest

        if (clientRequestToken != other.clientRequestToken) return false
        if (milestoneName != other.milestoneName) return false
        if (workloadId != other.workloadId) return false

        return true
    }

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

    public class Builder {
        /**
         * A unique case-sensitive string used to ensure that this request is idempotent (executes only once).
         *
         * You should not reuse the same token for other requests. If you retry a request with the same client request token and the same parameters after the original request has completed successfully, the result of the original request is returned.
         *
         * This token is listed as required, however, if you do not specify it, the Amazon Web Services SDKs automatically generate one for you. If you are not using the Amazon Web Services SDK or the CLI, you must provide this token or the request will fail.
         */
        public var clientRequestToken: kotlin.String? = null
        /**
         * The name of the milestone in a workload.
         *
         * Milestone names must be unique within a workload.
         */
        public var milestoneName: kotlin.String? = null
        /**
         * The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.
         */
        public var workloadId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wellarchitected.model.CreateMilestoneRequest) : this() {
            this.clientRequestToken = x.clientRequestToken
            this.milestoneName = x.milestoneName
            this.workloadId = x.workloadId
        }

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

        internal fun correctErrors(): Builder {
            if (clientRequestToken == null) clientRequestToken = ""
            if (milestoneName == null) milestoneName = ""
            if (workloadId == null) workloadId = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy