-- 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.RegistrationParams 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 Language.LSP.Protocol.Internal.Types.Registration
import qualified Language.LSP.Protocol.Types.Common

{-|

-}
data RegistrationParams = RegistrationParams 
  { {-|

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

instance Aeson.ToJSON RegistrationParams where
  toJSON :: RegistrationParams -> Value
toJSON (RegistrationParams [Registration]
arg0) = [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
"registrations" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Aeson..= [Registration]
arg0]]

instance Aeson.FromJSON RegistrationParams where
  parseJSON :: Value -> Parser RegistrationParams
parseJSON = forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"RegistrationParams" forall a b. (a -> b) -> a -> b
$ \Object
arg -> [Registration] -> RegistrationParams
RegistrationParams forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
arg forall a. FromJSON a => Object -> Key -> Parser a
Aeson..: Key
"registrations"