{- 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.ConfigurationParams 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.ConfigurationItem
import qualified Language.LSP.Protocol.Types.Common

{-|
The parameters of a configuration request.
-}
data ConfigurationParams = ConfigurationParams 
  { {-|

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

instance Aeson.ToJSON ConfigurationParams where
  toJSON :: ConfigurationParams -> Value
toJSON (ConfigurationParams [ConfigurationItem]
arg0) = [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
$  [[Key
"items" Key -> [ConfigurationItem] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [ConfigurationItem]
arg0]]

instance Aeson.FromJSON ConfigurationParams where
  parseJSON :: Value -> Parser ConfigurationParams
parseJSON = String
-> (Object -> Parser ConfigurationParams)
-> Value
-> Parser ConfigurationParams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ConfigurationParams" ((Object -> Parser ConfigurationParams)
 -> Value -> Parser ConfigurationParams)
-> (Object -> Parser ConfigurationParams)
-> Value
-> Parser ConfigurationParams
forall a b. (a -> b) -> a -> b
$ \Object
arg -> [ConfigurationItem] -> ConfigurationParams
ConfigurationParams ([ConfigurationItem] -> ConfigurationParams)
-> Parser [ConfigurationItem] -> Parser ConfigurationParams
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser [ConfigurationItem]
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"items"