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

commonMain.aws.sdk.kotlin.services.lookoutmetrics.model.DimensionNameValue.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lookoutmetrics.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A dimension name and value.
 */
public class DimensionNameValue private constructor(builder: Builder) {
    /**
     * The name of the dimension.
     */
    public val dimensionName: kotlin.String = requireNotNull(builder.dimensionName) { "A non-null value must be provided for dimensionName" }
    /**
     * The value of the dimension.
     */
    public val dimensionValue: kotlin.String = requireNotNull(builder.dimensionValue) { "A non-null value must be provided for dimensionValue" }

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

    override fun toString(): kotlin.String = buildString {
        append("DimensionNameValue(")
        append("dimensionName=$dimensionName,")
        append("dimensionValue=$dimensionValue")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dimensionName.hashCode()
        result = 31 * result + (dimensionValue.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 DimensionNameValue

        if (dimensionName != other.dimensionName) return false
        if (dimensionValue != other.dimensionValue) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the dimension.
         */
        public var dimensionName: kotlin.String? = null
        /**
         * The value of the dimension.
         */
        public var dimensionValue: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lookoutmetrics.model.DimensionNameValue) : this() {
            this.dimensionName = x.dimensionName
            this.dimensionValue = x.dimensionValue
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy