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

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