
commonMain.aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorConfig.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.applicationsignals.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* This structure specifies the information about the service and the performance metric that a request-based SLO is to monitor.
*/
public class RequestBasedServiceLevelIndicatorConfig private constructor(builder: Builder) {
/**
* The arithmetic operation to use when comparing the specified metric to the threshold. This parameter is required if this SLO is tracking the `Latency` metric.
*/
public val comparisonOperator: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorComparisonOperator? = builder.comparisonOperator
/**
* The value that the SLI metric is compared to. This parameter is required if this SLO is tracking the `Latency` metric.
*/
public val metricThreshold: kotlin.Double? = builder.metricThreshold
/**
* Use this structure to specify the metric to be used for the SLO.
*/
public val requestBasedSliMetricConfig: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetricConfig? = builder.requestBasedSliMetricConfig
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorConfig = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("RequestBasedServiceLevelIndicatorConfig(")
append("comparisonOperator=$comparisonOperator,")
append("metricThreshold=$metricThreshold,")
append("requestBasedSliMetricConfig=$requestBasedSliMetricConfig")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = comparisonOperator?.hashCode() ?: 0
result = 31 * result + (metricThreshold?.hashCode() ?: 0)
result = 31 * result + (requestBasedSliMetricConfig?.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 RequestBasedServiceLevelIndicatorConfig
if (comparisonOperator != other.comparisonOperator) return false
if (!(metricThreshold?.equals(other.metricThreshold) ?: (other.metricThreshold == null))) return false
if (requestBasedSliMetricConfig != other.requestBasedSliMetricConfig) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorConfig = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The arithmetic operation to use when comparing the specified metric to the threshold. This parameter is required if this SLO is tracking the `Latency` metric.
*/
public var comparisonOperator: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorComparisonOperator? = null
/**
* The value that the SLI metric is compared to. This parameter is required if this SLO is tracking the `Latency` metric.
*/
public var metricThreshold: kotlin.Double? = null
/**
* Use this structure to specify the metric to be used for the SLO.
*/
public var requestBasedSliMetricConfig: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetricConfig? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorConfig) : this() {
this.comparisonOperator = x.comparisonOperator
this.metricThreshold = x.metricThreshold
this.requestBasedSliMetricConfig = x.requestBasedSliMetricConfig
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorConfig = RequestBasedServiceLevelIndicatorConfig(this)
/**
* construct an [aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetricConfig] inside the given [block]
*/
public fun requestBasedSliMetricConfig(block: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetricConfig.Builder.() -> kotlin.Unit) {
this.requestBasedSliMetricConfig = aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetricConfig.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy