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

commonMain.aws.sdk.kotlin.services.proton.model.ServiceTemplateVersion.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
import aws.smithy.kotlin.runtime.time.Instant

/**
 * Detailed data of an Proton service template version resource.
 */
public class ServiceTemplateVersion private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the version of a service template.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * An array of compatible environment template names for the major version of a service template.
     */
    public val compatibleEnvironmentTemplates: List = requireNotNull(builder.compatibleEnvironmentTemplates) { "A non-null value must be provided for compatibleEnvironmentTemplates" }
    /**
     * The time when the version of a service template was created.
     */
    public val createdAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdAt) { "A non-null value must be provided for createdAt" }
    /**
     * A description of the version of a service template.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The time when the version of a service template was last modified.
     */
    public val lastModifiedAt: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.lastModifiedAt) { "A non-null value must be provided for lastModifiedAt" }
    /**
     * The latest major version that's associated with the version of a service template.
     */
    public val majorVersion: kotlin.String = requireNotNull(builder.majorVersion) { "A non-null value must be provided for majorVersion" }
    /**
     * The minor version of a service template.
     */
    public val minorVersion: kotlin.String = requireNotNull(builder.minorVersion) { "A non-null value must be provided for minorVersion" }
    /**
     * The recommended minor version of the service template.
     */
    public val recommendedMinorVersion: kotlin.String? = builder.recommendedMinorVersion
    /**
     * The schema of the version of a service template.
     */
    public val schema: kotlin.String? = builder.schema
    /**
     * The service template version status.
     */
    public val status: aws.sdk.kotlin.services.proton.model.TemplateVersionStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
    /**
     * A service template version status message.
     */
    public val statusMessage: kotlin.String? = builder.statusMessage
    /**
     * An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.
     *
     * For more information about components, see [Proton components](https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html) in the *Proton User Guide*.
     */
    public val supportedComponentSources: List? = builder.supportedComponentSources
    /**
     * The name of the version of a service template.
     */
    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.ServiceTemplateVersion = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ServiceTemplateVersion(")
        append("arn=$arn,")
        append("compatibleEnvironmentTemplates=$compatibleEnvironmentTemplates,")
        append("createdAt=$createdAt,")
        append("description=*** Sensitive Data Redacted ***,")
        append("lastModifiedAt=$lastModifiedAt,")
        append("majorVersion=$majorVersion,")
        append("minorVersion=$minorVersion,")
        append("recommendedMinorVersion=$recommendedMinorVersion,")
        append("schema=*** Sensitive Data Redacted ***,")
        append("status=$status,")
        append("statusMessage=*** Sensitive Data Redacted ***,")
        append("supportedComponentSources=$supportedComponentSources,")
        append("templateName=$templateName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = arn.hashCode()
        result = 31 * result + (compatibleEnvironmentTemplates.hashCode())
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (lastModifiedAt.hashCode())
        result = 31 * result + (majorVersion.hashCode())
        result = 31 * result + (minorVersion.hashCode())
        result = 31 * result + (recommendedMinorVersion?.hashCode() ?: 0)
        result = 31 * result + (schema?.hashCode() ?: 0)
        result = 31 * result + (status.hashCode())
        result = 31 * result + (statusMessage?.hashCode() ?: 0)
        result = 31 * result + (supportedComponentSources?.hashCode() ?: 0)
        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 ServiceTemplateVersion

        if (arn != other.arn) return false
        if (compatibleEnvironmentTemplates != other.compatibleEnvironmentTemplates) return false
        if (createdAt != other.createdAt) return false
        if (description != other.description) return false
        if (lastModifiedAt != other.lastModifiedAt) return false
        if (majorVersion != other.majorVersion) return false
        if (minorVersion != other.minorVersion) return false
        if (recommendedMinorVersion != other.recommendedMinorVersion) return false
        if (schema != other.schema) return false
        if (status != other.status) return false
        if (statusMessage != other.statusMessage) return false
        if (supportedComponentSources != other.supportedComponentSources) return false
        if (templateName != other.templateName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the version of a service template.
         */
        public var arn: kotlin.String? = null
        /**
         * An array of compatible environment template names for the major version of a service template.
         */
        public var compatibleEnvironmentTemplates: List? = null
        /**
         * The time when the version of a service template was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * A description of the version of a service template.
         */
        public var description: kotlin.String? = null
        /**
         * The time when the version of a service template was last modified.
         */
        public var lastModifiedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The latest major version that's associated with the version of a service template.
         */
        public var majorVersion: kotlin.String? = null
        /**
         * The minor version of a service template.
         */
        public var minorVersion: kotlin.String? = null
        /**
         * The recommended minor version of the service template.
         */
        public var recommendedMinorVersion: kotlin.String? = null
        /**
         * The schema of the version of a service template.
         */
        public var schema: kotlin.String? = null
        /**
         * The service template version status.
         */
        public var status: aws.sdk.kotlin.services.proton.model.TemplateVersionStatus? = null
        /**
         * A service template version status message.
         */
        public var statusMessage: kotlin.String? = null
        /**
         * An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.
         *
         * For more information about components, see [Proton components](https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html) in the *Proton User Guide*.
         */
        public var supportedComponentSources: List? = null
        /**
         * The name of the version of a service template.
         */
        public var templateName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.proton.model.ServiceTemplateVersion) : this() {
            this.arn = x.arn
            this.compatibleEnvironmentTemplates = x.compatibleEnvironmentTemplates
            this.createdAt = x.createdAt
            this.description = x.description
            this.lastModifiedAt = x.lastModifiedAt
            this.majorVersion = x.majorVersion
            this.minorVersion = x.minorVersion
            this.recommendedMinorVersion = x.recommendedMinorVersion
            this.schema = x.schema
            this.status = x.status
            this.statusMessage = x.statusMessage
            this.supportedComponentSources = x.supportedComponentSources
            this.templateName = x.templateName
        }

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

        internal fun correctErrors(): Builder {
            if (arn == null) arn = ""
            if (compatibleEnvironmentTemplates == null) compatibleEnvironmentTemplates = emptyList()
            if (createdAt == null) createdAt = Instant.fromEpochSeconds(0)
            if (lastModifiedAt == null) lastModifiedAt = Instant.fromEpochSeconds(0)
            if (majorVersion == null) majorVersion = ""
            if (minorVersion == null) minorVersion = ""
            if (status == null) status = TemplateVersionStatus.SdkUnknown("no value provided")
            if (templateName == null) templateName = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy