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

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

@since 3.16.0
-}
data RenameFilesParams = RenameFilesParams 
  { {-|
  An array of all files/folders renamed in this operation. When a folder is renamed, only
  the folder will be included, and not its children.
  -}
  RenameFilesParams -> [FileRename]
_files :: [Language.LSP.Protocol.Internal.Types.FileRename.FileRename]
  }
  deriving stock (Int -> RenameFilesParams -> ShowS
[RenameFilesParams] -> ShowS
RenameFilesParams -> String
(Int -> RenameFilesParams -> ShowS)
-> (RenameFilesParams -> String)
-> ([RenameFilesParams] -> ShowS)
-> Show RenameFilesParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RenameFilesParams -> ShowS
showsPrec :: Int -> RenameFilesParams -> ShowS
$cshow :: RenameFilesParams -> String
show :: RenameFilesParams -> String
$cshowList :: [RenameFilesParams] -> ShowS
showList :: [RenameFilesParams] -> ShowS
Show, RenameFilesParams -> RenameFilesParams -> Bool
(RenameFilesParams -> RenameFilesParams -> Bool)
-> (RenameFilesParams -> RenameFilesParams -> Bool)
-> Eq RenameFilesParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RenameFilesParams -> RenameFilesParams -> Bool
== :: RenameFilesParams -> RenameFilesParams -> Bool
$c/= :: RenameFilesParams -> RenameFilesParams -> Bool
/= :: RenameFilesParams -> RenameFilesParams -> Bool
Eq, Eq RenameFilesParams
Eq RenameFilesParams =>
(RenameFilesParams -> RenameFilesParams -> Ordering)
-> (RenameFilesParams -> RenameFilesParams -> Bool)
-> (RenameFilesParams -> RenameFilesParams -> Bool)
-> (RenameFilesParams -> RenameFilesParams -> Bool)
-> (RenameFilesParams -> RenameFilesParams -> Bool)
-> (RenameFilesParams -> RenameFilesParams -> RenameFilesParams)
-> (RenameFilesParams -> RenameFilesParams -> RenameFilesParams)
-> Ord RenameFilesParams
RenameFilesParams -> RenameFilesParams -> Bool
RenameFilesParams -> RenameFilesParams -> Ordering
RenameFilesParams -> RenameFilesParams -> RenameFilesParams
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 :: RenameFilesParams -> RenameFilesParams -> Ordering
compare :: RenameFilesParams -> RenameFilesParams -> Ordering
$c< :: RenameFilesParams -> RenameFilesParams -> Bool
< :: RenameFilesParams -> RenameFilesParams -> Bool
$c<= :: RenameFilesParams -> RenameFilesParams -> Bool
<= :: RenameFilesParams -> RenameFilesParams -> Bool
$c> :: RenameFilesParams -> RenameFilesParams -> Bool
> :: RenameFilesParams -> RenameFilesParams -> Bool
$c>= :: RenameFilesParams -> RenameFilesParams -> Bool
>= :: RenameFilesParams -> RenameFilesParams -> Bool
$cmax :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
max :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
$cmin :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
min :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
Ord, (forall x. RenameFilesParams -> Rep RenameFilesParams x)
-> (forall x. Rep RenameFilesParams x -> RenameFilesParams)
-> Generic RenameFilesParams
forall x. Rep RenameFilesParams x -> RenameFilesParams
forall x. RenameFilesParams -> Rep RenameFilesParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RenameFilesParams -> Rep RenameFilesParams x
from :: forall x. RenameFilesParams -> Rep RenameFilesParams x
$cto :: forall x. Rep RenameFilesParams x -> RenameFilesParams
to :: forall x. Rep RenameFilesParams x -> RenameFilesParams
Generic)
  deriving anyclass (RenameFilesParams -> ()
(RenameFilesParams -> ()) -> NFData RenameFilesParams
forall a. (a -> ()) -> NFData a
$crnf :: RenameFilesParams -> ()
rnf :: RenameFilesParams -> ()
NFData, Eq RenameFilesParams
Eq RenameFilesParams =>
(Int -> RenameFilesParams -> Int)
-> (RenameFilesParams -> Int) -> Hashable RenameFilesParams
Int -> RenameFilesParams -> Int
RenameFilesParams -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> RenameFilesParams -> Int
hashWithSalt :: Int -> RenameFilesParams -> Int
$chash :: RenameFilesParams -> Int
hash :: RenameFilesParams -> Int
Hashable)
  deriving (forall ann. RenameFilesParams -> Doc ann)
-> (forall ann. [RenameFilesParams] -> Doc ann)
-> Pretty RenameFilesParams
forall ann. [RenameFilesParams] -> Doc ann
forall ann. RenameFilesParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. RenameFilesParams -> Doc ann
pretty :: forall ann. RenameFilesParams -> Doc ann
$cprettyList :: forall ann. [RenameFilesParams] -> Doc ann
prettyList :: forall ann. [RenameFilesParams] -> Doc ann
Pretty via (ViaJSON RenameFilesParams)

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

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