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

commonMain.aws.sdk.kotlin.services.eventbridge.model.PutEventsRequestEntry.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.eventbridge.model

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

/**
 * Represents an event to be submitted.
 */
public class PutEventsRequestEntry private constructor(builder: Builder) {
    /**
     * A valid JSON object. There is no other schema imposed. The JSON object may contain fields and nested sub-objects.
     *
     * `Detail`, `DetailType`, and `Source` are required for EventBridge to successfully send an event to an event bus. If you include event entries in a request that do not include each of those properties, EventBridge fails that entry. If you submit a request in which *none* of the entries have each of these properties, EventBridge fails the entire request.
     */
    public val detail: kotlin.String? = builder.detail
    /**
     * Free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.
     *
     * `Detail`, `DetailType`, and `Source` are required for EventBridge to successfully send an event to an event bus. If you include event entries in a request that do not include each of those properties, EventBridge fails that entry. If you submit a request in which *none* of the entries have each of these properties, EventBridge fails the entire request.
     */
    public val detailType: kotlin.String? = builder.detailType
    /**
     * The name or ARN of the event bus to receive the event. Only the rules that are associated with this event bus are used to match the event. If you omit this, the default event bus is used.
     *
     * If you're using a global endpoint with a custom bus, you can enter either the name or Amazon Resource Name (ARN) of the event bus in either the primary or secondary Region here. EventBridge then determines the corresponding event bus in the other Region based on the endpoint referenced by the `EndpointId`. Specifying the event bus ARN is preferred.
     */
    public val eventBusName: kotlin.String? = builder.eventBusName
    /**
     * Amazon Web Services resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. Any number, including zero, may be present.
     */
    public val resources: List? = builder.resources
    /**
     * The source of the event.
     *
     * `Detail`, `DetailType`, and `Source` are required for EventBridge to successfully send an event to an event bus. If you include event entries in a request that do not include each of those properties, EventBridge fails that entry. If you submit a request in which *none* of the entries have each of these properties, EventBridge fails the entire request.
     */
    public val source: kotlin.String? = builder.source
    /**
     * The time stamp of the event, per [RFC3339](https://www.rfc-editor.org/rfc/rfc3339.txt). If no time stamp is provided, the time stamp of the [PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) call is used.
     */
    public val time: aws.smithy.kotlin.runtime.time.Instant? = builder.time
    /**
     * An X-Ray trace header, which is an http header (X-Amzn-Trace-Id) that contains the trace-id associated with the event.
     *
     * To learn more about X-Ray trace headers, see [Tracing header](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader) in the X-Ray Developer Guide.
     */
    public val traceHeader: kotlin.String? = builder.traceHeader

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

    override fun toString(): kotlin.String = buildString {
        append("PutEventsRequestEntry(")
        append("detail=$detail,")
        append("detailType=$detailType,")
        append("eventBusName=$eventBusName,")
        append("resources=$resources,")
        append("source=$source,")
        append("time=$time,")
        append("traceHeader=$traceHeader")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = detail?.hashCode() ?: 0
        result = 31 * result + (detailType?.hashCode() ?: 0)
        result = 31 * result + (eventBusName?.hashCode() ?: 0)
        result = 31 * result + (resources?.hashCode() ?: 0)
        result = 31 * result + (source?.hashCode() ?: 0)
        result = 31 * result + (time?.hashCode() ?: 0)
        result = 31 * result + (traceHeader?.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 PutEventsRequestEntry

        if (detail != other.detail) return false
        if (detailType != other.detailType) return false
        if (eventBusName != other.eventBusName) return false
        if (resources != other.resources) return false
        if (source != other.source) return false
        if (time != other.time) return false
        if (traceHeader != other.traceHeader) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A valid JSON object. There is no other schema imposed. The JSON object may contain fields and nested sub-objects.
         *
         * `Detail`, `DetailType`, and `Source` are required for EventBridge to successfully send an event to an event bus. If you include event entries in a request that do not include each of those properties, EventBridge fails that entry. If you submit a request in which *none* of the entries have each of these properties, EventBridge fails the entire request.
         */
        public var detail: kotlin.String? = null
        /**
         * Free-form string, with a maximum of 128 characters, used to decide what fields to expect in the event detail.
         *
         * `Detail`, `DetailType`, and `Source` are required for EventBridge to successfully send an event to an event bus. If you include event entries in a request that do not include each of those properties, EventBridge fails that entry. If you submit a request in which *none* of the entries have each of these properties, EventBridge fails the entire request.
         */
        public var detailType: kotlin.String? = null
        /**
         * The name or ARN of the event bus to receive the event. Only the rules that are associated with this event bus are used to match the event. If you omit this, the default event bus is used.
         *
         * If you're using a global endpoint with a custom bus, you can enter either the name or Amazon Resource Name (ARN) of the event bus in either the primary or secondary Region here. EventBridge then determines the corresponding event bus in the other Region based on the endpoint referenced by the `EndpointId`. Specifying the event bus ARN is preferred.
         */
        public var eventBusName: kotlin.String? = null
        /**
         * Amazon Web Services resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. Any number, including zero, may be present.
         */
        public var resources: List? = null
        /**
         * The source of the event.
         *
         * `Detail`, `DetailType`, and `Source` are required for EventBridge to successfully send an event to an event bus. If you include event entries in a request that do not include each of those properties, EventBridge fails that entry. If you submit a request in which *none* of the entries have each of these properties, EventBridge fails the entire request.
         */
        public var source: kotlin.String? = null
        /**
         * The time stamp of the event, per [RFC3339](https://www.rfc-editor.org/rfc/rfc3339.txt). If no time stamp is provided, the time stamp of the [PutEvents](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) call is used.
         */
        public var time: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * An X-Ray trace header, which is an http header (X-Amzn-Trace-Id) that contains the trace-id associated with the event.
         *
         * To learn more about X-Ray trace headers, see [Tracing header](https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader) in the X-Ray Developer Guide.
         */
        public var traceHeader: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.eventbridge.model.PutEventsRequestEntry) : this() {
            this.detail = x.detail
            this.detailType = x.detailType
            this.eventBusName = x.eventBusName
            this.resources = x.resources
            this.source = x.source
            this.time = x.time
            this.traceHeader = x.traceHeader
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy