
commonMain.aws.sdk.kotlin.services.mwaa.model.MetricDatum.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.mwaa.model
import aws.smithy.kotlin.runtime.time.Instant
/**
* **Internal only**. Collects Apache Airflow metrics. To learn more about the metrics published to Amazon CloudWatch, see [Amazon MWAA performance metrics in Amazon CloudWatch](https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html).
*/
@Deprecated("No longer recommended for use. See AWS API documentation for more details.")
public class MetricDatum private constructor(builder: Builder) {
/**
* **Internal only**. The dimensions associated with the metric.
*/
public val dimensions: List? = builder.dimensions
/**
* **Internal only**. The name of the metric.
*/
public val metricName: kotlin.String = requireNotNull(builder.metricName) { "A non-null value must be provided for metricName" }
/**
* **Internal only**. The statistical values for the metric.
*/
public val statisticValues: aws.sdk.kotlin.services.mwaa.model.StatisticSet? = builder.statisticValues
/**
* **Internal only**. The time the metric data was received.
*/
public val timestamp: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.timestamp) { "A non-null value must be provided for timestamp" }
/**
* **Internal only**. The unit used to store the metric.
*/
public val unit: aws.sdk.kotlin.services.mwaa.model.MwaaUnit? = builder.unit
/**
* **Internal only**. The value for the metric.
*/
public val value: kotlin.Double? = builder.value
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.mwaa.model.MetricDatum = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MetricDatum(")
append("dimensions=$dimensions,")
append("metricName=$metricName,")
append("statisticValues=$statisticValues,")
append("timestamp=$timestamp,")
append("unit=$unit,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = dimensions?.hashCode() ?: 0
result = 31 * result + (metricName.hashCode())
result = 31 * result + (statisticValues?.hashCode() ?: 0)
result = 31 * result + (timestamp.hashCode())
result = 31 * result + (unit?.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 MetricDatum
if (dimensions != other.dimensions) return false
if (metricName != other.metricName) return false
if (statisticValues != other.statisticValues) return false
if (timestamp != other.timestamp) return false
if (unit != other.unit) return false
if (value != other.value) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.mwaa.model.MetricDatum = Builder(this).apply(block).build()
public class Builder {
/**
* **Internal only**. The dimensions associated with the metric.
*/
public var dimensions: List? = null
/**
* **Internal only**. The name of the metric.
*/
public var metricName: kotlin.String? = null
/**
* **Internal only**. The statistical values for the metric.
*/
public var statisticValues: aws.sdk.kotlin.services.mwaa.model.StatisticSet? = null
/**
* **Internal only**. The time the metric data was received.
*/
public var timestamp: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* **Internal only**. The unit used to store the metric.
*/
public var unit: aws.sdk.kotlin.services.mwaa.model.MwaaUnit? = null
/**
* **Internal only**. The value for the metric.
*/
public var value: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.mwaa.model.MetricDatum) : this() {
this.dimensions = x.dimensions
this.metricName = x.metricName
this.statisticValues = x.statisticValues
this.timestamp = x.timestamp
this.unit = x.unit
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.mwaa.model.MetricDatum = MetricDatum(this)
/**
* construct an [aws.sdk.kotlin.services.mwaa.model.StatisticSet] inside the given [block]
*/
public fun statisticValues(block: aws.sdk.kotlin.services.mwaa.model.StatisticSet.Builder.() -> kotlin.Unit) {
this.statisticValues = aws.sdk.kotlin.services.mwaa.model.StatisticSet.invoke(block)
}
internal fun correctErrors(): Builder {
if (metricName == null) metricName = ""
if (timestamp == null) timestamp = Instant.fromEpochSeconds(0)
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy