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

commonMain.aws.sdk.kotlin.services.s3.model.TargetObjectKeyFormat.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.s3.model



/**
 * Amazon S3 key format for log objects. Only one format, PartitionedPrefix or SimplePrefix, is allowed.
 */
public class TargetObjectKeyFormat private constructor(builder: Builder) {
    /**
     * Partitioned S3 key for log objects.
     */
    public val partitionedPrefix: aws.sdk.kotlin.services.s3.model.PartitionedPrefix? = builder.partitionedPrefix
    /**
     * To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}.
     */
    public val simplePrefix: aws.sdk.kotlin.services.s3.model.SimplePrefix? = builder.simplePrefix

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

    override fun toString(): kotlin.String = buildString {
        append("TargetObjectKeyFormat(")
        append("partitionedPrefix=$partitionedPrefix,")
        append("simplePrefix=$simplePrefix")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = partitionedPrefix?.hashCode() ?: 0
        result = 31 * result + (simplePrefix?.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 TargetObjectKeyFormat

        if (partitionedPrefix != other.partitionedPrefix) return false
        if (simplePrefix != other.simplePrefix) return false

        return true
    }

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

    public class Builder {
        /**
         * Partitioned S3 key for log objects.
         */
        public var partitionedPrefix: aws.sdk.kotlin.services.s3.model.PartitionedPrefix? = null
        /**
         * To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}.
         */
        public var simplePrefix: aws.sdk.kotlin.services.s3.model.SimplePrefix? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.s3.model.TargetObjectKeyFormat) : this() {
            this.partitionedPrefix = x.partitionedPrefix
            this.simplePrefix = x.simplePrefix
        }

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy