{- 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.InitializeError 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 Language.LSP.Protocol.Types.Common

{-|
The data type of the ResponseError if the
initialize request fails.
-}
data InitializeError = InitializeError 
  { {-|
  Indicates whether the client execute the following retry logic:
  (1) show the message provided by the ResponseError to the user
  (2) user selects retry or cancel
  (3) if user selected retry the initialize method is sent again.
  -}
  InitializeError -> Bool
_retry :: Bool
  }
  deriving stock (Int -> InitializeError -> ShowS
[InitializeError] -> ShowS
InitializeError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InitializeError] -> ShowS
$cshowList :: [InitializeError] -> ShowS
show :: InitializeError -> String
$cshow :: InitializeError -> String
showsPrec :: Int -> InitializeError -> ShowS
$cshowsPrec :: Int -> InitializeError -> ShowS
Show, InitializeError -> InitializeError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InitializeError -> InitializeError -> Bool
$c/= :: InitializeError -> InitializeError -> Bool
== :: InitializeError -> InitializeError -> Bool
$c== :: InitializeError -> InitializeError -> Bool
Eq, Eq InitializeError
InitializeError -> InitializeError -> Bool
InitializeError -> InitializeError -> Ordering
InitializeError -> InitializeError -> InitializeError
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 :: InitializeError -> InitializeError -> InitializeError
$cmin :: InitializeError -> InitializeError -> InitializeError
max :: InitializeError -> InitializeError -> InitializeError
$cmax :: InitializeError -> InitializeError -> InitializeError
>= :: InitializeError -> InitializeError -> Bool
$c>= :: InitializeError -> InitializeError -> Bool
> :: InitializeError -> InitializeError -> Bool
$c> :: InitializeError -> InitializeError -> Bool
<= :: InitializeError -> InitializeError -> Bool
$c<= :: InitializeError -> InitializeError -> Bool
< :: InitializeError -> InitializeError -> Bool
$c< :: InitializeError -> InitializeError -> Bool
compare :: InitializeError -> InitializeError -> Ordering
$ccompare :: InitializeError -> InitializeError -> Ordering
Ord, forall x. Rep InitializeError x -> InitializeError
forall x. InitializeError -> Rep InitializeError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InitializeError x -> InitializeError
$cfrom :: forall x. InitializeError -> Rep InitializeError x
Generic)
  deriving anyclass (InitializeError -> ()
forall a. (a -> ()) -> NFData a
rnf :: InitializeError -> ()
$crnf :: InitializeError -> ()
NFData, Eq InitializeError
Int -> InitializeError -> Int
InitializeError -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: InitializeError -> Int
$chash :: InitializeError -> Int
hashWithSalt :: Int -> InitializeError -> Int
$chashWithSalt :: Int -> InitializeError -> Int
Hashable)
  deriving forall ann. [InitializeError] -> Doc ann
forall ann. InitializeError -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [InitializeError] -> Doc ann
$cprettyList :: forall ann. [InitializeError] -> Doc ann
pretty :: forall ann. InitializeError -> Doc ann
$cpretty :: forall ann. InitializeError -> Doc ann
Pretty via (ViaJSON InitializeError)

instance Aeson.ToJSON InitializeError where
  toJSON :: InitializeError -> Value
toJSON (InitializeError Bool
arg0) = [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
$  [[Key
"retry" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= Bool
arg0]]

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