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

commonMain.aws.sdk.kotlin.services.voiceid.model.KnownFraudsterRisk.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.voiceid.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains details produced as a result of performing known fraudster risk analysis on a speaker.
 */
public class KnownFraudsterRisk private constructor(builder: Builder) {
    /**
     * The identifier of the fraudster that is the closest match to the speaker. If there are no fraudsters registered in a given domain, or if there are no fraudsters with a non-zero RiskScore, this value is `null`.
     */
    public val generatedFraudsterId: kotlin.String? = builder.generatedFraudsterId
    /**
     * The score indicating the likelihood the speaker is a known fraudster.
     */
    public val riskScore: kotlin.Int = requireNotNull(builder.riskScore) { "A non-null value must be provided for riskScore" }

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

    override fun toString(): kotlin.String = buildString {
        append("KnownFraudsterRisk(")
        append("generatedFraudsterId=$generatedFraudsterId,")
        append("riskScore=$riskScore")
        append(")")
    }

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

        if (generatedFraudsterId != other.generatedFraudsterId) return false
        if (riskScore != other.riskScore) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The identifier of the fraudster that is the closest match to the speaker. If there are no fraudsters registered in a given domain, or if there are no fraudsters with a non-zero RiskScore, this value is `null`.
         */
        public var generatedFraudsterId: kotlin.String? = null
        /**
         * The score indicating the likelihood the speaker is a known fraudster.
         */
        public var riskScore: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.voiceid.model.KnownFraudsterRisk) : this() {
            this.generatedFraudsterId = x.generatedFraudsterId
            this.riskScore = x.riskScore
        }

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

        internal fun correctErrors(): Builder {
            if (riskScore == null) riskScore = 0
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy