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

commonMain.aws.sdk.kotlin.services.iotfleetwise.model.TimeBasedCollectionScheme.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotfleetwise.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Information about a collection scheme that uses a time period to decide how often to collect data.
 */
public class TimeBasedCollectionScheme private constructor(builder: Builder) {
    /**
     * The time period (in milliseconds) to decide how often to collect data. For example, if the time period is `60000`, the Edge Agent software collects data once every minute.
     */
    public val periodMs: kotlin.Long = requireNotNull(builder.periodMs) { "A non-null value must be provided for periodMs" }

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

    override fun toString(): kotlin.String = buildString {
        append("TimeBasedCollectionScheme(")
        append("periodMs=$periodMs")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = periodMs.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 TimeBasedCollectionScheme

        if (periodMs != other.periodMs) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The time period (in milliseconds) to decide how often to collect data. For example, if the time period is `60000`, the Edge Agent software collects data once every minute.
         */
        public var periodMs: kotlin.Long? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotfleetwise.model.TimeBasedCollectionScheme) : this() {
            this.periodMs = x.periodMs
        }

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

        internal fun correctErrors(): Builder {
            if (periodMs == null) periodMs = 0L
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy