-- 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.CodeLensParams 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.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common

{-|
The parameters of a `CodeLensRequest`.
-}
data CodeLensParams = CodeLensParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  CodeLensParams -> 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.
  -}
  CodeLensParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The document to request code lens for.
  -}
  CodeLensParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  }
  deriving stock (Int -> CodeLensParams -> ShowS
[CodeLensParams] -> ShowS
CodeLensParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CodeLensParams] -> ShowS
$cshowList :: [CodeLensParams] -> ShowS
show :: CodeLensParams -> String
$cshow :: CodeLensParams -> String
showsPrec :: Int -> CodeLensParams -> ShowS
$cshowsPrec :: Int -> CodeLensParams -> ShowS
Show, CodeLensParams -> CodeLensParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CodeLensParams -> CodeLensParams -> Bool
$c/= :: CodeLensParams -> CodeLensParams -> Bool
== :: CodeLensParams -> CodeLensParams -> Bool
$c== :: CodeLensParams -> CodeLensParams -> Bool
Eq, Eq CodeLensParams
CodeLensParams -> CodeLensParams -> Bool
CodeLensParams -> CodeLensParams -> Ordering
CodeLensParams -> CodeLensParams -> CodeLensParams
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 :: CodeLensParams -> CodeLensParams -> CodeLensParams
$cmin :: CodeLensParams -> CodeLensParams -> CodeLensParams
max :: CodeLensParams -> CodeLensParams -> CodeLensParams
$cmax :: CodeLensParams -> CodeLensParams -> CodeLensParams
>= :: CodeLensParams -> CodeLensParams -> Bool
$c>= :: CodeLensParams -> CodeLensParams -> Bool
> :: CodeLensParams -> CodeLensParams -> Bool
$c> :: CodeLensParams -> CodeLensParams -> Bool
<= :: CodeLensParams -> CodeLensParams -> Bool
$c<= :: CodeLensParams -> CodeLensParams -> Bool
< :: CodeLensParams -> CodeLensParams -> Bool
$c< :: CodeLensParams -> CodeLensParams -> Bool
compare :: CodeLensParams -> CodeLensParams -> Ordering
$ccompare :: CodeLensParams -> CodeLensParams -> Ordering
Ord, forall x. Rep CodeLensParams x -> CodeLensParams
forall x. CodeLensParams -> Rep CodeLensParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CodeLensParams x -> CodeLensParams
$cfrom :: forall x. CodeLensParams -> Rep CodeLensParams x
Generic)
  deriving anyclass (CodeLensParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: CodeLensParams -> ()
$crnf :: CodeLensParams -> ()
NFData, Eq CodeLensParams
Int -> CodeLensParams -> Int
CodeLensParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: CodeLensParams -> Int
$chash :: CodeLensParams -> Int
hashWithSalt :: Int -> CodeLensParams -> Int
$chashWithSalt :: Int -> CodeLensParams -> Int
Hashable)

instance Aeson.ToJSON CodeLensParams where
  toJSON :: CodeLensParams -> Value
toJSON (CodeLensParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 TextDocumentIdentifier
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
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg2]]

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