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