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

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

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

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



/**
 * The error information.
 */
public class ErrorDocument private constructor(builder: Builder) {
    /**
     * The object key name to use when a 4XX class error occurs.
     *
     * Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [ XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
     */
    public val key: kotlin.String = requireNotNull(builder.key) { "A non-null value must be provided for key" }

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

    override fun toString(): kotlin.String = buildString {
        append("ErrorDocument(")
        append("key=$key")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = key.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 ErrorDocument

        if (key != other.key) return false

        return true
    }

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

    public class Builder {
        /**
         * The object key name to use when a 4XX class error occurs.
         *
         * Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see [ XML related object key constraints](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints).
         */
        public var key: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.s3.model.ErrorDocument) : this() {
            this.key = x.key
        }

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

        internal fun correctErrors(): Builder {
            if (key == null) key = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy