{-# 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.ListStackSetOperationResults
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns summary information about the results of a stack set operation.
--
-- This operation returns paginated results.
module Amazonka.CloudFormation.ListStackSetOperationResults
  ( -- * Creating a Request
    ListStackSetOperationResults (..),
    newListStackSetOperationResults,

    -- * Request Lenses
    listStackSetOperationResults_callAs,
    listStackSetOperationResults_filters,
    listStackSetOperationResults_maxResults,
    listStackSetOperationResults_nextToken,
    listStackSetOperationResults_stackSetName,
    listStackSetOperationResults_operationId,

    -- * Destructuring the Response
    ListStackSetOperationResultsResponse (..),
    newListStackSetOperationResultsResponse,

    -- * Response Lenses
    listStackSetOperationResultsResponse_nextToken,
    listStackSetOperationResultsResponse_summaries,
    listStackSetOperationResultsResponse_httpStatus,
  )
where

import Amazonka.CloudFormation.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListStackSetOperationResults' smart constructor.
data ListStackSetOperationResults = ListStackSetOperationResults'
  { -- | [Service-managed permissions] Specifies whether you are acting as an
    -- account administrator in the organization\'s management account or as a
    -- delegated administrator in a member account.
    --
    -- By default, @SELF@ is specified. Use @SELF@ for stack sets with
    -- self-managed permissions.
    --
    -- -   If you are signed in to the management account, specify @SELF@.
    --
    -- -   If you are signed in to a delegated administrator account, specify
    --     @DELEGATED_ADMIN@.
    --
    --     Your Amazon Web Services account must be registered as a delegated
    --     administrator in the management account. For more information, see
    --     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
    --     in the /CloudFormation User Guide/.
    ListStackSetOperationResults -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
    -- | The filter to apply to operation results.
    ListStackSetOperationResults -> Maybe [OperationResultFilter]
filters :: Prelude.Maybe [OperationResultFilter],
    -- | 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.
    ListStackSetOperationResults -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous request didn\'t return all the remaining results, the
    -- response object\'s @NextToken@ parameter value is set to a token. To
    -- retrieve the next set of results, call @ListStackSetOperationResults@
    -- again and assign that token to the request object\'s @NextToken@
    -- parameter. If there are no remaining results, the previous response
    -- object\'s @NextToken@ parameter is set to @null@.
    ListStackSetOperationResults -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name or unique ID of the stack set that you want to get operation
    -- results for.
    ListStackSetOperationResults -> Text
stackSetName :: Prelude.Text,
    -- | The ID of the stack set operation.
    ListStackSetOperationResults -> Text
operationId :: Prelude.Text
  }
  deriving (ListStackSetOperationResults
-> ListStackSetOperationResults -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStackSetOperationResults
-> ListStackSetOperationResults -> Bool
$c/= :: ListStackSetOperationResults
-> ListStackSetOperationResults -> Bool
== :: ListStackSetOperationResults
-> ListStackSetOperationResults -> Bool
$c== :: ListStackSetOperationResults
-> ListStackSetOperationResults -> Bool
Prelude.Eq, ReadPrec [ListStackSetOperationResults]
ReadPrec ListStackSetOperationResults
Int -> ReadS ListStackSetOperationResults
ReadS [ListStackSetOperationResults]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStackSetOperationResults]
$creadListPrec :: ReadPrec [ListStackSetOperationResults]
readPrec :: ReadPrec ListStackSetOperationResults
$creadPrec :: ReadPrec ListStackSetOperationResults
readList :: ReadS [ListStackSetOperationResults]
$creadList :: ReadS [ListStackSetOperationResults]
readsPrec :: Int -> ReadS ListStackSetOperationResults
$creadsPrec :: Int -> ReadS ListStackSetOperationResults
Prelude.Read, Int -> ListStackSetOperationResults -> ShowS
[ListStackSetOperationResults] -> ShowS
ListStackSetOperationResults -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStackSetOperationResults] -> ShowS
$cshowList :: [ListStackSetOperationResults] -> ShowS
show :: ListStackSetOperationResults -> String
$cshow :: ListStackSetOperationResults -> String
showsPrec :: Int -> ListStackSetOperationResults -> ShowS
$cshowsPrec :: Int -> ListStackSetOperationResults -> ShowS
Prelude.Show, forall x.
Rep ListStackSetOperationResults x -> ListStackSetOperationResults
forall x.
ListStackSetOperationResults -> Rep ListStackSetOperationResults x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListStackSetOperationResults x -> ListStackSetOperationResults
$cfrom :: forall x.
ListStackSetOperationResults -> Rep ListStackSetOperationResults x
Prelude.Generic)

-- |
-- Create a value of 'ListStackSetOperationResults' 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:
--
-- 'callAs', 'listStackSetOperationResults_callAs' - [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the organization\'s management account or as a
-- delegated administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   If you are signed in to the management account, specify @SELF@.
--
-- -   If you are signed in to a delegated administrator account, specify
--     @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     administrator in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
--
-- 'filters', 'listStackSetOperationResults_filters' - The filter to apply to operation results.
--
-- 'maxResults', 'listStackSetOperationResults_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.
--
-- 'nextToken', 'listStackSetOperationResults_nextToken' - If the previous request didn\'t return all the remaining results, the
-- response object\'s @NextToken@ parameter value is set to a token. To
-- retrieve the next set of results, call @ListStackSetOperationResults@
-- again and assign that token to the request object\'s @NextToken@
-- parameter. If there are no remaining results, the previous response
-- object\'s @NextToken@ parameter is set to @null@.
--
-- 'stackSetName', 'listStackSetOperationResults_stackSetName' - The name or unique ID of the stack set that you want to get operation
-- results for.
--
-- 'operationId', 'listStackSetOperationResults_operationId' - The ID of the stack set operation.
newListStackSetOperationResults ::
  -- | 'stackSetName'
  Prelude.Text ->
  -- | 'operationId'
  Prelude.Text ->
  ListStackSetOperationResults
newListStackSetOperationResults :: Text -> Text -> ListStackSetOperationResults
newListStackSetOperationResults
  Text
pStackSetName_
  Text
pOperationId_ =
    ListStackSetOperationResults'
      { $sel:callAs:ListStackSetOperationResults' :: Maybe CallAs
callAs =
          forall a. Maybe a
Prelude.Nothing,
        $sel:filters:ListStackSetOperationResults' :: Maybe [OperationResultFilter]
filters = forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListStackSetOperationResults' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListStackSetOperationResults' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:stackSetName:ListStackSetOperationResults' :: Text
stackSetName = Text
pStackSetName_,
        $sel:operationId:ListStackSetOperationResults' :: Text
operationId = Text
pOperationId_
      }

-- | [Service-managed permissions] Specifies whether you are acting as an
-- account administrator in the organization\'s management account or as a
-- delegated administrator in a member account.
--
-- By default, @SELF@ is specified. Use @SELF@ for stack sets with
-- self-managed permissions.
--
-- -   If you are signed in to the management account, specify @SELF@.
--
-- -   If you are signed in to a delegated administrator account, specify
--     @DELEGATED_ADMIN@.
--
--     Your Amazon Web Services account must be registered as a delegated
--     administrator in the management account. For more information, see
--     <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html Register a delegated administrator>
--     in the /CloudFormation User Guide/.
listStackSetOperationResults_callAs :: Lens.Lens' ListStackSetOperationResults (Prelude.Maybe CallAs)
listStackSetOperationResults_callAs :: Lens' ListStackSetOperationResults (Maybe CallAs)
listStackSetOperationResults_callAs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationResults' {Maybe CallAs
callAs :: Maybe CallAs
$sel:callAs:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe CallAs
callAs} -> Maybe CallAs
callAs) (\s :: ListStackSetOperationResults
s@ListStackSetOperationResults' {} Maybe CallAs
a -> ListStackSetOperationResults
s {$sel:callAs:ListStackSetOperationResults' :: Maybe CallAs
callAs = Maybe CallAs
a} :: ListStackSetOperationResults)

-- | The filter to apply to operation results.
listStackSetOperationResults_filters :: Lens.Lens' ListStackSetOperationResults (Prelude.Maybe [OperationResultFilter])
listStackSetOperationResults_filters :: Lens' ListStackSetOperationResults (Maybe [OperationResultFilter])
listStackSetOperationResults_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationResults' {Maybe [OperationResultFilter]
filters :: Maybe [OperationResultFilter]
$sel:filters:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe [OperationResultFilter]
filters} -> Maybe [OperationResultFilter]
filters) (\s :: ListStackSetOperationResults
s@ListStackSetOperationResults' {} Maybe [OperationResultFilter]
a -> ListStackSetOperationResults
s {$sel:filters:ListStackSetOperationResults' :: Maybe [OperationResultFilter]
filters = Maybe [OperationResultFilter]
a} :: ListStackSetOperationResults) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
listStackSetOperationResults_maxResults :: Lens.Lens' ListStackSetOperationResults (Prelude.Maybe Prelude.Natural)
listStackSetOperationResults_maxResults :: Lens' ListStackSetOperationResults (Maybe Natural)
listStackSetOperationResults_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationResults' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListStackSetOperationResults
s@ListStackSetOperationResults' {} Maybe Natural
a -> ListStackSetOperationResults
s {$sel:maxResults:ListStackSetOperationResults' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListStackSetOperationResults)

-- | If the previous request didn\'t return all the remaining results, the
-- response object\'s @NextToken@ parameter value is set to a token. To
-- retrieve the next set of results, call @ListStackSetOperationResults@
-- again and assign that token to the request object\'s @NextToken@
-- parameter. If there are no remaining results, the previous response
-- object\'s @NextToken@ parameter is set to @null@.
listStackSetOperationResults_nextToken :: Lens.Lens' ListStackSetOperationResults (Prelude.Maybe Prelude.Text)
listStackSetOperationResults_nextToken :: Lens' ListStackSetOperationResults (Maybe Text)
listStackSetOperationResults_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationResults' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStackSetOperationResults
s@ListStackSetOperationResults' {} Maybe Text
a -> ListStackSetOperationResults
s {$sel:nextToken:ListStackSetOperationResults' :: Maybe Text
nextToken = Maybe Text
a} :: ListStackSetOperationResults)

-- | The name or unique ID of the stack set that you want to get operation
-- results for.
listStackSetOperationResults_stackSetName :: Lens.Lens' ListStackSetOperationResults Prelude.Text
listStackSetOperationResults_stackSetName :: Lens' ListStackSetOperationResults Text
listStackSetOperationResults_stackSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationResults' {Text
stackSetName :: Text
$sel:stackSetName:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
stackSetName} -> Text
stackSetName) (\s :: ListStackSetOperationResults
s@ListStackSetOperationResults' {} Text
a -> ListStackSetOperationResults
s {$sel:stackSetName:ListStackSetOperationResults' :: Text
stackSetName = Text
a} :: ListStackSetOperationResults)

-- | The ID of the stack set operation.
listStackSetOperationResults_operationId :: Lens.Lens' ListStackSetOperationResults Prelude.Text
listStackSetOperationResults_operationId :: Lens' ListStackSetOperationResults Text
listStackSetOperationResults_operationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationResults' {Text
operationId :: Text
$sel:operationId:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
operationId} -> Text
operationId) (\s :: ListStackSetOperationResults
s@ListStackSetOperationResults' {} Text
a -> ListStackSetOperationResults
s {$sel:operationId:ListStackSetOperationResults' :: Text
operationId = Text
a} :: ListStackSetOperationResults)

instance Core.AWSPager ListStackSetOperationResults where
  page :: ListStackSetOperationResults
-> AWSResponse ListStackSetOperationResults
-> Maybe ListStackSetOperationResults
page ListStackSetOperationResults
rq AWSResponse ListStackSetOperationResults
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSetOperationResults
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStackSetOperationResultsResponse (Maybe Text)
listStackSetOperationResultsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSetOperationResults
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListStackSetOperationResultsResponse
  (Maybe [StackSetOperationResultSummary])
listStackSetOperationResultsResponse_summaries
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListStackSetOperationResults
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListStackSetOperationResults (Maybe Text)
listStackSetOperationResults_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStackSetOperationResults
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStackSetOperationResultsResponse (Maybe Text)
listStackSetOperationResultsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListStackSetOperationResults where
  type
    AWSResponse ListStackSetOperationResults =
      ListStackSetOperationResultsResponse
  request :: (Service -> Service)
-> ListStackSetOperationResults
-> Request ListStackSetOperationResults
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListStackSetOperationResults
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListStackSetOperationResults)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListStackSetOperationResultsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [StackSetOperationResultSummary]
-> Int
-> ListStackSetOperationResultsResponse
ListStackSetOperationResultsResponse'
            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
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Summaries"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ListStackSetOperationResults
  where
  hashWithSalt :: Int -> ListStackSetOperationResults -> Int
hashWithSalt Int
_salt ListStackSetOperationResults' {Maybe Natural
Maybe [OperationResultFilter]
Maybe Text
Maybe CallAs
Text
operationId :: Text
stackSetName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [OperationResultFilter]
callAs :: Maybe CallAs
$sel:operationId:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:stackSetName:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:nextToken:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Text
$sel:maxResults:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Natural
$sel:filters:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe [OperationResultFilter]
$sel:callAs:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe CallAs
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CallAs
callAs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [OperationResultFilter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stackSetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
operationId

instance Prelude.NFData ListStackSetOperationResults where
  rnf :: ListStackSetOperationResults -> ()
rnf ListStackSetOperationResults' {Maybe Natural
Maybe [OperationResultFilter]
Maybe Text
Maybe CallAs
Text
operationId :: Text
stackSetName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [OperationResultFilter]
callAs :: Maybe CallAs
$sel:operationId:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:stackSetName:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:nextToken:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Text
$sel:maxResults:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Natural
$sel:filters:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe [OperationResultFilter]
$sel:callAs:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe CallAs
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CallAs
callAs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [OperationResultFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stackSetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
operationId

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

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

instance Data.ToQuery ListStackSetOperationResults where
  toQuery :: ListStackSetOperationResults -> QueryString
toQuery ListStackSetOperationResults' {Maybe Natural
Maybe [OperationResultFilter]
Maybe Text
Maybe CallAs
Text
operationId :: Text
stackSetName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [OperationResultFilter]
callAs :: Maybe CallAs
$sel:operationId:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:stackSetName:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:nextToken:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Text
$sel:maxResults:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Natural
$sel:filters:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe [OperationResultFilter]
$sel:callAs:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe CallAs
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"ListStackSetOperationResults" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"CallAs" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe CallAs
callAs,
        ByteString
"Filters"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OperationResultFilter]
filters),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"StackSetName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
stackSetName,
        ByteString
"OperationId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
operationId
      ]

-- | /See:/ 'newListStackSetOperationResultsResponse' smart constructor.
data ListStackSetOperationResultsResponse = ListStackSetOperationResultsResponse'
  { -- | If the request doesn\'t return all results, @NextToken@ is set to a
    -- token. To retrieve the next set of results, call @ListOperationResults@
    -- again and assign that token to the request object\'s @NextToken@
    -- parameter. If there are no remaining results, @NextToken@ is set to
    -- @null@.
    ListStackSetOperationResultsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of @StackSetOperationResultSummary@ structures that contain
    -- information about the specified operation results, for accounts and
    -- Amazon Web Services Regions that are included in the operation.
    ListStackSetOperationResultsResponse
-> Maybe [StackSetOperationResultSummary]
summaries :: Prelude.Maybe [StackSetOperationResultSummary],
    -- | The response's http status code.
    ListStackSetOperationResultsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListStackSetOperationResultsResponse
-> ListStackSetOperationResultsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStackSetOperationResultsResponse
-> ListStackSetOperationResultsResponse -> Bool
$c/= :: ListStackSetOperationResultsResponse
-> ListStackSetOperationResultsResponse -> Bool
== :: ListStackSetOperationResultsResponse
-> ListStackSetOperationResultsResponse -> Bool
$c== :: ListStackSetOperationResultsResponse
-> ListStackSetOperationResultsResponse -> Bool
Prelude.Eq, ReadPrec [ListStackSetOperationResultsResponse]
ReadPrec ListStackSetOperationResultsResponse
Int -> ReadS ListStackSetOperationResultsResponse
ReadS [ListStackSetOperationResultsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStackSetOperationResultsResponse]
$creadListPrec :: ReadPrec [ListStackSetOperationResultsResponse]
readPrec :: ReadPrec ListStackSetOperationResultsResponse
$creadPrec :: ReadPrec ListStackSetOperationResultsResponse
readList :: ReadS [ListStackSetOperationResultsResponse]
$creadList :: ReadS [ListStackSetOperationResultsResponse]
readsPrec :: Int -> ReadS ListStackSetOperationResultsResponse
$creadsPrec :: Int -> ReadS ListStackSetOperationResultsResponse
Prelude.Read, Int -> ListStackSetOperationResultsResponse -> ShowS
[ListStackSetOperationResultsResponse] -> ShowS
ListStackSetOperationResultsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStackSetOperationResultsResponse] -> ShowS
$cshowList :: [ListStackSetOperationResultsResponse] -> ShowS
show :: ListStackSetOperationResultsResponse -> String
$cshow :: ListStackSetOperationResultsResponse -> String
showsPrec :: Int -> ListStackSetOperationResultsResponse -> ShowS
$cshowsPrec :: Int -> ListStackSetOperationResultsResponse -> ShowS
Prelude.Show, forall x.
Rep ListStackSetOperationResultsResponse x
-> ListStackSetOperationResultsResponse
forall x.
ListStackSetOperationResultsResponse
-> Rep ListStackSetOperationResultsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListStackSetOperationResultsResponse x
-> ListStackSetOperationResultsResponse
$cfrom :: forall x.
ListStackSetOperationResultsResponse
-> Rep ListStackSetOperationResultsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListStackSetOperationResultsResponse' 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', 'listStackSetOperationResultsResponse_nextToken' - If the request doesn\'t return all results, @NextToken@ is set to a
-- token. To retrieve the next set of results, call @ListOperationResults@
-- again and assign that token to the request object\'s @NextToken@
-- parameter. If there are no remaining results, @NextToken@ is set to
-- @null@.
--
-- 'summaries', 'listStackSetOperationResultsResponse_summaries' - A list of @StackSetOperationResultSummary@ structures that contain
-- information about the specified operation results, for accounts and
-- Amazon Web Services Regions that are included in the operation.
--
-- 'httpStatus', 'listStackSetOperationResultsResponse_httpStatus' - The response's http status code.
newListStackSetOperationResultsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStackSetOperationResultsResponse
newListStackSetOperationResultsResponse :: Int -> ListStackSetOperationResultsResponse
newListStackSetOperationResultsResponse Int
pHttpStatus_ =
  ListStackSetOperationResultsResponse'
    { $sel:nextToken:ListStackSetOperationResultsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:ListStackSetOperationResultsResponse' :: Maybe [StackSetOperationResultSummary]
summaries = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStackSetOperationResultsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A list of @StackSetOperationResultSummary@ structures that contain
-- information about the specified operation results, for accounts and
-- Amazon Web Services Regions that are included in the operation.
listStackSetOperationResultsResponse_summaries :: Lens.Lens' ListStackSetOperationResultsResponse (Prelude.Maybe [StackSetOperationResultSummary])
listStackSetOperationResultsResponse_summaries :: Lens'
  ListStackSetOperationResultsResponse
  (Maybe [StackSetOperationResultSummary])
listStackSetOperationResultsResponse_summaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationResultsResponse' {Maybe [StackSetOperationResultSummary]
summaries :: Maybe [StackSetOperationResultSummary]
$sel:summaries:ListStackSetOperationResultsResponse' :: ListStackSetOperationResultsResponse
-> Maybe [StackSetOperationResultSummary]
summaries} -> Maybe [StackSetOperationResultSummary]
summaries) (\s :: ListStackSetOperationResultsResponse
s@ListStackSetOperationResultsResponse' {} Maybe [StackSetOperationResultSummary]
a -> ListStackSetOperationResultsResponse
s {$sel:summaries:ListStackSetOperationResultsResponse' :: Maybe [StackSetOperationResultSummary]
summaries = Maybe [StackSetOperationResultSummary]
a} :: ListStackSetOperationResultsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListStackSetOperationResultsResponse
  where
  rnf :: ListStackSetOperationResultsResponse -> ()
rnf ListStackSetOperationResultsResponse' {Int
Maybe [StackSetOperationResultSummary]
Maybe Text
httpStatus :: Int
summaries :: Maybe [StackSetOperationResultSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListStackSetOperationResultsResponse' :: ListStackSetOperationResultsResponse -> Int
$sel:summaries:ListStackSetOperationResultsResponse' :: ListStackSetOperationResultsResponse
-> Maybe [StackSetOperationResultSummary]
$sel:nextToken:ListStackSetOperationResultsResponse' :: ListStackSetOperationResultsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StackSetOperationResultSummary]
summaries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus