{- 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.NotebookDocumentSyncRegistrationOptions 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 as Row
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

{-|
Registration options specific to a notebook.

@since 3.17.0
-}
data NotebookDocumentSyncRegistrationOptions = NotebookDocumentSyncRegistrationOptions 
  { {-|
  The notebooks to be synced
  -}
  NotebookDocumentSyncRegistrationOptions
-> [Rec
      (Extend "notebook" (Text |? NotebookDocumentFilter) ('R '[])
       .+ (("cells"
            .== Maybe [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
           .+ 'R '[]))
    |? Rec
         (Extend
            "notebook" (Maybe (Text |? NotebookDocumentFilter)) ('R '[])
          .+ (("cells" .== [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
              .+ 'R '[]))]
_notebookSelector :: [((Row.Rec ("notebook" Row..== (Data.Text.Text Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.NotebookDocumentFilter.NotebookDocumentFilter) Row..+ ("cells" Row..== (Maybe [(Row.Rec ("language" Row..== Data.Text.Text Row..+ Row.Empty))]) Row..+ Row.Empty))) Language.LSP.Protocol.Types.Common.|? (Row.Rec ("notebook" Row..== (Maybe (Data.Text.Text Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.NotebookDocumentFilter.NotebookDocumentFilter)) Row..+ ("cells" Row..== [(Row.Rec ("language" Row..== Data.Text.Text Row..+ Row.Empty))] Row..+ Row.Empty))))]
  , {-|
  Whether save notification should be forwarded to
  the server. Will only be honored if mode === `notebook`.
  -}
  NotebookDocumentSyncRegistrationOptions -> Maybe Bool
_save :: (Maybe Bool)
  , {-|
  The id used to register the request. The id can be used to deregister
  the request again. See also Registration#id.
  -}
  NotebookDocumentSyncRegistrationOptions -> Maybe Text
_id :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> NotebookDocumentSyncRegistrationOptions -> ShowS
[NotebookDocumentSyncRegistrationOptions] -> ShowS
NotebookDocumentSyncRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotebookDocumentSyncRegistrationOptions] -> ShowS
$cshowList :: [NotebookDocumentSyncRegistrationOptions] -> ShowS
show :: NotebookDocumentSyncRegistrationOptions -> String
$cshow :: NotebookDocumentSyncRegistrationOptions -> String
showsPrec :: Int -> NotebookDocumentSyncRegistrationOptions -> ShowS
$cshowsPrec :: Int -> NotebookDocumentSyncRegistrationOptions -> ShowS
Show, NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
$c/= :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
== :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
$c== :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
Eq, Eq NotebookDocumentSyncRegistrationOptions
NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Ordering
NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
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
min :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
$cmin :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
max :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
$cmax :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions
>= :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
$c>= :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
> :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
$c> :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
<= :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
$c<= :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
< :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
$c< :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Bool
compare :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Ordering
$ccompare :: NotebookDocumentSyncRegistrationOptions
-> NotebookDocumentSyncRegistrationOptions -> Ordering
Ord, forall x.
Rep NotebookDocumentSyncRegistrationOptions x
-> NotebookDocumentSyncRegistrationOptions
forall x.
NotebookDocumentSyncRegistrationOptions
-> Rep NotebookDocumentSyncRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NotebookDocumentSyncRegistrationOptions x
-> NotebookDocumentSyncRegistrationOptions
$cfrom :: forall x.
NotebookDocumentSyncRegistrationOptions
-> Rep NotebookDocumentSyncRegistrationOptions x
Generic)
  deriving anyclass (NotebookDocumentSyncRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: NotebookDocumentSyncRegistrationOptions -> ()
$crnf :: NotebookDocumentSyncRegistrationOptions -> ()
NFData, Eq NotebookDocumentSyncRegistrationOptions
Int -> NotebookDocumentSyncRegistrationOptions -> Int
NotebookDocumentSyncRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: NotebookDocumentSyncRegistrationOptions -> Int
$chash :: NotebookDocumentSyncRegistrationOptions -> Int
hashWithSalt :: Int -> NotebookDocumentSyncRegistrationOptions -> Int
$chashWithSalt :: Int -> NotebookDocumentSyncRegistrationOptions -> Int
Hashable)
  deriving forall ann. [NotebookDocumentSyncRegistrationOptions] -> Doc ann
forall ann. NotebookDocumentSyncRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [NotebookDocumentSyncRegistrationOptions] -> Doc ann
$cprettyList :: forall ann. [NotebookDocumentSyncRegistrationOptions] -> Doc ann
pretty :: forall ann. NotebookDocumentSyncRegistrationOptions -> Doc ann
$cpretty :: forall ann. NotebookDocumentSyncRegistrationOptions -> Doc ann
Pretty via (ViaJSON NotebookDocumentSyncRegistrationOptions)

instance Aeson.ToJSON NotebookDocumentSyncRegistrationOptions where
  toJSON :: NotebookDocumentSyncRegistrationOptions -> Value
toJSON (NotebookDocumentSyncRegistrationOptions [Rec
   (Extend "notebook" (Text |? NotebookDocumentFilter) ('R '[])
    .+ (("cells"
         .== Maybe [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
        .+ 'R '[]))
 |? Rec
      (Extend
         "notebook" (Maybe (Text |? NotebookDocumentFilter)) ('R '[])
       .+ (("cells" .== [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
           .+ 'R '[]))]
arg0 Maybe Bool
arg1 Maybe Text
arg2) = [Pair] -> Value
Aeson.object forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall a b. (a -> b) -> a -> b
$  [[Key
"notebookSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [Rec
   (Extend "notebook" (Text |? NotebookDocumentFilter) ('R '[])
    .+ (("cells"
         .== Maybe [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
        .+ 'R '[]))
 |? Rec
      (Extend
         "notebook" (Maybe (Text |? NotebookDocumentFilter)) ('R '[])
       .+ (("cells" .== [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
           .+ 'R '[]))]
arg0]
    ,String
"save" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1
    ,String
"id" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg2]

instance Aeson.FromJSON NotebookDocumentSyncRegistrationOptions where
  parseJSON :: Value -> Parser NotebookDocumentSyncRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"NotebookDocumentSyncRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> [Rec
   (Extend "notebook" (Text |? NotebookDocumentFilter) ('R '[])
    .+ (("cells"
         .== Maybe [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
        .+ 'R '[]))
 |? Rec
      (Extend
         "notebook" (Maybe (Text |? NotebookDocumentFilter)) ('R '[])
       .+ (("cells" .== [Rec (Extend "language" Text ('R '[]) .+ 'R '[])])
           .+ 'R '[]))]
-> Maybe Bool
-> Maybe Text
-> NotebookDocumentSyncRegistrationOptions
NotebookDocumentSyncRegistrationOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"notebookSelector" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"save" forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Object
arg forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Aeson..:! Key
"id"