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

{-|

-}
data DidChangeWatchedFilesClientCapabilities = DidChangeWatchedFilesClientCapabilities 
  { {-|
  Did change watched files notification supports dynamic registration. Please note
  that the current protocol doesn't support static configuration for file changes
  from the server side.
  -}
  DidChangeWatchedFilesClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  , {-|
  Whether the client has support for `RelativePattern`
  or not.

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

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

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