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

commonMain.aws.sdk.kotlin.services.devopsguru.model.AnomalyReportedTimeRange.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.devopsguru.model

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

/**
 * A time range that specifies when DevOps Guru opens and then closes an anomaly. This is different from `AnomalyTimeRange`, which specifies the time range when DevOps Guru actually observes the anomalous behavior.
 */
public class AnomalyReportedTimeRange private constructor(builder: Builder) {
    /**
     * The time when an anomaly is closed.
     */
    public val closeTime: aws.smithy.kotlin.runtime.time.Instant? = builder.closeTime
    /**
     * The time when an anomaly is opened.
     */
    public val openTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.openTime) { "A non-null value must be provided for openTime" }

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

    override fun toString(): kotlin.String = buildString {
        append("AnomalyReportedTimeRange(")
        append("closeTime=$closeTime,")
        append("openTime=$openTime")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = closeTime?.hashCode() ?: 0
        result = 31 * result + (openTime.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 AnomalyReportedTimeRange

        if (closeTime != other.closeTime) return false
        if (openTime != other.openTime) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The time when an anomaly is closed.
         */
        public var closeTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The time when an anomaly is opened.
         */
        public var openTime: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.devopsguru.model.AnomalyReportedTimeRange) : this() {
            this.closeTime = x.closeTime
            this.openTime = x.openTime
        }

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

        internal fun correctErrors(): Builder {
            if (openTime == null) openTime = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy