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

commonMain.aws.sdk.kotlin.services.wisdom.model.StartContentUploadResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.wisdom.model

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

public class StartContentUploadResponse private constructor(builder: Builder) {
    /**
     * The headers to include in the upload.
     */
    public val headersToInclude: Map = requireNotNull(builder.headersToInclude) { "A non-null value must be provided for headersToInclude" }
    /**
     * The identifier of the upload.
     */
    public val uploadId: kotlin.String = requireNotNull(builder.uploadId) { "A non-null value must be provided for uploadId" }
    /**
     * The URL of the upload.
     */
    public val url: kotlin.String = requireNotNull(builder.url) { "A non-null value must be provided for url" }
    /**
     * The expiration time of the URL as an epoch timestamp.
     */
    public val urlExpiry: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.urlExpiry) { "A non-null value must be provided for urlExpiry" }

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

    override fun toString(): kotlin.String = buildString {
        append("StartContentUploadResponse(")
        append("headersToInclude=$headersToInclude,")
        append("uploadId=$uploadId,")
        append("url=*** Sensitive Data Redacted ***,")
        append("urlExpiry=$urlExpiry")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = headersToInclude.hashCode()
        result = 31 * result + (uploadId.hashCode())
        result = 31 * result + (url.hashCode())
        result = 31 * result + (urlExpiry.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 StartContentUploadResponse

        if (headersToInclude != other.headersToInclude) return false
        if (uploadId != other.uploadId) return false
        if (url != other.url) return false
        if (urlExpiry != other.urlExpiry) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The headers to include in the upload.
         */
        public var headersToInclude: Map? = null
        /**
         * The identifier of the upload.
         */
        public var uploadId: kotlin.String? = null
        /**
         * The URL of the upload.
         */
        public var url: kotlin.String? = null
        /**
         * The expiration time of the URL as an epoch timestamp.
         */
        public var urlExpiry: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.wisdom.model.StartContentUploadResponse) : this() {
            this.headersToInclude = x.headersToInclude
            this.uploadId = x.uploadId
            this.url = x.url
            this.urlExpiry = x.urlExpiry
        }

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

        internal fun correctErrors(): Builder {
            if (headersToInclude == null) headersToInclude = emptyMap()
            if (uploadId == null) uploadId = ""
            if (url == null) url = ""
            if (urlExpiry == null) urlExpiry = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy