{- 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.NotebookDocumentFilterWithCells 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.NotebookCellLanguage
import qualified Language.LSP.Protocol.Internal.Types.NotebookDocumentFilter
import qualified Language.LSP.Protocol.Types.Common

{-|
@since 3.18.0
@proposed
-}
data NotebookDocumentFilterWithCells = NotebookDocumentFilterWithCells 
  { {-|
  The notebook to be synced If a string
  value is provided it matches against the
  notebook type. '*' matches every notebook.
  -}
  NotebookDocumentFilterWithCells
-> Maybe (Text |? NotebookDocumentFilter)
_notebook :: (Maybe (Data.Text.Text Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.NotebookDocumentFilter.NotebookDocumentFilter))
  , {-|
  The cells of the matching notebook to be synced.
  -}
  NotebookDocumentFilterWithCells -> [NotebookCellLanguage]
_cells :: [Language.LSP.Protocol.Internal.Types.NotebookCellLanguage.NotebookCellLanguage]
  }
  deriving stock (Int -> NotebookDocumentFilterWithCells -> ShowS
[NotebookDocumentFilterWithCells] -> ShowS
NotebookDocumentFilterWithCells -> String
(Int -> NotebookDocumentFilterWithCells -> ShowS)
-> (NotebookDocumentFilterWithCells -> String)
-> ([NotebookDocumentFilterWithCells] -> ShowS)
-> Show NotebookDocumentFilterWithCells
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NotebookDocumentFilterWithCells -> ShowS
showsPrec :: Int -> NotebookDocumentFilterWithCells -> ShowS
$cshow :: NotebookDocumentFilterWithCells -> String
show :: NotebookDocumentFilterWithCells -> String
$cshowList :: [NotebookDocumentFilterWithCells] -> ShowS
showList :: [NotebookDocumentFilterWithCells] -> ShowS
Show, NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
(NotebookDocumentFilterWithCells
 -> NotebookDocumentFilterWithCells -> Bool)
-> (NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells -> Bool)
-> Eq NotebookDocumentFilterWithCells
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
== :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
$c/= :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
/= :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
Eq, Eq NotebookDocumentFilterWithCells
Eq NotebookDocumentFilterWithCells =>
(NotebookDocumentFilterWithCells
 -> NotebookDocumentFilterWithCells -> Ordering)
-> (NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells -> Bool)
-> (NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells -> Bool)
-> (NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells -> Bool)
-> (NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells -> Bool)
-> (NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells)
-> (NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells
    -> NotebookDocumentFilterWithCells)
-> Ord NotebookDocumentFilterWithCells
NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Ordering
NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
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 :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Ordering
compare :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Ordering
$c< :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
< :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
$c<= :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
<= :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
$c> :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
> :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
$c>= :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
>= :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells -> Bool
$cmax :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
max :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
$cmin :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
min :: NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
-> NotebookDocumentFilterWithCells
Ord, (forall x.
 NotebookDocumentFilterWithCells
 -> Rep NotebookDocumentFilterWithCells x)
-> (forall x.
    Rep NotebookDocumentFilterWithCells x
    -> NotebookDocumentFilterWithCells)
-> Generic NotebookDocumentFilterWithCells
forall x.
Rep NotebookDocumentFilterWithCells x
-> NotebookDocumentFilterWithCells
forall x.
NotebookDocumentFilterWithCells
-> Rep NotebookDocumentFilterWithCells x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
NotebookDocumentFilterWithCells
-> Rep NotebookDocumentFilterWithCells x
from :: forall x.
NotebookDocumentFilterWithCells
-> Rep NotebookDocumentFilterWithCells x
$cto :: forall x.
Rep NotebookDocumentFilterWithCells x
-> NotebookDocumentFilterWithCells
to :: forall x.
Rep NotebookDocumentFilterWithCells x
-> NotebookDocumentFilterWithCells
Generic)
  deriving anyclass (NotebookDocumentFilterWithCells -> ()
(NotebookDocumentFilterWithCells -> ())
-> NFData NotebookDocumentFilterWithCells
forall a. (a -> ()) -> NFData a
$crnf :: NotebookDocumentFilterWithCells -> ()
rnf :: NotebookDocumentFilterWithCells -> ()
NFData, Eq NotebookDocumentFilterWithCells
Eq NotebookDocumentFilterWithCells =>
(Int -> NotebookDocumentFilterWithCells -> Int)
-> (NotebookDocumentFilterWithCells -> Int)
-> Hashable NotebookDocumentFilterWithCells
Int -> NotebookDocumentFilterWithCells -> Int
NotebookDocumentFilterWithCells -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> NotebookDocumentFilterWithCells -> Int
hashWithSalt :: Int -> NotebookDocumentFilterWithCells -> Int
$chash :: NotebookDocumentFilterWithCells -> Int
hash :: NotebookDocumentFilterWithCells -> Int
Hashable)
  deriving (forall ann. NotebookDocumentFilterWithCells -> Doc ann)
-> (forall ann. [NotebookDocumentFilterWithCells] -> Doc ann)
-> Pretty NotebookDocumentFilterWithCells
forall ann. [NotebookDocumentFilterWithCells] -> Doc ann
forall ann. NotebookDocumentFilterWithCells -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. NotebookDocumentFilterWithCells -> Doc ann
pretty :: forall ann. NotebookDocumentFilterWithCells -> Doc ann
$cprettyList :: forall ann. [NotebookDocumentFilterWithCells] -> Doc ann
prettyList :: forall ann. [NotebookDocumentFilterWithCells] -> Doc ann
Pretty via (ViaJSON NotebookDocumentFilterWithCells)

instance Aeson.ToJSON NotebookDocumentFilterWithCells where
  toJSON :: NotebookDocumentFilterWithCells -> Value
toJSON (NotebookDocumentFilterWithCells Maybe (Text |? NotebookDocumentFilter)
arg0 [NotebookCellLanguage]
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
$  [String
"notebook" String -> Maybe (Text |? NotebookDocumentFilter) -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe (Text |? NotebookDocumentFilter)
arg0
    ,[Key
"cells" Key -> [NotebookCellLanguage] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
Aeson..= [NotebookCellLanguage]
arg1]]

instance Aeson.FromJSON NotebookDocumentFilterWithCells where
  parseJSON :: Value -> Parser NotebookDocumentFilterWithCells
parseJSON = String
-> (Object -> Parser NotebookDocumentFilterWithCells)
-> Value
-> Parser NotebookDocumentFilterWithCells
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"NotebookDocumentFilterWithCells" ((Object -> Parser NotebookDocumentFilterWithCells)
 -> Value -> Parser NotebookDocumentFilterWithCells)
-> (Object -> Parser NotebookDocumentFilterWithCells)
-> Value
-> Parser NotebookDocumentFilterWithCells
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe (Text |? NotebookDocumentFilter)
-> [NotebookCellLanguage] -> NotebookDocumentFilterWithCells
NotebookDocumentFilterWithCells (Maybe (Text |? NotebookDocumentFilter)
 -> [NotebookCellLanguage] -> NotebookDocumentFilterWithCells)
-> Parser (Maybe (Text |? NotebookDocumentFilter))
-> Parser
     ([NotebookCellLanguage] -> NotebookDocumentFilterWithCells)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg Object -> Key -> Parser (Maybe (Text |? NotebookDocumentFilter))
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"notebook" Parser ([NotebookCellLanguage] -> NotebookDocumentFilterWithCells)
-> Parser [NotebookCellLanguage]
-> Parser NotebookDocumentFilterWithCells
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 [NotebookCellLanguage]
forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"cells"