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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.FlowConnection.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrockagent.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains information about a connection between two nodes in the flow.
 */
public class FlowConnection private constructor(builder: Builder) {
    /**
     * The configuration of the connection.
     */
    public val configuration: aws.sdk.kotlin.services.bedrockagent.model.FlowConnectionConfiguration? = builder.configuration
    /**
     * A name for the connection that you can reference.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The node that the connection starts at.
     */
    public val source: kotlin.String = requireNotNull(builder.source) { "A non-null value must be provided for source" }
    /**
     * The node that the connection ends at.
     */
    public val target: kotlin.String = requireNotNull(builder.target) { "A non-null value must be provided for target" }
    /**
     * Whether the source node that the connection begins from is a condition node (`Conditional`) or not (`Data`).
     */
    public val type: aws.sdk.kotlin.services.bedrockagent.model.FlowConnectionType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("FlowConnection(")
        append("configuration=$configuration,")
        append("name=$name,")
        append("source=$source,")
        append("target=$target,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = configuration?.hashCode() ?: 0
        result = 31 * result + (name.hashCode())
        result = 31 * result + (source.hashCode())
        result = 31 * result + (target.hashCode())
        result = 31 * result + (type.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 FlowConnection

        if (configuration != other.configuration) return false
        if (name != other.name) return false
        if (source != other.source) return false
        if (target != other.target) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The configuration of the connection.
         */
        public var configuration: aws.sdk.kotlin.services.bedrockagent.model.FlowConnectionConfiguration? = null
        /**
         * A name for the connection that you can reference.
         */
        public var name: kotlin.String? = null
        /**
         * The node that the connection starts at.
         */
        public var source: kotlin.String? = null
        /**
         * The node that the connection ends at.
         */
        public var target: kotlin.String? = null
        /**
         * Whether the source node that the connection begins from is a condition node (`Conditional`) or not (`Data`).
         */
        public var type: aws.sdk.kotlin.services.bedrockagent.model.FlowConnectionType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.FlowConnection) : this() {
            this.configuration = x.configuration
            this.name = x.name
            this.source = x.source
            this.target = x.target
            this.type = x.type
        }

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            if (source == null) source = ""
            if (target == null) target = ""
            if (type == null) type = FlowConnectionType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy