-- 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.CreateFilesParams where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
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.FileCreate
import qualified Language.LSP.Protocol.Types.Common

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

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

instance Aeson.ToJSON CreateFilesParams where
  toJSON :: CreateFilesParams -> Value
toJSON (CreateFilesParams [FileCreate]
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..= [FileCreate]
arg0]]

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