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

commonMain.aws.sdk.kotlin.services.configservice.model.OrganizationConfigRule.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
import aws.smithy.kotlin.runtime.time.Instant

/**
 * An organization Config rule that has information about Config rules that Config creates in member accounts.
 */
public class OrganizationConfigRule private constructor(builder: Builder) {
    /**
     * A comma-separated list of accounts excluded from organization Config rule.
     */
    public val excludedAccounts: List? = builder.excludedAccounts
    /**
     * The timestamp of the last update.
     */
    public val lastUpdateTime: aws.smithy.kotlin.runtime.time.Instant? = builder.lastUpdateTime
    /**
     * Amazon Resource Name (ARN) of organization Config rule.
     */
    public val organizationConfigRuleArn: kotlin.String = requireNotNull(builder.organizationConfigRuleArn) { "A non-null value must be provided for organizationConfigRuleArn" }
    /**
     * The name that you assign to organization Config rule.
     */
    public val organizationConfigRuleName: kotlin.String = requireNotNull(builder.organizationConfigRuleName) { "A non-null value must be provided for organizationConfigRuleName" }
    /**
     * An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes the runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such as resource type, resource ID of Amazon Web Services resource, and organization trigger types that initiate Config to evaluate Amazon Web Services resources against a rule.
     */
    public val organizationCustomPolicyRuleMetadata: aws.sdk.kotlin.services.configservice.model.OrganizationCustomPolicyRuleMetadataNoPolicy? = builder.organizationCustomPolicyRuleMetadata
    /**
     * An `OrganizationCustomRuleMetadata` object.
     */
    public val organizationCustomRuleMetadata: aws.sdk.kotlin.services.configservice.model.OrganizationCustomRuleMetadata? = builder.organizationCustomRuleMetadata
    /**
     * An `OrganizationManagedRuleMetadata` object.
     */
    public val organizationManagedRuleMetadata: aws.sdk.kotlin.services.configservice.model.OrganizationManagedRuleMetadata? = builder.organizationManagedRuleMetadata

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

    override fun toString(): kotlin.String = buildString {
        append("OrganizationConfigRule(")
        append("excludedAccounts=$excludedAccounts,")
        append("lastUpdateTime=$lastUpdateTime,")
        append("organizationConfigRuleArn=$organizationConfigRuleArn,")
        append("organizationConfigRuleName=$organizationConfigRuleName,")
        append("organizationCustomPolicyRuleMetadata=$organizationCustomPolicyRuleMetadata,")
        append("organizationCustomRuleMetadata=$organizationCustomRuleMetadata,")
        append("organizationManagedRuleMetadata=$organizationManagedRuleMetadata")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = excludedAccounts?.hashCode() ?: 0
        result = 31 * result + (lastUpdateTime?.hashCode() ?: 0)
        result = 31 * result + (organizationConfigRuleArn.hashCode())
        result = 31 * result + (organizationConfigRuleName.hashCode())
        result = 31 * result + (organizationCustomPolicyRuleMetadata?.hashCode() ?: 0)
        result = 31 * result + (organizationCustomRuleMetadata?.hashCode() ?: 0)
        result = 31 * result + (organizationManagedRuleMetadata?.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 OrganizationConfigRule

        if (excludedAccounts != other.excludedAccounts) return false
        if (lastUpdateTime != other.lastUpdateTime) return false
        if (organizationConfigRuleArn != other.organizationConfigRuleArn) return false
        if (organizationConfigRuleName != other.organizationConfigRuleName) return false
        if (organizationCustomPolicyRuleMetadata != other.organizationCustomPolicyRuleMetadata) return false
        if (organizationCustomRuleMetadata != other.organizationCustomRuleMetadata) return false
        if (organizationManagedRuleMetadata != other.organizationManagedRuleMetadata) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A comma-separated list of accounts excluded from organization Config rule.
         */
        public var excludedAccounts: List? = null
        /**
         * The timestamp of the last update.
         */
        public var lastUpdateTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Amazon Resource Name (ARN) of organization Config rule.
         */
        public var organizationConfigRuleArn: kotlin.String? = null
        /**
         * The name that you assign to organization Config rule.
         */
        public var organizationConfigRuleName: kotlin.String? = null
        /**
         * An object that specifies metadata for your organization's Config Custom Policy rule. The metadata includes the runtime system in use, which accounts have debug logging enabled, and other custom rule metadata, such as resource type, resource ID of Amazon Web Services resource, and organization trigger types that initiate Config to evaluate Amazon Web Services resources against a rule.
         */
        public var organizationCustomPolicyRuleMetadata: aws.sdk.kotlin.services.configservice.model.OrganizationCustomPolicyRuleMetadataNoPolicy? = null
        /**
         * An `OrganizationCustomRuleMetadata` object.
         */
        public var organizationCustomRuleMetadata: aws.sdk.kotlin.services.configservice.model.OrganizationCustomRuleMetadata? = null
        /**
         * An `OrganizationManagedRuleMetadata` object.
         */
        public var organizationManagedRuleMetadata: aws.sdk.kotlin.services.configservice.model.OrganizationManagedRuleMetadata? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.OrganizationConfigRule) : this() {
            this.excludedAccounts = x.excludedAccounts
            this.lastUpdateTime = x.lastUpdateTime
            this.organizationConfigRuleArn = x.organizationConfigRuleArn
            this.organizationConfigRuleName = x.organizationConfigRuleName
            this.organizationCustomPolicyRuleMetadata = x.organizationCustomPolicyRuleMetadata
            this.organizationCustomRuleMetadata = x.organizationCustomRuleMetadata
            this.organizationManagedRuleMetadata = x.organizationManagedRuleMetadata
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            if (organizationConfigRuleArn == null) organizationConfigRuleArn = ""
            if (organizationConfigRuleName == null) organizationConfigRuleName = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy