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

commonMain.aws.sdk.kotlin.services.kms.model.VerifyMacResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.kms.model

import aws.smithy.kotlin.runtime.SdkDsl

public class VerifyMacResponse private constructor(builder: Builder) {
    /**
     * The HMAC KMS key used in the verification.
     */
    public val keyId: kotlin.String? = builder.keyId
    /**
     * The MAC algorithm used in the verification.
     */
    public val macAlgorithm: aws.sdk.kotlin.services.kms.model.MacAlgorithmSpec? = builder.macAlgorithm
    /**
     * A Boolean value that indicates whether the HMAC was verified. A value of `True` indicates that the HMAC (`Mac`) was generated with the specified `Message`, HMAC KMS key (`KeyID`) and `MacAlgorithm.`.
     *
     * If the HMAC is not verified, the `VerifyMac` operation fails with a `KMSInvalidMacException` exception. This exception indicates that one or more of the inputs changed since the HMAC was computed.
     */
    public val macValid: kotlin.Boolean = builder.macValid

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

    override fun toString(): kotlin.String = buildString {
        append("VerifyMacResponse(")
        append("keyId=$keyId,")
        append("macAlgorithm=$macAlgorithm,")
        append("macValid=$macValid")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = keyId?.hashCode() ?: 0
        result = 31 * result + (macAlgorithm?.hashCode() ?: 0)
        result = 31 * result + (macValid.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 VerifyMacResponse

        if (keyId != other.keyId) return false
        if (macAlgorithm != other.macAlgorithm) return false
        if (macValid != other.macValid) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The HMAC KMS key used in the verification.
         */
        public var keyId: kotlin.String? = null
        /**
         * The MAC algorithm used in the verification.
         */
        public var macAlgorithm: aws.sdk.kotlin.services.kms.model.MacAlgorithmSpec? = null
        /**
         * A Boolean value that indicates whether the HMAC was verified. A value of `True` indicates that the HMAC (`Mac`) was generated with the specified `Message`, HMAC KMS key (`KeyID`) and `MacAlgorithm.`.
         *
         * If the HMAC is not verified, the `VerifyMac` operation fails with a `KMSInvalidMacException` exception. This exception indicates that one or more of the inputs changed since the HMAC was computed.
         */
        public var macValid: kotlin.Boolean = false

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.kms.model.VerifyMacResponse) : this() {
            this.keyId = x.keyId
            this.macAlgorithm = x.macAlgorithm
            this.macValid = x.macValid
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy