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

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

There is a newer version: 1.3.99
Show 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

/**
 * Summary data of an Proton service resource.
 */
public class ServiceSummary private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the service.
     */
    public val arn: kotlin.String = requireNotNull(builder.arn) { "A non-null value must be provided for arn" }
    /**
     * The time when the service 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 service.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The time when the service 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 name of the service.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The status of the service.
     */
    public val status: aws.sdk.kotlin.services.proton.model.ServiceStatus = requireNotNull(builder.status) { "A non-null value must be provided for status" }
    /**
     * A service status message.
     */
    public val statusMessage: kotlin.String? = builder.statusMessage
    /**
     * The name of the 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.ServiceSummary = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ServiceSummary(")
        append("arn=$arn,")
        append("createdAt=$createdAt,")
        append("description=*** Sensitive Data Redacted ***,")
        append("lastModifiedAt=$lastModifiedAt,")
        append("name=$name,")
        append("status=$status,")
        append("statusMessage=*** Sensitive Data Redacted ***,")
        append("templateName=$templateName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = arn.hashCode()
        result = 31 * result + (createdAt.hashCode())
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (lastModifiedAt.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (status.hashCode())
        result = 31 * result + (statusMessage?.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 ServiceSummary

        if (arn != other.arn) return false
        if (createdAt != other.createdAt) return false
        if (description != other.description) return false
        if (lastModifiedAt != other.lastModifiedAt) return false
        if (name != other.name) return false
        if (status != other.status) return false
        if (statusMessage != other.statusMessage) return false
        if (templateName != other.templateName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the service.
         */
        public var arn: kotlin.String? = null
        /**
         * The time when the service was created.
         */
        public var createdAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * A description of the service.
         */
        public var description: kotlin.String? = null
        /**
         * The time when the service was last modified.
         */
        public var lastModifiedAt: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The name of the service.
         */
        public var name: kotlin.String? = null
        /**
         * The status of the service.
         */
        public var status: aws.sdk.kotlin.services.proton.model.ServiceStatus? = null
        /**
         * A service status message.
         */
        public var statusMessage: kotlin.String? = null
        /**
         * The name of the service template.
         */
        public var templateName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.proton.model.ServiceSummary) : this() {
            this.arn = x.arn
            this.createdAt = x.createdAt
            this.description = x.description
            this.lastModifiedAt = x.lastModifiedAt
            this.name = x.name
            this.status = x.status
            this.statusMessage = x.statusMessage
            this.templateName = x.templateName
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy