{- 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.ApplyWorkspaceEditParams 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.Internal.Types.WorkspaceEdit
import qualified Language.LSP.Protocol.Types.Common

{-|
The parameters passed via a apply workspace edit request.
-}
data ApplyWorkspaceEditParams = ApplyWorkspaceEditParams 
  { {-|
  An optional label of the workspace edit. This label is
  presented in the user interface for example on an undo
  stack to undo the workspace edit.
  -}
  ApplyWorkspaceEditParams -> Maybe Text
_label :: (Maybe Data.Text.Text)
  , {-|
  The edits to apply.
  -}
  ApplyWorkspaceEditParams -> WorkspaceEdit
_edit :: Language.LSP.Protocol.Internal.Types.WorkspaceEdit.WorkspaceEdit
  }
  deriving stock (Int -> ApplyWorkspaceEditParams -> ShowS
[ApplyWorkspaceEditParams] -> ShowS
ApplyWorkspaceEditParams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplyWorkspaceEditParams] -> ShowS
$cshowList :: [ApplyWorkspaceEditParams] -> ShowS
show :: ApplyWorkspaceEditParams -> String
$cshow :: ApplyWorkspaceEditParams -> String
showsPrec :: Int -> ApplyWorkspaceEditParams -> ShowS
$cshowsPrec :: Int -> ApplyWorkspaceEditParams -> ShowS
Show, ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
$c/= :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
== :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
$c== :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
Eq, Eq ApplyWorkspaceEditParams
ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Ordering
ApplyWorkspaceEditParams
-> ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams
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 :: ApplyWorkspaceEditParams
-> ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams
$cmin :: ApplyWorkspaceEditParams
-> ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams
max :: ApplyWorkspaceEditParams
-> ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams
$cmax :: ApplyWorkspaceEditParams
-> ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams
>= :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
$c>= :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
> :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
$c> :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
<= :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
$c<= :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
< :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
$c< :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Bool
compare :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Ordering
$ccompare :: ApplyWorkspaceEditParams -> ApplyWorkspaceEditParams -> Ordering
Ord, forall x.
Rep ApplyWorkspaceEditParams x -> ApplyWorkspaceEditParams
forall x.
ApplyWorkspaceEditParams -> Rep ApplyWorkspaceEditParams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplyWorkspaceEditParams x -> ApplyWorkspaceEditParams
$cfrom :: forall x.
ApplyWorkspaceEditParams -> Rep ApplyWorkspaceEditParams x
Generic)
  deriving anyclass (ApplyWorkspaceEditParams -> ()
forall a. (a -> ()) -> NFData a
rnf :: ApplyWorkspaceEditParams -> ()
$crnf :: ApplyWorkspaceEditParams -> ()
NFData, Eq ApplyWorkspaceEditParams
Int -> ApplyWorkspaceEditParams -> Int
ApplyWorkspaceEditParams -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ApplyWorkspaceEditParams -> Int
$chash :: ApplyWorkspaceEditParams -> Int
hashWithSalt :: Int -> ApplyWorkspaceEditParams -> Int
$chashWithSalt :: Int -> ApplyWorkspaceEditParams -> Int
Hashable)
  deriving forall ann. [ApplyWorkspaceEditParams] -> Doc ann
forall ann. ApplyWorkspaceEditParams -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [ApplyWorkspaceEditParams] -> Doc ann
$cprettyList :: forall ann. [ApplyWorkspaceEditParams] -> Doc ann
pretty :: forall ann. ApplyWorkspaceEditParams -> Doc ann
$cpretty :: forall ann. ApplyWorkspaceEditParams -> Doc ann
Pretty via (ViaJSON ApplyWorkspaceEditParams)

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

instance Aeson.FromJSON ApplyWorkspaceEditParams where
  parseJSON :: Value -> Parser ApplyWorkspaceEditParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ApplyWorkspaceEditParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Text -> WorkspaceEdit -> ApplyWorkspaceEditParams
ApplyWorkspaceEditParams 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
"label" 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
"edit"