commonMain.aws.sdk.kotlin.services.iotsitewise.model.ExpressionVariable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotsitewise-jvm Show documentation
Show all versions of iotsitewise-jvm Show documentation
The AWS SDK for Kotlin client for IoTSiteWise
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iotsitewise.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Contains expression variable information.
*/
public class ExpressionVariable private constructor(builder: Builder) {
/**
* The friendly name of the variable to be used in the expression.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The variable that identifies an asset property from which to use values.
*/
public val value: aws.sdk.kotlin.services.iotsitewise.model.VariableValue? = builder.value
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iotsitewise.model.ExpressionVariable = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ExpressionVariable(")
append("name=$name,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = name.hashCode()
result = 31 * result + (value?.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 ExpressionVariable
if (name != other.name) return false
if (value != other.value) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iotsitewise.model.ExpressionVariable = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The friendly name of the variable to be used in the expression.
*/
public var name: kotlin.String? = null
/**
* The variable that identifies an asset property from which to use values.
*/
public var value: aws.sdk.kotlin.services.iotsitewise.model.VariableValue? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.ExpressionVariable) : this() {
this.name = x.name
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.iotsitewise.model.ExpressionVariable = ExpressionVariable(this)
/**
* construct an [aws.sdk.kotlin.services.iotsitewise.model.VariableValue] inside the given [block]
*/
public fun value(block: aws.sdk.kotlin.services.iotsitewise.model.VariableValue.Builder.() -> kotlin.Unit) {
this.value = aws.sdk.kotlin.services.iotsitewise.model.VariableValue.invoke(block)
}
internal fun correctErrors(): Builder {
if (name == null) name = ""
return this
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy