{-# 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.Change where
import Amazonka.CloudFormation.Types.ChangeType
import Amazonka.CloudFormation.Types.ResourceChange
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Change = Change'
{
Change -> Maybe ResourceChange
resourceChange :: Prelude.Maybe ResourceChange,
Change -> Maybe ChangeType
type' :: Prelude.Maybe ChangeType
}
deriving (Change -> Change -> Bool
(Change -> Change -> Bool)
-> (Change -> Change -> Bool) -> Eq Change
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Change -> Change -> Bool
$c/= :: Change -> Change -> Bool
== :: Change -> Change -> Bool
$c== :: Change -> Change -> Bool
Prelude.Eq, ReadPrec [Change]
ReadPrec Change
Int -> ReadS Change
ReadS [Change]
(Int -> ReadS Change)
-> ReadS [Change]
-> ReadPrec Change
-> ReadPrec [Change]
-> Read Change
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Change]
$creadListPrec :: ReadPrec [Change]
readPrec :: ReadPrec Change
$creadPrec :: ReadPrec Change
readList :: ReadS [Change]
$creadList :: ReadS [Change]
readsPrec :: Int -> ReadS Change
$creadsPrec :: Int -> ReadS Change
Prelude.Read, Int -> Change -> ShowS
[Change] -> ShowS
Change -> String
(Int -> Change -> ShowS)
-> (Change -> String) -> ([Change] -> ShowS) -> Show Change
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Change] -> ShowS
$cshowList :: [Change] -> ShowS
show :: Change -> String
$cshow :: Change -> String
showsPrec :: Int -> Change -> ShowS
$cshowsPrec :: Int -> Change -> ShowS
Prelude.Show, (forall x. Change -> Rep Change x)
-> (forall x. Rep Change x -> Change) -> Generic Change
forall x. Rep Change x -> Change
forall x. Change -> Rep Change x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Change x -> Change
$cfrom :: forall x. Change -> Rep Change x
Prelude.Generic)
newChange ::
Change
newChange :: Change
newChange =
Change' :: Maybe ResourceChange -> Maybe ChangeType -> Change
Change'
{ $sel:resourceChange:Change' :: Maybe ResourceChange
resourceChange = Maybe ResourceChange
forall a. Maybe a
Prelude.Nothing,
$sel:type':Change' :: Maybe ChangeType
type' = Maybe ChangeType
forall a. Maybe a
Prelude.Nothing
}
change_resourceChange :: Lens.Lens' Change (Prelude.Maybe ResourceChange)
change_resourceChange :: (Maybe ResourceChange -> f (Maybe ResourceChange))
-> Change -> f Change
change_resourceChange = (Change -> Maybe ResourceChange)
-> (Change -> Maybe ResourceChange -> Change)
-> Lens Change Change (Maybe ResourceChange) (Maybe ResourceChange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Change' {Maybe ResourceChange
resourceChange :: Maybe ResourceChange
$sel:resourceChange:Change' :: Change -> Maybe ResourceChange
resourceChange} -> Maybe ResourceChange
resourceChange) (\s :: Change
s@Change' {} Maybe ResourceChange
a -> Change
s {$sel:resourceChange:Change' :: Maybe ResourceChange
resourceChange = Maybe ResourceChange
a} :: Change)
change_type :: Lens.Lens' Change (Prelude.Maybe ChangeType)
change_type :: (Maybe ChangeType -> f (Maybe ChangeType)) -> Change -> f Change
change_type = (Change -> Maybe ChangeType)
-> (Change -> Maybe ChangeType -> Change)
-> Lens Change Change (Maybe ChangeType) (Maybe ChangeType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Change' {Maybe ChangeType
type' :: Maybe ChangeType
$sel:type':Change' :: Change -> Maybe ChangeType
type'} -> Maybe ChangeType
type') (\s :: Change
s@Change' {} Maybe ChangeType
a -> Change
s {$sel:type':Change' :: Maybe ChangeType
type' = Maybe ChangeType
a} :: Change)
instance Core.FromXML Change where
parseXML :: [Node] -> Either String Change
parseXML [Node]
x =
Maybe ResourceChange -> Maybe ChangeType -> Change
Change'
(Maybe ResourceChange -> Maybe ChangeType -> Change)
-> Either String (Maybe ResourceChange)
-> Either String (Maybe ChangeType -> Change)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ResourceChange)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ResourceChange")
Either String (Maybe ChangeType -> Change)
-> Either String (Maybe ChangeType) -> Either String Change
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ChangeType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Type")
instance Prelude.Hashable Change
instance Prelude.NFData Change