{-# 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.Lightsail.GetCloudFormationStackRecords
-- 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 CloudFormation stack record created as a result of the
-- @create cloud formation stack@ operation.
--
-- An AWS CloudFormation stack is used to create a new Amazon EC2 instance
-- from an exported Lightsail snapshot.
--
-- This operation returns paginated results.
module Amazonka.Lightsail.GetCloudFormationStackRecords
  ( -- * Creating a Request
    GetCloudFormationStackRecords (..),
    newGetCloudFormationStackRecords,

    -- * Request Lenses
    getCloudFormationStackRecords_pageToken,

    -- * Destructuring the Response
    GetCloudFormationStackRecordsResponse (..),
    newGetCloudFormationStackRecordsResponse,

    -- * Response Lenses
    getCloudFormationStackRecordsResponse_nextPageToken,
    getCloudFormationStackRecordsResponse_cloudFormationStackRecords,
    getCloudFormationStackRecordsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetCloudFormationStackRecords' smart constructor.
data GetCloudFormationStackRecords = GetCloudFormationStackRecords'
  { -- | The token to advance to the next page of results from your request.
    --
    -- To get a page token, perform an initial @GetClouFormationStackRecords@
    -- request. If your results are paginated, the response will return a next
    -- page token that you can specify as the page token in a subsequent
    -- request.
    GetCloudFormationStackRecords -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
  }
  deriving (GetCloudFormationStackRecords
-> GetCloudFormationStackRecords -> Bool
(GetCloudFormationStackRecords
 -> GetCloudFormationStackRecords -> Bool)
-> (GetCloudFormationStackRecords
    -> GetCloudFormationStackRecords -> Bool)
-> Eq GetCloudFormationStackRecords
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCloudFormationStackRecords
-> GetCloudFormationStackRecords -> Bool
$c/= :: GetCloudFormationStackRecords
-> GetCloudFormationStackRecords -> Bool
== :: GetCloudFormationStackRecords
-> GetCloudFormationStackRecords -> Bool
$c== :: GetCloudFormationStackRecords
-> GetCloudFormationStackRecords -> Bool
Prelude.Eq, ReadPrec [GetCloudFormationStackRecords]
ReadPrec GetCloudFormationStackRecords
Int -> ReadS GetCloudFormationStackRecords
ReadS [GetCloudFormationStackRecords]
(Int -> ReadS GetCloudFormationStackRecords)
-> ReadS [GetCloudFormationStackRecords]
-> ReadPrec GetCloudFormationStackRecords
-> ReadPrec [GetCloudFormationStackRecords]
-> Read GetCloudFormationStackRecords
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCloudFormationStackRecords]
$creadListPrec :: ReadPrec [GetCloudFormationStackRecords]
readPrec :: ReadPrec GetCloudFormationStackRecords
$creadPrec :: ReadPrec GetCloudFormationStackRecords
readList :: ReadS [GetCloudFormationStackRecords]
$creadList :: ReadS [GetCloudFormationStackRecords]
readsPrec :: Int -> ReadS GetCloudFormationStackRecords
$creadsPrec :: Int -> ReadS GetCloudFormationStackRecords
Prelude.Read, Int -> GetCloudFormationStackRecords -> ShowS
[GetCloudFormationStackRecords] -> ShowS
GetCloudFormationStackRecords -> String
(Int -> GetCloudFormationStackRecords -> ShowS)
-> (GetCloudFormationStackRecords -> String)
-> ([GetCloudFormationStackRecords] -> ShowS)
-> Show GetCloudFormationStackRecords
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCloudFormationStackRecords] -> ShowS
$cshowList :: [GetCloudFormationStackRecords] -> ShowS
show :: GetCloudFormationStackRecords -> String
$cshow :: GetCloudFormationStackRecords -> String
showsPrec :: Int -> GetCloudFormationStackRecords -> ShowS
$cshowsPrec :: Int -> GetCloudFormationStackRecords -> ShowS
Prelude.Show, (forall x.
 GetCloudFormationStackRecords
 -> Rep GetCloudFormationStackRecords x)
-> (forall x.
    Rep GetCloudFormationStackRecords x
    -> GetCloudFormationStackRecords)
-> Generic GetCloudFormationStackRecords
forall x.
Rep GetCloudFormationStackRecords x
-> GetCloudFormationStackRecords
forall x.
GetCloudFormationStackRecords
-> Rep GetCloudFormationStackRecords x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCloudFormationStackRecords x
-> GetCloudFormationStackRecords
$cfrom :: forall x.
GetCloudFormationStackRecords
-> Rep GetCloudFormationStackRecords x
Prelude.Generic)

-- |
-- Create a value of 'GetCloudFormationStackRecords' 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:
--
-- 'pageToken', 'getCloudFormationStackRecords_pageToken' - The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetClouFormationStackRecords@
-- request. If your results are paginated, the response will return a next
-- page token that you can specify as the page token in a subsequent
-- request.
newGetCloudFormationStackRecords ::
  GetCloudFormationStackRecords
newGetCloudFormationStackRecords :: GetCloudFormationStackRecords
newGetCloudFormationStackRecords =
  GetCloudFormationStackRecords' :: Maybe Text -> GetCloudFormationStackRecords
GetCloudFormationStackRecords'
    { $sel:pageToken:GetCloudFormationStackRecords' :: Maybe Text
pageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The token to advance to the next page of results from your request.
--
-- To get a page token, perform an initial @GetClouFormationStackRecords@
-- request. If your results are paginated, the response will return a next
-- page token that you can specify as the page token in a subsequent
-- request.
getCloudFormationStackRecords_pageToken :: Lens.Lens' GetCloudFormationStackRecords (Prelude.Maybe Prelude.Text)
getCloudFormationStackRecords_pageToken :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationStackRecords -> f GetCloudFormationStackRecords
getCloudFormationStackRecords_pageToken = (GetCloudFormationStackRecords -> Maybe Text)
-> (GetCloudFormationStackRecords
    -> Maybe Text -> GetCloudFormationStackRecords)
-> Lens
     GetCloudFormationStackRecords
     GetCloudFormationStackRecords
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationStackRecords' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetCloudFormationStackRecords' :: GetCloudFormationStackRecords -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: GetCloudFormationStackRecords
s@GetCloudFormationStackRecords' {} Maybe Text
a -> GetCloudFormationStackRecords
s {$sel:pageToken:GetCloudFormationStackRecords' :: Maybe Text
pageToken = Maybe Text
a} :: GetCloudFormationStackRecords)

instance Core.AWSPager GetCloudFormationStackRecords where
  page :: GetCloudFormationStackRecords
-> AWSResponse GetCloudFormationStackRecords
-> Maybe GetCloudFormationStackRecords
page GetCloudFormationStackRecords
rq AWSResponse GetCloudFormationStackRecords
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetCloudFormationStackRecords
GetCloudFormationStackRecordsResponse
rs
            GetCloudFormationStackRecordsResponse
-> Getting (First Text) GetCloudFormationStackRecordsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetCloudFormationStackRecordsResponse
-> Const (First Text) GetCloudFormationStackRecordsResponse
Lens' GetCloudFormationStackRecordsResponse (Maybe Text)
getCloudFormationStackRecordsResponse_nextPageToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetCloudFormationStackRecordsResponse
 -> Const (First Text) GetCloudFormationStackRecordsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetCloudFormationStackRecordsResponse 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 GetCloudFormationStackRecords
forall a. Maybe a
Prelude.Nothing
    | Maybe [CloudFormationStackRecord] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetCloudFormationStackRecords
GetCloudFormationStackRecordsResponse
rs
            GetCloudFormationStackRecordsResponse
-> Getting
     (First [CloudFormationStackRecord])
     GetCloudFormationStackRecordsResponse
     [CloudFormationStackRecord]
-> Maybe [CloudFormationStackRecord]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [CloudFormationStackRecord]
 -> Const
      (First [CloudFormationStackRecord])
      (Maybe [CloudFormationStackRecord]))
-> GetCloudFormationStackRecordsResponse
-> Const
     (First [CloudFormationStackRecord])
     GetCloudFormationStackRecordsResponse
Lens'
  GetCloudFormationStackRecordsResponse
  (Maybe [CloudFormationStackRecord])
getCloudFormationStackRecordsResponse_cloudFormationStackRecords
              ((Maybe [CloudFormationStackRecord]
  -> Const
       (First [CloudFormationStackRecord])
       (Maybe [CloudFormationStackRecord]))
 -> GetCloudFormationStackRecordsResponse
 -> Const
      (First [CloudFormationStackRecord])
      GetCloudFormationStackRecordsResponse)
-> (([CloudFormationStackRecord]
     -> Const
          (First [CloudFormationStackRecord]) [CloudFormationStackRecord])
    -> Maybe [CloudFormationStackRecord]
    -> Const
         (First [CloudFormationStackRecord])
         (Maybe [CloudFormationStackRecord]))
-> Getting
     (First [CloudFormationStackRecord])
     GetCloudFormationStackRecordsResponse
     [CloudFormationStackRecord]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CloudFormationStackRecord]
 -> Const
      (First [CloudFormationStackRecord]) [CloudFormationStackRecord])
-> Maybe [CloudFormationStackRecord]
-> Const
     (First [CloudFormationStackRecord])
     (Maybe [CloudFormationStackRecord])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetCloudFormationStackRecords
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetCloudFormationStackRecords
-> Maybe GetCloudFormationStackRecords
forall a. a -> Maybe a
Prelude.Just (GetCloudFormationStackRecords
 -> Maybe GetCloudFormationStackRecords)
-> GetCloudFormationStackRecords
-> Maybe GetCloudFormationStackRecords
forall a b. (a -> b) -> a -> b
Prelude.$
        GetCloudFormationStackRecords
rq
          GetCloudFormationStackRecords
-> (GetCloudFormationStackRecords -> GetCloudFormationStackRecords)
-> GetCloudFormationStackRecords
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetCloudFormationStackRecords
-> Identity GetCloudFormationStackRecords
Lens
  GetCloudFormationStackRecords
  GetCloudFormationStackRecords
  (Maybe Text)
  (Maybe Text)
getCloudFormationStackRecords_pageToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetCloudFormationStackRecords
 -> Identity GetCloudFormationStackRecords)
-> Maybe Text
-> GetCloudFormationStackRecords
-> GetCloudFormationStackRecords
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetCloudFormationStackRecords
GetCloudFormationStackRecordsResponse
rs
          GetCloudFormationStackRecordsResponse
-> Getting (First Text) GetCloudFormationStackRecordsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetCloudFormationStackRecordsResponse
-> Const (First Text) GetCloudFormationStackRecordsResponse
Lens' GetCloudFormationStackRecordsResponse (Maybe Text)
getCloudFormationStackRecordsResponse_nextPageToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetCloudFormationStackRecordsResponse
 -> Const (First Text) GetCloudFormationStackRecordsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetCloudFormationStackRecordsResponse 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
    GetCloudFormationStackRecords
  where
  type
    AWSResponse GetCloudFormationStackRecords =
      GetCloudFormationStackRecordsResponse
  request :: GetCloudFormationStackRecords
-> Request GetCloudFormationStackRecords
request = Service
-> GetCloudFormationStackRecords
-> Request GetCloudFormationStackRecords
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetCloudFormationStackRecords
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCloudFormationStackRecords)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetCloudFormationStackRecords))
-> Logger
-> Service
-> Proxy GetCloudFormationStackRecords
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCloudFormationStackRecords)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [CloudFormationStackRecord]
-> Int
-> GetCloudFormationStackRecordsResponse
GetCloudFormationStackRecordsResponse'
            (Maybe Text
 -> Maybe [CloudFormationStackRecord]
 -> Int
 -> GetCloudFormationStackRecordsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [CloudFormationStackRecord]
      -> Int -> GetCloudFormationStackRecordsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextPageToken")
            Either
  String
  (Maybe [CloudFormationStackRecord]
   -> Int -> GetCloudFormationStackRecordsResponse)
-> Either String (Maybe [CloudFormationStackRecord])
-> Either String (Int -> GetCloudFormationStackRecordsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [CloudFormationStackRecord]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"cloudFormationStackRecords"
                            Either String (Maybe (Maybe [CloudFormationStackRecord]))
-> Maybe [CloudFormationStackRecord]
-> Either String (Maybe [CloudFormationStackRecord])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CloudFormationStackRecord]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> GetCloudFormationStackRecordsResponse)
-> Either String Int
-> Either String GetCloudFormationStackRecordsResponse
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
    GetCloudFormationStackRecords

instance Prelude.NFData GetCloudFormationStackRecords

instance Core.ToHeaders GetCloudFormationStackRecords where
  toHeaders :: GetCloudFormationStackRecords -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetCloudFormationStackRecords -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetCloudFormationStackRecords" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetCloudFormationStackRecords where
  toJSON :: GetCloudFormationStackRecords -> Value
toJSON GetCloudFormationStackRecords' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:GetCloudFormationStackRecords' :: GetCloudFormationStackRecords -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"pageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken]
      )

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

instance Core.ToQuery GetCloudFormationStackRecords where
  toQuery :: GetCloudFormationStackRecords -> QueryString
toQuery = QueryString -> GetCloudFormationStackRecords -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetCloudFormationStackRecordsResponse' smart constructor.
data GetCloudFormationStackRecordsResponse = GetCloudFormationStackRecordsResponse'
  { -- | The token to advance to the next page of results from your request.
    --
    -- A next page token is not returned if there are no more results to
    -- display.
    --
    -- To get the next page of results, perform another
    -- @GetCloudFormationStackRecords@ request and specify the next page token
    -- using the @pageToken@ parameter.
    GetCloudFormationStackRecordsResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | A list of objects describing the CloudFormation stack records.
    GetCloudFormationStackRecordsResponse
-> Maybe [CloudFormationStackRecord]
cloudFormationStackRecords :: Prelude.Maybe [CloudFormationStackRecord],
    -- | The response's http status code.
    GetCloudFormationStackRecordsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCloudFormationStackRecordsResponse
-> GetCloudFormationStackRecordsResponse -> Bool
(GetCloudFormationStackRecordsResponse
 -> GetCloudFormationStackRecordsResponse -> Bool)
-> (GetCloudFormationStackRecordsResponse
    -> GetCloudFormationStackRecordsResponse -> Bool)
-> Eq GetCloudFormationStackRecordsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCloudFormationStackRecordsResponse
-> GetCloudFormationStackRecordsResponse -> Bool
$c/= :: GetCloudFormationStackRecordsResponse
-> GetCloudFormationStackRecordsResponse -> Bool
== :: GetCloudFormationStackRecordsResponse
-> GetCloudFormationStackRecordsResponse -> Bool
$c== :: GetCloudFormationStackRecordsResponse
-> GetCloudFormationStackRecordsResponse -> Bool
Prelude.Eq, ReadPrec [GetCloudFormationStackRecordsResponse]
ReadPrec GetCloudFormationStackRecordsResponse
Int -> ReadS GetCloudFormationStackRecordsResponse
ReadS [GetCloudFormationStackRecordsResponse]
(Int -> ReadS GetCloudFormationStackRecordsResponse)
-> ReadS [GetCloudFormationStackRecordsResponse]
-> ReadPrec GetCloudFormationStackRecordsResponse
-> ReadPrec [GetCloudFormationStackRecordsResponse]
-> Read GetCloudFormationStackRecordsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCloudFormationStackRecordsResponse]
$creadListPrec :: ReadPrec [GetCloudFormationStackRecordsResponse]
readPrec :: ReadPrec GetCloudFormationStackRecordsResponse
$creadPrec :: ReadPrec GetCloudFormationStackRecordsResponse
readList :: ReadS [GetCloudFormationStackRecordsResponse]
$creadList :: ReadS [GetCloudFormationStackRecordsResponse]
readsPrec :: Int -> ReadS GetCloudFormationStackRecordsResponse
$creadsPrec :: Int -> ReadS GetCloudFormationStackRecordsResponse
Prelude.Read, Int -> GetCloudFormationStackRecordsResponse -> ShowS
[GetCloudFormationStackRecordsResponse] -> ShowS
GetCloudFormationStackRecordsResponse -> String
(Int -> GetCloudFormationStackRecordsResponse -> ShowS)
-> (GetCloudFormationStackRecordsResponse -> String)
-> ([GetCloudFormationStackRecordsResponse] -> ShowS)
-> Show GetCloudFormationStackRecordsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCloudFormationStackRecordsResponse] -> ShowS
$cshowList :: [GetCloudFormationStackRecordsResponse] -> ShowS
show :: GetCloudFormationStackRecordsResponse -> String
$cshow :: GetCloudFormationStackRecordsResponse -> String
showsPrec :: Int -> GetCloudFormationStackRecordsResponse -> ShowS
$cshowsPrec :: Int -> GetCloudFormationStackRecordsResponse -> ShowS
Prelude.Show, (forall x.
 GetCloudFormationStackRecordsResponse
 -> Rep GetCloudFormationStackRecordsResponse x)
-> (forall x.
    Rep GetCloudFormationStackRecordsResponse x
    -> GetCloudFormationStackRecordsResponse)
-> Generic GetCloudFormationStackRecordsResponse
forall x.
Rep GetCloudFormationStackRecordsResponse x
-> GetCloudFormationStackRecordsResponse
forall x.
GetCloudFormationStackRecordsResponse
-> Rep GetCloudFormationStackRecordsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCloudFormationStackRecordsResponse x
-> GetCloudFormationStackRecordsResponse
$cfrom :: forall x.
GetCloudFormationStackRecordsResponse
-> Rep GetCloudFormationStackRecordsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCloudFormationStackRecordsResponse' 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:
--
-- 'nextPageToken', 'getCloudFormationStackRecordsResponse_nextPageToken' - The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another
-- @GetCloudFormationStackRecords@ request and specify the next page token
-- using the @pageToken@ parameter.
--
-- 'cloudFormationStackRecords', 'getCloudFormationStackRecordsResponse_cloudFormationStackRecords' - A list of objects describing the CloudFormation stack records.
--
-- 'httpStatus', 'getCloudFormationStackRecordsResponse_httpStatus' - The response's http status code.
newGetCloudFormationStackRecordsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCloudFormationStackRecordsResponse
newGetCloudFormationStackRecordsResponse :: Int -> GetCloudFormationStackRecordsResponse
newGetCloudFormationStackRecordsResponse Int
pHttpStatus_ =
  GetCloudFormationStackRecordsResponse' :: Maybe Text
-> Maybe [CloudFormationStackRecord]
-> Int
-> GetCloudFormationStackRecordsResponse
GetCloudFormationStackRecordsResponse'
    { $sel:nextPageToken:GetCloudFormationStackRecordsResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudFormationStackRecords:GetCloudFormationStackRecordsResponse' :: Maybe [CloudFormationStackRecord]
cloudFormationStackRecords =
        Maybe [CloudFormationStackRecord]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCloudFormationStackRecordsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to advance to the next page of results from your request.
--
-- A next page token is not returned if there are no more results to
-- display.
--
-- To get the next page of results, perform another
-- @GetCloudFormationStackRecords@ request and specify the next page token
-- using the @pageToken@ parameter.
getCloudFormationStackRecordsResponse_nextPageToken :: Lens.Lens' GetCloudFormationStackRecordsResponse (Prelude.Maybe Prelude.Text)
getCloudFormationStackRecordsResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationStackRecordsResponse
-> f GetCloudFormationStackRecordsResponse
getCloudFormationStackRecordsResponse_nextPageToken = (GetCloudFormationStackRecordsResponse -> Maybe Text)
-> (GetCloudFormationStackRecordsResponse
    -> Maybe Text -> GetCloudFormationStackRecordsResponse)
-> Lens' GetCloudFormationStackRecordsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationStackRecordsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetCloudFormationStackRecordsResponse' :: GetCloudFormationStackRecordsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetCloudFormationStackRecordsResponse
s@GetCloudFormationStackRecordsResponse' {} Maybe Text
a -> GetCloudFormationStackRecordsResponse
s {$sel:nextPageToken:GetCloudFormationStackRecordsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetCloudFormationStackRecordsResponse)

-- | A list of objects describing the CloudFormation stack records.
getCloudFormationStackRecordsResponse_cloudFormationStackRecords :: Lens.Lens' GetCloudFormationStackRecordsResponse (Prelude.Maybe [CloudFormationStackRecord])
getCloudFormationStackRecordsResponse_cloudFormationStackRecords :: (Maybe [CloudFormationStackRecord]
 -> f (Maybe [CloudFormationStackRecord]))
-> GetCloudFormationStackRecordsResponse
-> f GetCloudFormationStackRecordsResponse
getCloudFormationStackRecordsResponse_cloudFormationStackRecords = (GetCloudFormationStackRecordsResponse
 -> Maybe [CloudFormationStackRecord])
-> (GetCloudFormationStackRecordsResponse
    -> Maybe [CloudFormationStackRecord]
    -> GetCloudFormationStackRecordsResponse)
-> Lens'
     GetCloudFormationStackRecordsResponse
     (Maybe [CloudFormationStackRecord])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationStackRecordsResponse' {Maybe [CloudFormationStackRecord]
cloudFormationStackRecords :: Maybe [CloudFormationStackRecord]
$sel:cloudFormationStackRecords:GetCloudFormationStackRecordsResponse' :: GetCloudFormationStackRecordsResponse
-> Maybe [CloudFormationStackRecord]
cloudFormationStackRecords} -> Maybe [CloudFormationStackRecord]
cloudFormationStackRecords) (\s :: GetCloudFormationStackRecordsResponse
s@GetCloudFormationStackRecordsResponse' {} Maybe [CloudFormationStackRecord]
a -> GetCloudFormationStackRecordsResponse
s {$sel:cloudFormationStackRecords:GetCloudFormationStackRecordsResponse' :: Maybe [CloudFormationStackRecord]
cloudFormationStackRecords = Maybe [CloudFormationStackRecord]
a} :: GetCloudFormationStackRecordsResponse) ((Maybe [CloudFormationStackRecord]
  -> f (Maybe [CloudFormationStackRecord]))
 -> GetCloudFormationStackRecordsResponse
 -> f GetCloudFormationStackRecordsResponse)
-> ((Maybe [CloudFormationStackRecord]
     -> f (Maybe [CloudFormationStackRecord]))
    -> Maybe [CloudFormationStackRecord]
    -> f (Maybe [CloudFormationStackRecord]))
-> (Maybe [CloudFormationStackRecord]
    -> f (Maybe [CloudFormationStackRecord]))
-> GetCloudFormationStackRecordsResponse
-> f GetCloudFormationStackRecordsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CloudFormationStackRecord]
  [CloudFormationStackRecord]
  [CloudFormationStackRecord]
  [CloudFormationStackRecord]
-> Iso
     (Maybe [CloudFormationStackRecord])
     (Maybe [CloudFormationStackRecord])
     (Maybe [CloudFormationStackRecord])
     (Maybe [CloudFormationStackRecord])
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
  [CloudFormationStackRecord]
  [CloudFormationStackRecord]
  [CloudFormationStackRecord]
  [CloudFormationStackRecord]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetCloudFormationStackRecordsResponse