{-# 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.NotificationConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NotificationConfiguration = NotificationConfiguration'
{
NotificationConfiguration -> Maybe Text
notificationTopicArn :: Prelude.Maybe Prelude.Text
}
deriving (NotificationConfiguration -> NotificationConfiguration -> Bool
(NotificationConfiguration -> NotificationConfiguration -> Bool)
-> (NotificationConfiguration -> NotificationConfiguration -> Bool)
-> Eq NotificationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotificationConfiguration -> NotificationConfiguration -> Bool
$c/= :: NotificationConfiguration -> NotificationConfiguration -> Bool
== :: NotificationConfiguration -> NotificationConfiguration -> Bool
$c== :: NotificationConfiguration -> NotificationConfiguration -> Bool
Prelude.Eq, ReadPrec [NotificationConfiguration]
ReadPrec NotificationConfiguration
Int -> ReadS NotificationConfiguration
ReadS [NotificationConfiguration]
(Int -> ReadS NotificationConfiguration)
-> ReadS [NotificationConfiguration]
-> ReadPrec NotificationConfiguration
-> ReadPrec [NotificationConfiguration]
-> Read NotificationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotificationConfiguration]
$creadListPrec :: ReadPrec [NotificationConfiguration]
readPrec :: ReadPrec NotificationConfiguration
$creadPrec :: ReadPrec NotificationConfiguration
readList :: ReadS [NotificationConfiguration]
$creadList :: ReadS [NotificationConfiguration]
readsPrec :: Int -> ReadS NotificationConfiguration
$creadsPrec :: Int -> ReadS NotificationConfiguration
Prelude.Read, Int -> NotificationConfiguration -> ShowS
[NotificationConfiguration] -> ShowS
NotificationConfiguration -> String
(Int -> NotificationConfiguration -> ShowS)
-> (NotificationConfiguration -> String)
-> ([NotificationConfiguration] -> ShowS)
-> Show NotificationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotificationConfiguration] -> ShowS
$cshowList :: [NotificationConfiguration] -> ShowS
show :: NotificationConfiguration -> String
$cshow :: NotificationConfiguration -> String
showsPrec :: Int -> NotificationConfiguration -> ShowS
$cshowsPrec :: Int -> NotificationConfiguration -> ShowS
Prelude.Show, (forall x.
NotificationConfiguration -> Rep NotificationConfiguration x)
-> (forall x.
Rep NotificationConfiguration x -> NotificationConfiguration)
-> Generic NotificationConfiguration
forall x.
Rep NotificationConfiguration x -> NotificationConfiguration
forall x.
NotificationConfiguration -> Rep NotificationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NotificationConfiguration x -> NotificationConfiguration
$cfrom :: forall x.
NotificationConfiguration -> Rep NotificationConfiguration x
Prelude.Generic)
newNotificationConfiguration ::
NotificationConfiguration
newNotificationConfiguration :: NotificationConfiguration
newNotificationConfiguration =
NotificationConfiguration' :: Maybe Text -> NotificationConfiguration
NotificationConfiguration'
{ $sel:notificationTopicArn:NotificationConfiguration' :: Maybe Text
notificationTopicArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
notificationConfiguration_notificationTopicArn :: Lens.Lens' NotificationConfiguration (Prelude.Maybe Prelude.Text)
notificationConfiguration_notificationTopicArn :: (Maybe Text -> f (Maybe Text))
-> NotificationConfiguration -> f NotificationConfiguration
notificationConfiguration_notificationTopicArn = (NotificationConfiguration -> Maybe Text)
-> (NotificationConfiguration
-> Maybe Text -> NotificationConfiguration)
-> Lens
NotificationConfiguration
NotificationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationConfiguration' {Maybe Text
notificationTopicArn :: Maybe Text
$sel:notificationTopicArn:NotificationConfiguration' :: NotificationConfiguration -> Maybe Text
notificationTopicArn} -> Maybe Text
notificationTopicArn) (\s :: NotificationConfiguration
s@NotificationConfiguration' {} Maybe Text
a -> NotificationConfiguration
s {$sel:notificationTopicArn:NotificationConfiguration' :: Maybe Text
notificationTopicArn = Maybe Text
a} :: NotificationConfiguration)
instance Core.FromJSON NotificationConfiguration where
parseJSON :: Value -> Parser NotificationConfiguration
parseJSON =
String
-> (Object -> Parser NotificationConfiguration)
-> Value
-> Parser NotificationConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NotificationConfiguration"
( \Object
x ->
Maybe Text -> NotificationConfiguration
NotificationConfiguration'
(Maybe Text -> NotificationConfiguration)
-> Parser (Maybe Text) -> Parser NotificationConfiguration
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
"NotificationTopicArn")
)
instance Prelude.Hashable NotificationConfiguration
instance Prelude.NFData NotificationConfiguration
instance Core.ToJSON NotificationConfiguration where
toJSON :: NotificationConfiguration -> Value
toJSON NotificationConfiguration' {Maybe Text
notificationTopicArn :: Maybe Text
$sel:notificationTopicArn:NotificationConfiguration' :: NotificationConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NotificationTopicArn" 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
notificationTopicArn
]
)