{-# 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.DevOpsGuru.Types.CloudFormationCollectionFilter
-- 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.DevOpsGuru.Types.CloudFormationCollectionFilter where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about AWS CloudFormation stacks. You can use up to 500
-- stacks to specify which AWS resources in your account to analyze. For
-- more information, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacks.html Stacks>
-- in the /AWS CloudFormation User Guide/.
--
-- /See:/ 'newCloudFormationCollectionFilter' smart constructor.
data CloudFormationCollectionFilter = CloudFormationCollectionFilter'
  { -- | An array of CloudFormation stack names.
    CloudFormationCollectionFilter -> Maybe [Text]
stackNames :: Prelude.Maybe [Prelude.Text]
  }
  deriving (CloudFormationCollectionFilter
-> CloudFormationCollectionFilter -> Bool
(CloudFormationCollectionFilter
 -> CloudFormationCollectionFilter -> Bool)
-> (CloudFormationCollectionFilter
    -> CloudFormationCollectionFilter -> Bool)
-> Eq CloudFormationCollectionFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudFormationCollectionFilter
-> CloudFormationCollectionFilter -> Bool
$c/= :: CloudFormationCollectionFilter
-> CloudFormationCollectionFilter -> Bool
== :: CloudFormationCollectionFilter
-> CloudFormationCollectionFilter -> Bool
$c== :: CloudFormationCollectionFilter
-> CloudFormationCollectionFilter -> Bool
Prelude.Eq, ReadPrec [CloudFormationCollectionFilter]
ReadPrec CloudFormationCollectionFilter
Int -> ReadS CloudFormationCollectionFilter
ReadS [CloudFormationCollectionFilter]
(Int -> ReadS CloudFormationCollectionFilter)
-> ReadS [CloudFormationCollectionFilter]
-> ReadPrec CloudFormationCollectionFilter
-> ReadPrec [CloudFormationCollectionFilter]
-> Read CloudFormationCollectionFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudFormationCollectionFilter]
$creadListPrec :: ReadPrec [CloudFormationCollectionFilter]
readPrec :: ReadPrec CloudFormationCollectionFilter
$creadPrec :: ReadPrec CloudFormationCollectionFilter
readList :: ReadS [CloudFormationCollectionFilter]
$creadList :: ReadS [CloudFormationCollectionFilter]
readsPrec :: Int -> ReadS CloudFormationCollectionFilter
$creadsPrec :: Int -> ReadS CloudFormationCollectionFilter
Prelude.Read, Int -> CloudFormationCollectionFilter -> ShowS
[CloudFormationCollectionFilter] -> ShowS
CloudFormationCollectionFilter -> String
(Int -> CloudFormationCollectionFilter -> ShowS)
-> (CloudFormationCollectionFilter -> String)
-> ([CloudFormationCollectionFilter] -> ShowS)
-> Show CloudFormationCollectionFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudFormationCollectionFilter] -> ShowS
$cshowList :: [CloudFormationCollectionFilter] -> ShowS
show :: CloudFormationCollectionFilter -> String
$cshow :: CloudFormationCollectionFilter -> String
showsPrec :: Int -> CloudFormationCollectionFilter -> ShowS
$cshowsPrec :: Int -> CloudFormationCollectionFilter -> ShowS
Prelude.Show, (forall x.
 CloudFormationCollectionFilter
 -> Rep CloudFormationCollectionFilter x)
-> (forall x.
    Rep CloudFormationCollectionFilter x
    -> CloudFormationCollectionFilter)
-> Generic CloudFormationCollectionFilter
forall x.
Rep CloudFormationCollectionFilter x
-> CloudFormationCollectionFilter
forall x.
CloudFormationCollectionFilter
-> Rep CloudFormationCollectionFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudFormationCollectionFilter x
-> CloudFormationCollectionFilter
$cfrom :: forall x.
CloudFormationCollectionFilter
-> Rep CloudFormationCollectionFilter x
Prelude.Generic)

-- |
-- Create a value of 'CloudFormationCollectionFilter' 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:
--
-- 'stackNames', 'cloudFormationCollectionFilter_stackNames' - An array of CloudFormation stack names.
newCloudFormationCollectionFilter ::
  CloudFormationCollectionFilter
newCloudFormationCollectionFilter :: CloudFormationCollectionFilter
newCloudFormationCollectionFilter =
  CloudFormationCollectionFilter' :: Maybe [Text] -> CloudFormationCollectionFilter
CloudFormationCollectionFilter'
    { $sel:stackNames:CloudFormationCollectionFilter' :: Maybe [Text]
stackNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | An array of CloudFormation stack names.
cloudFormationCollectionFilter_stackNames :: Lens.Lens' CloudFormationCollectionFilter (Prelude.Maybe [Prelude.Text])
cloudFormationCollectionFilter_stackNames :: (Maybe [Text] -> f (Maybe [Text]))
-> CloudFormationCollectionFilter
-> f CloudFormationCollectionFilter
cloudFormationCollectionFilter_stackNames = (CloudFormationCollectionFilter -> Maybe [Text])
-> (CloudFormationCollectionFilter
    -> Maybe [Text] -> CloudFormationCollectionFilter)
-> Lens
     CloudFormationCollectionFilter
     CloudFormationCollectionFilter
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudFormationCollectionFilter' {Maybe [Text]
stackNames :: Maybe [Text]
$sel:stackNames:CloudFormationCollectionFilter' :: CloudFormationCollectionFilter -> Maybe [Text]
stackNames} -> Maybe [Text]
stackNames) (\s :: CloudFormationCollectionFilter
s@CloudFormationCollectionFilter' {} Maybe [Text]
a -> CloudFormationCollectionFilter
s {$sel:stackNames:CloudFormationCollectionFilter' :: Maybe [Text]
stackNames = Maybe [Text]
a} :: CloudFormationCollectionFilter) ((Maybe [Text] -> f (Maybe [Text]))
 -> CloudFormationCollectionFilter
 -> f CloudFormationCollectionFilter)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CloudFormationCollectionFilter
-> f CloudFormationCollectionFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON CloudFormationCollectionFilter where
  parseJSON :: Value -> Parser CloudFormationCollectionFilter
parseJSON =
    String
-> (Object -> Parser CloudFormationCollectionFilter)
-> Value
-> Parser CloudFormationCollectionFilter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CloudFormationCollectionFilter"
      ( \Object
x ->
          Maybe [Text] -> CloudFormationCollectionFilter
CloudFormationCollectionFilter'
            (Maybe [Text] -> CloudFormationCollectionFilter)
-> Parser (Maybe [Text]) -> Parser CloudFormationCollectionFilter
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StackNames" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    CloudFormationCollectionFilter

instance
  Prelude.NFData
    CloudFormationCollectionFilter