{- 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.TypeHierarchySubtypesParams 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/subtypes` request.

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

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

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