{-# 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.ResourceTargetDefinition where
import Amazonka.CloudFormation.Types.RequiresRecreation
import Amazonka.CloudFormation.Types.ResourceAttribute
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 ResourceTargetDefinition = ResourceTargetDefinition'
{
ResourceTargetDefinition -> Maybe ResourceAttribute
attribute :: Prelude.Maybe ResourceAttribute,
ResourceTargetDefinition -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ResourceTargetDefinition -> Maybe RequiresRecreation
requiresRecreation :: Prelude.Maybe RequiresRecreation
}
deriving (ResourceTargetDefinition -> ResourceTargetDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceTargetDefinition -> ResourceTargetDefinition -> Bool
$c/= :: ResourceTargetDefinition -> ResourceTargetDefinition -> Bool
== :: ResourceTargetDefinition -> ResourceTargetDefinition -> Bool
$c== :: ResourceTargetDefinition -> ResourceTargetDefinition -> Bool
Prelude.Eq, ReadPrec [ResourceTargetDefinition]
ReadPrec ResourceTargetDefinition
Int -> ReadS ResourceTargetDefinition
ReadS [ResourceTargetDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceTargetDefinition]
$creadListPrec :: ReadPrec [ResourceTargetDefinition]
readPrec :: ReadPrec ResourceTargetDefinition
$creadPrec :: ReadPrec ResourceTargetDefinition
readList :: ReadS [ResourceTargetDefinition]
$creadList :: ReadS [ResourceTargetDefinition]
readsPrec :: Int -> ReadS ResourceTargetDefinition
$creadsPrec :: Int -> ReadS ResourceTargetDefinition
Prelude.Read, Int -> ResourceTargetDefinition -> ShowS
[ResourceTargetDefinition] -> ShowS
ResourceTargetDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceTargetDefinition] -> ShowS
$cshowList :: [ResourceTargetDefinition] -> ShowS
show :: ResourceTargetDefinition -> String
$cshow :: ResourceTargetDefinition -> String
showsPrec :: Int -> ResourceTargetDefinition -> ShowS
$cshowsPrec :: Int -> ResourceTargetDefinition -> ShowS
Prelude.Show, forall x.
Rep ResourceTargetDefinition x -> ResourceTargetDefinition
forall x.
ResourceTargetDefinition -> Rep ResourceTargetDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResourceTargetDefinition x -> ResourceTargetDefinition
$cfrom :: forall x.
ResourceTargetDefinition -> Rep ResourceTargetDefinition x
Prelude.Generic)
newResourceTargetDefinition ::
ResourceTargetDefinition
newResourceTargetDefinition :: ResourceTargetDefinition
newResourceTargetDefinition =
ResourceTargetDefinition'
{ $sel:attribute:ResourceTargetDefinition' :: Maybe ResourceAttribute
attribute =
forall a. Maybe a
Prelude.Nothing,
$sel:name:ResourceTargetDefinition' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:requiresRecreation:ResourceTargetDefinition' :: Maybe RequiresRecreation
requiresRecreation = forall a. Maybe a
Prelude.Nothing
}
resourceTargetDefinition_attribute :: Lens.Lens' ResourceTargetDefinition (Prelude.Maybe ResourceAttribute)
resourceTargetDefinition_attribute :: Lens' ResourceTargetDefinition (Maybe ResourceAttribute)
resourceTargetDefinition_attribute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceTargetDefinition' {Maybe ResourceAttribute
attribute :: Maybe ResourceAttribute
$sel:attribute:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe ResourceAttribute
attribute} -> Maybe ResourceAttribute
attribute) (\s :: ResourceTargetDefinition
s@ResourceTargetDefinition' {} Maybe ResourceAttribute
a -> ResourceTargetDefinition
s {$sel:attribute:ResourceTargetDefinition' :: Maybe ResourceAttribute
attribute = Maybe ResourceAttribute
a} :: ResourceTargetDefinition)
resourceTargetDefinition_name :: Lens.Lens' ResourceTargetDefinition (Prelude.Maybe Prelude.Text)
resourceTargetDefinition_name :: Lens' ResourceTargetDefinition (Maybe Text)
resourceTargetDefinition_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceTargetDefinition' {Maybe Text
name :: Maybe Text
$sel:name:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe Text
name} -> Maybe Text
name) (\s :: ResourceTargetDefinition
s@ResourceTargetDefinition' {} Maybe Text
a -> ResourceTargetDefinition
s {$sel:name:ResourceTargetDefinition' :: Maybe Text
name = Maybe Text
a} :: ResourceTargetDefinition)
resourceTargetDefinition_requiresRecreation :: Lens.Lens' ResourceTargetDefinition (Prelude.Maybe RequiresRecreation)
resourceTargetDefinition_requiresRecreation :: Lens' ResourceTargetDefinition (Maybe RequiresRecreation)
resourceTargetDefinition_requiresRecreation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceTargetDefinition' {Maybe RequiresRecreation
requiresRecreation :: Maybe RequiresRecreation
$sel:requiresRecreation:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe RequiresRecreation
requiresRecreation} -> Maybe RequiresRecreation
requiresRecreation) (\s :: ResourceTargetDefinition
s@ResourceTargetDefinition' {} Maybe RequiresRecreation
a -> ResourceTargetDefinition
s {$sel:requiresRecreation:ResourceTargetDefinition' :: Maybe RequiresRecreation
requiresRecreation = Maybe RequiresRecreation
a} :: ResourceTargetDefinition)
instance Data.FromXML ResourceTargetDefinition where
parseXML :: [Node] -> Either String ResourceTargetDefinition
parseXML [Node]
x =
Maybe ResourceAttribute
-> Maybe Text
-> Maybe RequiresRecreation
-> ResourceTargetDefinition
ResourceTargetDefinition'
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
"Attribute")
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
"Name")
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
"RequiresRecreation")
instance Prelude.Hashable ResourceTargetDefinition where
hashWithSalt :: Int -> ResourceTargetDefinition -> Int
hashWithSalt Int
_salt ResourceTargetDefinition' {Maybe Text
Maybe RequiresRecreation
Maybe ResourceAttribute
requiresRecreation :: Maybe RequiresRecreation
name :: Maybe Text
attribute :: Maybe ResourceAttribute
$sel:requiresRecreation:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe RequiresRecreation
$sel:name:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe Text
$sel:attribute:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe ResourceAttribute
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceAttribute
attribute
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RequiresRecreation
requiresRecreation
instance Prelude.NFData ResourceTargetDefinition where
rnf :: ResourceTargetDefinition -> ()
rnf ResourceTargetDefinition' {Maybe Text
Maybe RequiresRecreation
Maybe ResourceAttribute
requiresRecreation :: Maybe RequiresRecreation
name :: Maybe Text
attribute :: Maybe ResourceAttribute
$sel:requiresRecreation:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe RequiresRecreation
$sel:name:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe Text
$sel:attribute:ResourceTargetDefinition' :: ResourceTargetDefinition -> Maybe ResourceAttribute
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceAttribute
attribute
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RequiresRecreation
requiresRecreation