{-# 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.SageMaker.Types.AsyncInferenceNotificationConfig where
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 AsyncInferenceNotificationConfig = AsyncInferenceNotificationConfig'
{
AsyncInferenceNotificationConfig -> Maybe Text
errorTopic :: Prelude.Maybe Prelude.Text,
AsyncInferenceNotificationConfig -> Maybe Text
successTopic :: Prelude.Maybe Prelude.Text
}
deriving (AsyncInferenceNotificationConfig
-> AsyncInferenceNotificationConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AsyncInferenceNotificationConfig
-> AsyncInferenceNotificationConfig -> Bool
$c/= :: AsyncInferenceNotificationConfig
-> AsyncInferenceNotificationConfig -> Bool
== :: AsyncInferenceNotificationConfig
-> AsyncInferenceNotificationConfig -> Bool
$c== :: AsyncInferenceNotificationConfig
-> AsyncInferenceNotificationConfig -> Bool
Prelude.Eq, ReadPrec [AsyncInferenceNotificationConfig]
ReadPrec AsyncInferenceNotificationConfig
Int -> ReadS AsyncInferenceNotificationConfig
ReadS [AsyncInferenceNotificationConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AsyncInferenceNotificationConfig]
$creadListPrec :: ReadPrec [AsyncInferenceNotificationConfig]
readPrec :: ReadPrec AsyncInferenceNotificationConfig
$creadPrec :: ReadPrec AsyncInferenceNotificationConfig
readList :: ReadS [AsyncInferenceNotificationConfig]
$creadList :: ReadS [AsyncInferenceNotificationConfig]
readsPrec :: Int -> ReadS AsyncInferenceNotificationConfig
$creadsPrec :: Int -> ReadS AsyncInferenceNotificationConfig
Prelude.Read, Int -> AsyncInferenceNotificationConfig -> ShowS
[AsyncInferenceNotificationConfig] -> ShowS
AsyncInferenceNotificationConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AsyncInferenceNotificationConfig] -> ShowS
$cshowList :: [AsyncInferenceNotificationConfig] -> ShowS
show :: AsyncInferenceNotificationConfig -> String
$cshow :: AsyncInferenceNotificationConfig -> String
showsPrec :: Int -> AsyncInferenceNotificationConfig -> ShowS
$cshowsPrec :: Int -> AsyncInferenceNotificationConfig -> ShowS
Prelude.Show, forall x.
Rep AsyncInferenceNotificationConfig x
-> AsyncInferenceNotificationConfig
forall x.
AsyncInferenceNotificationConfig
-> Rep AsyncInferenceNotificationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AsyncInferenceNotificationConfig x
-> AsyncInferenceNotificationConfig
$cfrom :: forall x.
AsyncInferenceNotificationConfig
-> Rep AsyncInferenceNotificationConfig x
Prelude.Generic)
newAsyncInferenceNotificationConfig ::
AsyncInferenceNotificationConfig
newAsyncInferenceNotificationConfig :: AsyncInferenceNotificationConfig
newAsyncInferenceNotificationConfig =
AsyncInferenceNotificationConfig'
{ $sel:errorTopic:AsyncInferenceNotificationConfig' :: Maybe Text
errorTopic =
forall a. Maybe a
Prelude.Nothing,
$sel:successTopic:AsyncInferenceNotificationConfig' :: Maybe Text
successTopic = forall a. Maybe a
Prelude.Nothing
}
asyncInferenceNotificationConfig_errorTopic :: Lens.Lens' AsyncInferenceNotificationConfig (Prelude.Maybe Prelude.Text)
asyncInferenceNotificationConfig_errorTopic :: Lens' AsyncInferenceNotificationConfig (Maybe Text)
asyncInferenceNotificationConfig_errorTopic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AsyncInferenceNotificationConfig' {Maybe Text
errorTopic :: Maybe Text
$sel:errorTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
errorTopic} -> Maybe Text
errorTopic) (\s :: AsyncInferenceNotificationConfig
s@AsyncInferenceNotificationConfig' {} Maybe Text
a -> AsyncInferenceNotificationConfig
s {$sel:errorTopic:AsyncInferenceNotificationConfig' :: Maybe Text
errorTopic = Maybe Text
a} :: AsyncInferenceNotificationConfig)
asyncInferenceNotificationConfig_successTopic :: Lens.Lens' AsyncInferenceNotificationConfig (Prelude.Maybe Prelude.Text)
asyncInferenceNotificationConfig_successTopic :: Lens' AsyncInferenceNotificationConfig (Maybe Text)
asyncInferenceNotificationConfig_successTopic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AsyncInferenceNotificationConfig' {Maybe Text
successTopic :: Maybe Text
$sel:successTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
successTopic} -> Maybe Text
successTopic) (\s :: AsyncInferenceNotificationConfig
s@AsyncInferenceNotificationConfig' {} Maybe Text
a -> AsyncInferenceNotificationConfig
s {$sel:successTopic:AsyncInferenceNotificationConfig' :: Maybe Text
successTopic = Maybe Text
a} :: AsyncInferenceNotificationConfig)
instance
Data.FromJSON
AsyncInferenceNotificationConfig
where
parseJSON :: Value -> Parser AsyncInferenceNotificationConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AsyncInferenceNotificationConfig"
( \Object
x ->
Maybe Text -> Maybe Text -> AsyncInferenceNotificationConfig
AsyncInferenceNotificationConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorTopic")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SuccessTopic")
)
instance
Prelude.Hashable
AsyncInferenceNotificationConfig
where
hashWithSalt :: Int -> AsyncInferenceNotificationConfig -> Int
hashWithSalt
Int
_salt
AsyncInferenceNotificationConfig' {Maybe Text
successTopic :: Maybe Text
errorTopic :: Maybe Text
$sel:successTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
$sel:errorTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorTopic
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
successTopic
instance
Prelude.NFData
AsyncInferenceNotificationConfig
where
rnf :: AsyncInferenceNotificationConfig -> ()
rnf AsyncInferenceNotificationConfig' {Maybe Text
successTopic :: Maybe Text
errorTopic :: Maybe Text
$sel:successTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
$sel:errorTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorTopic
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
successTopic
instance Data.ToJSON AsyncInferenceNotificationConfig where
toJSON :: AsyncInferenceNotificationConfig -> Value
toJSON AsyncInferenceNotificationConfig' {Maybe Text
successTopic :: Maybe Text
errorTopic :: Maybe Text
$sel:successTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
$sel:errorTopic:AsyncInferenceNotificationConfig' :: AsyncInferenceNotificationConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ErrorTopic" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
errorTopic,
(Key
"SuccessTopic" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
successTopic
]
)