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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.FlowNode.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 configurations about a node in the flow.
 */
public class FlowNode private constructor(builder: Builder) {
    /**
     * Contains configurations for the node.
     */
    public val configuration: aws.sdk.kotlin.services.bedrockagent.model.FlowNodeConfiguration? = builder.configuration
    /**
     * An array of objects, each of which contains information about an input into the node.
     */
    public val inputs: List? = builder.inputs
    /**
     * A name for the node.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * A list of objects, each of which contains information about an output from the node.
     */
    public val outputs: List? = builder.outputs
    /**
     * The type of node. This value must match the name of the key that you provide in the configuration you provide in the `FlowNodeConfiguration` field.
     */
    public val type: aws.sdk.kotlin.services.bedrockagent.model.FlowNodeType = 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.FlowNode = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("FlowNode(")
        append("configuration=$configuration,")
        append("inputs=$inputs,")
        append("name=$name,")
        append("outputs=$outputs,")
        append("type=$type")
        append(")")
    }

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

        if (configuration != other.configuration) return false
        if (inputs != other.inputs) return false
        if (name != other.name) return false
        if (outputs != other.outputs) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Contains configurations for the node.
         */
        public var configuration: aws.sdk.kotlin.services.bedrockagent.model.FlowNodeConfiguration? = null
        /**
         * An array of objects, each of which contains information about an input into the node.
         */
        public var inputs: List? = null
        /**
         * A name for the node.
         */
        public var name: kotlin.String? = null
        /**
         * A list of objects, each of which contains information about an output from the node.
         */
        public var outputs: List? = null
        /**
         * The type of node. This value must match the name of the key that you provide in the configuration you provide in the `FlowNodeConfiguration` field.
         */
        public var type: aws.sdk.kotlin.services.bedrockagent.model.FlowNodeType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.FlowNode) : this() {
            this.configuration = x.configuration
            this.inputs = x.inputs
            this.name = x.name
            this.outputs = x.outputs
            this.type = x.type
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy