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

commonMain.aws.sdk.kotlin.services.cloudfront.model.ResponseHeadersPolicyReferrerPolicy.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudfront.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Determines whether CloudFront includes the `Referrer-Policy` HTTP response header and the header's value.
 *
 * For more information about the `Referrer-Policy` HTTP response header, see [Referrer-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) in the MDN Web Docs.
 */
public class ResponseHeadersPolicyReferrerPolicy private constructor(builder: Builder) {
    /**
     * A Boolean that determines whether CloudFront overrides the `Referrer-Policy` HTTP response header received from the origin with the one specified in this response headers policy.
     */
    public val override: kotlin.Boolean = requireNotNull(builder.override) { "A non-null value must be provided for override" }
    /**
     * The value of the `Referrer-Policy` HTTP response header. Valid values are:
     * + `no-referrer`
     * + `no-referrer-when-downgrade`
     * + `origin`
     * + `origin-when-cross-origin`
     * + `same-origin`
     * + `strict-origin`
     * + `strict-origin-when-cross-origin`
     * + `unsafe-url`
     *
     * For more information about these values, see [Referrer-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) in the MDN Web Docs.
     */
    public val referrerPolicy: aws.sdk.kotlin.services.cloudfront.model.ReferrerPolicyList = requireNotNull(builder.referrerPolicy) { "A non-null value must be provided for referrerPolicy" }

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

    override fun toString(): kotlin.String = buildString {
        append("ResponseHeadersPolicyReferrerPolicy(")
        append("override=$override,")
        append("referrerPolicy=$referrerPolicy")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = override.hashCode()
        result = 31 * result + (referrerPolicy.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 ResponseHeadersPolicyReferrerPolicy

        if (override != other.override) return false
        if (referrerPolicy != other.referrerPolicy) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A Boolean that determines whether CloudFront overrides the `Referrer-Policy` HTTP response header received from the origin with the one specified in this response headers policy.
         */
        public var override: kotlin.Boolean? = null
        /**
         * The value of the `Referrer-Policy` HTTP response header. Valid values are:
         * + `no-referrer`
         * + `no-referrer-when-downgrade`
         * + `origin`
         * + `origin-when-cross-origin`
         * + `same-origin`
         * + `strict-origin`
         * + `strict-origin-when-cross-origin`
         * + `unsafe-url`
         *
         * For more information about these values, see [Referrer-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) in the MDN Web Docs.
         */
        public var referrerPolicy: aws.sdk.kotlin.services.cloudfront.model.ReferrerPolicyList? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudfront.model.ResponseHeadersPolicyReferrerPolicy) : this() {
            this.override = x.override
            this.referrerPolicy = x.referrerPolicy
        }

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

        internal fun correctErrors(): Builder {
            if (override == null) override = false
            if (referrerPolicy == null) referrerPolicy = ReferrerPolicyList.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy