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

commonMain.aws.sdk.kotlin.services.proton.model.EnvironmentState.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.proton.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The detailed data about the current state of the environment.
 */
public class EnvironmentState private constructor(builder: Builder) {
    /**
     * The environment spec that was used to create the environment.
     */
    public val spec: kotlin.String? = builder.spec
    /**
     * The major version of the environment template that was used to create the environment.
     */
    public val templateMajorVersion: kotlin.String = requireNotNull(builder.templateMajorVersion) { "A non-null value must be provided for templateMajorVersion" }
    /**
     * The minor version of the environment template that was used to create the environment.
     */
    public val templateMinorVersion: kotlin.String = requireNotNull(builder.templateMinorVersion) { "A non-null value must be provided for templateMinorVersion" }
    /**
     * The name of the environment template that was used to create the environment.
     */
    public val templateName: kotlin.String = requireNotNull(builder.templateName) { "A non-null value must be provided for templateName" }

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

    override fun toString(): kotlin.String = buildString {
        append("EnvironmentState(")
        append("spec=*** Sensitive Data Redacted ***,")
        append("templateMajorVersion=$templateMajorVersion,")
        append("templateMinorVersion=$templateMinorVersion,")
        append("templateName=$templateName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = spec?.hashCode() ?: 0
        result = 31 * result + (templateMajorVersion.hashCode())
        result = 31 * result + (templateMinorVersion.hashCode())
        result = 31 * result + (templateName.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 EnvironmentState

        if (spec != other.spec) return false
        if (templateMajorVersion != other.templateMajorVersion) return false
        if (templateMinorVersion != other.templateMinorVersion) return false
        if (templateName != other.templateName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The environment spec that was used to create the environment.
         */
        public var spec: kotlin.String? = null
        /**
         * The major version of the environment template that was used to create the environment.
         */
        public var templateMajorVersion: kotlin.String? = null
        /**
         * The minor version of the environment template that was used to create the environment.
         */
        public var templateMinorVersion: kotlin.String? = null
        /**
         * The name of the environment template that was used to create the environment.
         */
        public var templateName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.proton.model.EnvironmentState) : this() {
            this.spec = x.spec
            this.templateMajorVersion = x.templateMajorVersion
            this.templateMinorVersion = x.templateMinorVersion
            this.templateName = x.templateName
        }

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

        internal fun correctErrors(): Builder {
            if (templateMajorVersion == null) templateMajorVersion = ""
            if (templateMinorVersion == null) templateMinorVersion = ""
            if (templateName == null) templateName = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy