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

commonMain.aws.sdk.kotlin.services.ssmincidents.model.UpdateTimelineEventRequest.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

public class UpdateTimelineEventRequest private constructor(builder: Builder) {
    /**
     * A token that ensures that a client calls the operation only once with the specified details.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * A short description of the event.
     */
    public val eventData: kotlin.String? = builder.eventData
    /**
     * The ID of the event to update. You can use `ListTimelineEvents` to find an event's ID.
     */
    public val eventId: kotlin.String = requireNotNull(builder.eventId) { "A non-null value must be provided for eventId" }
    /**
     * Updates all existing references in a `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 that resource. For example, to specify an Amazon DynamoDB (DynamoDB) table as a resource, use its ARN. You can also specify an Amazon CloudWatch metric associated with the DynamoDB table as a related item.
     *
     * This update action overrides all existing references. If you want to keep existing references, you must specify them in the call. If you don't, this action removes any existing references and enters only new references.
     */
    public val eventReferences: List? = builder.eventReferences
    /**
     * The timestamp for when the event occurred.
     */
    public val eventTime: aws.smithy.kotlin.runtime.time.Instant? = builder.eventTime
    /**
     * The type of event. You can update events of type `Custom Event` and `Note`.
     */
    public val eventType: kotlin.String? = builder.eventType
    /**
     * The Amazon Resource Name (ARN) of the incident that includes the timeline event.
     */
    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.UpdateTimelineEventRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("UpdateTimelineEventRequest(")
        append("clientToken=$clientToken,")
        append("eventData=$eventData,")
        append("eventId=$eventId,")
        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() ?: 0)
        result = 31 * result + (eventId.hashCode())
        result = 31 * result + (eventReferences?.hashCode() ?: 0)
        result = 31 * result + (eventTime?.hashCode() ?: 0)
        result = 31 * result + (eventType?.hashCode() ?: 0)
        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 UpdateTimelineEventRequest

        if (clientToken != other.clientToken) return false
        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 (incidentRecordArn != other.incidentRecordArn) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A token that ensures that a client calls the operation only once with the specified details.
         */
        public var clientToken: kotlin.String? = null
        /**
         * A short description of the event.
         */
        public var eventData: kotlin.String? = null
        /**
         * The ID of the event to update. You can use `ListTimelineEvents` to find an event's ID.
         */
        public var eventId: kotlin.String? = null
        /**
         * Updates all existing references in a `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 that resource. For example, to specify an Amazon DynamoDB (DynamoDB) table as a resource, use its ARN. You can also specify an Amazon CloudWatch metric associated with the DynamoDB table as a related item.
         *
         * This update action overrides all existing references. If you want to keep existing references, you must specify them in the call. If you don't, this action removes any existing references and enters only new references.
         */
        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 update events of type `Custom Event` and `Note`.
         */
        public var eventType: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the incident that includes the timeline event.
         */
        public var incidentRecordArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.UpdateTimelineEventRequest) : this() {
            this.clientToken = x.clientToken
            this.eventData = x.eventData
            this.eventId = x.eventId
            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.UpdateTimelineEventRequest = UpdateTimelineEventRequest(this)

        internal fun correctErrors(): Builder {
            if (eventId == null) eventId = ""
            if (incidentRecordArn == null) incidentRecordArn = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy