{-# 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.Chime.Types.StreamingNotificationTarget where
import Amazonka.Chime.Types.NotificationTarget
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 StreamingNotificationTarget = StreamingNotificationTarget'
{
StreamingNotificationTarget -> NotificationTarget
notificationTarget :: NotificationTarget
}
deriving (StreamingNotificationTarget -> StreamingNotificationTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamingNotificationTarget -> StreamingNotificationTarget -> Bool
$c/= :: StreamingNotificationTarget -> StreamingNotificationTarget -> Bool
== :: StreamingNotificationTarget -> StreamingNotificationTarget -> Bool
$c== :: StreamingNotificationTarget -> StreamingNotificationTarget -> Bool
Prelude.Eq, ReadPrec [StreamingNotificationTarget]
ReadPrec StreamingNotificationTarget
Int -> ReadS StreamingNotificationTarget
ReadS [StreamingNotificationTarget]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamingNotificationTarget]
$creadListPrec :: ReadPrec [StreamingNotificationTarget]
readPrec :: ReadPrec StreamingNotificationTarget
$creadPrec :: ReadPrec StreamingNotificationTarget
readList :: ReadS [StreamingNotificationTarget]
$creadList :: ReadS [StreamingNotificationTarget]
readsPrec :: Int -> ReadS StreamingNotificationTarget
$creadsPrec :: Int -> ReadS StreamingNotificationTarget
Prelude.Read, Int -> StreamingNotificationTarget -> ShowS
[StreamingNotificationTarget] -> ShowS
StreamingNotificationTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamingNotificationTarget] -> ShowS
$cshowList :: [StreamingNotificationTarget] -> ShowS
show :: StreamingNotificationTarget -> String
$cshow :: StreamingNotificationTarget -> String
showsPrec :: Int -> StreamingNotificationTarget -> ShowS
$cshowsPrec :: Int -> StreamingNotificationTarget -> ShowS
Prelude.Show, forall x.
Rep StreamingNotificationTarget x -> StreamingNotificationTarget
forall x.
StreamingNotificationTarget -> Rep StreamingNotificationTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StreamingNotificationTarget x -> StreamingNotificationTarget
$cfrom :: forall x.
StreamingNotificationTarget -> Rep StreamingNotificationTarget x
Prelude.Generic)
newStreamingNotificationTarget ::
NotificationTarget ->
StreamingNotificationTarget
newStreamingNotificationTarget :: NotificationTarget -> StreamingNotificationTarget
newStreamingNotificationTarget NotificationTarget
pNotificationTarget_ =
StreamingNotificationTarget'
{ $sel:notificationTarget:StreamingNotificationTarget' :: NotificationTarget
notificationTarget =
NotificationTarget
pNotificationTarget_
}
streamingNotificationTarget_notificationTarget :: Lens.Lens' StreamingNotificationTarget NotificationTarget
streamingNotificationTarget_notificationTarget :: Lens' StreamingNotificationTarget NotificationTarget
streamingNotificationTarget_notificationTarget = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingNotificationTarget' {NotificationTarget
notificationTarget :: NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> NotificationTarget
notificationTarget} -> NotificationTarget
notificationTarget) (\s :: StreamingNotificationTarget
s@StreamingNotificationTarget' {} NotificationTarget
a -> StreamingNotificationTarget
s {$sel:notificationTarget:StreamingNotificationTarget' :: NotificationTarget
notificationTarget = NotificationTarget
a} :: StreamingNotificationTarget)
instance Data.FromJSON StreamingNotificationTarget where
parseJSON :: Value -> Parser StreamingNotificationTarget
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StreamingNotificationTarget"
( \Object
x ->
NotificationTarget -> StreamingNotificationTarget
StreamingNotificationTarget'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"NotificationTarget")
)
instance Prelude.Hashable StreamingNotificationTarget where
hashWithSalt :: Int -> StreamingNotificationTarget -> Int
hashWithSalt Int
_salt StreamingNotificationTarget' {NotificationTarget
notificationTarget :: NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> NotificationTarget
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NotificationTarget
notificationTarget
instance Prelude.NFData StreamingNotificationTarget where
rnf :: StreamingNotificationTarget -> ()
rnf StreamingNotificationTarget' {NotificationTarget
notificationTarget :: NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> NotificationTarget
..} =
forall a. NFData a => a -> ()
Prelude.rnf NotificationTarget
notificationTarget
instance Data.ToJSON StreamingNotificationTarget where
toJSON :: StreamingNotificationTarget -> Value
toJSON StreamingNotificationTarget' {NotificationTarget
notificationTarget :: NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> NotificationTarget
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"NotificationTarget" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NotificationTarget
notificationTarget)
]
)