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

commonMain.aws.sdk.kotlin.services.iotfleetwise.model.VehicleMiddleware.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 vehicle middleware defined as a type of network interface. Examples of vehicle middleware include `ROS2` and `SOME/IP`.
 */
public class VehicleMiddleware private constructor(builder: Builder) {
    /**
     * The name of the vehicle middleware.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The protocol name of the vehicle middleware.
     */
    public val protocolName: aws.sdk.kotlin.services.iotfleetwise.model.VehicleMiddlewareProtocol = requireNotNull(builder.protocolName) { "A non-null value must be provided for protocolName" }

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

    override fun toString(): kotlin.String = buildString {
        append("VehicleMiddleware(")
        append("name=$name,")
        append("protocolName=$protocolName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = name.hashCode()
        result = 31 * result + (protocolName.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 VehicleMiddleware

        if (name != other.name) return false
        if (protocolName != other.protocolName) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the vehicle middleware.
         */
        public var name: kotlin.String? = null
        /**
         * The protocol name of the vehicle middleware.
         */
        public var protocolName: aws.sdk.kotlin.services.iotfleetwise.model.VehicleMiddlewareProtocol? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotfleetwise.model.VehicleMiddleware) : this() {
            this.name = x.name
            this.protocolName = x.protocolName
        }

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            if (protocolName == null) protocolName = VehicleMiddlewareProtocol.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy