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

commonMain.aws.sdk.kotlin.services.configservice.model.AggregateComplianceByConfigRule.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 Config rule is compliant based on account ID, region, compliance, and rule name.
 *
 * A rule is compliant if all of the resources that the rule evaluated comply with it. It is noncompliant if any of these resources do not comply.
 */
public class AggregateComplianceByConfigRule private constructor(builder: Builder) {
    /**
     * The 12-digit account ID of the source account.
     */
    public val accountId: kotlin.String? = builder.accountId
    /**
     * The source region from where the data is aggregated.
     */
    public val awsRegion: kotlin.String? = builder.awsRegion
    /**
     * Indicates whether an Amazon Web Services resource or Config rule is compliant and provides the number of contributors that affect the compliance.
     */
    public val compliance: aws.sdk.kotlin.services.configservice.model.Compliance? = builder.compliance
    /**
     * The name of the Config rule.
     */
    public val configRuleName: kotlin.String? = builder.configRuleName

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

    override fun toString(): kotlin.String = buildString {
        append("AggregateComplianceByConfigRule(")
        append("accountId=$accountId,")
        append("awsRegion=$awsRegion,")
        append("compliance=$compliance,")
        append("configRuleName=$configRuleName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = accountId?.hashCode() ?: 0
        result = 31 * result + (awsRegion?.hashCode() ?: 0)
        result = 31 * result + (compliance?.hashCode() ?: 0)
        result = 31 * result + (configRuleName?.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 AggregateComplianceByConfigRule

        if (accountId != other.accountId) return false
        if (awsRegion != other.awsRegion) return false
        if (compliance != other.compliance) return false
        if (configRuleName != other.configRuleName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The 12-digit account ID of the source account.
         */
        public var accountId: kotlin.String? = null
        /**
         * The source region from where the data is aggregated.
         */
        public var awsRegion: kotlin.String? = null
        /**
         * Indicates whether an Amazon Web Services resource or Config rule is compliant and provides the number of contributors that affect the compliance.
         */
        public var compliance: aws.sdk.kotlin.services.configservice.model.Compliance? = null
        /**
         * The name of the Config rule.
         */
        public var configRuleName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.AggregateComplianceByConfigRule) : this() {
            this.accountId = x.accountId
            this.awsRegion = x.awsRegion
            this.compliance = x.compliance
            this.configRuleName = x.configRuleName
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy