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

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

instance Aeson.ToJSON DocumentColorParams where
  toJSON :: DocumentColorParams -> Value
toJSON (DocumentColorParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 TextDocumentIdentifier
arg2) = [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
    ,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
arg1
    ,[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
arg2]]

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