{- 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InlineValueParams] -> ShowS
$cshowList :: [InlineValueParams] -> ShowS
show :: InlineValueParams -> String
$cshow :: InlineValueParams -> String
showsPrec :: Int -> InlineValueParams -> ShowS
$cshowsPrec :: Int -> InlineValueParams -> ShowS
Show, InlineValueParams -> InlineValueParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InlineValueParams -> InlineValueParams -> Bool
$c/= :: InlineValueParams -> InlineValueParams -> Bool
== :: InlineValueParams -> InlineValueParams -> Bool
$c== :: InlineValueParams -> InlineValueParams -> Bool
Eq, Eq 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
min :: InlineValueParams -> InlineValueParams -> InlineValueParams
$cmin :: InlineValueParams -> InlineValueParams -> InlineValueParams
max :: InlineValueParams -> InlineValueParams -> InlineValueParams
$cmax :: InlineValueParams -> InlineValueParams -> InlineValueParams
>= :: InlineValueParams -> InlineValueParams -> Bool
$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
compare :: InlineValueParams -> InlineValueParams -> Ordering
$ccompare :: InlineValueParams -> InlineValueParams -> Ordering
Ord, 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
$cto :: forall x. Rep InlineValueParams x -> InlineValueParams
$cfrom :: forall x. InlineValueParams -> Rep InlineValueParams x
Generic)
  deriving anyclass (InlineValueParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: InlineValueParams -> ()
$crnf :: InlineValueParams -> ()
NFData, Eq InlineValueParams
Int -> InlineValueParams -> Int
InlineValueParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: InlineValueParams -> Int
$chash :: InlineValueParams -> Int
hashWithSalt :: Int -> InlineValueParams -> Int
$chashWithSalt :: Int -> InlineValueParams -> Int
Hashable)
  deriving forall ann. [InlineValueParams] -> Doc ann
forall ann. InlineValueParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [InlineValueParams] -> Doc ann
$cprettyList :: forall ann. [InlineValueParams] -> Doc ann
pretty :: forall ann. InlineValueParams -> Doc ann
$cpretty :: 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 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
    ,[Key
"textDocument" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= TextDocumentIdentifier
arg1]
    ,[Key
"range" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg2]
    ,[Key
"context" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= InlineValueContext
arg3]]

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