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

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