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

commonMain.aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetric.kt Maven / Gradle / Ivy

There is a newer version: 1.4.1
Show newest version
// 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 the information about the metric that is used for a request-based SLO.
 */
public class RequestBasedServiceLevelIndicatorMetric private constructor(builder: Builder) {
    /**
     * This is a string-to-string map that contains information about the type of object that this SLO is related to. It can include the following fields.
     * + `Type` designates the type of object that this SLO is related to.
     * + `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 monitors either the `LATENCY` or `AVAILABILITY` metric that Application Signals collects, this field displays which of those metrics is used.
     */
    public val metricType: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorMetricType? = builder.metricType
    /**
     * This structure defines the metric that is used as the "good request" or "bad request" value for a request-based SLO. This value observed for the metric defined in `TotalRequestCountMetric` is 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 monitors a specific operation of the service, this field displays that operation name.
     */
    public val operationName: kotlin.String? = builder.operationName
    /**
     * This structure defines the metric that is used as the "total requests" number for a request-based SLO. The number observed for this metric is divided by the number of "good requests" or "bad requests" that is observed for the metric defined in `MonitoredRequestCountMetric`.
     */
    public val totalRequestCountMetric: List = requireNotNull(builder.totalRequestCountMetric) { "A non-null value must be provided for totalRequestCountMetric" }

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

    override fun toString(): kotlin.String = buildString {
        append("RequestBasedServiceLevelIndicatorMetric(")
        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())
        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 RequestBasedServiceLevelIndicatorMetric

        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.RequestBasedServiceLevelIndicatorMetric = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * This is a string-to-string map that contains information about the type of object that this SLO is related to. It can include the following fields.
         * + `Type` designates the type of object that this SLO is related to.
         * + `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 monitors either the `LATENCY` or `AVAILABILITY` metric that Application Signals collects, this field displays which of those metrics is used.
         */
        public var metricType: aws.sdk.kotlin.services.applicationsignals.model.ServiceLevelIndicatorMetricType? = null
        /**
         * This structure defines the metric that is used as the "good request" or "bad request" value for a request-based SLO. This value observed for the metric defined in `TotalRequestCountMetric` is 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 monitors a specific operation of the service, this field displays that operation name.
         */
        public var operationName: kotlin.String? = null
        /**
         * This structure defines the metric that is used as the "total requests" number for a request-based SLO. The number observed for this metric is divided by the number of "good requests" or "bad requests" that is observed for the metric defined in `MonitoredRequestCountMetric`.
         */
        public var totalRequestCountMetric: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationsignals.model.RequestBasedServiceLevelIndicatorMetric) : 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.RequestBasedServiceLevelIndicatorMetric = RequestBasedServiceLevelIndicatorMetric(this)

        internal fun correctErrors(): Builder {
            if (totalRequestCountMetric == null) totalRequestCountMetric = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy