{-# 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.StopAction where
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
import Amazonka.SES.Types.StopScope
data StopAction = StopAction'
{
StopAction -> Maybe Text
topicArn :: Prelude.Maybe Prelude.Text,
StopAction -> StopScope
scope :: StopScope
}
deriving (StopAction -> StopAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopAction -> StopAction -> Bool
$c/= :: StopAction -> StopAction -> Bool
== :: StopAction -> StopAction -> Bool
$c== :: StopAction -> StopAction -> Bool
Prelude.Eq, ReadPrec [StopAction]
ReadPrec StopAction
Int -> ReadS StopAction
ReadS [StopAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopAction]
$creadListPrec :: ReadPrec [StopAction]
readPrec :: ReadPrec StopAction
$creadPrec :: ReadPrec StopAction
readList :: ReadS [StopAction]
$creadList :: ReadS [StopAction]
readsPrec :: Int -> ReadS StopAction
$creadsPrec :: Int -> ReadS StopAction
Prelude.Read, Int -> StopAction -> ShowS
[StopAction] -> ShowS
StopAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopAction] -> ShowS
$cshowList :: [StopAction] -> ShowS
show :: StopAction -> String
$cshow :: StopAction -> String
showsPrec :: Int -> StopAction -> ShowS
$cshowsPrec :: Int -> StopAction -> ShowS
Prelude.Show, forall x. Rep StopAction x -> StopAction
forall x. StopAction -> Rep StopAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopAction x -> StopAction
$cfrom :: forall x. StopAction -> Rep StopAction x
Prelude.Generic)
newStopAction ::
StopScope ->
StopAction
newStopAction :: StopScope -> StopAction
newStopAction StopScope
pScope_ =
StopAction'
{ $sel:topicArn:StopAction' :: Maybe Text
topicArn = forall a. Maybe a
Prelude.Nothing,
$sel:scope:StopAction' :: StopScope
scope = StopScope
pScope_
}
stopAction_topicArn :: Lens.Lens' StopAction (Prelude.Maybe Prelude.Text)
stopAction_topicArn :: Lens' StopAction (Maybe Text)
stopAction_topicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopAction' {Maybe Text
topicArn :: Maybe Text
$sel:topicArn:StopAction' :: StopAction -> Maybe Text
topicArn} -> Maybe Text
topicArn) (\s :: StopAction
s@StopAction' {} Maybe Text
a -> StopAction
s {$sel:topicArn:StopAction' :: Maybe Text
topicArn = Maybe Text
a} :: StopAction)
stopAction_scope :: Lens.Lens' StopAction StopScope
stopAction_scope :: Lens' StopAction StopScope
stopAction_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopAction' {StopScope
scope :: StopScope
$sel:scope:StopAction' :: StopAction -> StopScope
scope} -> StopScope
scope) (\s :: StopAction
s@StopAction' {} StopScope
a -> StopAction
s {$sel:scope:StopAction' :: StopScope
scope = StopScope
a} :: StopAction)
instance Data.FromXML StopAction where
parseXML :: [Node] -> Either String StopAction
parseXML [Node]
x =
Maybe Text -> StopScope -> StopAction
StopAction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TopicArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Scope")
instance Prelude.Hashable StopAction where
hashWithSalt :: Int -> StopAction -> Int
hashWithSalt Int
_salt StopAction' {Maybe Text
StopScope
scope :: StopScope
topicArn :: Maybe Text
$sel:scope:StopAction' :: StopAction -> StopScope
$sel:topicArn:StopAction' :: StopAction -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
topicArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StopScope
scope
instance Prelude.NFData StopAction where
rnf :: StopAction -> ()
rnf StopAction' {Maybe Text
StopScope
scope :: StopScope
topicArn :: Maybe Text
$sel:scope:StopAction' :: StopAction -> StopScope
$sel:topicArn:StopAction' :: StopAction -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
topicArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StopScope
scope
instance Data.ToQuery StopAction where
toQuery :: StopAction -> QueryString
toQuery StopAction' {Maybe Text
StopScope
scope :: StopScope
topicArn :: Maybe Text
$sel:scope:StopAction' :: StopAction -> StopScope
$sel:topicArn:StopAction' :: StopAction -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"TopicArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
topicArn, ByteString
"Scope" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: StopScope
scope]