{-# 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-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 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_nextToken,
    listStackSetOperationResults_maxResults,
    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.Lens as Lens
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,
    -- | If the previous request didn\'t return all of 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 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,
    -- | 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
(ListStackSetOperationResults
 -> ListStackSetOperationResults -> Bool)
-> (ListStackSetOperationResults
    -> ListStackSetOperationResults -> Bool)
-> Eq ListStackSetOperationResults
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]
(Int -> ReadS ListStackSetOperationResults)
-> ReadS [ListStackSetOperationResults]
-> ReadPrec ListStackSetOperationResults
-> ReadPrec [ListStackSetOperationResults]
-> Read 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
(Int -> ListStackSetOperationResults -> ShowS)
-> (ListStackSetOperationResults -> String)
-> ([ListStackSetOperationResults] -> ShowS)
-> Show ListStackSetOperationResults
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.
 ListStackSetOperationResults -> Rep ListStackSetOperationResults x)
-> (forall x.
    Rep ListStackSetOperationResults x -> ListStackSetOperationResults)
-> Generic ListStackSetOperationResults
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/.
--
-- 'nextToken', 'listStackSetOperationResults_nextToken' - If the previous request didn\'t return all of 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@.
--
-- '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.
--
-- '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' :: Maybe CallAs
-> Maybe Text
-> Maybe Natural
-> Text
-> Text
-> ListStackSetOperationResults
ListStackSetOperationResults'
      { $sel:callAs:ListStackSetOperationResults' :: Maybe CallAs
callAs =
          Maybe CallAs
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:ListStackSetOperationResults' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListStackSetOperationResults' :: Maybe Natural
maxResults = Maybe Natural
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 :: (Maybe CallAs -> f (Maybe CallAs))
-> ListStackSetOperationResults -> f ListStackSetOperationResults
listStackSetOperationResults_callAs = (ListStackSetOperationResults -> Maybe CallAs)
-> (ListStackSetOperationResults
    -> Maybe CallAs -> ListStackSetOperationResults)
-> Lens
     ListStackSetOperationResults
     ListStackSetOperationResults
     (Maybe CallAs)
     (Maybe 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)

-- | If the previous request didn\'t return all of 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 :: (Maybe Text -> f (Maybe Text))
-> ListStackSetOperationResults -> f ListStackSetOperationResults
listStackSetOperationResults_nextToken = (ListStackSetOperationResults -> Maybe Text)
-> (ListStackSetOperationResults
    -> Maybe Text -> ListStackSetOperationResults)
-> Lens
     ListStackSetOperationResults
     ListStackSetOperationResults
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Natural -> f (Maybe Natural))
-> ListStackSetOperationResults -> f ListStackSetOperationResults
listStackSetOperationResults_maxResults = (ListStackSetOperationResults -> Maybe Natural)
-> (ListStackSetOperationResults
    -> Maybe Natural -> ListStackSetOperationResults)
-> Lens
     ListStackSetOperationResults
     ListStackSetOperationResults
     (Maybe Natural)
     (Maybe Natural)
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)

-- | 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 :: (Text -> f Text)
-> ListStackSetOperationResults -> f ListStackSetOperationResults
listStackSetOperationResults_stackSetName = (ListStackSetOperationResults -> Text)
-> (ListStackSetOperationResults
    -> Text -> ListStackSetOperationResults)
-> Lens
     ListStackSetOperationResults ListStackSetOperationResults Text Text
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 :: (Text -> f Text)
-> ListStackSetOperationResults -> f ListStackSetOperationResults
listStackSetOperationResults_operationId = (ListStackSetOperationResults -> Text)
-> (ListStackSetOperationResults
    -> Text -> ListStackSetOperationResults)
-> Lens
     ListStackSetOperationResults ListStackSetOperationResults Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSetOperationResults
ListStackSetOperationResultsResponse
rs
            ListStackSetOperationResultsResponse
-> Getting (First Text) ListStackSetOperationResultsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStackSetOperationResultsResponse
-> Const (First Text) ListStackSetOperationResultsResponse
Lens' ListStackSetOperationResultsResponse (Maybe Text)
listStackSetOperationResultsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStackSetOperationResultsResponse
 -> Const (First Text) ListStackSetOperationResultsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStackSetOperationResultsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListStackSetOperationResults
forall a. Maybe a
Prelude.Nothing
    | Maybe [StackSetOperationResultSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSetOperationResults
ListStackSetOperationResultsResponse
rs
            ListStackSetOperationResultsResponse
-> Getting
     (First [StackSetOperationResultSummary])
     ListStackSetOperationResultsResponse
     [StackSetOperationResultSummary]
-> Maybe [StackSetOperationResultSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [StackSetOperationResultSummary]
 -> Const
      (First [StackSetOperationResultSummary])
      (Maybe [StackSetOperationResultSummary]))
-> ListStackSetOperationResultsResponse
-> Const
     (First [StackSetOperationResultSummary])
     ListStackSetOperationResultsResponse
Lens'
  ListStackSetOperationResultsResponse
  (Maybe [StackSetOperationResultSummary])
listStackSetOperationResultsResponse_summaries
              ((Maybe [StackSetOperationResultSummary]
  -> Const
       (First [StackSetOperationResultSummary])
       (Maybe [StackSetOperationResultSummary]))
 -> ListStackSetOperationResultsResponse
 -> Const
      (First [StackSetOperationResultSummary])
      ListStackSetOperationResultsResponse)
-> (([StackSetOperationResultSummary]
     -> Const
          (First [StackSetOperationResultSummary])
          [StackSetOperationResultSummary])
    -> Maybe [StackSetOperationResultSummary]
    -> Const
         (First [StackSetOperationResultSummary])
         (Maybe [StackSetOperationResultSummary]))
-> Getting
     (First [StackSetOperationResultSummary])
     ListStackSetOperationResultsResponse
     [StackSetOperationResultSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([StackSetOperationResultSummary]
 -> Const
      (First [StackSetOperationResultSummary])
      [StackSetOperationResultSummary])
-> Maybe [StackSetOperationResultSummary]
-> Const
     (First [StackSetOperationResultSummary])
     (Maybe [StackSetOperationResultSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListStackSetOperationResults
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListStackSetOperationResults -> Maybe ListStackSetOperationResults
forall a. a -> Maybe a
Prelude.Just (ListStackSetOperationResults
 -> Maybe ListStackSetOperationResults)
-> ListStackSetOperationResults
-> Maybe ListStackSetOperationResults
forall a b. (a -> b) -> a -> b
Prelude.$
        ListStackSetOperationResults
rq
          ListStackSetOperationResults
-> (ListStackSetOperationResults -> ListStackSetOperationResults)
-> ListStackSetOperationResults
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListStackSetOperationResults
-> Identity ListStackSetOperationResults
Lens
  ListStackSetOperationResults
  ListStackSetOperationResults
  (Maybe Text)
  (Maybe Text)
listStackSetOperationResults_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListStackSetOperationResults
 -> Identity ListStackSetOperationResults)
-> Maybe Text
-> ListStackSetOperationResults
-> ListStackSetOperationResults
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStackSetOperationResults
ListStackSetOperationResultsResponse
rs
          ListStackSetOperationResultsResponse
-> Getting (First Text) ListStackSetOperationResultsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStackSetOperationResultsResponse
-> Const (First Text) ListStackSetOperationResultsResponse
Lens' ListStackSetOperationResultsResponse (Maybe Text)
listStackSetOperationResultsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStackSetOperationResultsResponse
 -> Const (First Text) ListStackSetOperationResultsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStackSetOperationResultsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListStackSetOperationResults where
  type
    AWSResponse ListStackSetOperationResults =
      ListStackSetOperationResultsResponse
  request :: ListStackSetOperationResults
-> Request ListStackSetOperationResults
request = Service
-> ListStackSetOperationResults
-> Request ListStackSetOperationResults
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListStackSetOperationResults
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListStackSetOperationResults)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListStackSetOperationResults))
-> Logger
-> Service
-> Proxy ListStackSetOperationResults
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListStackSetOperationResults)))
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
"ListStackSetOperationResultsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [StackSetOperationResultSummary]
-> Int
-> ListStackSetOperationResultsResponse
ListStackSetOperationResultsResponse'
            (Maybe Text
 -> Maybe [StackSetOperationResultSummary]
 -> Int
 -> ListStackSetOperationResultsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [StackSetOperationResultSummary]
      -> Int -> ListStackSetOperationResultsResponse)
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
  (Maybe [StackSetOperationResultSummary]
   -> Int -> ListStackSetOperationResultsResponse)
-> Either String (Maybe [StackSetOperationResultSummary])
-> Either String (Int -> ListStackSetOperationResultsResponse)
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
"Summaries" 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 (Maybe [StackSetOperationResultSummary]))
-> Either String (Maybe [StackSetOperationResultSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [StackSetOperationResultSummary])
-> [Node] -> Either String (Maybe [StackSetOperationResultSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [StackSetOperationResultSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ListStackSetOperationResultsResponse)
-> Either String Int
-> Either String ListStackSetOperationResultsResponse
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))
      )

instance
  Prelude.Hashable
    ListStackSetOperationResults

instance Prelude.NFData ListStackSetOperationResults

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

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

instance Core.ToQuery ListStackSetOperationResults where
  toQuery :: ListStackSetOperationResults -> QueryString
toQuery ListStackSetOperationResults' {Maybe Natural
Maybe Text
Maybe CallAs
Text
operationId :: Text
stackSetName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
callAs :: Maybe CallAs
$sel:operationId:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:stackSetName:ListStackSetOperationResults' :: ListStackSetOperationResults -> Text
$sel:maxResults:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Natural
$sel:nextToken:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe Text
$sel:callAs:ListStackSetOperationResults' :: ListStackSetOperationResults -> Maybe CallAs
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"ListStackSetOperationResults" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"CallAs" ByteString -> Maybe CallAs -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe CallAs
callAs,
        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
"StackSetName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackSetName,
        ByteString
"OperationId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: 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
    -- 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
(ListStackSetOperationResultsResponse
 -> ListStackSetOperationResultsResponse -> Bool)
-> (ListStackSetOperationResultsResponse
    -> ListStackSetOperationResultsResponse -> Bool)
-> Eq ListStackSetOperationResultsResponse
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]
(Int -> ReadS ListStackSetOperationResultsResponse)
-> ReadS [ListStackSetOperationResultsResponse]
-> ReadPrec ListStackSetOperationResultsResponse
-> ReadPrec [ListStackSetOperationResultsResponse]
-> Read 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
(Int -> ListStackSetOperationResultsResponse -> ShowS)
-> (ListStackSetOperationResultsResponse -> String)
-> ([ListStackSetOperationResultsResponse] -> ShowS)
-> Show ListStackSetOperationResultsResponse
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.
 ListStackSetOperationResultsResponse
 -> Rep ListStackSetOperationResultsResponse x)
-> (forall x.
    Rep ListStackSetOperationResultsResponse x
    -> ListStackSetOperationResultsResponse)
-> Generic ListStackSetOperationResultsResponse
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
-- 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' :: Maybe Text
-> Maybe [StackSetOperationResultSummary]
-> Int
-> ListStackSetOperationResultsResponse
ListStackSetOperationResultsResponse'
    { $sel:nextToken:ListStackSetOperationResultsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:ListStackSetOperationResultsResponse' :: Maybe [StackSetOperationResultSummary]
summaries = Maybe [StackSetOperationResultSummary]
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 :: (Maybe Text -> f (Maybe Text))
-> ListStackSetOperationResultsResponse
-> f ListStackSetOperationResultsResponse
listStackSetOperationResultsResponse_nextToken = (ListStackSetOperationResultsResponse -> Maybe Text)
-> (ListStackSetOperationResultsResponse
    -> Maybe Text -> ListStackSetOperationResultsResponse)
-> Lens' ListStackSetOperationResultsResponse (Maybe Text)
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
-- Regions that are included in the operation.
listStackSetOperationResultsResponse_summaries :: Lens.Lens' ListStackSetOperationResultsResponse (Prelude.Maybe [StackSetOperationResultSummary])
listStackSetOperationResultsResponse_summaries :: (Maybe [StackSetOperationResultSummary]
 -> f (Maybe [StackSetOperationResultSummary]))
-> ListStackSetOperationResultsResponse
-> f ListStackSetOperationResultsResponse
listStackSetOperationResultsResponse_summaries = (ListStackSetOperationResultsResponse
 -> Maybe [StackSetOperationResultSummary])
-> (ListStackSetOperationResultsResponse
    -> Maybe [StackSetOperationResultSummary]
    -> ListStackSetOperationResultsResponse)
-> Lens'
     ListStackSetOperationResultsResponse
     (Maybe [StackSetOperationResultSummary])
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) ((Maybe [StackSetOperationResultSummary]
  -> f (Maybe [StackSetOperationResultSummary]))
 -> ListStackSetOperationResultsResponse
 -> f ListStackSetOperationResultsResponse)
-> ((Maybe [StackSetOperationResultSummary]
     -> f (Maybe [StackSetOperationResultSummary]))
    -> Maybe [StackSetOperationResultSummary]
    -> f (Maybe [StackSetOperationResultSummary]))
-> (Maybe [StackSetOperationResultSummary]
    -> f (Maybe [StackSetOperationResultSummary]))
-> ListStackSetOperationResultsResponse
-> f ListStackSetOperationResultsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [StackSetOperationResultSummary]
  [StackSetOperationResultSummary]
  [StackSetOperationResultSummary]
  [StackSetOperationResultSummary]
-> Iso
     (Maybe [StackSetOperationResultSummary])
     (Maybe [StackSetOperationResultSummary])
     (Maybe [StackSetOperationResultSummary])
     (Maybe [StackSetOperationResultSummary])
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
  [StackSetOperationResultSummary]
  [StackSetOperationResultSummary]
  [StackSetOperationResultSummary]
  [StackSetOperationResultSummary]
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 :: (Int -> f Int)
-> ListStackSetOperationResultsResponse
-> f ListStackSetOperationResultsResponse
listStackSetOperationResultsResponse_httpStatus = (ListStackSetOperationResultsResponse -> Int)
-> (ListStackSetOperationResultsResponse
    -> Int -> ListStackSetOperationResultsResponse)
-> Lens
     ListStackSetOperationResultsResponse
     ListStackSetOperationResultsResponse
     Int
     Int
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