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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details about a metric. A metric is an aggregation of the values of a measure for a dimension value, such as *availability* in the *us-east-1* Region.
 */
public class TimeSeries private constructor(builder: Builder) {
    /**
     * The dimensions of the metric.
     */
    public val dimensionList: List = requireNotNull(builder.dimensionList) { "A non-null value must be provided for dimensionList" }
    /**
     * The values for the metric.
     */
    public val metricValueList: List = requireNotNull(builder.metricValueList) { "A non-null value must be provided for metricValueList" }
    /**
     * The ID of the metric.
     */
    public val timeSeriesId: kotlin.String = requireNotNull(builder.timeSeriesId) { "A non-null value must be provided for timeSeriesId" }

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

    override fun toString(): kotlin.String = buildString {
        append("TimeSeries(")
        append("dimensionList=$dimensionList,")
        append("metricValueList=$metricValueList,")
        append("timeSeriesId=$timeSeriesId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dimensionList.hashCode()
        result = 31 * result + (metricValueList.hashCode())
        result = 31 * result + (timeSeriesId.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 TimeSeries

        if (dimensionList != other.dimensionList) return false
        if (metricValueList != other.metricValueList) return false
        if (timeSeriesId != other.timeSeriesId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The dimensions of the metric.
         */
        public var dimensionList: List? = null
        /**
         * The values for the metric.
         */
        public var metricValueList: List? = null
        /**
         * The ID of the metric.
         */
        public var timeSeriesId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lookoutmetrics.model.TimeSeries) : this() {
            this.dimensionList = x.dimensionList
            this.metricValueList = x.metricValueList
            this.timeSeriesId = x.timeSeriesId
        }

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

        internal fun correctErrors(): Builder {
            if (dimensionList == null) dimensionList = emptyList()
            if (metricValueList == null) metricValueList = emptyList()
            if (timeSeriesId == null) timeSeriesId = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy