{- 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.MarkdownClientCapabilities 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

{-|
Client capabilities specific to the used markdown parser.

@since 3.16.0
-}
data MarkdownClientCapabilities = MarkdownClientCapabilities 
  { {-|
  The name of the parser.
  -}
  MarkdownClientCapabilities -> Text
_parser :: Data.Text.Text
  , {-|
  The version of the parser.
  -}
  MarkdownClientCapabilities -> Maybe Text
_version :: (Maybe Data.Text.Text)
  , {-|
  A list of HTML tags that the client allows / supports in
  Markdown.

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

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

instance Aeson.FromJSON MarkdownClientCapabilities where
  parseJSON :: Value -> Parser MarkdownClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"MarkdownClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text -> Maybe Text -> Maybe [Text] -> MarkdownClientCapabilities
MarkdownClientCapabilities forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"parser" 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
"version" 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
"allowedTags"