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

commonMain.aws.sdk.kotlin.services.appmesh.model.UpdateMeshRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.appmesh.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 *
 */
public class UpdateMeshRequest private constructor(builder: Builder) {
    /**
     * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The name of the service mesh to update.
     */
    public val meshName: kotlin.String = requireNotNull(builder.meshName) { "A non-null value must be provided for meshName" }
    /**
     * The service mesh specification to apply.
     */
    public val spec: aws.sdk.kotlin.services.appmesh.model.MeshSpec? = builder.spec

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateMeshRequest(")
        append("clientToken=$clientToken,")
        append("meshName=$meshName,")
        append("spec=$spec")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = clientToken?.hashCode() ?: 0
        result = 31 * result + (meshName.hashCode())
        result = 31 * result + (spec?.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 UpdateMeshRequest

        if (clientToken != other.clientToken) return false
        if (meshName != other.meshName) return false
        if (spec != other.spec) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.
         */
        public var clientToken: kotlin.String? = null
        /**
         * The name of the service mesh to update.
         */
        public var meshName: kotlin.String? = null
        /**
         * The service mesh specification to apply.
         */
        public var spec: aws.sdk.kotlin.services.appmesh.model.MeshSpec? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appmesh.model.UpdateMeshRequest) : this() {
            this.clientToken = x.clientToken
            this.meshName = x.meshName
            this.spec = x.spec
        }

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

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

        internal fun correctErrors(): Builder {
            if (meshName == null) meshName = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy