Something went wrong. Try again.
Dagger 1.0.0 beta SDK experiments
dagger purescript gleam clojure
Something went wrong. Try again.
2.8 kB · 91 lines
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192-- Generated by scripts/generate.mjs. Do not edit.module Dagger.JSONValue ( asArray , asBoolean , asInteger , asString , contents , contentsWith , ContentsOpts , defaultContentsOpts , field , fields , id , newBoolean , newInteger , newString , withContents , withField ) where
import Data.Maybe (Maybe(..))import Effect.Aff (Aff)import Dagger.Internal.Runtime as Rimport Dagger.Types as T
-- | Decode an array from jsonasArray :: T.JSONValue -> Aff (Array T.JSONValue)asArray = R.objectList "JSONValue" "asArray" []
-- | Decode a boolean from jsonasBoolean :: T.JSONValue -> Aff BooleanasBoolean = R.scalar "asBoolean" []
-- | Decode an integer from jsonasInteger :: T.JSONValue -> Aff IntasInteger = R.scalar "asInteger" []
-- | Decode a string from jsonasString :: T.JSONValue -> Aff StringasString = R.scalar "asString" []
type ContentsOpts = { pretty :: Maybe Boolean , indent :: Maybe String }
defaultContentsOpts :: ContentsOptsdefaultContentsOpts = { pretty: Nothing , indent: Nothing }
-- | Return the value encoded as jsoncontents :: T.JSONValue -> Aff T.JSONcontents = contentsWith defaultContentsOpts
-- | Return the value encoded as jsoncontentsWith :: ContentsOpts -> T.JSONValue -> Aff T.JSONcontentsWith opts = R.scalar "contents" [R.optional (R.argument "pretty" "Boolean") opts.pretty, R.optional (R.argument "indent" "String") opts.indent]
-- | Lookup the field at the given path, and return its value.field :: (Array String) -> T.JSONValue -> T.JSONValuefield argPath = R.select "field" [R.argument "path" "[String!]!" argPath]
-- | List fields of the encoded objectfields :: T.JSONValue -> Aff (Array String)fields = R.scalar "fields" []
-- | A unique identifier for this JSONValue.id :: T.JSONValue -> Aff T.IDid = R.scalar "id" []
-- | Encode a boolean to jsonnewBoolean :: Boolean -> T.JSONValue -> T.JSONValuenewBoolean argValue = R.select "newBoolean" [R.argument "value" "Boolean!" argValue]
-- | Encode an integer to jsonnewInteger :: Int -> T.JSONValue -> T.JSONValuenewInteger argValue = R.select "newInteger" [R.argument "value" "Int!" argValue]
-- | Encode a string to jsonnewString :: String -> T.JSONValue -> T.JSONValuenewString argValue = R.select "newString" [R.argument "value" "String!" argValue]
-- | Return a new json value, decoded from the given contentwithContents :: T.JSON -> T.JSONValue -> T.JSONValuewithContents argContents = R.select "withContents" [R.argument "contents" "JSON!" argContents]
-- | Set a new field at the given pathwithField :: (Array String) -> T.JSONValue -> T.JSONValue -> T.JSONValuewithField argPath argValue = R.select "withField" [R.argument "path" "[String!]!" argPath, R.objectArgument "value" "ID!" argValue]