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

commonMain.aws.sdk.kotlin.services.sagemakergeospatial.model.UserDefined.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

/**
 * The output resolution (in target georeferenced units) of the result of the operation
 */
public class UserDefined private constructor(builder: Builder) {
    /**
     * The units for output resolution of the result.
     */
    public val unit: aws.sdk.kotlin.services.sagemakergeospatial.model.SageMakerGeospatialUnit = requireNotNull(builder.unit) { "A non-null value must be provided for unit" }
    /**
     * The value for output resolution of the result.
     */
    public val value: kotlin.Float = requireNotNull(builder.value) { "A non-null value must be provided for value" }

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

    override fun toString(): kotlin.String = buildString {
        append("UserDefined(")
        append("unit=$unit,")
        append("value=$value")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = unit.hashCode()
        result = 31 * result + (value.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 UserDefined

        if (unit != other.unit) return false
        if (!(value?.equals(other.value) ?: (other.value == null))) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The units for output resolution of the result.
         */
        public var unit: aws.sdk.kotlin.services.sagemakergeospatial.model.SageMakerGeospatialUnit? = null
        /**
         * The value for output resolution of the result.
         */
        public var value: kotlin.Float? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.sagemakergeospatial.model.UserDefined) : this() {
            this.unit = x.unit
            this.value = x.value
        }

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

        internal fun correctErrors(): Builder {
            if (unit == null) unit = SageMakerGeospatialUnit.SdkUnknown("no value provided")
            if (value == null) value = 0f
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy