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

commonMain.aws.sdk.kotlin.services.honeycode.model.DelimitedTextImportOptions.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.honeycode.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An object that contains the options relating to parsing delimited text as part of an import request.
 */
public class DelimitedTextImportOptions private constructor(builder: Builder) {
    /**
     * The encoding of the data in the input file.
     */
    public val dataCharacterEncoding: aws.sdk.kotlin.services.honeycode.model.ImportDataCharacterEncoding? = builder.dataCharacterEncoding
    /**
     * The delimiter to use for separating columns in a single row of the input.
     */
    public val delimiter: kotlin.String = requireNotNull(builder.delimiter) { "A non-null value must be provided for delimiter" }
    /**
     * Indicates whether the input file has a header row at the top containing the column names.
     */
    public val hasHeaderRow: kotlin.Boolean = builder.hasHeaderRow
    /**
     * A parameter to indicate whether empty rows should be ignored or be included in the import.
     */
    public val ignoreEmptyRows: kotlin.Boolean = builder.ignoreEmptyRows

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

    override fun toString(): kotlin.String = buildString {
        append("DelimitedTextImportOptions(")
        append("dataCharacterEncoding=$dataCharacterEncoding,")
        append("delimiter=$delimiter,")
        append("hasHeaderRow=$hasHeaderRow,")
        append("ignoreEmptyRows=$ignoreEmptyRows")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dataCharacterEncoding?.hashCode() ?: 0
        result = 31 * result + (delimiter.hashCode())
        result = 31 * result + (hasHeaderRow.hashCode())
        result = 31 * result + (ignoreEmptyRows.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 DelimitedTextImportOptions

        if (dataCharacterEncoding != other.dataCharacterEncoding) return false
        if (delimiter != other.delimiter) return false
        if (hasHeaderRow != other.hasHeaderRow) return false
        if (ignoreEmptyRows != other.ignoreEmptyRows) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The encoding of the data in the input file.
         */
        public var dataCharacterEncoding: aws.sdk.kotlin.services.honeycode.model.ImportDataCharacterEncoding? = null
        /**
         * The delimiter to use for separating columns in a single row of the input.
         */
        public var delimiter: kotlin.String? = null
        /**
         * Indicates whether the input file has a header row at the top containing the column names.
         */
        public var hasHeaderRow: kotlin.Boolean = false
        /**
         * A parameter to indicate whether empty rows should be ignored or be included in the import.
         */
        public var ignoreEmptyRows: kotlin.Boolean = false

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.honeycode.model.DelimitedTextImportOptions) : this() {
            this.dataCharacterEncoding = x.dataCharacterEncoding
            this.delimiter = x.delimiter
            this.hasHeaderRow = x.hasHeaderRow
            this.ignoreEmptyRows = x.ignoreEmptyRows
        }

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

        internal fun correctErrors(): Builder {
            if (delimiter == null) delimiter = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy