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

commonMain.aws.sdk.kotlin.services.securityhub.model.AwsS3BucketWebsiteConfiguration.kt Maven / Gradle / Ivy

There is a newer version: 1.3.35
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.securityhub.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Website parameters for the S3 bucket.
 */
public class AwsS3BucketWebsiteConfiguration private constructor(builder: Builder) {
    /**
     * The name of the error document for the website.
     */
    public val errorDocument: kotlin.String? = builder.errorDocument
    /**
     * The name of the index document for the website.
     */
    public val indexDocumentSuffix: kotlin.String? = builder.indexDocumentSuffix
    /**
     * The redirect behavior for requests to the website.
     */
    public val redirectAllRequestsTo: aws.sdk.kotlin.services.securityhub.model.AwsS3BucketWebsiteConfigurationRedirectTo? = builder.redirectAllRequestsTo
    /**
     * The rules for applying redirects for requests to the website.
     */
    public val routingRules: List? = builder.routingRules

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

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

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

        if (errorDocument != other.errorDocument) return false
        if (indexDocumentSuffix != other.indexDocumentSuffix) 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.securityhub.model.AwsS3BucketWebsiteConfiguration = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The name of the error document for the website.
         */
        public var errorDocument: kotlin.String? = null
        /**
         * The name of the index document for the website.
         */
        public var indexDocumentSuffix: kotlin.String? = null
        /**
         * The redirect behavior for requests to the website.
         */
        public var redirectAllRequestsTo: aws.sdk.kotlin.services.securityhub.model.AwsS3BucketWebsiteConfigurationRedirectTo? = null
        /**
         * The rules for applying redirects for requests to the website.
         */
        public var routingRules: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.securityhub.model.AwsS3BucketWebsiteConfiguration) : this() {
            this.errorDocument = x.errorDocument
            this.indexDocumentSuffix = x.indexDocumentSuffix
            this.redirectAllRequestsTo = x.redirectAllRequestsTo
            this.routingRules = x.routingRules
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy