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

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

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