commonMain.aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of route53-jvm Show documentation
Show all versions of route53-jvm Show documentation
The AWS SDK for Kotlin client for Route 53
The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.route53.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A complex type that contains information about the CloudWatch alarm that Amazon Route 53 is monitoring for this health check.
*/
public class CloudWatchAlarmConfiguration private constructor(builder: Builder) {
/**
* For the metric that the CloudWatch alarm is associated with, the arithmetic operation that is used for the comparison.
*/
public val comparisonOperator: aws.sdk.kotlin.services.route53.model.ComparisonOperator = requireNotNull(builder.comparisonOperator) { "A non-null value must be provided for comparisonOperator" }
/**
* For the metric that the CloudWatch alarm is associated with, a complex type that contains information about the dimensions for the metric. For information, see [Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) in the *Amazon CloudWatch User Guide*.
*/
public val dimensions: List? = builder.dimensions
/**
* For the metric that the CloudWatch alarm is associated with, the number of periods that the metric is compared to the threshold.
*/
public val evaluationPeriods: kotlin.Int = requireNotNull(builder.evaluationPeriods) { "A non-null value must be provided for evaluationPeriods" }
/**
* The name of the CloudWatch metric that the alarm is associated with.
*/
public val metricName: kotlin.String = requireNotNull(builder.metricName) { "A non-null value must be provided for metricName" }
/**
* The namespace of the metric that the alarm is associated with. For more information, see [Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) in the *Amazon CloudWatch User Guide*.
*/
public val namespace: kotlin.String = requireNotNull(builder.namespace) { "A non-null value must be provided for namespace" }
/**
* For the metric that the CloudWatch alarm is associated with, the duration of one evaluation period in seconds.
*/
public val period: kotlin.Int = requireNotNull(builder.period) { "A non-null value must be provided for period" }
/**
* For the metric that the CloudWatch alarm is associated with, the statistic that is applied to the metric.
*/
public val statistic: aws.sdk.kotlin.services.route53.model.Statistic = requireNotNull(builder.statistic) { "A non-null value must be provided for statistic" }
/**
* For the metric that the CloudWatch alarm is associated with, the value the metric is compared with.
*/
public val threshold: kotlin.Double = requireNotNull(builder.threshold) { "A non-null value must be provided for threshold" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CloudWatchAlarmConfiguration(")
append("comparisonOperator=$comparisonOperator,")
append("dimensions=$dimensions,")
append("evaluationPeriods=$evaluationPeriods,")
append("metricName=$metricName,")
append("namespace=$namespace,")
append("period=$period,")
append("statistic=$statistic,")
append("threshold=$threshold")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = comparisonOperator.hashCode()
result = 31 * result + (dimensions?.hashCode() ?: 0)
result = 31 * result + (evaluationPeriods)
result = 31 * result + (metricName.hashCode())
result = 31 * result + (namespace.hashCode())
result = 31 * result + (period)
result = 31 * result + (statistic.hashCode())
result = 31 * result + (threshold.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 CloudWatchAlarmConfiguration
if (comparisonOperator != other.comparisonOperator) return false
if (dimensions != other.dimensions) return false
if (evaluationPeriods != other.evaluationPeriods) return false
if (metricName != other.metricName) return false
if (namespace != other.namespace) return false
if (period != other.period) return false
if (statistic != other.statistic) return false
if (!(threshold?.equals(other.threshold) ?: (other.threshold == null))) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* For the metric that the CloudWatch alarm is associated with, the arithmetic operation that is used for the comparison.
*/
public var comparisonOperator: aws.sdk.kotlin.services.route53.model.ComparisonOperator? = null
/**
* For the metric that the CloudWatch alarm is associated with, a complex type that contains information about the dimensions for the metric. For information, see [Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) in the *Amazon CloudWatch User Guide*.
*/
public var dimensions: List? = null
/**
* For the metric that the CloudWatch alarm is associated with, the number of periods that the metric is compared to the threshold.
*/
public var evaluationPeriods: kotlin.Int? = null
/**
* The name of the CloudWatch metric that the alarm is associated with.
*/
public var metricName: kotlin.String? = null
/**
* The namespace of the metric that the alarm is associated with. For more information, see [Amazon CloudWatch Namespaces, Dimensions, and Metrics Reference](https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW_Support_For_AWS.html) in the *Amazon CloudWatch User Guide*.
*/
public var namespace: kotlin.String? = null
/**
* For the metric that the CloudWatch alarm is associated with, the duration of one evaluation period in seconds.
*/
public var period: kotlin.Int? = null
/**
* For the metric that the CloudWatch alarm is associated with, the statistic that is applied to the metric.
*/
public var statistic: aws.sdk.kotlin.services.route53.model.Statistic? = null
/**
* For the metric that the CloudWatch alarm is associated with, the value the metric is compared with.
*/
public var threshold: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration) : this() {
this.comparisonOperator = x.comparisonOperator
this.dimensions = x.dimensions
this.evaluationPeriods = x.evaluationPeriods
this.metricName = x.metricName
this.namespace = x.namespace
this.period = x.period
this.statistic = x.statistic
this.threshold = x.threshold
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration = CloudWatchAlarmConfiguration(this)
internal fun correctErrors(): Builder {
if (comparisonOperator == null) comparisonOperator = ComparisonOperator.SdkUnknown("no value provided")
if (evaluationPeriods == null) evaluationPeriods = 0
if (metricName == null) metricName = ""
if (namespace == null) namespace = ""
if (period == null) period = 0
if (statistic == null) statistic = Statistic.SdkUnknown("no value provided")
if (threshold == null) threshold = 0.0
return this
}
}
}