{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.DescribeStackResourceDrifts
-- 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)
--
-- Returns drift information for the resources that have been checked for
-- drift in the specified stack. This includes actual and expected
-- configuration values for resources where CloudFormation detects
-- configuration drift.
--
-- For a given stack, there will be one @StackResourceDrift@ for each stack
-- resource that has been checked for drift. Resources that haven\'t yet
-- been checked for drift are not included. Resources that do not currently
-- support drift detection are not checked, and so not included. For a list
-- of resources that support drift detection, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html Resources that Support Drift Detection>.
--
-- Use DetectStackResourceDrift to detect drift on individual resources, or
-- DetectStackDrift to detect drift on all supported resources for a given
-- stack.
module Amazonka.CloudFormation.DescribeStackResourceDrifts
  ( -- * Creating a Request
    DescribeStackResourceDrifts (..),
    newDescribeStackResourceDrifts,

    -- * Request Lenses
    describeStackResourceDrifts_nextToken,
    describeStackResourceDrifts_maxResults,
    describeStackResourceDrifts_stackResourceDriftStatusFilters,
    describeStackResourceDrifts_stackName,

    -- * Destructuring the Response
    DescribeStackResourceDriftsResponse (..),
    newDescribeStackResourceDriftsResponse,

    -- * Response Lenses
    describeStackResourceDriftsResponse_nextToken,
    describeStackResourceDriftsResponse_httpStatus,
    describeStackResourceDriftsResponse_stackResourceDrifts,
  )
where

import Amazonka.CloudFormation.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeStackResourceDrifts' smart constructor.
data DescribeStackResourceDrifts = DescribeStackResourceDrifts'
  { -- | A string that identifies the next page of stack resource drift results.
    DescribeStackResourceDrifts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned with a single call. If the
    -- number of available results exceeds this maximum, the response includes
    -- a @NextToken@ value that you can assign to the @NextToken@ request
    -- parameter to get the next set of results.
    DescribeStackResourceDrifts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The resource drift status values to use as filters for the resource
    -- drift results returned.
    --
    -- -   @DELETED@: The resource differs from its expected template
    --     configuration in that the resource has been deleted.
    --
    -- -   @MODIFIED@: One or more resource properties differ from their
    --     expected template values.
    --
    -- -   @IN_SYNC@: The resources\'s actual configuration matches its
    --     expected template configuration.
    --
    -- -   @NOT_CHECKED@: CloudFormation does not currently return this value.
    DescribeStackResourceDrifts
-> Maybe (NonEmpty StackResourceDriftStatus)
stackResourceDriftStatusFilters :: Prelude.Maybe (Prelude.NonEmpty StackResourceDriftStatus),
    -- | The name of the stack for which you want drift information.
    DescribeStackResourceDrifts -> Text
stackName :: Prelude.Text
  }
  deriving (DescribeStackResourceDrifts -> DescribeStackResourceDrifts -> Bool
(DescribeStackResourceDrifts
 -> DescribeStackResourceDrifts -> Bool)
-> (DescribeStackResourceDrifts
    -> DescribeStackResourceDrifts -> Bool)
-> Eq DescribeStackResourceDrifts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackResourceDrifts -> DescribeStackResourceDrifts -> Bool
$c/= :: DescribeStackResourceDrifts -> DescribeStackResourceDrifts -> Bool
== :: DescribeStackResourceDrifts -> DescribeStackResourceDrifts -> Bool
$c== :: DescribeStackResourceDrifts -> DescribeStackResourceDrifts -> Bool
Prelude.Eq, ReadPrec [DescribeStackResourceDrifts]
ReadPrec DescribeStackResourceDrifts
Int -> ReadS DescribeStackResourceDrifts
ReadS [DescribeStackResourceDrifts]
(Int -> ReadS DescribeStackResourceDrifts)
-> ReadS [DescribeStackResourceDrifts]
-> ReadPrec DescribeStackResourceDrifts
-> ReadPrec [DescribeStackResourceDrifts]
-> Read DescribeStackResourceDrifts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackResourceDrifts]
$creadListPrec :: ReadPrec [DescribeStackResourceDrifts]
readPrec :: ReadPrec DescribeStackResourceDrifts
$creadPrec :: ReadPrec DescribeStackResourceDrifts
readList :: ReadS [DescribeStackResourceDrifts]
$creadList :: ReadS [DescribeStackResourceDrifts]
readsPrec :: Int -> ReadS DescribeStackResourceDrifts
$creadsPrec :: Int -> ReadS DescribeStackResourceDrifts
Prelude.Read, Int -> DescribeStackResourceDrifts -> ShowS
[DescribeStackResourceDrifts] -> ShowS
DescribeStackResourceDrifts -> String
(Int -> DescribeStackResourceDrifts -> ShowS)
-> (DescribeStackResourceDrifts -> String)
-> ([DescribeStackResourceDrifts] -> ShowS)
-> Show DescribeStackResourceDrifts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackResourceDrifts] -> ShowS
$cshowList :: [DescribeStackResourceDrifts] -> ShowS
show :: DescribeStackResourceDrifts -> String
$cshow :: DescribeStackResourceDrifts -> String
showsPrec :: Int -> DescribeStackResourceDrifts -> ShowS
$cshowsPrec :: Int -> DescribeStackResourceDrifts -> ShowS
Prelude.Show, (forall x.
 DescribeStackResourceDrifts -> Rep DescribeStackResourceDrifts x)
-> (forall x.
    Rep DescribeStackResourceDrifts x -> DescribeStackResourceDrifts)
-> Generic DescribeStackResourceDrifts
forall x.
Rep DescribeStackResourceDrifts x -> DescribeStackResourceDrifts
forall x.
DescribeStackResourceDrifts -> Rep DescribeStackResourceDrifts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStackResourceDrifts x -> DescribeStackResourceDrifts
$cfrom :: forall x.
DescribeStackResourceDrifts -> Rep DescribeStackResourceDrifts x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStackResourceDrifts' 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:
--
-- 'nextToken', 'describeStackResourceDrifts_nextToken' - A string that identifies the next page of stack resource drift results.
--
-- 'maxResults', 'describeStackResourceDrifts_maxResults' - The maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
--
-- 'stackResourceDriftStatusFilters', 'describeStackResourceDrifts_stackResourceDriftStatusFilters' - The resource drift status values to use as filters for the resource
-- drift results returned.
--
-- -   @DELETED@: The resource differs from its expected template
--     configuration in that the resource has been deleted.
--
-- -   @MODIFIED@: One or more resource properties differ from their
--     expected template values.
--
-- -   @IN_SYNC@: The resources\'s actual configuration matches its
--     expected template configuration.
--
-- -   @NOT_CHECKED@: CloudFormation does not currently return this value.
--
-- 'stackName', 'describeStackResourceDrifts_stackName' - The name of the stack for which you want drift information.
newDescribeStackResourceDrifts ::
  -- | 'stackName'
  Prelude.Text ->
  DescribeStackResourceDrifts
newDescribeStackResourceDrifts :: Text -> DescribeStackResourceDrifts
newDescribeStackResourceDrifts Text
pStackName_ =
  DescribeStackResourceDrifts' :: Maybe Text
-> Maybe Natural
-> Maybe (NonEmpty StackResourceDriftStatus)
-> Text
-> DescribeStackResourceDrifts
DescribeStackResourceDrifts'
    { $sel:nextToken:DescribeStackResourceDrifts' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeStackResourceDrifts' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:stackResourceDriftStatusFilters:DescribeStackResourceDrifts' :: Maybe (NonEmpty StackResourceDriftStatus)
stackResourceDriftStatusFilters =
        Maybe (NonEmpty StackResourceDriftStatus)
forall a. Maybe a
Prelude.Nothing,
      $sel:stackName:DescribeStackResourceDrifts' :: Text
stackName = Text
pStackName_
    }

-- | A string that identifies the next page of stack resource drift results.
describeStackResourceDrifts_nextToken :: Lens.Lens' DescribeStackResourceDrifts (Prelude.Maybe Prelude.Text)
describeStackResourceDrifts_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeStackResourceDrifts -> f DescribeStackResourceDrifts
describeStackResourceDrifts_nextToken = (DescribeStackResourceDrifts -> Maybe Text)
-> (DescribeStackResourceDrifts
    -> Maybe Text -> DescribeStackResourceDrifts)
-> Lens
     DescribeStackResourceDrifts
     DescribeStackResourceDrifts
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceDrifts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeStackResourceDrifts
s@DescribeStackResourceDrifts' {} Maybe Text
a -> DescribeStackResourceDrifts
s {$sel:nextToken:DescribeStackResourceDrifts' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeStackResourceDrifts)

-- | The maximum number of results to be returned with a single call. If the
-- number of available results exceeds this maximum, the response includes
-- a @NextToken@ value that you can assign to the @NextToken@ request
-- parameter to get the next set of results.
describeStackResourceDrifts_maxResults :: Lens.Lens' DescribeStackResourceDrifts (Prelude.Maybe Prelude.Natural)
describeStackResourceDrifts_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeStackResourceDrifts -> f DescribeStackResourceDrifts
describeStackResourceDrifts_maxResults = (DescribeStackResourceDrifts -> Maybe Natural)
-> (DescribeStackResourceDrifts
    -> Maybe Natural -> DescribeStackResourceDrifts)
-> Lens
     DescribeStackResourceDrifts
     DescribeStackResourceDrifts
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceDrifts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeStackResourceDrifts
s@DescribeStackResourceDrifts' {} Maybe Natural
a -> DescribeStackResourceDrifts
s {$sel:maxResults:DescribeStackResourceDrifts' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeStackResourceDrifts)

-- | The resource drift status values to use as filters for the resource
-- drift results returned.
--
-- -   @DELETED@: The resource differs from its expected template
--     configuration in that the resource has been deleted.
--
-- -   @MODIFIED@: One or more resource properties differ from their
--     expected template values.
--
-- -   @IN_SYNC@: The resources\'s actual configuration matches its
--     expected template configuration.
--
-- -   @NOT_CHECKED@: CloudFormation does not currently return this value.
describeStackResourceDrifts_stackResourceDriftStatusFilters :: Lens.Lens' DescribeStackResourceDrifts (Prelude.Maybe (Prelude.NonEmpty StackResourceDriftStatus))
describeStackResourceDrifts_stackResourceDriftStatusFilters :: (Maybe (NonEmpty StackResourceDriftStatus)
 -> f (Maybe (NonEmpty StackResourceDriftStatus)))
-> DescribeStackResourceDrifts -> f DescribeStackResourceDrifts
describeStackResourceDrifts_stackResourceDriftStatusFilters = (DescribeStackResourceDrifts
 -> Maybe (NonEmpty StackResourceDriftStatus))
-> (DescribeStackResourceDrifts
    -> Maybe (NonEmpty StackResourceDriftStatus)
    -> DescribeStackResourceDrifts)
-> Lens
     DescribeStackResourceDrifts
     DescribeStackResourceDrifts
     (Maybe (NonEmpty StackResourceDriftStatus))
     (Maybe (NonEmpty StackResourceDriftStatus))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceDrifts' {Maybe (NonEmpty StackResourceDriftStatus)
stackResourceDriftStatusFilters :: Maybe (NonEmpty StackResourceDriftStatus)
$sel:stackResourceDriftStatusFilters:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts
-> Maybe (NonEmpty StackResourceDriftStatus)
stackResourceDriftStatusFilters} -> Maybe (NonEmpty StackResourceDriftStatus)
stackResourceDriftStatusFilters) (\s :: DescribeStackResourceDrifts
s@DescribeStackResourceDrifts' {} Maybe (NonEmpty StackResourceDriftStatus)
a -> DescribeStackResourceDrifts
s {$sel:stackResourceDriftStatusFilters:DescribeStackResourceDrifts' :: Maybe (NonEmpty StackResourceDriftStatus)
stackResourceDriftStatusFilters = Maybe (NonEmpty StackResourceDriftStatus)
a} :: DescribeStackResourceDrifts) ((Maybe (NonEmpty StackResourceDriftStatus)
  -> f (Maybe (NonEmpty StackResourceDriftStatus)))
 -> DescribeStackResourceDrifts -> f DescribeStackResourceDrifts)
-> ((Maybe (NonEmpty StackResourceDriftStatus)
     -> f (Maybe (NonEmpty StackResourceDriftStatus)))
    -> Maybe (NonEmpty StackResourceDriftStatus)
    -> f (Maybe (NonEmpty StackResourceDriftStatus)))
-> (Maybe (NonEmpty StackResourceDriftStatus)
    -> f (Maybe (NonEmpty StackResourceDriftStatus)))
-> DescribeStackResourceDrifts
-> f DescribeStackResourceDrifts
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty StackResourceDriftStatus)
  (NonEmpty StackResourceDriftStatus)
  (NonEmpty StackResourceDriftStatus)
  (NonEmpty StackResourceDriftStatus)
-> Iso
     (Maybe (NonEmpty StackResourceDriftStatus))
     (Maybe (NonEmpty StackResourceDriftStatus))
     (Maybe (NonEmpty StackResourceDriftStatus))
     (Maybe (NonEmpty StackResourceDriftStatus))
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
  (NonEmpty StackResourceDriftStatus)
  (NonEmpty StackResourceDriftStatus)
  (NonEmpty StackResourceDriftStatus)
  (NonEmpty StackResourceDriftStatus)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the stack for which you want drift information.
describeStackResourceDrifts_stackName :: Lens.Lens' DescribeStackResourceDrifts Prelude.Text
describeStackResourceDrifts_stackName :: (Text -> f Text)
-> DescribeStackResourceDrifts -> f DescribeStackResourceDrifts
describeStackResourceDrifts_stackName = (DescribeStackResourceDrifts -> Text)
-> (DescribeStackResourceDrifts
    -> Text -> DescribeStackResourceDrifts)
-> Lens
     DescribeStackResourceDrifts DescribeStackResourceDrifts Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceDrifts' {Text
stackName :: Text
$sel:stackName:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts -> Text
stackName} -> Text
stackName) (\s :: DescribeStackResourceDrifts
s@DescribeStackResourceDrifts' {} Text
a -> DescribeStackResourceDrifts
s {$sel:stackName:DescribeStackResourceDrifts' :: Text
stackName = Text
a} :: DescribeStackResourceDrifts)

instance Core.AWSRequest DescribeStackResourceDrifts where
  type
    AWSResponse DescribeStackResourceDrifts =
      DescribeStackResourceDriftsResponse
  request :: DescribeStackResourceDrifts -> Request DescribeStackResourceDrifts
request = Service
-> DescribeStackResourceDrifts
-> Request DescribeStackResourceDrifts
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeStackResourceDrifts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeStackResourceDrifts)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeStackResourceDrifts))
-> Logger
-> Service
-> Proxy DescribeStackResourceDrifts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeStackResourceDrifts)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeStackResourceDriftsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Int
-> [StackResourceDrift]
-> DescribeStackResourceDriftsResponse
DescribeStackResourceDriftsResponse'
            (Maybe Text
 -> Int
 -> [StackResourceDrift]
 -> DescribeStackResourceDriftsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [StackResourceDrift] -> DescribeStackResourceDriftsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either
  String
  (Int
   -> [StackResourceDrift] -> DescribeStackResourceDriftsResponse)
-> Either String Int
-> Either
     String
     ([StackResourceDrift] -> DescribeStackResourceDriftsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([StackResourceDrift] -> DescribeStackResourceDriftsResponse)
-> Either String [StackResourceDrift]
-> Either String DescribeStackResourceDriftsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StackResourceDrifts"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [StackResourceDrift])
-> Either String [StackResourceDrift]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [StackResourceDrift]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance Prelude.Hashable DescribeStackResourceDrifts

instance Prelude.NFData DescribeStackResourceDrifts

instance Core.ToHeaders DescribeStackResourceDrifts where
  toHeaders :: DescribeStackResourceDrifts -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeStackResourceDrifts -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath DescribeStackResourceDrifts where
  toPath :: DescribeStackResourceDrifts -> ByteString
toPath = ByteString -> DescribeStackResourceDrifts -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeStackResourceDrifts where
  toQuery :: DescribeStackResourceDrifts -> QueryString
toQuery DescribeStackResourceDrifts' {Maybe Natural
Maybe (NonEmpty StackResourceDriftStatus)
Maybe Text
Text
stackName :: Text
stackResourceDriftStatusFilters :: Maybe (NonEmpty StackResourceDriftStatus)
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:stackName:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts -> Text
$sel:stackResourceDriftStatusFilters:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts
-> Maybe (NonEmpty StackResourceDriftStatus)
$sel:maxResults:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts -> Maybe Natural
$sel:nextToken:DescribeStackResourceDrifts' :: DescribeStackResourceDrifts -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DescribeStackResourceDrifts" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
        ByteString
"StackResourceDriftStatusFilters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> NonEmpty StackResourceDriftStatus -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                (NonEmpty StackResourceDriftStatus -> QueryString)
-> Maybe (NonEmpty StackResourceDriftStatus) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty StackResourceDriftStatus)
stackResourceDriftStatusFilters
            ),
        ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
      ]

-- | /See:/ 'newDescribeStackResourceDriftsResponse' smart constructor.
data DescribeStackResourceDriftsResponse = DescribeStackResourceDriftsResponse'
  { -- | If the request doesn\'t return all of the remaining results, @NextToken@
    -- is set to a token. To retrieve the next set of results, call
    -- @DescribeStackResourceDrifts@ again and assign that token to the request
    -- object\'s @NextToken@ parameter. If the request returns all results,
    -- @NextToken@ is set to @null@.
    DescribeStackResourceDriftsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeStackResourceDriftsResponse -> Int
httpStatus :: Prelude.Int,
    -- | Drift information for the resources that have been checked for drift in
    -- the specified stack. This includes actual and expected configuration
    -- values for resources where CloudFormation detects drift.
    --
    -- For a given stack, there will be one @StackResourceDrift@ for each stack
    -- resource that has been checked for drift. Resources that have not yet
    -- been checked for drift are not included. Resources that do not currently
    -- support drift detection are not checked, and so not included. For a list
    -- of resources that support drift detection, see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html Resources that Support Drift Detection>.
    DescribeStackResourceDriftsResponse -> [StackResourceDrift]
stackResourceDrifts :: [StackResourceDrift]
  }
  deriving (DescribeStackResourceDriftsResponse
-> DescribeStackResourceDriftsResponse -> Bool
(DescribeStackResourceDriftsResponse
 -> DescribeStackResourceDriftsResponse -> Bool)
-> (DescribeStackResourceDriftsResponse
    -> DescribeStackResourceDriftsResponse -> Bool)
-> Eq DescribeStackResourceDriftsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStackResourceDriftsResponse
-> DescribeStackResourceDriftsResponse -> Bool
$c/= :: DescribeStackResourceDriftsResponse
-> DescribeStackResourceDriftsResponse -> Bool
== :: DescribeStackResourceDriftsResponse
-> DescribeStackResourceDriftsResponse -> Bool
$c== :: DescribeStackResourceDriftsResponse
-> DescribeStackResourceDriftsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeStackResourceDriftsResponse]
ReadPrec DescribeStackResourceDriftsResponse
Int -> ReadS DescribeStackResourceDriftsResponse
ReadS [DescribeStackResourceDriftsResponse]
(Int -> ReadS DescribeStackResourceDriftsResponse)
-> ReadS [DescribeStackResourceDriftsResponse]
-> ReadPrec DescribeStackResourceDriftsResponse
-> ReadPrec [DescribeStackResourceDriftsResponse]
-> Read DescribeStackResourceDriftsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStackResourceDriftsResponse]
$creadListPrec :: ReadPrec [DescribeStackResourceDriftsResponse]
readPrec :: ReadPrec DescribeStackResourceDriftsResponse
$creadPrec :: ReadPrec DescribeStackResourceDriftsResponse
readList :: ReadS [DescribeStackResourceDriftsResponse]
$creadList :: ReadS [DescribeStackResourceDriftsResponse]
readsPrec :: Int -> ReadS DescribeStackResourceDriftsResponse
$creadsPrec :: Int -> ReadS DescribeStackResourceDriftsResponse
Prelude.Read, Int -> DescribeStackResourceDriftsResponse -> ShowS
[DescribeStackResourceDriftsResponse] -> ShowS
DescribeStackResourceDriftsResponse -> String
(Int -> DescribeStackResourceDriftsResponse -> ShowS)
-> (DescribeStackResourceDriftsResponse -> String)
-> ([DescribeStackResourceDriftsResponse] -> ShowS)
-> Show DescribeStackResourceDriftsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStackResourceDriftsResponse] -> ShowS
$cshowList :: [DescribeStackResourceDriftsResponse] -> ShowS
show :: DescribeStackResourceDriftsResponse -> String
$cshow :: DescribeStackResourceDriftsResponse -> String
showsPrec :: Int -> DescribeStackResourceDriftsResponse -> ShowS
$cshowsPrec :: Int -> DescribeStackResourceDriftsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeStackResourceDriftsResponse
 -> Rep DescribeStackResourceDriftsResponse x)
-> (forall x.
    Rep DescribeStackResourceDriftsResponse x
    -> DescribeStackResourceDriftsResponse)
-> Generic DescribeStackResourceDriftsResponse
forall x.
Rep DescribeStackResourceDriftsResponse x
-> DescribeStackResourceDriftsResponse
forall x.
DescribeStackResourceDriftsResponse
-> Rep DescribeStackResourceDriftsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStackResourceDriftsResponse x
-> DescribeStackResourceDriftsResponse
$cfrom :: forall x.
DescribeStackResourceDriftsResponse
-> Rep DescribeStackResourceDriftsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStackResourceDriftsResponse' 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:
--
-- 'nextToken', 'describeStackResourceDriftsResponse_nextToken' - If the request doesn\'t return all of the remaining results, @NextToken@
-- is set to a token. To retrieve the next set of results, call
-- @DescribeStackResourceDrifts@ again and assign that token to the request
-- object\'s @NextToken@ parameter. If the request returns all results,
-- @NextToken@ is set to @null@.
--
-- 'httpStatus', 'describeStackResourceDriftsResponse_httpStatus' - The response's http status code.
--
-- 'stackResourceDrifts', 'describeStackResourceDriftsResponse_stackResourceDrifts' - Drift information for the resources that have been checked for drift in
-- the specified stack. This includes actual and expected configuration
-- values for resources where CloudFormation detects drift.
--
-- For a given stack, there will be one @StackResourceDrift@ for each stack
-- resource that has been checked for drift. Resources that have not yet
-- been checked for drift are not included. Resources that do not currently
-- support drift detection are not checked, and so not included. For a list
-- of resources that support drift detection, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html Resources that Support Drift Detection>.
newDescribeStackResourceDriftsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeStackResourceDriftsResponse
newDescribeStackResourceDriftsResponse :: Int -> DescribeStackResourceDriftsResponse
newDescribeStackResourceDriftsResponse Int
pHttpStatus_ =
  DescribeStackResourceDriftsResponse' :: Maybe Text
-> Int
-> [StackResourceDrift]
-> DescribeStackResourceDriftsResponse
DescribeStackResourceDriftsResponse'
    { $sel:nextToken:DescribeStackResourceDriftsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeStackResourceDriftsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:stackResourceDrifts:DescribeStackResourceDriftsResponse' :: [StackResourceDrift]
stackResourceDrifts = [StackResourceDrift]
forall a. Monoid a => a
Prelude.mempty
    }

-- | If the request doesn\'t return all of the remaining results, @NextToken@
-- is set to a token. To retrieve the next set of results, call
-- @DescribeStackResourceDrifts@ again and assign that token to the request
-- object\'s @NextToken@ parameter. If the request returns all results,
-- @NextToken@ is set to @null@.
describeStackResourceDriftsResponse_nextToken :: Lens.Lens' DescribeStackResourceDriftsResponse (Prelude.Maybe Prelude.Text)
describeStackResourceDriftsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeStackResourceDriftsResponse
-> f DescribeStackResourceDriftsResponse
describeStackResourceDriftsResponse_nextToken = (DescribeStackResourceDriftsResponse -> Maybe Text)
-> (DescribeStackResourceDriftsResponse
    -> Maybe Text -> DescribeStackResourceDriftsResponse)
-> Lens
     DescribeStackResourceDriftsResponse
     DescribeStackResourceDriftsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceDriftsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeStackResourceDriftsResponse' :: DescribeStackResourceDriftsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeStackResourceDriftsResponse
s@DescribeStackResourceDriftsResponse' {} Maybe Text
a -> DescribeStackResourceDriftsResponse
s {$sel:nextToken:DescribeStackResourceDriftsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeStackResourceDriftsResponse)

-- | The response's http status code.
describeStackResourceDriftsResponse_httpStatus :: Lens.Lens' DescribeStackResourceDriftsResponse Prelude.Int
describeStackResourceDriftsResponse_httpStatus :: (Int -> f Int)
-> DescribeStackResourceDriftsResponse
-> f DescribeStackResourceDriftsResponse
describeStackResourceDriftsResponse_httpStatus = (DescribeStackResourceDriftsResponse -> Int)
-> (DescribeStackResourceDriftsResponse
    -> Int -> DescribeStackResourceDriftsResponse)
-> Lens
     DescribeStackResourceDriftsResponse
     DescribeStackResourceDriftsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceDriftsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeStackResourceDriftsResponse' :: DescribeStackResourceDriftsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeStackResourceDriftsResponse
s@DescribeStackResourceDriftsResponse' {} Int
a -> DescribeStackResourceDriftsResponse
s {$sel:httpStatus:DescribeStackResourceDriftsResponse' :: Int
httpStatus = Int
a} :: DescribeStackResourceDriftsResponse)

-- | Drift information for the resources that have been checked for drift in
-- the specified stack. This includes actual and expected configuration
-- values for resources where CloudFormation detects drift.
--
-- For a given stack, there will be one @StackResourceDrift@ for each stack
-- resource that has been checked for drift. Resources that have not yet
-- been checked for drift are not included. Resources that do not currently
-- support drift detection are not checked, and so not included. For a list
-- of resources that support drift detection, see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-drift-resource-list.html Resources that Support Drift Detection>.
describeStackResourceDriftsResponse_stackResourceDrifts :: Lens.Lens' DescribeStackResourceDriftsResponse [StackResourceDrift]
describeStackResourceDriftsResponse_stackResourceDrifts :: ([StackResourceDrift] -> f [StackResourceDrift])
-> DescribeStackResourceDriftsResponse
-> f DescribeStackResourceDriftsResponse
describeStackResourceDriftsResponse_stackResourceDrifts = (DescribeStackResourceDriftsResponse -> [StackResourceDrift])
-> (DescribeStackResourceDriftsResponse
    -> [StackResourceDrift] -> DescribeStackResourceDriftsResponse)
-> Lens
     DescribeStackResourceDriftsResponse
     DescribeStackResourceDriftsResponse
     [StackResourceDrift]
     [StackResourceDrift]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStackResourceDriftsResponse' {[StackResourceDrift]
stackResourceDrifts :: [StackResourceDrift]
$sel:stackResourceDrifts:DescribeStackResourceDriftsResponse' :: DescribeStackResourceDriftsResponse -> [StackResourceDrift]
stackResourceDrifts} -> [StackResourceDrift]
stackResourceDrifts) (\s :: DescribeStackResourceDriftsResponse
s@DescribeStackResourceDriftsResponse' {} [StackResourceDrift]
a -> DescribeStackResourceDriftsResponse
s {$sel:stackResourceDrifts:DescribeStackResourceDriftsResponse' :: [StackResourceDrift]
stackResourceDrifts = [StackResourceDrift]
a} :: DescribeStackResourceDriftsResponse) (([StackResourceDrift] -> f [StackResourceDrift])
 -> DescribeStackResourceDriftsResponse
 -> f DescribeStackResourceDriftsResponse)
-> (([StackResourceDrift] -> f [StackResourceDrift])
    -> [StackResourceDrift] -> f [StackResourceDrift])
-> ([StackResourceDrift] -> f [StackResourceDrift])
-> DescribeStackResourceDriftsResponse
-> f DescribeStackResourceDriftsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([StackResourceDrift] -> f [StackResourceDrift])
-> [StackResourceDrift] -> f [StackResourceDrift]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    DescribeStackResourceDriftsResponse