commonMain.aws.sdk.kotlin.services.configservice.model.Scope.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
/**
* Defines which resources trigger an evaluation for an Config rule. The scope can include one or more resource types, a combination of a tag key and value, or a combination of one resource type and one resource ID. Specify a scope to constrain which resources trigger an evaluation for a rule. Otherwise, evaluations for the rule are triggered when any resource in your recording group changes in configuration.
*/
public class Scope private constructor(builder: Builder) {
/**
* The ID of the only Amazon Web Services resource that you want to trigger an evaluation for the rule. If you specify a resource ID, you must specify one resource type for `ComplianceResourceTypes`.
*/
public val complianceResourceId: kotlin.String? = builder.complianceResourceId
/**
* The resource types of only those Amazon Web Services resources that you want to trigger an evaluation for the rule. You can only specify one type if you also specify a resource ID for `ComplianceResourceId`.
*/
public val complianceResourceTypes: List? = builder.complianceResourceTypes
/**
* The tag key that is applied to only those Amazon Web Services resources that you want to trigger an evaluation for the rule.
*/
public val tagKey: kotlin.String? = builder.tagKey
/**
* The tag value applied to only those Amazon Web Services resources that you want to trigger an evaluation for the rule. If you specify a value for `TagValue`, you must also specify a value for `TagKey`.
*/
public val tagValue: kotlin.String? = builder.tagValue
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.configservice.model.Scope = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Scope(")
append("complianceResourceId=$complianceResourceId,")
append("complianceResourceTypes=$complianceResourceTypes,")
append("tagKey=$tagKey,")
append("tagValue=$tagValue")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = complianceResourceId?.hashCode() ?: 0
result = 31 * result + (complianceResourceTypes?.hashCode() ?: 0)
result = 31 * result + (tagKey?.hashCode() ?: 0)
result = 31 * result + (tagValue?.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 Scope
if (complianceResourceId != other.complianceResourceId) return false
if (complianceResourceTypes != other.complianceResourceTypes) return false
if (tagKey != other.tagKey) return false
if (tagValue != other.tagValue) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.configservice.model.Scope = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ID of the only Amazon Web Services resource that you want to trigger an evaluation for the rule. If you specify a resource ID, you must specify one resource type for `ComplianceResourceTypes`.
*/
public var complianceResourceId: kotlin.String? = null
/**
* The resource types of only those Amazon Web Services resources that you want to trigger an evaluation for the rule. You can only specify one type if you also specify a resource ID for `ComplianceResourceId`.
*/
public var complianceResourceTypes: List? = null
/**
* The tag key that is applied to only those Amazon Web Services resources that you want to trigger an evaluation for the rule.
*/
public var tagKey: kotlin.String? = null
/**
* The tag value applied to only those Amazon Web Services resources that you want to trigger an evaluation for the rule. If you specify a value for `TagValue`, you must also specify a value for `TagKey`.
*/
public var tagValue: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.configservice.model.Scope) : this() {
this.complianceResourceId = x.complianceResourceId
this.complianceResourceTypes = x.complianceResourceTypes
this.tagKey = x.tagKey
this.tagValue = x.tagValue
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.configservice.model.Scope = Scope(this)
internal fun correctErrors(): Builder {
return this
}
}
}