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

commonMain.aws.sdk.kotlin.services.pi.model.PerformanceInsightsMetric.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.pi.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * This data type helps to determine Performance Insights metric to render for the insight.
 */
public class PerformanceInsightsMetric private constructor(builder: Builder) {
    /**
     * A dimension map that contains the dimensions for this partition.
     */
    public val dimensions: Map? = builder.dimensions
    /**
     * The Performance Insights metric name.
     */
    public val displayName: kotlin.String? = builder.displayName
    /**
     * The Performance Insights metric.
     */
    public val metric: kotlin.String? = builder.metric
    /**
     * The value of the metric. For example, `9` for `db.load.avg`.
     */
    public val value: kotlin.Double? = builder.value

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

    override fun toString(): kotlin.String = buildString {
        append("PerformanceInsightsMetric(")
        append("dimensions=$dimensions,")
        append("displayName=$displayName,")
        append("metric=$metric,")
        append("value=$value")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dimensions?.hashCode() ?: 0
        result = 31 * result + (displayName?.hashCode() ?: 0)
        result = 31 * result + (metric?.hashCode() ?: 0)
        result = 31 * result + (value?.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 PerformanceInsightsMetric

        if (dimensions != other.dimensions) return false
        if (displayName != other.displayName) return false
        if (metric != other.metric) return false
        if (!(value?.equals(other.value) ?: (other.value == null))) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A dimension map that contains the dimensions for this partition.
         */
        public var dimensions: Map? = null
        /**
         * The Performance Insights metric name.
         */
        public var displayName: kotlin.String? = null
        /**
         * The Performance Insights metric.
         */
        public var metric: kotlin.String? = null
        /**
         * The value of the metric. For example, `9` for `db.load.avg`.
         */
        public var value: kotlin.Double? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pi.model.PerformanceInsightsMetric) : this() {
            this.dimensions = x.dimensions
            this.displayName = x.displayName
            this.metric = x.metric
            this.value = x.value
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy