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

commonMain.aws.sdk.kotlin.services.cloudwatch.model.Datapoint.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudwatch.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * Encapsulates the statistical data that CloudWatch computes from metric data.
 */
public class Datapoint private constructor(builder: Builder) {
    /**
     * The average of the metric values that correspond to the data point.
     */
    public val average: kotlin.Double? = builder.average
    /**
     * The percentile statistic for the data point.
     */
    public val extendedStatistics: Map? = builder.extendedStatistics
    /**
     * The maximum metric value for the data point.
     */
    public val maximum: kotlin.Double? = builder.maximum
    /**
     * The minimum metric value for the data point.
     */
    public val minimum: kotlin.Double? = builder.minimum
    /**
     * The number of metric values that contributed to the aggregate value of this data point.
     */
    public val sampleCount: kotlin.Double? = builder.sampleCount
    /**
     * The sum of the metric values for the data point.
     */
    public val sum: kotlin.Double? = builder.sum
    /**
     * The time stamp used for the data point.
     */
    public val timestamp: aws.smithy.kotlin.runtime.time.Instant? = builder.timestamp
    /**
     * The standard unit for the data point.
     */
    public val unit: aws.sdk.kotlin.services.cloudwatch.model.StandardUnit? = builder.unit

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

    override fun toString(): kotlin.String = buildString {
        append("Datapoint(")
        append("average=$average,")
        append("extendedStatistics=$extendedStatistics,")
        append("maximum=$maximum,")
        append("minimum=$minimum,")
        append("sampleCount=$sampleCount,")
        append("sum=$sum,")
        append("timestamp=$timestamp,")
        append("unit=$unit")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = average?.hashCode() ?: 0
        result = 31 * result + (extendedStatistics?.hashCode() ?: 0)
        result = 31 * result + (maximum?.hashCode() ?: 0)
        result = 31 * result + (minimum?.hashCode() ?: 0)
        result = 31 * result + (sampleCount?.hashCode() ?: 0)
        result = 31 * result + (sum?.hashCode() ?: 0)
        result = 31 * result + (timestamp?.hashCode() ?: 0)
        result = 31 * result + (unit?.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 Datapoint

        if (!(average?.equals(other.average) ?: (other.average == null))) return false
        if (extendedStatistics != other.extendedStatistics) return false
        if (!(maximum?.equals(other.maximum) ?: (other.maximum == null))) return false
        if (!(minimum?.equals(other.minimum) ?: (other.minimum == null))) return false
        if (!(sampleCount?.equals(other.sampleCount) ?: (other.sampleCount == null))) return false
        if (!(sum?.equals(other.sum) ?: (other.sum == null))) return false
        if (timestamp != other.timestamp) return false
        if (unit != other.unit) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The average of the metric values that correspond to the data point.
         */
        public var average: kotlin.Double? = null
        /**
         * The percentile statistic for the data point.
         */
        public var extendedStatistics: Map? = null
        /**
         * The maximum metric value for the data point.
         */
        public var maximum: kotlin.Double? = null
        /**
         * The minimum metric value for the data point.
         */
        public var minimum: kotlin.Double? = null
        /**
         * The number of metric values that contributed to the aggregate value of this data point.
         */
        public var sampleCount: kotlin.Double? = null
        /**
         * The sum of the metric values for the data point.
         */
        public var sum: kotlin.Double? = null
        /**
         * The time stamp used for the data point.
         */
        public var timestamp: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The standard unit for the data point.
         */
        public var unit: aws.sdk.kotlin.services.cloudwatch.model.StandardUnit? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudwatch.model.Datapoint) : this() {
            this.average = x.average
            this.extendedStatistics = x.extendedStatistics
            this.maximum = x.maximum
            this.minimum = x.minimum
            this.sampleCount = x.sampleCount
            this.sum = x.sum
            this.timestamp = x.timestamp
            this.unit = x.unit
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy