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

{-|

-}
data MonikerParams = MonikerParams 
  { {-|
  The text document.
  -}
  MonikerParams -> TextDocumentIdentifier
_textDocument :: Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier
  , {-|
  The position inside the text document.
  -}
  MonikerParams -> Position
_position :: Language.LSP.Protocol.Internal.Types.Position.Position
  , {-|
  An optional token that a server can use to report work done progress.
  -}
  MonikerParams -> 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.
  -}
  MonikerParams -> Maybe ProgressToken
_partialResultToken :: (Maybe Language.LSP.Protocol.Internal.Types.ProgressToken.ProgressToken)
  }
  deriving stock (Int -> MonikerParams -> ShowS
[MonikerParams] -> ShowS
MonikerParams -> String
(Int -> MonikerParams -> ShowS)
-> (MonikerParams -> String)
-> ([MonikerParams] -> ShowS)
-> Show MonikerParams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MonikerParams -> ShowS
showsPrec :: Int -> MonikerParams -> ShowS
$cshow :: MonikerParams -> String
show :: MonikerParams -> String
$cshowList :: [MonikerParams] -> ShowS
showList :: [MonikerParams] -> ShowS
Show, MonikerParams -> MonikerParams -> Bool
(MonikerParams -> MonikerParams -> Bool)
-> (MonikerParams -> MonikerParams -> Bool) -> Eq MonikerParams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MonikerParams -> MonikerParams -> Bool
== :: MonikerParams -> MonikerParams -> Bool
$c/= :: MonikerParams -> MonikerParams -> Bool
/= :: MonikerParams -> MonikerParams -> Bool
Eq, Eq MonikerParams
Eq MonikerParams =>
(MonikerParams -> MonikerParams -> Ordering)
-> (MonikerParams -> MonikerParams -> Bool)
-> (MonikerParams -> MonikerParams -> Bool)
-> (MonikerParams -> MonikerParams -> Bool)
-> (MonikerParams -> MonikerParams -> Bool)
-> (MonikerParams -> MonikerParams -> MonikerParams)
-> (MonikerParams -> MonikerParams -> MonikerParams)
-> Ord MonikerParams
MonikerParams -> MonikerParams -> Bool
MonikerParams -> MonikerParams -> Ordering
MonikerParams -> MonikerParams -> MonikerParams
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 :: MonikerParams -> MonikerParams -> Ordering
compare :: MonikerParams -> MonikerParams -> Ordering
$c< :: MonikerParams -> MonikerParams -> Bool
< :: MonikerParams -> MonikerParams -> Bool
$c<= :: MonikerParams -> MonikerParams -> Bool
<= :: MonikerParams -> MonikerParams -> Bool
$c> :: MonikerParams -> MonikerParams -> Bool
> :: MonikerParams -> MonikerParams -> Bool
$c>= :: MonikerParams -> MonikerParams -> Bool
>= :: MonikerParams -> MonikerParams -> Bool
$cmax :: MonikerParams -> MonikerParams -> MonikerParams
max :: MonikerParams -> MonikerParams -> MonikerParams
$cmin :: MonikerParams -> MonikerParams -> MonikerParams
min :: MonikerParams -> MonikerParams -> MonikerParams
Ord, (forall x. MonikerParams -> Rep MonikerParams x)
-> (forall x. Rep MonikerParams x -> MonikerParams)
-> Generic MonikerParams
forall x. Rep MonikerParams x -> MonikerParams
forall x. MonikerParams -> Rep MonikerParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MonikerParams -> Rep MonikerParams x
from :: forall x. MonikerParams -> Rep MonikerParams x
$cto :: forall x. Rep MonikerParams x -> MonikerParams
to :: forall x. Rep MonikerParams x -> MonikerParams
Generic)
  deriving anyclass (MonikerParams -> ()
(MonikerParams -> ()) -> NFData MonikerParams
forall a. (a -> ()) -> NFData a
$crnf :: MonikerParams -> ()
rnf :: MonikerParams -> ()
NFData, Eq MonikerParams
Eq MonikerParams =>
(Int -> MonikerParams -> Int)
-> (MonikerParams -> Int) -> Hashable MonikerParams
Int -> MonikerParams -> Int
MonikerParams -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> MonikerParams -> Int
hashWithSalt :: Int -> MonikerParams -> Int
$chash :: MonikerParams -> Int
hash :: MonikerParams -> Int
Hashable)
  deriving (forall ann. MonikerParams -> Doc ann)
-> (forall ann. [MonikerParams] -> Doc ann) -> Pretty MonikerParams
forall ann. [MonikerParams] -> Doc ann
forall ann. MonikerParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. MonikerParams -> Doc ann
pretty :: forall ann. MonikerParams -> Doc ann
$cprettyList :: forall ann. [MonikerParams] -> Doc ann
prettyList :: forall ann. [MonikerParams] -> Doc ann
Pretty via (ViaJSON MonikerParams)

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

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