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

commonMain.aws.sdk.kotlin.services.groundstation.model.UpdateAgentStatusRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.groundstation.model

import aws.smithy.kotlin.runtime.SdkDsl

public class UpdateAgentStatusRequest private constructor(builder: Builder) {
    /**
     * UUID of agent to update.
     */
    public val agentId: kotlin.String = requireNotNull(builder.agentId) { "A non-null value must be provided for agentId" }
    /**
     * Aggregate status for agent.
     */
    public val aggregateStatus: aws.sdk.kotlin.services.groundstation.model.AggregateStatus? = builder.aggregateStatus
    /**
     * List of component statuses for agent.
     */
    public val componentStatuses: List = requireNotNull(builder.componentStatuses) { "A non-null value must be provided for componentStatuses" }
    /**
     * GUID of agent task.
     */
    public val taskId: kotlin.String = requireNotNull(builder.taskId) { "A non-null value must be provided for taskId" }

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateAgentStatusRequest(")
        append("agentId=$agentId,")
        append("aggregateStatus=$aggregateStatus,")
        append("componentStatuses=$componentStatuses,")
        append("taskId=$taskId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = agentId.hashCode()
        result = 31 * result + (aggregateStatus?.hashCode() ?: 0)
        result = 31 * result + (componentStatuses.hashCode())
        result = 31 * result + (taskId.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 UpdateAgentStatusRequest

        if (agentId != other.agentId) return false
        if (aggregateStatus != other.aggregateStatus) return false
        if (componentStatuses != other.componentStatuses) return false
        if (taskId != other.taskId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * UUID of agent to update.
         */
        public var agentId: kotlin.String? = null
        /**
         * Aggregate status for agent.
         */
        public var aggregateStatus: aws.sdk.kotlin.services.groundstation.model.AggregateStatus? = null
        /**
         * List of component statuses for agent.
         */
        public var componentStatuses: List? = null
        /**
         * GUID of agent task.
         */
        public var taskId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.groundstation.model.UpdateAgentStatusRequest) : this() {
            this.agentId = x.agentId
            this.aggregateStatus = x.aggregateStatus
            this.componentStatuses = x.componentStatuses
            this.taskId = x.taskId
        }

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

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

        internal fun correctErrors(): Builder {
            if (agentId == null) agentId = ""
            if (componentStatuses == null) componentStatuses = emptyList()
            if (taskId == null) taskId = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy