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

commonMain.aws.sdk.kotlin.services.codegurusecurity.model.MetricsSummary.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codegurusecurity.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * A summary of metrics for an account as of a specified date.
 */
public class MetricsSummary private constructor(builder: Builder) {
    /**
     * A list of `CategoryWithFindingNum` objects for the top 5 finding categories with the most findings.
     */
    public val categoriesWithMostFindings: List? = builder.categoriesWithMostFindings
    /**
     * The date from which the metrics summary information was retrieved.
     */
    public val date: aws.smithy.kotlin.runtime.time.Instant? = builder.date
    /**
     * The number of open findings of each severity.
     */
    public val openFindings: aws.sdk.kotlin.services.codegurusecurity.model.FindingMetricsValuePerSeverity? = builder.openFindings
    /**
     * A list of `ScanNameWithFindingNum` objects for the top 3 scans with the most number of open critical findings.
     */
    public val scansWithMostOpenCriticalFindings: List? = builder.scansWithMostOpenCriticalFindings
    /**
     * A list of `ScanNameWithFindingNum` objects for the top 3 scans with the most number of open findings.
     */
    public val scansWithMostOpenFindings: List? = builder.scansWithMostOpenFindings

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

    override fun toString(): kotlin.String = buildString {
        append("MetricsSummary(")
        append("categoriesWithMostFindings=$categoriesWithMostFindings,")
        append("date=$date,")
        append("openFindings=$openFindings,")
        append("scansWithMostOpenCriticalFindings=$scansWithMostOpenCriticalFindings,")
        append("scansWithMostOpenFindings=$scansWithMostOpenFindings")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = categoriesWithMostFindings?.hashCode() ?: 0
        result = 31 * result + (date?.hashCode() ?: 0)
        result = 31 * result + (openFindings?.hashCode() ?: 0)
        result = 31 * result + (scansWithMostOpenCriticalFindings?.hashCode() ?: 0)
        result = 31 * result + (scansWithMostOpenFindings?.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 MetricsSummary

        if (categoriesWithMostFindings != other.categoriesWithMostFindings) return false
        if (date != other.date) return false
        if (openFindings != other.openFindings) return false
        if (scansWithMostOpenCriticalFindings != other.scansWithMostOpenCriticalFindings) return false
        if (scansWithMostOpenFindings != other.scansWithMostOpenFindings) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A list of `CategoryWithFindingNum` objects for the top 5 finding categories with the most findings.
         */
        public var categoriesWithMostFindings: List? = null
        /**
         * The date from which the metrics summary information was retrieved.
         */
        public var date: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The number of open findings of each severity.
         */
        public var openFindings: aws.sdk.kotlin.services.codegurusecurity.model.FindingMetricsValuePerSeverity? = null
        /**
         * A list of `ScanNameWithFindingNum` objects for the top 3 scans with the most number of open critical findings.
         */
        public var scansWithMostOpenCriticalFindings: List? = null
        /**
         * A list of `ScanNameWithFindingNum` objects for the top 3 scans with the most number of open findings.
         */
        public var scansWithMostOpenFindings: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codegurusecurity.model.MetricsSummary) : this() {
            this.categoriesWithMostFindings = x.categoriesWithMostFindings
            this.date = x.date
            this.openFindings = x.openFindings
            this.scansWithMostOpenCriticalFindings = x.scansWithMostOpenCriticalFindings
            this.scansWithMostOpenFindings = x.scansWithMostOpenFindings
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy