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

commonMain.aws.sdk.kotlin.services.glue.model.Classifier.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Classifiers are triggered during a crawl task. A classifier checks whether a given file is in a format it can handle. If it is, the classifier creates a schema in the form of a `StructType` object that matches that data format.
 *
 * You can use the standard classifiers that Glue provides, or you can write your own classifiers to best categorize your data sources and specify the appropriate schemas to use for them. A classifier can be a `grok` classifier, an `XML` classifier, a `JSON` classifier, or a custom `CSV` classifier, as specified in one of the fields in the `Classifier` object.
 */
public class Classifier private constructor(builder: Builder) {
    /**
     * A classifier for comma-separated values (CSV).
     */
    public val csvClassifier: aws.sdk.kotlin.services.glue.model.CsvClassifier? = builder.csvClassifier
    /**
     * A classifier that uses `grok`.
     */
    public val grokClassifier: aws.sdk.kotlin.services.glue.model.GrokClassifier? = builder.grokClassifier
    /**
     * A classifier for JSON content.
     */
    public val jsonClassifier: aws.sdk.kotlin.services.glue.model.JsonClassifier? = builder.jsonClassifier
    /**
     * A classifier for XML content.
     */
    public val xmlClassifier: aws.sdk.kotlin.services.glue.model.XmlClassifier? = builder.xmlClassifier

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

    override fun toString(): kotlin.String = buildString {
        append("Classifier(")
        append("csvClassifier=$csvClassifier,")
        append("grokClassifier=$grokClassifier,")
        append("jsonClassifier=$jsonClassifier,")
        append("xmlClassifier=$xmlClassifier")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = csvClassifier?.hashCode() ?: 0
        result = 31 * result + (grokClassifier?.hashCode() ?: 0)
        result = 31 * result + (jsonClassifier?.hashCode() ?: 0)
        result = 31 * result + (xmlClassifier?.hashCode() ?: 0)
        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 Classifier

        if (csvClassifier != other.csvClassifier) return false
        if (grokClassifier != other.grokClassifier) return false
        if (jsonClassifier != other.jsonClassifier) return false
        if (xmlClassifier != other.xmlClassifier) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A classifier for comma-separated values (CSV).
         */
        public var csvClassifier: aws.sdk.kotlin.services.glue.model.CsvClassifier? = null
        /**
         * A classifier that uses `grok`.
         */
        public var grokClassifier: aws.sdk.kotlin.services.glue.model.GrokClassifier? = null
        /**
         * A classifier for JSON content.
         */
        public var jsonClassifier: aws.sdk.kotlin.services.glue.model.JsonClassifier? = null
        /**
         * A classifier for XML content.
         */
        public var xmlClassifier: aws.sdk.kotlin.services.glue.model.XmlClassifier? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Classifier) : this() {
            this.csvClassifier = x.csvClassifier
            this.grokClassifier = x.grokClassifier
            this.jsonClassifier = x.jsonClassifier
            this.xmlClassifier = x.xmlClassifier
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.glue.model.CsvClassifier] inside the given [block]
         */
        public fun csvClassifier(block: aws.sdk.kotlin.services.glue.model.CsvClassifier.Builder.() -> kotlin.Unit) {
            this.csvClassifier = aws.sdk.kotlin.services.glue.model.CsvClassifier.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.glue.model.GrokClassifier] inside the given [block]
         */
        public fun grokClassifier(block: aws.sdk.kotlin.services.glue.model.GrokClassifier.Builder.() -> kotlin.Unit) {
            this.grokClassifier = aws.sdk.kotlin.services.glue.model.GrokClassifier.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.glue.model.JsonClassifier] inside the given [block]
         */
        public fun jsonClassifier(block: aws.sdk.kotlin.services.glue.model.JsonClassifier.Builder.() -> kotlin.Unit) {
            this.jsonClassifier = aws.sdk.kotlin.services.glue.model.JsonClassifier.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.glue.model.XmlClassifier] inside the given [block]
         */
        public fun xmlClassifier(block: aws.sdk.kotlin.services.glue.model.XmlClassifier.Builder.() -> kotlin.Unit) {
            this.xmlClassifier = aws.sdk.kotlin.services.glue.model.XmlClassifier.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy