{- ORMOLU_DISABLE -}
{- HLINT ignore -}
-- THIS IS A GENERATED FILE, DO NOT EDIT

{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.UInitializeParams where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson
import qualified Data.Aeson as Aeson
import qualified Data.Row as Row
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Data.Text
import qualified Language.LSP.Protocol.Internal.Types.ClientCapabilities
import qualified Language.LSP.Protocol.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Internal.Types.TraceValues
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Uri

{-|
The initialize parameters
-}
data UInitializeParams = UInitializeParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  UInitializeParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The process Id of the parent process that started
  the server.

  Is `null` if the process has not been started by another process.
  If the parent process is not alive then the server should exit.
  -}
  UInitializeParams -> Int32 |? Null
_processId :: (Language.LSP.Protocol.Types.Common.Int32 Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|
  Information about the client

  @since 3.15.0
  -}
  UInitializeParams
-> Maybe
     (Rec (("name" .== Text) .+ (("version" .== Maybe Text) .+ Empty)))
_clientInfo :: (Maybe (Row.Rec ("name" Row..== Data.Text.Text Row..+ ("version" Row..== (Maybe Data.Text.Text) Row..+ Row.Empty))))
  , {-|
  The locale the client is currently showing the user interface
  in. This must not necessarily be the locale of the operating
  system.

  Uses IETF language tags as the value's syntax
  (See https://en.wikipedia.org/wiki/IETF_language_tag)

  @since 3.16.0
  -}
  UInitializeParams -> Maybe Text
_locale :: (Maybe Data.Text.Text)
  , {-|
  The rootPath of the workspace. Is null
  if no folder is open.

  @deprecated in favour of rootUri.
  -}
  UInitializeParams -> Maybe (Text |? Null)
_rootPath :: (Maybe (Data.Text.Text Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null))
  , {-|
  The rootUri of the workspace. Is null if no
  folder is open. If both `rootPath` and `rootUri` are set
  `rootUri` wins.

  @deprecated in favour of workspaceFolders.
  -}
  UInitializeParams -> Uri |? Null
_rootUri :: (Language.LSP.Protocol.Types.Uri.Uri Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|
  The capabilities provided by the client (editor or tool)
  -}
  UInitializeParams -> ClientCapabilities
_capabilities :: Language.LSP.Protocol.Internal.Types.ClientCapabilities.ClientCapabilities
  , {-|
  User provided initialization options.
  -}
  UInitializeParams -> Maybe Value
_initializationOptions :: (Maybe Data.Aeson.Value)
  , {-|
  The initial trace setting. If omitted trace is disabled ('off').
  -}
  UInitializeParams -> Maybe TraceValues
_trace :: (Maybe Language.LSP.Protocol.Internal.Types.TraceValues.TraceValues)
  }
  deriving stock (Int -> UInitializeParams -> ShowS
[UInitializeParams] -> ShowS
UInitializeParams -> String
(Int -> UInitializeParams -> ShowS)
-> (UInitializeParams -> String)
-> ([UInitializeParams] -> ShowS)
-> Show UInitializeParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UInitializeParams -> ShowS
showsPrec :: Int -> UInitializeParams -> ShowS
$cshow :: UInitializeParams -> String
show :: UInitializeParams -> String
$cshowList :: [UInitializeParams] -> ShowS
showList :: [UInitializeParams] -> ShowS
Show, UInitializeParams -> UInitializeParams -> Bool
(UInitializeParams -> UInitializeParams -> Bool)
-> (UInitializeParams -> UInitializeParams -> Bool)
-> Eq UInitializeParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UInitializeParams -> UInitializeParams -> Bool
== :: UInitializeParams -> UInitializeParams -> Bool
$c/= :: UInitializeParams -> UInitializeParams -> Bool
/= :: UInitializeParams -> UInitializeParams -> Bool
Eq, Eq UInitializeParams
Eq UInitializeParams =>
(UInitializeParams -> UInitializeParams -> Ordering)
-> (UInitializeParams -> UInitializeParams -> Bool)
-> (UInitializeParams -> UInitializeParams -> Bool)
-> (UInitializeParams -> UInitializeParams -> Bool)
-> (UInitializeParams -> UInitializeParams -> Bool)
-> (UInitializeParams -> UInitializeParams -> UInitializeParams)
-> (UInitializeParams -> UInitializeParams -> UInitializeParams)
-> Ord UInitializeParams
UInitializeParams -> UInitializeParams -> Bool
UInitializeParams -> UInitializeParams -> Ordering
UInitializeParams -> UInitializeParams -> UInitializeParams
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: UInitializeParams -> UInitializeParams -> Ordering
compare :: UInitializeParams -> UInitializeParams -> Ordering
$c< :: UInitializeParams -> UInitializeParams -> Bool
< :: UInitializeParams -> UInitializeParams -> Bool
$c<= :: UInitializeParams -> UInitializeParams -> Bool
<= :: UInitializeParams -> UInitializeParams -> Bool
$c> :: UInitializeParams -> UInitializeParams -> Bool
> :: UInitializeParams -> UInitializeParams -> Bool
$c>= :: UInitializeParams -> UInitializeParams -> Bool
>= :: UInitializeParams -> UInitializeParams -> Bool
$cmax :: UInitializeParams -> UInitializeParams -> UInitializeParams
max :: UInitializeParams -> UInitializeParams -> UInitializeParams
$cmin :: UInitializeParams -> UInitializeParams -> UInitializeParams
min :: UInitializeParams -> UInitializeParams -> UInitializeParams
Ord, (forall x. UInitializeParams -> Rep UInitializeParams x)
-> (forall x. Rep UInitializeParams x -> UInitializeParams)
-> Generic UInitializeParams
forall x. Rep UInitializeParams x -> UInitializeParams
forall x. UInitializeParams -> Rep UInitializeParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UInitializeParams -> Rep UInitializeParams x
from :: forall x. UInitializeParams -> Rep UInitializeParams x
$cto :: forall x. Rep UInitializeParams x -> UInitializeParams
to :: forall x. Rep UInitializeParams x -> UInitializeParams
Generic)
  deriving anyclass (UInitializeParams -> ()
(UInitializeParams -> ()) -> NFData UInitializeParams
forall a. (a -> ()) -> NFData a
$crnf :: UInitializeParams -> ()
rnf :: UInitializeParams -> ()
NFData, Eq UInitializeParams
Eq UInitializeParams =>
(Int -> UInitializeParams -> Int)
-> (UInitializeParams -> Int) -> Hashable UInitializeParams
Int -> UInitializeParams -> Int
UInitializeParams -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> UInitializeParams -> Int
hashWithSalt :: Int -> UInitializeParams -> Int
$chash :: UInitializeParams -> Int
hash :: UInitializeParams -> Int
Hashable)
  deriving (forall ann. UInitializeParams -> Doc ann)
-> (forall ann. [UInitializeParams] -> Doc ann)
-> Pretty UInitializeParams
forall ann. [UInitializeParams] -> Doc ann
forall ann. UInitializeParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. UInitializeParams -> Doc ann
pretty :: forall ann. UInitializeParams -> Doc ann
$cprettyList :: forall ann. [UInitializeParams] -> Doc ann
prettyList :: forall ann. [UInitializeParams] -> Doc ann
Pretty via (ViaJSON UInitializeParams)

instance Aeson.ToJSON UInitializeParams where
  toJSON :: UInitializeParams -> Value
toJSON (UInitializeParams Maybe ProgressToken
arg0 Int32 |? Null
arg1 Maybe
  (Rec (("name" .== Text) .+ (("version" .== Maybe Text) .+ Empty)))
arg2 Maybe Text
arg3 Maybe (Text |? Null)
arg4 Uri |? Null
arg5 ClientCapabilities
arg6 Maybe Value
arg7 Maybe TraceValues
arg8) = [Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [String
"workDoneToken" String -> Maybe ProgressToken -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
    ,[Key
"processId" Key -> (Int32 |? Null) -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Int32 |? Null
arg1]
    ,String
"clientInfo" String
-> Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
-> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe
  (Rec (("name" .== Text) .+ (("version" .== Maybe Text) .+ Empty)))
Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
arg2
    ,String
"locale" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg3
    ,String
"rootPath" String -> Maybe (Text |? Null) -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Text |? Null)
arg4
    ,[Key
"rootUri" Key -> (Uri |? Null) -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri |? Null
arg5]
    ,[Key
"capabilities" Key -> ClientCapabilities -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= ClientCapabilities
arg6]
    ,String
"initializationOptions" String -> Maybe Value -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Value
arg7
    ,String
"trace" String -> Maybe TraceValues -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe TraceValues
arg8]

instance Aeson.FromJSON UInitializeParams where
  parseJSON :: Value -> Parser UInitializeParams
parseJSON = String
-> (Object -> Parser UInitializeParams)
-> Value
-> Parser UInitializeParams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"_InitializeParams" ((Object -> Parser UInitializeParams)
 -> Value -> Parser UInitializeParams)
-> (Object -> Parser UInitializeParams)
-> Value
-> Parser UInitializeParams
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> (Int32 |? Null)
-> Maybe
     (Rec (("name" .== Text) .+ (("version" .== Maybe Text) .+ Empty)))
-> Maybe Text
-> Maybe (Text |? Null)
-> (Uri |? Null)
-> ClientCapabilities
-> Maybe Value
-> Maybe TraceValues
-> UInitializeParams
Maybe ProgressToken
-> (Int32 |? Null)
-> Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
-> Maybe Text
-> Maybe (Text |? Null)
-> (Uri |? Null)
-> ClientCapabilities
-> Maybe Value
-> Maybe TraceValues
-> UInitializeParams
UInitializeParams (Maybe ProgressToken
 -> (Int32 |? Null)
 -> Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
 -> Maybe Text
 -> Maybe (Text |? Null)
 -> (Uri |? Null)
 -> ClientCapabilities
 -> Maybe Value
 -> Maybe TraceValues
 -> UInitializeParams)
-> Parser (Maybe ProgressToken)
-> Parser
     ((Int32 |? Null)
      -> Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
      -> Maybe Text
      -> Maybe (Text |? Null)
      -> (Uri |? Null)
      -> ClientCapabilities
      -> Maybe Value
      -> Maybe TraceValues
      -> UInitializeParams)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe ProgressToken)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneToken" Parser
  ((Int32 |? Null)
   -> Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
   -> Maybe Text
   -> Maybe (Text |? Null)
   -> (Uri |? Null)
   -> ClientCapabilities
   -> Maybe Value
   -> Maybe TraceValues
   -> UInitializeParams)
-> Parser (Int32 |? Null)
-> Parser
     (Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
      -> Maybe Text
      -> Maybe (Text |? Null)
      -> (Uri |? Null)
      -> ClientCapabilities
      -> Maybe Value
      -> Maybe TraceValues
      -> UInitializeParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Int32 |? Null)
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"processId" Parser
  (Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text]))
   -> Maybe Text
   -> Maybe (Text |? Null)
   -> (Uri |? Null)
   -> ClientCapabilities
   -> Maybe Value
   -> Maybe TraceValues
   -> UInitializeParams)
-> Parser
     (Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text])))
-> Parser
     (Maybe Text
      -> Maybe (Text |? Null)
      -> (Uri |? Null)
      -> ClientCapabilities
      -> Maybe Value
      -> Maybe TraceValues
      -> UInitializeParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object
-> Key
-> Parser
     (Maybe (Rec ('R '["name" ':-> Text, "version" ':-> Maybe Text])))
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"clientInfo" Parser
  (Maybe Text
   -> Maybe (Text |? Null)
   -> (Uri |? Null)
   -> ClientCapabilities
   -> Maybe Value
   -> Maybe TraceValues
   -> UInitializeParams)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Text |? Null)
      -> (Uri |? Null)
      -> ClientCapabilities
      -> Maybe Value
      -> Maybe TraceValues
      -> UInitializeParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"locale" Parser
  (Maybe (Text |? Null)
   -> (Uri |? Null)
   -> ClientCapabilities
   -> Maybe Value
   -> Maybe TraceValues
   -> UInitializeParams)
-> Parser (Maybe (Text |? Null))
-> Parser
     ((Uri |? Null)
      -> ClientCapabilities
      -> Maybe Value
      -> Maybe TraceValues
      -> UInitializeParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe (Text |? Null))
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"rootPath" Parser
  ((Uri |? Null)
   -> ClientCapabilities
   -> Maybe Value
   -> Maybe TraceValues
   -> UInitializeParams)
-> Parser (Uri |? Null)
-> Parser
     (ClientCapabilities
      -> Maybe Value -> Maybe TraceValues -> UInitializeParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Uri |? Null)
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"rootUri" Parser
  (ClientCapabilities
   -> Maybe Value -> Maybe TraceValues -> UInitializeParams)
-> Parser ClientCapabilities
-> Parser (Maybe Value -> Maybe TraceValues -> UInitializeParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser ClientCapabilities
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"capabilities" Parser (Maybe Value -> Maybe TraceValues -> UInitializeParams)
-> Parser (Maybe Value)
-> Parser (Maybe TraceValues -> UInitializeParams)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Value)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"initializationOptions" Parser (Maybe TraceValues -> UInitializeParams)
-> Parser (Maybe TraceValues) -> Parser UInitializeParams
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe TraceValues)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"trace"