{- 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.ColorPresentationParams 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.Color
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

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

instance Aeson.ToJSON ColorPresentationParams where
  toJSON :: ColorPresentationParams -> Value
toJSON (ColorPresentationParams Maybe ProgressToken
arg0 Maybe ProgressToken
arg1 TextDocumentIdentifier
arg2 Color
arg3 Range
arg4) = [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]
    ,[Key
"color" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Color
arg3]
    ,[Key
"range" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Range
arg4]]

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