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

commonMain.aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicator.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 contains information about the performance metric that a request-based SLO monitors.
 */
public class RequestBasedServiceLevelIndicator private constructor(builder: Builder) {
    /**
     * The arithmetic operation used when comparing the specified metric to the threshold.
     */
    public val comparisonOperator: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorComparisonOperator? = builder.comparisonOperator
    /**
     * This value is the threshold that the observed metric values of the SLI metric are compared to.
     */
    public val metricThreshold: kotlin.Double? = builder.metricThreshold
    /**
     * A structure that contains information about the metric that the SLO monitors.
     */
    public val requestBasedSliMetric: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetric? = builder.requestBasedSliMetric

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

    override fun toString(): kotlin.String = buildString {
        append("RequestBasedServiceLevelIndicator(")
        append("comparisonOperator=$comparisonOperator,")
        append("metricThreshold=$metricThreshold,")
        append("requestBasedSliMetric=$requestBasedSliMetric")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = comparisonOperator?.hashCode() ?: 0
        result = 31 * result + (metricThreshold?.hashCode() ?: 0)
        result = 31 * result + (requestBasedSliMetric?.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 RequestBasedServiceLevelIndicator

        if (comparisonOperator != other.comparisonOperator) return false
        if (!(metricThreshold?.equals(other.metricThreshold) ?: (other.metricThreshold == null))) return false
        if (requestBasedSliMetric != other.requestBasedSliMetric) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The arithmetic operation used when comparing the specified metric to the threshold.
         */
        public var comparisonOperator: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorComparisonOperator? = null
        /**
         * This value is the threshold that the observed metric values of the SLI metric are compared to.
         */
        public var metricThreshold: kotlin.Double? = null
        /**
         * A structure that contains information about the metric that the SLO monitors.
         */
        public var requestBasedSliMetric: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetric? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicator) : this() {
            this.comparisonOperator = x.comparisonOperator
            this.metricThreshold = x.metricThreshold
            this.requestBasedSliMetric = x.requestBasedSliMetric
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetric] inside the given [block]
         */
        public fun requestBasedSliMetric(block: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetric.Builder.() -> kotlin.Unit) {
            this.requestBasedSliMetric = aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetric.invoke(block)
        }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy