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

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

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