{- 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.LogTraceParams 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.Types.Common

{-|

-}
data LogTraceParams = LogTraceParams 
  { {-|

  -}
  LogTraceParams -> Text
_message :: Data.Text.Text
  , {-|

  -}
  LogTraceParams -> Maybe Text
_verbose :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> LogTraceParams -> ShowS
[LogTraceParams] -> ShowS
LogTraceParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogTraceParams] -> ShowS
$cshowList :: [LogTraceParams] -> ShowS
show :: LogTraceParams -> String
$cshow :: LogTraceParams -> String
showsPrec :: Int -> LogTraceParams -> ShowS
$cshowsPrec :: Int -> LogTraceParams -> ShowS
Show, LogTraceParams -> LogTraceParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogTraceParams -> LogTraceParams -> Bool
$c/= :: LogTraceParams -> LogTraceParams -> Bool
== :: LogTraceParams -> LogTraceParams -> Bool
$c== :: LogTraceParams -> LogTraceParams -> Bool
Eq, Eq LogTraceParams
LogTraceParams -> LogTraceParams -> Bool
LogTraceParams -> LogTraceParams -> Ordering
LogTraceParams -> LogTraceParams -> LogTraceParams
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 :: LogTraceParams -> LogTraceParams -> LogTraceParams
$cmin :: LogTraceParams -> LogTraceParams -> LogTraceParams
max :: LogTraceParams -> LogTraceParams -> LogTraceParams
$cmax :: LogTraceParams -> LogTraceParams -> LogTraceParams
>= :: LogTraceParams -> LogTraceParams -> Bool
$c>= :: LogTraceParams -> LogTraceParams -> Bool
> :: LogTraceParams -> LogTraceParams -> Bool
$c> :: LogTraceParams -> LogTraceParams -> Bool
<= :: LogTraceParams -> LogTraceParams -> Bool
$c<= :: LogTraceParams -> LogTraceParams -> Bool
< :: LogTraceParams -> LogTraceParams -> Bool
$c< :: LogTraceParams -> LogTraceParams -> Bool
compare :: LogTraceParams -> LogTraceParams -> Ordering
$ccompare :: LogTraceParams -> LogTraceParams -> Ordering
Ord, forall x. Rep LogTraceParams x -> LogTraceParams
forall x. LogTraceParams -> Rep LogTraceParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogTraceParams x -> LogTraceParams
$cfrom :: forall x. LogTraceParams -> Rep LogTraceParams x
Generic)
  deriving anyclass (LogTraceParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: LogTraceParams -> ()
$crnf :: LogTraceParams -> ()
NFData, Eq LogTraceParams
Int -> LogTraceParams -> Int
LogTraceParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: LogTraceParams -> Int
$chash :: LogTraceParams -> Int
hashWithSalt :: Int -> LogTraceParams -> Int
$chashWithSalt :: Int -> LogTraceParams -> Int
Hashable)
  deriving forall ann. [LogTraceParams] -> Doc ann
forall ann. LogTraceParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [LogTraceParams] -> Doc ann
$cprettyList :: forall ann. [LogTraceParams] -> Doc ann
pretty :: forall ann. LogTraceParams -> Doc ann
$cpretty :: forall ann. LogTraceParams -> Doc ann
Pretty via (ViaJSON LogTraceParams)

instance Aeson.ToJSON LogTraceParams where
  toJSON :: LogTraceParams -> Value
toJSON (LogTraceParams Text
arg0 Maybe 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
"message" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Text
arg0]
    ,String
"verbose" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg1]

instance Aeson.FromJSON LogTraceParams where
  parseJSON :: Value -> Parser LogTraceParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"LogTraceParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text -> Maybe Text -> LogTraceParams
LogTraceParams forall (f :: * -> *) a b. Functor 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
"verbose"