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

commonMain.aws.sdk.kotlin.services.codegurusecurity.model.BatchGetFindingsError.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.codegurusecurity.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains information about the error that caused a finding to fail to be retrieved.
 */
public class BatchGetFindingsError private constructor(builder: Builder) {
    /**
     * A code associated with the type of error.
     */
    public val errorCode: aws.sdk.kotlin.services.codegurusecurity.model.ErrorCode = requireNotNull(builder.errorCode) { "A non-null value must be provided for errorCode" }
    /**
     * The finding ID of the finding that was not fetched.
     */
    public val findingId: kotlin.String = requireNotNull(builder.findingId) { "A non-null value must be provided for findingId" }
    /**
     * Describes the error.
     */
    public val message: kotlin.String = requireNotNull(builder.message) { "A non-null value must be provided for message" }
    /**
     * The name of the scan that generated the finding.
     */
    public val scanName: kotlin.String = requireNotNull(builder.scanName) { "A non-null value must be provided for scanName" }

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

    override fun toString(): kotlin.String = buildString {
        append("BatchGetFindingsError(")
        append("errorCode=$errorCode,")
        append("findingId=$findingId,")
        append("message=$message,")
        append("scanName=$scanName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = errorCode.hashCode()
        result = 31 * result + (findingId.hashCode())
        result = 31 * result + (message.hashCode())
        result = 31 * result + (scanName.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 BatchGetFindingsError

        if (errorCode != other.errorCode) return false
        if (findingId != other.findingId) return false
        if (message != other.message) return false
        if (scanName != other.scanName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A code associated with the type of error.
         */
        public var errorCode: aws.sdk.kotlin.services.codegurusecurity.model.ErrorCode? = null
        /**
         * The finding ID of the finding that was not fetched.
         */
        public var findingId: kotlin.String? = null
        /**
         * Describes the error.
         */
        public var message: kotlin.String? = null
        /**
         * The name of the scan that generated the finding.
         */
        public var scanName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codegurusecurity.model.BatchGetFindingsError) : this() {
            this.errorCode = x.errorCode
            this.findingId = x.findingId
            this.message = x.message
            this.scanName = x.scanName
        }

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

        internal fun correctErrors(): Builder {
            if (errorCode == null) errorCode = ErrorCode.SdkUnknown("no value provided")
            if (findingId == null) findingId = ""
            if (message == null) message = ""
            if (scanName == null) scanName = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy