commonMain.aws.sdk.kotlin.services.glue.model.CreateGrokClassifierRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Specifies a `grok` classifier for `CreateClassifier` to create.
*/
public class CreateGrokClassifierRequest private constructor(builder: Builder) {
/**
* An identifier of the data format that the classifier matches, such as Twitter, JSON, Omniture logs, Amazon CloudWatch Logs, and so on.
*/
public val classification: kotlin.String = requireNotNull(builder.classification) { "A non-null value must be provided for classification" }
/**
* Optional custom grok patterns used by this classifier.
*/
public val customPatterns: kotlin.String? = builder.customPatterns
/**
* The grok pattern used by this classifier.
*/
public val grokPattern: kotlin.String = requireNotNull(builder.grokPattern) { "A non-null value must be provided for grokPattern" }
/**
* The name of the new classifier.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.CreateGrokClassifierRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateGrokClassifierRequest(")
append("classification=$classification,")
append("customPatterns=$customPatterns,")
append("grokPattern=$grokPattern,")
append("name=$name")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = classification.hashCode()
result = 31 * result + (customPatterns?.hashCode() ?: 0)
result = 31 * result + (grokPattern.hashCode())
result = 31 * result + (name.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 CreateGrokClassifierRequest
if (classification != other.classification) return false
if (customPatterns != other.customPatterns) return false
if (grokPattern != other.grokPattern) return false
if (name != other.name) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.CreateGrokClassifierRequest = 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, Amazon CloudWatch Logs, and so on.
*/
public var classification: kotlin.String? = null
/**
* Optional custom grok patterns used by this classifier.
*/
public var customPatterns: kotlin.String? = null
/**
* The grok pattern used by this classifier.
*/
public var grokPattern: kotlin.String? = null
/**
* The name of the new classifier.
*/
public var name: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.glue.model.CreateGrokClassifierRequest) : this() {
this.classification = x.classification
this.customPatterns = x.customPatterns
this.grokPattern = x.grokPattern
this.name = x.name
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.glue.model.CreateGrokClassifierRequest = CreateGrokClassifierRequest(this)
internal fun correctErrors(): Builder {
if (classification == null) classification = ""
if (grokPattern == null) grokPattern = ""
if (name == null) name = ""
return this
}
}
}