{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AppSync.Types.AppSyncRuntime where
import Amazonka.AppSync.Types.RuntimeName
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AppSyncRuntime = AppSyncRuntime'
{
AppSyncRuntime -> RuntimeName
name :: RuntimeName,
AppSyncRuntime -> Text
runtimeVersion :: Prelude.Text
}
deriving (AppSyncRuntime -> AppSyncRuntime -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppSyncRuntime -> AppSyncRuntime -> Bool
$c/= :: AppSyncRuntime -> AppSyncRuntime -> Bool
== :: AppSyncRuntime -> AppSyncRuntime -> Bool
$c== :: AppSyncRuntime -> AppSyncRuntime -> Bool
Prelude.Eq, ReadPrec [AppSyncRuntime]
ReadPrec AppSyncRuntime
Int -> ReadS AppSyncRuntime
ReadS [AppSyncRuntime]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppSyncRuntime]
$creadListPrec :: ReadPrec [AppSyncRuntime]
readPrec :: ReadPrec AppSyncRuntime
$creadPrec :: ReadPrec AppSyncRuntime
readList :: ReadS [AppSyncRuntime]
$creadList :: ReadS [AppSyncRuntime]
readsPrec :: Int -> ReadS AppSyncRuntime
$creadsPrec :: Int -> ReadS AppSyncRuntime
Prelude.Read, Int -> AppSyncRuntime -> ShowS
[AppSyncRuntime] -> ShowS
AppSyncRuntime -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppSyncRuntime] -> ShowS
$cshowList :: [AppSyncRuntime] -> ShowS
show :: AppSyncRuntime -> String
$cshow :: AppSyncRuntime -> String
showsPrec :: Int -> AppSyncRuntime -> ShowS
$cshowsPrec :: Int -> AppSyncRuntime -> ShowS
Prelude.Show, forall x. Rep AppSyncRuntime x -> AppSyncRuntime
forall x. AppSyncRuntime -> Rep AppSyncRuntime x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppSyncRuntime x -> AppSyncRuntime
$cfrom :: forall x. AppSyncRuntime -> Rep AppSyncRuntime x
Prelude.Generic)
newAppSyncRuntime ::
RuntimeName ->
Prelude.Text ->
AppSyncRuntime
newAppSyncRuntime :: RuntimeName -> Text -> AppSyncRuntime
newAppSyncRuntime RuntimeName
pName_ Text
pRuntimeVersion_ =
AppSyncRuntime'
{ $sel:name:AppSyncRuntime' :: RuntimeName
name = RuntimeName
pName_,
$sel:runtimeVersion:AppSyncRuntime' :: Text
runtimeVersion = Text
pRuntimeVersion_
}
appSyncRuntime_name :: Lens.Lens' AppSyncRuntime RuntimeName
appSyncRuntime_name :: Lens' AppSyncRuntime RuntimeName
appSyncRuntime_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSyncRuntime' {RuntimeName
name :: RuntimeName
$sel:name:AppSyncRuntime' :: AppSyncRuntime -> RuntimeName
name} -> RuntimeName
name) (\s :: AppSyncRuntime
s@AppSyncRuntime' {} RuntimeName
a -> AppSyncRuntime
s {$sel:name:AppSyncRuntime' :: RuntimeName
name = RuntimeName
a} :: AppSyncRuntime)
appSyncRuntime_runtimeVersion :: Lens.Lens' AppSyncRuntime Prelude.Text
appSyncRuntime_runtimeVersion :: Lens' AppSyncRuntime Text
appSyncRuntime_runtimeVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppSyncRuntime' {Text
runtimeVersion :: Text
$sel:runtimeVersion:AppSyncRuntime' :: AppSyncRuntime -> Text
runtimeVersion} -> Text
runtimeVersion) (\s :: AppSyncRuntime
s@AppSyncRuntime' {} Text
a -> AppSyncRuntime
s {$sel:runtimeVersion:AppSyncRuntime' :: Text
runtimeVersion = Text
a} :: AppSyncRuntime)
instance Data.FromJSON AppSyncRuntime where
parseJSON :: Value -> Parser AppSyncRuntime
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AppSyncRuntime"
( \Object
x ->
RuntimeName -> Text -> AppSyncRuntime
AppSyncRuntime'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"runtimeVersion")
)
instance Prelude.Hashable AppSyncRuntime where
hashWithSalt :: Int -> AppSyncRuntime -> Int
hashWithSalt Int
_salt AppSyncRuntime' {Text
RuntimeName
runtimeVersion :: Text
name :: RuntimeName
$sel:runtimeVersion:AppSyncRuntime' :: AppSyncRuntime -> Text
$sel:name:AppSyncRuntime' :: AppSyncRuntime -> RuntimeName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RuntimeName
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
runtimeVersion
instance Prelude.NFData AppSyncRuntime where
rnf :: AppSyncRuntime -> ()
rnf AppSyncRuntime' {Text
RuntimeName
runtimeVersion :: Text
name :: RuntimeName
$sel:runtimeVersion:AppSyncRuntime' :: AppSyncRuntime -> Text
$sel:name:AppSyncRuntime' :: AppSyncRuntime -> RuntimeName
..} =
forall a. NFData a => a -> ()
Prelude.rnf RuntimeName
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
runtimeVersion
instance Data.ToJSON AppSyncRuntime where
toJSON :: AppSyncRuntime -> Value
toJSON AppSyncRuntime' {Text
RuntimeName
runtimeVersion :: Text
name :: RuntimeName
$sel:runtimeVersion:AppSyncRuntime' :: AppSyncRuntime -> Text
$sel:name:AppSyncRuntime' :: AppSyncRuntime -> RuntimeName
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RuntimeName
name),
forall a. a -> Maybe a
Prelude.Just
(Key
"runtimeVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
runtimeVersion)
]
)