
commonMain.aws.sdk.kotlin.services.kendra.model.AdditionalResultAttribute.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kendra.model
/**
* An attribute returned from an index query.
*/
public class AdditionalResultAttribute private constructor(builder: Builder) {
/**
* The key that identifies the attribute.
*/
public val key: kotlin.String = requireNotNull(builder.key) { "A non-null value must be provided for key" }
/**
* An object that contains the attribute value.
*/
public val value: aws.sdk.kotlin.services.kendra.model.AdditionalResultAttributeValue? = builder.value
/**
* The data type of the `Value` property.
*/
public val valueType: aws.sdk.kotlin.services.kendra.model.AdditionalResultAttributeValueType = requireNotNull(builder.valueType) { "A non-null value must be provided for valueType" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.kendra.model.AdditionalResultAttribute = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AdditionalResultAttribute(")
append("key=$key,")
append("value=$value,")
append("valueType=$valueType")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = key.hashCode()
result = 31 * result + (value?.hashCode() ?: 0)
result = 31 * result + (valueType.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 AdditionalResultAttribute
if (key != other.key) return false
if (value != other.value) return false
if (valueType != other.valueType) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.kendra.model.AdditionalResultAttribute = Builder(this).apply(block).build()
public class Builder {
/**
* The key that identifies the attribute.
*/
public var key: kotlin.String? = null
/**
* An object that contains the attribute value.
*/
public var value: aws.sdk.kotlin.services.kendra.model.AdditionalResultAttributeValue? = null
/**
* The data type of the `Value` property.
*/
public var valueType: aws.sdk.kotlin.services.kendra.model.AdditionalResultAttributeValueType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.kendra.model.AdditionalResultAttribute) : this() {
this.key = x.key
this.value = x.value
this.valueType = x.valueType
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.kendra.model.AdditionalResultAttribute = AdditionalResultAttribute(this)
/**
* construct an [aws.sdk.kotlin.services.kendra.model.AdditionalResultAttributeValue] inside the given [block]
*/
public fun value(block: aws.sdk.kotlin.services.kendra.model.AdditionalResultAttributeValue.Builder.() -> kotlin.Unit) {
this.value = aws.sdk.kotlin.services.kendra.model.AdditionalResultAttributeValue.invoke(block)
}
internal fun correctErrors(): Builder {
if (key == null) key = ""
if (valueType == null) valueType = AdditionalResultAttributeValueType.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy