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

{-|
Registration options for a `ExecuteCommandRequest`.
-}
data ExecuteCommandRegistrationOptions = ExecuteCommandRegistrationOptions 
  { {-|

  -}
  ExecuteCommandRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  The commands to be executed on the server
  -}
  ExecuteCommandRegistrationOptions -> [Text]
_commands :: [Data.Text.Text]
  }
  deriving stock (Int -> ExecuteCommandRegistrationOptions -> ShowS
[ExecuteCommandRegistrationOptions] -> ShowS
ExecuteCommandRegistrationOptions -> String
(Int -> ExecuteCommandRegistrationOptions -> ShowS)
-> (ExecuteCommandRegistrationOptions -> String)
-> ([ExecuteCommandRegistrationOptions] -> ShowS)
-> Show ExecuteCommandRegistrationOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ExecuteCommandRegistrationOptions -> ShowS
showsPrec :: Int -> ExecuteCommandRegistrationOptions -> ShowS
$cshow :: ExecuteCommandRegistrationOptions -> String
show :: ExecuteCommandRegistrationOptions -> String
$cshowList :: [ExecuteCommandRegistrationOptions] -> ShowS
showList :: [ExecuteCommandRegistrationOptions] -> ShowS
Show, ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
(ExecuteCommandRegistrationOptions
 -> ExecuteCommandRegistrationOptions -> Bool)
-> (ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions -> Bool)
-> Eq ExecuteCommandRegistrationOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
== :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
$c/= :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
/= :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
Eq, Eq ExecuteCommandRegistrationOptions
Eq ExecuteCommandRegistrationOptions =>
(ExecuteCommandRegistrationOptions
 -> ExecuteCommandRegistrationOptions -> Ordering)
-> (ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions -> Bool)
-> (ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions -> Bool)
-> (ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions -> Bool)
-> (ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions -> Bool)
-> (ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions)
-> (ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions
    -> ExecuteCommandRegistrationOptions)
-> Ord ExecuteCommandRegistrationOptions
ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Ordering
ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
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 :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Ordering
compare :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Ordering
$c< :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
< :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
$c<= :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
<= :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
$c> :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
> :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
$c>= :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
>= :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions -> Bool
$cmax :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
max :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
$cmin :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
min :: ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
-> ExecuteCommandRegistrationOptions
Ord, (forall x.
 ExecuteCommandRegistrationOptions
 -> Rep ExecuteCommandRegistrationOptions x)
-> (forall x.
    Rep ExecuteCommandRegistrationOptions x
    -> ExecuteCommandRegistrationOptions)
-> Generic ExecuteCommandRegistrationOptions
forall x.
Rep ExecuteCommandRegistrationOptions x
-> ExecuteCommandRegistrationOptions
forall x.
ExecuteCommandRegistrationOptions
-> Rep ExecuteCommandRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
ExecuteCommandRegistrationOptions
-> Rep ExecuteCommandRegistrationOptions x
from :: forall x.
ExecuteCommandRegistrationOptions
-> Rep ExecuteCommandRegistrationOptions x
$cto :: forall x.
Rep ExecuteCommandRegistrationOptions x
-> ExecuteCommandRegistrationOptions
to :: forall x.
Rep ExecuteCommandRegistrationOptions x
-> ExecuteCommandRegistrationOptions
Generic)
  deriving anyclass (ExecuteCommandRegistrationOptions -> ()
(ExecuteCommandRegistrationOptions -> ())
-> NFData ExecuteCommandRegistrationOptions
forall a. (a -> ()) -> NFData a
$crnf :: ExecuteCommandRegistrationOptions -> ()
rnf :: ExecuteCommandRegistrationOptions -> ()
NFData, Eq ExecuteCommandRegistrationOptions
Eq ExecuteCommandRegistrationOptions =>
(Int -> ExecuteCommandRegistrationOptions -> Int)
-> (ExecuteCommandRegistrationOptions -> Int)
-> Hashable ExecuteCommandRegistrationOptions
Int -> ExecuteCommandRegistrationOptions -> Int
ExecuteCommandRegistrationOptions -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> ExecuteCommandRegistrationOptions -> Int
hashWithSalt :: Int -> ExecuteCommandRegistrationOptions -> Int
$chash :: ExecuteCommandRegistrationOptions -> Int
hash :: ExecuteCommandRegistrationOptions -> Int
Hashable)
  deriving (forall ann. ExecuteCommandRegistrationOptions -> Doc ann)
-> (forall ann. [ExecuteCommandRegistrationOptions] -> Doc ann)
-> Pretty ExecuteCommandRegistrationOptions
forall ann. [ExecuteCommandRegistrationOptions] -> Doc ann
forall ann. ExecuteCommandRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. ExecuteCommandRegistrationOptions -> Doc ann
pretty :: forall ann. ExecuteCommandRegistrationOptions -> Doc ann
$cprettyList :: forall ann. [ExecuteCommandRegistrationOptions] -> Doc ann
prettyList :: forall ann. [ExecuteCommandRegistrationOptions] -> Doc ann
Pretty via (ViaJSON ExecuteCommandRegistrationOptions)

instance Aeson.ToJSON ExecuteCommandRegistrationOptions where
  toJSON :: ExecuteCommandRegistrationOptions -> Value
toJSON (ExecuteCommandRegistrationOptions Maybe Bool
arg0 [Text]
arg1) = [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
$  [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
arg0
    ,[Key
"commands" Key -> [Text] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [Text]
arg1]]

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