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

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

/**
 * The count of resources that are grouped by the group name.
 */
public class GroupedResourceCount private constructor(builder: Builder) {
    /**
     * The name of the group that can be region, account ID, or resource type. For example, region1, region2 if the region was chosen as `GroupByKey`.
     */
    public val groupName: kotlin.String = requireNotNull(builder.groupName) { "A non-null value must be provided for groupName" }
    /**
     * The number of resources in the group.
     */
    public val resourceCount: kotlin.Long = builder.resourceCount

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

    override fun toString(): kotlin.String = buildString {
        append("GroupedResourceCount(")
        append("groupName=$groupName,")
        append("resourceCount=$resourceCount")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = groupName.hashCode()
        result = 31 * result + (resourceCount.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 GroupedResourceCount

        if (groupName != other.groupName) return false
        if (resourceCount != other.resourceCount) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the group that can be region, account ID, or resource type. For example, region1, region2 if the region was chosen as `GroupByKey`.
         */
        public var groupName: kotlin.String? = null
        /**
         * The number of resources in the group.
         */
        public var resourceCount: kotlin.Long = 0L

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.GroupedResourceCount) : this() {
            this.groupName = x.groupName
            this.resourceCount = x.resourceCount
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy