{- 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.RenameClientCapabilities 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.Internal.Types.PrepareSupportDefaultBehavior
import qualified Language.LSP.Protocol.Types.Common

{-|

-}
data RenameClientCapabilities = RenameClientCapabilities 
  { {-|
  Whether rename supports dynamic registration.
  -}
  RenameClientCapabilities -> Maybe Bool
_dynamicRegistration :: (Maybe Bool)
  , {-|
  Client supports testing for validity of rename operations
  before execution.

  @since 3.12.0
  -}
  RenameClientCapabilities -> Maybe Bool
_prepareSupport :: (Maybe Bool)
  , {-|
  Client supports the default behavior result.

  The value indicates the default behavior used by the
  client.

  @since 3.16.0
  -}
  RenameClientCapabilities -> Maybe PrepareSupportDefaultBehavior
_prepareSupportDefaultBehavior :: (Maybe Language.LSP.Protocol.Internal.Types.PrepareSupportDefaultBehavior.PrepareSupportDefaultBehavior)
  , {-|
  Whether the client honors the change annotations in
  text edits and resource operations returned via the
  rename request's workspace edit by for example presenting
  the workspace edit in the user interface and asking
  for confirmation.

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

instance Aeson.ToJSON RenameClientCapabilities where
  toJSON :: RenameClientCapabilities -> Value
toJSON (RenameClientCapabilities Maybe Bool
arg0 Maybe Bool
arg1 Maybe PrepareSupportDefaultBehavior
arg2 Maybe Bool
arg3) = [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
"prepareSupport" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1
    ,String
"prepareSupportDefaultBehavior" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe PrepareSupportDefaultBehavior
arg2
    ,String
"honorsChangeAnnotations" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg3]

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