{- 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.ShowDocumentResult 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.Types.Common

{-|
The result of a showDocument request.

@since 3.16.0
-}
data ShowDocumentResult = ShowDocumentResult 
  { {-|
  A boolean indicating if the show was successful.
  -}
  ShowDocumentResult -> Bool
_success :: Bool
  }
  deriving stock (Int -> ShowDocumentResult -> ShowS
[ShowDocumentResult] -> ShowS
ShowDocumentResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShowDocumentResult] -> ShowS
$cshowList :: [ShowDocumentResult] -> ShowS
show :: ShowDocumentResult -> String
$cshow :: ShowDocumentResult -> String
showsPrec :: Int -> ShowDocumentResult -> ShowS
$cshowsPrec :: Int -> ShowDocumentResult -> ShowS
Show, ShowDocumentResult -> ShowDocumentResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShowDocumentResult -> ShowDocumentResult -> Bool
$c/= :: ShowDocumentResult -> ShowDocumentResult -> Bool
== :: ShowDocumentResult -> ShowDocumentResult -> Bool
$c== :: ShowDocumentResult -> ShowDocumentResult -> Bool
Eq, Eq ShowDocumentResult
ShowDocumentResult -> ShowDocumentResult -> Bool
ShowDocumentResult -> ShowDocumentResult -> Ordering
ShowDocumentResult -> ShowDocumentResult -> ShowDocumentResult
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 :: ShowDocumentResult -> ShowDocumentResult -> ShowDocumentResult
$cmin :: ShowDocumentResult -> ShowDocumentResult -> ShowDocumentResult
max :: ShowDocumentResult -> ShowDocumentResult -> ShowDocumentResult
$cmax :: ShowDocumentResult -> ShowDocumentResult -> ShowDocumentResult
>= :: ShowDocumentResult -> ShowDocumentResult -> Bool
$c>= :: ShowDocumentResult -> ShowDocumentResult -> Bool
> :: ShowDocumentResult -> ShowDocumentResult -> Bool
$c> :: ShowDocumentResult -> ShowDocumentResult -> Bool
<= :: ShowDocumentResult -> ShowDocumentResult -> Bool
$c<= :: ShowDocumentResult -> ShowDocumentResult -> Bool
< :: ShowDocumentResult -> ShowDocumentResult -> Bool
$c< :: ShowDocumentResult -> ShowDocumentResult -> Bool
compare :: ShowDocumentResult -> ShowDocumentResult -> Ordering
$ccompare :: ShowDocumentResult -> ShowDocumentResult -> Ordering
Ord, forall x. Rep ShowDocumentResult x -> ShowDocumentResult
forall x. ShowDocumentResult -> Rep ShowDocumentResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShowDocumentResult x -> ShowDocumentResult
$cfrom :: forall x. ShowDocumentResult -> Rep ShowDocumentResult x
Generic)
  deriving anyclass (ShowDocumentResult -> ()
forall a. (a -> ()) -> NFData a
rnf :: ShowDocumentResult -> ()
$crnf :: ShowDocumentResult -> ()
NFData, Eq ShowDocumentResult
Int -> ShowDocumentResult -> Int
ShowDocumentResult -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ShowDocumentResult -> Int
$chash :: ShowDocumentResult -> Int
hashWithSalt :: Int -> ShowDocumentResult -> Int
$chashWithSalt :: Int -> ShowDocumentResult -> Int
Hashable)
  deriving forall ann. [ShowDocumentResult] -> Doc ann
forall ann. ShowDocumentResult -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ShowDocumentResult] -> Doc ann
$cprettyList :: forall ann. [ShowDocumentResult] -> Doc ann
pretty :: forall ann. ShowDocumentResult -> Doc ann
$cpretty :: forall ann. ShowDocumentResult -> Doc ann
Pretty via (ViaJSON ShowDocumentResult)

instance Aeson.ToJSON ShowDocumentResult where
  toJSON :: ShowDocumentResult -> Value
toJSON (ShowDocumentResult Bool
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
"success" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg0]]

instance Aeson.FromJSON ShowDocumentResult where
  parseJSON :: Value -> Parser ShowDocumentResult
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ShowDocumentResult" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Bool -> ShowDocumentResult
ShowDocumentResult forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"success"