packages feed

hydra-pg-0.17.7: src/main/haskell/Hydra/Pg/Graphson/Syntax.hs

-- Note: this is an automatically generated file. Do not edit.

-- | A syntax model for TinkerPop's GraphSON format. This model is designed to be as inclusive as possible, supporting GraphSON 4.0 as well as earlier versions. See https://github.com/apache/tinkerpop/blob/master/docs/src/dev/io/graphson.asciidoc.

module Hydra.Pg.Graphson.Syntax where

import qualified Hydra.Core as Core
import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)
import qualified Data.Scientific as Sci
import Data.Void
import qualified Data.Int as I
import qualified Data.Map as M

-- | A GraphSON edge as referenced from an adjacent vertex, with its own properties
data AdjacentEdge =
  AdjacentEdge {
    adjacentEdgeId :: Value,
    adjacentEdgeVertexId :: Value,
    adjacentEdgeProperties :: (M.Map PropertyKey Value)}
  deriving (Eq, Ord, Read, Show)

_AdjacentEdge = Core.Name "hydra.pg.graphson.syntax.AdjacentEdge"

_AdjacentEdge_id = Core.Name "id"

_AdjacentEdge_vertexId = Core.Name "vertexId"

_AdjacentEdge_properties = Core.Name "properties"

-- | A GraphSON big-decimal value, represented as a string
newtype BigDecimalValue =
  BigDecimalValue {
    unBigDecimalValue :: String}
  deriving (Eq, Ord, Read, Show)

_BigDecimalValue = Core.Name "hydra.pg.graphson.syntax.BigDecimalValue"

-- | A GraphSON composite value tagged with a GraphSON type name
data CompositeTypedValue =
  CompositeTypedValue {
    compositeTypedValueType :: TypeName,
    compositeTypedValueFields :: Map}
  deriving (Eq, Ord, Read, Show)

_CompositeTypedValue = Core.Name "hydra.pg.graphson.syntax.CompositeTypedValue"

_CompositeTypedValue_type = Core.Name "type"

_CompositeTypedValue_fields = Core.Name "fields"

-- | A GraphSON date-time value, represented as a string
newtype DateTime =
  DateTime {
    unDateTime :: String}
  deriving (Eq, Ord, Read, Show)

_DateTime = Core.Name "hydra.pg.graphson.syntax.DateTime"

-- | A GraphSON double-precision floating-point value, including IEEE special values
data DoubleValue =
  DoubleValueFinite Double |
  DoubleValueInfinity |
  DoubleValueNegativeInfinity |
  DoubleValueNotANumber
  deriving (Eq, Ord, Read, Show)

_DoubleValue = Core.Name "hydra.pg.graphson.syntax.DoubleValue"

_DoubleValue_finite = Core.Name "finite"

_DoubleValue_infinity = Core.Name "infinity"

_DoubleValue_negativeInfinity = Core.Name "negativeInfinity"

_DoubleValue_notANumber = Core.Name "notANumber"

-- | A GraphSON duration value, represented as a string
newtype Duration =
  Duration {
    unDuration :: String}
  deriving (Eq, Ord, Read, Show)

_Duration = Core.Name "hydra.pg.graphson.syntax.Duration"

-- | A GraphSON edge label, represented as a string
newtype EdgeLabel =
  EdgeLabel {
    unEdgeLabel :: String}
  deriving (Eq, Ord, Read, Show)

_EdgeLabel = Core.Name "hydra.pg.graphson.syntax.EdgeLabel"

-- | A GraphSON single-precision floating-point value, including IEEE special values
data FloatValue =
  FloatValueFinite Float |
  FloatValueInfinity |
  FloatValueNegativeInfinity |
  FloatValueNotANumber
  deriving (Eq, Ord, Read, Show)

_FloatValue = Core.Name "hydra.pg.graphson.syntax.FloatValue"

_FloatValue_finite = Core.Name "finite"

_FloatValue_infinity = Core.Name "infinity"

_FloatValue_negativeInfinity = Core.Name "negativeInfinity"

_FloatValue_notANumber = Core.Name "notANumber"

-- | A GraphSON map, represented as a list of key/value pairs
newtype Map =
  Map {
    unMap :: [ValuePair]}
  deriving (Eq, Ord, Read, Show)

_Map = Core.Name "hydra.pg.graphson.syntax.Map"

-- | A GraphSON primitive value tagged with a GraphSON type name
data PrimitiveTypedValue =
  PrimitiveTypedValue {
    primitiveTypedValueType :: TypeName,
    primitiveTypedValueValue :: String}
  deriving (Eq, Ord, Read, Show)

_PrimitiveTypedValue = Core.Name "hydra.pg.graphson.syntax.PrimitiveTypedValue"

_PrimitiveTypedValue_type = Core.Name "type"

_PrimitiveTypedValue_value = Core.Name "value"

-- | A GraphSON property key, represented as a string
newtype PropertyKey =
  PropertyKey {
    unPropertyKey :: String}
  deriving (Eq, Ord, Read, Show)

_PropertyKey = Core.Name "hydra.pg.graphson.syntax.PropertyKey"

-- | A GraphSON type name, represented as a string
newtype TypeName =
  TypeName {
    unTypeName :: String}
  deriving (Eq, Ord, Read, Show)

_TypeName = Core.Name "hydra.pg.graphson.syntax.TypeName"

-- | A GraphSON UUID value, represented as a string
newtype Uuid =
  Uuid {
    unUuid :: String}
  deriving (Eq, Ord, Read, Show)

_Uuid = Core.Name "hydra.pg.graphson.syntax.Uuid"

-- | A GraphSON value, covering the subset of GraphSON value types this model supports
data Value =
  ValueBigDecimal BigDecimalValue |
  ValueBigInteger Integer |
  ValueBinary String |
  ValueBoolean Bool |
  ValueByte I.Int16 |
  ValueChar I.Int64 |
  ValueComposite CompositeTypedValue |
  ValueDateTime DateTime |
  ValueDouble DoubleValue |
  ValueDuration Duration |
  ValueFloat FloatValue |
  ValueInteger Int |
  ValueList [Value] |
  ValueLong I.Int64 |
  ValueMap Map |
  ValueNull |
  ValuePrimitive PrimitiveTypedValue |
  ValueSet [Value] |
  ValueShort I.Int16 |
  ValueString String |
  ValueUuid Uuid
  deriving (Eq, Ord, Read, Show)

_Value = Core.Name "hydra.pg.graphson.syntax.Value"

_Value_bigDecimal = Core.Name "bigDecimal"

_Value_bigInteger = Core.Name "bigInteger"

_Value_binary = Core.Name "binary"

_Value_boolean = Core.Name "boolean"

_Value_byte = Core.Name "byte"

_Value_char = Core.Name "char"

_Value_composite = Core.Name "composite"

_Value_dateTime = Core.Name "dateTime"

_Value_double = Core.Name "double"

_Value_duration = Core.Name "duration"

_Value_float = Core.Name "float"

_Value_integer = Core.Name "integer"

_Value_list = Core.Name "list"

_Value_long = Core.Name "long"

_Value_map = Core.Name "map"

_Value_null = Core.Name "null"

_Value_primitive = Core.Name "primitive"

_Value_set = Core.Name "set"

_Value_short = Core.Name "short"

_Value_string = Core.Name "string"

_Value_uuid = Core.Name "uuid"

-- | A key/value pair in a GraphSON map
data ValuePair =
  ValuePair {
    valuePairFirst :: Value,
    valuePairSecond :: Value}
  deriving (Eq, Ord, Read, Show)

_ValuePair = Core.Name "hydra.pg.graphson.syntax.ValuePair"

_ValuePair_first = Core.Name "first"

_ValuePair_second = Core.Name "second"

-- | A GraphSON vertex, with its incident edges and properties
data Vertex =
  Vertex {
    vertexId :: Value,
    vertexLabel :: (Maybe VertexLabel),
    vertexInEdges :: (M.Map EdgeLabel [AdjacentEdge]),
    vertexOutEdges :: (M.Map EdgeLabel [AdjacentEdge]),
    vertexProperties :: (M.Map PropertyKey [VertexPropertyValue])}
  deriving (Eq, Ord, Read, Show)

_Vertex = Core.Name "hydra.pg.graphson.syntax.Vertex"

_Vertex_id = Core.Name "id"

_Vertex_label = Core.Name "label"

_Vertex_inEdges = Core.Name "inEdges"

_Vertex_outEdges = Core.Name "outEdges"

_Vertex_properties = Core.Name "properties"

-- | A GraphSON vertex label, represented as a string
newtype VertexLabel =
  VertexLabel {
    unVertexLabel :: String}
  deriving (Eq, Ord, Read, Show)

_VertexLabel = Core.Name "hydra.pg.graphson.syntax.VertexLabel"

-- | A GraphSON vertex property value, with an optional property id
data VertexPropertyValue =
  VertexPropertyValue {
    vertexPropertyValueId :: (Maybe Value),
    vertexPropertyValueValue :: Value}
  deriving (Eq, Ord, Read, Show)

_VertexPropertyValue = Core.Name "hydra.pg.graphson.syntax.VertexPropertyValue"

_VertexPropertyValue_id = Core.Name "id"

_VertexPropertyValue_value = Core.Name "value"