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

{-|
The parameters sent in notifications/requests for user-initiated deletes of
files.

@since 3.16.0
-}
data DeleteFilesParams = DeleteFilesParams 
  { {-|
  An array of all files/folders deleted in this operation.
  -}
  DeleteFilesParams -> [FileDelete]
_files :: [Language.LSP.Protocol.Internal.Types.FileDelete.FileDelete]
  }
  deriving stock (Int -> DeleteFilesParams -> ShowS
[DeleteFilesParams] -> ShowS
DeleteFilesParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFilesParams] -> ShowS
$cshowList :: [DeleteFilesParams] -> ShowS
show :: DeleteFilesParams -> String
$cshow :: DeleteFilesParams -> String
showsPrec :: Int -> DeleteFilesParams -> ShowS
$cshowsPrec :: Int -> DeleteFilesParams -> ShowS
Show, DeleteFilesParams -> DeleteFilesParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFilesParams -> DeleteFilesParams -> Bool
$c/= :: DeleteFilesParams -> DeleteFilesParams -> Bool
== :: DeleteFilesParams -> DeleteFilesParams -> Bool
$c== :: DeleteFilesParams -> DeleteFilesParams -> Bool
Eq, Eq DeleteFilesParams
DeleteFilesParams -> DeleteFilesParams -> Bool
DeleteFilesParams -> DeleteFilesParams -> Ordering
DeleteFilesParams -> DeleteFilesParams -> DeleteFilesParams
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 :: DeleteFilesParams -> DeleteFilesParams -> DeleteFilesParams
$cmin :: DeleteFilesParams -> DeleteFilesParams -> DeleteFilesParams
max :: DeleteFilesParams -> DeleteFilesParams -> DeleteFilesParams
$cmax :: DeleteFilesParams -> DeleteFilesParams -> DeleteFilesParams
>= :: DeleteFilesParams -> DeleteFilesParams -> Bool
$c>= :: DeleteFilesParams -> DeleteFilesParams -> Bool
> :: DeleteFilesParams -> DeleteFilesParams -> Bool
$c> :: DeleteFilesParams -> DeleteFilesParams -> Bool
<= :: DeleteFilesParams -> DeleteFilesParams -> Bool
$c<= :: DeleteFilesParams -> DeleteFilesParams -> Bool
< :: DeleteFilesParams -> DeleteFilesParams -> Bool
$c< :: DeleteFilesParams -> DeleteFilesParams -> Bool
compare :: DeleteFilesParams -> DeleteFilesParams -> Ordering
$ccompare :: DeleteFilesParams -> DeleteFilesParams -> Ordering
Ord, forall x. Rep DeleteFilesParams x -> DeleteFilesParams
forall x. DeleteFilesParams -> Rep DeleteFilesParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteFilesParams x -> DeleteFilesParams
$cfrom :: forall x. DeleteFilesParams -> Rep DeleteFilesParams x
Generic)
  deriving anyclass (DeleteFilesParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: DeleteFilesParams -> ()
$crnf :: DeleteFilesParams -> ()
NFData, Eq DeleteFilesParams
Int -> DeleteFilesParams -> Int
DeleteFilesParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DeleteFilesParams -> Int
$chash :: DeleteFilesParams -> Int
hashWithSalt :: Int -> DeleteFilesParams -> Int
$chashWithSalt :: Int -> DeleteFilesParams -> Int
Hashable)
  deriving forall ann. [DeleteFilesParams] -> Doc ann
forall ann. DeleteFilesParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DeleteFilesParams] -> Doc ann
$cprettyList :: forall ann. [DeleteFilesParams] -> Doc ann
pretty :: forall ann. DeleteFilesParams -> Doc ann
$cpretty :: forall ann. DeleteFilesParams -> Doc ann
Pretty via (ViaJSON DeleteFilesParams)

instance Aeson.ToJSON DeleteFilesParams where
  toJSON :: DeleteFilesParams -> Value
toJSON (DeleteFilesParams [FileDelete]
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
"files" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [FileDelete]
arg0]]

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