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

commonMain.aws.sdk.kotlin.services.glue.model.GrokClassifier.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
import aws.smithy.kotlin.runtime.time.Instant

/**
 * A classifier that uses `grok` patterns.
 */
public class GrokClassifier private constructor(builder: Builder) {
    /**
     * An identifier of the data format that the classifier matches, such as Twitter, JSON, Omniture logs, and so on.
     */
    public val classification: kotlin.String = requireNotNull(builder.classification) { "A non-null value must be provided for classification" }
    /**
     * The time that this classifier was registered.
     */
    public val creationTime: aws.smithy.kotlin.runtime.time.Instant? = builder.creationTime
    /**
     * Optional custom grok patterns defined by this classifier. For more information, see custom patterns in [Writing Custom Classifiers](https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html).
     */
    public val customPatterns: kotlin.String? = builder.customPatterns
    /**
     * The grok pattern applied to a data store by this classifier. For more information, see built-in patterns in [Writing Custom Classifiers](https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html).
     */
    public val grokPattern: kotlin.String = requireNotNull(builder.grokPattern) { "A non-null value must be provided for grokPattern" }
    /**
     * The time that this classifier was last updated.
     */
    public val lastUpdated: aws.smithy.kotlin.runtime.time.Instant? = builder.lastUpdated
    /**
     * The name of the classifier.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The version of this classifier.
     */
    public val version: kotlin.Long = builder.version

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

    override fun toString(): kotlin.String = buildString {
        append("GrokClassifier(")
        append("classification=$classification,")
        append("creationTime=$creationTime,")
        append("customPatterns=$customPatterns,")
        append("grokPattern=$grokPattern,")
        append("lastUpdated=$lastUpdated,")
        append("name=$name,")
        append("version=$version")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = classification.hashCode()
        result = 31 * result + (creationTime?.hashCode() ?: 0)
        result = 31 * result + (customPatterns?.hashCode() ?: 0)
        result = 31 * result + (grokPattern.hashCode())
        result = 31 * result + (lastUpdated?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (version.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 GrokClassifier

        if (classification != other.classification) return false
        if (creationTime != other.creationTime) return false
        if (customPatterns != other.customPatterns) return false
        if (grokPattern != other.grokPattern) return false
        if (lastUpdated != other.lastUpdated) return false
        if (name != other.name) return false
        if (version != other.version) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An identifier of the data format that the classifier matches, such as Twitter, JSON, Omniture logs, and so on.
         */
        public var classification: kotlin.String? = null
        /**
         * The time that this classifier was registered.
         */
        public var creationTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * Optional custom grok patterns defined by this classifier. For more information, see custom patterns in [Writing Custom Classifiers](https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html).
         */
        public var customPatterns: kotlin.String? = null
        /**
         * The grok pattern applied to a data store by this classifier. For more information, see built-in patterns in [Writing Custom Classifiers](https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html).
         */
        public var grokPattern: kotlin.String? = null
        /**
         * The time that this classifier was last updated.
         */
        public var lastUpdated: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The name of the classifier.
         */
        public var name: kotlin.String? = null
        /**
         * The version of this classifier.
         */
        public var version: kotlin.Long = 0L

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.GrokClassifier) : this() {
            this.classification = x.classification
            this.creationTime = x.creationTime
            this.customPatterns = x.customPatterns
            this.grokPattern = x.grokPattern
            this.lastUpdated = x.lastUpdated
            this.name = x.name
            this.version = x.version
        }

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

        internal fun correctErrors(): Builder {
            if (classification == null) classification = ""
            if (grokPattern == null) grokPattern = ""
            if (name == null) name = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy