-- 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.ExecuteCommandOptions where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
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

{-|
The server capabilities of a `ExecuteCommandRequest`.
-}
data ExecuteCommandOptions = ExecuteCommandOptions 
  { {-|

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

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

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