{- 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.FailureHandlingKind 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.Set
import qualified Data.String
import qualified Data.Text
import qualified Language.LSP.Protocol.Types.LspEnum

{-|

-}
data FailureHandlingKind = 
    {-|
  Applying the workspace change is simply aborted if one of the changes provided
  fails. All operations executed before the failing operation stay executed.
  -}
  FailureHandlingKind_Abort
  | {-|
  All operations are executed transactional. That means they either all
  succeed or no changes at all are applied to the workspace.
  -}
  FailureHandlingKind_Transactional
  | {-|
  If the workspace edit contains only textual file changes they are executed transactional.
  If resource changes (create, rename or delete file) are part of the change the failure
  handling strategy is abort.
  -}
  FailureHandlingKind_TextOnlyTransactional
  | {-|
  The client tries to undo the operations already executed. But there is no
  guarantee that this is succeeding.
  -}
  FailureHandlingKind_Undo
  deriving stock (Int -> FailureHandlingKind -> ShowS
[FailureHandlingKind] -> ShowS
FailureHandlingKind -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailureHandlingKind] -> ShowS
$cshowList :: [FailureHandlingKind] -> ShowS
show :: FailureHandlingKind -> String
$cshow :: FailureHandlingKind -> String
showsPrec :: Int -> FailureHandlingKind -> ShowS
$cshowsPrec :: Int -> FailureHandlingKind -> ShowS
Show, FailureHandlingKind -> FailureHandlingKind -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailureHandlingKind -> FailureHandlingKind -> Bool
$c/= :: FailureHandlingKind -> FailureHandlingKind -> Bool
== :: FailureHandlingKind -> FailureHandlingKind -> Bool
$c== :: FailureHandlingKind -> FailureHandlingKind -> Bool
Eq, Eq FailureHandlingKind
FailureHandlingKind -> FailureHandlingKind -> Bool
FailureHandlingKind -> FailureHandlingKind -> Ordering
FailureHandlingKind -> FailureHandlingKind -> FailureHandlingKind
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 :: FailureHandlingKind -> FailureHandlingKind -> FailureHandlingKind
$cmin :: FailureHandlingKind -> FailureHandlingKind -> FailureHandlingKind
max :: FailureHandlingKind -> FailureHandlingKind -> FailureHandlingKind
$cmax :: FailureHandlingKind -> FailureHandlingKind -> FailureHandlingKind
>= :: FailureHandlingKind -> FailureHandlingKind -> Bool
$c>= :: FailureHandlingKind -> FailureHandlingKind -> Bool
> :: FailureHandlingKind -> FailureHandlingKind -> Bool
$c> :: FailureHandlingKind -> FailureHandlingKind -> Bool
<= :: FailureHandlingKind -> FailureHandlingKind -> Bool
$c<= :: FailureHandlingKind -> FailureHandlingKind -> Bool
< :: FailureHandlingKind -> FailureHandlingKind -> Bool
$c< :: FailureHandlingKind -> FailureHandlingKind -> Bool
compare :: FailureHandlingKind -> FailureHandlingKind -> Ordering
$ccompare :: FailureHandlingKind -> FailureHandlingKind -> Ordering
Ord, forall x. Rep FailureHandlingKind x -> FailureHandlingKind
forall x. FailureHandlingKind -> Rep FailureHandlingKind x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FailureHandlingKind x -> FailureHandlingKind
$cfrom :: forall x. FailureHandlingKind -> Rep FailureHandlingKind x
Generic)
  deriving anyclass (FailureHandlingKind -> ()
forall a. (a -> ()) -> NFData a
rnf :: FailureHandlingKind -> ()
$crnf :: FailureHandlingKind -> ()
NFData, Eq FailureHandlingKind
Int -> FailureHandlingKind -> Int
FailureHandlingKind -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: FailureHandlingKind -> Int
$chash :: FailureHandlingKind -> Int
hashWithSalt :: Int -> FailureHandlingKind -> Int
$chashWithSalt :: Int -> FailureHandlingKind -> Int
Hashable)
  deriving ( [FailureHandlingKind] -> Encoding
[FailureHandlingKind] -> Value
FailureHandlingKind -> Encoding
FailureHandlingKind -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [FailureHandlingKind] -> Encoding
$ctoEncodingList :: [FailureHandlingKind] -> Encoding
toJSONList :: [FailureHandlingKind] -> Value
$ctoJSONList :: [FailureHandlingKind] -> Value
toEncoding :: FailureHandlingKind -> Encoding
$ctoEncoding :: FailureHandlingKind -> Encoding
toJSON :: FailureHandlingKind -> Value
$ctoJSON :: FailureHandlingKind -> Value
Aeson.ToJSON
  , Value -> Parser [FailureHandlingKind]
Value -> Parser FailureHandlingKind
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [FailureHandlingKind]
$cparseJSONList :: Value -> Parser [FailureHandlingKind]
parseJSON :: Value -> Parser FailureHandlingKind
$cparseJSON :: Value -> Parser FailureHandlingKind
Aeson.FromJSON ) via (Language.LSP.Protocol.Types.LspEnum.AsLspEnum FailureHandlingKind Data.Text.Text)
  deriving forall ann. [FailureHandlingKind] -> Doc ann
forall ann. FailureHandlingKind -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [FailureHandlingKind] -> Doc ann
$cprettyList :: forall ann. [FailureHandlingKind] -> Doc ann
pretty :: forall ann. FailureHandlingKind -> Doc ann
$cpretty :: forall ann. FailureHandlingKind -> Doc ann
Pretty via (ViaJSON FailureHandlingKind)

instance Language.LSP.Protocol.Types.LspEnum.LspEnum FailureHandlingKind where
  knownValues :: Set FailureHandlingKind
knownValues = forall a. Ord a => [a] -> Set a
Data.Set.fromList [FailureHandlingKind
FailureHandlingKind_Abort
    ,FailureHandlingKind
FailureHandlingKind_Transactional
    ,FailureHandlingKind
FailureHandlingKind_TextOnlyTransactional
    ,FailureHandlingKind
FailureHandlingKind_Undo]
  type EnumBaseType FailureHandlingKind = Data.Text.Text
  toEnumBaseType :: FailureHandlingKind -> EnumBaseType FailureHandlingKind
toEnumBaseType FailureHandlingKind
FailureHandlingKind_Abort = Text
"abort"
  toEnumBaseType FailureHandlingKind
FailureHandlingKind_Transactional = Text
"transactional"
  toEnumBaseType FailureHandlingKind
FailureHandlingKind_TextOnlyTransactional = Text
"textOnlyTransactional"
  toEnumBaseType FailureHandlingKind
FailureHandlingKind_Undo = Text
"undo"
  fromEnumBaseType :: EnumBaseType FailureHandlingKind -> Maybe FailureHandlingKind
fromEnumBaseType EnumBaseType FailureHandlingKind
"abort" = forall (f :: * -> *) a. Applicative f => a -> f a
pure FailureHandlingKind
FailureHandlingKind_Abort
  fromEnumBaseType EnumBaseType FailureHandlingKind
"transactional" = forall (f :: * -> *) a. Applicative f => a -> f a
pure FailureHandlingKind
FailureHandlingKind_Transactional
  fromEnumBaseType EnumBaseType FailureHandlingKind
"textOnlyTransactional" = forall (f :: * -> *) a. Applicative f => a -> f a
pure FailureHandlingKind
FailureHandlingKind_TextOnlyTransactional
  fromEnumBaseType EnumBaseType FailureHandlingKind
"undo" = forall (f :: * -> *) a. Applicative f => a -> f a
pure FailureHandlingKind
FailureHandlingKind_Undo
  fromEnumBaseType EnumBaseType FailureHandlingKind
_ = forall a. Maybe a
Nothing