{- 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.ShowMessageParams 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.MessageType
import qualified Language.LSP.Protocol.Types.Common

{-|
The parameters of a notification message.
-}
data ShowMessageParams = ShowMessageParams 
  { {-|
  The message type. See `MessageType`
  -}
  ShowMessageParams -> MessageType
_type_ :: Language.LSP.Protocol.Internal.Types.MessageType.MessageType
  , {-|
  The actual message.
  -}
  ShowMessageParams -> Text
_message :: Data.Text.Text
  }
  deriving stock (Int -> ShowMessageParams -> ShowS
[ShowMessageParams] -> ShowS
ShowMessageParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShowMessageParams] -> ShowS
$cshowList :: [ShowMessageParams] -> ShowS
show :: ShowMessageParams -> String
$cshow :: ShowMessageParams -> String
showsPrec :: Int -> ShowMessageParams -> ShowS
$cshowsPrec :: Int -> ShowMessageParams -> ShowS
Show, ShowMessageParams -> ShowMessageParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShowMessageParams -> ShowMessageParams -> Bool
$c/= :: ShowMessageParams -> ShowMessageParams -> Bool
== :: ShowMessageParams -> ShowMessageParams -> Bool
$c== :: ShowMessageParams -> ShowMessageParams -> Bool
Eq, Eq ShowMessageParams
ShowMessageParams -> ShowMessageParams -> Bool
ShowMessageParams -> ShowMessageParams -> Ordering
ShowMessageParams -> ShowMessageParams -> ShowMessageParams
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 :: ShowMessageParams -> ShowMessageParams -> ShowMessageParams
$cmin :: ShowMessageParams -> ShowMessageParams -> ShowMessageParams
max :: ShowMessageParams -> ShowMessageParams -> ShowMessageParams
$cmax :: ShowMessageParams -> ShowMessageParams -> ShowMessageParams
>= :: ShowMessageParams -> ShowMessageParams -> Bool
$c>= :: ShowMessageParams -> ShowMessageParams -> Bool
> :: ShowMessageParams -> ShowMessageParams -> Bool
$c> :: ShowMessageParams -> ShowMessageParams -> Bool
<= :: ShowMessageParams -> ShowMessageParams -> Bool
$c<= :: ShowMessageParams -> ShowMessageParams -> Bool
< :: ShowMessageParams -> ShowMessageParams -> Bool
$c< :: ShowMessageParams -> ShowMessageParams -> Bool
compare :: ShowMessageParams -> ShowMessageParams -> Ordering
$ccompare :: ShowMessageParams -> ShowMessageParams -> Ordering
Ord, forall x. Rep ShowMessageParams x -> ShowMessageParams
forall x. ShowMessageParams -> Rep ShowMessageParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShowMessageParams x -> ShowMessageParams
$cfrom :: forall x. ShowMessageParams -> Rep ShowMessageParams x
Generic)
  deriving anyclass (ShowMessageParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: ShowMessageParams -> ()
$crnf :: ShowMessageParams -> ()
NFData, Eq ShowMessageParams
Int -> ShowMessageParams -> Int
ShowMessageParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ShowMessageParams -> Int
$chash :: ShowMessageParams -> Int
hashWithSalt :: Int -> ShowMessageParams -> Int
$chashWithSalt :: Int -> ShowMessageParams -> Int
Hashable)
  deriving forall ann. [ShowMessageParams] -> Doc ann
forall ann. ShowMessageParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ShowMessageParams] -> Doc ann
$cprettyList :: forall ann. [ShowMessageParams] -> Doc ann
pretty :: forall ann. ShowMessageParams -> Doc ann
$cpretty :: forall ann. ShowMessageParams -> Doc ann
Pretty via (ViaJSON ShowMessageParams)

instance Aeson.ToJSON ShowMessageParams where
  toJSON :: ShowMessageParams -> Value
toJSON (ShowMessageParams MessageType
arg0 Text
arg1) = [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]]

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