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

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

/**
 * Returns details of a specific query.
 */
public class StoredQueryMetadata private constructor(builder: Builder) {
    /**
     * A unique description for the query.
     */
    public val description: kotlin.String? = builder.description
    /**
     * Amazon Resource Name (ARN) of the query. For example, arn:partition:service:region:account-id:resource-type/resource-name/resource-id.
     */
    public val queryArn: kotlin.String = requireNotNull(builder.queryArn) { "A non-null value must be provided for queryArn" }
    /**
     * The ID of the query.
     */
    public val queryId: kotlin.String = requireNotNull(builder.queryId) { "A non-null value must be provided for queryId" }
    /**
     * The name of the query.
     */
    public val queryName: kotlin.String = requireNotNull(builder.queryName) { "A non-null value must be provided for queryName" }

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

    override fun toString(): kotlin.String = buildString {
        append("StoredQueryMetadata(")
        append("description=$description,")
        append("queryArn=$queryArn,")
        append("queryId=$queryId,")
        append("queryName=$queryName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = description?.hashCode() ?: 0
        result = 31 * result + (queryArn.hashCode())
        result = 31 * result + (queryId.hashCode())
        result = 31 * result + (queryName.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 StoredQueryMetadata

        if (description != other.description) return false
        if (queryArn != other.queryArn) return false
        if (queryId != other.queryId) return false
        if (queryName != other.queryName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A unique description for the query.
         */
        public var description: kotlin.String? = null
        /**
         * Amazon Resource Name (ARN) of the query. For example, arn:partition:service:region:account-id:resource-type/resource-name/resource-id.
         */
        public var queryArn: kotlin.String? = null
        /**
         * The ID of the query.
         */
        public var queryId: kotlin.String? = null
        /**
         * The name of the query.
         */
        public var queryName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.StoredQueryMetadata) : this() {
            this.description = x.description
            this.queryArn = x.queryArn
            this.queryId = x.queryId
            this.queryName = x.queryName
        }

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

        internal fun correctErrors(): Builder {
            if (queryArn == null) queryArn = ""
            if (queryId == null) queryId = ""
            if (queryName == null) queryName = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy