{- 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.CallHierarchyOutgoingCallsParams 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/outgoingCalls` request.

@since 3.16.0
-}
data CallHierarchyOutgoingCallsParams = CallHierarchyOutgoingCallsParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  CallHierarchyOutgoingCallsParams -> 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.
  -}
  CallHierarchyOutgoingCallsParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|

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

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