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

commonMain.aws.sdk.kotlin.services.configservice.model.ConformancePackEvaluationResult.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.configservice.model

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

/**
 * The details of a conformance pack evaluation. Provides Config rule and Amazon Web Services resource type that was evaluated, the compliance of the conformance pack, related time stamps, and supplementary information.
 */
public class ConformancePackEvaluationResult private constructor(builder: Builder) {
    /**
     * Supplementary information about how the evaluation determined the compliance.
     */
    public val annotation: kotlin.String? = builder.annotation
    /**
     * The compliance type. The allowed values are `COMPLIANT` and `NON_COMPLIANT`. `INSUFFICIENT_DATA` is not supported.
     */
    public val complianceType: aws.sdk.kotlin.services.configservice.model.ConformancePackComplianceType = requireNotNull(builder.complianceType) { "A non-null value must be provided for complianceType" }
    /**
     * The time when Config rule evaluated Amazon Web Services resource.
     */
    public val configRuleInvokedTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.configRuleInvokedTime) { "A non-null value must be provided for configRuleInvokedTime" }
    /**
     * Uniquely identifies an evaluation result.
     */
    public val evaluationResultIdentifier: aws.sdk.kotlin.services.configservice.model.EvaluationResultIdentifier? = builder.evaluationResultIdentifier
    /**
     * The time when Config recorded the evaluation result.
     */
    public val resultRecordedTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.resultRecordedTime) { "A non-null value must be provided for resultRecordedTime" }

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

    override fun toString(): kotlin.String = buildString {
        append("ConformancePackEvaluationResult(")
        append("annotation=$annotation,")
        append("complianceType=$complianceType,")
        append("configRuleInvokedTime=$configRuleInvokedTime,")
        append("evaluationResultIdentifier=$evaluationResultIdentifier,")
        append("resultRecordedTime=$resultRecordedTime")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = annotation?.hashCode() ?: 0
        result = 31 * result + (complianceType.hashCode())
        result = 31 * result + (configRuleInvokedTime.hashCode())
        result = 31 * result + (evaluationResultIdentifier?.hashCode() ?: 0)
        result = 31 * result + (resultRecordedTime.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 ConformancePackEvaluationResult

        if (annotation != other.annotation) return false
        if (complianceType != other.complianceType) return false
        if (configRuleInvokedTime != other.configRuleInvokedTime) return false
        if (evaluationResultIdentifier != other.evaluationResultIdentifier) return false
        if (resultRecordedTime != other.resultRecordedTime) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Supplementary information about how the evaluation determined the compliance.
         */
        public var annotation: kotlin.String? = null
        /**
         * The compliance type. The allowed values are `COMPLIANT` and `NON_COMPLIANT`. `INSUFFICIENT_DATA` is not supported.
         */
        public var complianceType: aws.sdk.kotlin.services.configservice.model.ConformancePackComplianceType? = null
        /**
         * The time when Config rule evaluated Amazon Web Services resource.
         */
        public var configRuleInvokedTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Uniquely identifies an evaluation result.
         */
        public var evaluationResultIdentifier: aws.sdk.kotlin.services.configservice.model.EvaluationResultIdentifier? = null
        /**
         * The time when Config recorded the evaluation result.
         */
        public var resultRecordedTime: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.ConformancePackEvaluationResult) : this() {
            this.annotation = x.annotation
            this.complianceType = x.complianceType
            this.configRuleInvokedTime = x.configRuleInvokedTime
            this.evaluationResultIdentifier = x.evaluationResultIdentifier
            this.resultRecordedTime = x.resultRecordedTime
        }

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

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

        internal fun correctErrors(): Builder {
            if (complianceType == null) complianceType = ConformancePackComplianceType.SdkUnknown("no value provided")
            if (configRuleInvokedTime == null) configRuleInvokedTime = Instant.fromEpochSeconds(0)
            if (resultRecordedTime == null) resultRecordedTime = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy