{- 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.NotebookDocumentCellChanges 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.NotebookCell
import qualified Language.LSP.Protocol.Internal.Types.NotebookDocumentCellChangeStructure
import qualified Language.LSP.Protocol.Internal.Types.NotebookDocumentCellContentChanges
import qualified Language.LSP.Protocol.Types.Common

{-|
Cell changes to a notebook document.

@since 3.18.0
@proposed
-}
data NotebookDocumentCellChanges = NotebookDocumentCellChanges 
  { {-|
  Changes to the cell structure to add or
  remove cells.
  -}
  NotebookDocumentCellChanges
-> Maybe NotebookDocumentCellChangeStructure
_structure :: (Maybe Language.LSP.Protocol.Internal.Types.NotebookDocumentCellChangeStructure.NotebookDocumentCellChangeStructure)
  , {-|
  Changes to notebook cells properties like its
  kind, execution summary or metadata.
  -}
  NotebookDocumentCellChanges -> Maybe [NotebookCell]
_data_ :: (Maybe [Language.LSP.Protocol.Internal.Types.NotebookCell.NotebookCell])
  , {-|
  Changes to the text content of notebook cells.
  -}
  NotebookDocumentCellChanges
-> Maybe [NotebookDocumentCellContentChanges]
_textContent :: (Maybe [Language.LSP.Protocol.Internal.Types.NotebookDocumentCellContentChanges.NotebookDocumentCellContentChanges])
  }
  deriving stock (Int -> NotebookDocumentCellChanges -> ShowS
[NotebookDocumentCellChanges] -> ShowS
NotebookDocumentCellChanges -> String
(Int -> NotebookDocumentCellChanges -> ShowS)
-> (NotebookDocumentCellChanges -> String)
-> ([NotebookDocumentCellChanges] -> ShowS)
-> Show NotebookDocumentCellChanges
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NotebookDocumentCellChanges -> ShowS
showsPrec :: Int -> NotebookDocumentCellChanges -> ShowS
$cshow :: NotebookDocumentCellChanges -> String
show :: NotebookDocumentCellChanges -> String
$cshowList :: [NotebookDocumentCellChanges] -> ShowS
showList :: [NotebookDocumentCellChanges] -> ShowS
Show, NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
(NotebookDocumentCellChanges
 -> NotebookDocumentCellChanges -> Bool)
-> (NotebookDocumentCellChanges
    -> NotebookDocumentCellChanges -> Bool)
-> Eq NotebookDocumentCellChanges
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
== :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
$c/= :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
/= :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
Eq, Eq NotebookDocumentCellChanges
Eq NotebookDocumentCellChanges =>
(NotebookDocumentCellChanges
 -> NotebookDocumentCellChanges -> Ordering)
-> (NotebookDocumentCellChanges
    -> NotebookDocumentCellChanges -> Bool)
-> (NotebookDocumentCellChanges
    -> NotebookDocumentCellChanges -> Bool)
-> (NotebookDocumentCellChanges
    -> NotebookDocumentCellChanges -> Bool)
-> (NotebookDocumentCellChanges
    -> NotebookDocumentCellChanges -> Bool)
-> (NotebookDocumentCellChanges
    -> NotebookDocumentCellChanges -> NotebookDocumentCellChanges)
-> (NotebookDocumentCellChanges
    -> NotebookDocumentCellChanges -> NotebookDocumentCellChanges)
-> Ord NotebookDocumentCellChanges
NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> Ordering
NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> NotebookDocumentCellChanges
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 :: NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> Ordering
compare :: NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> Ordering
$c< :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
< :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
$c<= :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
<= :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
$c> :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
> :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
$c>= :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
>= :: NotebookDocumentCellChanges -> NotebookDocumentCellChanges -> Bool
$cmax :: NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> NotebookDocumentCellChanges
max :: NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> NotebookDocumentCellChanges
$cmin :: NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> NotebookDocumentCellChanges
min :: NotebookDocumentCellChanges
-> NotebookDocumentCellChanges -> NotebookDocumentCellChanges
Ord, (forall x.
 NotebookDocumentCellChanges -> Rep NotebookDocumentCellChanges x)
-> (forall x.
    Rep NotebookDocumentCellChanges x -> NotebookDocumentCellChanges)
-> Generic NotebookDocumentCellChanges
forall x.
Rep NotebookDocumentCellChanges x -> NotebookDocumentCellChanges
forall x.
NotebookDocumentCellChanges -> Rep NotebookDocumentCellChanges x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
NotebookDocumentCellChanges -> Rep NotebookDocumentCellChanges x
from :: forall x.
NotebookDocumentCellChanges -> Rep NotebookDocumentCellChanges x
$cto :: forall x.
Rep NotebookDocumentCellChanges x -> NotebookDocumentCellChanges
to :: forall x.
Rep NotebookDocumentCellChanges x -> NotebookDocumentCellChanges
Generic)
  deriving anyclass (NotebookDocumentCellChanges -> ()
(NotebookDocumentCellChanges -> ())
-> NFData NotebookDocumentCellChanges
forall a. (a -> ()) -> NFData a
$crnf :: NotebookDocumentCellChanges -> ()
rnf :: NotebookDocumentCellChanges -> ()
NFData, Eq NotebookDocumentCellChanges
Eq NotebookDocumentCellChanges =>
(Int -> NotebookDocumentCellChanges -> Int)
-> (NotebookDocumentCellChanges -> Int)
-> Hashable NotebookDocumentCellChanges
Int -> NotebookDocumentCellChanges -> Int
NotebookDocumentCellChanges -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> NotebookDocumentCellChanges -> Int
hashWithSalt :: Int -> NotebookDocumentCellChanges -> Int
$chash :: NotebookDocumentCellChanges -> Int
hash :: NotebookDocumentCellChanges -> Int
Hashable)
  deriving (forall ann. NotebookDocumentCellChanges -> Doc ann)
-> (forall ann. [NotebookDocumentCellChanges] -> Doc ann)
-> Pretty NotebookDocumentCellChanges
forall ann. [NotebookDocumentCellChanges] -> Doc ann
forall ann. NotebookDocumentCellChanges -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. NotebookDocumentCellChanges -> Doc ann
pretty :: forall ann. NotebookDocumentCellChanges -> Doc ann
$cprettyList :: forall ann. [NotebookDocumentCellChanges] -> Doc ann
prettyList :: forall ann. [NotebookDocumentCellChanges] -> Doc ann
Pretty via (ViaJSON NotebookDocumentCellChanges)

instance Aeson.ToJSON NotebookDocumentCellChanges where
  toJSON :: NotebookDocumentCellChanges -> Value
toJSON (NotebookDocumentCellChanges Maybe NotebookDocumentCellChangeStructure
arg0 Maybe [NotebookCell]
arg1 Maybe [NotebookDocumentCellContentChanges]
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
$  [String
"structure" String -> Maybe NotebookDocumentCellChangeStructure -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe NotebookDocumentCellChangeStructure
arg0
    ,String
"data" String -> Maybe [NotebookCell] -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [NotebookCell]
arg1
    ,String
"textContent" String -> Maybe [NotebookDocumentCellContentChanges] -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe [NotebookDocumentCellContentChanges]
arg2]

instance Aeson.FromJSON NotebookDocumentCellChanges where
  parseJSON :: Value -> Parser NotebookDocumentCellChanges
parseJSON = String
-> (Object -> Parser NotebookDocumentCellChanges)
-> Value
-> Parser NotebookDocumentCellChanges
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"NotebookDocumentCellChanges" ((Object -> Parser NotebookDocumentCellChanges)
 -> Value -> Parser NotebookDocumentCellChanges)
-> (Object -> Parser NotebookDocumentCellChanges)
-> Value
-> Parser NotebookDocumentCellChanges
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe NotebookDocumentCellChangeStructure
-> Maybe [NotebookCell]
-> Maybe [NotebookDocumentCellContentChanges]
-> NotebookDocumentCellChanges
NotebookDocumentCellChanges (Maybe NotebookDocumentCellChangeStructure
 -> Maybe [NotebookCell]
 -> Maybe [NotebookDocumentCellContentChanges]
 -> NotebookDocumentCellChanges)
-> Parser (Maybe NotebookDocumentCellChangeStructure)
-> Parser
     (Maybe [NotebookCell]
      -> Maybe [NotebookDocumentCellContentChanges]
      -> NotebookDocumentCellChanges)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe NotebookDocumentCellChangeStructure)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"structure" Parser
  (Maybe [NotebookCell]
   -> Maybe [NotebookDocumentCellContentChanges]
   -> NotebookDocumentCellChanges)
-> Parser (Maybe [NotebookCell])
-> Parser
     (Maybe [NotebookDocumentCellContentChanges]
      -> NotebookDocumentCellChanges)
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 [NotebookCell])
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"data" Parser
  (Maybe [NotebookDocumentCellContentChanges]
   -> NotebookDocumentCellChanges)
-> Parser (Maybe [NotebookDocumentCellContentChanges])
-> Parser NotebookDocumentCellChanges
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 [NotebookDocumentCellContentChanges])
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"textContent"