commonMain.aws.sdk.kotlin.services.ssmincidents.model.CreateTimelineEventRequest.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
import aws.smithy.kotlin.runtime.time.Instant
public class CreateTimelineEventRequest private constructor(builder: Builder) {
/**
* A token that ensures that a client calls the action only once with the specified details.
*/
public val clientToken: kotlin.String? = builder.clientToken
/**
* A short description of the event.
*/
public val eventData: kotlin.String = requireNotNull(builder.eventData) { "A non-null value must be provided for eventData" }
/**
* Adds one or more references to the `TimelineEvent`. A reference is an Amazon Web Services resource involved or associated with the incident. To specify a reference, enter its Amazon Resource Name (ARN). You can also specify a related item associated with a resource. For example, to specify an Amazon DynamoDB (DynamoDB) table as a resource, use the table's ARN. You can also specify an Amazon CloudWatch metric associated with the DynamoDB table as a related item.
*/
public val eventReferences: List? = builder.eventReferences
/**
* The timestamp for when the event occurred.
*/
public val eventTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.eventTime) { "A non-null value must be provided for eventTime" }
/**
* The type of event. You can create timeline events of type `Custom Event` and `Note`.
*
* To make a Note-type event appear on the *Incident notes* panel in the console, specify `eventType` as `Note`and enter the Amazon Resource Name (ARN) of the incident as the value for `eventReference`.
*/
public val eventType: kotlin.String = requireNotNull(builder.eventType) { "A non-null value must be provided for eventType" }
/**
* The Amazon Resource Name (ARN) of the incident record that the action adds the incident to.
*/
public val incidentRecordArn: kotlin.String = requireNotNull(builder.incidentRecordArn) { "A non-null value must be provided for incidentRecordArn" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ssmincidents.model.CreateTimelineEventRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateTimelineEventRequest(")
append("clientToken=$clientToken,")
append("eventData=$eventData,")
append("eventReferences=$eventReferences,")
append("eventTime=$eventTime,")
append("eventType=$eventType,")
append("incidentRecordArn=$incidentRecordArn")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = clientToken?.hashCode() ?: 0
result = 31 * result + (eventData.hashCode())
result = 31 * result + (eventReferences?.hashCode() ?: 0)
result = 31 * result + (eventTime.hashCode())
result = 31 * result + (eventType.hashCode())
result = 31 * result + (incidentRecordArn.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 CreateTimelineEventRequest
if (clientToken != other.clientToken) return false
if (eventData != other.eventData) return false
if (eventReferences != other.eventReferences) return false
if (eventTime != other.eventTime) return false
if (eventType != other.eventType) return false
if (incidentRecordArn != other.incidentRecordArn) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ssmincidents.model.CreateTimelineEventRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A token that ensures that a client calls the action only once with the specified details.
*/
public var clientToken: kotlin.String? = null
/**
* A short description of the event.
*/
public var eventData: kotlin.String? = null
/**
* Adds one or more references to the `TimelineEvent`. A reference is an Amazon Web Services resource involved or associated with the incident. To specify a reference, enter its Amazon Resource Name (ARN). You can also specify a related item associated with a resource. For example, to specify an Amazon DynamoDB (DynamoDB) table as a resource, use the table's ARN. You can also specify an Amazon CloudWatch metric associated with the DynamoDB table as a related item.
*/
public var eventReferences: List? = null
/**
* The timestamp for when the event occurred.
*/
public var eventTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The type of event. You can create timeline events of type `Custom Event` and `Note`.
*
* To make a Note-type event appear on the *Incident notes* panel in the console, specify `eventType` as `Note`and enter the Amazon Resource Name (ARN) of the incident as the value for `eventReference`.
*/
public var eventType: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the incident record that the action adds the incident to.
*/
public var incidentRecordArn: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.CreateTimelineEventRequest) : this() {
this.clientToken = x.clientToken
this.eventData = x.eventData
this.eventReferences = x.eventReferences
this.eventTime = x.eventTime
this.eventType = x.eventType
this.incidentRecordArn = x.incidentRecordArn
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.ssmincidents.model.CreateTimelineEventRequest = CreateTimelineEventRequest(this)
internal fun correctErrors(): Builder {
if (eventData == null) eventData = ""
if (eventTime == null) eventTime = Instant.fromEpochSeconds(0)
if (eventType == null) eventType = ""
if (incidentRecordArn == null) incidentRecordArn = ""
return this
}
}
}