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

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

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Indicates whether an Amazon Web Services resource or Config rule is compliant and provides the number of contributors that affect the compliance.
 */
public class Compliance private constructor(builder: Builder) {
    /**
     * The number of Amazon Web Services resources or Config rules that cause a result of `NON_COMPLIANT`, up to a maximum number.
     */
    public val complianceContributorCount: aws.sdk.kotlin.services.configservice.model.ComplianceContributorCount? = builder.complianceContributorCount
    /**
     * Indicates whether an Amazon Web Services resource or Config rule is compliant.
     *
     * A resource is compliant if it complies with all of the Config rules that evaluate it. A resource is noncompliant if it does not comply with one or more of these rules.
     *
     * A rule is compliant if all of the resources that the rule evaluates comply with it. A rule is noncompliant if any of these resources do not comply.
     *
     * Config returns the `INSUFFICIENT_DATA` value when no evaluation results are available for the Amazon Web Services resource or Config rule.
     *
     * For the `Compliance` data type, Config supports only `COMPLIANT`, `NON_COMPLIANT`, and `INSUFFICIENT_DATA` values. Config does not support the `NOT_APPLICABLE` value for the `Compliance` data type.
     */
    public val complianceType: aws.sdk.kotlin.services.configservice.model.ComplianceType? = builder.complianceType

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

    override fun toString(): kotlin.String = buildString {
        append("Compliance(")
        append("complianceContributorCount=$complianceContributorCount,")
        append("complianceType=$complianceType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = complianceContributorCount?.hashCode() ?: 0
        result = 31 * result + (complianceType?.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 Compliance

        if (complianceContributorCount != other.complianceContributorCount) return false
        if (complianceType != other.complianceType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The number of Amazon Web Services resources or Config rules that cause a result of `NON_COMPLIANT`, up to a maximum number.
         */
        public var complianceContributorCount: aws.sdk.kotlin.services.configservice.model.ComplianceContributorCount? = null
        /**
         * Indicates whether an Amazon Web Services resource or Config rule is compliant.
         *
         * A resource is compliant if it complies with all of the Config rules that evaluate it. A resource is noncompliant if it does not comply with one or more of these rules.
         *
         * A rule is compliant if all of the resources that the rule evaluates comply with it. A rule is noncompliant if any of these resources do not comply.
         *
         * Config returns the `INSUFFICIENT_DATA` value when no evaluation results are available for the Amazon Web Services resource or Config rule.
         *
         * For the `Compliance` data type, Config supports only `COMPLIANT`, `NON_COMPLIANT`, and `INSUFFICIENT_DATA` values. Config does not support the `NOT_APPLICABLE` value for the `Compliance` data type.
         */
        public var complianceType: aws.sdk.kotlin.services.configservice.model.ComplianceType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.Compliance) : this() {
            this.complianceContributorCount = x.complianceContributorCount
            this.complianceType = x.complianceType
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy