{- 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.NotebookDocumentCellChangeStructure 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.NotebookCellArrayChange
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentItem
import qualified Language.LSP.Protocol.Types.Common

{-|
Structural changes to cells in a notebook document.

@since 3.18.0
@proposed
-}
data NotebookDocumentCellChangeStructure = NotebookDocumentCellChangeStructure 
  { {-|
  The change to the cell array.
  -}
  NotebookDocumentCellChangeStructure -> NotebookCellArrayChange
_array :: Language.LSP.Protocol.Internal.Types.NotebookCellArrayChange.NotebookCellArrayChange
  , {-|
  Additional opened cell text documents.
  -}
  NotebookDocumentCellChangeStructure -> Maybe [TextDocumentItem]
_didOpen :: (Maybe [Language.LSP.Protocol.Internal.Types.TextDocumentItem.TextDocumentItem])
  , {-|
  Additional closed cell text documents.
  -}
  NotebookDocumentCellChangeStructure
-> Maybe [TextDocumentIdentifier]
_didClose :: (Maybe [Language.LSP.Protocol.Internal.Types.TextDocumentIdentifier.TextDocumentIdentifier])
  }
  deriving stock (Int -> NotebookDocumentCellChangeStructure -> ShowS
[NotebookDocumentCellChangeStructure] -> ShowS
NotebookDocumentCellChangeStructure -> String
(Int -> NotebookDocumentCellChangeStructure -> ShowS)
-> (NotebookDocumentCellChangeStructure -> String)
-> ([NotebookDocumentCellChangeStructure] -> ShowS)
-> Show NotebookDocumentCellChangeStructure
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NotebookDocumentCellChangeStructure -> ShowS
showsPrec :: Int -> NotebookDocumentCellChangeStructure -> ShowS
$cshow :: NotebookDocumentCellChangeStructure -> String
show :: NotebookDocumentCellChangeStructure -> String
$cshowList :: [NotebookDocumentCellChangeStructure] -> ShowS
showList :: [NotebookDocumentCellChangeStructure] -> ShowS
Show, NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
(NotebookDocumentCellChangeStructure
 -> NotebookDocumentCellChangeStructure -> Bool)
-> (NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure -> Bool)
-> Eq NotebookDocumentCellChangeStructure
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
== :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
$c/= :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
/= :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
Eq, Eq NotebookDocumentCellChangeStructure
Eq NotebookDocumentCellChangeStructure =>
(NotebookDocumentCellChangeStructure
 -> NotebookDocumentCellChangeStructure -> Ordering)
-> (NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure -> Bool)
-> (NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure -> Bool)
-> (NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure -> Bool)
-> (NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure -> Bool)
-> (NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure)
-> (NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure
    -> NotebookDocumentCellChangeStructure)
-> Ord NotebookDocumentCellChangeStructure
NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Ordering
NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
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 :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Ordering
compare :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Ordering
$c< :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
< :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
$c<= :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
<= :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
$c> :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
> :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
$c>= :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
>= :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure -> Bool
$cmax :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
max :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
$cmin :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
min :: NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
-> NotebookDocumentCellChangeStructure
Ord, (forall x.
 NotebookDocumentCellChangeStructure
 -> Rep NotebookDocumentCellChangeStructure x)
-> (forall x.
    Rep NotebookDocumentCellChangeStructure x
    -> NotebookDocumentCellChangeStructure)
-> Generic NotebookDocumentCellChangeStructure
forall x.
Rep NotebookDocumentCellChangeStructure x
-> NotebookDocumentCellChangeStructure
forall x.
NotebookDocumentCellChangeStructure
-> Rep NotebookDocumentCellChangeStructure x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
NotebookDocumentCellChangeStructure
-> Rep NotebookDocumentCellChangeStructure x
from :: forall x.
NotebookDocumentCellChangeStructure
-> Rep NotebookDocumentCellChangeStructure x
$cto :: forall x.
Rep NotebookDocumentCellChangeStructure x
-> NotebookDocumentCellChangeStructure
to :: forall x.
Rep NotebookDocumentCellChangeStructure x
-> NotebookDocumentCellChangeStructure
Generic)
  deriving anyclass (NotebookDocumentCellChangeStructure -> ()
(NotebookDocumentCellChangeStructure -> ())
-> NFData NotebookDocumentCellChangeStructure
forall a. (a -> ()) -> NFData a
$crnf :: NotebookDocumentCellChangeStructure -> ()
rnf :: NotebookDocumentCellChangeStructure -> ()
NFData, Eq NotebookDocumentCellChangeStructure
Eq NotebookDocumentCellChangeStructure =>
(Int -> NotebookDocumentCellChangeStructure -> Int)
-> (NotebookDocumentCellChangeStructure -> Int)
-> Hashable NotebookDocumentCellChangeStructure
Int -> NotebookDocumentCellChangeStructure -> Int
NotebookDocumentCellChangeStructure -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> NotebookDocumentCellChangeStructure -> Int
hashWithSalt :: Int -> NotebookDocumentCellChangeStructure -> Int
$chash :: NotebookDocumentCellChangeStructure -> Int
hash :: NotebookDocumentCellChangeStructure -> Int
Hashable)
  deriving (forall ann. NotebookDocumentCellChangeStructure -> Doc ann)
-> (forall ann. [NotebookDocumentCellChangeStructure] -> Doc ann)
-> Pretty NotebookDocumentCellChangeStructure
forall ann. [NotebookDocumentCellChangeStructure] -> Doc ann
forall ann. NotebookDocumentCellChangeStructure -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. NotebookDocumentCellChangeStructure -> Doc ann
pretty :: forall ann. NotebookDocumentCellChangeStructure -> Doc ann
$cprettyList :: forall ann. [NotebookDocumentCellChangeStructure] -> Doc ann
prettyList :: forall ann. [NotebookDocumentCellChangeStructure] -> Doc ann
Pretty via (ViaJSON NotebookDocumentCellChangeStructure)

instance Aeson.ToJSON NotebookDocumentCellChangeStructure where
  toJSON :: NotebookDocumentCellChangeStructure -> Value
toJSON (NotebookDocumentCellChangeStructure NotebookCellArrayChange
arg0 Maybe [TextDocumentItem]
arg1 Maybe [TextDocumentIdentifier]
arg2) = [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
"array" Key -> NotebookCellArrayChange -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= NotebookCellArrayChange
arg0]
    ,String
"didOpen" String -> Maybe [TextDocumentItem] -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [TextDocumentItem]
arg1
    ,String
"didClose" String -> Maybe [TextDocumentIdentifier] -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [TextDocumentIdentifier]
arg2]

instance Aeson.FromJSON NotebookDocumentCellChangeStructure where
  parseJSON :: Value -> Parser NotebookDocumentCellChangeStructure
parseJSON = String
-> (Object -> Parser NotebookDocumentCellChangeStructure)
-> Value
-> Parser NotebookDocumentCellChangeStructure
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"NotebookDocumentCellChangeStructure" ((Object -> Parser NotebookDocumentCellChangeStructure)
 -> Value -> Parser NotebookDocumentCellChangeStructure)
-> (Object -> Parser NotebookDocumentCellChangeStructure)
-> Value
-> Parser NotebookDocumentCellChangeStructure
forall a b. (a -> b) -> a -> b
$ \Object
arg -> NotebookCellArrayChange
-> Maybe [TextDocumentItem]
-> Maybe [TextDocumentIdentifier]
-> NotebookDocumentCellChangeStructure
NotebookDocumentCellChangeStructure (NotebookCellArrayChange
 -> Maybe [TextDocumentItem]
 -> Maybe [TextDocumentIdentifier]
 -> NotebookDocumentCellChangeStructure)
-> Parser NotebookCellArrayChange
-> Parser
     (Maybe [TextDocumentItem]
      -> Maybe [TextDocumentIdentifier]
      -> NotebookDocumentCellChangeStructure)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser NotebookCellArrayChange
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"array" Parser
  (Maybe [TextDocumentItem]
   -> Maybe [TextDocumentIdentifier]
   -> NotebookDocumentCellChangeStructure)
-> Parser (Maybe [TextDocumentItem])
-> Parser
     (Maybe [TextDocumentIdentifier]
      -> NotebookDocumentCellChangeStructure)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe [TextDocumentItem])
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"didOpen" Parser
  (Maybe [TextDocumentIdentifier]
   -> NotebookDocumentCellChangeStructure)
-> Parser (Maybe [TextDocumentIdentifier])
-> Parser NotebookDocumentCellChangeStructure
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg Object -> Key -> Parser (Maybe [TextDocumentIdentifier])
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"didClose"