-- 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RenameFilesParams] -> ShowS
$cshowList :: [RenameFilesParams] -> ShowS
show :: RenameFilesParams -> String
$cshow :: RenameFilesParams -> String
showsPrec :: Int -> RenameFilesParams -> ShowS
$cshowsPrec :: Int -> RenameFilesParams -> ShowS
Show, RenameFilesParams -> RenameFilesParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RenameFilesParams -> RenameFilesParams -> Bool
$c/= :: RenameFilesParams -> RenameFilesParams -> Bool
== :: RenameFilesParams -> RenameFilesParams -> Bool
$c== :: RenameFilesParams -> RenameFilesParams -> Bool
Eq, Eq 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
min :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
$cmin :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
max :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
$cmax :: RenameFilesParams -> RenameFilesParams -> RenameFilesParams
>= :: RenameFilesParams -> RenameFilesParams -> Bool
$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
compare :: RenameFilesParams -> RenameFilesParams -> Ordering
$ccompare :: RenameFilesParams -> RenameFilesParams -> Ordering
Ord, 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
$cto :: forall x. Rep RenameFilesParams x -> RenameFilesParams
$cfrom :: forall x. RenameFilesParams -> Rep RenameFilesParams x
Generic)
  deriving anyclass (RenameFilesParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: RenameFilesParams -> ()
$crnf :: RenameFilesParams -> ()
NFData, Eq RenameFilesParams
Int -> RenameFilesParams -> Int
RenameFilesParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: RenameFilesParams -> Int
$chash :: RenameFilesParams -> Int
hashWithSalt :: Int -> RenameFilesParams -> Int
$chashWithSalt :: Int -> RenameFilesParams -> Int
Hashable)
  deriving forall ann. [RenameFilesParams] -> Doc ann
forall ann. RenameFilesParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [RenameFilesParams] -> Doc ann
$cprettyList :: forall ann. [RenameFilesParams] -> Doc ann
pretty :: forall ann. RenameFilesParams -> Doc ann
$cpretty :: 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 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..= [FileRename]
arg0]]

instance Aeson.FromJSON RenameFilesParams where
  parseJSON :: Value -> Parser RenameFilesParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"RenameFilesParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> [FileRename] -> RenameFilesParams
RenameFilesParams 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"