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

{-|
The workspace folder change event.
-}
data WorkspaceFoldersChangeEvent = WorkspaceFoldersChangeEvent 
  { {-|
  The array of added workspace folders
  -}
  WorkspaceFoldersChangeEvent -> [WorkspaceFolder]
_added :: [Language.LSP.Protocol.Internal.Types.WorkspaceFolder.WorkspaceFolder]
  , {-|
  The array of the removed workspace folders
  -}
  WorkspaceFoldersChangeEvent -> [WorkspaceFolder]
_removed :: [Language.LSP.Protocol.Internal.Types.WorkspaceFolder.WorkspaceFolder]
  }
  deriving stock (Int -> WorkspaceFoldersChangeEvent -> ShowS
[WorkspaceFoldersChangeEvent] -> ShowS
WorkspaceFoldersChangeEvent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceFoldersChangeEvent] -> ShowS
$cshowList :: [WorkspaceFoldersChangeEvent] -> ShowS
show :: WorkspaceFoldersChangeEvent -> String
$cshow :: WorkspaceFoldersChangeEvent -> String
showsPrec :: Int -> WorkspaceFoldersChangeEvent -> ShowS
$cshowsPrec :: Int -> WorkspaceFoldersChangeEvent -> ShowS
Show, WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
$c/= :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
== :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
$c== :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
Eq, Eq WorkspaceFoldersChangeEvent
WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> Ordering
WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent
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 :: WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent
$cmin :: WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent
max :: WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent
$cmax :: WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent
>= :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
$c>= :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
> :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
$c> :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
<= :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
$c<= :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
< :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
$c< :: WorkspaceFoldersChangeEvent -> WorkspaceFoldersChangeEvent -> Bool
compare :: WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> Ordering
$ccompare :: WorkspaceFoldersChangeEvent
-> WorkspaceFoldersChangeEvent -> Ordering
Ord, forall x.
Rep WorkspaceFoldersChangeEvent x -> WorkspaceFoldersChangeEvent
forall x.
WorkspaceFoldersChangeEvent -> Rep WorkspaceFoldersChangeEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkspaceFoldersChangeEvent x -> WorkspaceFoldersChangeEvent
$cfrom :: forall x.
WorkspaceFoldersChangeEvent -> Rep WorkspaceFoldersChangeEvent x
Generic)
  deriving anyclass (WorkspaceFoldersChangeEvent -> ()
forall a. (a -> ()) -> NFData a
rnf :: WorkspaceFoldersChangeEvent -> ()
$crnf :: WorkspaceFoldersChangeEvent -> ()
NFData, Eq WorkspaceFoldersChangeEvent
Int -> WorkspaceFoldersChangeEvent -> Int
WorkspaceFoldersChangeEvent -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: WorkspaceFoldersChangeEvent -> Int
$chash :: WorkspaceFoldersChangeEvent -> Int
hashWithSalt :: Int -> WorkspaceFoldersChangeEvent -> Int
$chashWithSalt :: Int -> WorkspaceFoldersChangeEvent -> Int
Hashable)
  deriving forall ann. [WorkspaceFoldersChangeEvent] -> Doc ann
forall ann. WorkspaceFoldersChangeEvent -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [WorkspaceFoldersChangeEvent] -> Doc ann
$cprettyList :: forall ann. [WorkspaceFoldersChangeEvent] -> Doc ann
pretty :: forall ann. WorkspaceFoldersChangeEvent -> Doc ann
$cpretty :: forall ann. WorkspaceFoldersChangeEvent -> Doc ann
Pretty via (ViaJSON WorkspaceFoldersChangeEvent)

instance Aeson.ToJSON WorkspaceFoldersChangeEvent where
  toJSON :: WorkspaceFoldersChangeEvent -> Value
toJSON (WorkspaceFoldersChangeEvent [WorkspaceFolder]
arg0 [WorkspaceFolder]
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
$  [[Key
"added" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [WorkspaceFolder]
arg0]
    ,[Key
"removed" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [WorkspaceFolder]
arg1]]

instance Aeson.FromJSON WorkspaceFoldersChangeEvent where
  parseJSON :: Value -> Parser WorkspaceFoldersChangeEvent
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkspaceFoldersChangeEvent" forall a b. (a -> b) -> a -> b
$ \Object
arg -> [WorkspaceFolder]
-> [WorkspaceFolder] -> WorkspaceFoldersChangeEvent
WorkspaceFoldersChangeEvent forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"added" 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
"removed"