{- 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.PartialResultParams 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.Types.Common

{-|

-}
data PartialResultParams = PartialResultParams 
  { {-|
  An optional token that a server can use to report partial results (e.g. streaming) to
  the client.
  -}
  PartialResultParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  }
  deriving stock (Int -> PartialResultParams -> ShowS
[PartialResultParams] -> ShowS
PartialResultParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PartialResultParams] -> ShowS
$cshowList :: [PartialResultParams] -> ShowS
show :: PartialResultParams -> String
$cshow :: PartialResultParams -> String
showsPrec :: Int -> PartialResultParams -> ShowS
$cshowsPrec :: Int -> PartialResultParams -> ShowS
Show, PartialResultParams -> PartialResultParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartialResultParams -> PartialResultParams -> Bool
$c/= :: PartialResultParams -> PartialResultParams -> Bool
== :: PartialResultParams -> PartialResultParams -> Bool
$c== :: PartialResultParams -> PartialResultParams -> Bool
Eq, Eq PartialResultParams
PartialResultParams -> PartialResultParams -> Bool
PartialResultParams -> PartialResultParams -> Ordering
PartialResultParams -> PartialResultParams -> PartialResultParams
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 :: PartialResultParams -> PartialResultParams -> PartialResultParams
$cmin :: PartialResultParams -> PartialResultParams -> PartialResultParams
max :: PartialResultParams -> PartialResultParams -> PartialResultParams
$cmax :: PartialResultParams -> PartialResultParams -> PartialResultParams
>= :: PartialResultParams -> PartialResultParams -> Bool
$c>= :: PartialResultParams -> PartialResultParams -> Bool
> :: PartialResultParams -> PartialResultParams -> Bool
$c> :: PartialResultParams -> PartialResultParams -> Bool
<= :: PartialResultParams -> PartialResultParams -> Bool
$c<= :: PartialResultParams -> PartialResultParams -> Bool
< :: PartialResultParams -> PartialResultParams -> Bool
$c< :: PartialResultParams -> PartialResultParams -> Bool
compare :: PartialResultParams -> PartialResultParams -> Ordering
$ccompare :: PartialResultParams -> PartialResultParams -> Ordering
Ord, forall x. Rep PartialResultParams x -> PartialResultParams
forall x. PartialResultParams -> Rep PartialResultParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PartialResultParams x -> PartialResultParams
$cfrom :: forall x. PartialResultParams -> Rep PartialResultParams x
Generic)
  deriving anyclass (PartialResultParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: PartialResultParams -> ()
$crnf :: PartialResultParams -> ()
NFData, Eq PartialResultParams
Int -> PartialResultParams -> Int
PartialResultParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: PartialResultParams -> Int
$chash :: PartialResultParams -> Int
hashWithSalt :: Int -> PartialResultParams -> Int
$chashWithSalt :: Int -> PartialResultParams -> Int
Hashable)
  deriving forall ann. [PartialResultParams] -> Doc ann
forall ann. PartialResultParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [PartialResultParams] -> Doc ann
$cprettyList :: forall ann. [PartialResultParams] -> Doc ann
pretty :: forall ann. PartialResultParams -> Doc ann
$cpretty :: forall ann. PartialResultParams -> Doc ann
Pretty via (ViaJSON PartialResultParams)

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

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