{-# 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.Textract.Types.NotificationChannel where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NotificationChannel = NotificationChannel'
{
NotificationChannel -> Text
sNSTopicArn :: Prelude.Text,
NotificationChannel -> Text
roleArn :: 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 ::
Prelude.Text ->
Prelude.Text ->
NotificationChannel
newNotificationChannel :: Text -> Text -> NotificationChannel
newNotificationChannel Text
pSNSTopicArn_ Text
pRoleArn_ =
NotificationChannel' :: Text -> Text -> NotificationChannel
NotificationChannel'
{ $sel:sNSTopicArn:NotificationChannel' :: Text
sNSTopicArn = Text
pSNSTopicArn_,
$sel:roleArn:NotificationChannel' :: Text
roleArn = Text
pRoleArn_
}
notificationChannel_sNSTopicArn :: Lens.Lens' NotificationChannel Prelude.Text
notificationChannel_sNSTopicArn :: (Text -> f Text) -> NotificationChannel -> f NotificationChannel
notificationChannel_sNSTopicArn = (NotificationChannel -> Text)
-> (NotificationChannel -> Text -> NotificationChannel)
-> Lens NotificationChannel NotificationChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationChannel' {Text
sNSTopicArn :: Text
$sel:sNSTopicArn:NotificationChannel' :: NotificationChannel -> Text
sNSTopicArn} -> Text
sNSTopicArn) (\s :: NotificationChannel
s@NotificationChannel' {} Text
a -> NotificationChannel
s {$sel:sNSTopicArn:NotificationChannel' :: Text
sNSTopicArn = Text
a} :: NotificationChannel)
notificationChannel_roleArn :: Lens.Lens' NotificationChannel Prelude.Text
notificationChannel_roleArn :: (Text -> f Text) -> NotificationChannel -> f NotificationChannel
notificationChannel_roleArn = (NotificationChannel -> Text)
-> (NotificationChannel -> Text -> NotificationChannel)
-> Lens NotificationChannel NotificationChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationChannel' {Text
roleArn :: Text
$sel:roleArn:NotificationChannel' :: NotificationChannel -> Text
roleArn} -> Text
roleArn) (\s :: NotificationChannel
s@NotificationChannel' {} Text
a -> NotificationChannel
s {$sel:roleArn:NotificationChannel' :: Text
roleArn = Text
a} :: NotificationChannel)
instance Prelude.Hashable NotificationChannel
instance Prelude.NFData NotificationChannel
instance Core.ToJSON NotificationChannel where
toJSON :: NotificationChannel -> Value
toJSON NotificationChannel' {Text
roleArn :: Text
sNSTopicArn :: Text
$sel:roleArn:NotificationChannel' :: NotificationChannel -> Text
$sel:sNSTopicArn:NotificationChannel' :: NotificationChannel -> Text
..} =
[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
"SNSTopicArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sNSTopicArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
]
)