{- 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.NotebookDocumentCellContentChanges 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.TextDocumentContentChangeEvent
import qualified Language.LSP.Protocol.Internal.Types.VersionedTextDocumentIdentifier
import qualified Language.LSP.Protocol.Types.Common

{-|
Content changes to a cell in a notebook document.

@since 3.18.0
@proposed
-}
data NotebookDocumentCellContentChanges = NotebookDocumentCellContentChanges 
  { {-|

  -}
  NotebookDocumentCellContentChanges
-> VersionedTextDocumentIdentifier
_document :: Language.LSP.Protocol.Internal.Types.VersionedTextDocumentIdentifier.VersionedTextDocumentIdentifier
  , {-|

  -}
  NotebookDocumentCellContentChanges
-> [TextDocumentContentChangeEvent]
_changes :: [Language.LSP.Protocol.Internal.Types.TextDocumentContentChangeEvent.TextDocumentContentChangeEvent]
  }
  deriving stock (Int -> NotebookDocumentCellContentChanges -> ShowS
[NotebookDocumentCellContentChanges] -> ShowS
NotebookDocumentCellContentChanges -> String
(Int -> NotebookDocumentCellContentChanges -> ShowS)
-> (NotebookDocumentCellContentChanges -> String)
-> ([NotebookDocumentCellContentChanges] -> ShowS)
-> Show NotebookDocumentCellContentChanges
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NotebookDocumentCellContentChanges -> ShowS
showsPrec :: Int -> NotebookDocumentCellContentChanges -> ShowS
$cshow :: NotebookDocumentCellContentChanges -> String
show :: NotebookDocumentCellContentChanges -> String
$cshowList :: [NotebookDocumentCellContentChanges] -> ShowS
showList :: [NotebookDocumentCellContentChanges] -> ShowS
Show, NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
(NotebookDocumentCellContentChanges
 -> NotebookDocumentCellContentChanges -> Bool)
-> (NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges -> Bool)
-> Eq NotebookDocumentCellContentChanges
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
== :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
$c/= :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
/= :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
Eq, Eq NotebookDocumentCellContentChanges
Eq NotebookDocumentCellContentChanges =>
(NotebookDocumentCellContentChanges
 -> NotebookDocumentCellContentChanges -> Ordering)
-> (NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges -> Bool)
-> (NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges -> Bool)
-> (NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges -> Bool)
-> (NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges -> Bool)
-> (NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges)
-> (NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges
    -> NotebookDocumentCellContentChanges)
-> Ord NotebookDocumentCellContentChanges
NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Ordering
NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
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 :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Ordering
compare :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Ordering
$c< :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
< :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
$c<= :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
<= :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
$c> :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
> :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
$c>= :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
>= :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges -> Bool
$cmax :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
max :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
$cmin :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
min :: NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
-> NotebookDocumentCellContentChanges
Ord, (forall x.
 NotebookDocumentCellContentChanges
 -> Rep NotebookDocumentCellContentChanges x)
-> (forall x.
    Rep NotebookDocumentCellContentChanges x
    -> NotebookDocumentCellContentChanges)
-> Generic NotebookDocumentCellContentChanges
forall x.
Rep NotebookDocumentCellContentChanges x
-> NotebookDocumentCellContentChanges
forall x.
NotebookDocumentCellContentChanges
-> Rep NotebookDocumentCellContentChanges x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
NotebookDocumentCellContentChanges
-> Rep NotebookDocumentCellContentChanges x
from :: forall x.
NotebookDocumentCellContentChanges
-> Rep NotebookDocumentCellContentChanges x
$cto :: forall x.
Rep NotebookDocumentCellContentChanges x
-> NotebookDocumentCellContentChanges
to :: forall x.
Rep NotebookDocumentCellContentChanges x
-> NotebookDocumentCellContentChanges
Generic)
  deriving anyclass (NotebookDocumentCellContentChanges -> ()
(NotebookDocumentCellContentChanges -> ())
-> NFData NotebookDocumentCellContentChanges
forall a. (a -> ()) -> NFData a
$crnf :: NotebookDocumentCellContentChanges -> ()
rnf :: NotebookDocumentCellContentChanges -> ()
NFData, Eq NotebookDocumentCellContentChanges
Eq NotebookDocumentCellContentChanges =>
(Int -> NotebookDocumentCellContentChanges -> Int)
-> (NotebookDocumentCellContentChanges -> Int)
-> Hashable NotebookDocumentCellContentChanges
Int -> NotebookDocumentCellContentChanges -> Int
NotebookDocumentCellContentChanges -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> NotebookDocumentCellContentChanges -> Int
hashWithSalt :: Int -> NotebookDocumentCellContentChanges -> Int
$chash :: NotebookDocumentCellContentChanges -> Int
hash :: NotebookDocumentCellContentChanges -> Int
Hashable)
  deriving (forall ann. NotebookDocumentCellContentChanges -> Doc ann)
-> (forall ann. [NotebookDocumentCellContentChanges] -> Doc ann)
-> Pretty NotebookDocumentCellContentChanges
forall ann. [NotebookDocumentCellContentChanges] -> Doc ann
forall ann. NotebookDocumentCellContentChanges -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. NotebookDocumentCellContentChanges -> Doc ann
pretty :: forall ann. NotebookDocumentCellContentChanges -> Doc ann
$cprettyList :: forall ann. [NotebookDocumentCellContentChanges] -> Doc ann
prettyList :: forall ann. [NotebookDocumentCellContentChanges] -> Doc ann
Pretty via (ViaJSON NotebookDocumentCellContentChanges)

instance Aeson.ToJSON NotebookDocumentCellContentChanges where
  toJSON :: NotebookDocumentCellContentChanges -> Value
toJSON (NotebookDocumentCellContentChanges VersionedTextDocumentIdentifier
arg0 [TextDocumentContentChangeEvent]
arg1) = [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
"document" Key -> VersionedTextDocumentIdentifier -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= VersionedTextDocumentIdentifier
arg0]
    ,[Key
"changes" Key -> [TextDocumentContentChangeEvent] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [TextDocumentContentChangeEvent]
arg1]]

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