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

{-|
Registration options for a `DocumentLinkRequest`.
-}
data DocumentLinkRegistrationOptions = DocumentLinkRegistrationOptions 
  { {-|
  A document selector to identify the scope of the registration. If set to null
  the document selector provided on the client side will be used.
  -}
  DocumentLinkRegistrationOptions -> DocumentSelector |? Null
_documentSelector :: (Language.LSP.Protocol.Internal.Types.DocumentSelector.DocumentSelector Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Types.Common.Null)
  , {-|

  -}
  DocumentLinkRegistrationOptions -> Maybe Bool
_workDoneProgress :: (Maybe Bool)
  , {-|
  Document links have a resolve provider as well.
  -}
  DocumentLinkRegistrationOptions -> Maybe Bool
_resolveProvider :: (Maybe Bool)
  }
  deriving stock (Int -> DocumentLinkRegistrationOptions -> ShowS
[DocumentLinkRegistrationOptions] -> ShowS
DocumentLinkRegistrationOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentLinkRegistrationOptions] -> ShowS
$cshowList :: [DocumentLinkRegistrationOptions] -> ShowS
show :: DocumentLinkRegistrationOptions -> String
$cshow :: DocumentLinkRegistrationOptions -> String
showsPrec :: Int -> DocumentLinkRegistrationOptions -> ShowS
$cshowsPrec :: Int -> DocumentLinkRegistrationOptions -> ShowS
Show, DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
$c/= :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
== :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
$c== :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
Eq, Eq DocumentLinkRegistrationOptions
DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Ordering
DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
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 :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
$cmin :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
max :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
$cmax :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions
>= :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
$c>= :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
> :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
$c> :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
<= :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
$c<= :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
< :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
$c< :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Bool
compare :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Ordering
$ccompare :: DocumentLinkRegistrationOptions
-> DocumentLinkRegistrationOptions -> Ordering
Ord, forall x.
Rep DocumentLinkRegistrationOptions x
-> DocumentLinkRegistrationOptions
forall x.
DocumentLinkRegistrationOptions
-> Rep DocumentLinkRegistrationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentLinkRegistrationOptions x
-> DocumentLinkRegistrationOptions
$cfrom :: forall x.
DocumentLinkRegistrationOptions
-> Rep DocumentLinkRegistrationOptions x
Generic)
  deriving anyclass (DocumentLinkRegistrationOptions -> ()
forall a. (a -> ()) -> NFData a
rnf :: DocumentLinkRegistrationOptions -> ()
$crnf :: DocumentLinkRegistrationOptions -> ()
NFData, Eq DocumentLinkRegistrationOptions
Int -> DocumentLinkRegistrationOptions -> Int
DocumentLinkRegistrationOptions -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: DocumentLinkRegistrationOptions -> Int
$chash :: DocumentLinkRegistrationOptions -> Int
hashWithSalt :: Int -> DocumentLinkRegistrationOptions -> Int
$chashWithSalt :: Int -> DocumentLinkRegistrationOptions -> Int
Hashable)
  deriving forall ann. [DocumentLinkRegistrationOptions] -> Doc ann
forall ann. DocumentLinkRegistrationOptions -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
prettyList :: forall ann. [DocumentLinkRegistrationOptions] -> Doc ann
$cprettyList :: forall ann. [DocumentLinkRegistrationOptions] -> Doc ann
pretty :: forall ann. DocumentLinkRegistrationOptions -> Doc ann
$cpretty :: forall ann. DocumentLinkRegistrationOptions -> Doc ann
Pretty via (ViaJSON DocumentLinkRegistrationOptions)

instance Aeson.ToJSON DocumentLinkRegistrationOptions where
  toJSON :: DocumentLinkRegistrationOptions -> Value
toJSON (DocumentLinkRegistrationOptions DocumentSelector |? Null
arg0 Maybe Bool
arg1 Maybe Bool
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
"documentSelector" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= DocumentSelector |? Null
arg0]
    ,String
"workDoneProgress" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg1
    ,String
"resolveProvider" forall kv v. (KeyValue kv, ToJSON v) => String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Bool
arg2]

instance Aeson.FromJSON DocumentLinkRegistrationOptions where
  parseJSON :: Value -> Parser DocumentLinkRegistrationOptions
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"DocumentLinkRegistrationOptions" forall a b. (a -> b) -> a -> b
$ \Object
arg -> (DocumentSelector |? Null)
-> Maybe Bool -> Maybe Bool -> DocumentLinkRegistrationOptions
DocumentLinkRegistrationOptions forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"documentSelector" 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
"workDoneProgress" 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
"resolveProvider"