packages feed

hydra-kernel-0.18.1: src/main/haskell/Hydra/Core/Json/Model.hs

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

-- | A JSON syntax model. See the BNF at https://www.json.org

module Hydra.Core.Json.Model where

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

-- | Layout options for hydra.core.json.writer.printJsonWith
data JsonWriterOptions =
  JsonWriterOptions {
    -- | Whether to omit all insignificant whitespace. When true, the value is rendered on a single line with no space after ':' or ',' and the indent, maxLineWidth, and maxIndentDepth fields are ignored.
    jsonWriterOptionsCompact :: Bool,
    -- | The string used to indent each level of nesting when pretty-printing
    jsonWriterOptionsIndent :: String,
    -- | The maximum estimated line width before an object or array breaks onto multiple lines. Ignored when compact is true.
    jsonWriterOptionsMaxLineWidth :: Int,
    -- | The nesting depth at or beyond which objects and arrays are always rendered inline, regardless of estimated width. Depth 0 is the top-level value, so maxIndentDepth = 0 renders the entire value on one line. None means no depth-based limit. Ignored when compact is true.
    jsonWriterOptionsMaxIndentDepth :: (Maybe Int)}
  deriving (Eq, Ord, Read, Show)

_JsonWriterOptions = Model.Name "hydra.core.json.model.JsonWriterOptions"

_JsonWriterOptions_compact = Model.Name "compact"

_JsonWriterOptions_indent = Model.Name "indent"

_JsonWriterOptions_maxLineWidth = Model.Name "maxLineWidth"

_JsonWriterOptions_maxIndentDepth = Model.Name "maxIndentDepth"

-- | A JSON value
data Value =
  -- | A JSON array
  ValueArray [Value] |
  -- | A boolean value
  ValueBoolean Bool |
  -- | JSON's null value
  ValueNull |
  -- | A numeric value
  ValueNumber Sci.Scientific |
  -- | A JSON object as an ordered list of key/value pairs. The ordering preserves the declaration order of the record from which the object was encoded, rather than alphabetizing keys. As a consequence, equality of Value objects is order-sensitive: two objects with the same pairs in a different order are equal as JSON, but not as Hydra Values.
  ValueObject [(String, Value)] |
  -- | A string value
  ValueString String
  deriving (Eq, Ord, Read, Show)

_Value = Model.Name "hydra.core.json.model.Value"

_Value_array = Model.Name "array"

_Value_boolean = Model.Name "boolean"

_Value_null = Model.Name "null"

_Value_number = Model.Name "number"

_Value_object = Model.Name "object"

_Value_string = Model.Name "string"