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

{-|
A notebook cell text document filter denotes a cell text
document by different properties.

@since 3.17.0
-}
data NotebookCellTextDocumentFilter = NotebookCellTextDocumentFilter 
  { {-|
  A filter that matches against the notebook
  containing the notebook cell. If a string
  value is provided it matches against the
  notebook type. '*' matches every notebook.
  -}
  NotebookCellTextDocumentFilter -> Text |? NotebookDocumentFilter
_notebook :: (Data.Text.Text Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.NotebookDocumentFilter.NotebookDocumentFilter)
  , {-|
  A language id like `python`.

  Will be matched against the language id of the
  notebook cell document. '*' matches every language.
  -}
  NotebookCellTextDocumentFilter -> Maybe Text
_language :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> NotebookCellTextDocumentFilter -> ShowS
[NotebookCellTextDocumentFilter] -> ShowS
NotebookCellTextDocumentFilter -> String
(Int -> NotebookCellTextDocumentFilter -> ShowS)
-> (NotebookCellTextDocumentFilter -> String)
-> ([NotebookCellTextDocumentFilter] -> ShowS)
-> Show NotebookCellTextDocumentFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NotebookCellTextDocumentFilter -> ShowS
showsPrec :: Int -> NotebookCellTextDocumentFilter -> ShowS
$cshow :: NotebookCellTextDocumentFilter -> String
show :: NotebookCellTextDocumentFilter -> String
$cshowList :: [NotebookCellTextDocumentFilter] -> ShowS
showList :: [NotebookCellTextDocumentFilter] -> ShowS
Show, NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
(NotebookCellTextDocumentFilter
 -> NotebookCellTextDocumentFilter -> Bool)
-> (NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter -> Bool)
-> Eq NotebookCellTextDocumentFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
== :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
$c/= :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
/= :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
Eq, Eq NotebookCellTextDocumentFilter
Eq NotebookCellTextDocumentFilter =>
(NotebookCellTextDocumentFilter
 -> NotebookCellTextDocumentFilter -> Ordering)
-> (NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter -> Bool)
-> (NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter -> Bool)
-> (NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter -> Bool)
-> (NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter -> Bool)
-> (NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter)
-> (NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter
    -> NotebookCellTextDocumentFilter)
-> Ord NotebookCellTextDocumentFilter
NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Ordering
NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> NotebookCellTextDocumentFilter
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 :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Ordering
compare :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Ordering
$c< :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
< :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
$c<= :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
<= :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
$c> :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
> :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
$c>= :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
>= :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> Bool
$cmax :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> NotebookCellTextDocumentFilter
max :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> NotebookCellTextDocumentFilter
$cmin :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> NotebookCellTextDocumentFilter
min :: NotebookCellTextDocumentFilter
-> NotebookCellTextDocumentFilter -> NotebookCellTextDocumentFilter
Ord, (forall x.
 NotebookCellTextDocumentFilter
 -> Rep NotebookCellTextDocumentFilter x)
-> (forall x.
    Rep NotebookCellTextDocumentFilter x
    -> NotebookCellTextDocumentFilter)
-> Generic NotebookCellTextDocumentFilter
forall x.
Rep NotebookCellTextDocumentFilter x
-> NotebookCellTextDocumentFilter
forall x.
NotebookCellTextDocumentFilter
-> Rep NotebookCellTextDocumentFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
NotebookCellTextDocumentFilter
-> Rep NotebookCellTextDocumentFilter x
from :: forall x.
NotebookCellTextDocumentFilter
-> Rep NotebookCellTextDocumentFilter x
$cto :: forall x.
Rep NotebookCellTextDocumentFilter x
-> NotebookCellTextDocumentFilter
to :: forall x.
Rep NotebookCellTextDocumentFilter x
-> NotebookCellTextDocumentFilter
Generic)
  deriving anyclass (NotebookCellTextDocumentFilter -> ()
(NotebookCellTextDocumentFilter -> ())
-> NFData NotebookCellTextDocumentFilter
forall a. (a -> ()) -> NFData a
$crnf :: NotebookCellTextDocumentFilter -> ()
rnf :: NotebookCellTextDocumentFilter -> ()
NFData, Eq NotebookCellTextDocumentFilter
Eq NotebookCellTextDocumentFilter =>
(Int -> NotebookCellTextDocumentFilter -> Int)
-> (NotebookCellTextDocumentFilter -> Int)
-> Hashable NotebookCellTextDocumentFilter
Int -> NotebookCellTextDocumentFilter -> Int
NotebookCellTextDocumentFilter -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> NotebookCellTextDocumentFilter -> Int
hashWithSalt :: Int -> NotebookCellTextDocumentFilter -> Int
$chash :: NotebookCellTextDocumentFilter -> Int
hash :: NotebookCellTextDocumentFilter -> Int
Hashable)
  deriving (forall ann. NotebookCellTextDocumentFilter -> Doc ann)
-> (forall ann. [NotebookCellTextDocumentFilter] -> Doc ann)
-> Pretty NotebookCellTextDocumentFilter
forall ann. [NotebookCellTextDocumentFilter] -> Doc ann
forall ann. NotebookCellTextDocumentFilter -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. NotebookCellTextDocumentFilter -> Doc ann
pretty :: forall ann. NotebookCellTextDocumentFilter -> Doc ann
$cprettyList :: forall ann. [NotebookCellTextDocumentFilter] -> Doc ann
prettyList :: forall ann. [NotebookCellTextDocumentFilter] -> Doc ann
Pretty via (ViaJSON NotebookCellTextDocumentFilter)

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

instance Aeson.FromJSON NotebookCellTextDocumentFilter where
  parseJSON :: Value -> Parser NotebookCellTextDocumentFilter
parseJSON = String
-> (Object -> Parser NotebookCellTextDocumentFilter)
-> Value
-> Parser NotebookCellTextDocumentFilter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"NotebookCellTextDocumentFilter" ((Object -> Parser NotebookCellTextDocumentFilter)
 -> Value -> Parser NotebookCellTextDocumentFilter)
-> (Object -> Parser NotebookCellTextDocumentFilter)
-> Value
-> Parser NotebookCellTextDocumentFilter
forall a b. (a -> b) -> a -> b
$ \Object
arg -> (Text |? NotebookDocumentFilter)
-> Maybe Text -> NotebookCellTextDocumentFilter
NotebookCellTextDocumentFilter ((Text |? NotebookDocumentFilter)
 -> Maybe Text -> NotebookCellTextDocumentFilter)
-> Parser (Text |? NotebookDocumentFilter)
-> Parser (Maybe Text -> NotebookCellTextDocumentFilter)
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 Text -> NotebookCellTextDocumentFilter)
-> Parser (Maybe Text) -> Parser NotebookCellTextDocumentFilter
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 Text)
forall v. FromJSON v => Object -> Key -> Parser (Maybe v)
Language.LSP.Protocol.Types.Common..:!? Key
"language"