{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Change = Change'
{
Change -> Maybe Natural
hookInvocationCount :: Prelude.Maybe Prelude.Natural,
Change -> Maybe ResourceChange
resourceChange :: Prelude.Maybe ResourceChange,
Change -> Maybe ChangeType
type' :: Prelude.Maybe ChangeType
}
deriving (Change -> Change -> Bool
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]
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
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. 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'
{ $sel:hookInvocationCount:Change' :: Maybe Natural
hookInvocationCount = forall a. Maybe a
Prelude.Nothing,
$sel:resourceChange:Change' :: Maybe ResourceChange
resourceChange = forall a. Maybe a
Prelude.Nothing,
$sel:type':Change' :: Maybe ChangeType
type' = forall a. Maybe a
Prelude.Nothing
}
change_hookInvocationCount :: Lens.Lens' Change (Prelude.Maybe Prelude.Natural)
change_hookInvocationCount :: Lens' Change (Maybe Natural)
change_hookInvocationCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Change' {Maybe Natural
hookInvocationCount :: Maybe Natural
$sel:hookInvocationCount:Change' :: Change -> Maybe Natural
hookInvocationCount} -> Maybe Natural
hookInvocationCount) (\s :: Change
s@Change' {} Maybe Natural
a -> Change
s {$sel:hookInvocationCount:Change' :: Maybe Natural
hookInvocationCount = Maybe Natural
a} :: Change)
change_resourceChange :: Lens.Lens' Change (Prelude.Maybe ResourceChange)
change_resourceChange :: Lens' Change (Maybe ResourceChange)
change_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 :: Lens' Change (Maybe ChangeType)
change_type = 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 Data.FromXML Change where
parseXML :: [Node] -> Either String Change
parseXML [Node]
x =
Maybe Natural -> Maybe ResourceChange -> Maybe ChangeType -> Change
Change'
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
"HookInvocationCount")
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
"ResourceChange")
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
"Type")
instance Prelude.Hashable Change where
hashWithSalt :: Int -> Change -> Int
hashWithSalt Int
_salt Change' {Maybe Natural
Maybe ChangeType
Maybe ResourceChange
type' :: Maybe ChangeType
resourceChange :: Maybe ResourceChange
hookInvocationCount :: Maybe Natural
$sel:type':Change' :: Change -> Maybe ChangeType
$sel:resourceChange:Change' :: Change -> Maybe ResourceChange
$sel:hookInvocationCount:Change' :: Change -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
hookInvocationCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceChange
resourceChange
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChangeType
type'
instance Prelude.NFData Change where
rnf :: Change -> ()
rnf Change' {Maybe Natural
Maybe ChangeType
Maybe ResourceChange
type' :: Maybe ChangeType
resourceChange :: Maybe ResourceChange
hookInvocationCount :: Maybe Natural
$sel:type':Change' :: Change -> Maybe ChangeType
$sel:resourceChange:Change' :: Change -> Maybe ResourceChange
$sel:hookInvocationCount:Change' :: Change -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
hookInvocationCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceChange
resourceChange
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChangeType
type'