{- 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.TypeHierarchyPrepareParams 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.Position
import qualified Language.LSP.Protocol.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common

{-|
The parameter of a `textDocument/prepareTypeHierarchy` request.

@since 3.17.0
-}
data TypeHierarchyPrepareParams = TypeHierarchyPrepareParams 
  { {-|
  The text document.
  -}
  TypeHierarchyPrepareParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  , {-|
  The position inside the text document.
  -}
  TypeHierarchyPrepareParams -> Position
_position :: Language.LSP.Protocol.Internal.Types.Position.Position
  , {-|
  An optional token that a server can use to report work done progress.
  -}
  TypeHierarchyPrepareParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  }
  deriving stock (Int -> TypeHierarchyPrepareParams -> ShowS
[TypeHierarchyPrepareParams] -> ShowS
TypeHierarchyPrepareParams -> String
(Int -> TypeHierarchyPrepareParams -> ShowS)
-> (TypeHierarchyPrepareParams -> String)
-> ([TypeHierarchyPrepareParams] -> ShowS)
-> Show TypeHierarchyPrepareParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TypeHierarchyPrepareParams -> ShowS
showsPrec :: Int -> TypeHierarchyPrepareParams -> ShowS
$cshow :: TypeHierarchyPrepareParams -> String
show :: TypeHierarchyPrepareParams -> String
$cshowList :: [TypeHierarchyPrepareParams] -> ShowS
showList :: [TypeHierarchyPrepareParams] -> ShowS
Show, TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
(TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool)
-> (TypeHierarchyPrepareParams
    -> TypeHierarchyPrepareParams -> Bool)
-> Eq TypeHierarchyPrepareParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
== :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
$c/= :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
/= :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
Eq, Eq TypeHierarchyPrepareParams
Eq TypeHierarchyPrepareParams =>
(TypeHierarchyPrepareParams
 -> TypeHierarchyPrepareParams -> Ordering)
-> (TypeHierarchyPrepareParams
    -> TypeHierarchyPrepareParams -> Bool)
-> (TypeHierarchyPrepareParams
    -> TypeHierarchyPrepareParams -> Bool)
-> (TypeHierarchyPrepareParams
    -> TypeHierarchyPrepareParams -> Bool)
-> (TypeHierarchyPrepareParams
    -> TypeHierarchyPrepareParams -> Bool)
-> (TypeHierarchyPrepareParams
    -> TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams)
-> (TypeHierarchyPrepareParams
    -> TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams)
-> Ord TypeHierarchyPrepareParams
TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> Ordering
TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams
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 :: TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> Ordering
compare :: TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> Ordering
$c< :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
< :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
$c<= :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
<= :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
$c> :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
> :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
$c>= :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
>= :: TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams -> Bool
$cmax :: TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams
max :: TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams
$cmin :: TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams
min :: TypeHierarchyPrepareParams
-> TypeHierarchyPrepareParams -> TypeHierarchyPrepareParams
Ord, (forall x.
 TypeHierarchyPrepareParams -> Rep TypeHierarchyPrepareParams x)
-> (forall x.
    Rep TypeHierarchyPrepareParams x -> TypeHierarchyPrepareParams)
-> Generic TypeHierarchyPrepareParams
forall x.
Rep TypeHierarchyPrepareParams x -> TypeHierarchyPrepareParams
forall x.
TypeHierarchyPrepareParams -> Rep TypeHierarchyPrepareParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
TypeHierarchyPrepareParams -> Rep TypeHierarchyPrepareParams x
from :: forall x.
TypeHierarchyPrepareParams -> Rep TypeHierarchyPrepareParams x
$cto :: forall x.
Rep TypeHierarchyPrepareParams x -> TypeHierarchyPrepareParams
to :: forall x.
Rep TypeHierarchyPrepareParams x -> TypeHierarchyPrepareParams
Generic)
  deriving anyclass (TypeHierarchyPrepareParams -> ()
(TypeHierarchyPrepareParams -> ())
-> NFData TypeHierarchyPrepareParams
forall a. (a -> ()) -> NFData a
$crnf :: TypeHierarchyPrepareParams -> ()
rnf :: TypeHierarchyPrepareParams -> ()
NFData, Eq TypeHierarchyPrepareParams
Eq TypeHierarchyPrepareParams =>
(Int -> TypeHierarchyPrepareParams -> Int)
-> (TypeHierarchyPrepareParams -> Int)
-> Hashable TypeHierarchyPrepareParams
Int -> TypeHierarchyPrepareParams -> Int
TypeHierarchyPrepareParams -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> TypeHierarchyPrepareParams -> Int
hashWithSalt :: Int -> TypeHierarchyPrepareParams -> Int
$chash :: TypeHierarchyPrepareParams -> Int
hash :: TypeHierarchyPrepareParams -> Int
Hashable)
  deriving (forall ann. TypeHierarchyPrepareParams -> Doc ann)
-> (forall ann. [TypeHierarchyPrepareParams] -> Doc ann)
-> Pretty TypeHierarchyPrepareParams
forall ann. [TypeHierarchyPrepareParams] -> Doc ann
forall ann. TypeHierarchyPrepareParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. TypeHierarchyPrepareParams -> Doc ann
pretty :: forall ann. TypeHierarchyPrepareParams -> Doc ann
$cprettyList :: forall ann. [TypeHierarchyPrepareParams] -> Doc ann
prettyList :: forall ann. [TypeHierarchyPrepareParams] -> Doc ann
Pretty via (ViaJSON TypeHierarchyPrepareParams)

instance Aeson.ToJSON TypeHierarchyPrepareParams where
  toJSON :: TypeHierarchyPrepareParams -> Value
toJSON (TypeHierarchyPrepareParams TextDocumentIdentifier
arg0 Position
arg1 Maybe ProgressToken
arg2) = [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
"textDocument" Key -> TextDocumentIdentifier -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg0]
    ,[Key
"position" Key -> Position -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Position
arg1]
    ,String
"workDoneToken" String -> Maybe ProgressToken -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg2]

instance Aeson.FromJSON TypeHierarchyPrepareParams where
  parseJSON :: Value -> Parser TypeHierarchyPrepareParams
parseJSON = String
-> (Object -> Parser TypeHierarchyPrepareParams)
-> Value
-> Parser TypeHierarchyPrepareParams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TypeHierarchyPrepareParams" ((Object -> Parser TypeHierarchyPrepareParams)
 -> Value -> Parser TypeHierarchyPrepareParams)
-> (Object -> Parser TypeHierarchyPrepareParams)
-> Value
-> Parser TypeHierarchyPrepareParams
forall a b. (a -> b) -> a -> b
$ \Object
arg -> TextDocumentIdentifier
-> Position -> Maybe ProgressToken -> TypeHierarchyPrepareParams
TypeHierarchyPrepareParams (TextDocumentIdentifier
 -> Position -> Maybe ProgressToken -> TypeHierarchyPrepareParams)
-> Parser TextDocumentIdentifier
-> Parser
     (Position -> Maybe ProgressToken -> TypeHierarchyPrepareParams)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser TextDocumentIdentifier
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"textDocument" Parser
  (Position -> Maybe ProgressToken -> TypeHierarchyPrepareParams)
-> Parser Position
-> Parser (Maybe ProgressToken -> TypeHierarchyPrepareParams)
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 Position
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"position" Parser (Maybe ProgressToken -> TypeHierarchyPrepareParams)
-> Parser (Maybe ProgressToken)
-> Parser TypeHierarchyPrepareParams
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 ProgressToken)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneToken"