{-# 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.GetTemplate
-- 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 template body for a specified stack. You can get the
-- template for running or deleted stacks.
--
-- For deleted stacks, GetTemplate returns the template for up to 90 days
-- after the stack has been deleted.
--
-- If the template does not exist, a @ValidationError@ is returned.
module Amazonka.CloudFormation.GetTemplate
  ( -- * Creating a Request
    GetTemplate (..),
    newGetTemplate,

    -- * Request Lenses
    getTemplate_changeSetName,
    getTemplate_templateStage,
    getTemplate_stackName,

    -- * Destructuring the Response
    GetTemplateResponse (..),
    newGetTemplateResponse,

    -- * Response Lenses
    getTemplateResponse_stagesAvailable,
    getTemplateResponse_templateBody,
    getTemplateResponse_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 a GetTemplate action.
--
-- /See:/ 'newGetTemplate' smart constructor.
data GetTemplate = GetTemplate'
  { -- | The name or Amazon Resource Name (ARN) of a change set for which
    -- CloudFormation returns the associated template. If you specify a name,
    -- you must also specify the @StackName@.
    GetTemplate -> Maybe Text
changeSetName :: Prelude.Maybe Prelude.Text,
    -- | For templates that include transforms, the stage of the template that
    -- CloudFormation returns. To get the user-submitted template, specify
    -- @Original@. To get the template after CloudFormation has processed all
    -- transforms, specify @Processed@.
    --
    -- If the template doesn\'t include transforms, @Original@ and @Processed@
    -- return the same template. By default, CloudFormation specifies
    -- @Processed@.
    GetTemplate -> Maybe TemplateStage
templateStage :: Prelude.Maybe TemplateStage,
    -- | The name or the unique stack ID that is associated with the stack, which
    -- are not always interchangeable:
    --
    -- -   Running stacks: You can specify either the stack\'s name or its
    --     unique stack ID.
    --
    -- -   Deleted stacks: You must specify the unique stack ID.
    --
    -- Default: There is no default value.
    GetTemplate -> Maybe Text
stackName :: Prelude.Maybe Prelude.Text
  }
  deriving (GetTemplate -> GetTemplate -> Bool
(GetTemplate -> GetTemplate -> Bool)
-> (GetTemplate -> GetTemplate -> Bool) -> Eq GetTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTemplate -> GetTemplate -> Bool
$c/= :: GetTemplate -> GetTemplate -> Bool
== :: GetTemplate -> GetTemplate -> Bool
$c== :: GetTemplate -> GetTemplate -> Bool
Prelude.Eq, ReadPrec [GetTemplate]
ReadPrec GetTemplate
Int -> ReadS GetTemplate
ReadS [GetTemplate]
(Int -> ReadS GetTemplate)
-> ReadS [GetTemplate]
-> ReadPrec GetTemplate
-> ReadPrec [GetTemplate]
-> Read GetTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTemplate]
$creadListPrec :: ReadPrec [GetTemplate]
readPrec :: ReadPrec GetTemplate
$creadPrec :: ReadPrec GetTemplate
readList :: ReadS [GetTemplate]
$creadList :: ReadS [GetTemplate]
readsPrec :: Int -> ReadS GetTemplate
$creadsPrec :: Int -> ReadS GetTemplate
Prelude.Read, Int -> GetTemplate -> ShowS
[GetTemplate] -> ShowS
GetTemplate -> String
(Int -> GetTemplate -> ShowS)
-> (GetTemplate -> String)
-> ([GetTemplate] -> ShowS)
-> Show GetTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTemplate] -> ShowS
$cshowList :: [GetTemplate] -> ShowS
show :: GetTemplate -> String
$cshow :: GetTemplate -> String
showsPrec :: Int -> GetTemplate -> ShowS
$cshowsPrec :: Int -> GetTemplate -> ShowS
Prelude.Show, (forall x. GetTemplate -> Rep GetTemplate x)
-> (forall x. Rep GetTemplate x -> GetTemplate)
-> Generic GetTemplate
forall x. Rep GetTemplate x -> GetTemplate
forall x. GetTemplate -> Rep GetTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTemplate x -> GetTemplate
$cfrom :: forall x. GetTemplate -> Rep GetTemplate x
Prelude.Generic)

-- |
-- Create a value of 'GetTemplate' 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:
--
-- 'changeSetName', 'getTemplate_changeSetName' - The name or Amazon Resource Name (ARN) of a change set for which
-- CloudFormation returns the associated template. If you specify a name,
-- you must also specify the @StackName@.
--
-- 'templateStage', 'getTemplate_templateStage' - For templates that include transforms, the stage of the template that
-- CloudFormation returns. To get the user-submitted template, specify
-- @Original@. To get the template after CloudFormation has processed all
-- transforms, specify @Processed@.
--
-- If the template doesn\'t include transforms, @Original@ and @Processed@
-- return the same template. By default, CloudFormation specifies
-- @Processed@.
--
-- 'stackName', 'getTemplate_stackName' - The name or the unique stack ID that is associated with the stack, which
-- are not always interchangeable:
--
-- -   Running stacks: You can specify either the stack\'s name or its
--     unique stack ID.
--
-- -   Deleted stacks: You must specify the unique stack ID.
--
-- Default: There is no default value.
newGetTemplate ::
  GetTemplate
newGetTemplate :: GetTemplate
newGetTemplate =
  GetTemplate' :: Maybe Text -> Maybe TemplateStage -> Maybe Text -> GetTemplate
GetTemplate'
    { $sel:changeSetName:GetTemplate' :: Maybe Text
changeSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateStage:GetTemplate' :: Maybe TemplateStage
templateStage = Maybe TemplateStage
forall a. Maybe a
Prelude.Nothing,
      $sel:stackName:GetTemplate' :: Maybe Text
stackName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name or Amazon Resource Name (ARN) of a change set for which
-- CloudFormation returns the associated template. If you specify a name,
-- you must also specify the @StackName@.
getTemplate_changeSetName :: Lens.Lens' GetTemplate (Prelude.Maybe Prelude.Text)
getTemplate_changeSetName :: (Maybe Text -> f (Maybe Text)) -> GetTemplate -> f GetTemplate
getTemplate_changeSetName = (GetTemplate -> Maybe Text)
-> (GetTemplate -> Maybe Text -> GetTemplate)
-> Lens GetTemplate GetTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTemplate' {Maybe Text
changeSetName :: Maybe Text
$sel:changeSetName:GetTemplate' :: GetTemplate -> Maybe Text
changeSetName} -> Maybe Text
changeSetName) (\s :: GetTemplate
s@GetTemplate' {} Maybe Text
a -> GetTemplate
s {$sel:changeSetName:GetTemplate' :: Maybe Text
changeSetName = Maybe Text
a} :: GetTemplate)

-- | For templates that include transforms, the stage of the template that
-- CloudFormation returns. To get the user-submitted template, specify
-- @Original@. To get the template after CloudFormation has processed all
-- transforms, specify @Processed@.
--
-- If the template doesn\'t include transforms, @Original@ and @Processed@
-- return the same template. By default, CloudFormation specifies
-- @Processed@.
getTemplate_templateStage :: Lens.Lens' GetTemplate (Prelude.Maybe TemplateStage)
getTemplate_templateStage :: (Maybe TemplateStage -> f (Maybe TemplateStage))
-> GetTemplate -> f GetTemplate
getTemplate_templateStage = (GetTemplate -> Maybe TemplateStage)
-> (GetTemplate -> Maybe TemplateStage -> GetTemplate)
-> Lens
     GetTemplate GetTemplate (Maybe TemplateStage) (Maybe TemplateStage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTemplate' {Maybe TemplateStage
templateStage :: Maybe TemplateStage
$sel:templateStage:GetTemplate' :: GetTemplate -> Maybe TemplateStage
templateStage} -> Maybe TemplateStage
templateStage) (\s :: GetTemplate
s@GetTemplate' {} Maybe TemplateStage
a -> GetTemplate
s {$sel:templateStage:GetTemplate' :: Maybe TemplateStage
templateStage = Maybe TemplateStage
a} :: GetTemplate)

-- | The name or the unique stack ID that is associated with the stack, which
-- are not always interchangeable:
--
-- -   Running stacks: You can specify either the stack\'s name or its
--     unique stack ID.
--
-- -   Deleted stacks: You must specify the unique stack ID.
--
-- Default: There is no default value.
getTemplate_stackName :: Lens.Lens' GetTemplate (Prelude.Maybe Prelude.Text)
getTemplate_stackName :: (Maybe Text -> f (Maybe Text)) -> GetTemplate -> f GetTemplate
getTemplate_stackName = (GetTemplate -> Maybe Text)
-> (GetTemplate -> Maybe Text -> GetTemplate)
-> Lens GetTemplate GetTemplate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTemplate' {Maybe Text
stackName :: Maybe Text
$sel:stackName:GetTemplate' :: GetTemplate -> Maybe Text
stackName} -> Maybe Text
stackName) (\s :: GetTemplate
s@GetTemplate' {} Maybe Text
a -> GetTemplate
s {$sel:stackName:GetTemplate' :: Maybe Text
stackName = Maybe Text
a} :: GetTemplate)

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

instance Prelude.NFData GetTemplate

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

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

instance Core.ToQuery GetTemplate where
  toQuery :: GetTemplate -> QueryString
toQuery GetTemplate' {Maybe Text
Maybe TemplateStage
stackName :: Maybe Text
templateStage :: Maybe TemplateStage
changeSetName :: Maybe Text
$sel:stackName:GetTemplate' :: GetTemplate -> Maybe Text
$sel:templateStage:GetTemplate' :: GetTemplate -> Maybe TemplateStage
$sel:changeSetName:GetTemplate' :: GetTemplate -> 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
"GetTemplate" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-15" :: Prelude.ByteString),
        ByteString
"ChangeSetName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
changeSetName,
        ByteString
"TemplateStage" ByteString -> Maybe TemplateStage -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TemplateStage
templateStage,
        ByteString
"StackName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stackName
      ]

-- | The output for GetTemplate action.
--
-- /See:/ 'newGetTemplateResponse' smart constructor.
data GetTemplateResponse = GetTemplateResponse'
  { -- | The stage of the template that you can retrieve. For stacks, the
    -- @Original@ and @Processed@ templates are always available. For change
    -- sets, the @Original@ template is always available. After CloudFormation
    -- finishes creating the change set, the @Processed@ template becomes
    -- available.
    GetTemplateResponse -> Maybe [TemplateStage]
stagesAvailable :: Prelude.Maybe [TemplateStage],
    -- | Structure containing the template body. (For more information, go to
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
    -- in the CloudFormation User Guide.)
    --
    -- CloudFormation returns the same template that was used when the stack
    -- was created.
    GetTemplateResponse -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTemplateResponse -> GetTemplateResponse -> Bool
(GetTemplateResponse -> GetTemplateResponse -> Bool)
-> (GetTemplateResponse -> GetTemplateResponse -> Bool)
-> Eq GetTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTemplateResponse -> GetTemplateResponse -> Bool
$c/= :: GetTemplateResponse -> GetTemplateResponse -> Bool
== :: GetTemplateResponse -> GetTemplateResponse -> Bool
$c== :: GetTemplateResponse -> GetTemplateResponse -> Bool
Prelude.Eq, ReadPrec [GetTemplateResponse]
ReadPrec GetTemplateResponse
Int -> ReadS GetTemplateResponse
ReadS [GetTemplateResponse]
(Int -> ReadS GetTemplateResponse)
-> ReadS [GetTemplateResponse]
-> ReadPrec GetTemplateResponse
-> ReadPrec [GetTemplateResponse]
-> Read GetTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTemplateResponse]
$creadListPrec :: ReadPrec [GetTemplateResponse]
readPrec :: ReadPrec GetTemplateResponse
$creadPrec :: ReadPrec GetTemplateResponse
readList :: ReadS [GetTemplateResponse]
$creadList :: ReadS [GetTemplateResponse]
readsPrec :: Int -> ReadS GetTemplateResponse
$creadsPrec :: Int -> ReadS GetTemplateResponse
Prelude.Read, Int -> GetTemplateResponse -> ShowS
[GetTemplateResponse] -> ShowS
GetTemplateResponse -> String
(Int -> GetTemplateResponse -> ShowS)
-> (GetTemplateResponse -> String)
-> ([GetTemplateResponse] -> ShowS)
-> Show GetTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTemplateResponse] -> ShowS
$cshowList :: [GetTemplateResponse] -> ShowS
show :: GetTemplateResponse -> String
$cshow :: GetTemplateResponse -> String
showsPrec :: Int -> GetTemplateResponse -> ShowS
$cshowsPrec :: Int -> GetTemplateResponse -> ShowS
Prelude.Show, (forall x. GetTemplateResponse -> Rep GetTemplateResponse x)
-> (forall x. Rep GetTemplateResponse x -> GetTemplateResponse)
-> Generic GetTemplateResponse
forall x. Rep GetTemplateResponse x -> GetTemplateResponse
forall x. GetTemplateResponse -> Rep GetTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetTemplateResponse x -> GetTemplateResponse
$cfrom :: forall x. GetTemplateResponse -> Rep GetTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetTemplateResponse' 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:
--
-- 'stagesAvailable', 'getTemplateResponse_stagesAvailable' - The stage of the template that you can retrieve. For stacks, the
-- @Original@ and @Processed@ templates are always available. For change
-- sets, the @Original@ template is always available. After CloudFormation
-- finishes creating the change set, the @Processed@ template becomes
-- available.
--
-- 'templateBody', 'getTemplateResponse_templateBody' - Structure containing the template body. (For more information, go to
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.)
--
-- CloudFormation returns the same template that was used when the stack
-- was created.
--
-- 'httpStatus', 'getTemplateResponse_httpStatus' - The response's http status code.
newGetTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTemplateResponse
newGetTemplateResponse :: Int -> GetTemplateResponse
newGetTemplateResponse Int
pHttpStatus_ =
  GetTemplateResponse' :: Maybe [TemplateStage] -> Maybe Text -> Int -> GetTemplateResponse
GetTemplateResponse'
    { $sel:stagesAvailable:GetTemplateResponse' :: Maybe [TemplateStage]
stagesAvailable =
        Maybe [TemplateStage]
forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:GetTemplateResponse' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The stage of the template that you can retrieve. For stacks, the
-- @Original@ and @Processed@ templates are always available. For change
-- sets, the @Original@ template is always available. After CloudFormation
-- finishes creating the change set, the @Processed@ template becomes
-- available.
getTemplateResponse_stagesAvailable :: Lens.Lens' GetTemplateResponse (Prelude.Maybe [TemplateStage])
getTemplateResponse_stagesAvailable :: (Maybe [TemplateStage] -> f (Maybe [TemplateStage]))
-> GetTemplateResponse -> f GetTemplateResponse
getTemplateResponse_stagesAvailable = (GetTemplateResponse -> Maybe [TemplateStage])
-> (GetTemplateResponse
    -> Maybe [TemplateStage] -> GetTemplateResponse)
-> Lens
     GetTemplateResponse
     GetTemplateResponse
     (Maybe [TemplateStage])
     (Maybe [TemplateStage])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTemplateResponse' {Maybe [TemplateStage]
stagesAvailable :: Maybe [TemplateStage]
$sel:stagesAvailable:GetTemplateResponse' :: GetTemplateResponse -> Maybe [TemplateStage]
stagesAvailable} -> Maybe [TemplateStage]
stagesAvailable) (\s :: GetTemplateResponse
s@GetTemplateResponse' {} Maybe [TemplateStage]
a -> GetTemplateResponse
s {$sel:stagesAvailable:GetTemplateResponse' :: Maybe [TemplateStage]
stagesAvailable = Maybe [TemplateStage]
a} :: GetTemplateResponse) ((Maybe [TemplateStage] -> f (Maybe [TemplateStage]))
 -> GetTemplateResponse -> f GetTemplateResponse)
-> ((Maybe [TemplateStage] -> f (Maybe [TemplateStage]))
    -> Maybe [TemplateStage] -> f (Maybe [TemplateStage]))
-> (Maybe [TemplateStage] -> f (Maybe [TemplateStage]))
-> GetTemplateResponse
-> f GetTemplateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TemplateStage] [TemplateStage] [TemplateStage] [TemplateStage]
-> Iso
     (Maybe [TemplateStage])
     (Maybe [TemplateStage])
     (Maybe [TemplateStage])
     (Maybe [TemplateStage])
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
  [TemplateStage] [TemplateStage] [TemplateStage] [TemplateStage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Structure containing the template body. (For more information, go to
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html Template Anatomy>
-- in the CloudFormation User Guide.)
--
-- CloudFormation returns the same template that was used when the stack
-- was created.
getTemplateResponse_templateBody :: Lens.Lens' GetTemplateResponse (Prelude.Maybe Prelude.Text)
getTemplateResponse_templateBody :: (Maybe Text -> f (Maybe Text))
-> GetTemplateResponse -> f GetTemplateResponse
getTemplateResponse_templateBody = (GetTemplateResponse -> Maybe Text)
-> (GetTemplateResponse -> Maybe Text -> GetTemplateResponse)
-> Lens
     GetTemplateResponse GetTemplateResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTemplateResponse' {Maybe Text
templateBody :: Maybe Text
$sel:templateBody:GetTemplateResponse' :: GetTemplateResponse -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: GetTemplateResponse
s@GetTemplateResponse' {} Maybe Text
a -> GetTemplateResponse
s {$sel:templateBody:GetTemplateResponse' :: Maybe Text
templateBody = Maybe Text
a} :: GetTemplateResponse)

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

instance Prelude.NFData GetTemplateResponse