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

commonMain.aws.sdk.kotlin.services.eventbridge.model.CreateEventBusRequest.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

public class CreateEventBusRequest private constructor(builder: Builder) {
    /**
     * Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).
     *
     * For more information, see [Event retry policy and using dead-letter queues](eventbridge/latest/userguide/eb-rule-dlq.html) in the *EventBridge User Guide*.
     */
    public val deadLetterConfig: aws.sdk.kotlin.services.eventbridge.model.DeadLetterConfig? = builder.deadLetterConfig
    /**
     * The event bus description.
     */
    public val description: kotlin.String? = builder.description
    /**
     * If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.
     */
    public val eventSourceName: kotlin.String? = builder.eventSourceName
    /**
     * The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
     *
     * If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt events on the event bus.
     *
     * For more information, see [Managing keys](https://docs.aws.amazon.com/kms/latest/developerguide/getting-started.html) in the *Key Management Service Developer Guide*.
     *
     * Archives and schema discovery are not supported for event buses encrypted using a customer managed key. EventBridge returns an error if:
     * + You call ` CreateArchive ` on an event bus set to use a customer managed key for encryption.
     * + You call ` CreateDiscoverer ` on an event bus set to use a customer managed key for encryption.
     * + You call ` UpdatedEventBus ` to set a customer managed key on an event bus with an archives or schema discovery enabled.
     * To enable archives or schema discovery on an event bus, choose to use an Amazon Web Services owned key. For more information, see [Data encryption in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption.html) in the *Amazon EventBridge User Guide*.
     */
    public val kmsKeyIdentifier: kotlin.String? = builder.kmsKeyIdentifier
    /**
     * The name of the new event bus.
     *
     * Custom event bus names can't contain the `/` character, but you can use the `/` character in partner event bus names. In addition, for partner event buses, the name must exactly match the name of the partner event source that this event bus is matched to.
     *
     * You can't use the name `default` for a custom event bus, as this name is already used for your account's default event bus.
     */
    public val name: kotlin.String? = builder.name
    /**
     * Tags to associate with the event bus.
     */
    public val tags: List? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("CreateEventBusRequest(")
        append("deadLetterConfig=$deadLetterConfig,")
        append("description=$description,")
        append("eventSourceName=$eventSourceName,")
        append("kmsKeyIdentifier=$kmsKeyIdentifier,")
        append("name=$name,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = deadLetterConfig?.hashCode() ?: 0
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (eventSourceName?.hashCode() ?: 0)
        result = 31 * result + (kmsKeyIdentifier?.hashCode() ?: 0)
        result = 31 * result + (name?.hashCode() ?: 0)
        result = 31 * result + (tags?.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 CreateEventBusRequest

        if (deadLetterConfig != other.deadLetterConfig) return false
        if (description != other.description) return false
        if (eventSourceName != other.eventSourceName) return false
        if (kmsKeyIdentifier != other.kmsKeyIdentifier) return false
        if (name != other.name) return false
        if (tags != other.tags) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Configuration details of the Amazon SQS queue for EventBridge to use as a dead-letter queue (DLQ).
         *
         * For more information, see [Event retry policy and using dead-letter queues](eventbridge/latest/userguide/eb-rule-dlq.html) in the *EventBridge User Guide*.
         */
        public var deadLetterConfig: aws.sdk.kotlin.services.eventbridge.model.DeadLetterConfig? = null
        /**
         * The event bus description.
         */
        public var description: kotlin.String? = null
        /**
         * If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.
         */
        public var eventSourceName: kotlin.String? = null
        /**
         * The identifier of the KMS customer managed key for EventBridge to use, if you choose to use a customer managed key to encrypt events on this event bus. The identifier can be the key Amazon Resource Name (ARN), KeyId, key alias, or key alias ARN.
         *
         * If you do not specify a customer managed key identifier, EventBridge uses an Amazon Web Services owned key to encrypt events on the event bus.
         *
         * For more information, see [Managing keys](https://docs.aws.amazon.com/kms/latest/developerguide/getting-started.html) in the *Key Management Service Developer Guide*.
         *
         * Archives and schema discovery are not supported for event buses encrypted using a customer managed key. EventBridge returns an error if:
         * + You call ` CreateArchive ` on an event bus set to use a customer managed key for encryption.
         * + You call ` CreateDiscoverer ` on an event bus set to use a customer managed key for encryption.
         * + You call ` UpdatedEventBus ` to set a customer managed key on an event bus with an archives or schema discovery enabled.
         * To enable archives or schema discovery on an event bus, choose to use an Amazon Web Services owned key. For more information, see [Data encryption in EventBridge](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-encryption.html) in the *Amazon EventBridge User Guide*.
         */
        public var kmsKeyIdentifier: kotlin.String? = null
        /**
         * The name of the new event bus.
         *
         * Custom event bus names can't contain the `/` character, but you can use the `/` character in partner event bus names. In addition, for partner event buses, the name must exactly match the name of the partner event source that this event bus is matched to.
         *
         * You can't use the name `default` for a custom event bus, as this name is already used for your account's default event bus.
         */
        public var name: kotlin.String? = null
        /**
         * Tags to associate with the event bus.
         */
        public var tags: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.eventbridge.model.CreateEventBusRequest) : this() {
            this.deadLetterConfig = x.deadLetterConfig
            this.description = x.description
            this.eventSourceName = x.eventSourceName
            this.kmsKeyIdentifier = x.kmsKeyIdentifier
            this.name = x.name
            this.tags = x.tags
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy