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

commonMain.aws.sdk.kotlin.services.mediapackage.model.SpekeKeyProvider.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 configuration for accessing an external Secure Packager and Encoder Key Exchange (SPEKE) service that will provide encryption keys.
 */
public class SpekeKeyProvider private constructor(builder: Builder) {
    /**
     * An Amazon Resource Name (ARN) of a Certificate Manager certificate that MediaPackage will use for enforcing secure end-to-end data transfer with the key provider service.
     */
    public val certificateArn: kotlin.String? = builder.certificateArn
    /**
     * Use encryptionContractConfiguration to configure one or more content encryption keys for your endpoints that use SPEKE 2.0. The encryption contract defines which content keys are used to encrypt the audio and video tracks in your stream. To configure the encryption contract, specify which audio and video encryption presets to use. Note the following considerations when using encryptionContractConfiguration: encryptionContractConfiguration can be used for DASH or CMAF endpoints that use SPEKE 2.0. SPEKE 2.0 relies on the CPIX 2.3 specification. You must disable key rotation for this endpoint by setting keyRotationIntervalSeconds to 0.
     */
    public val encryptionContractConfiguration: aws.sdk.kotlin.services.mediapackage.model.EncryptionContractConfiguration? = builder.encryptionContractConfiguration
    /**
     * The resource ID to include in key requests.
     */
    public val resourceId: kotlin.String? = builder.resourceId
    /**
     * An Amazon Resource Name (ARN) of an IAM role that AWS Elemental MediaPackage will assume when accessing the key provider service.
     */
    public val roleArn: kotlin.String? = builder.roleArn
    /**
     * The system IDs to include in key requests.
     */
    public val systemIds: List? = builder.systemIds
    /**
     * The URL of the external key provider service.
     */
    public val url: kotlin.String? = builder.url

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

    override fun toString(): kotlin.String = buildString {
        append("SpekeKeyProvider(")
        append("certificateArn=$certificateArn,")
        append("encryptionContractConfiguration=$encryptionContractConfiguration,")
        append("resourceId=$resourceId,")
        append("roleArn=$roleArn,")
        append("systemIds=$systemIds,")
        append("url=$url")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = certificateArn?.hashCode() ?: 0
        result = 31 * result + (encryptionContractConfiguration?.hashCode() ?: 0)
        result = 31 * result + (resourceId?.hashCode() ?: 0)
        result = 31 * result + (roleArn?.hashCode() ?: 0)
        result = 31 * result + (systemIds?.hashCode() ?: 0)
        result = 31 * result + (url?.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 SpekeKeyProvider

        if (certificateArn != other.certificateArn) return false
        if (encryptionContractConfiguration != other.encryptionContractConfiguration) return false
        if (resourceId != other.resourceId) return false
        if (roleArn != other.roleArn) return false
        if (systemIds != other.systemIds) return false
        if (url != other.url) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An Amazon Resource Name (ARN) of a Certificate Manager certificate that MediaPackage will use for enforcing secure end-to-end data transfer with the key provider service.
         */
        public var certificateArn: kotlin.String? = null
        /**
         * Use encryptionContractConfiguration to configure one or more content encryption keys for your endpoints that use SPEKE 2.0. The encryption contract defines which content keys are used to encrypt the audio and video tracks in your stream. To configure the encryption contract, specify which audio and video encryption presets to use. Note the following considerations when using encryptionContractConfiguration: encryptionContractConfiguration can be used for DASH or CMAF endpoints that use SPEKE 2.0. SPEKE 2.0 relies on the CPIX 2.3 specification. You must disable key rotation for this endpoint by setting keyRotationIntervalSeconds to 0.
         */
        public var encryptionContractConfiguration: aws.sdk.kotlin.services.mediapackage.model.EncryptionContractConfiguration? = null
        /**
         * The resource ID to include in key requests.
         */
        public var resourceId: kotlin.String? = null
        /**
         * An Amazon Resource Name (ARN) of an IAM role that AWS Elemental MediaPackage will assume when accessing the key provider service.
         */
        public var roleArn: kotlin.String? = null
        /**
         * The system IDs to include in key requests.
         */
        public var systemIds: List? = null
        /**
         * The URL of the external key provider service.
         */
        public var url: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.mediapackage.model.SpekeKeyProvider) : this() {
            this.certificateArn = x.certificateArn
            this.encryptionContractConfiguration = x.encryptionContractConfiguration
            this.resourceId = x.resourceId
            this.roleArn = x.roleArn
            this.systemIds = x.systemIds
            this.url = x.url
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy