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

commonMain.aws.sdk.kotlin.services.dataexchange.model.EventActionEntry.kt Maven / Gradle / Ivy

There is a newer version: 1.3.32
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.dataexchange.model

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

/**
 * An event action is an object that defines the relationship between a specific event and an automated action that will be taken on behalf of the customer.
 */
public class EventActionEntry private constructor(builder: Builder) {
    /**
     * What occurs after a certain event.
     */
    public val action: aws.sdk.kotlin.services.dataexchange.model.Action? = builder.action
    /**
     * The Amazon Resource Name (ARN) for the event action.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * The date and time that the event action was created, in ISO 8601 format.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
    /**
     * What occurs to start an action.
     */
    public val event: aws.sdk.kotlin.services.dataexchange.model.Event? = builder.event
    /**
     * The unique identifier for the event action.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The date and time that the event action was last updated, in ISO 8601 format.
     */
    public val updatedAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.updatedAt) { "A non-null value must be provided for updatedAt" }

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

    override fun toString(): kotlin.String = buildString {
        append("EventActionEntry(")
        append("action=$action,")
        append("arn=$arn,")
        append("createdAt=$createdAt,")
        append("event=$event,")
        append("id=$id,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = action?.hashCode() ?: 0
        result = 31 * result + (arn.hashCode())
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (event?.hashCode() ?: 0)
        result = 31 * result + (id.hashCode())
        result = 31 * result + (updatedAt.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 EventActionEntry

        if (action != other.action) return false
        if (arn != other.arn) return false
        if (createdAt != other.createdAt) return false
        if (event != other.event) return false
        if (id != other.id) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * What occurs after a certain event.
         */
        public var action: aws.sdk.kotlin.services.dataexchange.model.Action? = null
        /**
         * The Amazon Resource Name (ARN) for the event action.
         */
        public var arn: kotlin.String? = null
        /**
         * The date and time that the event action was created, in ISO 8601 format.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * What occurs to start an action.
         */
        public var event: aws.sdk.kotlin.services.dataexchange.model.Event? = null
        /**
         * The unique identifier for the event action.
         */
        public var id: kotlin.String? = null
        /**
         * The date and time that the event action was last updated, in ISO 8601 format.
         */
        public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.dataexchange.model.EventActionEntry) : this() {
            this.action = x.action
            this.arn = x.arn
            this.createdAt = x.createdAt
            this.event = x.event
            this.id = x.id
            this.updatedAt = x.updatedAt
        }

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

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

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

        internal fun correctErrors(): Builder {
            if (arn == null) arn = ""
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (id == null) id = ""
            if (updatedAt == null) updatedAt = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy