
commonMain.aws.sdk.kotlin.services.iot.model.AttributePayload.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iot.model
/**
* The attribute payload.
*/
public class AttributePayload private constructor(builder: Builder) {
/**
* A JSON string containing up to three key-value pair in JSON format. For example:
*
* `{\"attributes\":{\"string1\":\"string2\"}}`
*/
public val attributes: Map? = builder.attributes
/**
* Specifies whether the list of attributes provided in the `AttributePayload` is merged with the attributes stored in the registry, instead of overwriting them.
*
* To remove an attribute, call `UpdateThing` with an empty attribute value.
*
* The `merge` attribute is only valid when calling `UpdateThing` or `UpdateThingGroup`.
*/
public val merge: kotlin.Boolean = builder.merge
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iot.model.AttributePayload = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AttributePayload(")
append("attributes=$attributes,")
append("merge=$merge")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = attributes?.hashCode() ?: 0
result = 31 * result + (merge.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 AttributePayload
if (attributes != other.attributes) return false
if (merge != other.merge) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iot.model.AttributePayload = Builder(this).apply(block).build()
public class Builder {
/**
* A JSON string containing up to three key-value pair in JSON format. For example:
*
* `{\"attributes\":{\"string1\":\"string2\"}}`
*/
public var attributes: Map? = null
/**
* Specifies whether the list of attributes provided in the `AttributePayload` is merged with the attributes stored in the registry, instead of overwriting them.
*
* To remove an attribute, call `UpdateThing` with an empty attribute value.
*
* The `merge` attribute is only valid when calling `UpdateThing` or `UpdateThingGroup`.
*/
public var merge: kotlin.Boolean = false
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.iot.model.AttributePayload) : this() {
this.attributes = x.attributes
this.merge = x.merge
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.iot.model.AttributePayload = AttributePayload(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy