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

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

instance Aeson.ToJSON ExecuteCommandOptions where
  toJSON :: ExecuteCommandOptions -> Value
toJSON (ExecuteCommandOptions 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 ExecuteCommandOptions where
  parseJSON :: Value -> Parser ExecuteCommandOptions
parseJSON = String
-> (Object -> Parser ExecuteCommandOptions)
-> Value
-> Parser ExecuteCommandOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ExecuteCommandOptions" ((Object -> Parser ExecuteCommandOptions)
 -> Value -> Parser ExecuteCommandOptions)
-> (Object -> Parser ExecuteCommandOptions)
-> Value
-> Parser ExecuteCommandOptions
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Bool -> [Text] -> ExecuteCommandOptions
ExecuteCommandOptions (Maybe Bool -> [Text] -> ExecuteCommandOptions)
-> Parser (Maybe Bool) -> Parser ([Text] -> ExecuteCommandOptions)
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] -> ExecuteCommandOptions)
-> Parser [Text] -> Parser ExecuteCommandOptions
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"