{-# 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.ChangeSetHookResourceTargetDetails
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFormation.Types.ChangeSetHookResourceTargetDetails where

import Amazonka.CloudFormation.Types.ChangeAction
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

-- | Specifies @RESOURCE@ type target details for activated hooks.
--
-- /See:/ 'newChangeSetHookResourceTargetDetails' smart constructor.
data ChangeSetHookResourceTargetDetails = ChangeSetHookResourceTargetDetails'
  { -- | The resource\'s logical ID, which is defined in the stack\'s template.
    ChangeSetHookResourceTargetDetails -> Maybe Text
logicalResourceId :: Prelude.Maybe Prelude.Text,
    -- | Specifies the action of the resource.
    ChangeSetHookResourceTargetDetails -> Maybe ChangeAction
resourceAction :: Prelude.Maybe ChangeAction,
    -- | The type of CloudFormation resource, such as @AWS::S3::Bucket@.
    ChangeSetHookResourceTargetDetails -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text
  }
  deriving (ChangeSetHookResourceTargetDetails
-> ChangeSetHookResourceTargetDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeSetHookResourceTargetDetails
-> ChangeSetHookResourceTargetDetails -> Bool
$c/= :: ChangeSetHookResourceTargetDetails
-> ChangeSetHookResourceTargetDetails -> Bool
== :: ChangeSetHookResourceTargetDetails
-> ChangeSetHookResourceTargetDetails -> Bool
$c== :: ChangeSetHookResourceTargetDetails
-> ChangeSetHookResourceTargetDetails -> Bool
Prelude.Eq, ReadPrec [ChangeSetHookResourceTargetDetails]
ReadPrec ChangeSetHookResourceTargetDetails
Int -> ReadS ChangeSetHookResourceTargetDetails
ReadS [ChangeSetHookResourceTargetDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeSetHookResourceTargetDetails]
$creadListPrec :: ReadPrec [ChangeSetHookResourceTargetDetails]
readPrec :: ReadPrec ChangeSetHookResourceTargetDetails
$creadPrec :: ReadPrec ChangeSetHookResourceTargetDetails
readList :: ReadS [ChangeSetHookResourceTargetDetails]
$creadList :: ReadS [ChangeSetHookResourceTargetDetails]
readsPrec :: Int -> ReadS ChangeSetHookResourceTargetDetails
$creadsPrec :: Int -> ReadS ChangeSetHookResourceTargetDetails
Prelude.Read, Int -> ChangeSetHookResourceTargetDetails -> ShowS
[ChangeSetHookResourceTargetDetails] -> ShowS
ChangeSetHookResourceTargetDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeSetHookResourceTargetDetails] -> ShowS
$cshowList :: [ChangeSetHookResourceTargetDetails] -> ShowS
show :: ChangeSetHookResourceTargetDetails -> String
$cshow :: ChangeSetHookResourceTargetDetails -> String
showsPrec :: Int -> ChangeSetHookResourceTargetDetails -> ShowS
$cshowsPrec :: Int -> ChangeSetHookResourceTargetDetails -> ShowS
Prelude.Show, forall x.
Rep ChangeSetHookResourceTargetDetails x
-> ChangeSetHookResourceTargetDetails
forall x.
ChangeSetHookResourceTargetDetails
-> Rep ChangeSetHookResourceTargetDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChangeSetHookResourceTargetDetails x
-> ChangeSetHookResourceTargetDetails
$cfrom :: forall x.
ChangeSetHookResourceTargetDetails
-> Rep ChangeSetHookResourceTargetDetails x
Prelude.Generic)

-- |
-- Create a value of 'ChangeSetHookResourceTargetDetails' 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', 'changeSetHookResourceTargetDetails_logicalResourceId' - The resource\'s logical ID, which is defined in the stack\'s template.
--
-- 'resourceAction', 'changeSetHookResourceTargetDetails_resourceAction' - Specifies the action of the resource.
--
-- 'resourceType', 'changeSetHookResourceTargetDetails_resourceType' - The type of CloudFormation resource, such as @AWS::S3::Bucket@.
newChangeSetHookResourceTargetDetails ::
  ChangeSetHookResourceTargetDetails
newChangeSetHookResourceTargetDetails :: ChangeSetHookResourceTargetDetails
newChangeSetHookResourceTargetDetails =
  ChangeSetHookResourceTargetDetails'
    { $sel:logicalResourceId:ChangeSetHookResourceTargetDetails' :: Maybe Text
logicalResourceId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:resourceAction:ChangeSetHookResourceTargetDetails' :: Maybe ChangeAction
resourceAction = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:ChangeSetHookResourceTargetDetails' :: Maybe Text
resourceType = forall a. Maybe a
Prelude.Nothing
    }

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

-- | Specifies the action of the resource.
changeSetHookResourceTargetDetails_resourceAction :: Lens.Lens' ChangeSetHookResourceTargetDetails (Prelude.Maybe ChangeAction)
changeSetHookResourceTargetDetails_resourceAction :: Lens' ChangeSetHookResourceTargetDetails (Maybe ChangeAction)
changeSetHookResourceTargetDetails_resourceAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeSetHookResourceTargetDetails' {Maybe ChangeAction
resourceAction :: Maybe ChangeAction
$sel:resourceAction:ChangeSetHookResourceTargetDetails' :: ChangeSetHookResourceTargetDetails -> Maybe ChangeAction
resourceAction} -> Maybe ChangeAction
resourceAction) (\s :: ChangeSetHookResourceTargetDetails
s@ChangeSetHookResourceTargetDetails' {} Maybe ChangeAction
a -> ChangeSetHookResourceTargetDetails
s {$sel:resourceAction:ChangeSetHookResourceTargetDetails' :: Maybe ChangeAction
resourceAction = Maybe ChangeAction
a} :: ChangeSetHookResourceTargetDetails)

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

instance
  Data.FromXML
    ChangeSetHookResourceTargetDetails
  where
  parseXML :: [Node] -> Either String ChangeSetHookResourceTargetDetails
parseXML [Node]
x =
    Maybe Text
-> Maybe ChangeAction
-> Maybe Text
-> ChangeSetHookResourceTargetDetails
ChangeSetHookResourceTargetDetails'
      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
"LogicalResourceId")
      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
"ResourceAction")
      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
"ResourceType")

instance
  Prelude.Hashable
    ChangeSetHookResourceTargetDetails
  where
  hashWithSalt :: Int -> ChangeSetHookResourceTargetDetails -> Int
hashWithSalt
    Int
_salt
    ChangeSetHookResourceTargetDetails' {Maybe Text
Maybe ChangeAction
resourceType :: Maybe Text
resourceAction :: Maybe ChangeAction
logicalResourceId :: Maybe Text
$sel:resourceType:ChangeSetHookResourceTargetDetails' :: ChangeSetHookResourceTargetDetails -> Maybe Text
$sel:resourceAction:ChangeSetHookResourceTargetDetails' :: ChangeSetHookResourceTargetDetails -> Maybe ChangeAction
$sel:logicalResourceId:ChangeSetHookResourceTargetDetails' :: ChangeSetHookResourceTargetDetails -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logicalResourceId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChangeAction
resourceAction
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceType

instance
  Prelude.NFData
    ChangeSetHookResourceTargetDetails
  where
  rnf :: ChangeSetHookResourceTargetDetails -> ()
rnf ChangeSetHookResourceTargetDetails' {Maybe Text
Maybe ChangeAction
resourceType :: Maybe Text
resourceAction :: Maybe ChangeAction
logicalResourceId :: Maybe Text
$sel:resourceType:ChangeSetHookResourceTargetDetails' :: ChangeSetHookResourceTargetDetails -> Maybe Text
$sel:resourceAction:ChangeSetHookResourceTargetDetails' :: ChangeSetHookResourceTargetDetails -> Maybe ChangeAction
$sel:logicalResourceId:ChangeSetHookResourceTargetDetails' :: ChangeSetHookResourceTargetDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logicalResourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChangeAction
resourceAction
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceType