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

commonMain.aws.sdk.kotlin.services.securityhub.model.Resource.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.securityhub.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A resource related to a finding.
 */
public class Resource private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the application that is related to a finding.
     */
    public val applicationArn: kotlin.String? = builder.applicationArn
    /**
     * The name of the application that is related to a finding.
     */
    public val applicationName: kotlin.String? = builder.applicationName
    /**
     * Contains information about sensitive data that was detected on the resource.
     */
    public val dataClassification: aws.sdk.kotlin.services.securityhub.model.DataClassificationDetails? = builder.dataClassification
    /**
     * Additional details about the resource related to a finding.
     */
    public val details: aws.sdk.kotlin.services.securityhub.model.ResourceDetails? = builder.details
    /**
     * The canonical identifier for the given resource type.
     */
    public val id: kotlin.String? = builder.id
    /**
     * The canonical Amazon Web Services partition name that the Region is assigned to.
     */
    public val partition: aws.sdk.kotlin.services.securityhub.model.Partition? = builder.partition
    /**
     * The canonical Amazon Web Services external Region name where this resource is located.
     *
     * Length Constraints: Minimum length of 1. Maximum length of 16.
     */
    public val region: kotlin.String? = builder.region
    /**
     * Identifies the role of the resource in the finding. A resource is either the actor or target of the finding activity,
     */
    public val resourceRole: kotlin.String? = builder.resourceRole
    /**
     * A list of Amazon Web Services tags associated with a resource at the time the finding was processed. Tags must follow [Amazon Web Services tag naming limits and requirements](https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions).
     */
    public val tags: Map? = builder.tags
    /**
     * The type of the resource that details are provided for. If possible, set `Type` to one of the supported resource types. For example, if the resource is an EC2 instance, then set `Type` to `AwsEc2Instance`.
     *
     * If the resource does not match any of the provided types, then set `Type` to `Other`.
     *
     * Length Constraints: Minimum length of 1. Maximum length of 256.
     */
    public val type: kotlin.String? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("Resource(")
        append("applicationArn=$applicationArn,")
        append("applicationName=$applicationName,")
        append("dataClassification=$dataClassification,")
        append("details=$details,")
        append("id=$id,")
        append("partition=$partition,")
        append("region=$region,")
        append("resourceRole=$resourceRole,")
        append("tags=$tags,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = applicationArn?.hashCode() ?: 0
        result = 31 * result + (applicationName?.hashCode() ?: 0)
        result = 31 * result + (dataClassification?.hashCode() ?: 0)
        result = 31 * result + (details?.hashCode() ?: 0)
        result = 31 * result + (id?.hashCode() ?: 0)
        result = 31 * result + (partition?.hashCode() ?: 0)
        result = 31 * result + (region?.hashCode() ?: 0)
        result = 31 * result + (resourceRole?.hashCode() ?: 0)
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (type?.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 Resource

        if (applicationArn != other.applicationArn) return false
        if (applicationName != other.applicationName) return false
        if (dataClassification != other.dataClassification) return false
        if (details != other.details) return false
        if (id != other.id) return false
        if (partition != other.partition) return false
        if (region != other.region) return false
        if (resourceRole != other.resourceRole) return false
        if (tags != other.tags) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the application that is related to a finding.
         */
        public var applicationArn: kotlin.String? = null
        /**
         * The name of the application that is related to a finding.
         */
        public var applicationName: kotlin.String? = null
        /**
         * Contains information about sensitive data that was detected on the resource.
         */
        public var dataClassification: aws.sdk.kotlin.services.securityhub.model.DataClassificationDetails? = null
        /**
         * Additional details about the resource related to a finding.
         */
        public var details: aws.sdk.kotlin.services.securityhub.model.ResourceDetails? = null
        /**
         * The canonical identifier for the given resource type.
         */
        public var id: kotlin.String? = null
        /**
         * The canonical Amazon Web Services partition name that the Region is assigned to.
         */
        public var partition: aws.sdk.kotlin.services.securityhub.model.Partition? = null
        /**
         * The canonical Amazon Web Services external Region name where this resource is located.
         *
         * Length Constraints: Minimum length of 1. Maximum length of 16.
         */
        public var region: kotlin.String? = null
        /**
         * Identifies the role of the resource in the finding. A resource is either the actor or target of the finding activity,
         */
        public var resourceRole: kotlin.String? = null
        /**
         * A list of Amazon Web Services tags associated with a resource at the time the finding was processed. Tags must follow [Amazon Web Services tag naming limits and requirements](https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html#tag-conventions).
         */
        public var tags: Map? = null
        /**
         * The type of the resource that details are provided for. If possible, set `Type` to one of the supported resource types. For example, if the resource is an EC2 instance, then set `Type` to `AwsEc2Instance`.
         *
         * If the resource does not match any of the provided types, then set `Type` to `Other`.
         *
         * Length Constraints: Minimum length of 1. Maximum length of 256.
         */
        public var type: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.securityhub.model.Resource) : this() {
            this.applicationArn = x.applicationArn
            this.applicationName = x.applicationName
            this.dataClassification = x.dataClassification
            this.details = x.details
            this.id = x.id
            this.partition = x.partition
            this.region = x.region
            this.resourceRole = x.resourceRole
            this.tags = x.tags
            this.type = x.type
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy