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

commonMain.aws.sdk.kotlin.services.configservice.model.AggregateResourceIdentifier.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

/**
 * The details that identify a resource that is collected by Config aggregator, including the resource type, ID, (if available) the custom resource name, the source account, and source region.
 */
public class AggregateResourceIdentifier private constructor(builder: Builder) {
    /**
     * The ID of the Amazon Web Services resource.
     */
    public val resourceId: kotlin.String = requireNotNull(builder.resourceId) { "A non-null value must be provided for resourceId" }
    /**
     * The name of the Amazon Web Services resource.
     */
    public val resourceName: kotlin.String? = builder.resourceName
    /**
     * The type of the Amazon Web Services resource.
     */
    public val resourceType: aws.sdk.kotlin.services.configservice.model.ResourceType = requireNotNull(builder.resourceType) { "A non-null value must be provided for resourceType" }
    /**
     * The 12-digit account ID of the source account.
     */
    public val sourceAccountId: kotlin.String = requireNotNull(builder.sourceAccountId) { "A non-null value must be provided for sourceAccountId" }
    /**
     * The source region where data is aggregated.
     */
    public val sourceRegion: kotlin.String = requireNotNull(builder.sourceRegion) { "A non-null value must be provided for sourceRegion" }

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

    override fun toString(): kotlin.String = buildString {
        append("AggregateResourceIdentifier(")
        append("resourceId=$resourceId,")
        append("resourceName=$resourceName,")
        append("resourceType=$resourceType,")
        append("sourceAccountId=$sourceAccountId,")
        append("sourceRegion=$sourceRegion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = resourceId.hashCode()
        result = 31 * result + (resourceName?.hashCode() ?: 0)
        result = 31 * result + (resourceType.hashCode())
        result = 31 * result + (sourceAccountId.hashCode())
        result = 31 * result + (sourceRegion.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 AggregateResourceIdentifier

        if (resourceId != other.resourceId) return false
        if (resourceName != other.resourceName) return false
        if (resourceType != other.resourceType) return false
        if (sourceAccountId != other.sourceAccountId) return false
        if (sourceRegion != other.sourceRegion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID of the Amazon Web Services resource.
         */
        public var resourceId: kotlin.String? = null
        /**
         * The name of the Amazon Web Services resource.
         */
        public var resourceName: kotlin.String? = null
        /**
         * The type of the Amazon Web Services resource.
         */
        public var resourceType: aws.sdk.kotlin.services.configservice.model.ResourceType? = null
        /**
         * The 12-digit account ID of the source account.
         */
        public var sourceAccountId: kotlin.String? = null
        /**
         * The source region where data is aggregated.
         */
        public var sourceRegion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.AggregateResourceIdentifier) : this() {
            this.resourceId = x.resourceId
            this.resourceName = x.resourceName
            this.resourceType = x.resourceType
            this.sourceAccountId = x.sourceAccountId
            this.sourceRegion = x.sourceRegion
        }

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

        internal fun correctErrors(): Builder {
            if (resourceId == null) resourceId = ""
            if (resourceType == null) resourceType = ResourceType.SdkUnknown("no value provided")
            if (sourceAccountId == null) sourceAccountId = ""
            if (sourceRegion == null) sourceRegion = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy