{- 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.WorkspaceFoldersInitializeParams where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson as Aeson
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Internal.Types.WorkspaceFolder
import qualified Language.LSP.Protocol.Types.Common

{-|

-}
data WorkspaceFoldersInitializeParams = WorkspaceFoldersInitializeParams 
  { {-|
  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
  -}
  WorkspaceFoldersInitializeParams
-> 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 -> WorkspaceFoldersInitializeParams -> ShowS
[WorkspaceFoldersInitializeParams] -> ShowS
WorkspaceFoldersInitializeParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceFoldersInitializeParams] -> ShowS
$cshowList :: [WorkspaceFoldersInitializeParams] -> ShowS
show :: WorkspaceFoldersInitializeParams -> String
$cshow :: WorkspaceFoldersInitializeParams -> String
showsPrec :: Int -> WorkspaceFoldersInitializeParams -> ShowS
$cshowsPrec :: Int -> WorkspaceFoldersInitializeParams -> ShowS
Show, WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
$c/= :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
== :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
$c== :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
Eq, Eq WorkspaceFoldersInitializeParams
WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Ordering
WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
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 :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
$cmin :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
max :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
$cmax :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams
>= :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
$c>= :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
> :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
$c> :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
<= :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
$c<= :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
< :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
$c< :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Bool
compare :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Ordering
$ccompare :: WorkspaceFoldersInitializeParams
-> WorkspaceFoldersInitializeParams -> Ordering
Ord, forall x.
Rep WorkspaceFoldersInitializeParams x
-> WorkspaceFoldersInitializeParams
forall x.
WorkspaceFoldersInitializeParams
-> Rep WorkspaceFoldersInitializeParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkspaceFoldersInitializeParams x
-> WorkspaceFoldersInitializeParams
$cfrom :: forall x.
WorkspaceFoldersInitializeParams
-> Rep WorkspaceFoldersInitializeParams x
Generic)
  deriving anyclass (WorkspaceFoldersInitializeParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceFoldersInitializeParams -> ()
$crnf :: WorkspaceFoldersInitializeParams -> ()
NFData, Eq WorkspaceFoldersInitializeParams
Int -> WorkspaceFoldersInitializeParams -> Int
WorkspaceFoldersInitializeParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceFoldersInitializeParams -> Int
$chash :: WorkspaceFoldersInitializeParams -> Int
hashWithSalt :: Int -> WorkspaceFoldersInitializeParams -> Int
$chashWithSalt :: Int -> WorkspaceFoldersInitializeParams -> Int
Hashable)
  deriving forall ann. [WorkspaceFoldersInitializeParams] -> Doc ann
forall ann. WorkspaceFoldersInitializeParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceFoldersInitializeParams] -> Doc ann
$cprettyList :: forall ann. [WorkspaceFoldersInitializeParams] -> Doc ann
pretty :: forall ann. WorkspaceFoldersInitializeParams -> Doc ann
$cpretty :: forall ann. WorkspaceFoldersInitializeParams -> Doc ann
Pretty via (ViaJSON WorkspaceFoldersInitializeParams)

instance Aeson.ToJSON WorkspaceFoldersInitializeParams where
  toJSON :: WorkspaceFoldersInitializeParams -> Value
toJSON (WorkspaceFoldersInitializeParams Maybe ([WorkspaceFolder] |? Null)
arg0) = [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
"workspaceFolders" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ([WorkspaceFolder] |? Null)
arg0]

instance Aeson.FromJSON WorkspaceFoldersInitializeParams where
  parseJSON :: Value -> Parser WorkspaceFoldersInitializeParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceFoldersInitializeParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ([WorkspaceFolder] |? Null)
-> WorkspaceFoldersInitializeParams
WorkspaceFoldersInitializeParams 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
"workspaceFolders"