All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.iotfleetwise.model.MessageSignal.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.iotfleetwise.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The decoding information for a specific message which support higher order data types.
 */
public class MessageSignal private constructor(builder: Builder) {
    /**
     * The structured message for the message signal. It can be defined with either a `primitiveMessageDefinition`, `structuredMessageListDefinition`, or `structuredMessageDefinition` recursively.
     */
    public val structuredMessage: aws.sdk.kotlin.services.iotfleetwise.model.StructuredMessage? = builder.structuredMessage
    /**
     * The topic name for the message signal. It corresponds to topics in ROS 2.
     */
    public val topicName: kotlin.String = requireNotNull(builder.topicName) { "A non-null value must be provided for topicName" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iotfleetwise.model.MessageSignal = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("MessageSignal(")
        append("structuredMessage=$structuredMessage,")
        append("topicName=$topicName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = structuredMessage?.hashCode() ?: 0
        result = 31 * result + (topicName.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 MessageSignal

        if (structuredMessage != other.structuredMessage) return false
        if (topicName != other.topicName) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iotfleetwise.model.MessageSignal = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The structured message for the message signal. It can be defined with either a `primitiveMessageDefinition`, `structuredMessageListDefinition`, or `structuredMessageDefinition` recursively.
         */
        public var structuredMessage: aws.sdk.kotlin.services.iotfleetwise.model.StructuredMessage? = null
        /**
         * The topic name for the message signal. It corresponds to topics in ROS 2.
         */
        public var topicName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotfleetwise.model.MessageSignal) : this() {
            this.structuredMessage = x.structuredMessage
            this.topicName = x.topicName
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.iotfleetwise.model.MessageSignal = MessageSignal(this)

        internal fun correctErrors(): Builder {
            if (topicName == null) topicName = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy