commonMain.aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleDescription.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudwatch-jvm Show documentation
Show all versions of cloudwatch-jvm Show documentation
The AWS SDK for Kotlin client for CloudWatch
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudwatch.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Contains information about managed Contributor Insights rules, as returned by `ListManagedInsightRules`.
*/
public class ManagedRuleDescription private constructor(builder: Builder) {
/**
* If a managed rule is enabled, this is the ARN for the related Amazon Web Services resource.
*/
public val resourceArn: kotlin.String? = builder.resourceArn
/**
* Describes the state of a managed rule. If present, it contains information about the Contributor Insights rule that contains information about the related Amazon Web Services resource.
*/
public val ruleState: aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleState? = builder.ruleState
/**
* The template name for the managed rule. Used to enable managed rules using `PutManagedInsightRules`.
*/
public val templateName: kotlin.String? = builder.templateName
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleDescription = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ManagedRuleDescription(")
append("resourceArn=$resourceArn,")
append("ruleState=$ruleState,")
append("templateName=$templateName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = resourceArn?.hashCode() ?: 0
result = 31 * result + (ruleState?.hashCode() ?: 0)
result = 31 * result + (templateName?.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 ManagedRuleDescription
if (resourceArn != other.resourceArn) return false
if (ruleState != other.ruleState) return false
if (templateName != other.templateName) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleDescription = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* If a managed rule is enabled, this is the ARN for the related Amazon Web Services resource.
*/
public var resourceArn: kotlin.String? = null
/**
* Describes the state of a managed rule. If present, it contains information about the Contributor Insights rule that contains information about the related Amazon Web Services resource.
*/
public var ruleState: aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleState? = null
/**
* The template name for the managed rule. Used to enable managed rules using `PutManagedInsightRules`.
*/
public var templateName: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleDescription) : this() {
this.resourceArn = x.resourceArn
this.ruleState = x.ruleState
this.templateName = x.templateName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleDescription = ManagedRuleDescription(this)
/**
* construct an [aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleState] inside the given [block]
*/
public fun ruleState(block: aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleState.Builder.() -> kotlin.Unit) {
this.ruleState = aws.sdk.kotlin.services.cloudwatch.model.ManagedRuleState.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}