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

import Amazonka.CloudFormation.Types.StackInstanceDetailedStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 cancelled. 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
(StackInstanceComprehensiveStatus
 -> StackInstanceComprehensiveStatus -> Bool)
-> (StackInstanceComprehensiveStatus
    -> StackInstanceComprehensiveStatus -> Bool)
-> Eq StackInstanceComprehensiveStatus
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]
(Int -> ReadS StackInstanceComprehensiveStatus)
-> ReadS [StackInstanceComprehensiveStatus]
-> ReadPrec StackInstanceComprehensiveStatus
-> ReadPrec [StackInstanceComprehensiveStatus]
-> Read 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
(Int -> StackInstanceComprehensiveStatus -> ShowS)
-> (StackInstanceComprehensiveStatus -> String)
-> ([StackInstanceComprehensiveStatus] -> ShowS)
-> Show StackInstanceComprehensiveStatus
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.
 StackInstanceComprehensiveStatus
 -> Rep StackInstanceComprehensiveStatus x)
-> (forall x.
    Rep StackInstanceComprehensiveStatus x
    -> StackInstanceComprehensiveStatus)
-> Generic StackInstanceComprehensiveStatus
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 cancelled. 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' :: Maybe StackInstanceDetailedStatus
-> StackInstanceComprehensiveStatus
StackInstanceComprehensiveStatus'
    { $sel:detailedStatus:StackInstanceComprehensiveStatus' :: Maybe StackInstanceDetailedStatus
detailedStatus =
        Maybe StackInstanceDetailedStatus
forall a. Maybe a
Prelude.Nothing
    }

-- | -   @CANCELLED@: The operation in the specified account and Region has
--     been cancelled. 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 :: (Maybe StackInstanceDetailedStatus
 -> f (Maybe StackInstanceDetailedStatus))
-> StackInstanceComprehensiveStatus
-> f StackInstanceComprehensiveStatus
stackInstanceComprehensiveStatus_detailedStatus = (StackInstanceComprehensiveStatus
 -> Maybe StackInstanceDetailedStatus)
-> (StackInstanceComprehensiveStatus
    -> Maybe StackInstanceDetailedStatus
    -> StackInstanceComprehensiveStatus)
-> Lens
     StackInstanceComprehensiveStatus
     StackInstanceComprehensiveStatus
     (Maybe StackInstanceDetailedStatus)
     (Maybe StackInstanceDetailedStatus)
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
  Core.FromXML
    StackInstanceComprehensiveStatus
  where
  parseXML :: [Node] -> Either String StackInstanceComprehensiveStatus
parseXML [Node]
x =
    Maybe StackInstanceDetailedStatus
-> StackInstanceComprehensiveStatus
StackInstanceComprehensiveStatus'
      (Maybe StackInstanceDetailedStatus
 -> StackInstanceComprehensiveStatus)
-> Either String (Maybe StackInstanceDetailedStatus)
-> Either String StackInstanceComprehensiveStatus
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe StackInstanceDetailedStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DetailedStatus")

instance
  Prelude.Hashable
    StackInstanceComprehensiveStatus

instance
  Prelude.NFData
    StackInstanceComprehensiveStatus