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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant

public class GetScanResponse private constructor(builder: Builder) {
    /**
     * The type of analysis CodeGuru Security performed in the scan, either `Security` or `All`. The `Security` type only generates findings related to security. The `All` type generates both security findings and quality findings.
     */
    public val analysisType: aws.sdk.kotlin.services.codegurusecurity.model.AnalysisType = requireNotNull(builder.analysisType) { "A non-null value must be provided for analysisType" }
    /**
     * The time the scan was created.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
    /**
     * Details about the error that causes a scan to fail to be retrieved.
     */
    public val errorMessage: kotlin.String? = builder.errorMessage
    /**
     * The number of times a scan has been re-run on a revised resource.
     */
    public val numberOfRevisions: kotlin.Long? = builder.numberOfRevisions
    /**
     * UUID that identifies the individual scan run.
     */
    public val runId: kotlin.String = requireNotNull(builder.runId) { "A non-null value must be provided for runId" }
    /**
     * The name of the scan.
     */
    public val scanName: kotlin.String = requireNotNull(builder.scanName) { "A non-null value must be provided for scanName" }
    /**
     * The ARN for the scan name.
     */
    public val scanNameArn: kotlin.String? = builder.scanNameArn
    /**
     * The current state of the scan. Returns either `InProgress`, `Successful`, or `Failed`.
     */
    public val scanState: aws.sdk.kotlin.services.codegurusecurity.model.ScanState = requireNotNull(builder.scanState) { "A non-null value must be provided for scanState" }
    /**
     * The time when the scan was last updated. Only available for `STANDARD` scan types.
     */
    public val updatedAt: aws.smithy.kotlin.runtime.time.Instant? = builder.updatedAt

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

    override fun toString(): kotlin.String = buildString {
        append("GetScanResponse(")
        append("analysisType=$analysisType,")
        append("createdAt=$createdAt,")
        append("errorMessage=$errorMessage,")
        append("numberOfRevisions=$numberOfRevisions,")
        append("runId=$runId,")
        append("scanName=$scanName,")
        append("scanNameArn=$scanNameArn,")
        append("scanState=$scanState,")
        append("updatedAt=$updatedAt")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = analysisType.hashCode()
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (errorMessage?.hashCode() ?: 0)
        result = 31 * result + (numberOfRevisions?.hashCode() ?: 0)
        result = 31 * result + (runId.hashCode())
        result = 31 * result + (scanName.hashCode())
        result = 31 * result + (scanNameArn?.hashCode() ?: 0)
        result = 31 * result + (scanState.hashCode())
        result = 31 * result + (updatedAt?.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 GetScanResponse

        if (analysisType != other.analysisType) return false
        if (createdAt != other.createdAt) return false
        if (errorMessage != other.errorMessage) return false
        if (numberOfRevisions != other.numberOfRevisions) return false
        if (runId != other.runId) return false
        if (scanName != other.scanName) return false
        if (scanNameArn != other.scanNameArn) return false
        if (scanState != other.scanState) return false
        if (updatedAt != other.updatedAt) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The type of analysis CodeGuru Security performed in the scan, either `Security` or `All`. The `Security` type only generates findings related to security. The `All` type generates both security findings and quality findings.
         */
        public var analysisType: aws.sdk.kotlin.services.codegurusecurity.model.AnalysisType? = null
        /**
         * The time the scan was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Details about the error that causes a scan to fail to be retrieved.
         */
        public var errorMessage: kotlin.String? = null
        /**
         * The number of times a scan has been re-run on a revised resource.
         */
        public var numberOfRevisions: kotlin.Long? = null
        /**
         * UUID that identifies the individual scan run.
         */
        public var runId: kotlin.String? = null
        /**
         * The name of the scan.
         */
        public var scanName: kotlin.String? = null
        /**
         * The ARN for the scan name.
         */
        public var scanNameArn: kotlin.String? = null
        /**
         * The current state of the scan. Returns either `InProgress`, `Successful`, or `Failed`.
         */
        public var scanState: aws.sdk.kotlin.services.codegurusecurity.model.ScanState? = null
        /**
         * The time when the scan was last updated. Only available for `STANDARD` scan types.
         */
        public var updatedAt: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codegurusecurity.model.GetScanResponse) : this() {
            this.analysisType = x.analysisType
            this.createdAt = x.createdAt
            this.errorMessage = x.errorMessage
            this.numberOfRevisions = x.numberOfRevisions
            this.runId = x.runId
            this.scanName = x.scanName
            this.scanNameArn = x.scanNameArn
            this.scanState = x.scanState
            this.updatedAt = x.updatedAt
        }

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

        internal fun correctErrors(): Builder {
            if (analysisType == null) analysisType = AnalysisType.SdkUnknown("no value provided")
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (runId == null) runId = ""
            if (scanName == null) scanName = ""
            if (scanState == null) scanState = ScanState.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy