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

commonMain.aws.sdk.kotlin.services.iotsitewise.model.ImageFile.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.iotsitewise.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains an image file.
 */
public class ImageFile private constructor(builder: Builder) {
    /**
     * The image file contents, represented as a base64-encoded string. The file size must be less than 1 MB.
     */
    public val data: kotlin.ByteArray = requireNotNull(builder.data) { "A non-null value must be provided for data" }
    /**
     * The file type of the image.
     */
    public val type: aws.sdk.kotlin.services.iotsitewise.model.ImageFileType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("ImageFile(")
        append("data=$data,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = data.contentHashCode()
        result = 31 * result + (type.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 ImageFile

        if (data != null) {
            if (other.data == null) return false
            if (!data.contentEquals(other.data)) return false
        } else if (other.data != null) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The image file contents, represented as a base64-encoded string. The file size must be less than 1 MB.
         */
        public var data: kotlin.ByteArray? = null
        /**
         * The file type of the image.
         */
        public var type: aws.sdk.kotlin.services.iotsitewise.model.ImageFileType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.ImageFile) : this() {
            this.data = x.data
            this.type = x.type
        }

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

        internal fun correctErrors(): Builder {
            if (data == null) data = ByteArray(0)
            if (type == null) type = ImageFileType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy