commonMain.aws.sdk.kotlin.services.cloudwatch.model.SetAlarmStateRequest.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
public class SetAlarmStateRequest private constructor(builder: Builder) {
/**
* The name of the alarm.
*/
public val alarmName: kotlin.String? = builder.alarmName
/**
* The reason that this alarm is set to this specific state, in text format.
*/
public val stateReason: kotlin.String? = builder.stateReason
/**
* The reason that this alarm is set to this specific state, in JSON format.
*
* For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.
*/
public val stateReasonData: kotlin.String? = builder.stateReasonData
/**
* The value of the state.
*/
public val stateValue: aws.sdk.kotlin.services.cloudwatch.model.StateValue? = builder.stateValue
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudwatch.model.SetAlarmStateRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SetAlarmStateRequest(")
append("alarmName=$alarmName,")
append("stateReason=$stateReason,")
append("stateReasonData=$stateReasonData,")
append("stateValue=$stateValue")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = alarmName?.hashCode() ?: 0
result = 31 * result + (stateReason?.hashCode() ?: 0)
result = 31 * result + (stateReasonData?.hashCode() ?: 0)
result = 31 * result + (stateValue?.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 SetAlarmStateRequest
if (alarmName != other.alarmName) return false
if (stateReason != other.stateReason) return false
if (stateReasonData != other.stateReasonData) return false
if (stateValue != other.stateValue) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudwatch.model.SetAlarmStateRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the alarm.
*/
public var alarmName: kotlin.String? = null
/**
* The reason that this alarm is set to this specific state, in text format.
*/
public var stateReason: kotlin.String? = null
/**
* The reason that this alarm is set to this specific state, in JSON format.
*
* For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto Scaling or application Auto Scaling alarm actions, the Auto Scaling policy uses the information in this field to take the correct action.
*/
public var stateReasonData: kotlin.String? = null
/**
* The value of the state.
*/
public var stateValue: aws.sdk.kotlin.services.cloudwatch.model.StateValue? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudwatch.model.SetAlarmStateRequest) : this() {
this.alarmName = x.alarmName
this.stateReason = x.stateReason
this.stateReasonData = x.stateReasonData
this.stateValue = x.stateValue
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudwatch.model.SetAlarmStateRequest = SetAlarmStateRequest(this)
internal fun correctErrors(): Builder {
return this
}
}
}