{-# 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.ListStackSetOperations
-- 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 operations performed on a stack set.
--
-- This operation returns paginated results.
module Amazonka.CloudFormation.ListStackSetOperations
  ( -- * Creating a Request
    ListStackSetOperations (..),
    newListStackSetOperations,

    -- * Request Lenses
    listStackSetOperations_callAs,
    listStackSetOperations_nextToken,
    listStackSetOperations_maxResults,
    listStackSetOperations_stackSetName,

    -- * Destructuring the Response
    ListStackSetOperationsResponse (..),
    newListStackSetOperationsResponse,

    -- * Response Lenses
    listStackSetOperationsResponse_nextToken,
    listStackSetOperationsResponse_summaries,
    listStackSetOperationsResponse_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:/ 'newListStackSetOperations' smart constructor.
data ListStackSetOperations = ListStackSetOperations'
  { -- | [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/.
    ListStackSetOperations -> Maybe CallAs
callAs :: Prelude.Maybe CallAs,
    -- | If the previous paginated 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
    -- @ListStackSetOperations@ 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@.
    ListStackSetOperations -> 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.
    ListStackSetOperations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name or unique ID of the stack set that you want to get operation
    -- summaries for.
    ListStackSetOperations -> Text
stackSetName :: Prelude.Text
  }
  deriving (ListStackSetOperations -> ListStackSetOperations -> Bool
(ListStackSetOperations -> ListStackSetOperations -> Bool)
-> (ListStackSetOperations -> ListStackSetOperations -> Bool)
-> Eq ListStackSetOperations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStackSetOperations -> ListStackSetOperations -> Bool
$c/= :: ListStackSetOperations -> ListStackSetOperations -> Bool
== :: ListStackSetOperations -> ListStackSetOperations -> Bool
$c== :: ListStackSetOperations -> ListStackSetOperations -> Bool
Prelude.Eq, ReadPrec [ListStackSetOperations]
ReadPrec ListStackSetOperations
Int -> ReadS ListStackSetOperations
ReadS [ListStackSetOperations]
(Int -> ReadS ListStackSetOperations)
-> ReadS [ListStackSetOperations]
-> ReadPrec ListStackSetOperations
-> ReadPrec [ListStackSetOperations]
-> Read ListStackSetOperations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStackSetOperations]
$creadListPrec :: ReadPrec [ListStackSetOperations]
readPrec :: ReadPrec ListStackSetOperations
$creadPrec :: ReadPrec ListStackSetOperations
readList :: ReadS [ListStackSetOperations]
$creadList :: ReadS [ListStackSetOperations]
readsPrec :: Int -> ReadS ListStackSetOperations
$creadsPrec :: Int -> ReadS ListStackSetOperations
Prelude.Read, Int -> ListStackSetOperations -> ShowS
[ListStackSetOperations] -> ShowS
ListStackSetOperations -> String
(Int -> ListStackSetOperations -> ShowS)
-> (ListStackSetOperations -> String)
-> ([ListStackSetOperations] -> ShowS)
-> Show ListStackSetOperations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStackSetOperations] -> ShowS
$cshowList :: [ListStackSetOperations] -> ShowS
show :: ListStackSetOperations -> String
$cshow :: ListStackSetOperations -> String
showsPrec :: Int -> ListStackSetOperations -> ShowS
$cshowsPrec :: Int -> ListStackSetOperations -> ShowS
Prelude.Show, (forall x. ListStackSetOperations -> Rep ListStackSetOperations x)
-> (forall x.
    Rep ListStackSetOperations x -> ListStackSetOperations)
-> Generic ListStackSetOperations
forall x. Rep ListStackSetOperations x -> ListStackSetOperations
forall x. ListStackSetOperations -> Rep ListStackSetOperations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStackSetOperations x -> ListStackSetOperations
$cfrom :: forall x. ListStackSetOperations -> Rep ListStackSetOperations x
Prelude.Generic)

-- |
-- Create a value of 'ListStackSetOperations' 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', 'listStackSetOperations_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', 'listStackSetOperations_nextToken' - If the previous paginated 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
-- @ListStackSetOperations@ 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', 'listStackSetOperations_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', 'listStackSetOperations_stackSetName' - The name or unique ID of the stack set that you want to get operation
-- summaries for.
newListStackSetOperations ::
  -- | 'stackSetName'
  Prelude.Text ->
  ListStackSetOperations
newListStackSetOperations :: Text -> ListStackSetOperations
newListStackSetOperations Text
pStackSetName_ =
  ListStackSetOperations' :: Maybe CallAs
-> Maybe Text -> Maybe Natural -> Text -> ListStackSetOperations
ListStackSetOperations'
    { $sel:callAs:ListStackSetOperations' :: Maybe CallAs
callAs = Maybe CallAs
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListStackSetOperations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListStackSetOperations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:stackSetName:ListStackSetOperations' :: Text
stackSetName = Text
pStackSetName_
    }

-- | [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/.
listStackSetOperations_callAs :: Lens.Lens' ListStackSetOperations (Prelude.Maybe CallAs)
listStackSetOperations_callAs :: (Maybe CallAs -> f (Maybe CallAs))
-> ListStackSetOperations -> f ListStackSetOperations
listStackSetOperations_callAs = (ListStackSetOperations -> Maybe CallAs)
-> (ListStackSetOperations
    -> Maybe CallAs -> ListStackSetOperations)
-> Lens
     ListStackSetOperations
     ListStackSetOperations
     (Maybe CallAs)
     (Maybe CallAs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperations' {Maybe CallAs
callAs :: Maybe CallAs
$sel:callAs:ListStackSetOperations' :: ListStackSetOperations -> Maybe CallAs
callAs} -> Maybe CallAs
callAs) (\s :: ListStackSetOperations
s@ListStackSetOperations' {} Maybe CallAs
a -> ListStackSetOperations
s {$sel:callAs:ListStackSetOperations' :: Maybe CallAs
callAs = Maybe CallAs
a} :: ListStackSetOperations)

-- | If the previous paginated 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
-- @ListStackSetOperations@ 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@.
listStackSetOperations_nextToken :: Lens.Lens' ListStackSetOperations (Prelude.Maybe Prelude.Text)
listStackSetOperations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListStackSetOperations -> f ListStackSetOperations
listStackSetOperations_nextToken = (ListStackSetOperations -> Maybe Text)
-> (ListStackSetOperations -> Maybe Text -> ListStackSetOperations)
-> Lens
     ListStackSetOperations
     ListStackSetOperations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStackSetOperations' :: ListStackSetOperations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStackSetOperations
s@ListStackSetOperations' {} Maybe Text
a -> ListStackSetOperations
s {$sel:nextToken:ListStackSetOperations' :: Maybe Text
nextToken = Maybe Text
a} :: ListStackSetOperations)

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

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

instance Core.AWSPager ListStackSetOperations where
  page :: ListStackSetOperations
-> AWSResponse ListStackSetOperations
-> Maybe ListStackSetOperations
page ListStackSetOperations
rq AWSResponse ListStackSetOperations
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSetOperations
ListStackSetOperationsResponse
rs
            ListStackSetOperationsResponse
-> Getting (First Text) ListStackSetOperationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStackSetOperationsResponse
-> Const (First Text) ListStackSetOperationsResponse
Lens' ListStackSetOperationsResponse (Maybe Text)
listStackSetOperationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStackSetOperationsResponse
 -> Const (First Text) ListStackSetOperationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStackSetOperationsResponse 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 ListStackSetOperations
forall a. Maybe a
Prelude.Nothing
    | Maybe [StackSetOperationSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStackSetOperations
ListStackSetOperationsResponse
rs
            ListStackSetOperationsResponse
-> Getting
     (First [StackSetOperationSummary])
     ListStackSetOperationsResponse
     [StackSetOperationSummary]
-> Maybe [StackSetOperationSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [StackSetOperationSummary]
 -> Const
      (First [StackSetOperationSummary])
      (Maybe [StackSetOperationSummary]))
-> ListStackSetOperationsResponse
-> Const
     (First [StackSetOperationSummary]) ListStackSetOperationsResponse
Lens'
  ListStackSetOperationsResponse (Maybe [StackSetOperationSummary])
listStackSetOperationsResponse_summaries
              ((Maybe [StackSetOperationSummary]
  -> Const
       (First [StackSetOperationSummary])
       (Maybe [StackSetOperationSummary]))
 -> ListStackSetOperationsResponse
 -> Const
      (First [StackSetOperationSummary]) ListStackSetOperationsResponse)
-> (([StackSetOperationSummary]
     -> Const
          (First [StackSetOperationSummary]) [StackSetOperationSummary])
    -> Maybe [StackSetOperationSummary]
    -> Const
         (First [StackSetOperationSummary])
         (Maybe [StackSetOperationSummary]))
-> Getting
     (First [StackSetOperationSummary])
     ListStackSetOperationsResponse
     [StackSetOperationSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([StackSetOperationSummary]
 -> Const
      (First [StackSetOperationSummary]) [StackSetOperationSummary])
-> Maybe [StackSetOperationSummary]
-> Const
     (First [StackSetOperationSummary])
     (Maybe [StackSetOperationSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListStackSetOperations
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListStackSetOperations -> Maybe ListStackSetOperations
forall a. a -> Maybe a
Prelude.Just (ListStackSetOperations -> Maybe ListStackSetOperations)
-> ListStackSetOperations -> Maybe ListStackSetOperations
forall a b. (a -> b) -> a -> b
Prelude.$
        ListStackSetOperations
rq
          ListStackSetOperations
-> (ListStackSetOperations -> ListStackSetOperations)
-> ListStackSetOperations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListStackSetOperations -> Identity ListStackSetOperations
Lens
  ListStackSetOperations
  ListStackSetOperations
  (Maybe Text)
  (Maybe Text)
listStackSetOperations_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListStackSetOperations -> Identity ListStackSetOperations)
-> Maybe Text -> ListStackSetOperations -> ListStackSetOperations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStackSetOperations
ListStackSetOperationsResponse
rs
          ListStackSetOperationsResponse
-> Getting (First Text) ListStackSetOperationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListStackSetOperationsResponse
-> Const (First Text) ListStackSetOperationsResponse
Lens' ListStackSetOperationsResponse (Maybe Text)
listStackSetOperationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListStackSetOperationsResponse
 -> Const (First Text) ListStackSetOperationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListStackSetOperationsResponse 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 ListStackSetOperations where
  type
    AWSResponse ListStackSetOperations =
      ListStackSetOperationsResponse
  request :: ListStackSetOperations -> Request ListStackSetOperations
request = Service -> ListStackSetOperations -> Request ListStackSetOperations
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListStackSetOperations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListStackSetOperations)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListStackSetOperations))
-> Logger
-> Service
-> Proxy ListStackSetOperations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListStackSetOperations)))
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
"ListStackSetOperationsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [StackSetOperationSummary]
-> Int
-> ListStackSetOperationsResponse
ListStackSetOperationsResponse'
            (Maybe Text
 -> Maybe [StackSetOperationSummary]
 -> Int
 -> ListStackSetOperationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [StackSetOperationSummary]
      -> Int -> ListStackSetOperationsResponse)
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 [StackSetOperationSummary]
   -> Int -> ListStackSetOperationsResponse)
-> Either String (Maybe [StackSetOperationSummary])
-> Either String (Int -> ListStackSetOperationsResponse)
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 [StackSetOperationSummary]))
-> Either String (Maybe [StackSetOperationSummary])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [StackSetOperationSummary])
-> [Node] -> Either String (Maybe [StackSetOperationSummary])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [StackSetOperationSummary]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ListStackSetOperationsResponse)
-> Either String Int
-> Either String ListStackSetOperationsResponse
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 ListStackSetOperations

instance Prelude.NFData ListStackSetOperations

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

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

instance Core.ToQuery ListStackSetOperations where
  toQuery :: ListStackSetOperations -> QueryString
toQuery ListStackSetOperations' {Maybe Natural
Maybe Text
Maybe CallAs
Text
stackSetName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
callAs :: Maybe CallAs
$sel:stackSetName:ListStackSetOperations' :: ListStackSetOperations -> Text
$sel:maxResults:ListStackSetOperations' :: ListStackSetOperations -> Maybe Natural
$sel:nextToken:ListStackSetOperations' :: ListStackSetOperations -> Maybe Text
$sel:callAs:ListStackSetOperations' :: ListStackSetOperations -> 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
"ListStackSetOperations" :: 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
      ]

-- | /See:/ 'newListStackSetOperationsResponse' smart constructor.
data ListStackSetOperationsResponse = ListStackSetOperationsResponse'
  { -- | 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@.
    ListStackSetOperationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of @StackSetOperationSummary@ structures that contain summary
    -- information about operations for the specified stack set.
    ListStackSetOperationsResponse -> Maybe [StackSetOperationSummary]
summaries :: Prelude.Maybe [StackSetOperationSummary],
    -- | The response's http status code.
    ListStackSetOperationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListStackSetOperationsResponse
-> ListStackSetOperationsResponse -> Bool
(ListStackSetOperationsResponse
 -> ListStackSetOperationsResponse -> Bool)
-> (ListStackSetOperationsResponse
    -> ListStackSetOperationsResponse -> Bool)
-> Eq ListStackSetOperationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStackSetOperationsResponse
-> ListStackSetOperationsResponse -> Bool
$c/= :: ListStackSetOperationsResponse
-> ListStackSetOperationsResponse -> Bool
== :: ListStackSetOperationsResponse
-> ListStackSetOperationsResponse -> Bool
$c== :: ListStackSetOperationsResponse
-> ListStackSetOperationsResponse -> Bool
Prelude.Eq, ReadPrec [ListStackSetOperationsResponse]
ReadPrec ListStackSetOperationsResponse
Int -> ReadS ListStackSetOperationsResponse
ReadS [ListStackSetOperationsResponse]
(Int -> ReadS ListStackSetOperationsResponse)
-> ReadS [ListStackSetOperationsResponse]
-> ReadPrec ListStackSetOperationsResponse
-> ReadPrec [ListStackSetOperationsResponse]
-> Read ListStackSetOperationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStackSetOperationsResponse]
$creadListPrec :: ReadPrec [ListStackSetOperationsResponse]
readPrec :: ReadPrec ListStackSetOperationsResponse
$creadPrec :: ReadPrec ListStackSetOperationsResponse
readList :: ReadS [ListStackSetOperationsResponse]
$creadList :: ReadS [ListStackSetOperationsResponse]
readsPrec :: Int -> ReadS ListStackSetOperationsResponse
$creadsPrec :: Int -> ReadS ListStackSetOperationsResponse
Prelude.Read, Int -> ListStackSetOperationsResponse -> ShowS
[ListStackSetOperationsResponse] -> ShowS
ListStackSetOperationsResponse -> String
(Int -> ListStackSetOperationsResponse -> ShowS)
-> (ListStackSetOperationsResponse -> String)
-> ([ListStackSetOperationsResponse] -> ShowS)
-> Show ListStackSetOperationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStackSetOperationsResponse] -> ShowS
$cshowList :: [ListStackSetOperationsResponse] -> ShowS
show :: ListStackSetOperationsResponse -> String
$cshow :: ListStackSetOperationsResponse -> String
showsPrec :: Int -> ListStackSetOperationsResponse -> ShowS
$cshowsPrec :: Int -> ListStackSetOperationsResponse -> ShowS
Prelude.Show, (forall x.
 ListStackSetOperationsResponse
 -> Rep ListStackSetOperationsResponse x)
-> (forall x.
    Rep ListStackSetOperationsResponse x
    -> ListStackSetOperationsResponse)
-> Generic ListStackSetOperationsResponse
forall x.
Rep ListStackSetOperationsResponse x
-> ListStackSetOperationsResponse
forall x.
ListStackSetOperationsResponse
-> Rep ListStackSetOperationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListStackSetOperationsResponse x
-> ListStackSetOperationsResponse
$cfrom :: forall x.
ListStackSetOperationsResponse
-> Rep ListStackSetOperationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListStackSetOperationsResponse' 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', 'listStackSetOperationsResponse_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', 'listStackSetOperationsResponse_summaries' - A list of @StackSetOperationSummary@ structures that contain summary
-- information about operations for the specified stack set.
--
-- 'httpStatus', 'listStackSetOperationsResponse_httpStatus' - The response's http status code.
newListStackSetOperationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStackSetOperationsResponse
newListStackSetOperationsResponse :: Int -> ListStackSetOperationsResponse
newListStackSetOperationsResponse Int
pHttpStatus_ =
  ListStackSetOperationsResponse' :: Maybe Text
-> Maybe [StackSetOperationSummary]
-> Int
-> ListStackSetOperationsResponse
ListStackSetOperationsResponse'
    { $sel:nextToken:ListStackSetOperationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:ListStackSetOperationsResponse' :: Maybe [StackSetOperationSummary]
summaries = Maybe [StackSetOperationSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStackSetOperationsResponse' :: 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@.
listStackSetOperationsResponse_nextToken :: Lens.Lens' ListStackSetOperationsResponse (Prelude.Maybe Prelude.Text)
listStackSetOperationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListStackSetOperationsResponse
-> f ListStackSetOperationsResponse
listStackSetOperationsResponse_nextToken = (ListStackSetOperationsResponse -> Maybe Text)
-> (ListStackSetOperationsResponse
    -> Maybe Text -> ListStackSetOperationsResponse)
-> Lens' ListStackSetOperationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStackSetOperationsResponse' :: ListStackSetOperationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStackSetOperationsResponse
s@ListStackSetOperationsResponse' {} Maybe Text
a -> ListStackSetOperationsResponse
s {$sel:nextToken:ListStackSetOperationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListStackSetOperationsResponse)

-- | A list of @StackSetOperationSummary@ structures that contain summary
-- information about operations for the specified stack set.
listStackSetOperationsResponse_summaries :: Lens.Lens' ListStackSetOperationsResponse (Prelude.Maybe [StackSetOperationSummary])
listStackSetOperationsResponse_summaries :: (Maybe [StackSetOperationSummary]
 -> f (Maybe [StackSetOperationSummary]))
-> ListStackSetOperationsResponse
-> f ListStackSetOperationsResponse
listStackSetOperationsResponse_summaries = (ListStackSetOperationsResponse
 -> Maybe [StackSetOperationSummary])
-> (ListStackSetOperationsResponse
    -> Maybe [StackSetOperationSummary]
    -> ListStackSetOperationsResponse)
-> Lens'
     ListStackSetOperationsResponse (Maybe [StackSetOperationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStackSetOperationsResponse' {Maybe [StackSetOperationSummary]
summaries :: Maybe [StackSetOperationSummary]
$sel:summaries:ListStackSetOperationsResponse' :: ListStackSetOperationsResponse -> Maybe [StackSetOperationSummary]
summaries} -> Maybe [StackSetOperationSummary]
summaries) (\s :: ListStackSetOperationsResponse
s@ListStackSetOperationsResponse' {} Maybe [StackSetOperationSummary]
a -> ListStackSetOperationsResponse
s {$sel:summaries:ListStackSetOperationsResponse' :: Maybe [StackSetOperationSummary]
summaries = Maybe [StackSetOperationSummary]
a} :: ListStackSetOperationsResponse) ((Maybe [StackSetOperationSummary]
  -> f (Maybe [StackSetOperationSummary]))
 -> ListStackSetOperationsResponse
 -> f ListStackSetOperationsResponse)
-> ((Maybe [StackSetOperationSummary]
     -> f (Maybe [StackSetOperationSummary]))
    -> Maybe [StackSetOperationSummary]
    -> f (Maybe [StackSetOperationSummary]))
-> (Maybe [StackSetOperationSummary]
    -> f (Maybe [StackSetOperationSummary]))
-> ListStackSetOperationsResponse
-> f ListStackSetOperationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [StackSetOperationSummary]
  [StackSetOperationSummary]
  [StackSetOperationSummary]
  [StackSetOperationSummary]
-> Iso
     (Maybe [StackSetOperationSummary])
     (Maybe [StackSetOperationSummary])
     (Maybe [StackSetOperationSummary])
     (Maybe [StackSetOperationSummary])
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
  [StackSetOperationSummary]
  [StackSetOperationSummary]
  [StackSetOperationSummary]
  [StackSetOperationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListStackSetOperationsResponse