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

commonMain.aws.sdk.kotlin.services.ivs.model.PlaybackRestrictionPolicySummary.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ivs.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Summary information about a PlaybackRestrictionPolicy.
 */
public class PlaybackRestrictionPolicySummary private constructor(builder: Builder) {
    /**
     * A list of country codes that control geoblocking restriction. Allowed values are the officially assigned [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes. Default: All countries (an empty array).
     */
    public val allowedCountries: List = requireNotNull(builder.allowedCountries) { "A non-null value must be provided for allowedCountries" }
    /**
     * A list of origin sites that control CORS restriction. Allowed values are the same as valid values of the Origin header defined at [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin). Default: All origins (an empty array).
     */
    public val allowedOrigins: List = requireNotNull(builder.allowedOrigins) { "A non-null value must be provided for allowedOrigins" }
    /**
     * Playback-restriction-policy ARN
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * Whether channel playback is constrained by origin site. Default: `false`.
     */
    public val enableStrictOriginEnforcement: kotlin.Boolean? = builder.enableStrictOriginEnforcement
    /**
     * Playback-restriction-policy name. The value does not need to be unique.
     */
    public val name: kotlin.String? = builder.name
    /**
     * Tags attached to the resource. Array of 1-50 maps, each of the form `string:string (key:value)`. See [Tagging Amazon Web Services Resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) for more information, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
     */
    public val tags: Map? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("PlaybackRestrictionPolicySummary(")
        append("allowedCountries=$allowedCountries,")
        append("allowedOrigins=$allowedOrigins,")
        append("arn=$arn,")
        append("enableStrictOriginEnforcement=$enableStrictOriginEnforcement,")
        append("name=$name,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = allowedCountries.hashCode()
        result = 31 * result + (allowedOrigins.hashCode())
        result = 31 * result + (arn.hashCode())
        result = 31 * result + (enableStrictOriginEnforcement?.hashCode() ?: 0)
        result = 31 * result + (name?.hashCode() ?: 0)
        result = 31 * result + (tags?.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 PlaybackRestrictionPolicySummary

        if (allowedCountries != other.allowedCountries) return false
        if (allowedOrigins != other.allowedOrigins) return false
        if (arn != other.arn) return false
        if (enableStrictOriginEnforcement != other.enableStrictOriginEnforcement) return false
        if (name != other.name) return false
        if (tags != other.tags) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A list of country codes that control geoblocking restriction. Allowed values are the officially assigned [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes. Default: All countries (an empty array).
         */
        public var allowedCountries: List? = null
        /**
         * A list of origin sites that control CORS restriction. Allowed values are the same as valid values of the Origin header defined at [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin). Default: All origins (an empty array).
         */
        public var allowedOrigins: List? = null
        /**
         * Playback-restriction-policy ARN
         */
        public var arn: kotlin.String? = null
        /**
         * Whether channel playback is constrained by origin site. Default: `false`.
         */
        public var enableStrictOriginEnforcement: kotlin.Boolean? = null
        /**
         * Playback-restriction-policy name. The value does not need to be unique.
         */
        public var name: kotlin.String? = null
        /**
         * Tags attached to the resource. Array of 1-50 maps, each of the form `string:string (key:value)`. See [Tagging Amazon Web Services Resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) for more information, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no service-specific constraints beyond what is documented there.
         */
        public var tags: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ivs.model.PlaybackRestrictionPolicySummary) : this() {
            this.allowedCountries = x.allowedCountries
            this.allowedOrigins = x.allowedOrigins
            this.arn = x.arn
            this.enableStrictOriginEnforcement = x.enableStrictOriginEnforcement
            this.name = x.name
            this.tags = x.tags
        }

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

        internal fun correctErrors(): Builder {
            if (allowedCountries == null) allowedCountries = emptyList()
            if (allowedOrigins == null) allowedOrigins = emptyList()
            if (arn == null) arn = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy