{-# 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.Lens as Lens
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
(AsyncInferenceNotificationConfig
-> AsyncInferenceNotificationConfig -> Bool)
-> (AsyncInferenceNotificationConfig
-> AsyncInferenceNotificationConfig -> Bool)
-> Eq AsyncInferenceNotificationConfig
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]
(Int -> ReadS AsyncInferenceNotificationConfig)
-> ReadS [AsyncInferenceNotificationConfig]
-> ReadPrec AsyncInferenceNotificationConfig
-> ReadPrec [AsyncInferenceNotificationConfig]
-> Read 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
(Int -> AsyncInferenceNotificationConfig -> ShowS)
-> (AsyncInferenceNotificationConfig -> String)
-> ([AsyncInferenceNotificationConfig] -> ShowS)
-> Show AsyncInferenceNotificationConfig
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.
AsyncInferenceNotificationConfig
-> Rep AsyncInferenceNotificationConfig x)
-> (forall x.
Rep AsyncInferenceNotificationConfig x
-> AsyncInferenceNotificationConfig)
-> Generic AsyncInferenceNotificationConfig
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' :: Maybe Text -> Maybe Text -> AsyncInferenceNotificationConfig
AsyncInferenceNotificationConfig'
{ $sel:errorTopic:AsyncInferenceNotificationConfig' :: Maybe Text
errorTopic =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:successTopic:AsyncInferenceNotificationConfig' :: Maybe Text
successTopic = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
asyncInferenceNotificationConfig_errorTopic :: Lens.Lens' AsyncInferenceNotificationConfig (Prelude.Maybe Prelude.Text)
asyncInferenceNotificationConfig_errorTopic :: (Maybe Text -> f (Maybe Text))
-> AsyncInferenceNotificationConfig
-> f AsyncInferenceNotificationConfig
asyncInferenceNotificationConfig_errorTopic = (AsyncInferenceNotificationConfig -> Maybe Text)
-> (AsyncInferenceNotificationConfig
-> Maybe Text -> AsyncInferenceNotificationConfig)
-> Lens
AsyncInferenceNotificationConfig
AsyncInferenceNotificationConfig
(Maybe Text)
(Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> AsyncInferenceNotificationConfig
-> f AsyncInferenceNotificationConfig
asyncInferenceNotificationConfig_successTopic = (AsyncInferenceNotificationConfig -> Maybe Text)
-> (AsyncInferenceNotificationConfig
-> Maybe Text -> AsyncInferenceNotificationConfig)
-> Lens
AsyncInferenceNotificationConfig
AsyncInferenceNotificationConfig
(Maybe Text)
(Maybe Text)
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
Core.FromJSON
AsyncInferenceNotificationConfig
where
parseJSON :: Value -> Parser AsyncInferenceNotificationConfig
parseJSON =
String
-> (Object -> Parser AsyncInferenceNotificationConfig)
-> Value
-> Parser AsyncInferenceNotificationConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AsyncInferenceNotificationConfig"
( \Object
x ->
Maybe Text -> Maybe Text -> AsyncInferenceNotificationConfig
AsyncInferenceNotificationConfig'
(Maybe Text -> Maybe Text -> AsyncInferenceNotificationConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AsyncInferenceNotificationConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorTopic")
Parser (Maybe Text -> AsyncInferenceNotificationConfig)
-> Parser (Maybe Text) -> Parser AsyncInferenceNotificationConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SuccessTopic")
)
instance
Prelude.Hashable
AsyncInferenceNotificationConfig
instance
Prelude.NFData
AsyncInferenceNotificationConfig
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ErrorTopic" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
errorTopic,
(Text
"SuccessTopic" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
successTopic
]
)