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

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

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

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



public class GetBucketWebsiteResponse private constructor(builder: Builder) {
    /**
     * The object key name of the website error document to use for 4XX class errors.
     */
    public val errorDocument: aws.sdk.kotlin.services.s3.model.ErrorDocument? = builder.errorDocument
    /**
     * The name of the index document for the website (for example `index.html`).
     */
    public val indexDocument: aws.sdk.kotlin.services.s3.model.IndexDocument? = builder.indexDocument
    /**
     * Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.
     */
    public val redirectAllRequestsTo: aws.sdk.kotlin.services.s3.model.RedirectAllRequestsTo? = builder.redirectAllRequestsTo
    /**
     * Rules that define when a redirect is applied and the redirect behavior.
     */
    public val routingRules: List? = builder.routingRules

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

    override fun toString(): kotlin.String = buildString {
        append("GetBucketWebsiteResponse(")
        append("errorDocument=$errorDocument,")
        append("indexDocument=$indexDocument,")
        append("redirectAllRequestsTo=$redirectAllRequestsTo,")
        append("routingRules=$routingRules")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = errorDocument?.hashCode() ?: 0
        result = 31 * result + (indexDocument?.hashCode() ?: 0)
        result = 31 * result + (redirectAllRequestsTo?.hashCode() ?: 0)
        result = 31 * result + (routingRules?.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 GetBucketWebsiteResponse

        if (errorDocument != other.errorDocument) return false
        if (indexDocument != other.indexDocument) return false
        if (redirectAllRequestsTo != other.redirectAllRequestsTo) return false
        if (routingRules != other.routingRules) return false

        return true
    }

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

    public class Builder {
        /**
         * The object key name of the website error document to use for 4XX class errors.
         */
        public var errorDocument: aws.sdk.kotlin.services.s3.model.ErrorDocument? = null
        /**
         * The name of the index document for the website (for example `index.html`).
         */
        public var indexDocument: aws.sdk.kotlin.services.s3.model.IndexDocument? = null
        /**
         * Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.
         */
        public var redirectAllRequestsTo: aws.sdk.kotlin.services.s3.model.RedirectAllRequestsTo? = null
        /**
         * Rules that define when a redirect is applied and the redirect behavior.
         */
        public var routingRules: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.s3.model.GetBucketWebsiteResponse) : this() {
            this.errorDocument = x.errorDocument
            this.indexDocument = x.indexDocument
            this.redirectAllRequestsTo = x.redirectAllRequestsTo
            this.routingRules = x.routingRules
        }

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy