{-# 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.ListChangeSets
-- 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 the ID and status of each active change set for a stack. For
-- example, CloudFormation lists change sets that are in the
-- @CREATE_IN_PROGRESS@ or @CREATE_PENDING@ state.
--
-- This operation returns paginated results.
module Amazonka.CloudFormation.ListChangeSets
  ( -- * Creating a Request
    ListChangeSets (..),
    newListChangeSets,

    -- * Request Lenses
    listChangeSets_nextToken,
    listChangeSets_stackName,

    -- * Destructuring the Response
    ListChangeSetsResponse (..),
    newListChangeSetsResponse,

    -- * Response Lenses
    listChangeSetsResponse_nextToken,
    listChangeSetsResponse_summaries,
    listChangeSetsResponse_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

-- | The input for the ListChangeSets action.
--
-- /See:/ 'newListChangeSets' smart constructor.
data ListChangeSets = ListChangeSets'
  { -- | A string (provided by the ListChangeSets response output) that
    -- identifies the next page of change sets that you want to retrieve.
    ListChangeSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name or the Amazon Resource Name (ARN) of the stack for which you
    -- want to list change sets.
    ListChangeSets -> Text
stackName :: Prelude.Text
  }
  deriving (ListChangeSets -> ListChangeSets -> Bool
(ListChangeSets -> ListChangeSets -> Bool)
-> (ListChangeSets -> ListChangeSets -> Bool) -> Eq ListChangeSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChangeSets -> ListChangeSets -> Bool
$c/= :: ListChangeSets -> ListChangeSets -> Bool
== :: ListChangeSets -> ListChangeSets -> Bool
$c== :: ListChangeSets -> ListChangeSets -> Bool
Prelude.Eq, ReadPrec [ListChangeSets]
ReadPrec ListChangeSets
Int -> ReadS ListChangeSets
ReadS [ListChangeSets]
(Int -> ReadS ListChangeSets)
-> ReadS [ListChangeSets]
-> ReadPrec ListChangeSets
-> ReadPrec [ListChangeSets]
-> Read ListChangeSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListChangeSets]
$creadListPrec :: ReadPrec [ListChangeSets]
readPrec :: ReadPrec ListChangeSets
$creadPrec :: ReadPrec ListChangeSets
readList :: ReadS [ListChangeSets]
$creadList :: ReadS [ListChangeSets]
readsPrec :: Int -> ReadS ListChangeSets
$creadsPrec :: Int -> ReadS ListChangeSets
Prelude.Read, Int -> ListChangeSets -> ShowS
[ListChangeSets] -> ShowS
ListChangeSets -> String
(Int -> ListChangeSets -> ShowS)
-> (ListChangeSets -> String)
-> ([ListChangeSets] -> ShowS)
-> Show ListChangeSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChangeSets] -> ShowS
$cshowList :: [ListChangeSets] -> ShowS
show :: ListChangeSets -> String
$cshow :: ListChangeSets -> String
showsPrec :: Int -> ListChangeSets -> ShowS
$cshowsPrec :: Int -> ListChangeSets -> ShowS
Prelude.Show, (forall x. ListChangeSets -> Rep ListChangeSets x)
-> (forall x. Rep ListChangeSets x -> ListChangeSets)
-> Generic ListChangeSets
forall x. Rep ListChangeSets x -> ListChangeSets
forall x. ListChangeSets -> Rep ListChangeSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChangeSets x -> ListChangeSets
$cfrom :: forall x. ListChangeSets -> Rep ListChangeSets x
Prelude.Generic)

-- |
-- Create a value of 'ListChangeSets' 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', 'listChangeSets_nextToken' - A string (provided by the ListChangeSets response output) that
-- identifies the next page of change sets that you want to retrieve.
--
-- 'stackName', 'listChangeSets_stackName' - The name or the Amazon Resource Name (ARN) of the stack for which you
-- want to list change sets.
newListChangeSets ::
  -- | 'stackName'
  Prelude.Text ->
  ListChangeSets
newListChangeSets :: Text -> ListChangeSets
newListChangeSets Text
pStackName_ =
  ListChangeSets' :: Maybe Text -> Text -> ListChangeSets
ListChangeSets'
    { $sel:nextToken:ListChangeSets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackName:ListChangeSets' :: Text
stackName = Text
pStackName_
    }

-- | A string (provided by the ListChangeSets response output) that
-- identifies the next page of change sets that you want to retrieve.
listChangeSets_nextToken :: Lens.Lens' ListChangeSets (Prelude.Maybe Prelude.Text)
listChangeSets_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListChangeSets -> f ListChangeSets
listChangeSets_nextToken = (ListChangeSets -> Maybe Text)
-> (ListChangeSets -> Maybe Text -> ListChangeSets)
-> Lens ListChangeSets ListChangeSets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListChangeSets' :: ListChangeSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListChangeSets
s@ListChangeSets' {} Maybe Text
a -> ListChangeSets
s {$sel:nextToken:ListChangeSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListChangeSets)

-- | The name or the Amazon Resource Name (ARN) of the stack for which you
-- want to list change sets.
listChangeSets_stackName :: Lens.Lens' ListChangeSets Prelude.Text
listChangeSets_stackName :: (Text -> f Text) -> ListChangeSets -> f ListChangeSets
listChangeSets_stackName = (ListChangeSets -> Text)
-> (ListChangeSets -> Text -> ListChangeSets)
-> Lens ListChangeSets ListChangeSets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSets' {Text
stackName :: Text
$sel:stackName:ListChangeSets' :: ListChangeSets -> Text
stackName} -> Text
stackName) (\s :: ListChangeSets
s@ListChangeSets' {} Text
a -> ListChangeSets
s {$sel:stackName:ListChangeSets' :: Text
stackName = Text
a} :: ListChangeSets)

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

instance Prelude.NFData ListChangeSets

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

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

instance Core.ToQuery ListChangeSets where
  toQuery :: ListChangeSets -> QueryString
toQuery ListChangeSets' {Maybe Text
Text
stackName :: Text
nextToken :: Maybe Text
$sel:stackName:ListChangeSets' :: ListChangeSets -> Text
$sel:nextToken:ListChangeSets' :: ListChangeSets -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListChangeSets" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"StackName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
stackName
      ]

-- | The output for the ListChangeSets action.
--
-- /See:/ 'newListChangeSetsResponse' smart constructor.
data ListChangeSetsResponse = ListChangeSetsResponse'
  { -- | If the output exceeds 1 MB, a string that identifies the next page of
    -- change sets. If there is no additional page, this value is null.
    ListChangeSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of @ChangeSetSummary@ structures that provides the ID and status
    -- of each change set for the specified stack.
    ListChangeSetsResponse -> Maybe [ChangeSetSummary]
summaries :: Prelude.Maybe [ChangeSetSummary],
    -- | The response's http status code.
    ListChangeSetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
(ListChangeSetsResponse -> ListChangeSetsResponse -> Bool)
-> (ListChangeSetsResponse -> ListChangeSetsResponse -> Bool)
-> Eq ListChangeSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
$c/= :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
== :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
$c== :: ListChangeSetsResponse -> ListChangeSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListChangeSetsResponse]
ReadPrec ListChangeSetsResponse
Int -> ReadS ListChangeSetsResponse
ReadS [ListChangeSetsResponse]
(Int -> ReadS ListChangeSetsResponse)
-> ReadS [ListChangeSetsResponse]
-> ReadPrec ListChangeSetsResponse
-> ReadPrec [ListChangeSetsResponse]
-> Read ListChangeSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListChangeSetsResponse]
$creadListPrec :: ReadPrec [ListChangeSetsResponse]
readPrec :: ReadPrec ListChangeSetsResponse
$creadPrec :: ReadPrec ListChangeSetsResponse
readList :: ReadS [ListChangeSetsResponse]
$creadList :: ReadS [ListChangeSetsResponse]
readsPrec :: Int -> ReadS ListChangeSetsResponse
$creadsPrec :: Int -> ReadS ListChangeSetsResponse
Prelude.Read, Int -> ListChangeSetsResponse -> ShowS
[ListChangeSetsResponse] -> ShowS
ListChangeSetsResponse -> String
(Int -> ListChangeSetsResponse -> ShowS)
-> (ListChangeSetsResponse -> String)
-> ([ListChangeSetsResponse] -> ShowS)
-> Show ListChangeSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChangeSetsResponse] -> ShowS
$cshowList :: [ListChangeSetsResponse] -> ShowS
show :: ListChangeSetsResponse -> String
$cshow :: ListChangeSetsResponse -> String
showsPrec :: Int -> ListChangeSetsResponse -> ShowS
$cshowsPrec :: Int -> ListChangeSetsResponse -> ShowS
Prelude.Show, (forall x. ListChangeSetsResponse -> Rep ListChangeSetsResponse x)
-> (forall x.
    Rep ListChangeSetsResponse x -> ListChangeSetsResponse)
-> Generic ListChangeSetsResponse
forall x. Rep ListChangeSetsResponse x -> ListChangeSetsResponse
forall x. ListChangeSetsResponse -> Rep ListChangeSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChangeSetsResponse x -> ListChangeSetsResponse
$cfrom :: forall x. ListChangeSetsResponse -> Rep ListChangeSetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListChangeSetsResponse' 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', 'listChangeSetsResponse_nextToken' - If the output exceeds 1 MB, a string that identifies the next page of
-- change sets. If there is no additional page, this value is null.
--
-- 'summaries', 'listChangeSetsResponse_summaries' - A list of @ChangeSetSummary@ structures that provides the ID and status
-- of each change set for the specified stack.
--
-- 'httpStatus', 'listChangeSetsResponse_httpStatus' - The response's http status code.
newListChangeSetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListChangeSetsResponse
newListChangeSetsResponse :: Int -> ListChangeSetsResponse
newListChangeSetsResponse Int
pHttpStatus_ =
  ListChangeSetsResponse' :: Maybe Text
-> Maybe [ChangeSetSummary] -> Int -> ListChangeSetsResponse
ListChangeSetsResponse'
    { $sel:nextToken:ListChangeSetsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:ListChangeSetsResponse' :: Maybe [ChangeSetSummary]
summaries = Maybe [ChangeSetSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListChangeSetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the output exceeds 1 MB, a string that identifies the next page of
-- change sets. If there is no additional page, this value is null.
listChangeSetsResponse_nextToken :: Lens.Lens' ListChangeSetsResponse (Prelude.Maybe Prelude.Text)
listChangeSetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListChangeSetsResponse -> f ListChangeSetsResponse
listChangeSetsResponse_nextToken = (ListChangeSetsResponse -> Maybe Text)
-> (ListChangeSetsResponse -> Maybe Text -> ListChangeSetsResponse)
-> Lens' ListChangeSetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListChangeSetsResponse' :: ListChangeSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListChangeSetsResponse
s@ListChangeSetsResponse' {} Maybe Text
a -> ListChangeSetsResponse
s {$sel:nextToken:ListChangeSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListChangeSetsResponse)

-- | A list of @ChangeSetSummary@ structures that provides the ID and status
-- of each change set for the specified stack.
listChangeSetsResponse_summaries :: Lens.Lens' ListChangeSetsResponse (Prelude.Maybe [ChangeSetSummary])
listChangeSetsResponse_summaries :: (Maybe [ChangeSetSummary] -> f (Maybe [ChangeSetSummary]))
-> ListChangeSetsResponse -> f ListChangeSetsResponse
listChangeSetsResponse_summaries = (ListChangeSetsResponse -> Maybe [ChangeSetSummary])
-> (ListChangeSetsResponse
    -> Maybe [ChangeSetSummary] -> ListChangeSetsResponse)
-> Lens' ListChangeSetsResponse (Maybe [ChangeSetSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChangeSetsResponse' {Maybe [ChangeSetSummary]
summaries :: Maybe [ChangeSetSummary]
$sel:summaries:ListChangeSetsResponse' :: ListChangeSetsResponse -> Maybe [ChangeSetSummary]
summaries} -> Maybe [ChangeSetSummary]
summaries) (\s :: ListChangeSetsResponse
s@ListChangeSetsResponse' {} Maybe [ChangeSetSummary]
a -> ListChangeSetsResponse
s {$sel:summaries:ListChangeSetsResponse' :: Maybe [ChangeSetSummary]
summaries = Maybe [ChangeSetSummary]
a} :: ListChangeSetsResponse) ((Maybe [ChangeSetSummary] -> f (Maybe [ChangeSetSummary]))
 -> ListChangeSetsResponse -> f ListChangeSetsResponse)
-> ((Maybe [ChangeSetSummary] -> f (Maybe [ChangeSetSummary]))
    -> Maybe [ChangeSetSummary] -> f (Maybe [ChangeSetSummary]))
-> (Maybe [ChangeSetSummary] -> f (Maybe [ChangeSetSummary]))
-> ListChangeSetsResponse
-> f ListChangeSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ChangeSetSummary]
  [ChangeSetSummary]
  [ChangeSetSummary]
  [ChangeSetSummary]
-> Iso
     (Maybe [ChangeSetSummary])
     (Maybe [ChangeSetSummary])
     (Maybe [ChangeSetSummary])
     (Maybe [ChangeSetSummary])
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
  [ChangeSetSummary]
  [ChangeSetSummary]
  [ChangeSetSummary]
  [ChangeSetSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListChangeSetsResponse