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

{-|
The parameter of a `typeHierarchy/supertypes` request.

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

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

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

instance Aeson.FromJSON TypeHierarchySupertypesParams where
  parseJSON :: Value -> Parser TypeHierarchySupertypesParams
parseJSON = String
-> (Object -> Parser TypeHierarchySupertypesParams)
-> Value
-> Parser TypeHierarchySupertypesParams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"TypeHierarchySupertypesParams" ((Object -> Parser TypeHierarchySupertypesParams)
 -> Value -> Parser TypeHierarchySupertypesParams)
-> (Object -> Parser TypeHierarchySupertypesParams)
-> Value
-> Parser TypeHierarchySupertypesParams
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> Maybe ProgressToken
-> TypeHierarchyItem
-> TypeHierarchySupertypesParams
TypeHierarchySupertypesParams (Maybe ProgressToken
 -> Maybe ProgressToken
 -> TypeHierarchyItem
 -> TypeHierarchySupertypesParams)
-> Parser (Maybe ProgressToken)
-> Parser
     (Maybe ProgressToken
      -> TypeHierarchyItem -> TypeHierarchySupertypesParams)
forall (f :: * -> *) a b. Functor 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" Parser
  (Maybe ProgressToken
   -> TypeHierarchyItem -> TypeHierarchySupertypesParams)
-> Parser (Maybe ProgressToken)
-> Parser (TypeHierarchyItem -> TypeHierarchySupertypesParams)
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
"partialResultToken" Parser (TypeHierarchyItem -> TypeHierarchySupertypesParams)
-> Parser TypeHierarchyItem -> Parser TypeHierarchySupertypesParams
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 TypeHierarchyItem
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"item"