commonMain.aws.sdk.kotlin.services.ssmincidents.model.IncidentTemplate.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ssmincidents-jvm Show documentation
Show all versions of ssmincidents-jvm Show documentation
The AWS SDK for Kotlin client for SSM Incidents
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.ssmincidents.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Basic details used in creating a response plan. The response plan is then used to create an incident record.
*/
public class IncidentTemplate private constructor(builder: Builder) {
/**
* The string Incident Manager uses to prevent the same root cause from creating multiple incidents in the same account.
*
* A deduplication string is a term or phrase the system uses to check for duplicate incidents. If you specify a deduplication string, Incident Manager searches for open incidents that contain the same string in the `dedupeString` field when it creates the incident. If a duplicate is detected, Incident Manager deduplicates the newer incident into the existing incident.
*
* By default, Incident Manager automatically deduplicates multiple incidents created by the same Amazon CloudWatch alarm or Amazon EventBridge event. You don't have to enter your own deduplication string to prevent duplication for these resource types.
*/
public val dedupeString: kotlin.String? = builder.dedupeString
/**
* The impact of the incident on your customers and applications.
*
* **Supported impact codes**
* + `1` - Critical
* + `2` - High
* + `3` - Medium
* + `4` - Low
* + `5` - No Impact
*/
public val impact: kotlin.Int = requireNotNull(builder.impact) { "A non-null value must be provided for impact" }
/**
* Tags to assign to the template. When the `StartIncident` API action is called, Incident Manager assigns the tags specified in the template to the incident.
*/
public val incidentTags: Map? = builder.incidentTags
/**
* The Amazon SNS targets that are notified when updates are made to an incident.
*/
public val notificationTargets: List? = builder.notificationTargets
/**
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening, and context.
*/
public val summary: kotlin.String? = builder.summary
/**
* The title of the incident.
*/
public val title: kotlin.String = requireNotNull(builder.title) { "A non-null value must be provided for title" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ssmincidents.model.IncidentTemplate = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("IncidentTemplate(")
append("dedupeString=$dedupeString,")
append("impact=$impact,")
append("incidentTags=$incidentTags,")
append("notificationTargets=$notificationTargets,")
append("summary=$summary,")
append("title=$title")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = dedupeString?.hashCode() ?: 0
result = 31 * result + (impact)
result = 31 * result + (incidentTags?.hashCode() ?: 0)
result = 31 * result + (notificationTargets?.hashCode() ?: 0)
result = 31 * result + (summary?.hashCode() ?: 0)
result = 31 * result + (title.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 IncidentTemplate
if (dedupeString != other.dedupeString) return false
if (impact != other.impact) return false
if (incidentTags != other.incidentTags) return false
if (notificationTargets != other.notificationTargets) return false
if (summary != other.summary) return false
if (title != other.title) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ssmincidents.model.IncidentTemplate = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The string Incident Manager uses to prevent the same root cause from creating multiple incidents in the same account.
*
* A deduplication string is a term or phrase the system uses to check for duplicate incidents. If you specify a deduplication string, Incident Manager searches for open incidents that contain the same string in the `dedupeString` field when it creates the incident. If a duplicate is detected, Incident Manager deduplicates the newer incident into the existing incident.
*
* By default, Incident Manager automatically deduplicates multiple incidents created by the same Amazon CloudWatch alarm or Amazon EventBridge event. You don't have to enter your own deduplication string to prevent duplication for these resource types.
*/
public var dedupeString: kotlin.String? = null
/**
* The impact of the incident on your customers and applications.
*
* **Supported impact codes**
* + `1` - Critical
* + `2` - High
* + `3` - Medium
* + `4` - Low
* + `5` - No Impact
*/
public var impact: kotlin.Int? = null
/**
* Tags to assign to the template. When the `StartIncident` API action is called, Incident Manager assigns the tags specified in the template to the incident.
*/
public var incidentTags: Map? = null
/**
* The Amazon SNS targets that are notified when updates are made to an incident.
*/
public var notificationTargets: List? = null
/**
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening, and context.
*/
public var summary: kotlin.String? = null
/**
* The title of the incident.
*/
public var title: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.IncidentTemplate) : this() {
this.dedupeString = x.dedupeString
this.impact = x.impact
this.incidentTags = x.incidentTags
this.notificationTargets = x.notificationTargets
this.summary = x.summary
this.title = x.title
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.ssmincidents.model.IncidentTemplate = IncidentTemplate(this)
internal fun correctErrors(): Builder {
if (impact == null) impact = 0
if (title == null) title = ""
return this
}
}
}