All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.ssmincidents.model.TimelineEvent.kt Maven / Gradle / Ivy

There is a newer version: 1.3.79
Show newest version
// 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

/**
 * A significant event that happened during the incident.
 */
public class TimelineEvent private constructor(builder: Builder) {
    /**
     * A short description of the event.
     */
    public val eventData: kotlin.String = requireNotNull(builder.eventData) { "A non-null value must be provided for eventData" }
    /**
     * The ID of the timeline event.
     */
    public val eventId: kotlin.String = requireNotNull(builder.eventId) { "A non-null value must be provided for eventId" }
    /**
     * A list of references in a `TimelineEvent`.
     */
    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 that occurred. Currently Incident Manager supports only the `Custom Event` and `Note` types.
     */
    public val eventType: kotlin.String = requireNotNull(builder.eventType) { "A non-null value must be provided for eventType" }
    /**
     * The timestamp for when the timeline event was last updated.
     */
    public val eventUpdatedTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.eventUpdatedTime) { "A non-null value must be provided for eventUpdatedTime" }
    /**
     * The Amazon Resource Name (ARN) of the incident that the event occurred during.
     */
    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.TimelineEvent = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("TimelineEvent(")
        append("eventData=$eventData,")
        append("eventId=$eventId,")
        append("eventReferences=$eventReferences,")
        append("eventTime=$eventTime,")
        append("eventType=$eventType,")
        append("eventUpdatedTime=$eventUpdatedTime,")
        append("incidentRecordArn=$incidentRecordArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = eventData.hashCode()
        result = 31 * result + (eventId.hashCode())
        result = 31 * result + (eventReferences?.hashCode() ?: 0)
        result = 31 * result + (eventTime.hashCode())
        result = 31 * result + (eventType.hashCode())
        result = 31 * result + (eventUpdatedTime.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 TimelineEvent

        if (eventData != other.eventData) return false
        if (eventId != other.eventId) return false
        if (eventReferences != other.eventReferences) return false
        if (eventTime != other.eventTime) return false
        if (eventType != other.eventType) return false
        if (eventUpdatedTime != other.eventUpdatedTime) return false
        if (incidentRecordArn != other.incidentRecordArn) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ssmincidents.model.TimelineEvent = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * A short description of the event.
         */
        public var eventData: kotlin.String? = null
        /**
         * The ID of the timeline event.
         */
        public var eventId: kotlin.String? = null
        /**
         * A list of references in a `TimelineEvent`.
         */
        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 that occurred. Currently Incident Manager supports only the `Custom Event` and `Note` types.
         */
        public var eventType: kotlin.String? = null
        /**
         * The timestamp for when the timeline event was last updated.
         */
        public var eventUpdatedTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The Amazon Resource Name (ARN) of the incident that the event occurred during.
         */
        public var incidentRecordArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.TimelineEvent) : this() {
            this.eventData = x.eventData
            this.eventId = x.eventId
            this.eventReferences = x.eventReferences
            this.eventTime = x.eventTime
            this.eventType = x.eventType
            this.eventUpdatedTime = x.eventUpdatedTime
            this.incidentRecordArn = x.incidentRecordArn
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.ssmincidents.model.TimelineEvent = TimelineEvent(this)

        internal fun correctErrors(): Builder {
            if (eventData == null) eventData = ""
            if (eventId == null) eventId = ""
            if (eventTime == null) eventTime = Instant.fromEpochSeconds(0)
            if (eventType == null) eventType = ""
            if (eventUpdatedTime == null) eventUpdatedTime = Instant.fromEpochSeconds(0)
            if (incidentRecordArn == null) incidentRecordArn = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy