{- 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.InlineValueParams 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.InlineValueContext
import qualified Language.LSP.Protocol.Internal.Types.ProgressToken
import qualified Language.LSP.Protocol.Internal.Types.Range
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common

{-|
A parameter literal used in inline value requests.

@since 3.17.0
-}
data InlineValueParams = InlineValueParams 
  { {-|
  An optional token that a server can use to report work done progress.
  -}
  InlineValueParams -> Maybe ProgressToken
_workDoneToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  , {-|
  The text document.
  -}
  InlineValueParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  , {-|
  The document range for which inline values should be computed.
  -}
  InlineValueParams -> Range
_range :: Language.LSP.Protocol.Internal.Types.Range.Range
  , {-|
  Additional information about the context in which inline values were
  requested.
  -}
  InlineValueParams -> InlineValueContext
_context :: Language.LSP.Protocol.Internal.Types.InlineValueContext.InlineValueContext
  }
  deriving stock (Int -> InlineValueParams -> ShowS
[InlineValueParams] -> ShowS
InlineValueParams -> String
(Int -> InlineValueParams -> ShowS)
-> (InlineValueParams -> String)
-> ([InlineValueParams] -> ShowS)
-> Show InlineValueParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InlineValueParams -> ShowS
showsPrec :: Int -> InlineValueParams -> ShowS
$cshow :: InlineValueParams -> String
show :: InlineValueParams -> String
$cshowList :: [InlineValueParams] -> ShowS
showList :: [InlineValueParams] -> ShowS
Show, InlineValueParams -> InlineValueParams -> Bool
(InlineValueParams -> InlineValueParams -> Bool)
-> (InlineValueParams -> InlineValueParams -> Bool)
-> Eq InlineValueParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InlineValueParams -> InlineValueParams -> Bool
== :: InlineValueParams -> InlineValueParams -> Bool
$c/= :: InlineValueParams -> InlineValueParams -> Bool
/= :: InlineValueParams -> InlineValueParams -> Bool
Eq, Eq InlineValueParams
Eq InlineValueParams =>
(InlineValueParams -> InlineValueParams -> Ordering)
-> (InlineValueParams -> InlineValueParams -> Bool)
-> (InlineValueParams -> InlineValueParams -> Bool)
-> (InlineValueParams -> InlineValueParams -> Bool)
-> (InlineValueParams -> InlineValueParams -> Bool)
-> (InlineValueParams -> InlineValueParams -> InlineValueParams)
-> (InlineValueParams -> InlineValueParams -> InlineValueParams)
-> Ord InlineValueParams
InlineValueParams -> InlineValueParams -> Bool
InlineValueParams -> InlineValueParams -> Ordering
InlineValueParams -> InlineValueParams -> InlineValueParams
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 :: InlineValueParams -> InlineValueParams -> Ordering
compare :: InlineValueParams -> InlineValueParams -> Ordering
$c< :: InlineValueParams -> InlineValueParams -> Bool
< :: InlineValueParams -> InlineValueParams -> Bool
$c<= :: InlineValueParams -> InlineValueParams -> Bool
<= :: InlineValueParams -> InlineValueParams -> Bool
$c> :: InlineValueParams -> InlineValueParams -> Bool
> :: InlineValueParams -> InlineValueParams -> Bool
$c>= :: InlineValueParams -> InlineValueParams -> Bool
>= :: InlineValueParams -> InlineValueParams -> Bool
$cmax :: InlineValueParams -> InlineValueParams -> InlineValueParams
max :: InlineValueParams -> InlineValueParams -> InlineValueParams
$cmin :: InlineValueParams -> InlineValueParams -> InlineValueParams
min :: InlineValueParams -> InlineValueParams -> InlineValueParams
Ord, (forall x. InlineValueParams -> Rep InlineValueParams x)
-> (forall x. Rep InlineValueParams x -> InlineValueParams)
-> Generic InlineValueParams
forall x. Rep InlineValueParams x -> InlineValueParams
forall x. InlineValueParams -> Rep InlineValueParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. InlineValueParams -> Rep InlineValueParams x
from :: forall x. InlineValueParams -> Rep InlineValueParams x
$cto :: forall x. Rep InlineValueParams x -> InlineValueParams
to :: forall x. Rep InlineValueParams x -> InlineValueParams
Generic)
  deriving anyclass (InlineValueParams -> ()
(InlineValueParams -> ()) -> NFData InlineValueParams
forall a. (a -> ()) -> NFData a
$crnf :: InlineValueParams -> ()
rnf :: InlineValueParams -> ()
NFData, Eq InlineValueParams
Eq InlineValueParams =>
(Int -> InlineValueParams -> Int)
-> (InlineValueParams -> Int) -> Hashable InlineValueParams
Int -> InlineValueParams -> Int
InlineValueParams -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> InlineValueParams -> Int
hashWithSalt :: Int -> InlineValueParams -> Int
$chash :: InlineValueParams -> Int
hash :: InlineValueParams -> Int
Hashable)
  deriving (forall ann. InlineValueParams -> Doc ann)
-> (forall ann. [InlineValueParams] -> Doc ann)
-> Pretty InlineValueParams
forall ann. [InlineValueParams] -> Doc ann
forall ann. InlineValueParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. InlineValueParams -> Doc ann
pretty :: forall ann. InlineValueParams -> Doc ann
$cprettyList :: forall ann. [InlineValueParams] -> Doc ann
prettyList :: forall ann. [InlineValueParams] -> Doc ann
Pretty via (ViaJSON InlineValueParams)

instance Aeson.ToJSON InlineValueParams where
  toJSON :: InlineValueParams -> Value
toJSON (InlineValueParams Maybe ProgressToken
arg0 TextDocumentIdentifier
arg1 Range
arg2 InlineValueContext
arg3) = [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
$  [String
"workDoneToken" String -> Maybe ProgressToken -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe ProgressToken
arg0
    ,[Key
"textDocument" Key -> TextDocumentIdentifier -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg1]
    ,[Key
"range" Key -> Range -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg2]
    ,[Key
"context" Key -> InlineValueContext -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= InlineValueContext
arg3]]

instance Aeson.FromJSON InlineValueParams where
  parseJSON :: Value -> Parser InlineValueParams
parseJSON = String
-> (Object -> Parser InlineValueParams)
-> Value
-> Parser InlineValueParams
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"InlineValueParams" ((Object -> Parser InlineValueParams)
 -> Value -> Parser InlineValueParams)
-> (Object -> Parser InlineValueParams)
-> Value
-> Parser InlineValueParams
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe ProgressToken
-> TextDocumentIdentifier
-> Range
-> InlineValueContext
-> InlineValueParams
InlineValueParams (Maybe ProgressToken
 -> TextDocumentIdentifier
 -> Range
 -> InlineValueContext
 -> InlineValueParams)
-> Parser (Maybe ProgressToken)
-> Parser
     (TextDocumentIdentifier
      -> Range -> InlineValueContext -> InlineValueParams)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe ProgressToken)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneToken" Parser
  (TextDocumentIdentifier
   -> Range -> InlineValueContext -> InlineValueParams)
-> Parser TextDocumentIdentifier
-> Parser (Range -> InlineValueContext -> InlineValueParams)
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 TextDocumentIdentifier
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"textDocument" Parser (Range -> InlineValueContext -> InlineValueParams)
-> Parser Range -> Parser (InlineValueContext -> InlineValueParams)
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 Range
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"range" Parser (InlineValueContext -> InlineValueParams)
-> Parser InlineValueContext -> Parser InlineValueParams
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 InlineValueContext
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"context"