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

commonMain.aws.sdk.kotlin.services.ssmsap.model.OperationEvent.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.ssmsap.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

/**
 * An operation event returns details for an operation, including key milestones which can be used to monitor and track operations in progress.
 *
 * Operation events contain:
 * + Description string
 * + Resource, including its ARN and type
 * + Status
 * + StatusMessage string
 * + TimeStamp
 *
 * Operation event examples include StartApplication or StopApplication.
 */
public class OperationEvent private constructor(builder: Builder) {
    /**
     * A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
     */
    public val description: kotlin.String? = builder.description
    /**
     * The resource involved in the operations event.
     *
     * Contains `ResourceArn` ARN and `ResourceType`.
     */
    public val resource: aws.sdk.kotlin.services.ssmsap.model.Resource? = builder.resource
    /**
     * The status of the operation event. The possible statuses are: `IN_PROGRESS`, `COMPLETED`, and `FAILED`.
     */
    public val status: aws.sdk.kotlin.services.ssmsap.model.OperationEventStatus? = builder.status
    /**
     * The status message relating to a specific operation event.
     */
    public val statusMessage: kotlin.String? = builder.statusMessage
    /**
     * The timestamp of the specified operation event.
     */
    public val timestamp: aws.smithy.kotlin.runtime.time.Instant? = builder.timestamp

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ssmsap.model.OperationEvent = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("OperationEvent(")
        append("description=$description,")
        append("resource=$resource,")
        append("status=$status,")
        append("statusMessage=$statusMessage,")
        append("timestamp=$timestamp")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = description?.hashCode() ?: 0
        result = 31 * result + (resource?.hashCode() ?: 0)
        result = 31 * result + (status?.hashCode() ?: 0)
        result = 31 * result + (statusMessage?.hashCode() ?: 0)
        result = 31 * result + (timestamp?.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 OperationEvent

        if (description != other.description) return false
        if (resource != other.resource) return false
        if (status != other.status) return false
        if (statusMessage != other.statusMessage) return false
        if (timestamp != other.timestamp) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
         */
        public var description: kotlin.String? = null
        /**
         * The resource involved in the operations event.
         *
         * Contains `ResourceArn` ARN and `ResourceType`.
         */
        public var resource: aws.sdk.kotlin.services.ssmsap.model.Resource? = null
        /**
         * The status of the operation event. The possible statuses are: `IN_PROGRESS`, `COMPLETED`, and `FAILED`.
         */
        public var status: aws.sdk.kotlin.services.ssmsap.model.OperationEventStatus? = null
        /**
         * The status message relating to a specific operation event.
         */
        public var statusMessage: kotlin.String? = null
        /**
         * The timestamp of the specified operation event.
         */
        public var timestamp: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmsap.model.OperationEvent) : this() {
            this.description = x.description
            this.resource = x.resource
            this.status = x.status
            this.statusMessage = x.statusMessage
            this.timestamp = x.timestamp
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.ssmsap.model.Resource] inside the given [block]
         */
        public fun resource(block: aws.sdk.kotlin.services.ssmsap.model.Resource.Builder.() -> kotlin.Unit) {
            this.resource = aws.sdk.kotlin.services.ssmsap.model.Resource.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy