{- 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.ProgressParams where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson
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 ProgressParams = ProgressParams 
  { {-|
  The progress token provided by the client or server.
  -}
  ProgressParams -> ProgressToken
_token :: Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken
  , {-|
  The progress data.
  -}
  ProgressParams -> Value
_value :: Data.Aeson.Value
  }
  deriving stock (Int -> ProgressParams -> ShowS
[ProgressParams] -> ShowS
ProgressParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProgressParams] -> ShowS
$cshowList :: [ProgressParams] -> ShowS
show :: ProgressParams -> String
$cshow :: ProgressParams -> String
showsPrec :: Int -> ProgressParams -> ShowS
$cshowsPrec :: Int -> ProgressParams -> ShowS
Show, ProgressParams -> ProgressParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProgressParams -> ProgressParams -> Bool
$c/= :: ProgressParams -> ProgressParams -> Bool
== :: ProgressParams -> ProgressParams -> Bool
$c== :: ProgressParams -> ProgressParams -> Bool
Eq, Eq ProgressParams
ProgressParams -> ProgressParams -> Bool
ProgressParams -> ProgressParams -> Ordering
ProgressParams -> ProgressParams -> ProgressParams
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 :: ProgressParams -> ProgressParams -> ProgressParams
$cmin :: ProgressParams -> ProgressParams -> ProgressParams
max :: ProgressParams -> ProgressParams -> ProgressParams
$cmax :: ProgressParams -> ProgressParams -> ProgressParams
>= :: ProgressParams -> ProgressParams -> Bool
$c>= :: ProgressParams -> ProgressParams -> Bool
> :: ProgressParams -> ProgressParams -> Bool
$c> :: ProgressParams -> ProgressParams -> Bool
<= :: ProgressParams -> ProgressParams -> Bool
$c<= :: ProgressParams -> ProgressParams -> Bool
< :: ProgressParams -> ProgressParams -> Bool
$c< :: ProgressParams -> ProgressParams -> Bool
compare :: ProgressParams -> ProgressParams -> Ordering
$ccompare :: ProgressParams -> ProgressParams -> Ordering
Ord, forall x. Rep ProgressParams x -> ProgressParams
forall x. ProgressParams -> Rep ProgressParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProgressParams x -> ProgressParams
$cfrom :: forall x. ProgressParams -> Rep ProgressParams x
Generic)
  deriving anyclass (ProgressParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: ProgressParams -> ()
$crnf :: ProgressParams -> ()
NFData, Eq ProgressParams
Int -> ProgressParams -> Int
ProgressParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ProgressParams -> Int
$chash :: ProgressParams -> Int
hashWithSalt :: Int -> ProgressParams -> Int
$chashWithSalt :: Int -> ProgressParams -> Int
Hashable)
  deriving forall ann. [ProgressParams] -> Doc ann
forall ann. ProgressParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ProgressParams] -> Doc ann
$cprettyList :: forall ann. [ProgressParams] -> Doc ann
pretty :: forall ann. ProgressParams -> Doc ann
$cpretty :: forall ann. ProgressParams -> Doc ann
Pretty via (ViaJSON ProgressParams)

instance Aeson.ToJSON ProgressParams where
  toJSON :: ProgressParams -> Value
toJSON (ProgressParams ProgressToken
arg0 Value
arg1) = [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
$  [[Key
"token" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= ProgressToken
arg0]
    ,[Key
"value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Value
arg1]]

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