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

commonMain.aws.sdk.kotlin.services.deadline.model.Statistics.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.deadline.model

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

/**
 * A list of statistics for a session.
 */
public class Statistics private constructor(builder: Builder) {
    /**
     * The end time for the aggregation.
     */
    public val aggregationEndTime: aws.smithy.kotlin.runtime.time.Instant? = builder.aggregationEndTime
    /**
     * The start time for the aggregation.
     */
    public val aggregationStartTime: aws.smithy.kotlin.runtime.time.Instant? = builder.aggregationStartTime
    /**
     * How the statistics should appear in USD. Options include: minimum, maximum, average or sum.
     */
    public val costInUsd: aws.sdk.kotlin.services.deadline.model.Stats? = builder.costInUsd
    /**
     * The number of instances in a list of statistics.
     */
    public val count: kotlin.Int = requireNotNull(builder.count) { "A non-null value must be provided for count" }
    /**
     * The fleet ID.
     */
    public val fleetId: kotlin.String? = builder.fleetId
    /**
     * The type of instance.
     */
    public val instanceType: kotlin.String? = builder.instanceType
    /**
     * The job ID.
     */
    public val jobId: kotlin.String? = builder.jobId
    /**
     * The job name.
     */
    public val jobName: kotlin.String? = builder.jobName
    /**
     * The licensed product.
     */
    public val licenseProduct: kotlin.String? = builder.licenseProduct
    /**
     * The queue ID.
     */
    public val queueId: kotlin.String? = builder.queueId
    /**
     * The total aggregated runtime.
     */
    public val runtimeInSeconds: aws.sdk.kotlin.services.deadline.model.Stats? = builder.runtimeInSeconds
    /**
     * The type of usage for the statistics.
     */
    public val usageType: aws.sdk.kotlin.services.deadline.model.UsageType? = builder.usageType
    /**
     * The user ID.
     */
    public val userId: kotlin.String? = builder.userId

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

    override fun toString(): kotlin.String = buildString {
        append("Statistics(")
        append("aggregationEndTime=$aggregationEndTime,")
        append("aggregationStartTime=$aggregationStartTime,")
        append("costInUsd=$costInUsd,")
        append("count=$count,")
        append("fleetId=$fleetId,")
        append("instanceType=$instanceType,")
        append("jobId=$jobId,")
        append("jobName=$jobName,")
        append("licenseProduct=$licenseProduct,")
        append("queueId=$queueId,")
        append("runtimeInSeconds=$runtimeInSeconds,")
        append("usageType=$usageType,")
        append("userId=$userId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = aggregationEndTime?.hashCode() ?: 0
        result = 31 * result + (aggregationStartTime?.hashCode() ?: 0)
        result = 31 * result + (costInUsd?.hashCode() ?: 0)
        result = 31 * result + (count)
        result = 31 * result + (fleetId?.hashCode() ?: 0)
        result = 31 * result + (instanceType?.hashCode() ?: 0)
        result = 31 * result + (jobId?.hashCode() ?: 0)
        result = 31 * result + (jobName?.hashCode() ?: 0)
        result = 31 * result + (licenseProduct?.hashCode() ?: 0)
        result = 31 * result + (queueId?.hashCode() ?: 0)
        result = 31 * result + (runtimeInSeconds?.hashCode() ?: 0)
        result = 31 * result + (usageType?.hashCode() ?: 0)
        result = 31 * result + (userId?.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 Statistics

        if (aggregationEndTime != other.aggregationEndTime) return false
        if (aggregationStartTime != other.aggregationStartTime) return false
        if (costInUsd != other.costInUsd) return false
        if (count != other.count) return false
        if (fleetId != other.fleetId) return false
        if (instanceType != other.instanceType) return false
        if (jobId != other.jobId) return false
        if (jobName != other.jobName) return false
        if (licenseProduct != other.licenseProduct) return false
        if (queueId != other.queueId) return false
        if (runtimeInSeconds != other.runtimeInSeconds) return false
        if (usageType != other.usageType) return false
        if (userId != other.userId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The end time for the aggregation.
         */
        public var aggregationEndTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The start time for the aggregation.
         */
        public var aggregationStartTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * How the statistics should appear in USD. Options include: minimum, maximum, average or sum.
         */
        public var costInUsd: aws.sdk.kotlin.services.deadline.model.Stats? = null
        /**
         * The number of instances in a list of statistics.
         */
        public var count: kotlin.Int? = null
        /**
         * The fleet ID.
         */
        public var fleetId: kotlin.String? = null
        /**
         * The type of instance.
         */
        public var instanceType: kotlin.String? = null
        /**
         * The job ID.
         */
        public var jobId: kotlin.String? = null
        /**
         * The job name.
         */
        public var jobName: kotlin.String? = null
        /**
         * The licensed product.
         */
        public var licenseProduct: kotlin.String? = null
        /**
         * The queue ID.
         */
        public var queueId: kotlin.String? = null
        /**
         * The total aggregated runtime.
         */
        public var runtimeInSeconds: aws.sdk.kotlin.services.deadline.model.Stats? = null
        /**
         * The type of usage for the statistics.
         */
        public var usageType: aws.sdk.kotlin.services.deadline.model.UsageType? = null
        /**
         * The user ID.
         */
        public var userId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.deadline.model.Statistics) : this() {
            this.aggregationEndTime = x.aggregationEndTime
            this.aggregationStartTime = x.aggregationStartTime
            this.costInUsd = x.costInUsd
            this.count = x.count
            this.fleetId = x.fleetId
            this.instanceType = x.instanceType
            this.jobId = x.jobId
            this.jobName = x.jobName
            this.licenseProduct = x.licenseProduct
            this.queueId = x.queueId
            this.runtimeInSeconds = x.runtimeInSeconds
            this.usageType = x.usageType
            this.userId = x.userId
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy