{- 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.CallHierarchyIncomingCallsParams 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.CallHierarchyItem
import qualified Language.LSP.Protocol.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Types.Common

{-|
The parameter of a `callHierarchy/incomingCalls` request.

@since 3.16.0
-}
data CallHierarchyIncomingCallsParams = CallHierarchyIncomingCallsParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  CallHierarchyIncomingCallsParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  An optional token that a server can use to report partial results (e.g. streaming) to
  the client.
  -}
  CallHierarchyIncomingCallsParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|

  -}
  CallHierarchyIncomingCallsParams -> CallHierarchyItem
_item :: Language.LSP.Protocol.Internal.Types.CallHierarchyItem.CallHierarchyItem
  }
  deriving stock (Int -> CallHierarchyIncomingCallsParams -> ShowS
[CallHierarchyIncomingCallsParams] -> ShowS
CallHierarchyIncomingCallsParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CallHierarchyIncomingCallsParams] -> ShowS
$cshowList :: [CallHierarchyIncomingCallsParams] -> ShowS
show :: CallHierarchyIncomingCallsParams -> String
$cshow :: CallHierarchyIncomingCallsParams -> String
showsPrec :: Int -> CallHierarchyIncomingCallsParams -> ShowS
$cshowsPrec :: Int -> CallHierarchyIncomingCallsParams -> ShowS
Show, CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
$c/= :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
== :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
$c== :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
Eq, Eq CallHierarchyIncomingCallsParams
CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Ordering
CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
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 :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
$cmin :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
max :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
$cmax :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams
>= :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
$c>= :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
> :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
$c> :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
<= :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
$c<= :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
< :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
$c< :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Bool
compare :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Ordering
$ccompare :: CallHierarchyIncomingCallsParams
-> CallHierarchyIncomingCallsParams -> Ordering
Ord, forall x.
Rep CallHierarchyIncomingCallsParams x
-> CallHierarchyIncomingCallsParams
forall x.
CallHierarchyIncomingCallsParams
-> Rep CallHierarchyIncomingCallsParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CallHierarchyIncomingCallsParams x
-> CallHierarchyIncomingCallsParams
$cfrom :: forall x.
CallHierarchyIncomingCallsParams
-> Rep CallHierarchyIncomingCallsParams x
Generic)
  deriving anyclass (CallHierarchyIncomingCallsParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: CallHierarchyIncomingCallsParams -> ()
$crnf :: CallHierarchyIncomingCallsParams -> ()
NFData, Eq CallHierarchyIncomingCallsParams
Int -> CallHierarchyIncomingCallsParams -> Int
CallHierarchyIncomingCallsParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: CallHierarchyIncomingCallsParams -> Int
$chash :: CallHierarchyIncomingCallsParams -> Int
hashWithSalt :: Int -> CallHierarchyIncomingCallsParams -> Int
$chashWithSalt :: Int -> CallHierarchyIncomingCallsParams -> Int
Hashable)
  deriving forall ann. [CallHierarchyIncomingCallsParams] -> Doc ann
forall ann. CallHierarchyIncomingCallsParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [CallHierarchyIncomingCallsParams] -> Doc ann
$cprettyList :: forall ann. [CallHierarchyIncomingCallsParams] -> Doc ann
pretty :: forall ann. CallHierarchyIncomingCallsParams -> Doc ann
$cpretty :: forall ann. CallHierarchyIncomingCallsParams -> Doc ann
Pretty via (ViaJSON CallHierarchyIncomingCallsParams)

instance Aeson.ToJSON CallHierarchyIncomingCallsParams where
  toJSON :: CallHierarchyIncomingCallsParams -> Value
toJSON (CallHierarchyIncomingCallsParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 CallHierarchyItem
arg2) = [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
"workDoneToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
    ,String
"partialResultToken" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg1
    ,[Key
"item" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= CallHierarchyItem
arg2]]

instance Aeson.FromJSON CallHierarchyIncomingCallsParams where
  parseJSON :: Value -> Parser CallHierarchyIncomingCallsParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CallHierarchyIncomingCallsParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> Maybe ProgressToken
-> CallHierarchyItem
-> CallHierarchyIncomingCallsParams
CallHierarchyIncomingCallsParams 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
"workDoneToken" 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
"partialResultToken" 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
"item"