{- 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
(Int -> ProgressParams -> ShowS)
-> (ProgressParams -> String)
-> ([ProgressParams] -> ShowS)
-> Show ProgressParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ProgressParams -> ShowS
showsPrec :: Int -> ProgressParams -> ShowS
$cshow :: ProgressParams -> String
show :: ProgressParams -> String
$cshowList :: [ProgressParams] -> ShowS
showList :: [ProgressParams] -> ShowS
Show, ProgressParams -> ProgressParams -> Bool
(ProgressParams -> ProgressParams -> Bool)
-> (ProgressParams -> ProgressParams -> Bool) -> Eq ProgressParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ProgressParams -> ProgressParams -> Bool
== :: ProgressParams -> ProgressParams -> Bool
$c/= :: ProgressParams -> ProgressParams -> Bool
/= :: ProgressParams -> ProgressParams -> Bool
Eq, Eq ProgressParams
Eq ProgressParams =>
(ProgressParams -> ProgressParams -> Ordering)
-> (ProgressParams -> ProgressParams -> Bool)
-> (ProgressParams -> ProgressParams -> Bool)
-> (ProgressParams -> ProgressParams -> Bool)
-> (ProgressParams -> ProgressParams -> Bool)
-> (ProgressParams -> ProgressParams -> ProgressParams)
-> (ProgressParams -> ProgressParams -> ProgressParams)
-> Ord 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
$ccompare :: ProgressParams -> ProgressParams -> Ordering
compare :: ProgressParams -> ProgressParams -> Ordering
$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
>= :: ProgressParams -> ProgressParams -> Bool
$cmax :: ProgressParams -> ProgressParams -> ProgressParams
max :: ProgressParams -> ProgressParams -> ProgressParams
$cmin :: ProgressParams -> ProgressParams -> ProgressParams
min :: ProgressParams -> ProgressParams -> ProgressParams
Ord, (forall x. ProgressParams -> Rep ProgressParams x)
-> (forall x. Rep ProgressParams x -> ProgressParams)
-> Generic ProgressParams
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
$cfrom :: forall x. ProgressParams -> Rep ProgressParams x
from :: forall x. ProgressParams -> Rep ProgressParams x
$cto :: forall x. Rep ProgressParams x -> ProgressParams
to :: forall x. Rep ProgressParams x -> ProgressParams
Generic)
  deriving anyclass (ProgressParams -> ()
(ProgressParams -> ()) -> NFData ProgressParams
forall a. (a -> ()) -> NFData a
$crnf :: ProgressParams -> ()
rnf :: ProgressParams -> ()
NFData, Eq ProgressParams
Eq ProgressParams =>
(Int -> ProgressParams -> Int)
-> (ProgressParams -> Int) -> Hashable ProgressParams
Int -> ProgressParams -> Int
ProgressParams -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> ProgressParams -> Int
hashWithSalt :: Int -> ProgressParams -> Int
$chash :: ProgressParams -> Int
hash :: ProgressParams -> Int
Hashable)
  deriving (forall ann. ProgressParams -> Doc ann)
-> (forall ann. [ProgressParams] -> Doc ann)
-> Pretty ProgressParams
forall ann. [ProgressParams] -> Doc ann
forall ann. ProgressParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. ProgressParams -> Doc ann
pretty :: forall ann. ProgressParams -> Doc ann
$cprettyList :: forall ann. [ProgressParams] -> Doc ann
prettyList :: 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 ([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
$  [[Key
"token" Key -> ProgressToken -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= ProgressToken
arg0]
    ,[Key
"value" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Value
arg1]]

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