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

commonMain.aws.sdk.kotlin.services.signer.model.EncryptionAlgorithmOptions.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.signer.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The encryption algorithm options that are available to a code-signing job.
 */
public class EncryptionAlgorithmOptions private constructor(builder: Builder) {
    /**
     * The set of accepted encryption algorithms that are allowed in a code-signing job.
     */
    public val allowedValues: List = requireNotNull(builder.allowedValues) { "A non-null value must be provided for allowedValues" }
    /**
     * The default encryption algorithm that is used by a code-signing job.
     */
    public val defaultValue: aws.sdk.kotlin.services.signer.model.EncryptionAlgorithm = requireNotNull(builder.defaultValue) { "A non-null value must be provided for defaultValue" }

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

    override fun toString(): kotlin.String = buildString {
        append("EncryptionAlgorithmOptions(")
        append("allowedValues=$allowedValues,")
        append("defaultValue=$defaultValue")
        append(")")
    }

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

        if (allowedValues != other.allowedValues) return false
        if (defaultValue != other.defaultValue) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The set of accepted encryption algorithms that are allowed in a code-signing job.
         */
        public var allowedValues: List? = null
        /**
         * The default encryption algorithm that is used by a code-signing job.
         */
        public var defaultValue: aws.sdk.kotlin.services.signer.model.EncryptionAlgorithm? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.signer.model.EncryptionAlgorithmOptions) : this() {
            this.allowedValues = x.allowedValues
            this.defaultValue = x.defaultValue
        }

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

        internal fun correctErrors(): Builder {
            if (allowedValues == null) allowedValues = emptyList()
            if (defaultValue == null) defaultValue = EncryptionAlgorithm.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy