{-# 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.ChimeSdkVoice.Types.StreamingNotificationTarget where
import Amazonka.ChimeSdkVoice.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 -> Maybe NotificationTarget
notificationTarget :: Prelude.Maybe 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 ::
StreamingNotificationTarget
newStreamingNotificationTarget :: StreamingNotificationTarget
newStreamingNotificationTarget =
StreamingNotificationTarget'
{ $sel:notificationTarget:StreamingNotificationTarget' :: Maybe NotificationTarget
notificationTarget =
forall a. Maybe a
Prelude.Nothing
}
streamingNotificationTarget_notificationTarget :: Lens.Lens' StreamingNotificationTarget (Prelude.Maybe NotificationTarget)
streamingNotificationTarget_notificationTarget :: Lens' StreamingNotificationTarget (Maybe NotificationTarget)
streamingNotificationTarget_notificationTarget = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamingNotificationTarget' {Maybe NotificationTarget
notificationTarget :: Maybe NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> Maybe NotificationTarget
notificationTarget} -> Maybe NotificationTarget
notificationTarget) (\s :: StreamingNotificationTarget
s@StreamingNotificationTarget' {} Maybe NotificationTarget
a -> StreamingNotificationTarget
s {$sel:notificationTarget:StreamingNotificationTarget' :: Maybe NotificationTarget
notificationTarget = Maybe 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 ->
Maybe 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 (Maybe a)
Data..:? Key
"NotificationTarget")
)
instance Prelude.Hashable StreamingNotificationTarget where
hashWithSalt :: Int -> StreamingNotificationTarget -> Int
hashWithSalt Int
_salt StreamingNotificationTarget' {Maybe NotificationTarget
notificationTarget :: Maybe NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> Maybe NotificationTarget
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NotificationTarget
notificationTarget
instance Prelude.NFData StreamingNotificationTarget where
rnf :: StreamingNotificationTarget -> ()
rnf StreamingNotificationTarget' {Maybe NotificationTarget
notificationTarget :: Maybe NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> Maybe NotificationTarget
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe NotificationTarget
notificationTarget
instance Data.ToJSON StreamingNotificationTarget where
toJSON :: StreamingNotificationTarget -> Value
toJSON StreamingNotificationTarget' {Maybe NotificationTarget
notificationTarget :: Maybe NotificationTarget
$sel:notificationTarget:StreamingNotificationTarget' :: StreamingNotificationTarget -> Maybe NotificationTarget
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"NotificationTarget" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotificationTarget
notificationTarget
]
)