commonMain.aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudwatch-jvm Show documentation
Show all versions of cloudwatch-jvm Show documentation
The AWS SDK for Kotlin client for CloudWatch
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudwatch.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Designates the CloudWatch metric and statistic that provides the time series the anomaly detector uses as input. If you have enabled unified cross-account observability, and this account is a monitoring account, the metric can be in the same account or a source account.
*/
public class SingleMetricAnomalyDetector private constructor(builder: Builder) {
/**
* If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here. If you omit this parameter, the current account is used.
*/
public val accountId: kotlin.String? = builder.accountId
/**
* The metric dimensions to create the anomaly detection model for.
*/
public val dimensions: List? = builder.dimensions
/**
* The name of the metric to create the anomaly detection model for.
*/
public val metricName: kotlin.String? = builder.metricName
/**
* The namespace of the metric to create the anomaly detection model for.
*/
public val namespace: kotlin.String? = builder.namespace
/**
* The statistic to use for the metric and anomaly detection model.
*/
public val stat: kotlin.String? = builder.stat
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SingleMetricAnomalyDetector(")
append("accountId=$accountId,")
append("dimensions=$dimensions,")
append("metricName=$metricName,")
append("namespace=$namespace,")
append("stat=$stat")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = accountId?.hashCode() ?: 0
result = 31 * result + (dimensions?.hashCode() ?: 0)
result = 31 * result + (metricName?.hashCode() ?: 0)
result = 31 * result + (namespace?.hashCode() ?: 0)
result = 31 * result + (stat?.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 SingleMetricAnomalyDetector
if (accountId != other.accountId) return false
if (dimensions != other.dimensions) return false
if (metricName != other.metricName) return false
if (namespace != other.namespace) return false
if (stat != other.stat) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* If the CloudWatch metric that provides the time series that the anomaly detector uses as input is in another account, specify that account ID here. If you omit this parameter, the current account is used.
*/
public var accountId: kotlin.String? = null
/**
* The metric dimensions to create the anomaly detection model for.
*/
public var dimensions: List? = null
/**
* The name of the metric to create the anomaly detection model for.
*/
public var metricName: kotlin.String? = null
/**
* The namespace of the metric to create the anomaly detection model for.
*/
public var namespace: kotlin.String? = null
/**
* The statistic to use for the metric and anomaly detection model.
*/
public var stat: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector) : this() {
this.accountId = x.accountId
this.dimensions = x.dimensions
this.metricName = x.metricName
this.namespace = x.namespace
this.stat = x.stat
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudwatch.model.SingleMetricAnomalyDetector = SingleMetricAnomalyDetector(this)
internal fun correctErrors(): Builder {
return this
}
}
}