{-# 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.NotificationChannel where
import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.Types.NotificationChannelConfig
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NotificationChannel = NotificationChannel'
{
NotificationChannel -> Maybe NotificationChannelConfig
config :: Prelude.Maybe NotificationChannelConfig,
NotificationChannel -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (NotificationChannel -> NotificationChannel -> Bool
(NotificationChannel -> NotificationChannel -> Bool)
-> (NotificationChannel -> NotificationChannel -> Bool)
-> Eq NotificationChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotificationChannel -> NotificationChannel -> Bool
$c/= :: NotificationChannel -> NotificationChannel -> Bool
== :: NotificationChannel -> NotificationChannel -> Bool
$c== :: NotificationChannel -> NotificationChannel -> Bool
Prelude.Eq, ReadPrec [NotificationChannel]
ReadPrec NotificationChannel
Int -> ReadS NotificationChannel
ReadS [NotificationChannel]
(Int -> ReadS NotificationChannel)
-> ReadS [NotificationChannel]
-> ReadPrec NotificationChannel
-> ReadPrec [NotificationChannel]
-> Read NotificationChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotificationChannel]
$creadListPrec :: ReadPrec [NotificationChannel]
readPrec :: ReadPrec NotificationChannel
$creadPrec :: ReadPrec NotificationChannel
readList :: ReadS [NotificationChannel]
$creadList :: ReadS [NotificationChannel]
readsPrec :: Int -> ReadS NotificationChannel
$creadsPrec :: Int -> ReadS NotificationChannel
Prelude.Read, Int -> NotificationChannel -> ShowS
[NotificationChannel] -> ShowS
NotificationChannel -> String
(Int -> NotificationChannel -> ShowS)
-> (NotificationChannel -> String)
-> ([NotificationChannel] -> ShowS)
-> Show NotificationChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotificationChannel] -> ShowS
$cshowList :: [NotificationChannel] -> ShowS
show :: NotificationChannel -> String
$cshow :: NotificationChannel -> String
showsPrec :: Int -> NotificationChannel -> ShowS
$cshowsPrec :: Int -> NotificationChannel -> ShowS
Prelude.Show, (forall x. NotificationChannel -> Rep NotificationChannel x)
-> (forall x. Rep NotificationChannel x -> NotificationChannel)
-> Generic NotificationChannel
forall x. Rep NotificationChannel x -> NotificationChannel
forall x. NotificationChannel -> Rep NotificationChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotificationChannel x -> NotificationChannel
$cfrom :: forall x. NotificationChannel -> Rep NotificationChannel x
Prelude.Generic)
newNotificationChannel ::
NotificationChannel
newNotificationChannel :: NotificationChannel
newNotificationChannel =
NotificationChannel' :: Maybe NotificationChannelConfig
-> Maybe Text -> NotificationChannel
NotificationChannel'
{ $sel:config:NotificationChannel' :: Maybe NotificationChannelConfig
config = Maybe NotificationChannelConfig
forall a. Maybe a
Prelude.Nothing,
$sel:id:NotificationChannel' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
notificationChannel_config :: Lens.Lens' NotificationChannel (Prelude.Maybe NotificationChannelConfig)
notificationChannel_config :: (Maybe NotificationChannelConfig
-> f (Maybe NotificationChannelConfig))
-> NotificationChannel -> f NotificationChannel
notificationChannel_config = (NotificationChannel -> Maybe NotificationChannelConfig)
-> (NotificationChannel
-> Maybe NotificationChannelConfig -> NotificationChannel)
-> Lens
NotificationChannel
NotificationChannel
(Maybe NotificationChannelConfig)
(Maybe NotificationChannelConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationChannel' {Maybe NotificationChannelConfig
config :: Maybe NotificationChannelConfig
$sel:config:NotificationChannel' :: NotificationChannel -> Maybe NotificationChannelConfig
config} -> Maybe NotificationChannelConfig
config) (\s :: NotificationChannel
s@NotificationChannel' {} Maybe NotificationChannelConfig
a -> NotificationChannel
s {$sel:config:NotificationChannel' :: Maybe NotificationChannelConfig
config = Maybe NotificationChannelConfig
a} :: NotificationChannel)
notificationChannel_id :: Lens.Lens' NotificationChannel (Prelude.Maybe Prelude.Text)
notificationChannel_id :: (Maybe Text -> f (Maybe Text))
-> NotificationChannel -> f NotificationChannel
notificationChannel_id = (NotificationChannel -> Maybe Text)
-> (NotificationChannel -> Maybe Text -> NotificationChannel)
-> Lens
NotificationChannel NotificationChannel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationChannel' {Maybe Text
id :: Maybe Text
$sel:id:NotificationChannel' :: NotificationChannel -> Maybe Text
id} -> Maybe Text
id) (\s :: NotificationChannel
s@NotificationChannel' {} Maybe Text
a -> NotificationChannel
s {$sel:id:NotificationChannel' :: Maybe Text
id = Maybe Text
a} :: NotificationChannel)
instance Core.FromJSON NotificationChannel where
parseJSON :: Value -> Parser NotificationChannel
parseJSON =
String
-> (Object -> Parser NotificationChannel)
-> Value
-> Parser NotificationChannel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NotificationChannel"
( \Object
x ->
Maybe NotificationChannelConfig
-> Maybe Text -> NotificationChannel
NotificationChannel'
(Maybe NotificationChannelConfig
-> Maybe Text -> NotificationChannel)
-> Parser (Maybe NotificationChannelConfig)
-> Parser (Maybe Text -> NotificationChannel)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NotificationChannelConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Config") Parser (Maybe Text -> NotificationChannel)
-> Parser (Maybe Text) -> Parser NotificationChannel
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
"Id")
)
instance Prelude.Hashable NotificationChannel
instance Prelude.NFData NotificationChannel