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

commonMain.aws.sdk.kotlin.services.sagemakergeospatial.model.ItemSource.kt Maven / Gradle / Ivy

There is a newer version: 1.3.77
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.sagemakergeospatial.model

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

/**
 * The structure representing the items in the response for SearchRasterDataCollection.
 */
public class ItemSource private constructor(builder: Builder) {
    /**
     * This is a dictionary of Asset Objects data associated with the Item that can be downloaded or streamed, each with a unique key.
     */
    public val assets: Map? = builder.assets
    /**
     * The searchable date and time of the item, in UTC.
     */
    public val dateTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.dateTime) { "A non-null value must be provided for dateTime" }
    /**
     * The item Geometry in GeoJson format.
     */
    public val geometry: aws.sdk.kotlin.services.sagemakergeospatial.model.Geometry? = builder.geometry
    /**
     * A unique Id for the source item.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * This field contains additional properties of the item.
     */
    public val properties: aws.sdk.kotlin.services.sagemakergeospatial.model.Properties? = builder.properties

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

    override fun toString(): kotlin.String = buildString {
        append("ItemSource(")
        append("assets=$assets,")
        append("dateTime=$dateTime,")
        append("geometry=$geometry,")
        append("id=$id,")
        append("properties=$properties")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = assets?.hashCode() ?: 0
        result = 31 * result + (dateTime.hashCode())
        result = 31 * result + (geometry?.hashCode() ?: 0)
        result = 31 * result + (id.hashCode())
        result = 31 * result + (properties?.hashCode() ?: 0)
        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 ItemSource

        if (assets != other.assets) return false
        if (dateTime != other.dateTime) return false
        if (geometry != other.geometry) return false
        if (id != other.id) return false
        if (properties != other.properties) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * This is a dictionary of Asset Objects data associated with the Item that can be downloaded or streamed, each with a unique key.
         */
        public var assets: Map? = null
        /**
         * The searchable date and time of the item, in UTC.
         */
        public var dateTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The item Geometry in GeoJson format.
         */
        public var geometry: aws.sdk.kotlin.services.sagemakergeospatial.model.Geometry? = null
        /**
         * A unique Id for the source item.
         */
        public var id: kotlin.String? = null
        /**
         * This field contains additional properties of the item.
         */
        public var properties: aws.sdk.kotlin.services.sagemakergeospatial.model.Properties? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.sagemakergeospatial.model.ItemSource) : this() {
            this.assets = x.assets
            this.dateTime = x.dateTime
            this.geometry = x.geometry
            this.id = x.id
            this.properties = x.properties
        }

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

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

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

        internal fun correctErrors(): Builder {
            if (dateTime == null) dateTime = Instant.fromEpochSeconds(0)
            if (id == null) id = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy