{-# 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.CloudFormation.Types.RollbackConfiguration where
import Amazonka.CloudFormation.Types.RollbackTrigger
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 RollbackConfiguration = RollbackConfiguration'
{
RollbackConfiguration -> Maybe Natural
monitoringTimeInMinutes :: Prelude.Maybe Prelude.Natural,
RollbackConfiguration -> Maybe [RollbackTrigger]
rollbackTriggers :: Prelude.Maybe [RollbackTrigger]
}
deriving (RollbackConfiguration -> RollbackConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RollbackConfiguration -> RollbackConfiguration -> Bool
$c/= :: RollbackConfiguration -> RollbackConfiguration -> Bool
== :: RollbackConfiguration -> RollbackConfiguration -> Bool
$c== :: RollbackConfiguration -> RollbackConfiguration -> Bool
Prelude.Eq, ReadPrec [RollbackConfiguration]
ReadPrec RollbackConfiguration
Int -> ReadS RollbackConfiguration
ReadS [RollbackConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RollbackConfiguration]
$creadListPrec :: ReadPrec [RollbackConfiguration]
readPrec :: ReadPrec RollbackConfiguration
$creadPrec :: ReadPrec RollbackConfiguration
readList :: ReadS [RollbackConfiguration]
$creadList :: ReadS [RollbackConfiguration]
readsPrec :: Int -> ReadS RollbackConfiguration
$creadsPrec :: Int -> ReadS RollbackConfiguration
Prelude.Read, Int -> RollbackConfiguration -> ShowS
[RollbackConfiguration] -> ShowS
RollbackConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RollbackConfiguration] -> ShowS
$cshowList :: [RollbackConfiguration] -> ShowS
show :: RollbackConfiguration -> String
$cshow :: RollbackConfiguration -> String
showsPrec :: Int -> RollbackConfiguration -> ShowS
$cshowsPrec :: Int -> RollbackConfiguration -> ShowS
Prelude.Show, forall x. Rep RollbackConfiguration x -> RollbackConfiguration
forall x. RollbackConfiguration -> Rep RollbackConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RollbackConfiguration x -> RollbackConfiguration
$cfrom :: forall x. RollbackConfiguration -> Rep RollbackConfiguration x
Prelude.Generic)
newRollbackConfiguration ::
RollbackConfiguration
newRollbackConfiguration :: RollbackConfiguration
newRollbackConfiguration =
RollbackConfiguration'
{ $sel:monitoringTimeInMinutes:RollbackConfiguration' :: Maybe Natural
monitoringTimeInMinutes =
forall a. Maybe a
Prelude.Nothing,
$sel:rollbackTriggers:RollbackConfiguration' :: Maybe [RollbackTrigger]
rollbackTriggers = forall a. Maybe a
Prelude.Nothing
}
rollbackConfiguration_monitoringTimeInMinutes :: Lens.Lens' RollbackConfiguration (Prelude.Maybe Prelude.Natural)
rollbackConfiguration_monitoringTimeInMinutes :: Lens' RollbackConfiguration (Maybe Natural)
rollbackConfiguration_monitoringTimeInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RollbackConfiguration' {Maybe Natural
monitoringTimeInMinutes :: Maybe Natural
$sel:monitoringTimeInMinutes:RollbackConfiguration' :: RollbackConfiguration -> Maybe Natural
monitoringTimeInMinutes} -> Maybe Natural
monitoringTimeInMinutes) (\s :: RollbackConfiguration
s@RollbackConfiguration' {} Maybe Natural
a -> RollbackConfiguration
s {$sel:monitoringTimeInMinutes:RollbackConfiguration' :: Maybe Natural
monitoringTimeInMinutes = Maybe Natural
a} :: RollbackConfiguration)
rollbackConfiguration_rollbackTriggers :: Lens.Lens' RollbackConfiguration (Prelude.Maybe [RollbackTrigger])
rollbackConfiguration_rollbackTriggers :: Lens' RollbackConfiguration (Maybe [RollbackTrigger])
rollbackConfiguration_rollbackTriggers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RollbackConfiguration' {Maybe [RollbackTrigger]
rollbackTriggers :: Maybe [RollbackTrigger]
$sel:rollbackTriggers:RollbackConfiguration' :: RollbackConfiguration -> Maybe [RollbackTrigger]
rollbackTriggers} -> Maybe [RollbackTrigger]
rollbackTriggers) (\s :: RollbackConfiguration
s@RollbackConfiguration' {} Maybe [RollbackTrigger]
a -> RollbackConfiguration
s {$sel:rollbackTriggers:RollbackConfiguration' :: Maybe [RollbackTrigger]
rollbackTriggers = Maybe [RollbackTrigger]
a} :: RollbackConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromXML RollbackConfiguration where
parseXML :: [Node] -> Either String RollbackConfiguration
parseXML [Node]
x =
Maybe Natural -> Maybe [RollbackTrigger] -> RollbackConfiguration
RollbackConfiguration'
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
"MonitoringTimeInMinutes")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"RollbackTriggers"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
instance Prelude.Hashable RollbackConfiguration where
hashWithSalt :: Int -> RollbackConfiguration -> Int
hashWithSalt Int
_salt RollbackConfiguration' {Maybe Natural
Maybe [RollbackTrigger]
rollbackTriggers :: Maybe [RollbackTrigger]
monitoringTimeInMinutes :: Maybe Natural
$sel:rollbackTriggers:RollbackConfiguration' :: RollbackConfiguration -> Maybe [RollbackTrigger]
$sel:monitoringTimeInMinutes:RollbackConfiguration' :: RollbackConfiguration -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
monitoringTimeInMinutes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RollbackTrigger]
rollbackTriggers
instance Prelude.NFData RollbackConfiguration where
rnf :: RollbackConfiguration -> ()
rnf RollbackConfiguration' {Maybe Natural
Maybe [RollbackTrigger]
rollbackTriggers :: Maybe [RollbackTrigger]
monitoringTimeInMinutes :: Maybe Natural
$sel:rollbackTriggers:RollbackConfiguration' :: RollbackConfiguration -> Maybe [RollbackTrigger]
$sel:monitoringTimeInMinutes:RollbackConfiguration' :: RollbackConfiguration -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
monitoringTimeInMinutes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RollbackTrigger]
rollbackTriggers
instance Data.ToQuery RollbackConfiguration where
toQuery :: RollbackConfiguration -> QueryString
toQuery RollbackConfiguration' {Maybe Natural
Maybe [RollbackTrigger]
rollbackTriggers :: Maybe [RollbackTrigger]
monitoringTimeInMinutes :: Maybe Natural
$sel:rollbackTriggers:RollbackConfiguration' :: RollbackConfiguration -> Maybe [RollbackTrigger]
$sel:monitoringTimeInMinutes:RollbackConfiguration' :: RollbackConfiguration -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"MonitoringTimeInMinutes"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
monitoringTimeInMinutes,
ByteString
"RollbackTriggers"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RollbackTrigger]
rollbackTriggers
)
]