commonMain.aws.sdk.kotlin.services.configservice.model.StoredQuery.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of configservice-jvm Show documentation
Show all versions of configservice-jvm Show documentation
The AWS SDK for Kotlin client for Config Service
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
/**
* Provides the details of a stored query.
*/
public class StoredQuery private constructor(builder: Builder) {
/**
* A unique description for the query.
*/
public val description: kotlin.String? = builder.description
/**
* The expression of the query. For example, `SELECT resourceId, resourceType, supplementaryConfiguration.BucketVersioningConfiguration.status WHERE resourceType = 'AWS::S3::Bucket' AND supplementaryConfiguration.BucketVersioningConfiguration.status = 'Off'.`
*/
public val expression: kotlin.String? = builder.expression
/**
* 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? = builder.queryArn
/**
* The ID of the query.
*/
public val queryId: kotlin.String? = builder.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.StoredQuery = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("StoredQuery(")
append("description=$description,")
append("expression=$expression,")
append("queryArn=$queryArn,")
append("queryId=$queryId,")
append("queryName=$queryName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = description?.hashCode() ?: 0
result = 31 * result + (expression?.hashCode() ?: 0)
result = 31 * result + (queryArn?.hashCode() ?: 0)
result = 31 * result + (queryId?.hashCode() ?: 0)
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 StoredQuery
if (description != other.description) return false
if (expression != other.expression) 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.StoredQuery = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A unique description for the query.
*/
public var description: kotlin.String? = null
/**
* The expression of the query. For example, `SELECT resourceId, resourceType, supplementaryConfiguration.BucketVersioningConfiguration.status WHERE resourceType = 'AWS::S3::Bucket' AND supplementaryConfiguration.BucketVersioningConfiguration.status = 'Off'.`
*/
public var expression: 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.StoredQuery) : this() {
this.description = x.description
this.expression = x.expression
this.queryArn = x.queryArn
this.queryId = x.queryId
this.queryName = x.queryName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.configservice.model.StoredQuery = StoredQuery(this)
internal fun correctErrors(): Builder {
if (queryName == null) queryName = ""
return this
}
}
}