-- 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 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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigurationItem] -> ShowS
$cshowList :: [ConfigurationItem] -> ShowS
show :: ConfigurationItem -> String
$cshow :: ConfigurationItem -> String
showsPrec :: Int -> ConfigurationItem -> ShowS
$cshowsPrec :: Int -> ConfigurationItem -> ShowS
Show, ConfigurationItem -> ConfigurationItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigurationItem -> ConfigurationItem -> Bool
$c/= :: ConfigurationItem -> ConfigurationItem -> Bool
== :: ConfigurationItem -> ConfigurationItem -> Bool
$c== :: ConfigurationItem -> ConfigurationItem -> Bool
Eq, Eq 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
min :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
$cmin :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
max :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
$cmax :: ConfigurationItem -> ConfigurationItem -> ConfigurationItem
>= :: ConfigurationItem -> ConfigurationItem -> Bool
$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
compare :: ConfigurationItem -> ConfigurationItem -> Ordering
$ccompare :: ConfigurationItem -> ConfigurationItem -> Ordering
Ord, 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
$cto :: forall x. Rep ConfigurationItem x -> ConfigurationItem
$cfrom :: forall x. ConfigurationItem -> Rep ConfigurationItem x
Generic)
  deriving anyclass (ConfigurationItem -> ()
forall a. (a -> ()) -> NFData a
rnf :: ConfigurationItem -> ()
$crnf :: ConfigurationItem -> ()
NFData, Eq ConfigurationItem
Int -> ConfigurationItem -> Int
ConfigurationItem -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ConfigurationItem -> Int
$chash :: ConfigurationItem -> Int
hashWithSalt :: Int -> ConfigurationItem -> Int
$chashWithSalt :: Int -> ConfigurationItem -> Int
Hashable)

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