{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.ShowMessageRequestParams 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 Data.Text
import qualified Language.LSP.Protocol.Internal.Types.MessageActionItem
import qualified Language.LSP.Protocol.Internal.Types.MessageType
import qualified Language.LSP.Protocol.Types.Common
data ShowMessageRequestParams = ShowMessageRequestParams
{
ShowMessageRequestParams -> MessageType
_type_ :: Language.LSP.Protocol.Internal.Types.MessageType.MessageType
,
ShowMessageRequestParams -> Text
_message :: Data.Text.Text
,
ShowMessageRequestParams -> Maybe [MessageActionItem]
_actions :: (Maybe [Language.LSP.Protocol.Internal.Types.MessageActionItem.MessageActionItem])
}
deriving stock (Int -> ShowMessageRequestParams -> ShowS
[ShowMessageRequestParams] -> ShowS
ShowMessageRequestParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShowMessageRequestParams] -> ShowS
$cshowList :: [ShowMessageRequestParams] -> ShowS
show :: ShowMessageRequestParams -> String
$cshow :: ShowMessageRequestParams -> String
showsPrec :: Int -> ShowMessageRequestParams -> ShowS
$cshowsPrec :: Int -> ShowMessageRequestParams -> ShowS
Show, ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
$c/= :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
== :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
$c== :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
Eq, Eq ShowMessageRequestParams
ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
ShowMessageRequestParams -> ShowMessageRequestParams -> Ordering
ShowMessageRequestParams
-> ShowMessageRequestParams -> ShowMessageRequestParams
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 :: ShowMessageRequestParams
-> ShowMessageRequestParams -> ShowMessageRequestParams
$cmin :: ShowMessageRequestParams
-> ShowMessageRequestParams -> ShowMessageRequestParams
max :: ShowMessageRequestParams
-> ShowMessageRequestParams -> ShowMessageRequestParams
$cmax :: ShowMessageRequestParams
-> ShowMessageRequestParams -> ShowMessageRequestParams
>= :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
$c>= :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
> :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
$c> :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
<= :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
$c<= :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
< :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
$c< :: ShowMessageRequestParams -> ShowMessageRequestParams -> Bool
compare :: ShowMessageRequestParams -> ShowMessageRequestParams -> Ordering
$ccompare :: ShowMessageRequestParams -> ShowMessageRequestParams -> Ordering
Ord, forall x.
Rep ShowMessageRequestParams x -> ShowMessageRequestParams
forall x.
ShowMessageRequestParams -> Rep ShowMessageRequestParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ShowMessageRequestParams x -> ShowMessageRequestParams
$cfrom :: forall x.
ShowMessageRequestParams -> Rep ShowMessageRequestParams x
Generic)
deriving anyclass (ShowMessageRequestParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: ShowMessageRequestParams -> ()
$crnf :: ShowMessageRequestParams -> ()
NFData, Eq ShowMessageRequestParams
Int -> ShowMessageRequestParams -> Int
ShowMessageRequestParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ShowMessageRequestParams -> Int
$chash :: ShowMessageRequestParams -> Int
hashWithSalt :: Int -> ShowMessageRequestParams -> Int
$chashWithSalt :: Int -> ShowMessageRequestParams -> Int
Hashable)
deriving forall ann. [ShowMessageRequestParams] -> Doc ann
forall ann. ShowMessageRequestParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ShowMessageRequestParams] -> Doc ann
$cprettyList :: forall ann. [ShowMessageRequestParams] -> Doc ann
pretty :: forall ann. ShowMessageRequestParams -> Doc ann
$cpretty :: forall ann. ShowMessageRequestParams -> Doc ann
Pretty via (ViaJSON ShowMessageRequestParams)
instance Aeson.ToJSON ShowMessageRequestParams where
toJSON :: ShowMessageRequestParams -> Value
toJSON (ShowMessageRequestParams MessageType
arg0 Text
arg1 Maybe [MessageActionItem]
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
$ [[Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= MessageType
arg0]
,[Key
"message" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg1]
,String
"actions" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [MessageActionItem]
arg2]
instance Aeson.FromJSON ShowMessageRequestParams where
parseJSON :: Value -> Parser ShowMessageRequestParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ShowMessageRequestParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> MessageType
-> Text -> Maybe [MessageActionItem] -> ShowMessageRequestParams
ShowMessageRequestParams forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"type" 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
"message" 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
"actions"