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

commonMain.aws.sdk.kotlin.services.codegurusecurity.model.Vulnerability.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

/**
 * Information about a security vulnerability that Amazon CodeGuru Security detected.
 */
public class Vulnerability private constructor(builder: Builder) {
    /**
     * An object that describes the location of the detected security vulnerability in your code.
     */
    public val filePath: aws.sdk.kotlin.services.codegurusecurity.model.FilePath? = builder.filePath
    /**
     * The identifier for the vulnerability.
     */
    public val id: kotlin.String? = builder.id
    /**
     * The number of times the vulnerability appears in your code.
     */
    @Deprecated("This shape is not used.")
    public val itemCount: kotlin.Int? = builder.itemCount
    /**
     * One or more URL addresses that contain details about a vulnerability.
     */
    public val referenceUrls: List? = builder.referenceUrls
    /**
     * One or more vulnerabilities that are related to the vulnerability being described.
     */
    public val relatedVulnerabilities: List? = builder.relatedVulnerabilities

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

    override fun toString(): kotlin.String = buildString {
        append("Vulnerability(")
        append("filePath=$filePath,")
        append("id=$id,")
        append("itemCount=$itemCount,")
        append("referenceUrls=$referenceUrls,")
        append("relatedVulnerabilities=$relatedVulnerabilities")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = filePath?.hashCode() ?: 0
        result = 31 * result + (id?.hashCode() ?: 0)
        result = 31 * result + (itemCount ?: 0)
        result = 31 * result + (referenceUrls?.hashCode() ?: 0)
        result = 31 * result + (relatedVulnerabilities?.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 Vulnerability

        if (filePath != other.filePath) return false
        if (id != other.id) return false
        if (itemCount != other.itemCount) return false
        if (referenceUrls != other.referenceUrls) return false
        if (relatedVulnerabilities != other.relatedVulnerabilities) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An object that describes the location of the detected security vulnerability in your code.
         */
        public var filePath: aws.sdk.kotlin.services.codegurusecurity.model.FilePath? = null
        /**
         * The identifier for the vulnerability.
         */
        public var id: kotlin.String? = null
        /**
         * The number of times the vulnerability appears in your code.
         */
        @Deprecated("This shape is not used.")
        public var itemCount: kotlin.Int? = null
        /**
         * One or more URL addresses that contain details about a vulnerability.
         */
        public var referenceUrls: List? = null
        /**
         * One or more vulnerabilities that are related to the vulnerability being described.
         */
        public var relatedVulnerabilities: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codegurusecurity.model.Vulnerability) : this() {
            this.filePath = x.filePath
            this.id = x.id
            this.itemCount = x.itemCount
            this.referenceUrls = x.referenceUrls
            this.relatedVulnerabilities = x.relatedVulnerabilities
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy