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

commonMain.aws.sdk.kotlin.services.qapps.model.CreatePresignedUrlResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.qapps.model

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

public class CreatePresignedUrlResponse private constructor(builder: Builder) {
    /**
     * The unique identifier assigned to the file to be uploaded.
     */
    public val fileId: kotlin.String = requireNotNull(builder.fileId) { "A non-null value must be provided for fileId" }
    /**
     * The URL for a presigned S3 POST operation used to upload a file.
     */
    public val presignedUrl: kotlin.String = requireNotNull(builder.presignedUrl) { "A non-null value must be provided for presignedUrl" }
    /**
     * The date and time that the presigned URL will expire in ISO 8601 format.
     */
    public val presignedUrlExpiration: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.presignedUrlExpiration) { "A non-null value must be provided for presignedUrlExpiration" }
    /**
     * The form fields to include in the presigned S3 POST operation used to upload a file.
     */
    public val presignedUrlFields: Map = requireNotNull(builder.presignedUrlFields) { "A non-null value must be provided for presignedUrlFields" }

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

    override fun toString(): kotlin.String = buildString {
        append("CreatePresignedUrlResponse(")
        append("fileId=$fileId,")
        append("presignedUrl=$presignedUrl,")
        append("presignedUrlExpiration=$presignedUrlExpiration,")
        append("presignedUrlFields=$presignedUrlFields")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = fileId.hashCode()
        result = 31 * result + (presignedUrl.hashCode())
        result = 31 * result + (presignedUrlExpiration.hashCode())
        result = 31 * result + (presignedUrlFields.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 CreatePresignedUrlResponse

        if (fileId != other.fileId) return false
        if (presignedUrl != other.presignedUrl) return false
        if (presignedUrlExpiration != other.presignedUrlExpiration) return false
        if (presignedUrlFields != other.presignedUrlFields) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The unique identifier assigned to the file to be uploaded.
         */
        public var fileId: kotlin.String? = null
        /**
         * The URL for a presigned S3 POST operation used to upload a file.
         */
        public var presignedUrl: kotlin.String? = null
        /**
         * The date and time that the presigned URL will expire in ISO 8601 format.
         */
        public var presignedUrlExpiration: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The form fields to include in the presigned S3 POST operation used to upload a file.
         */
        public var presignedUrlFields: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qapps.model.CreatePresignedUrlResponse) : this() {
            this.fileId = x.fileId
            this.presignedUrl = x.presignedUrl
            this.presignedUrlExpiration = x.presignedUrlExpiration
            this.presignedUrlFields = x.presignedUrlFields
        }

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

        internal fun correctErrors(): Builder {
            if (fileId == null) fileId = ""
            if (presignedUrl == null) presignedUrl = ""
            if (presignedUrlExpiration == null) presignedUrlExpiration = Instant.fromEpochSeconds(0)
            if (presignedUrlFields == null) presignedUrlFields = emptyMap()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy