{- 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteFile] -> ShowS
$cshowList :: [DeleteFile] -> ShowS
show :: DeleteFile -> String
$cshow :: DeleteFile -> String
showsPrec :: Int -> DeleteFile -> ShowS
$cshowsPrec :: Int -> DeleteFile -> ShowS
Show, DeleteFile -> DeleteFile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteFile -> DeleteFile -> Bool
$c/= :: DeleteFile -> DeleteFile -> Bool
== :: DeleteFile -> DeleteFile -> Bool
$c== :: DeleteFile -> DeleteFile -> Bool
Eq, Eq 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
min :: DeleteFile -> DeleteFile -> DeleteFile
$cmin :: DeleteFile -> DeleteFile -> DeleteFile
max :: DeleteFile -> DeleteFile -> DeleteFile
$cmax :: DeleteFile -> DeleteFile -> DeleteFile
>= :: DeleteFile -> DeleteFile -> Bool
$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
compare :: DeleteFile -> DeleteFile -> Ordering
$ccompare :: DeleteFile -> DeleteFile -> Ordering
Ord, 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
$cto :: forall x. Rep DeleteFile x -> DeleteFile
$cfrom :: forall x. DeleteFile -> Rep DeleteFile x
Generic)
  deriving anyclass (DeleteFile -> ()
forall a. (a -> ()) -> NFData a
rnf :: DeleteFile -> ()
$crnf :: DeleteFile -> ()
NFData, Eq DeleteFile
Int -> DeleteFile -> Int
DeleteFile -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DeleteFile -> Int
$chash :: DeleteFile -> Int
hashWithSalt :: Int -> DeleteFile -> Int
$chashWithSalt :: Int -> DeleteFile -> Int
Hashable)
  deriving forall ann. [DeleteFile] -> Doc ann
forall ann. DeleteFile -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DeleteFile] -> Doc ann
$cprettyList :: forall ann. [DeleteFile] -> Doc ann
pretty :: forall ann. DeleteFile -> Doc ann
$cpretty :: 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 forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [String
"annotationId" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ChangeAnnotationIdentifier
arg0
    ,[Key
"kind" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= AString "delete"
arg1]
    ,[Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Uri
arg2]
    ,String
"options" forall kv v. (KeyValue 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 = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DeleteFile" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ChangeAnnotationIdentifier
-> AString "delete" -> Uri -> Maybe DeleteFileOptions -> DeleteFile
DeleteFile forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"annotationId" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"kind" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"uri" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"options"