{-# 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.SES.Types.WorkmailAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WorkmailAction = WorkmailAction'
{
WorkmailAction -> Maybe Text
topicArn :: Prelude.Maybe Prelude.Text,
WorkmailAction -> Text
organizationArn :: Prelude.Text
}
deriving (WorkmailAction -> WorkmailAction -> Bool
(WorkmailAction -> WorkmailAction -> Bool)
-> (WorkmailAction -> WorkmailAction -> Bool) -> Eq WorkmailAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkmailAction -> WorkmailAction -> Bool
$c/= :: WorkmailAction -> WorkmailAction -> Bool
== :: WorkmailAction -> WorkmailAction -> Bool
$c== :: WorkmailAction -> WorkmailAction -> Bool
Prelude.Eq, ReadPrec [WorkmailAction]
ReadPrec WorkmailAction
Int -> ReadS WorkmailAction
ReadS [WorkmailAction]
(Int -> ReadS WorkmailAction)
-> ReadS [WorkmailAction]
-> ReadPrec WorkmailAction
-> ReadPrec [WorkmailAction]
-> Read WorkmailAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkmailAction]
$creadListPrec :: ReadPrec [WorkmailAction]
readPrec :: ReadPrec WorkmailAction
$creadPrec :: ReadPrec WorkmailAction
readList :: ReadS [WorkmailAction]
$creadList :: ReadS [WorkmailAction]
readsPrec :: Int -> ReadS WorkmailAction
$creadsPrec :: Int -> ReadS WorkmailAction
Prelude.Read, Int -> WorkmailAction -> ShowS
[WorkmailAction] -> ShowS
WorkmailAction -> String
(Int -> WorkmailAction -> ShowS)
-> (WorkmailAction -> String)
-> ([WorkmailAction] -> ShowS)
-> Show WorkmailAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkmailAction] -> ShowS
$cshowList :: [WorkmailAction] -> ShowS
show :: WorkmailAction -> String
$cshow :: WorkmailAction -> String
showsPrec :: Int -> WorkmailAction -> ShowS
$cshowsPrec :: Int -> WorkmailAction -> ShowS
Prelude.Show, (forall x. WorkmailAction -> Rep WorkmailAction x)
-> (forall x. Rep WorkmailAction x -> WorkmailAction)
-> Generic WorkmailAction
forall x. Rep WorkmailAction x -> WorkmailAction
forall x. WorkmailAction -> Rep WorkmailAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkmailAction x -> WorkmailAction
$cfrom :: forall x. WorkmailAction -> Rep WorkmailAction x
Prelude.Generic)
newWorkmailAction ::
Prelude.Text ->
WorkmailAction
newWorkmailAction :: Text -> WorkmailAction
newWorkmailAction Text
pOrganizationArn_ =
WorkmailAction' :: Maybe Text -> Text -> WorkmailAction
WorkmailAction'
{ $sel:topicArn:WorkmailAction' :: Maybe Text
topicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:organizationArn:WorkmailAction' :: Text
organizationArn = Text
pOrganizationArn_
}
workmailAction_topicArn :: Lens.Lens' WorkmailAction (Prelude.Maybe Prelude.Text)
workmailAction_topicArn :: (Maybe Text -> f (Maybe Text))
-> WorkmailAction -> f WorkmailAction
workmailAction_topicArn = (WorkmailAction -> Maybe Text)
-> (WorkmailAction -> Maybe Text -> WorkmailAction)
-> Lens WorkmailAction WorkmailAction (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkmailAction' {Maybe Text
topicArn :: Maybe Text
$sel:topicArn:WorkmailAction' :: WorkmailAction -> Maybe Text
topicArn} -> Maybe Text
topicArn) (\s :: WorkmailAction
s@WorkmailAction' {} Maybe Text
a -> WorkmailAction
s {$sel:topicArn:WorkmailAction' :: Maybe Text
topicArn = Maybe Text
a} :: WorkmailAction)
workmailAction_organizationArn :: Lens.Lens' WorkmailAction Prelude.Text
workmailAction_organizationArn :: (Text -> f Text) -> WorkmailAction -> f WorkmailAction
workmailAction_organizationArn = (WorkmailAction -> Text)
-> (WorkmailAction -> Text -> WorkmailAction)
-> Lens WorkmailAction WorkmailAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkmailAction' {Text
organizationArn :: Text
$sel:organizationArn:WorkmailAction' :: WorkmailAction -> Text
organizationArn} -> Text
organizationArn) (\s :: WorkmailAction
s@WorkmailAction' {} Text
a -> WorkmailAction
s {$sel:organizationArn:WorkmailAction' :: Text
organizationArn = Text
a} :: WorkmailAction)
instance Core.FromXML WorkmailAction where
parseXML :: [Node] -> Either String WorkmailAction
parseXML [Node]
x =
Maybe Text -> Text -> WorkmailAction
WorkmailAction'
(Maybe Text -> Text -> WorkmailAction)
-> Either String (Maybe Text)
-> Either String (Text -> WorkmailAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TopicArn")
Either String (Text -> WorkmailAction)
-> Either String Text -> Either String WorkmailAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"OrganizationArn")
instance Prelude.Hashable WorkmailAction
instance Prelude.NFData WorkmailAction
instance Core.ToQuery WorkmailAction where
toQuery :: WorkmailAction -> QueryString
toQuery WorkmailAction' {Maybe Text
Text
organizationArn :: Text
topicArn :: Maybe Text
$sel:organizationArn:WorkmailAction' :: WorkmailAction -> Text
$sel:topicArn:WorkmailAction' :: WorkmailAction -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"TopicArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
topicArn,
ByteString
"OrganizationArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
organizationArn
]