
commonMain.aws.sdk.kotlin.services.s3.model.TopicConfiguration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.s3.model
/**
* A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events.
*/
public class TopicConfiguration private constructor(builder: Builder) {
/**
* The Amazon S3 bucket event about which to send notifications. For more information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*.
*/
public val events: List = requireNotNull(builder.events) { "A non-null value must be provided for events" }
/**
* Specifies object key name filtering rules. For information about key name filtering, see [Configuring event notifications using object key name filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the *Amazon S3 User Guide*.
*/
public val filter: aws.sdk.kotlin.services.s3.model.NotificationConfigurationFilter? = builder.filter
/**
* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.
*/
public val id: kotlin.String? = builder.id
/**
* The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.
*/
public val topicArn: kotlin.String = requireNotNull(builder.topicArn) { "A non-null value must be provided for topicArn" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.s3.model.TopicConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("TopicConfiguration(")
append("events=$events,")
append("filter=$filter,")
append("id=$id,")
append("topicArn=$topicArn")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = events.hashCode()
result = 31 * result + (filter?.hashCode() ?: 0)
result = 31 * result + (id?.hashCode() ?: 0)
result = 31 * result + (topicArn.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 TopicConfiguration
if (events != other.events) return false
if (filter != other.filter) return false
if (id != other.id) return false
if (topicArn != other.topicArn) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.s3.model.TopicConfiguration = Builder(this).apply(block).build()
public class Builder {
/**
* The Amazon S3 bucket event about which to send notifications. For more information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide*.
*/
public var events: List? = null
/**
* Specifies object key name filtering rules. For information about key name filtering, see [Configuring event notifications using object key name filtering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html) in the *Amazon S3 User Guide*.
*/
public var filter: aws.sdk.kotlin.services.s3.model.NotificationConfigurationFilter? = null
/**
* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.
*/
public var id: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.
*/
public var topicArn: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.s3.model.TopicConfiguration) : this() {
this.events = x.events
this.filter = x.filter
this.id = x.id
this.topicArn = x.topicArn
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.s3.model.TopicConfiguration = TopicConfiguration(this)
/**
* construct an [aws.sdk.kotlin.services.s3.model.NotificationConfigurationFilter] inside the given [block]
*/
public fun filter(block: aws.sdk.kotlin.services.s3.model.NotificationConfigurationFilter.Builder.() -> kotlin.Unit) {
this.filter = aws.sdk.kotlin.services.s3.model.NotificationConfigurationFilter.invoke(block)
}
internal fun correctErrors(): Builder {
if (events == null) events = emptyList()
if (topicArn == null) topicArn = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy