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

commonMain.aws.sdk.kotlin.services.mediapackage.model.DashEncryption.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.mediapackage.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A Dynamic Adaptive Streaming over HTTP (DASH) encryption configuration.
 */
public class DashEncryption private constructor(builder: Builder) {
    /**
     * Time (in seconds) between each encryption key rotation.
     */
    public val keyRotationIntervalSeconds: kotlin.Int? = builder.keyRotationIntervalSeconds
    /**
     * A configuration for accessing an external Secure Packager and Encoder Key Exchange (SPEKE) service that will provide encryption keys.
     */
    public val spekeKeyProvider: aws.sdk.kotlin.services.mediapackage.model.SpekeKeyProvider? = builder.spekeKeyProvider

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

    override fun toString(): kotlin.String = buildString {
        append("DashEncryption(")
        append("keyRotationIntervalSeconds=$keyRotationIntervalSeconds,")
        append("spekeKeyProvider=$spekeKeyProvider")
        append(")")
    }

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

        if (keyRotationIntervalSeconds != other.keyRotationIntervalSeconds) return false
        if (spekeKeyProvider != other.spekeKeyProvider) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Time (in seconds) between each encryption key rotation.
         */
        public var keyRotationIntervalSeconds: kotlin.Int? = null
        /**
         * A configuration for accessing an external Secure Packager and Encoder Key Exchange (SPEKE) service that will provide encryption keys.
         */
        public var spekeKeyProvider: aws.sdk.kotlin.services.mediapackage.model.SpekeKeyProvider? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.mediapackage.model.DashEncryption) : this() {
            this.keyRotationIntervalSeconds = x.keyRotationIntervalSeconds
            this.spekeKeyProvider = x.spekeKeyProvider
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy