zw&      !"#$%(Haskell types for various JSON patterns.(c) Adrian Dawid 2015BSD3adriandwd@gmail.comstableNone0=HKMHHaskell type for the JSON scheme, that is returned by the LIST function.JHaskell type for the JSON scheme, that is returned by the SEARCH function. Represents a path, as it is returned by the LIST and SEARCH function. Right now it is not actually used, but it might be useful in the future.&jTypeClass for OrchestrateQueryResult and OrchestrateListResult, it makes it possible to have one function(7), that extractes the values from both of those types.dRepresents a collection inside an OrchestrateApplication, it stores all data necessary to access it.vA data type, that represents an Orchestrate application. It stores an api key (generated online) and a https-endpoint.$ &'()*+,-.    &'()*+,-.>All functions which interact with the Orchestrate.io REST API.(c) Adrian Dawid 2015BSD3adriandwd@gmail.comstableNoneM The l function validates your API key, by making an authenticated HEAD request to the endpoint specified in the u record. The function returns False when the key is invalid or no connection with the endpoint could be established.The  function lists the contents of the specified collection, by making GET request to the /$collection?limit=$limit endpoint. For more information check out the Orchestrate.io API docs:  0https://orchestrate.io/docs/apiref#keyvalue-lista. If connecting to the api fails, or the api key stored in the application record is invlaid, /0 is returned. Otherwise an array of the type 0(see the documentation of Z for more information) is returned, it contains the values from the HTTP response(see  0https://orchestrate.io/docs/apiref#keyvalue-list8 for an example of how the response looks like in JSON).Example:  let dbApplication = DB.createStdApplication "APPLICATION_NAME" "API_KEY" let dbCollection = DB.createStdCollection "COLLECTION_NAME" dbContents <- DB.orchestrateCollectionList dbApplication dbCollection 10 The ( function stores a Haskell value(with a 1 instance) in an Orchestrate.io database. It does so by making a POST request to the /$collection endpoint(Offical API docs: 0https://orchestrate.io/docs/apiref#keyvalue-post). This function does not need a user specified key, because it uses a server-generated key, if you want to know the key use  instead of this function.Example:  data TestRecord = TestRecord { string :: String , number :: Int } deriving (Show,Read,Generic,Eq) instance FromJSON TestRecord instance ToJSON TestRecord let dbApplication = DB.createStdApplication "APPLICATION_NAME" "API_KEY" let dbCollection = DB.createStdCollection "COLLECTION_NAME" let testRecord = TestRecord {string = "You may delay, but time will not!",number = 903} _ <- DB.orchestrateCollectionPutWithoutKey dbApplication dbCollection testRecord The ( function stores a Haskell value(with a 1 instance) in an Orchestrate.io database. It does so by making a PUT request to the /$collection/$key endpoint(Offical API docs: /https://orchestrate.io/docs/apiref#keyvalue-putV). In order to upload a Haskell Value to the database, it must have an instance of 1% because this client library uses H to convert Haskel Values to JSON, which is required by Orchestrate.io.Example:  data TestRecord = TestRecord { string :: String , number :: Int } deriving (Show,Read,Generic,Eq) instance FromJSON TestRecord instance ToJSON TestRecord let dbApplication = DB.createStdApplication "APPLICATION_NAME" "API_KEY" let dbCollection = DB.createStdCollection "COLLECTION_NAME" let testRecord = TestRecord {string = "You may delay, but time will not!",number = 903} _ <- DB.orchestrateCollectionPutWithoutKey dbApplication dbCollection KEY testRecord The  function request a value from an Orchestrate.io database, and tries to convert it to the specified Haskell type, if either gettings the value from the database or converting it to the Haskell type fails /w is returned. The value is requested by making a GET request to the /$collection/$key endpoint(Offical documentation: /https://orchestrate.io/docs/apiref#keyvalue-get)Example:  data TestRecord = TestRecord { string :: String , number :: Int } deriving (Show,Read,Generic,Eq) instance FromJSON TestRecord instance ToJSON TestRecord let dbApplication = DB.createStdApplication "APPLICATION_NAME" "API_KEY" let dbCollection = DB.createStdCollection "COLLECTION_NAME" let testRecord = TestRecord {string = "You may delay, but time will not!",number = 903} dbValue <- DB.orchestrateCollectionGet dbApplication dbCollection KEY :: IO (Maybe TestRecord) The   function deletes a value from an Orchestrate.io database. This is done by making a DELETE request to the /$collection/$key endpoint(Offical documentation: 2https://orchestrate.io/docs/apiref#keyvalue-delete)Example:  data TestRecord = TestRecord { string :: String , number :: Int } deriving (Show,Read,Generic,Eq) instance FromJSON TestRecord instance ToJSON TestRecord let dbApplication = DB.createStdApplication "APPLICATION_NAME" "API_KEY" let dbCollection = DB.createStdCollection "COLLECTION_NAME" _ <- DB.orchestrateCollectionKey dbApplication dbCollection KEY !The ! function deletes a collection from an Orchestrate.io application. This is done by making a DELETE request to the /$collection endpoint(Offical documentation: 5https://orchestrate.io/docs/apiref#collections-delete)Example:  let dbApplication = DB.createStdApplication "APPLICATION_NAME" "API_KEY" let dbCollection = DB.createStdCollection "COLLECTION_NAME" _ <- DB.orchestrateCollectionDelete dbApplication dbCollection " Please see #\ for more information. This function just calls it without an offset and with a limit of 10.#The #V function searches for the query in the database and returns an array of the type "2 [0]". Nothing is returned when establishing a connection or authenticating failed. The function uses the SEARCH method of the Orchestrate.io API (Offical documentation: 4https://orchestrate.io/docs/apiref#search-collectionO) , but automatically parsers the response. It returns a tupel of the type (2([0],3)), the boolean indicates wether or not more results are availble on the server. If that is true, the function should be called again with an increased offset, until (Just _,False) is returned.Example:  dbSearchResults query num = let results = DB.orchestrateCollectionSearchWithOffset query num (num+10) let currentResults = fromJust $ fst results if snd results then currentResults:(dbSearchResults query (num+10)) else currentResults let dbApplication = DB.createStdApplication "APPLICATION_NAME" "API_KEY" let dbCollection = DB.createStdCollection "COLLECTION_NAME" let completeDBSearchResults = dbSearchResults QUERY 0  !"#45  !"# ! "#  !"#45(c) Adrian Dawid 2015BSD3adriandwd@gmail.comstableNone$4Creates an application record with the std.("https:/api.orchestrate.io v0") enpoint.%Creates an collection record.$% !"#$%! "#%$$%6       !"#$%&'()*+,-./0123453670189:;<=>OrchestrateDB-1.0.0.2Database.Orchestrate.TypesDatabase.Orchestrate.RESTDatabase.OrchestrateDataAesonOrchestrateListResultorchestrateListResultPathorchestrateListResultValue'orchestrateListResultReftimeQueryResultOrchestrateQueryResultorchestrateQueryResultPathorchestrateQueryResultValueorchestrateQueryResultScore(orchestrateQueryResultReftimeQueryResultOrchestratePathorchestratePathCollectionorchestratePathKindorchestratePathKeyorchestratePathReforchestratePathReftimeresultValuesAsListOrchestrateCollectioncollectionNameOrchestrateApplicationapplicationNameapiKey httpsEndpointvalidateApplicationorchestrateCollectionList"orchestrateCollectionPutWithoutKeyorchestrateCollectionPutorchestrateCollectionGetorchestrateCollectionDeleteKeyorchestrateCollectionDeleteorchestrateCollectionSearch%orchestrateCollectionSearchWithOffsetcreateStdApplicationcreateStdCollectionOrchestrateIntermediateResult4$fOrchestrateIntermediateResultOrchestrateListResult$fToJSONOrchestrateListResult$fFromJSONOrchestrateListResult5$fOrchestrateIntermediateResultOrchestrateQueryResult$fToJSONOrchestrateQueryResult $fFromJSONOrchestrateQueryResult$fToJSONOrchestratePath$fFromJSONOrchestratePathbase Data.MaybeNothing aeson-0.9.0.1Data.Aeson.Types.InternalObjectData.Aeson.Types.ClassToJSONMaybeghc-prim GHC.TypesBoolparseListResponseBodyparseQueryResponseBody