{- 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.DeleteFile 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.ChangeAnnotationIdentifier
import qualified Language.LSP.Protocol.Internal.Types.DeleteFileOptions
import qualified Language.LSP.Protocol.Types.Common
import qualified Language.LSP.Protocol.Types.Singletons
import qualified Language.LSP.Protocol.Types.Uri

{-|
Delete file operation
-}
data DeleteFile = DeleteFile 
  { {-|
  An optional annotation identifier describing the operation.

  @since 3.16.0
  -}
  DeleteFile -> Maybe ChangeAnnotationIdentifier
_annotationId :: (Maybe Language.LSP.Protocol.Internal.Types.ChangeAnnotationIdentifier.ChangeAnnotationIdentifier)
  , {-|
  A delete
  -}
  DeleteFile -> AString "delete"
_kind :: (Language.LSP.Protocol.Types.Singletons.AString "delete")
  , {-|
  The file to delete.
  -}
  DeleteFile -> Uri
_uri :: Language.LSP.Protocol.Types.Uri.Uri
  , {-|
  Delete options.
  -}
  DeleteFile -> Maybe DeleteFileOptions
_options :: (Maybe Language.LSP.Protocol.Internal.Types.DeleteFileOptions.DeleteFileOptions)
  }
  deriving stock (Int -> DeleteFile -> ShowS
[DeleteFile] -> ShowS
DeleteFile -> String
(Int -> DeleteFile -> ShowS)
-> (DeleteFile -> String)
-> ([DeleteFile] -> ShowS)
-> Show DeleteFile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeleteFile -> ShowS
showsPrec :: Int -> DeleteFile -> ShowS
$cshow :: DeleteFile -> String
show :: DeleteFile -> String
$cshowList :: [DeleteFile] -> ShowS
showList :: [DeleteFile] -> ShowS
Show, DeleteFile -> DeleteFile -> Bool
(DeleteFile -> DeleteFile -> Bool)
-> (DeleteFile -> DeleteFile -> Bool) -> Eq DeleteFile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeleteFile -> DeleteFile -> Bool
== :: DeleteFile -> DeleteFile -> Bool
$c/= :: DeleteFile -> DeleteFile -> Bool
/= :: DeleteFile -> DeleteFile -> Bool
Eq, Eq DeleteFile
Eq DeleteFile =>
(DeleteFile -> DeleteFile -> Ordering)
-> (DeleteFile -> DeleteFile -> Bool)
-> (DeleteFile -> DeleteFile -> Bool)
-> (DeleteFile -> DeleteFile -> Bool)
-> (DeleteFile -> DeleteFile -> Bool)
-> (DeleteFile -> DeleteFile -> DeleteFile)
-> (DeleteFile -> DeleteFile -> DeleteFile)
-> Ord DeleteFile
DeleteFile -> DeleteFile -> Bool
DeleteFile -> DeleteFile -> Ordering
DeleteFile -> DeleteFile -> DeleteFile
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 :: DeleteFile -> DeleteFile -> Ordering
compare :: DeleteFile -> DeleteFile -> Ordering
$c< :: DeleteFile -> DeleteFile -> Bool
< :: DeleteFile -> DeleteFile -> Bool
$c<= :: DeleteFile -> DeleteFile -> Bool
<= :: DeleteFile -> DeleteFile -> Bool
$c> :: DeleteFile -> DeleteFile -> Bool
> :: DeleteFile -> DeleteFile -> Bool
$c>= :: DeleteFile -> DeleteFile -> Bool
>= :: DeleteFile -> DeleteFile -> Bool
$cmax :: DeleteFile -> DeleteFile -> DeleteFile
max :: DeleteFile -> DeleteFile -> DeleteFile
$cmin :: DeleteFile -> DeleteFile -> DeleteFile
min :: DeleteFile -> DeleteFile -> DeleteFile
Ord, (forall x. DeleteFile -> Rep DeleteFile x)
-> (forall x. Rep DeleteFile x -> DeleteFile) -> Generic DeleteFile
forall x. Rep DeleteFile x -> DeleteFile
forall x. DeleteFile -> Rep DeleteFile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DeleteFile -> Rep DeleteFile x
from :: forall x. DeleteFile -> Rep DeleteFile x
$cto :: forall x. Rep DeleteFile x -> DeleteFile
to :: forall x. Rep DeleteFile x -> DeleteFile
Generic)
  deriving anyclass (DeleteFile -> ()
(DeleteFile -> ()) -> NFData DeleteFile
forall a. (a -> ()) -> NFData a
$crnf :: DeleteFile -> ()
rnf :: DeleteFile -> ()
NFData, Eq DeleteFile
Eq DeleteFile =>
(Int -> DeleteFile -> Int)
-> (DeleteFile -> Int) -> Hashable DeleteFile
Int -> DeleteFile -> Int
DeleteFile -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> DeleteFile -> Int
hashWithSalt :: Int -> DeleteFile -> Int
$chash :: DeleteFile -> Int
hash :: DeleteFile -> Int
Hashable)
  deriving (forall ann. DeleteFile -> Doc ann)
-> (forall ann. [DeleteFile] -> Doc ann) -> Pretty DeleteFile
forall ann. [DeleteFile] -> Doc ann
forall ann. DeleteFile -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. DeleteFile -> Doc ann
pretty :: forall ann. DeleteFile -> Doc ann
$cprettyList :: forall ann. [DeleteFile] -> Doc ann
prettyList :: forall ann. [DeleteFile] -> Doc ann
Pretty via (ViaJSON DeleteFile)

instance Aeson.ToJSON DeleteFile where
  toJSON :: DeleteFile -> Value
toJSON (DeleteFile Maybe ChangeAnnotationIdentifier
arg0 AString "delete"
arg1 Uri
arg2 Maybe DeleteFileOptions
arg3) = [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
$  [String
"annotationId" String -> Maybe ChangeAnnotationIdentifier -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ChangeAnnotationIdentifier
arg0
    ,[Key
"kind" Key -> AString "delete" -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= AString "delete"
arg1]
    ,[Key
"uri" Key -> Uri -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg2]
    ,String
"options" String -> Maybe DeleteFileOptions -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe DeleteFileOptions
arg3]

instance Aeson.FromJSON DeleteFile where
  parseJSON :: Value -> Parser DeleteFile
parseJSON = String
-> (Object -> Parser DeleteFile) -> Value -> Parser DeleteFile
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DeleteFile" ((Object -> Parser DeleteFile) -> Value -> Parser DeleteFile)
-> (Object -> Parser DeleteFile) -> Value -> Parser DeleteFile
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ChangeAnnotationIdentifier
-> AString "delete" -> Uri -> Maybe DeleteFileOptions -> DeleteFile
DeleteFile (Maybe ChangeAnnotationIdentifier
 -> AString "delete"
 -> Uri
 -> Maybe DeleteFileOptions
 -> DeleteFile)
-> Parser (Maybe ChangeAnnotationIdentifier)
-> Parser
     (AString "delete" -> Uri -> Maybe DeleteFileOptions -> DeleteFile)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe ChangeAnnotationIdentifier)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"annotationId" Parser
  (AString "delete" -> Uri -> Maybe DeleteFileOptions -> DeleteFile)
-> Parser (AString "delete")
-> Parser (Uri -> Maybe DeleteFileOptions -> DeleteFile)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (AString "delete")
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"kind" Parser (Uri -> Maybe DeleteFileOptions -> DeleteFile)
-> Parser Uri -> Parser (Maybe DeleteFileOptions -> DeleteFile)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser Uri
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"uri" Parser (Maybe DeleteFileOptions -> DeleteFile)
-> Parser (Maybe DeleteFileOptions) -> Parser DeleteFile
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe DeleteFileOptions)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"options"