-- |
-- Module: Network.Greskell.WebSocket.Client.Options
-- Description: Options to create a Client
-- Maintainer: Toshio Ito <debug.ito@gmail.com>
--
-- 
module Network.Greskell.WebSocket.Client.Options
       ( -- * Options
         Options,
         defOptions,
         -- ** accessor functions
         connectionSettings,
         batchSize,
         language,
         aliases,
         scriptEvaluationTimeout,
         -- * Settings
         module Network.Greskell.WebSocket.Connection.Settings
       ) where

import Data.Greskell.GraphSON (GValue)
import Data.HashMap.Strict (HashMap)
import Data.Text (Text)

import Network.Greskell.WebSocket.Connection (Connection)
import Network.Greskell.WebSocket.Connection.Settings

-- | Configuration options to create a client for Gremlin Server.
--
-- You can get the default 'Options' by 'defOptions' function, and
-- customize its fields by accessor functions.
data Options =
  Options
  { Options -> Settings GValue
connectionSettings :: !(Settings GValue),
    -- ^ Settings for the underlying 'Connection'. Default:
    -- 'defJSONSettings'.
    Options -> Maybe Int
batchSize :: !(Maybe Int),
    -- ^ \"batchSize\" field for \"eval\" operation. Default:
    -- 'Nothing'.
    Options -> Maybe Text
language :: !(Maybe Text),
    -- ^ \"language\" field for \"eval\" operation. Default:
    -- 'Nothing'.
    Options -> Maybe (HashMap Text Text)
aliases :: !(Maybe (HashMap Text Text)),
    -- ^ \"aliases\" field for \"eval\" operation. Default: 'Nothing'.
    Options -> Maybe Int
scriptEvaluationTimeout :: !(Maybe Int)
    -- ^ \"scriptEvaluationTimeout\" field for \"eval\"
    -- operation. Default: 'Nothing'.
  }

defOptions :: Options
defOptions :: Options
defOptions =
  Options :: Settings GValue
-> Maybe Int
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Int
-> Options
Options
  { connectionSettings :: Settings GValue
connectionSettings = Settings GValue
forall s. FromGraphSON s => Settings s
defJSONSettings,
    batchSize :: Maybe Int
batchSize = Maybe Int
forall a. Maybe a
Nothing,
    language :: Maybe Text
language = Maybe Text
forall a. Maybe a
Nothing,
    aliases :: Maybe (HashMap Text Text)
aliases = Maybe (HashMap Text Text)
forall a. Maybe a
Nothing,
    scriptEvaluationTimeout :: Maybe Int
scriptEvaluationTimeout = Maybe Int
forall a. Maybe a
Nothing
  }