commonMain.aws.sdk.kotlin.services.textract.model.Geometry.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of textract-jvm Show documentation
Show all versions of textract-jvm Show documentation
The AWS SDK for Kotlin client for Textract
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.textract.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.
*/
public class Geometry private constructor(builder: Builder) {
/**
* An axis-aligned coarse representation of the location of the recognized item on the document page.
*/
public val boundingBox: aws.sdk.kotlin.services.textract.model.BoundingBox? = builder.boundingBox
/**
* Within the bounding box, a fine-grained polygon around the recognized item.
*/
public val polygon: List? = builder.polygon
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.textract.model.Geometry = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Geometry(")
append("boundingBox=$boundingBox,")
append("polygon=$polygon")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = boundingBox?.hashCode() ?: 0
result = 31 * result + (polygon?.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 Geometry
if (boundingBox != other.boundingBox) return false
if (polygon != other.polygon) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.textract.model.Geometry = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* An axis-aligned coarse representation of the location of the recognized item on the document page.
*/
public var boundingBox: aws.sdk.kotlin.services.textract.model.BoundingBox? = null
/**
* Within the bounding box, a fine-grained polygon around the recognized item.
*/
public var polygon: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.textract.model.Geometry) : this() {
this.boundingBox = x.boundingBox
this.polygon = x.polygon
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.textract.model.Geometry = Geometry(this)
/**
* construct an [aws.sdk.kotlin.services.textract.model.BoundingBox] inside the given [block]
*/
public fun boundingBox(block: aws.sdk.kotlin.services.textract.model.BoundingBox.Builder.() -> kotlin.Unit) {
this.boundingBox = aws.sdk.kotlin.services.textract.model.BoundingBox.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}