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

{-|
Captures why the code action is currently disabled.

@since 3.18.0
@proposed
-}
data CodeActionDisabled = CodeActionDisabled 
  { {-|
  Human readable description of why the code action is currently disabled.

  This is displayed in the code actions UI.
  -}
  CodeActionDisabled -> Text
_reason :: Data.Text.Text
  }
  deriving stock (Int -> CodeActionDisabled -> ShowS
[CodeActionDisabled] -> ShowS
CodeActionDisabled -> String
(Int -> CodeActionDisabled -> ShowS)
-> (CodeActionDisabled -> String)
-> ([CodeActionDisabled] -> ShowS)
-> Show CodeActionDisabled
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CodeActionDisabled -> ShowS
showsPrec :: Int -> CodeActionDisabled -> ShowS
$cshow :: CodeActionDisabled -> String
show :: CodeActionDisabled -> String
$cshowList :: [CodeActionDisabled] -> ShowS
showList :: [CodeActionDisabled] -> ShowS
Show, CodeActionDisabled -> CodeActionDisabled -> Bool
(CodeActionDisabled -> CodeActionDisabled -> Bool)
-> (CodeActionDisabled -> CodeActionDisabled -> Bool)
-> Eq CodeActionDisabled
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CodeActionDisabled -> CodeActionDisabled -> Bool
== :: CodeActionDisabled -> CodeActionDisabled -> Bool
$c/= :: CodeActionDisabled -> CodeActionDisabled -> Bool
/= :: CodeActionDisabled -> CodeActionDisabled -> Bool
Eq, Eq CodeActionDisabled
Eq CodeActionDisabled =>
(CodeActionDisabled -> CodeActionDisabled -> Ordering)
-> (CodeActionDisabled -> CodeActionDisabled -> Bool)
-> (CodeActionDisabled -> CodeActionDisabled -> Bool)
-> (CodeActionDisabled -> CodeActionDisabled -> Bool)
-> (CodeActionDisabled -> CodeActionDisabled -> Bool)
-> (CodeActionDisabled -> CodeActionDisabled -> CodeActionDisabled)
-> (CodeActionDisabled -> CodeActionDisabled -> CodeActionDisabled)
-> Ord CodeActionDisabled
CodeActionDisabled -> CodeActionDisabled -> Bool
CodeActionDisabled -> CodeActionDisabled -> Ordering
CodeActionDisabled -> CodeActionDisabled -> CodeActionDisabled
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 :: CodeActionDisabled -> CodeActionDisabled -> Ordering
compare :: CodeActionDisabled -> CodeActionDisabled -> Ordering
$c< :: CodeActionDisabled -> CodeActionDisabled -> Bool
< :: CodeActionDisabled -> CodeActionDisabled -> Bool
$c<= :: CodeActionDisabled -> CodeActionDisabled -> Bool
<= :: CodeActionDisabled -> CodeActionDisabled -> Bool
$c> :: CodeActionDisabled -> CodeActionDisabled -> Bool
> :: CodeActionDisabled -> CodeActionDisabled -> Bool
$c>= :: CodeActionDisabled -> CodeActionDisabled -> Bool
>= :: CodeActionDisabled -> CodeActionDisabled -> Bool
$cmax :: CodeActionDisabled -> CodeActionDisabled -> CodeActionDisabled
max :: CodeActionDisabled -> CodeActionDisabled -> CodeActionDisabled
$cmin :: CodeActionDisabled -> CodeActionDisabled -> CodeActionDisabled
min :: CodeActionDisabled -> CodeActionDisabled -> CodeActionDisabled
Ord, (forall x. CodeActionDisabled -> Rep CodeActionDisabled x)
-> (forall x. Rep CodeActionDisabled x -> CodeActionDisabled)
-> Generic CodeActionDisabled
forall x. Rep CodeActionDisabled x -> CodeActionDisabled
forall x. CodeActionDisabled -> Rep CodeActionDisabled x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CodeActionDisabled -> Rep CodeActionDisabled x
from :: forall x. CodeActionDisabled -> Rep CodeActionDisabled x
$cto :: forall x. Rep CodeActionDisabled x -> CodeActionDisabled
to :: forall x. Rep CodeActionDisabled x -> CodeActionDisabled
Generic)
  deriving anyclass (CodeActionDisabled -> ()
(CodeActionDisabled -> ()) -> NFData CodeActionDisabled
forall a. (a -> ()) -> NFData a
$crnf :: CodeActionDisabled -> ()
rnf :: CodeActionDisabled -> ()
NFData, Eq CodeActionDisabled
Eq CodeActionDisabled =>
(Int -> CodeActionDisabled -> Int)
-> (CodeActionDisabled -> Int) -> Hashable CodeActionDisabled
Int -> CodeActionDisabled -> Int
CodeActionDisabled -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> CodeActionDisabled -> Int
hashWithSalt :: Int -> CodeActionDisabled -> Int
$chash :: CodeActionDisabled -> Int
hash :: CodeActionDisabled -> Int
Hashable)
  deriving (forall ann. CodeActionDisabled -> Doc ann)
-> (forall ann. [CodeActionDisabled] -> Doc ann)
-> Pretty CodeActionDisabled
forall ann. [CodeActionDisabled] -> Doc ann
forall ann. CodeActionDisabled -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. CodeActionDisabled -> Doc ann
pretty :: forall ann. CodeActionDisabled -> Doc ann
$cprettyList :: forall ann. [CodeActionDisabled] -> Doc ann
prettyList :: forall ann. [CodeActionDisabled] -> Doc ann
Pretty via (ViaJSON CodeActionDisabled)

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

instance Aeson.FromJSON CodeActionDisabled where
  parseJSON :: Value -> Parser CodeActionDisabled
parseJSON = String
-> (Object -> Parser CodeActionDisabled)
-> Value
-> Parser CodeActionDisabled
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"CodeActionDisabled" ((Object -> Parser CodeActionDisabled)
 -> Value -> Parser CodeActionDisabled)
-> (Object -> Parser CodeActionDisabled)
-> Value
-> Parser CodeActionDisabled
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Text -> CodeActionDisabled
CodeActionDisabled (Text -> CodeActionDisabled)
-> Parser Text -> Parser CodeActionDisabled
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"reason"