{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourceTargetDefinition = ResourceTargetDefinition'
{
ResourceTargetDefinition -> Maybe ResourceAttribute
attribute :: Prelude.Maybe ResourceAttribute,
ResourceTargetDefinition -> Maybe RequiresRecreation
requiresRecreation :: Prelude.Maybe RequiresRecreation,
ResourceTargetDefinition -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (ResourceTargetDefinition -> ResourceTargetDefinition -> Bool
(ResourceTargetDefinition -> ResourceTargetDefinition -> Bool)
-> (ResourceTargetDefinition -> ResourceTargetDefinition -> Bool)
-> Eq ResourceTargetDefinition
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]
(Int -> ReadS ResourceTargetDefinition)
-> ReadS [ResourceTargetDefinition]
-> ReadPrec ResourceTargetDefinition
-> ReadPrec [ResourceTargetDefinition]
-> Read 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
(Int -> ResourceTargetDefinition -> ShowS)
-> (ResourceTargetDefinition -> String)
-> ([ResourceTargetDefinition] -> ShowS)
-> Show ResourceTargetDefinition
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.
ResourceTargetDefinition -> Rep ResourceTargetDefinition x)
-> (forall x.
Rep ResourceTargetDefinition x -> ResourceTargetDefinition)
-> Generic ResourceTargetDefinition
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' :: Maybe ResourceAttribute
-> Maybe RequiresRecreation
-> Maybe Text
-> ResourceTargetDefinition
ResourceTargetDefinition'
{ $sel:attribute:ResourceTargetDefinition' :: Maybe ResourceAttribute
attribute =
Maybe ResourceAttribute
forall a. Maybe a
Prelude.Nothing,
$sel:requiresRecreation:ResourceTargetDefinition' :: Maybe RequiresRecreation
requiresRecreation = Maybe RequiresRecreation
forall a. Maybe a
Prelude.Nothing,
$sel:name:ResourceTargetDefinition' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
resourceTargetDefinition_attribute :: Lens.Lens' ResourceTargetDefinition (Prelude.Maybe ResourceAttribute)
resourceTargetDefinition_attribute :: (Maybe ResourceAttribute -> f (Maybe ResourceAttribute))
-> ResourceTargetDefinition -> f ResourceTargetDefinition
resourceTargetDefinition_attribute = (ResourceTargetDefinition -> Maybe ResourceAttribute)
-> (ResourceTargetDefinition
-> Maybe ResourceAttribute -> ResourceTargetDefinition)
-> Lens
ResourceTargetDefinition
ResourceTargetDefinition
(Maybe ResourceAttribute)
(Maybe ResourceAttribute)
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_requiresRecreation :: Lens.Lens' ResourceTargetDefinition (Prelude.Maybe RequiresRecreation)
resourceTargetDefinition_requiresRecreation :: (Maybe RequiresRecreation -> f (Maybe RequiresRecreation))
-> ResourceTargetDefinition -> f ResourceTargetDefinition
resourceTargetDefinition_requiresRecreation = (ResourceTargetDefinition -> Maybe RequiresRecreation)
-> (ResourceTargetDefinition
-> Maybe RequiresRecreation -> ResourceTargetDefinition)
-> Lens
ResourceTargetDefinition
ResourceTargetDefinition
(Maybe RequiresRecreation)
(Maybe 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)
resourceTargetDefinition_name :: Lens.Lens' ResourceTargetDefinition (Prelude.Maybe Prelude.Text)
resourceTargetDefinition_name :: (Maybe Text -> f (Maybe Text))
-> ResourceTargetDefinition -> f ResourceTargetDefinition
resourceTargetDefinition_name = (ResourceTargetDefinition -> Maybe Text)
-> (ResourceTargetDefinition
-> Maybe Text -> ResourceTargetDefinition)
-> Lens
ResourceTargetDefinition
ResourceTargetDefinition
(Maybe Text)
(Maybe Text)
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)
instance Core.FromXML ResourceTargetDefinition where
parseXML :: [Node] -> Either String ResourceTargetDefinition
parseXML [Node]
x =
Maybe ResourceAttribute
-> Maybe RequiresRecreation
-> Maybe Text
-> ResourceTargetDefinition
ResourceTargetDefinition'
(Maybe ResourceAttribute
-> Maybe RequiresRecreation
-> Maybe Text
-> ResourceTargetDefinition)
-> Either String (Maybe ResourceAttribute)
-> Either
String
(Maybe RequiresRecreation
-> Maybe Text -> ResourceTargetDefinition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ResourceAttribute)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Attribute")
Either
String
(Maybe RequiresRecreation
-> Maybe Text -> ResourceTargetDefinition)
-> Either String (Maybe RequiresRecreation)
-> Either String (Maybe Text -> ResourceTargetDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe RequiresRecreation)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequiresRecreation")
Either String (Maybe Text -> ResourceTargetDefinition)
-> Either String (Maybe Text)
-> Either String ResourceTargetDefinition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Name")
instance Prelude.Hashable ResourceTargetDefinition
instance Prelude.NFData ResourceTargetDefinition