{- 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.DocumentFormattingClientCapabilities 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 Language.LSP.Protocol.Types.Common

{-|
Client capabilities of a `DocumentFormattingRequest`.
-}
data DocumentFormattingClientCapabilities = DocumentFormattingClientCapabilities 
  { {-|
  Whether formatting supports dynamic registration.
  -}
  DocumentFormattingClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  }
  deriving stock (Int -> DocumentFormattingClientCapabilities -> ShowS
[DocumentFormattingClientCapabilities] -> ShowS
DocumentFormattingClientCapabilities -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentFormattingClientCapabilities] -> ShowS
$cshowList :: [DocumentFormattingClientCapabilities] -> ShowS
show :: DocumentFormattingClientCapabilities -> String
$cshow :: DocumentFormattingClientCapabilities -> String
showsPrec :: Int -> DocumentFormattingClientCapabilities -> ShowS
$cshowsPrec :: Int -> DocumentFormattingClientCapabilities -> ShowS
Show, DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
$c/= :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
== :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
$c== :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
Eq, Eq DocumentFormattingClientCapabilities
DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Ordering
DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
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 :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
$cmin :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
max :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
$cmax :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities
>= :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
$c>= :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
> :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
$c> :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
<= :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
$c<= :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
< :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
$c< :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Bool
compare :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Ordering
$ccompare :: DocumentFormattingClientCapabilities
-> DocumentFormattingClientCapabilities -> Ordering
Ord, forall x.
Rep DocumentFormattingClientCapabilities x
-> DocumentFormattingClientCapabilities
forall x.
DocumentFormattingClientCapabilities
-> Rep DocumentFormattingClientCapabilities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentFormattingClientCapabilities x
-> DocumentFormattingClientCapabilities
$cfrom :: forall x.
DocumentFormattingClientCapabilities
-> Rep DocumentFormattingClientCapabilities x
Generic)
  deriving anyclass (DocumentFormattingClientCapabilities -> ()
forall a. (a -> ()) -> NFData a
rnf :: DocumentFormattingClientCapabilities -> ()
$crnf :: DocumentFormattingClientCapabilities -> ()
NFData, Eq DocumentFormattingClientCapabilities
Int -> DocumentFormattingClientCapabilities -> Int
DocumentFormattingClientCapabilities -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DocumentFormattingClientCapabilities -> Int
$chash :: DocumentFormattingClientCapabilities -> Int
hashWithSalt :: Int -> DocumentFormattingClientCapabilities -> Int
$chashWithSalt :: Int -> DocumentFormattingClientCapabilities -> Int
Hashable)
  deriving forall ann. [DocumentFormattingClientCapabilities] -> Doc ann
forall ann. DocumentFormattingClientCapabilities -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DocumentFormattingClientCapabilities] -> Doc ann
$cprettyList :: forall ann. [DocumentFormattingClientCapabilities] -> Doc ann
pretty :: forall ann. DocumentFormattingClientCapabilities -> Doc ann
$cpretty :: forall ann. DocumentFormattingClientCapabilities -> Doc ann
Pretty via (ViaJSON DocumentFormattingClientCapabilities)

instance Aeson.ToJSON DocumentFormattingClientCapabilities where
  toJSON :: DocumentFormattingClientCapabilities -> Value
toJSON (DocumentFormattingClientCapabilities Maybe Bool
arg0) = [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
$  [String
"dynamicRegistration" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg0]

instance Aeson.FromJSON DocumentFormattingClientCapabilities where
  parseJSON :: Value -> Parser DocumentFormattingClientCapabilities
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentFormattingClientCapabilities" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> DocumentFormattingClientCapabilities
DocumentFormattingClientCapabilities forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"dynamicRegistration"