{- 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.InitializeParams 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.Internal.Types.WorkspaceFolder
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Uri

{-|

-}
data InitializeParams = InitializeParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  InitializeParams -> 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.
  -}
  InitializeParams -> 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
  -}
  InitializeParams
-> Maybe
     (Rec
        (("name" .== Text)
         .+ (Extend "version" (Maybe Text) ('R '[]) .+ 'R '[])))
_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
  -}
  InitializeParams -> Maybe Text
_locale :: (Maybe Data.Text.Text)
  , {-|
  The rootPath of the workspace. Is null
  if no folder is open.

  @deprecated in favour of rootUri.
  -}
  InitializeParams -> 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.
  -}
  InitializeParams -> 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)
  -}
  InitializeParams -> ClientCapabilities
_capabilities :: Language.LSP.Protocol.Internal.Types.ClientCapabilities.ClientCapabilities
  , {-|
  User provided initialization options.
  -}
  InitializeParams -> Maybe Value
_initializationOptions :: (Maybe Data.Aeson.Value)
  , {-|
  The initial trace setting. If omitted trace is disabled ('off').
  -}
  InitializeParams -> Maybe TraceValues
_trace :: (Maybe Language.LSP.Protocol.Internal.Types.TraceValues.TraceValues)
  , {-|
  The workspace folders configured in the client when the server starts.

  This property is only available if the client supports workspace folders.
  It can be `null` if the client supports workspace folders but none are
  configured.

  @since 3.6.0
  -}
  InitializeParams -> Maybe ([WorkspaceFolder] |? Null)
_workspaceFolders :: (Maybe ([Language.LSP.Protocol.Internal.Types.WorkspaceFolder.WorkspaceFolder] Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null))
  }
  deriving stock (Int -> InitializeParams -> ShowS
[InitializeParams] -> ShowS
InitializeParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InitializeParams] -> ShowS
$cshowList :: [InitializeParams] -> ShowS
show :: InitializeParams -> String
$cshow :: InitializeParams -> String
showsPrec :: Int -> InitializeParams -> ShowS
$cshowsPrec :: Int -> InitializeParams -> ShowS
Show, InitializeParams -> InitializeParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InitializeParams -> InitializeParams -> Bool
$c/= :: InitializeParams -> InitializeParams -> Bool
== :: InitializeParams -> InitializeParams -> Bool
$c== :: InitializeParams -> InitializeParams -> Bool
Eq, Eq InitializeParams
InitializeParams -> InitializeParams -> Bool
InitializeParams -> InitializeParams -> Ordering
InitializeParams -> InitializeParams -> InitializeParams
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
min :: InitializeParams -> InitializeParams -> InitializeParams
$cmin :: InitializeParams -> InitializeParams -> InitializeParams
max :: InitializeParams -> InitializeParams -> InitializeParams
$cmax :: InitializeParams -> InitializeParams -> InitializeParams
>= :: InitializeParams -> InitializeParams -> Bool
$c>= :: InitializeParams -> InitializeParams -> Bool
> :: InitializeParams -> InitializeParams -> Bool
$c> :: InitializeParams -> InitializeParams -> Bool
<= :: InitializeParams -> InitializeParams -> Bool
$c<= :: InitializeParams -> InitializeParams -> Bool
< :: InitializeParams -> InitializeParams -> Bool
$c< :: InitializeParams -> InitializeParams -> Bool
compare :: InitializeParams -> InitializeParams -> Ordering
$ccompare :: InitializeParams -> InitializeParams -> Ordering
Ord, forall x. Rep InitializeParams x -> InitializeParams
forall x. InitializeParams -> Rep InitializeParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InitializeParams x -> InitializeParams
$cfrom :: forall x. InitializeParams -> Rep InitializeParams x
Generic)
  deriving anyclass (InitializeParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: InitializeParams -> ()
$crnf :: InitializeParams -> ()
NFData, Eq InitializeParams
Int -> InitializeParams -> Int
InitializeParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: InitializeParams -> Int
$chash :: InitializeParams -> Int
hashWithSalt :: Int -> InitializeParams -> Int
$chashWithSalt :: Int -> InitializeParams -> Int
Hashable)
  deriving forall ann. [InitializeParams] -> Doc ann
forall ann. InitializeParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [InitializeParams] -> Doc ann
$cprettyList :: forall ann. [InitializeParams] -> Doc ann
pretty :: forall ann. InitializeParams -> Doc ann
$cpretty :: forall ann. InitializeParams -> Doc ann
Pretty via (ViaJSON InitializeParams)

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

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