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

commonMain.aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetricConfig.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

/**
 * Use this structure to specify the information for the metric that a period-based SLO will monitor.
 */
public class RequestBasedServiceLevelIndicatorMetricConfig private constructor(builder: Builder) {
    /**
     * If this SLO is related to a metric collected by Application Signals, you must use this field to specify which service the SLO metric is related to. To do so, you must specify at least the `Type`, `Name`, and `Environment` attributes.
     *
     * This is a string-to-string map. It can include the following fields.
     * + `Type` designates the type of object this is.
     * + `ResourceType` specifies the type of the resource. This field is used only when the value of the `Type` field is `Resource` or `AWS::Resource`.
     * + `Name` specifies the name of the object. This is used only if the value of the `Type` field is `Service`, `RemoteService`, or `AWS::Service`.
     * + `Identifier` identifies the resource objects of this resource. This is used only if the value of the `Type` field is `Resource` or `AWS::Resource`.
     * + `Environment` specifies the location where this object is hosted, or what it belongs to.
     */
    public val keyAttributes: Map? = builder.keyAttributes
    /**
     * If the SLO is to monitor either the `LATENCY` or `AVAILABILITY` metric that Application Signals collects, use this field to specify which of those metrics is used.
     */
    public val metricType: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorMetricType? = builder.metricType
    /**
     * Use this structure to define the metric that you want to use as the "good request" or "bad request" value for a request-based SLO. This value observed for the metric defined in `TotalRequestCountMetric` will be divided by the number found for `MonitoredRequestCountMetric` to determine the percentage of successful requests that this SLO tracks.
     */
    public val monitoredRequestCountMetric: aws.sdk.kotlin.services.applicationsignals.model.MonitoredRequestCountMetricDataQueries? = builder.monitoredRequestCountMetric
    /**
     * If the SLO is to monitor a specific operation of the service, use this field to specify the name of that operation.
     */
    public val operationName: kotlin.String? = builder.operationName
    /**
     * Use this structure to define the metric that you want to use as the "total requests" number for a request-based SLO. This result will be divided by the "good request" or "bad request" value defined in `MonitoredRequestCountMetric`.
     */
    public val totalRequestCountMetric: List? = builder.totalRequestCountMetric

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

    override fun toString(): kotlin.String = buildString {
        append("RequestBasedServiceLevelIndicatorMetricConfig(")
        append("keyAttributes=$keyAttributes,")
        append("metricType=$metricType,")
        append("monitoredRequestCountMetric=$monitoredRequestCountMetric,")
        append("operationName=$operationName,")
        append("totalRequestCountMetric=$totalRequestCountMetric")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = keyAttributes?.hashCode() ?: 0
        result = 31 * result + (metricType?.hashCode() ?: 0)
        result = 31 * result + (monitoredRequestCountMetric?.hashCode() ?: 0)
        result = 31 * result + (operationName?.hashCode() ?: 0)
        result = 31 * result + (totalRequestCountMetric?.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 RequestBasedServiceLevelIndicatorMetricConfig

        if (keyAttributes != other.keyAttributes) return false
        if (metricType != other.metricType) return false
        if (monitoredRequestCountMetric != other.monitoredRequestCountMetric) return false
        if (operationName != other.operationName) return false
        if (totalRequestCountMetric != other.totalRequestCountMetric) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * If this SLO is related to a metric collected by Application Signals, you must use this field to specify which service the SLO metric is related to. To do so, you must specify at least the `Type`, `Name`, and `Environment` attributes.
         *
         * This is a string-to-string map. It can include the following fields.
         * + `Type` designates the type of object this is.
         * + `ResourceType` specifies the type of the resource. This field is used only when the value of the `Type` field is `Resource` or `AWS::Resource`.
         * + `Name` specifies the name of the object. This is used only if the value of the `Type` field is `Service`, `RemoteService`, or `AWS::Service`.
         * + `Identifier` identifies the resource objects of this resource. This is used only if the value of the `Type` field is `Resource` or `AWS::Resource`.
         * + `Environment` specifies the location where this object is hosted, or what it belongs to.
         */
        public var keyAttributes: Map? = null
        /**
         * If the SLO is to monitor either the `LATENCY` or `AVAILABILITY` metric that Application Signals collects, use this field to specify which of those metrics is used.
         */
        public var metricType: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorMetricType? = null
        /**
         * Use this structure to define the metric that you want to use as the "good request" or "bad request" value for a request-based SLO. This value observed for the metric defined in `TotalRequestCountMetric` will be divided by the number found for `MonitoredRequestCountMetric` to determine the percentage of successful requests that this SLO tracks.
         */
        public var monitoredRequestCountMetric: aws.sdk.kotlin.services.applicationsignals.model.MonitoredRequestCountMetricDataQueries? = null
        /**
         * If the SLO is to monitor a specific operation of the service, use this field to specify the name of that operation.
         */
        public var operationName: kotlin.String? = null
        /**
         * Use this structure to define the metric that you want to use as the "total requests" number for a request-based SLO. This result will be divided by the "good request" or "bad request" value defined in `MonitoredRequestCountMetric`.
         */
        public var totalRequestCountMetric: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetricConfig) : this() {
            this.keyAttributes = x.keyAttributes
            this.metricType = x.metricType
            this.monitoredRequestCountMetric = x.monitoredRequestCountMetric
            this.operationName = x.operationName
            this.totalRequestCountMetric = x.totalRequestCountMetric
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy