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

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

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