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

{-|
The watched files change notification's parameters.
-}
data DidChangeWatchedFilesParams = DidChangeWatchedFilesParams 
  { {-|
  The actual file events.
  -}
  DidChangeWatchedFilesParams -> [FileEvent]
_changes :: [Language.LSP.Protocol.Internal.Types.FileEvent.FileEvent]
  }
  deriving stock (Int -> DidChangeWatchedFilesParams -> ShowS
[DidChangeWatchedFilesParams] -> ShowS
DidChangeWatchedFilesParams -> String
(Int -> DidChangeWatchedFilesParams -> ShowS)
-> (DidChangeWatchedFilesParams -> String)
-> ([DidChangeWatchedFilesParams] -> ShowS)
-> Show DidChangeWatchedFilesParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DidChangeWatchedFilesParams -> ShowS
showsPrec :: Int -> DidChangeWatchedFilesParams -> ShowS
$cshow :: DidChangeWatchedFilesParams -> String
show :: DidChangeWatchedFilesParams -> String
$cshowList :: [DidChangeWatchedFilesParams] -> ShowS
showList :: [DidChangeWatchedFilesParams] -> ShowS
Show, DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
(DidChangeWatchedFilesParams
 -> DidChangeWatchedFilesParams -> Bool)
-> (DidChangeWatchedFilesParams
    -> DidChangeWatchedFilesParams -> Bool)
-> Eq DidChangeWatchedFilesParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
== :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$c/= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
/= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
Eq, Eq DidChangeWatchedFilesParams
Eq DidChangeWatchedFilesParams =>
(DidChangeWatchedFilesParams
 -> DidChangeWatchedFilesParams -> Ordering)
-> (DidChangeWatchedFilesParams
    -> DidChangeWatchedFilesParams -> Bool)
-> (DidChangeWatchedFilesParams
    -> DidChangeWatchedFilesParams -> Bool)
-> (DidChangeWatchedFilesParams
    -> DidChangeWatchedFilesParams -> Bool)
-> (DidChangeWatchedFilesParams
    -> DidChangeWatchedFilesParams -> Bool)
-> (DidChangeWatchedFilesParams
    -> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams)
-> (DidChangeWatchedFilesParams
    -> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams)
-> Ord DidChangeWatchedFilesParams
DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> Ordering
DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
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 :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> Ordering
compare :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> Ordering
$c< :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
< :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$c<= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
<= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$c> :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
> :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$c>= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
>= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$cmax :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
max :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
$cmin :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
min :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
Ord, (forall x.
 DidChangeWatchedFilesParams -> Rep DidChangeWatchedFilesParams x)
-> (forall x.
    Rep DidChangeWatchedFilesParams x -> DidChangeWatchedFilesParams)
-> Generic DidChangeWatchedFilesParams
forall x.
Rep DidChangeWatchedFilesParams x -> DidChangeWatchedFilesParams
forall x.
DidChangeWatchedFilesParams -> Rep DidChangeWatchedFilesParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DidChangeWatchedFilesParams -> Rep DidChangeWatchedFilesParams x
from :: forall x.
DidChangeWatchedFilesParams -> Rep DidChangeWatchedFilesParams x
$cto :: forall x.
Rep DidChangeWatchedFilesParams x -> DidChangeWatchedFilesParams
to :: forall x.
Rep DidChangeWatchedFilesParams x -> DidChangeWatchedFilesParams
Generic)
  deriving anyclass (DidChangeWatchedFilesParams -> ()
(DidChangeWatchedFilesParams -> ())
-> NFData DidChangeWatchedFilesParams
forall a. (a -> ()) -> NFData a
$crnf :: DidChangeWatchedFilesParams -> ()
rnf :: DidChangeWatchedFilesParams -> ()
NFData, Eq DidChangeWatchedFilesParams
Eq DidChangeWatchedFilesParams =>
(Int -> DidChangeWatchedFilesParams -> Int)
-> (DidChangeWatchedFilesParams -> Int)
-> Hashable DidChangeWatchedFilesParams
Int -> DidChangeWatchedFilesParams -> Int
DidChangeWatchedFilesParams -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DidChangeWatchedFilesParams -> Int
hashWithSalt :: Int -> DidChangeWatchedFilesParams -> Int
$chash :: DidChangeWatchedFilesParams -> Int
hash :: DidChangeWatchedFilesParams -> Int
Hashable)
  deriving (forall ann. DidChangeWatchedFilesParams -> Doc ann)
-> (forall ann. [DidChangeWatchedFilesParams] -> Doc ann)
-> Pretty DidChangeWatchedFilesParams
forall ann. [DidChangeWatchedFilesParams] -> Doc ann
forall ann. DidChangeWatchedFilesParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DidChangeWatchedFilesParams -> Doc ann
pretty :: forall ann. DidChangeWatchedFilesParams -> Doc ann
$cprettyList :: forall ann. [DidChangeWatchedFilesParams] -> Doc ann
prettyList :: forall ann. [DidChangeWatchedFilesParams] -> Doc ann
Pretty via (ViaJSON DidChangeWatchedFilesParams)

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

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