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

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