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

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

-- | Detailed information about the StackSet operation.
--
-- /See:/ 'newStackSetOperationStatusDetails' smart constructor.
data StackSetOperationStatusDetails = StackSetOperationStatusDetails'
  { -- | The number of stack instances for which the StackSet operation failed.
    StackSetOperationStatusDetails -> Maybe Natural
failedStackInstancesCount :: Prelude.Maybe Prelude.Natural
  }
  deriving (StackSetOperationStatusDetails
-> StackSetOperationStatusDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackSetOperationStatusDetails
-> StackSetOperationStatusDetails -> Bool
$c/= :: StackSetOperationStatusDetails
-> StackSetOperationStatusDetails -> Bool
== :: StackSetOperationStatusDetails
-> StackSetOperationStatusDetails -> Bool
$c== :: StackSetOperationStatusDetails
-> StackSetOperationStatusDetails -> Bool
Prelude.Eq, ReadPrec [StackSetOperationStatusDetails]
ReadPrec StackSetOperationStatusDetails
Int -> ReadS StackSetOperationStatusDetails
ReadS [StackSetOperationStatusDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackSetOperationStatusDetails]
$creadListPrec :: ReadPrec [StackSetOperationStatusDetails]
readPrec :: ReadPrec StackSetOperationStatusDetails
$creadPrec :: ReadPrec StackSetOperationStatusDetails
readList :: ReadS [StackSetOperationStatusDetails]
$creadList :: ReadS [StackSetOperationStatusDetails]
readsPrec :: Int -> ReadS StackSetOperationStatusDetails
$creadsPrec :: Int -> ReadS StackSetOperationStatusDetails
Prelude.Read, Int -> StackSetOperationStatusDetails -> ShowS
[StackSetOperationStatusDetails] -> ShowS
StackSetOperationStatusDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackSetOperationStatusDetails] -> ShowS
$cshowList :: [StackSetOperationStatusDetails] -> ShowS
show :: StackSetOperationStatusDetails -> String
$cshow :: StackSetOperationStatusDetails -> String
showsPrec :: Int -> StackSetOperationStatusDetails -> ShowS
$cshowsPrec :: Int -> StackSetOperationStatusDetails -> ShowS
Prelude.Show, forall x.
Rep StackSetOperationStatusDetails x
-> StackSetOperationStatusDetails
forall x.
StackSetOperationStatusDetails
-> Rep StackSetOperationStatusDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StackSetOperationStatusDetails x
-> StackSetOperationStatusDetails
$cfrom :: forall x.
StackSetOperationStatusDetails
-> Rep StackSetOperationStatusDetails x
Prelude.Generic)

-- |
-- Create a value of 'StackSetOperationStatusDetails' 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:
--
-- 'failedStackInstancesCount', 'stackSetOperationStatusDetails_failedStackInstancesCount' - The number of stack instances for which the StackSet operation failed.
newStackSetOperationStatusDetails ::
  StackSetOperationStatusDetails
newStackSetOperationStatusDetails :: StackSetOperationStatusDetails
newStackSetOperationStatusDetails =
  StackSetOperationStatusDetails'
    { $sel:failedStackInstancesCount:StackSetOperationStatusDetails' :: Maybe Natural
failedStackInstancesCount =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The number of stack instances for which the StackSet operation failed.
stackSetOperationStatusDetails_failedStackInstancesCount :: Lens.Lens' StackSetOperationStatusDetails (Prelude.Maybe Prelude.Natural)
stackSetOperationStatusDetails_failedStackInstancesCount :: Lens' StackSetOperationStatusDetails (Maybe Natural)
stackSetOperationStatusDetails_failedStackInstancesCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackSetOperationStatusDetails' {Maybe Natural
failedStackInstancesCount :: Maybe Natural
$sel:failedStackInstancesCount:StackSetOperationStatusDetails' :: StackSetOperationStatusDetails -> Maybe Natural
failedStackInstancesCount} -> Maybe Natural
failedStackInstancesCount) (\s :: StackSetOperationStatusDetails
s@StackSetOperationStatusDetails' {} Maybe Natural
a -> StackSetOperationStatusDetails
s {$sel:failedStackInstancesCount:StackSetOperationStatusDetails' :: Maybe Natural
failedStackInstancesCount = Maybe Natural
a} :: StackSetOperationStatusDetails)

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

instance
  Prelude.Hashable
    StackSetOperationStatusDetails
  where
  hashWithSalt :: Int -> StackSetOperationStatusDetails -> Int
hashWithSalt
    Int
_salt
    StackSetOperationStatusDetails' {Maybe Natural
failedStackInstancesCount :: Maybe Natural
$sel:failedStackInstancesCount:StackSetOperationStatusDetails' :: StackSetOperationStatusDetails -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
failedStackInstancesCount

instance
  Prelude.NFData
    StackSetOperationStatusDetails
  where
  rnf :: StackSetOperationStatusDetails -> ()
rnf StackSetOperationStatusDetails' {Maybe Natural
failedStackInstancesCount :: Maybe Natural
$sel:failedStackInstancesCount:StackSetOperationStatusDetails' :: StackSetOperationStatusDetails -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
failedStackInstancesCount