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

commonMain.aws.sdk.kotlin.services.vpclattice.model.CreateTargetGroupRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.vpclattice.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateTargetGroupRequest private constructor(builder: Builder) {
    /**
     * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The target group configuration.
     */
    public val config: aws.sdk.kotlin.services.vpclattice.model.TargetGroupConfig? = builder.config
    /**
     * The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The tags for the target group.
     */
    public val tags: Map? = builder.tags
    /**
     * The type of target group.
     */
    public val type: aws.sdk.kotlin.services.vpclattice.model.TargetGroupType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("CreateTargetGroupRequest(")
        append("clientToken=$clientToken,")
        append("config=$config,")
        append("name=$name,")
        append("tags=$tags,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = clientToken?.hashCode() ?: 0
        result = 31 * result + (config?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (type.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 CreateTargetGroupRequest

        if (clientToken != other.clientToken) return false
        if (config != other.config) return false
        if (name != other.name) return false
        if (tags != other.tags) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.
         */
        public var clientToken: kotlin.String? = null
        /**
         * The target group configuration.
         */
        public var config: aws.sdk.kotlin.services.vpclattice.model.TargetGroupConfig? = null
        /**
         * The name of the target group. The name must be unique within the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.
         */
        public var name: kotlin.String? = null
        /**
         * The tags for the target group.
         */
        public var tags: Map? = null
        /**
         * The type of target group.
         */
        public var type: aws.sdk.kotlin.services.vpclattice.model.TargetGroupType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.vpclattice.model.CreateTargetGroupRequest) : this() {
            this.clientToken = x.clientToken
            this.config = x.config
            this.name = x.name
            this.tags = x.tags
            this.type = x.type
        }

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

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            if (type == null) type = TargetGroupType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy