{-# 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.StackInstanceComprehensiveStatus
-- 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.StackInstanceComprehensiveStatus where

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

-- | The detailed status of the stack instance.
--
-- /See:/ 'newStackInstanceComprehensiveStatus' smart constructor.
data StackInstanceComprehensiveStatus = StackInstanceComprehensiveStatus'
  { -- | -   @CANCELLED@: The operation in the specified account and Region has
    --     been canceled. This is either because a user has stopped the stack
    --     set operation, or because the failure tolerance of the stack set
    --     operation has been exceeded.
    --
    -- -   @FAILED@: The operation in the specified account and Region failed.
    --     If the stack set operation fails in enough accounts within a Region,
    --     the failure tolerance for the stack set operation as a whole might
    --     be exceeded.
    --
    -- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
    --     the stack in an unstable state. Stacks in this state are excluded
    --     from further @UpdateStackSet@ operations. You might need to perform
    --     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
    --     @true@, to delete the stack instance, and then delete the stack
    --     manually.
    --
    -- -   @PENDING@: The operation in the specified account and Region has yet
    --     to start.
    --
    -- -   @RUNNING@: The operation in the specified account and Region is
    --     currently in progress.
    --
    -- -   @SUCCEEDED@: The operation in the specified account and Region
    --     completed successfully.
    StackInstanceComprehensiveStatus
-> Maybe StackInstanceDetailedStatus
detailedStatus :: Prelude.Maybe StackInstanceDetailedStatus
  }
  deriving (StackInstanceComprehensiveStatus
-> StackInstanceComprehensiveStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackInstanceComprehensiveStatus
-> StackInstanceComprehensiveStatus -> Bool
$c/= :: StackInstanceComprehensiveStatus
-> StackInstanceComprehensiveStatus -> Bool
== :: StackInstanceComprehensiveStatus
-> StackInstanceComprehensiveStatus -> Bool
$c== :: StackInstanceComprehensiveStatus
-> StackInstanceComprehensiveStatus -> Bool
Prelude.Eq, ReadPrec [StackInstanceComprehensiveStatus]
ReadPrec StackInstanceComprehensiveStatus
Int -> ReadS StackInstanceComprehensiveStatus
ReadS [StackInstanceComprehensiveStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackInstanceComprehensiveStatus]
$creadListPrec :: ReadPrec [StackInstanceComprehensiveStatus]
readPrec :: ReadPrec StackInstanceComprehensiveStatus
$creadPrec :: ReadPrec StackInstanceComprehensiveStatus
readList :: ReadS [StackInstanceComprehensiveStatus]
$creadList :: ReadS [StackInstanceComprehensiveStatus]
readsPrec :: Int -> ReadS StackInstanceComprehensiveStatus
$creadsPrec :: Int -> ReadS StackInstanceComprehensiveStatus
Prelude.Read, Int -> StackInstanceComprehensiveStatus -> ShowS
[StackInstanceComprehensiveStatus] -> ShowS
StackInstanceComprehensiveStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackInstanceComprehensiveStatus] -> ShowS
$cshowList :: [StackInstanceComprehensiveStatus] -> ShowS
show :: StackInstanceComprehensiveStatus -> String
$cshow :: StackInstanceComprehensiveStatus -> String
showsPrec :: Int -> StackInstanceComprehensiveStatus -> ShowS
$cshowsPrec :: Int -> StackInstanceComprehensiveStatus -> ShowS
Prelude.Show, forall x.
Rep StackInstanceComprehensiveStatus x
-> StackInstanceComprehensiveStatus
forall x.
StackInstanceComprehensiveStatus
-> Rep StackInstanceComprehensiveStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StackInstanceComprehensiveStatus x
-> StackInstanceComprehensiveStatus
$cfrom :: forall x.
StackInstanceComprehensiveStatus
-> Rep StackInstanceComprehensiveStatus x
Prelude.Generic)

-- |
-- Create a value of 'StackInstanceComprehensiveStatus' 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:
--
-- 'detailedStatus', 'stackInstanceComprehensiveStatus_detailedStatus' - -   @CANCELLED@: The operation in the specified account and Region has
--     been canceled. This is either because a user has stopped the stack
--     set operation, or because the failure tolerance of the stack set
--     operation has been exceeded.
--
-- -   @FAILED@: The operation in the specified account and Region failed.
--     If the stack set operation fails in enough accounts within a Region,
--     the failure tolerance for the stack set operation as a whole might
--     be exceeded.
--
-- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
--     the stack in an unstable state. Stacks in this state are excluded
--     from further @UpdateStackSet@ operations. You might need to perform
--     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
--     @true@, to delete the stack instance, and then delete the stack
--     manually.
--
-- -   @PENDING@: The operation in the specified account and Region has yet
--     to start.
--
-- -   @RUNNING@: The operation in the specified account and Region is
--     currently in progress.
--
-- -   @SUCCEEDED@: The operation in the specified account and Region
--     completed successfully.
newStackInstanceComprehensiveStatus ::
  StackInstanceComprehensiveStatus
newStackInstanceComprehensiveStatus :: StackInstanceComprehensiveStatus
newStackInstanceComprehensiveStatus =
  StackInstanceComprehensiveStatus'
    { $sel:detailedStatus:StackInstanceComprehensiveStatus' :: Maybe StackInstanceDetailedStatus
detailedStatus =
        forall a. Maybe a
Prelude.Nothing
    }

-- | -   @CANCELLED@: The operation in the specified account and Region has
--     been canceled. This is either because a user has stopped the stack
--     set operation, or because the failure tolerance of the stack set
--     operation has been exceeded.
--
-- -   @FAILED@: The operation in the specified account and Region failed.
--     If the stack set operation fails in enough accounts within a Region,
--     the failure tolerance for the stack set operation as a whole might
--     be exceeded.
--
-- -   @INOPERABLE@: A @DeleteStackInstances@ operation has failed and left
--     the stack in an unstable state. Stacks in this state are excluded
--     from further @UpdateStackSet@ operations. You might need to perform
--     a @DeleteStackInstances@ operation, with @RetainStacks@ set to
--     @true@, to delete the stack instance, and then delete the stack
--     manually.
--
-- -   @PENDING@: The operation in the specified account and Region has yet
--     to start.
--
-- -   @RUNNING@: The operation in the specified account and Region is
--     currently in progress.
--
-- -   @SUCCEEDED@: The operation in the specified account and Region
--     completed successfully.
stackInstanceComprehensiveStatus_detailedStatus :: Lens.Lens' StackInstanceComprehensiveStatus (Prelude.Maybe StackInstanceDetailedStatus)
stackInstanceComprehensiveStatus_detailedStatus :: Lens'
  StackInstanceComprehensiveStatus
  (Maybe StackInstanceDetailedStatus)
stackInstanceComprehensiveStatus_detailedStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackInstanceComprehensiveStatus' {Maybe StackInstanceDetailedStatus
detailedStatus :: Maybe StackInstanceDetailedStatus
$sel:detailedStatus:StackInstanceComprehensiveStatus' :: StackInstanceComprehensiveStatus
-> Maybe StackInstanceDetailedStatus
detailedStatus} -> Maybe StackInstanceDetailedStatus
detailedStatus) (\s :: StackInstanceComprehensiveStatus
s@StackInstanceComprehensiveStatus' {} Maybe StackInstanceDetailedStatus
a -> StackInstanceComprehensiveStatus
s {$sel:detailedStatus:StackInstanceComprehensiveStatus' :: Maybe StackInstanceDetailedStatus
detailedStatus = Maybe StackInstanceDetailedStatus
a} :: StackInstanceComprehensiveStatus)

instance
  Data.FromXML
    StackInstanceComprehensiveStatus
  where
  parseXML :: [Node] -> Either String StackInstanceComprehensiveStatus
parseXML [Node]
x =
    Maybe StackInstanceDetailedStatus
-> StackInstanceComprehensiveStatus
StackInstanceComprehensiveStatus'
      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
"DetailedStatus")

instance
  Prelude.Hashable
    StackInstanceComprehensiveStatus
  where
  hashWithSalt :: Int -> StackInstanceComprehensiveStatus -> Int
hashWithSalt
    Int
_salt
    StackInstanceComprehensiveStatus' {Maybe StackInstanceDetailedStatus
detailedStatus :: Maybe StackInstanceDetailedStatus
$sel:detailedStatus:StackInstanceComprehensiveStatus' :: StackInstanceComprehensiveStatus
-> Maybe StackInstanceDetailedStatus
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StackInstanceDetailedStatus
detailedStatus

instance
  Prelude.NFData
    StackInstanceComprehensiveStatus
  where
  rnf :: StackInstanceComprehensiveStatus -> ()
rnf StackInstanceComprehensiveStatus' {Maybe StackInstanceDetailedStatus
detailedStatus :: Maybe StackInstanceDetailedStatus
$sel:detailedStatus:StackInstanceComprehensiveStatus' :: StackInstanceComprehensiveStatus
-> Maybe StackInstanceDetailedStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe StackInstanceDetailedStatus
detailedStatus