
commonMain.aws.sdk.kotlin.services.textract.model.Relationship.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.textract.model
/**
* Information about how blocks are related to each other. A `Block` object contains 0 or more `Relation` objects in a list, `Relationships`. For more information, see Block.
*
* The `Type` element provides the type of the relationship for all blocks in the `IDs` array.
*/
public class Relationship private constructor(builder: Builder) {
/**
* An array of IDs for related blocks. You can get the type of the relationship from the `Type` element.
*/
public val ids: List? = builder.ids
/**
* The type of relationship that the blocks in the IDs array have with the current block. The relationship can be `VALUE` or `CHILD`. A relationship of type VALUE is a list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair. A relationship of type CHILD is a list of IDs that identify WORD blocks in the case of lines Cell blocks in the case of Tables, and WORD blocks in the case of Selection Elements.
*/
public val type: aws.sdk.kotlin.services.textract.model.RelationshipType? = builder.type
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.textract.model.Relationship = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Relationship(")
append("ids=$ids,")
append("type=$type)")
}
override fun hashCode(): kotlin.Int {
var result = ids?.hashCode() ?: 0
result = 31 * result + (type?.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 Relationship
if (ids != other.ids) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.textract.model.Relationship = Builder(this).apply(block).build()
public class Builder {
/**
* An array of IDs for related blocks. You can get the type of the relationship from the `Type` element.
*/
public var ids: List? = null
/**
* The type of relationship that the blocks in the IDs array have with the current block. The relationship can be `VALUE` or `CHILD`. A relationship of type VALUE is a list that contains the ID of the VALUE block that's associated with the KEY of a key-value pair. A relationship of type CHILD is a list of IDs that identify WORD blocks in the case of lines Cell blocks in the case of Tables, and WORD blocks in the case of Selection Elements.
*/
public var type: aws.sdk.kotlin.services.textract.model.RelationshipType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.textract.model.Relationship) : this() {
this.ids = x.ids
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.textract.model.Relationship = Relationship(this)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy