commonMain.aws.sdk.kotlin.services.timestreamquery.model.MixedMeasureMapping.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreamquery-jvm Show documentation
Show all versions of timestreamquery-jvm Show documentation
The AWS SDK for Kotlin client for Timestream Query
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.timestreamquery.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* MixedMeasureMappings are mappings that can be used to ingest data into a mixture of narrow and multi measures in the derived table.
*/
public class MixedMeasureMapping private constructor(builder: Builder) {
/**
* Refers to the value of measure_name in a result row. This field is required if MeasureNameColumn is provided.
*/
public val measureName: kotlin.String? = builder.measureName
/**
* Type of the value that is to be read from sourceColumn. If the mapping is for MULTI, use MeasureValueType.MULTI.
*/
public val measureValueType: aws.sdk.kotlin.services.timestreamquery.model.MeasureValueType = requireNotNull(builder.measureValueType) { "A non-null value must be provided for measureValueType" }
/**
* Required when measureValueType is MULTI. Attribute mappings for MULTI value measures.
*/
public val multiMeasureAttributeMappings: List? = builder.multiMeasureAttributeMappings
/**
* This field refers to the source column from which measure-value is to be read for result materialization.
*/
public val sourceColumn: kotlin.String? = builder.sourceColumn
/**
* Target measure name to be used. If not provided, the target measure name by default would be measure-name if provided, or sourceColumn otherwise.
*/
public val targetMeasureName: kotlin.String? = builder.targetMeasureName
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.timestreamquery.model.MixedMeasureMapping = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("MixedMeasureMapping(")
append("measureName=$measureName,")
append("measureValueType=$measureValueType,")
append("multiMeasureAttributeMappings=$multiMeasureAttributeMappings,")
append("sourceColumn=$sourceColumn,")
append("targetMeasureName=$targetMeasureName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = measureName?.hashCode() ?: 0
result = 31 * result + (measureValueType.hashCode())
result = 31 * result + (multiMeasureAttributeMappings?.hashCode() ?: 0)
result = 31 * result + (sourceColumn?.hashCode() ?: 0)
result = 31 * result + (targetMeasureName?.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 MixedMeasureMapping
if (measureName != other.measureName) return false
if (measureValueType != other.measureValueType) return false
if (multiMeasureAttributeMappings != other.multiMeasureAttributeMappings) return false
if (sourceColumn != other.sourceColumn) return false
if (targetMeasureName != other.targetMeasureName) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.timestreamquery.model.MixedMeasureMapping = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Refers to the value of measure_name in a result row. This field is required if MeasureNameColumn is provided.
*/
public var measureName: kotlin.String? = null
/**
* Type of the value that is to be read from sourceColumn. If the mapping is for MULTI, use MeasureValueType.MULTI.
*/
public var measureValueType: aws.sdk.kotlin.services.timestreamquery.model.MeasureValueType? = null
/**
* Required when measureValueType is MULTI. Attribute mappings for MULTI value measures.
*/
public var multiMeasureAttributeMappings: List? = null
/**
* This field refers to the source column from which measure-value is to be read for result materialization.
*/
public var sourceColumn: kotlin.String? = null
/**
* Target measure name to be used. If not provided, the target measure name by default would be measure-name if provided, or sourceColumn otherwise.
*/
public var targetMeasureName: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.timestreamquery.model.MixedMeasureMapping) : this() {
this.measureName = x.measureName
this.measureValueType = x.measureValueType
this.multiMeasureAttributeMappings = x.multiMeasureAttributeMappings
this.sourceColumn = x.sourceColumn
this.targetMeasureName = x.targetMeasureName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.timestreamquery.model.MixedMeasureMapping = MixedMeasureMapping(this)
internal fun correctErrors(): Builder {
if (measureValueType == null) measureValueType = MeasureValueType.SdkUnknown("no value provided")
return this
}
}
}