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

commonMain.aws.sdk.kotlin.services.applicationsignals.model.GetServiceResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.applicationsignals.model

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

public class GetServiceResponse private constructor(builder: Builder) {
    /**
     * The end time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: `1698778057`.
     */
    public val endTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.endTime) { "A non-null value must be provided for endTime" }
    /**
     * A structure containing information about the service.
     */
    public val service: aws.sdk.kotlin.services.applicationsignals.model.Service? = builder.service
    /**
     * The start time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: `1698778057`.
     */
    public val startTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.startTime) { "A non-null value must be provided for startTime" }

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

    override fun toString(): kotlin.String = buildString {
        append("GetServiceResponse(")
        append("endTime=$endTime,")
        append("service=$service,")
        append("startTime=$startTime")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = endTime.hashCode()
        result = 31 * result + (service?.hashCode() ?: 0)
        result = 31 * result + (startTime.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 GetServiceResponse

        if (endTime != other.endTime) return false
        if (service != other.service) return false
        if (startTime != other.startTime) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The end time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: `1698778057`.
         */
        public var endTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * A structure containing information about the service.
         */
        public var service: aws.sdk.kotlin.services.applicationsignals.model.Service? = null
        /**
         * The start time of the data included in the response. In a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: `1698778057`.
         */
        public var startTime: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.applicationsignals.model.GetServiceResponse) : this() {
            this.endTime = x.endTime
            this.service = x.service
            this.startTime = x.startTime
        }

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

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

        internal fun correctErrors(): Builder {
            if (endTime == null) endTime = Instant.fromEpochSeconds(0)
            if (startTime == null) startTime = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy