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

commonMain.aws.sdk.kotlin.services.neptunedata.model.PropertygraphData.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.neptunedata.model

import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.content.Document

/**
 * A Gremlin or openCypher change record.
 */
public class PropertygraphData private constructor(builder: Builder) {
    /**
     * If this is an edge (type = `e`), the ID of the corresponding `from` vertex or source node.
     */
    public val from: kotlin.String? = builder.from
    /**
     * The ID of the Gremlin or openCypher element.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The property name. For element labels, this is `label`.
     */
    public val key: kotlin.String = requireNotNull(builder.key) { "A non-null value must be provided for key" }
    /**
     * If this is an edge (type = `e`), the ID of the corresponding `to` vertex or target node.
     */
    public val to: kotlin.String? = builder.to
    /**
     * The type of this Gremlin or openCypher element. Must be one of:
     * + **`v1`** - Vertex label for Gremlin, or node label for openCypher.
     * + **`vp`** - Vertex properties for Gremlin, or node properties for openCypher.
     * + **`e`** - Edge and edge label for Gremlin, or relationship and relationship type for openCypher.
     * + **`ep`** - Edge properties for Gremlin, or relationship properties for openCypher.
     */
    public val type: kotlin.String = requireNotNull(builder.type) { "A non-null value must be provided for type" }
    /**
     * This is a JSON object that contains a value field for the value itself, and a datatype field for the JSON data type of that value:
     */
    public val value: aws.smithy.kotlin.runtime.content.Document? = builder.value

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

    override fun toString(): kotlin.String = buildString {
        append("PropertygraphData(")
        append("from=$from,")
        append("id=$id,")
        append("key=$key,")
        append("to=$to,")
        append("type=$type,")
        append("value=$value")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = from?.hashCode() ?: 0
        result = 31 * result + (id.hashCode())
        result = 31 * result + (key.hashCode())
        result = 31 * result + (to?.hashCode() ?: 0)
        result = 31 * result + (type.hashCode())
        result = 31 * result + (value?.hashCode() ?: 0)
        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 PropertygraphData

        if (from != other.from) return false
        if (id != other.id) return false
        if (key != other.key) return false
        if (to != other.to) return false
        if (type != other.type) return false
        if (value != other.value) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * If this is an edge (type = `e`), the ID of the corresponding `from` vertex or source node.
         */
        public var from: kotlin.String? = null
        /**
         * The ID of the Gremlin or openCypher element.
         */
        public var id: kotlin.String? = null
        /**
         * The property name. For element labels, this is `label`.
         */
        public var key: kotlin.String? = null
        /**
         * If this is an edge (type = `e`), the ID of the corresponding `to` vertex or target node.
         */
        public var to: kotlin.String? = null
        /**
         * The type of this Gremlin or openCypher element. Must be one of:
         * + **`v1`** - Vertex label for Gremlin, or node label for openCypher.
         * + **`vp`** - Vertex properties for Gremlin, or node properties for openCypher.
         * + **`e`** - Edge and edge label for Gremlin, or relationship and relationship type for openCypher.
         * + **`ep`** - Edge properties for Gremlin, or relationship properties for openCypher.
         */
        public var type: kotlin.String? = null
        /**
         * This is a JSON object that contains a value field for the value itself, and a datatype field for the JSON data type of that value:
         */
        public var value: aws.smithy.kotlin.runtime.content.Document? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.neptunedata.model.PropertygraphData) : this() {
            this.from = x.from
            this.id = x.id
            this.key = x.key
            this.to = x.to
            this.type = x.type
            this.value = x.value
        }

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

        internal fun correctErrors(): Builder {
            if (id == null) id = ""
            if (key == null) key = ""
            if (type == null) type = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy