{-# 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.ServerlessApplicationRepository.GetCloudFormationTemplate
-- 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)
--
-- Gets the specified AWS CloudFormation template.
module Amazonka.ServerlessApplicationRepository.GetCloudFormationTemplate
  ( -- * Creating a Request
    GetCloudFormationTemplate (..),
    newGetCloudFormationTemplate,

    -- * Request Lenses
    getCloudFormationTemplate_applicationId,
    getCloudFormationTemplate_templateId,

    -- * Destructuring the Response
    GetCloudFormationTemplateResponse (..),
    newGetCloudFormationTemplateResponse,

    -- * Response Lenses
    getCloudFormationTemplateResponse_creationTime,
    getCloudFormationTemplateResponse_status,
    getCloudFormationTemplateResponse_templateId,
    getCloudFormationTemplateResponse_semanticVersion,
    getCloudFormationTemplateResponse_applicationId,
    getCloudFormationTemplateResponse_templateUrl,
    getCloudFormationTemplateResponse_expirationTime,
    getCloudFormationTemplateResponse_httpStatus,
  )
where

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
import Amazonka.ServerlessApplicationRepository.Types

-- | /See:/ 'newGetCloudFormationTemplate' smart constructor.
data GetCloudFormationTemplate = GetCloudFormationTemplate'
  { -- | The Amazon Resource Name (ARN) of the application.
    GetCloudFormationTemplate -> Text
applicationId :: Prelude.Text,
    -- | The UUID returned by CreateCloudFormationTemplate.
    --
    -- Pattern:
    -- [0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}
    GetCloudFormationTemplate -> Text
templateId :: Prelude.Text
  }
  deriving (GetCloudFormationTemplate -> GetCloudFormationTemplate -> Bool
(GetCloudFormationTemplate -> GetCloudFormationTemplate -> Bool)
-> (GetCloudFormationTemplate -> GetCloudFormationTemplate -> Bool)
-> Eq GetCloudFormationTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCloudFormationTemplate -> GetCloudFormationTemplate -> Bool
$c/= :: GetCloudFormationTemplate -> GetCloudFormationTemplate -> Bool
== :: GetCloudFormationTemplate -> GetCloudFormationTemplate -> Bool
$c== :: GetCloudFormationTemplate -> GetCloudFormationTemplate -> Bool
Prelude.Eq, ReadPrec [GetCloudFormationTemplate]
ReadPrec GetCloudFormationTemplate
Int -> ReadS GetCloudFormationTemplate
ReadS [GetCloudFormationTemplate]
(Int -> ReadS GetCloudFormationTemplate)
-> ReadS [GetCloudFormationTemplate]
-> ReadPrec GetCloudFormationTemplate
-> ReadPrec [GetCloudFormationTemplate]
-> Read GetCloudFormationTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCloudFormationTemplate]
$creadListPrec :: ReadPrec [GetCloudFormationTemplate]
readPrec :: ReadPrec GetCloudFormationTemplate
$creadPrec :: ReadPrec GetCloudFormationTemplate
readList :: ReadS [GetCloudFormationTemplate]
$creadList :: ReadS [GetCloudFormationTemplate]
readsPrec :: Int -> ReadS GetCloudFormationTemplate
$creadsPrec :: Int -> ReadS GetCloudFormationTemplate
Prelude.Read, Int -> GetCloudFormationTemplate -> ShowS
[GetCloudFormationTemplate] -> ShowS
GetCloudFormationTemplate -> String
(Int -> GetCloudFormationTemplate -> ShowS)
-> (GetCloudFormationTemplate -> String)
-> ([GetCloudFormationTemplate] -> ShowS)
-> Show GetCloudFormationTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCloudFormationTemplate] -> ShowS
$cshowList :: [GetCloudFormationTemplate] -> ShowS
show :: GetCloudFormationTemplate -> String
$cshow :: GetCloudFormationTemplate -> String
showsPrec :: Int -> GetCloudFormationTemplate -> ShowS
$cshowsPrec :: Int -> GetCloudFormationTemplate -> ShowS
Prelude.Show, (forall x.
 GetCloudFormationTemplate -> Rep GetCloudFormationTemplate x)
-> (forall x.
    Rep GetCloudFormationTemplate x -> GetCloudFormationTemplate)
-> Generic GetCloudFormationTemplate
forall x.
Rep GetCloudFormationTemplate x -> GetCloudFormationTemplate
forall x.
GetCloudFormationTemplate -> Rep GetCloudFormationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCloudFormationTemplate x -> GetCloudFormationTemplate
$cfrom :: forall x.
GetCloudFormationTemplate -> Rep GetCloudFormationTemplate x
Prelude.Generic)

-- |
-- Create a value of 'GetCloudFormationTemplate' 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:
--
-- 'applicationId', 'getCloudFormationTemplate_applicationId' - The Amazon Resource Name (ARN) of the application.
--
-- 'templateId', 'getCloudFormationTemplate_templateId' - The UUID returned by CreateCloudFormationTemplate.
--
-- Pattern:
-- [0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}
newGetCloudFormationTemplate ::
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'templateId'
  Prelude.Text ->
  GetCloudFormationTemplate
newGetCloudFormationTemplate :: Text -> Text -> GetCloudFormationTemplate
newGetCloudFormationTemplate
  Text
pApplicationId_
  Text
pTemplateId_ =
    GetCloudFormationTemplate' :: Text -> Text -> GetCloudFormationTemplate
GetCloudFormationTemplate'
      { $sel:applicationId:GetCloudFormationTemplate' :: Text
applicationId =
          Text
pApplicationId_,
        $sel:templateId:GetCloudFormationTemplate' :: Text
templateId = Text
pTemplateId_
      }

-- | The Amazon Resource Name (ARN) of the application.
getCloudFormationTemplate_applicationId :: Lens.Lens' GetCloudFormationTemplate Prelude.Text
getCloudFormationTemplate_applicationId :: (Text -> f Text)
-> GetCloudFormationTemplate -> f GetCloudFormationTemplate
getCloudFormationTemplate_applicationId = (GetCloudFormationTemplate -> Text)
-> (GetCloudFormationTemplate -> Text -> GetCloudFormationTemplate)
-> Lens
     GetCloudFormationTemplate GetCloudFormationTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplate' {Text
applicationId :: Text
$sel:applicationId:GetCloudFormationTemplate' :: GetCloudFormationTemplate -> Text
applicationId} -> Text
applicationId) (\s :: GetCloudFormationTemplate
s@GetCloudFormationTemplate' {} Text
a -> GetCloudFormationTemplate
s {$sel:applicationId:GetCloudFormationTemplate' :: Text
applicationId = Text
a} :: GetCloudFormationTemplate)

-- | The UUID returned by CreateCloudFormationTemplate.
--
-- Pattern:
-- [0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}
getCloudFormationTemplate_templateId :: Lens.Lens' GetCloudFormationTemplate Prelude.Text
getCloudFormationTemplate_templateId :: (Text -> f Text)
-> GetCloudFormationTemplate -> f GetCloudFormationTemplate
getCloudFormationTemplate_templateId = (GetCloudFormationTemplate -> Text)
-> (GetCloudFormationTemplate -> Text -> GetCloudFormationTemplate)
-> Lens
     GetCloudFormationTemplate GetCloudFormationTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplate' {Text
templateId :: Text
$sel:templateId:GetCloudFormationTemplate' :: GetCloudFormationTemplate -> Text
templateId} -> Text
templateId) (\s :: GetCloudFormationTemplate
s@GetCloudFormationTemplate' {} Text
a -> GetCloudFormationTemplate
s {$sel:templateId:GetCloudFormationTemplate' :: Text
templateId = Text
a} :: GetCloudFormationTemplate)

instance Core.AWSRequest GetCloudFormationTemplate where
  type
    AWSResponse GetCloudFormationTemplate =
      GetCloudFormationTemplateResponse
  request :: GetCloudFormationTemplate -> Request GetCloudFormationTemplate
request = Service
-> GetCloudFormationTemplate -> Request GetCloudFormationTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetCloudFormationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCloudFormationTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetCloudFormationTemplate))
-> Logger
-> Service
-> Proxy GetCloudFormationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCloudFormationTemplate)))
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 Status
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetCloudFormationTemplateResponse
GetCloudFormationTemplateResponse'
            (Maybe Text
 -> Maybe Status
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Status
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetCloudFormationTemplateResponse)
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
"creationTime")
            Either
  String
  (Maybe Status
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetCloudFormationTemplateResponse)
-> Either String (Maybe Status)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetCloudFormationTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Status)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetCloudFormationTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"templateId")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetCloudFormationTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"semanticVersion")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> GetCloudFormationTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"applicationId")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> GetCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> GetCloudFormationTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"templateUrl")
            Either
  String (Maybe Text -> Int -> GetCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetCloudFormationTemplateResponse)
forall (f :: * -> *) a b. Applicative f => 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
"expirationTime")
            Either String (Int -> GetCloudFormationTemplateResponse)
-> Either String Int
-> Either String GetCloudFormationTemplateResponse
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 GetCloudFormationTemplate

instance Prelude.NFData GetCloudFormationTemplate

instance Core.ToHeaders GetCloudFormationTemplate where
  toHeaders :: GetCloudFormationTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetCloudFormationTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath GetCloudFormationTemplate where
  toPath :: GetCloudFormationTemplate -> ByteString
toPath GetCloudFormationTemplate' {Text
templateId :: Text
applicationId :: Text
$sel:templateId:GetCloudFormationTemplate' :: GetCloudFormationTemplate -> Text
$sel:applicationId:GetCloudFormationTemplate' :: GetCloudFormationTemplate -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/applications/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
        ByteString
"/templates/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateId
      ]

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

-- | /See:/ 'newGetCloudFormationTemplateResponse' smart constructor.
data GetCloudFormationTemplateResponse = GetCloudFormationTemplateResponse'
  { -- | The date and time this resource was created.
    GetCloudFormationTemplateResponse -> Maybe Text
creationTime :: Prelude.Maybe Prelude.Text,
    -- | Status of the template creation workflow.
    --
    -- Possible values: PREPARING | ACTIVE | EXPIRED
    GetCloudFormationTemplateResponse -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The UUID returned by CreateCloudFormationTemplate.
    --
    -- Pattern:
    -- [0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}
    GetCloudFormationTemplateResponse -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
    -- | The semantic version of the application:
    --
    -- <https://semver.org/>
    GetCloudFormationTemplateResponse -> Maybe Text
semanticVersion :: Prelude.Maybe Prelude.Text,
    -- | The application Amazon Resource Name (ARN).
    GetCloudFormationTemplateResponse -> Maybe Text
applicationId :: Prelude.Maybe Prelude.Text,
    -- | A link to the template that can be used to deploy the application using
    -- AWS CloudFormation.
    GetCloudFormationTemplateResponse -> Maybe Text
templateUrl :: Prelude.Maybe Prelude.Text,
    -- | The date and time this template expires. Templates expire 1 hour after
    -- creation.
    GetCloudFormationTemplateResponse -> Maybe Text
expirationTime :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetCloudFormationTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCloudFormationTemplateResponse
-> GetCloudFormationTemplateResponse -> Bool
(GetCloudFormationTemplateResponse
 -> GetCloudFormationTemplateResponse -> Bool)
-> (GetCloudFormationTemplateResponse
    -> GetCloudFormationTemplateResponse -> Bool)
-> Eq GetCloudFormationTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCloudFormationTemplateResponse
-> GetCloudFormationTemplateResponse -> Bool
$c/= :: GetCloudFormationTemplateResponse
-> GetCloudFormationTemplateResponse -> Bool
== :: GetCloudFormationTemplateResponse
-> GetCloudFormationTemplateResponse -> Bool
$c== :: GetCloudFormationTemplateResponse
-> GetCloudFormationTemplateResponse -> Bool
Prelude.Eq, ReadPrec [GetCloudFormationTemplateResponse]
ReadPrec GetCloudFormationTemplateResponse
Int -> ReadS GetCloudFormationTemplateResponse
ReadS [GetCloudFormationTemplateResponse]
(Int -> ReadS GetCloudFormationTemplateResponse)
-> ReadS [GetCloudFormationTemplateResponse]
-> ReadPrec GetCloudFormationTemplateResponse
-> ReadPrec [GetCloudFormationTemplateResponse]
-> Read GetCloudFormationTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCloudFormationTemplateResponse]
$creadListPrec :: ReadPrec [GetCloudFormationTemplateResponse]
readPrec :: ReadPrec GetCloudFormationTemplateResponse
$creadPrec :: ReadPrec GetCloudFormationTemplateResponse
readList :: ReadS [GetCloudFormationTemplateResponse]
$creadList :: ReadS [GetCloudFormationTemplateResponse]
readsPrec :: Int -> ReadS GetCloudFormationTemplateResponse
$creadsPrec :: Int -> ReadS GetCloudFormationTemplateResponse
Prelude.Read, Int -> GetCloudFormationTemplateResponse -> ShowS
[GetCloudFormationTemplateResponse] -> ShowS
GetCloudFormationTemplateResponse -> String
(Int -> GetCloudFormationTemplateResponse -> ShowS)
-> (GetCloudFormationTemplateResponse -> String)
-> ([GetCloudFormationTemplateResponse] -> ShowS)
-> Show GetCloudFormationTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCloudFormationTemplateResponse] -> ShowS
$cshowList :: [GetCloudFormationTemplateResponse] -> ShowS
show :: GetCloudFormationTemplateResponse -> String
$cshow :: GetCloudFormationTemplateResponse -> String
showsPrec :: Int -> GetCloudFormationTemplateResponse -> ShowS
$cshowsPrec :: Int -> GetCloudFormationTemplateResponse -> ShowS
Prelude.Show, (forall x.
 GetCloudFormationTemplateResponse
 -> Rep GetCloudFormationTemplateResponse x)
-> (forall x.
    Rep GetCloudFormationTemplateResponse x
    -> GetCloudFormationTemplateResponse)
-> Generic GetCloudFormationTemplateResponse
forall x.
Rep GetCloudFormationTemplateResponse x
-> GetCloudFormationTemplateResponse
forall x.
GetCloudFormationTemplateResponse
-> Rep GetCloudFormationTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCloudFormationTemplateResponse x
-> GetCloudFormationTemplateResponse
$cfrom :: forall x.
GetCloudFormationTemplateResponse
-> Rep GetCloudFormationTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCloudFormationTemplateResponse' 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:
--
-- 'creationTime', 'getCloudFormationTemplateResponse_creationTime' - The date and time this resource was created.
--
-- 'status', 'getCloudFormationTemplateResponse_status' - Status of the template creation workflow.
--
-- Possible values: PREPARING | ACTIVE | EXPIRED
--
-- 'templateId', 'getCloudFormationTemplateResponse_templateId' - The UUID returned by CreateCloudFormationTemplate.
--
-- Pattern:
-- [0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}
--
-- 'semanticVersion', 'getCloudFormationTemplateResponse_semanticVersion' - The semantic version of the application:
--
-- <https://semver.org/>
--
-- 'applicationId', 'getCloudFormationTemplateResponse_applicationId' - The application Amazon Resource Name (ARN).
--
-- 'templateUrl', 'getCloudFormationTemplateResponse_templateUrl' - A link to the template that can be used to deploy the application using
-- AWS CloudFormation.
--
-- 'expirationTime', 'getCloudFormationTemplateResponse_expirationTime' - The date and time this template expires. Templates expire 1 hour after
-- creation.
--
-- 'httpStatus', 'getCloudFormationTemplateResponse_httpStatus' - The response's http status code.
newGetCloudFormationTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCloudFormationTemplateResponse
newGetCloudFormationTemplateResponse :: Int -> GetCloudFormationTemplateResponse
newGetCloudFormationTemplateResponse Int
pHttpStatus_ =
  GetCloudFormationTemplateResponse' :: Maybe Text
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetCloudFormationTemplateResponse
GetCloudFormationTemplateResponse'
    { $sel:creationTime:GetCloudFormationTemplateResponse' :: Maybe Text
creationTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:GetCloudFormationTemplateResponse' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
      $sel:templateId:GetCloudFormationTemplateResponse' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:semanticVersion:GetCloudFormationTemplateResponse' :: Maybe Text
semanticVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationId:GetCloudFormationTemplateResponse' :: Maybe Text
applicationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateUrl:GetCloudFormationTemplateResponse' :: Maybe Text
templateUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expirationTime:GetCloudFormationTemplateResponse' :: Maybe Text
expirationTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCloudFormationTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The date and time this resource was created.
getCloudFormationTemplateResponse_creationTime :: Lens.Lens' GetCloudFormationTemplateResponse (Prelude.Maybe Prelude.Text)
getCloudFormationTemplateResponse_creationTime :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationTemplateResponse
-> f GetCloudFormationTemplateResponse
getCloudFormationTemplateResponse_creationTime = (GetCloudFormationTemplateResponse -> Maybe Text)
-> (GetCloudFormationTemplateResponse
    -> Maybe Text -> GetCloudFormationTemplateResponse)
-> Lens
     GetCloudFormationTemplateResponse
     GetCloudFormationTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplateResponse' {Maybe Text
creationTime :: Maybe Text
$sel:creationTime:GetCloudFormationTemplateResponse' :: GetCloudFormationTemplateResponse -> Maybe Text
creationTime} -> Maybe Text
creationTime) (\s :: GetCloudFormationTemplateResponse
s@GetCloudFormationTemplateResponse' {} Maybe Text
a -> GetCloudFormationTemplateResponse
s {$sel:creationTime:GetCloudFormationTemplateResponse' :: Maybe Text
creationTime = Maybe Text
a} :: GetCloudFormationTemplateResponse)

-- | Status of the template creation workflow.
--
-- Possible values: PREPARING | ACTIVE | EXPIRED
getCloudFormationTemplateResponse_status :: Lens.Lens' GetCloudFormationTemplateResponse (Prelude.Maybe Status)
getCloudFormationTemplateResponse_status :: (Maybe Status -> f (Maybe Status))
-> GetCloudFormationTemplateResponse
-> f GetCloudFormationTemplateResponse
getCloudFormationTemplateResponse_status = (GetCloudFormationTemplateResponse -> Maybe Status)
-> (GetCloudFormationTemplateResponse
    -> Maybe Status -> GetCloudFormationTemplateResponse)
-> Lens
     GetCloudFormationTemplateResponse
     GetCloudFormationTemplateResponse
     (Maybe Status)
     (Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplateResponse' {Maybe Status
status :: Maybe Status
$sel:status:GetCloudFormationTemplateResponse' :: GetCloudFormationTemplateResponse -> Maybe Status
status} -> Maybe Status
status) (\s :: GetCloudFormationTemplateResponse
s@GetCloudFormationTemplateResponse' {} Maybe Status
a -> GetCloudFormationTemplateResponse
s {$sel:status:GetCloudFormationTemplateResponse' :: Maybe Status
status = Maybe Status
a} :: GetCloudFormationTemplateResponse)

-- | The UUID returned by CreateCloudFormationTemplate.
--
-- Pattern:
-- [0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}
getCloudFormationTemplateResponse_templateId :: Lens.Lens' GetCloudFormationTemplateResponse (Prelude.Maybe Prelude.Text)
getCloudFormationTemplateResponse_templateId :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationTemplateResponse
-> f GetCloudFormationTemplateResponse
getCloudFormationTemplateResponse_templateId = (GetCloudFormationTemplateResponse -> Maybe Text)
-> (GetCloudFormationTemplateResponse
    -> Maybe Text -> GetCloudFormationTemplateResponse)
-> Lens
     GetCloudFormationTemplateResponse
     GetCloudFormationTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplateResponse' {Maybe Text
templateId :: Maybe Text
$sel:templateId:GetCloudFormationTemplateResponse' :: GetCloudFormationTemplateResponse -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: GetCloudFormationTemplateResponse
s@GetCloudFormationTemplateResponse' {} Maybe Text
a -> GetCloudFormationTemplateResponse
s {$sel:templateId:GetCloudFormationTemplateResponse' :: Maybe Text
templateId = Maybe Text
a} :: GetCloudFormationTemplateResponse)

-- | The semantic version of the application:
--
-- <https://semver.org/>
getCloudFormationTemplateResponse_semanticVersion :: Lens.Lens' GetCloudFormationTemplateResponse (Prelude.Maybe Prelude.Text)
getCloudFormationTemplateResponse_semanticVersion :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationTemplateResponse
-> f GetCloudFormationTemplateResponse
getCloudFormationTemplateResponse_semanticVersion = (GetCloudFormationTemplateResponse -> Maybe Text)
-> (GetCloudFormationTemplateResponse
    -> Maybe Text -> GetCloudFormationTemplateResponse)
-> Lens
     GetCloudFormationTemplateResponse
     GetCloudFormationTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplateResponse' {Maybe Text
semanticVersion :: Maybe Text
$sel:semanticVersion:GetCloudFormationTemplateResponse' :: GetCloudFormationTemplateResponse -> Maybe Text
semanticVersion} -> Maybe Text
semanticVersion) (\s :: GetCloudFormationTemplateResponse
s@GetCloudFormationTemplateResponse' {} Maybe Text
a -> GetCloudFormationTemplateResponse
s {$sel:semanticVersion:GetCloudFormationTemplateResponse' :: Maybe Text
semanticVersion = Maybe Text
a} :: GetCloudFormationTemplateResponse)

-- | The application Amazon Resource Name (ARN).
getCloudFormationTemplateResponse_applicationId :: Lens.Lens' GetCloudFormationTemplateResponse (Prelude.Maybe Prelude.Text)
getCloudFormationTemplateResponse_applicationId :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationTemplateResponse
-> f GetCloudFormationTemplateResponse
getCloudFormationTemplateResponse_applicationId = (GetCloudFormationTemplateResponse -> Maybe Text)
-> (GetCloudFormationTemplateResponse
    -> Maybe Text -> GetCloudFormationTemplateResponse)
-> Lens
     GetCloudFormationTemplateResponse
     GetCloudFormationTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplateResponse' {Maybe Text
applicationId :: Maybe Text
$sel:applicationId:GetCloudFormationTemplateResponse' :: GetCloudFormationTemplateResponse -> Maybe Text
applicationId} -> Maybe Text
applicationId) (\s :: GetCloudFormationTemplateResponse
s@GetCloudFormationTemplateResponse' {} Maybe Text
a -> GetCloudFormationTemplateResponse
s {$sel:applicationId:GetCloudFormationTemplateResponse' :: Maybe Text
applicationId = Maybe Text
a} :: GetCloudFormationTemplateResponse)

-- | A link to the template that can be used to deploy the application using
-- AWS CloudFormation.
getCloudFormationTemplateResponse_templateUrl :: Lens.Lens' GetCloudFormationTemplateResponse (Prelude.Maybe Prelude.Text)
getCloudFormationTemplateResponse_templateUrl :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationTemplateResponse
-> f GetCloudFormationTemplateResponse
getCloudFormationTemplateResponse_templateUrl = (GetCloudFormationTemplateResponse -> Maybe Text)
-> (GetCloudFormationTemplateResponse
    -> Maybe Text -> GetCloudFormationTemplateResponse)
-> Lens
     GetCloudFormationTemplateResponse
     GetCloudFormationTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplateResponse' {Maybe Text
templateUrl :: Maybe Text
$sel:templateUrl:GetCloudFormationTemplateResponse' :: GetCloudFormationTemplateResponse -> Maybe Text
templateUrl} -> Maybe Text
templateUrl) (\s :: GetCloudFormationTemplateResponse
s@GetCloudFormationTemplateResponse' {} Maybe Text
a -> GetCloudFormationTemplateResponse
s {$sel:templateUrl:GetCloudFormationTemplateResponse' :: Maybe Text
templateUrl = Maybe Text
a} :: GetCloudFormationTemplateResponse)

-- | The date and time this template expires. Templates expire 1 hour after
-- creation.
getCloudFormationTemplateResponse_expirationTime :: Lens.Lens' GetCloudFormationTemplateResponse (Prelude.Maybe Prelude.Text)
getCloudFormationTemplateResponse_expirationTime :: (Maybe Text -> f (Maybe Text))
-> GetCloudFormationTemplateResponse
-> f GetCloudFormationTemplateResponse
getCloudFormationTemplateResponse_expirationTime = (GetCloudFormationTemplateResponse -> Maybe Text)
-> (GetCloudFormationTemplateResponse
    -> Maybe Text -> GetCloudFormationTemplateResponse)
-> Lens
     GetCloudFormationTemplateResponse
     GetCloudFormationTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCloudFormationTemplateResponse' {Maybe Text
expirationTime :: Maybe Text
$sel:expirationTime:GetCloudFormationTemplateResponse' :: GetCloudFormationTemplateResponse -> Maybe Text
expirationTime} -> Maybe Text
expirationTime) (\s :: GetCloudFormationTemplateResponse
s@GetCloudFormationTemplateResponse' {} Maybe Text
a -> GetCloudFormationTemplateResponse
s {$sel:expirationTime:GetCloudFormationTemplateResponse' :: Maybe Text
expirationTime = Maybe Text
a} :: GetCloudFormationTemplateResponse)

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

instance
  Prelude.NFData
    GetCloudFormationTemplateResponse