{- 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.RenameRegistrationOptions 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.DocumentSelector
import qualified Language.LSP.Protocol.Types.Common

{-|
Registration options for a `RenameRequest`.
-}
data RenameRegistrationOptions = RenameRegistrationOptions 
  { {-|
  A document selector to identify the scope of the registration. If set to null
  the document selector provided on the client side will be used.
  -}
  RenameRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|

  -}
  RenameRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  Renames should be checked and tested before being executed.

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

instance Aeson.ToJSON RenameRegistrationOptions where
  toJSON :: RenameRegistrationOptions -> Value
toJSON (RenameRegistrationOptions DocumentSelector |? Null
arg0 Maybe Bool
arg1 Maybe Bool
arg2) = [Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$ [[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[Pair]] -> [Pair]) -> [[Pair]] -> [Pair]
forall a b. (a -> b) -> a -> b
$  [[Key
"documentSelector" Key -> (DocumentSelector |? Null) -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,String
"workDoneProgress" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1
    ,String
"prepareProvider" String -> Maybe Bool -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg2]

instance Aeson.FromJSON RenameRegistrationOptions where
  parseJSON :: Value -> Parser RenameRegistrationOptions
parseJSON = String
-> (Object -> Parser RenameRegistrationOptions)
-> Value
-> Parser RenameRegistrationOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"RenameRegistrationOptions" ((Object -> Parser RenameRegistrationOptions)
 -> Value -> Parser RenameRegistrationOptions)
-> (Object -> Parser RenameRegistrationOptions)
-> Value
-> Parser RenameRegistrationOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool -> Maybe Bool -> RenameRegistrationOptions
RenameRegistrationOptions ((DocumentSelector |? Null)
 -> Maybe Bool -> Maybe Bool -> RenameRegistrationOptions)
-> Parser (DocumentSelector |? Null)
-> Parser (Maybe Bool -> Maybe Bool -> RenameRegistrationOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (DocumentSelector |? Null)
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" Parser (Maybe Bool -> Maybe Bool -> RenameRegistrationOptions)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> RenameRegistrationOptions)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"workDoneProgress" Parser (Maybe Bool -> RenameRegistrationOptions)
-> Parser (Maybe Bool) -> Parser RenameRegistrationOptions
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe Bool)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"prepareProvider"