{- 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DidChangeWatchedFilesParams] -> ShowS
$cshowList :: [DidChangeWatchedFilesParams] -> ShowS
show :: DidChangeWatchedFilesParams -> String
$cshow :: DidChangeWatchedFilesParams -> String
showsPrec :: Int -> DidChangeWatchedFilesParams -> ShowS
$cshowsPrec :: Int -> DidChangeWatchedFilesParams -> ShowS
Show, DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$c/= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
== :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$c== :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
Eq, Eq 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
min :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
$cmin :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
max :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
$cmax :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams
>= :: DidChangeWatchedFilesParams -> DidChangeWatchedFilesParams -> Bool
$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
compare :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> Ordering
$ccompare :: DidChangeWatchedFilesParams
-> DidChangeWatchedFilesParams -> Ordering
Ord, 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
$cto :: forall x.
Rep DidChangeWatchedFilesParams x -> DidChangeWatchedFilesParams
$cfrom :: forall x.
DidChangeWatchedFilesParams -> Rep DidChangeWatchedFilesParams x
Generic)
  deriving anyclass (DidChangeWatchedFilesParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: DidChangeWatchedFilesParams -> ()
$crnf :: DidChangeWatchedFilesParams -> ()
NFData, Eq DidChangeWatchedFilesParams
Int -> DidChangeWatchedFilesParams -> Int
DidChangeWatchedFilesParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DidChangeWatchedFilesParams -> Int
$chash :: DidChangeWatchedFilesParams -> Int
hashWithSalt :: Int -> DidChangeWatchedFilesParams -> Int
$chashWithSalt :: Int -> DidChangeWatchedFilesParams -> Int
Hashable)
  deriving forall ann. [DidChangeWatchedFilesParams] -> Doc ann
forall ann. DidChangeWatchedFilesParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DidChangeWatchedFilesParams] -> Doc ann
$cprettyList :: forall ann. [DidChangeWatchedFilesParams] -> Doc ann
pretty :: forall ann. DidChangeWatchedFilesParams -> Doc ann
$cpretty :: 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 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [[Key
"changes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [FileEvent]
arg0]]

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