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

commonMain.aws.sdk.kotlin.services.configservice.model.RemediationException.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.configservice.model

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

/**
 * An object that represents the details about the remediation exception. The details include the rule name, an explanation of an exception, the time when the exception will be deleted, the resource ID, and resource type.
 */
public class RemediationException private constructor(builder: Builder) {
    /**
     * The name of the Config rule.
     */
    public val configRuleName: kotlin.String = requireNotNull(builder.configRuleName) { "A non-null value must be provided for configRuleName" }
    /**
     * The time when the remediation exception will be deleted.
     */
    public val expirationTime: aws.smithy.kotlin.runtime.time.Instant? = builder.expirationTime
    /**
     * An explanation of an remediation exception.
     */
    public val message: kotlin.String? = builder.message
    /**
     * The ID of the resource (for example., sg-xxxxxx).
     */
    public val resourceId: kotlin.String = requireNotNull(builder.resourceId) { "A non-null value must be provided for resourceId" }
    /**
     * The type of a resource.
     */
    public val resourceType: kotlin.String = requireNotNull(builder.resourceType) { "A non-null value must be provided for resourceType" }

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

    override fun toString(): kotlin.String = buildString {
        append("RemediationException(")
        append("configRuleName=$configRuleName,")
        append("expirationTime=$expirationTime,")
        append("message=$message,")
        append("resourceId=$resourceId,")
        append("resourceType=$resourceType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = configRuleName.hashCode()
        result = 31 * result + (expirationTime?.hashCode() ?: 0)
        result = 31 * result + (message?.hashCode() ?: 0)
        result = 31 * result + (resourceId.hashCode())
        result = 31 * result + (resourceType.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 RemediationException

        if (configRuleName != other.configRuleName) return false
        if (expirationTime != other.expirationTime) return false
        if (message != other.message) return false
        if (resourceId != other.resourceId) return false
        if (resourceType != other.resourceType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the Config rule.
         */
        public var configRuleName: kotlin.String? = null
        /**
         * The time when the remediation exception will be deleted.
         */
        public var expirationTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * An explanation of an remediation exception.
         */
        public var message: kotlin.String? = null
        /**
         * The ID of the resource (for example., sg-xxxxxx).
         */
        public var resourceId: kotlin.String? = null
        /**
         * The type of a resource.
         */
        public var resourceType: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.RemediationException) : this() {
            this.configRuleName = x.configRuleName
            this.expirationTime = x.expirationTime
            this.message = x.message
            this.resourceId = x.resourceId
            this.resourceType = x.resourceType
        }

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

        internal fun correctErrors(): Builder {
            if (configRuleName == null) configRuleName = ""
            if (resourceId == null) resourceId = ""
            if (resourceType == null) resourceType = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy