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

commonMain.aws.sdk.kotlin.services.xray.model.ServiceStatistics.kt Maven / Gradle / Ivy

There is a newer version: 1.3.34
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.xray.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Response statistics for a service.
 */
public class ServiceStatistics private constructor(builder: Builder) {
    /**
     * Information about requests that failed with a 4xx Client Error status code.
     */
    public val errorStatistics: aws.sdk.kotlin.services.xray.model.ErrorStatistics? = builder.errorStatistics
    /**
     * Information about requests that failed with a 5xx Server Error status code.
     */
    public val faultStatistics: aws.sdk.kotlin.services.xray.model.FaultStatistics? = builder.faultStatistics
    /**
     * The number of requests that completed with a 2xx Success status code.
     */
    public val okCount: kotlin.Long? = builder.okCount
    /**
     * The total number of completed requests.
     */
    public val totalCount: kotlin.Long? = builder.totalCount
    /**
     * The aggregate response time of completed requests.
     */
    public val totalResponseTime: kotlin.Double? = builder.totalResponseTime

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

    override fun toString(): kotlin.String = buildString {
        append("ServiceStatistics(")
        append("errorStatistics=$errorStatistics,")
        append("faultStatistics=$faultStatistics,")
        append("okCount=$okCount,")
        append("totalCount=$totalCount,")
        append("totalResponseTime=$totalResponseTime")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = errorStatistics?.hashCode() ?: 0
        result = 31 * result + (faultStatistics?.hashCode() ?: 0)
        result = 31 * result + (okCount?.hashCode() ?: 0)
        result = 31 * result + (totalCount?.hashCode() ?: 0)
        result = 31 * result + (totalResponseTime?.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 ServiceStatistics

        if (errorStatistics != other.errorStatistics) return false
        if (faultStatistics != other.faultStatistics) return false
        if (okCount != other.okCount) return false
        if (totalCount != other.totalCount) return false
        if (!(totalResponseTime?.equals(other.totalResponseTime) ?: (other.totalResponseTime == null))) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Information about requests that failed with a 4xx Client Error status code.
         */
        public var errorStatistics: aws.sdk.kotlin.services.xray.model.ErrorStatistics? = null
        /**
         * Information about requests that failed with a 5xx Server Error status code.
         */
        public var faultStatistics: aws.sdk.kotlin.services.xray.model.FaultStatistics? = null
        /**
         * The number of requests that completed with a 2xx Success status code.
         */
        public var okCount: kotlin.Long? = null
        /**
         * The total number of completed requests.
         */
        public var totalCount: kotlin.Long? = null
        /**
         * The aggregate response time of completed requests.
         */
        public var totalResponseTime: kotlin.Double? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.xray.model.ServiceStatistics) : this() {
            this.errorStatistics = x.errorStatistics
            this.faultStatistics = x.faultStatistics
            this.okCount = x.okCount
            this.totalCount = x.totalCount
            this.totalResponseTime = x.totalResponseTime
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy