{- 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.ConfigurationItem 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.Types.Common

{-|

-}
data ConfigurationItem = ConfigurationItem 
  { {-|
  The scope to get the configuration section for.
  -}
  ConfigurationItem -> Maybe Text
_scopeUri :: (Maybe Data.Text.Text)
  , {-|
  The configuration section asked for.
  -}
  ConfigurationItem -> Maybe Text
_section :: (Maybe Data.Text.Text)
  }
  deriving stock (Int -> ConfigurationItem -> ShowS
[ConfigurationItem] -> ShowS
ConfigurationItem -> String
(Int -> ConfigurationItem -> ShowS)
-> (ConfigurationItem -> String)
-> ([ConfigurationItem] -> ShowS)
-> Show ConfigurationItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConfigurationItem -> ShowS
showsPrec :: Int -> ConfigurationItem -> ShowS
$cshow :: ConfigurationItem -> String
show :: ConfigurationItem -> String
$cshowList :: [ConfigurationItem] -> ShowS
showList :: [ConfigurationItem] -> ShowS
Show, ConfigurationItem -> ConfigurationItem -> Bool
(ConfigurationItem -> ConfigurationItem -> Bool)
-> (ConfigurationItem -> ConfigurationItem -> Bool)
-> Eq ConfigurationItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConfigurationItem -> ConfigurationItem -> Bool
== :: ConfigurationItem -> ConfigurationItem -> Bool
$c/= :: ConfigurationItem -> ConfigurationItem -> Bool
/= :: ConfigurationItem -> ConfigurationItem -> Bool
Eq, Eq ConfigurationItem
Eq ConfigurationItem =>
(ConfigurationItem -> ConfigurationItem -> Ordering)
-> (ConfigurationItem -> ConfigurationItem -> Bool)
-> (ConfigurationItem -> ConfigurationItem -> Bool)
-> (ConfigurationItem -> ConfigurationItem -> Bool)
-> (ConfigurationItem -> ConfigurationItem -> Bool)
-> (ConfigurationItem -> ConfigurationItem -> ConfigurationItem)
-> (ConfigurationItem -> ConfigurationItem -> ConfigurationItem)
-> Ord ConfigurationItem
ConfigurationItem -> ConfigurationItem -> Bool
ConfigurationItem -> ConfigurationItem -> Ordering
ConfigurationItem -> ConfigurationItem -> ConfigurationItem
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 :: ConfigurationItem -> ConfigurationItem -> Ordering
compare :: ConfigurationItem -> ConfigurationItem -> Ordering
$c< :: ConfigurationItem -> ConfigurationItem -> Bool
< :: ConfigurationItem -> ConfigurationItem -> Bool
$c<= :: ConfigurationItem -> ConfigurationItem -> Bool
<= :: ConfigurationItem -> ConfigurationItem -> Bool
$c> :: ConfigurationItem -> ConfigurationItem -> Bool
> :: ConfigurationItem -> ConfigurationItem -> Bool
$c>= :: ConfigurationItem -> ConfigurationItem -> Bool
>= :: ConfigurationItem -> ConfigurationItem -> Bool
$cmax :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
max :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
$cmin :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
min :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
Ord, (forall x. ConfigurationItem -> Rep ConfigurationItem x)
-> (forall x. Rep ConfigurationItem x -> ConfigurationItem)
-> Generic ConfigurationItem
forall x. Rep ConfigurationItem x -> ConfigurationItem
forall x. ConfigurationItem -> Rep ConfigurationItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConfigurationItem -> Rep ConfigurationItem x
from :: forall x. ConfigurationItem -> Rep ConfigurationItem x
$cto :: forall x. Rep ConfigurationItem x -> ConfigurationItem
to :: forall x. Rep ConfigurationItem x -> ConfigurationItem
Generic)
  deriving anyclass (ConfigurationItem -> ()
(ConfigurationItem -> ()) -> NFData ConfigurationItem
forall a. (a -> ()) -> NFData a
$crnf :: ConfigurationItem -> ()
rnf :: ConfigurationItem -> ()
NFData, Eq ConfigurationItem
Eq ConfigurationItem =>
(Int -> ConfigurationItem -> Int)
-> (ConfigurationItem -> Int) -> Hashable ConfigurationItem
Int -> ConfigurationItem -> Int
ConfigurationItem -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> ConfigurationItem -> Int
hashWithSalt :: Int -> ConfigurationItem -> Int
$chash :: ConfigurationItem -> Int
hash :: ConfigurationItem -> Int
Hashable)
  deriving (forall ann. ConfigurationItem -> Doc ann)
-> (forall ann. [ConfigurationItem] -> Doc ann)
-> Pretty ConfigurationItem
forall ann. [ConfigurationItem] -> Doc ann
forall ann. ConfigurationItem -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. ConfigurationItem -> Doc ann
pretty :: forall ann. ConfigurationItem -> Doc ann
$cprettyList :: forall ann. [ConfigurationItem] -> Doc ann
prettyList :: forall ann. [ConfigurationItem] -> Doc ann
Pretty via (ViaJSON ConfigurationItem)

instance Aeson.ToJSON ConfigurationItem where
  toJSON :: ConfigurationItem -> Value
toJSON (ConfigurationItem Maybe Text
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
$  [String
"scopeUri" String -> Maybe Text -> [Pair]
forall e kv v.
(KeyValue e kv, ToJSON v) =>
String -> Maybe v -> [kv]
Language.LSP.Protocol.Types.Common..=? Maybe Text
arg0
    ,String
"section" 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 ConfigurationItem where
  parseJSON :: Value -> Parser ConfigurationItem
parseJSON = String
-> (Object -> Parser ConfigurationItem)
-> Value
-> Parser ConfigurationItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ConfigurationItem" ((Object -> Parser ConfigurationItem)
 -> Value -> Parser ConfigurationItem)
-> (Object -> Parser ConfigurationItem)
-> Value
-> Parser ConfigurationItem
forall a b. (a -> b) -> a -> b
$ \Object
arg -> Maybe Text -> Maybe Text -> ConfigurationItem
ConfigurationItem (Maybe Text -> Maybe Text -> ConfigurationItem)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ConfigurationItem)
forall (f :: * -> *) a b. Functor 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
"scopeUri" Parser (Maybe Text -> ConfigurationItem)
-> Parser (Maybe Text) -> Parser ConfigurationItem
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
"section"