-- 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 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypeHierarchySupertypesParams] -> ShowS
$cshowList :: [TypeHierarchySupertypesParams] -> ShowS
show :: TypeHierarchySupertypesParams -> String
$cshow :: TypeHierarchySupertypesParams -> String
showsPrec :: Int -> TypeHierarchySupertypesParams -> ShowS
$cshowsPrec :: Int -> TypeHierarchySupertypesParams -> ShowS
Show, TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Bool
$c/= :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Bool
== :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Bool
$c== :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Bool
Eq, Eq 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
min :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> TypeHierarchySupertypesParams
$cmin :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> TypeHierarchySupertypesParams
max :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> TypeHierarchySupertypesParams
$cmax :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> TypeHierarchySupertypesParams
>= :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Bool
$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
compare :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Ordering
$ccompare :: TypeHierarchySupertypesParams
-> TypeHierarchySupertypesParams -> Ordering
Ord, 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
$cto :: forall x.
Rep TypeHierarchySupertypesParams x
-> TypeHierarchySupertypesParams
$cfrom :: forall x.
TypeHierarchySupertypesParams
-> Rep TypeHierarchySupertypesParams x
Generic)
  deriving anyclass (TypeHierarchySupertypesParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: TypeHierarchySupertypesParams -> ()
$crnf :: TypeHierarchySupertypesParams -> ()
NFData, Eq TypeHierarchySupertypesParams
Int -> TypeHierarchySupertypesParams -> Int
TypeHierarchySupertypesParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TypeHierarchySupertypesParams -> Int
$chash :: TypeHierarchySupertypesParams -> Int
hashWithSalt :: Int -> TypeHierarchySupertypesParams -> Int
$chashWithSalt :: Int -> TypeHierarchySupertypesParams -> Int
Hashable)

instance Aeson.ToJSON TypeHierarchySupertypesParams where
  toJSON :: TypeHierarchySupertypesParams -> Value
toJSON (TypeHierarchySupertypesParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 TypeHierarchyItem
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..= TypeHierarchyItem
arg2]]

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