{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudFormation.Types.ResourceChange
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFormation.Types.ResourceChange where

import Amazonka.CloudFormation.Types.ChangeAction
import Amazonka.CloudFormation.Types.ModuleInfo
import Amazonka.CloudFormation.Types.Replacement
import Amazonka.CloudFormation.Types.ResourceAttribute
import Amazonka.CloudFormation.Types.ResourceChangeDetail
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The @ResourceChange@ structure describes the resource and the action
-- that CloudFormation will perform on it if you execute this change set.
--
-- /See:/ 'newResourceChange' smart constructor.
data ResourceChange = ResourceChange'
  { -- | The resource\'s logical ID, which is defined in the stack\'s template.
    ResourceChange -> Maybe Text
logicalResourceId :: Prelude.Maybe Prelude.Text,
    -- | The resource\'s physical ID (resource name). Resources that you are
    -- adding don\'t have physical IDs because they haven\'t been created.
    ResourceChange -> Maybe Text
physicalResourceId :: Prelude.Maybe Prelude.Text,
    -- | The type of CloudFormation resource, such as @AWS::S3::Bucket@.
    ResourceChange -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | The action that CloudFormation takes on the resource, such as @Add@
    -- (adds a new resource), @Modify@ (changes a resource), @Remove@ (deletes
    -- a resource), @Import@ (imports a resource), or @Dynamic@ (exact action
    -- for the resource cannot be determined).
    ResourceChange -> Maybe ChangeAction
action :: Prelude.Maybe ChangeAction,
    -- | The change set ID of the nested change set.
    ResourceChange -> Maybe Text
changeSetId :: Prelude.Maybe Prelude.Text,
    -- | Contains information about the module from which the resource was
    -- created, if the resource was created from a module included in the stack
    -- template.
    ResourceChange -> Maybe ModuleInfo
moduleInfo :: Prelude.Maybe ModuleInfo,
    -- | For the @Modify@ action, indicates which resource attribute is
    -- triggering this update, such as a change in the resource attribute\'s
    -- @Metadata@, @Properties@, or @Tags@.
    ResourceChange -> Maybe [ResourceAttribute]
scope :: Prelude.Maybe [ResourceAttribute],
    -- | For the @Modify@ action, a list of @ResourceChangeDetail@ structures
    -- that describes the changes that CloudFormation will make to the
    -- resource.
    ResourceChange -> Maybe [ResourceChangeDetail]
details :: Prelude.Maybe [ResourceChangeDetail],
    -- | For the @Modify@ action, indicates whether CloudFormation will replace
    -- the resource by creating a new one and deleting the old one. This value
    -- depends on the value of the @RequiresRecreation@ property in the
    -- @ResourceTargetDefinition@ structure. For example, if the
    -- @RequiresRecreation@ field is @Always@ and the @Evaluation@ field is
    -- @Static@, @Replacement@ is @True@. If the @RequiresRecreation@ field is
    -- @Always@ and the @Evaluation@ field is @Dynamic@, @Replacement@ is
    -- @Conditionally@.
    --
    -- If you have multiple changes with different @RequiresRecreation@ values,
    -- the @Replacement@ value depends on the change with the most impact. A
    -- @RequiresRecreation@ value of @Always@ has the most impact, followed by
    -- @Conditionally@, and then @Never@.
    ResourceChange -> Maybe Replacement
replacement :: Prelude.Maybe Replacement
  }
  deriving (ResourceChange -> ResourceChange -> Bool
(ResourceChange -> ResourceChange -> Bool)
-> (ResourceChange -> ResourceChange -> Bool) -> Eq ResourceChange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceChange -> ResourceChange -> Bool
$c/= :: ResourceChange -> ResourceChange -> Bool
== :: ResourceChange -> ResourceChange -> Bool
$c== :: ResourceChange -> ResourceChange -> Bool
Prelude.Eq, ReadPrec [ResourceChange]
ReadPrec ResourceChange
Int -> ReadS ResourceChange
ReadS [ResourceChange]
(Int -> ReadS ResourceChange)
-> ReadS [ResourceChange]
-> ReadPrec ResourceChange
-> ReadPrec [ResourceChange]
-> Read ResourceChange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceChange]
$creadListPrec :: ReadPrec [ResourceChange]
readPrec :: ReadPrec ResourceChange
$creadPrec :: ReadPrec ResourceChange
readList :: ReadS [ResourceChange]
$creadList :: ReadS [ResourceChange]
readsPrec :: Int -> ReadS ResourceChange
$creadsPrec :: Int -> ReadS ResourceChange
Prelude.Read, Int -> ResourceChange -> ShowS
[ResourceChange] -> ShowS
ResourceChange -> String
(Int -> ResourceChange -> ShowS)
-> (ResourceChange -> String)
-> ([ResourceChange] -> ShowS)
-> Show ResourceChange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceChange] -> ShowS
$cshowList :: [ResourceChange] -> ShowS
show :: ResourceChange -> String
$cshow :: ResourceChange -> String
showsPrec :: Int -> ResourceChange -> ShowS
$cshowsPrec :: Int -> ResourceChange -> ShowS
Prelude.Show, (forall x. ResourceChange -> Rep ResourceChange x)
-> (forall x. Rep ResourceChange x -> ResourceChange)
-> Generic ResourceChange
forall x. Rep ResourceChange x -> ResourceChange
forall x. ResourceChange -> Rep ResourceChange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceChange x -> ResourceChange
$cfrom :: forall x. ResourceChange -> Rep ResourceChange x
Prelude.Generic)

-- |
-- Create a value of 'ResourceChange' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'logicalResourceId', 'resourceChange_logicalResourceId' - The resource\'s logical ID, which is defined in the stack\'s template.
--
-- 'physicalResourceId', 'resourceChange_physicalResourceId' - The resource\'s physical ID (resource name). Resources that you are
-- adding don\'t have physical IDs because they haven\'t been created.
--
-- 'resourceType', 'resourceChange_resourceType' - The type of CloudFormation resource, such as @AWS::S3::Bucket@.
--
-- 'action', 'resourceChange_action' - The action that CloudFormation takes on the resource, such as @Add@
-- (adds a new resource), @Modify@ (changes a resource), @Remove@ (deletes
-- a resource), @Import@ (imports a resource), or @Dynamic@ (exact action
-- for the resource cannot be determined).
--
-- 'changeSetId', 'resourceChange_changeSetId' - The change set ID of the nested change set.
--
-- 'moduleInfo', 'resourceChange_moduleInfo' - Contains information about the module from which the resource was
-- created, if the resource was created from a module included in the stack
-- template.
--
-- 'scope', 'resourceChange_scope' - For the @Modify@ action, indicates which resource attribute is
-- triggering this update, such as a change in the resource attribute\'s
-- @Metadata@, @Properties@, or @Tags@.
--
-- 'details', 'resourceChange_details' - For the @Modify@ action, a list of @ResourceChangeDetail@ structures
-- that describes the changes that CloudFormation will make to the
-- resource.
--
-- 'replacement', 'resourceChange_replacement' - For the @Modify@ action, indicates whether CloudFormation will replace
-- the resource by creating a new one and deleting the old one. This value
-- depends on the value of the @RequiresRecreation@ property in the
-- @ResourceTargetDefinition@ structure. For example, if the
-- @RequiresRecreation@ field is @Always@ and the @Evaluation@ field is
-- @Static@, @Replacement@ is @True@. If the @RequiresRecreation@ field is
-- @Always@ and the @Evaluation@ field is @Dynamic@, @Replacement@ is
-- @Conditionally@.
--
-- If you have multiple changes with different @RequiresRecreation@ values,
-- the @Replacement@ value depends on the change with the most impact. A
-- @RequiresRecreation@ value of @Always@ has the most impact, followed by
-- @Conditionally@, and then @Never@.
newResourceChange ::
  ResourceChange
newResourceChange :: ResourceChange
newResourceChange =
  ResourceChange' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ChangeAction
-> Maybe Text
-> Maybe ModuleInfo
-> Maybe [ResourceAttribute]
-> Maybe [ResourceChangeDetail]
-> Maybe Replacement
-> ResourceChange
ResourceChange'
    { $sel:logicalResourceId:ResourceChange' :: Maybe Text
logicalResourceId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:physicalResourceId:ResourceChange' :: Maybe Text
physicalResourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:ResourceChange' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:action:ResourceChange' :: Maybe ChangeAction
action = Maybe ChangeAction
forall a. Maybe a
Prelude.Nothing,
      $sel:changeSetId:ResourceChange' :: Maybe Text
changeSetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:moduleInfo:ResourceChange' :: Maybe ModuleInfo
moduleInfo = Maybe ModuleInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:scope:ResourceChange' :: Maybe [ResourceAttribute]
scope = Maybe [ResourceAttribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:details:ResourceChange' :: Maybe [ResourceChangeDetail]
details = Maybe [ResourceChangeDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:replacement:ResourceChange' :: Maybe Replacement
replacement = Maybe Replacement
forall a. Maybe a
Prelude.Nothing
    }

-- | The resource\'s logical ID, which is defined in the stack\'s template.
resourceChange_logicalResourceId :: Lens.Lens' ResourceChange (Prelude.Maybe Prelude.Text)
resourceChange_logicalResourceId :: (Maybe Text -> f (Maybe Text))
-> ResourceChange -> f ResourceChange
resourceChange_logicalResourceId = (ResourceChange -> Maybe Text)
-> (ResourceChange -> Maybe Text -> ResourceChange)
-> Lens ResourceChange ResourceChange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe Text
logicalResourceId :: Maybe Text
$sel:logicalResourceId:ResourceChange' :: ResourceChange -> Maybe Text
logicalResourceId} -> Maybe Text
logicalResourceId) (\s :: ResourceChange
s@ResourceChange' {} Maybe Text
a -> ResourceChange
s {$sel:logicalResourceId:ResourceChange' :: Maybe Text
logicalResourceId = Maybe Text
a} :: ResourceChange)

-- | The resource\'s physical ID (resource name). Resources that you are
-- adding don\'t have physical IDs because they haven\'t been created.
resourceChange_physicalResourceId :: Lens.Lens' ResourceChange (Prelude.Maybe Prelude.Text)
resourceChange_physicalResourceId :: (Maybe Text -> f (Maybe Text))
-> ResourceChange -> f ResourceChange
resourceChange_physicalResourceId = (ResourceChange -> Maybe Text)
-> (ResourceChange -> Maybe Text -> ResourceChange)
-> Lens ResourceChange ResourceChange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe Text
physicalResourceId :: Maybe Text
$sel:physicalResourceId:ResourceChange' :: ResourceChange -> Maybe Text
physicalResourceId} -> Maybe Text
physicalResourceId) (\s :: ResourceChange
s@ResourceChange' {} Maybe Text
a -> ResourceChange
s {$sel:physicalResourceId:ResourceChange' :: Maybe Text
physicalResourceId = Maybe Text
a} :: ResourceChange)

-- | The type of CloudFormation resource, such as @AWS::S3::Bucket@.
resourceChange_resourceType :: Lens.Lens' ResourceChange (Prelude.Maybe Prelude.Text)
resourceChange_resourceType :: (Maybe Text -> f (Maybe Text))
-> ResourceChange -> f ResourceChange
resourceChange_resourceType = (ResourceChange -> Maybe Text)
-> (ResourceChange -> Maybe Text -> ResourceChange)
-> Lens ResourceChange ResourceChange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:ResourceChange' :: ResourceChange -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: ResourceChange
s@ResourceChange' {} Maybe Text
a -> ResourceChange
s {$sel:resourceType:ResourceChange' :: Maybe Text
resourceType = Maybe Text
a} :: ResourceChange)

-- | The action that CloudFormation takes on the resource, such as @Add@
-- (adds a new resource), @Modify@ (changes a resource), @Remove@ (deletes
-- a resource), @Import@ (imports a resource), or @Dynamic@ (exact action
-- for the resource cannot be determined).
resourceChange_action :: Lens.Lens' ResourceChange (Prelude.Maybe ChangeAction)
resourceChange_action :: (Maybe ChangeAction -> f (Maybe ChangeAction))
-> ResourceChange -> f ResourceChange
resourceChange_action = (ResourceChange -> Maybe ChangeAction)
-> (ResourceChange -> Maybe ChangeAction -> ResourceChange)
-> Lens
     ResourceChange
     ResourceChange
     (Maybe ChangeAction)
     (Maybe ChangeAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe ChangeAction
action :: Maybe ChangeAction
$sel:action:ResourceChange' :: ResourceChange -> Maybe ChangeAction
action} -> Maybe ChangeAction
action) (\s :: ResourceChange
s@ResourceChange' {} Maybe ChangeAction
a -> ResourceChange
s {$sel:action:ResourceChange' :: Maybe ChangeAction
action = Maybe ChangeAction
a} :: ResourceChange)

-- | The change set ID of the nested change set.
resourceChange_changeSetId :: Lens.Lens' ResourceChange (Prelude.Maybe Prelude.Text)
resourceChange_changeSetId :: (Maybe Text -> f (Maybe Text))
-> ResourceChange -> f ResourceChange
resourceChange_changeSetId = (ResourceChange -> Maybe Text)
-> (ResourceChange -> Maybe Text -> ResourceChange)
-> Lens ResourceChange ResourceChange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe Text
changeSetId :: Maybe Text
$sel:changeSetId:ResourceChange' :: ResourceChange -> Maybe Text
changeSetId} -> Maybe Text
changeSetId) (\s :: ResourceChange
s@ResourceChange' {} Maybe Text
a -> ResourceChange
s {$sel:changeSetId:ResourceChange' :: Maybe Text
changeSetId = Maybe Text
a} :: ResourceChange)

-- | Contains information about the module from which the resource was
-- created, if the resource was created from a module included in the stack
-- template.
resourceChange_moduleInfo :: Lens.Lens' ResourceChange (Prelude.Maybe ModuleInfo)
resourceChange_moduleInfo :: (Maybe ModuleInfo -> f (Maybe ModuleInfo))
-> ResourceChange -> f ResourceChange
resourceChange_moduleInfo = (ResourceChange -> Maybe ModuleInfo)
-> (ResourceChange -> Maybe ModuleInfo -> ResourceChange)
-> Lens
     ResourceChange ResourceChange (Maybe ModuleInfo) (Maybe ModuleInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe ModuleInfo
moduleInfo :: Maybe ModuleInfo
$sel:moduleInfo:ResourceChange' :: ResourceChange -> Maybe ModuleInfo
moduleInfo} -> Maybe ModuleInfo
moduleInfo) (\s :: ResourceChange
s@ResourceChange' {} Maybe ModuleInfo
a -> ResourceChange
s {$sel:moduleInfo:ResourceChange' :: Maybe ModuleInfo
moduleInfo = Maybe ModuleInfo
a} :: ResourceChange)

-- | For the @Modify@ action, indicates which resource attribute is
-- triggering this update, such as a change in the resource attribute\'s
-- @Metadata@, @Properties@, or @Tags@.
resourceChange_scope :: Lens.Lens' ResourceChange (Prelude.Maybe [ResourceAttribute])
resourceChange_scope :: (Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> ResourceChange -> f ResourceChange
resourceChange_scope = (ResourceChange -> Maybe [ResourceAttribute])
-> (ResourceChange -> Maybe [ResourceAttribute] -> ResourceChange)
-> Lens
     ResourceChange
     ResourceChange
     (Maybe [ResourceAttribute])
     (Maybe [ResourceAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe [ResourceAttribute]
scope :: Maybe [ResourceAttribute]
$sel:scope:ResourceChange' :: ResourceChange -> Maybe [ResourceAttribute]
scope} -> Maybe [ResourceAttribute]
scope) (\s :: ResourceChange
s@ResourceChange' {} Maybe [ResourceAttribute]
a -> ResourceChange
s {$sel:scope:ResourceChange' :: Maybe [ResourceAttribute]
scope = Maybe [ResourceAttribute]
a} :: ResourceChange) ((Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
 -> ResourceChange -> f ResourceChange)
-> ((Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
    -> Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> (Maybe [ResourceAttribute] -> f (Maybe [ResourceAttribute]))
-> ResourceChange
-> f ResourceChange
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourceAttribute]
  [ResourceAttribute]
  [ResourceAttribute]
  [ResourceAttribute]
-> Iso
     (Maybe [ResourceAttribute])
     (Maybe [ResourceAttribute])
     (Maybe [ResourceAttribute])
     (Maybe [ResourceAttribute])
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 AnIso
  [ResourceAttribute]
  [ResourceAttribute]
  [ResourceAttribute]
  [ResourceAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For the @Modify@ action, a list of @ResourceChangeDetail@ structures
-- that describes the changes that CloudFormation will make to the
-- resource.
resourceChange_details :: Lens.Lens' ResourceChange (Prelude.Maybe [ResourceChangeDetail])
resourceChange_details :: (Maybe [ResourceChangeDetail] -> f (Maybe [ResourceChangeDetail]))
-> ResourceChange -> f ResourceChange
resourceChange_details = (ResourceChange -> Maybe [ResourceChangeDetail])
-> (ResourceChange
    -> Maybe [ResourceChangeDetail] -> ResourceChange)
-> Lens
     ResourceChange
     ResourceChange
     (Maybe [ResourceChangeDetail])
     (Maybe [ResourceChangeDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe [ResourceChangeDetail]
details :: Maybe [ResourceChangeDetail]
$sel:details:ResourceChange' :: ResourceChange -> Maybe [ResourceChangeDetail]
details} -> Maybe [ResourceChangeDetail]
details) (\s :: ResourceChange
s@ResourceChange' {} Maybe [ResourceChangeDetail]
a -> ResourceChange
s {$sel:details:ResourceChange' :: Maybe [ResourceChangeDetail]
details = Maybe [ResourceChangeDetail]
a} :: ResourceChange) ((Maybe [ResourceChangeDetail] -> f (Maybe [ResourceChangeDetail]))
 -> ResourceChange -> f ResourceChange)
-> ((Maybe [ResourceChangeDetail]
     -> f (Maybe [ResourceChangeDetail]))
    -> Maybe [ResourceChangeDetail]
    -> f (Maybe [ResourceChangeDetail]))
-> (Maybe [ResourceChangeDetail]
    -> f (Maybe [ResourceChangeDetail]))
-> ResourceChange
-> f ResourceChange
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourceChangeDetail]
  [ResourceChangeDetail]
  [ResourceChangeDetail]
  [ResourceChangeDetail]
-> Iso
     (Maybe [ResourceChangeDetail])
     (Maybe [ResourceChangeDetail])
     (Maybe [ResourceChangeDetail])
     (Maybe [ResourceChangeDetail])
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 AnIso
  [ResourceChangeDetail]
  [ResourceChangeDetail]
  [ResourceChangeDetail]
  [ResourceChangeDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For the @Modify@ action, indicates whether CloudFormation will replace
-- the resource by creating a new one and deleting the old one. This value
-- depends on the value of the @RequiresRecreation@ property in the
-- @ResourceTargetDefinition@ structure. For example, if the
-- @RequiresRecreation@ field is @Always@ and the @Evaluation@ field is
-- @Static@, @Replacement@ is @True@. If the @RequiresRecreation@ field is
-- @Always@ and the @Evaluation@ field is @Dynamic@, @Replacement@ is
-- @Conditionally@.
--
-- If you have multiple changes with different @RequiresRecreation@ values,
-- the @Replacement@ value depends on the change with the most impact. A
-- @RequiresRecreation@ value of @Always@ has the most impact, followed by
-- @Conditionally@, and then @Never@.
resourceChange_replacement :: Lens.Lens' ResourceChange (Prelude.Maybe Replacement)
resourceChange_replacement :: (Maybe Replacement -> f (Maybe Replacement))
-> ResourceChange -> f ResourceChange
resourceChange_replacement = (ResourceChange -> Maybe Replacement)
-> (ResourceChange -> Maybe Replacement -> ResourceChange)
-> Lens
     ResourceChange
     ResourceChange
     (Maybe Replacement)
     (Maybe Replacement)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceChange' {Maybe Replacement
replacement :: Maybe Replacement
$sel:replacement:ResourceChange' :: ResourceChange -> Maybe Replacement
replacement} -> Maybe Replacement
replacement) (\s :: ResourceChange
s@ResourceChange' {} Maybe Replacement
a -> ResourceChange
s {$sel:replacement:ResourceChange' :: Maybe Replacement
replacement = Maybe Replacement
a} :: ResourceChange)

instance Core.FromXML ResourceChange where
  parseXML :: [Node] -> Either String ResourceChange
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ChangeAction
-> Maybe Text
-> Maybe ModuleInfo
-> Maybe [ResourceAttribute]
-> Maybe [ResourceChangeDetail]
-> Maybe Replacement
-> ResourceChange
ResourceChange'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ChangeAction
 -> Maybe Text
 -> Maybe ModuleInfo
 -> Maybe [ResourceAttribute]
 -> Maybe [ResourceChangeDetail]
 -> Maybe Replacement
 -> ResourceChange)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ChangeAction
      -> Maybe Text
      -> Maybe ModuleInfo
      -> Maybe [ResourceAttribute]
      -> Maybe [ResourceChangeDetail]
      -> Maybe Replacement
      -> ResourceChange)
forall (f :: * -> *) a b. Functor 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
"LogicalResourceId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ChangeAction
   -> Maybe Text
   -> Maybe ModuleInfo
   -> Maybe [ResourceAttribute]
   -> Maybe [ResourceChangeDetail]
   -> Maybe Replacement
   -> ResourceChange)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ChangeAction
      -> Maybe Text
      -> Maybe ModuleInfo
      -> Maybe [ResourceAttribute]
      -> Maybe [ResourceChangeDetail]
      -> Maybe Replacement
      -> ResourceChange)
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
"PhysicalResourceId")
      Either
  String
  (Maybe Text
   -> Maybe ChangeAction
   -> Maybe Text
   -> Maybe ModuleInfo
   -> Maybe [ResourceAttribute]
   -> Maybe [ResourceChangeDetail]
   -> Maybe Replacement
   -> ResourceChange)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ChangeAction
      -> Maybe Text
      -> Maybe ModuleInfo
      -> Maybe [ResourceAttribute]
      -> Maybe [ResourceChangeDetail]
      -> Maybe Replacement
      -> ResourceChange)
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
"ResourceType")
      Either
  String
  (Maybe ChangeAction
   -> Maybe Text
   -> Maybe ModuleInfo
   -> Maybe [ResourceAttribute]
   -> Maybe [ResourceChangeDetail]
   -> Maybe Replacement
   -> ResourceChange)
-> Either String (Maybe ChangeAction)
-> Either
     String
     (Maybe Text
      -> Maybe ModuleInfo
      -> Maybe [ResourceAttribute]
      -> Maybe [ResourceChangeDetail]
      -> Maybe Replacement
      -> ResourceChange)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ChangeAction)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Action")
      Either
  String
  (Maybe Text
   -> Maybe ModuleInfo
   -> Maybe [ResourceAttribute]
   -> Maybe [ResourceChangeDetail]
   -> Maybe Replacement
   -> ResourceChange)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ModuleInfo
      -> Maybe [ResourceAttribute]
      -> Maybe [ResourceChangeDetail]
      -> Maybe Replacement
      -> ResourceChange)
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
"ChangeSetId")
      Either
  String
  (Maybe ModuleInfo
   -> Maybe [ResourceAttribute]
   -> Maybe [ResourceChangeDetail]
   -> Maybe Replacement
   -> ResourceChange)
-> Either String (Maybe ModuleInfo)
-> Either
     String
     (Maybe [ResourceAttribute]
      -> Maybe [ResourceChangeDetail]
      -> Maybe Replacement
      -> ResourceChange)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ModuleInfo)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ModuleInfo")
      Either
  String
  (Maybe [ResourceAttribute]
   -> Maybe [ResourceChangeDetail]
   -> Maybe Replacement
   -> ResourceChange)
-> Either String (Maybe [ResourceAttribute])
-> Either
     String
     (Maybe [ResourceChangeDetail]
      -> Maybe Replacement -> ResourceChange)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Scope" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [ResourceAttribute]))
-> Either String (Maybe [ResourceAttribute])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ResourceAttribute])
-> [Node] -> Either String (Maybe [ResourceAttribute])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ResourceAttribute]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe [ResourceChangeDetail]
   -> Maybe Replacement -> ResourceChange)
-> Either String (Maybe [ResourceChangeDetail])
-> Either String (Maybe Replacement -> ResourceChange)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Details" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [ResourceChangeDetail]))
-> Either String (Maybe [ResourceChangeDetail])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ResourceChangeDetail])
-> [Node] -> Either String (Maybe [ResourceChangeDetail])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ResourceChangeDetail]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either String (Maybe Replacement -> ResourceChange)
-> Either String (Maybe Replacement)
-> Either String ResourceChange
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Replacement)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Replacement")

instance Prelude.Hashable ResourceChange

instance Prelude.NFData ResourceChange