{-# 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.CreateCloudFormationTemplate
-- 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)
--
-- Creates an AWS CloudFormation template.
module Amazonka.ServerlessApplicationRepository.CreateCloudFormationTemplate
  ( -- * Creating a Request
    CreateCloudFormationTemplate (..),
    newCreateCloudFormationTemplate,

    -- * Request Lenses
    createCloudFormationTemplate_semanticVersion,
    createCloudFormationTemplate_applicationId,

    -- * Destructuring the Response
    CreateCloudFormationTemplateResponse (..),
    newCreateCloudFormationTemplateResponse,

    -- * Response Lenses
    createCloudFormationTemplateResponse_creationTime,
    createCloudFormationTemplateResponse_status,
    createCloudFormationTemplateResponse_templateId,
    createCloudFormationTemplateResponse_semanticVersion,
    createCloudFormationTemplateResponse_applicationId,
    createCloudFormationTemplateResponse_templateUrl,
    createCloudFormationTemplateResponse_expirationTime,
    createCloudFormationTemplateResponse_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:/ 'newCreateCloudFormationTemplate' smart constructor.
data CreateCloudFormationTemplate = CreateCloudFormationTemplate'
  { -- | The semantic version of the application:
    --
    -- <https://semver.org/>
    CreateCloudFormationTemplate -> Maybe Text
semanticVersion :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the application.
    CreateCloudFormationTemplate -> Text
applicationId :: Prelude.Text
  }
  deriving (CreateCloudFormationTemplate
-> CreateCloudFormationTemplate -> Bool
(CreateCloudFormationTemplate
 -> CreateCloudFormationTemplate -> Bool)
-> (CreateCloudFormationTemplate
    -> CreateCloudFormationTemplate -> Bool)
-> Eq CreateCloudFormationTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCloudFormationTemplate
-> CreateCloudFormationTemplate -> Bool
$c/= :: CreateCloudFormationTemplate
-> CreateCloudFormationTemplate -> Bool
== :: CreateCloudFormationTemplate
-> CreateCloudFormationTemplate -> Bool
$c== :: CreateCloudFormationTemplate
-> CreateCloudFormationTemplate -> Bool
Prelude.Eq, ReadPrec [CreateCloudFormationTemplate]
ReadPrec CreateCloudFormationTemplate
Int -> ReadS CreateCloudFormationTemplate
ReadS [CreateCloudFormationTemplate]
(Int -> ReadS CreateCloudFormationTemplate)
-> ReadS [CreateCloudFormationTemplate]
-> ReadPrec CreateCloudFormationTemplate
-> ReadPrec [CreateCloudFormationTemplate]
-> Read CreateCloudFormationTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCloudFormationTemplate]
$creadListPrec :: ReadPrec [CreateCloudFormationTemplate]
readPrec :: ReadPrec CreateCloudFormationTemplate
$creadPrec :: ReadPrec CreateCloudFormationTemplate
readList :: ReadS [CreateCloudFormationTemplate]
$creadList :: ReadS [CreateCloudFormationTemplate]
readsPrec :: Int -> ReadS CreateCloudFormationTemplate
$creadsPrec :: Int -> ReadS CreateCloudFormationTemplate
Prelude.Read, Int -> CreateCloudFormationTemplate -> ShowS
[CreateCloudFormationTemplate] -> ShowS
CreateCloudFormationTemplate -> String
(Int -> CreateCloudFormationTemplate -> ShowS)
-> (CreateCloudFormationTemplate -> String)
-> ([CreateCloudFormationTemplate] -> ShowS)
-> Show CreateCloudFormationTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCloudFormationTemplate] -> ShowS
$cshowList :: [CreateCloudFormationTemplate] -> ShowS
show :: CreateCloudFormationTemplate -> String
$cshow :: CreateCloudFormationTemplate -> String
showsPrec :: Int -> CreateCloudFormationTemplate -> ShowS
$cshowsPrec :: Int -> CreateCloudFormationTemplate -> ShowS
Prelude.Show, (forall x.
 CreateCloudFormationTemplate -> Rep CreateCloudFormationTemplate x)
-> (forall x.
    Rep CreateCloudFormationTemplate x -> CreateCloudFormationTemplate)
-> Generic CreateCloudFormationTemplate
forall x.
Rep CreateCloudFormationTemplate x -> CreateCloudFormationTemplate
forall x.
CreateCloudFormationTemplate -> Rep CreateCloudFormationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCloudFormationTemplate x -> CreateCloudFormationTemplate
$cfrom :: forall x.
CreateCloudFormationTemplate -> Rep CreateCloudFormationTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CreateCloudFormationTemplate' 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:
--
-- 'semanticVersion', 'createCloudFormationTemplate_semanticVersion' - The semantic version of the application:
--
-- <https://semver.org/>
--
-- 'applicationId', 'createCloudFormationTemplate_applicationId' - The Amazon Resource Name (ARN) of the application.
newCreateCloudFormationTemplate ::
  -- | 'applicationId'
  Prelude.Text ->
  CreateCloudFormationTemplate
newCreateCloudFormationTemplate :: Text -> CreateCloudFormationTemplate
newCreateCloudFormationTemplate Text
pApplicationId_ =
  CreateCloudFormationTemplate' :: Maybe Text -> Text -> CreateCloudFormationTemplate
CreateCloudFormationTemplate'
    { $sel:semanticVersion:CreateCloudFormationTemplate' :: Maybe Text
semanticVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationId:CreateCloudFormationTemplate' :: Text
applicationId = Text
pApplicationId_
    }

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

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

instance Core.AWSRequest CreateCloudFormationTemplate where
  type
    AWSResponse CreateCloudFormationTemplate =
      CreateCloudFormationTemplateResponse
  request :: CreateCloudFormationTemplate
-> Request CreateCloudFormationTemplate
request = Service
-> CreateCloudFormationTemplate
-> Request CreateCloudFormationTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCloudFormationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCloudFormationTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateCloudFormationTemplate))
-> Logger
-> Service
-> Proxy CreateCloudFormationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCloudFormationTemplate)))
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
-> CreateCloudFormationTemplateResponse
CreateCloudFormationTemplateResponse'
            (Maybe Text
 -> Maybe Status
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Status
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateCloudFormationTemplateResponse)
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
   -> CreateCloudFormationTemplateResponse)
-> Either String (Maybe Status)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateCloudFormationTemplateResponse)
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
   -> CreateCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateCloudFormationTemplateResponse)
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
   -> CreateCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateCloudFormationTemplateResponse)
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
   -> CreateCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateCloudFormationTemplateResponse)
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 -> CreateCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateCloudFormationTemplateResponse)
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 -> CreateCloudFormationTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateCloudFormationTemplateResponse)
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 -> CreateCloudFormationTemplateResponse)
-> Either String Int
-> Either String CreateCloudFormationTemplateResponse
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
    CreateCloudFormationTemplate

instance Prelude.NFData CreateCloudFormationTemplate

instance Core.ToHeaders CreateCloudFormationTemplate where
  toHeaders :: CreateCloudFormationTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateCloudFormationTemplate -> 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.ToJSON CreateCloudFormationTemplate where
  toJSON :: CreateCloudFormationTemplate -> Value
toJSON CreateCloudFormationTemplate' {Maybe Text
Text
applicationId :: Text
semanticVersion :: Maybe Text
$sel:applicationId:CreateCloudFormationTemplate' :: CreateCloudFormationTemplate -> Text
$sel:semanticVersion:CreateCloudFormationTemplate' :: CreateCloudFormationTemplate -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"semanticVersion" 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
semanticVersion
          ]
      )

instance Core.ToPath CreateCloudFormationTemplate where
  toPath :: CreateCloudFormationTemplate -> ByteString
toPath CreateCloudFormationTemplate' {Maybe Text
Text
applicationId :: Text
semanticVersion :: Maybe Text
$sel:applicationId:CreateCloudFormationTemplate' :: CreateCloudFormationTemplate -> Text
$sel:semanticVersion:CreateCloudFormationTemplate' :: CreateCloudFormationTemplate -> Maybe 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"
      ]

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

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

-- |
-- Create a value of 'CreateCloudFormationTemplateResponse' 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', 'createCloudFormationTemplateResponse_creationTime' - The date and time this resource was created.
--
-- 'status', 'createCloudFormationTemplateResponse_status' - Status of the template creation workflow.
--
-- Possible values: PREPARING | ACTIVE | EXPIRED
--
-- 'templateId', 'createCloudFormationTemplateResponse_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', 'createCloudFormationTemplateResponse_semanticVersion' - The semantic version of the application:
--
-- <https://semver.org/>
--
-- 'applicationId', 'createCloudFormationTemplateResponse_applicationId' - The application Amazon Resource Name (ARN).
--
-- 'templateUrl', 'createCloudFormationTemplateResponse_templateUrl' - A link to the template that can be used to deploy the application using
-- AWS CloudFormation.
--
-- 'expirationTime', 'createCloudFormationTemplateResponse_expirationTime' - The date and time this template expires. Templates expire 1 hour after
-- creation.
--
-- 'httpStatus', 'createCloudFormationTemplateResponse_httpStatus' - The response's http status code.
newCreateCloudFormationTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCloudFormationTemplateResponse
newCreateCloudFormationTemplateResponse :: Int -> CreateCloudFormationTemplateResponse
newCreateCloudFormationTemplateResponse Int
pHttpStatus_ =
  CreateCloudFormationTemplateResponse' :: Maybe Text
-> Maybe Status
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateCloudFormationTemplateResponse
CreateCloudFormationTemplateResponse'
    { $sel:creationTime:CreateCloudFormationTemplateResponse' :: Maybe Text
creationTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateCloudFormationTemplateResponse' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
      $sel:templateId:CreateCloudFormationTemplateResponse' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:semanticVersion:CreateCloudFormationTemplateResponse' :: Maybe Text
semanticVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationId:CreateCloudFormationTemplateResponse' :: Maybe Text
applicationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateUrl:CreateCloudFormationTemplateResponse' :: Maybe Text
templateUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:expirationTime:CreateCloudFormationTemplateResponse' :: Maybe Text
expirationTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCloudFormationTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

-- | 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}
createCloudFormationTemplateResponse_templateId :: Lens.Lens' CreateCloudFormationTemplateResponse (Prelude.Maybe Prelude.Text)
createCloudFormationTemplateResponse_templateId :: (Maybe Text -> f (Maybe Text))
-> CreateCloudFormationTemplateResponse
-> f CreateCloudFormationTemplateResponse
createCloudFormationTemplateResponse_templateId = (CreateCloudFormationTemplateResponse -> Maybe Text)
-> (CreateCloudFormationTemplateResponse
    -> Maybe Text -> CreateCloudFormationTemplateResponse)
-> Lens
     CreateCloudFormationTemplateResponse
     CreateCloudFormationTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCloudFormationTemplateResponse' {Maybe Text
templateId :: Maybe Text
$sel:templateId:CreateCloudFormationTemplateResponse' :: CreateCloudFormationTemplateResponse -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: CreateCloudFormationTemplateResponse
s@CreateCloudFormationTemplateResponse' {} Maybe Text
a -> CreateCloudFormationTemplateResponse
s {$sel:templateId:CreateCloudFormationTemplateResponse' :: Maybe Text
templateId = Maybe Text
a} :: CreateCloudFormationTemplateResponse)

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

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

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

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

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

instance
  Prelude.NFData
    CreateCloudFormationTemplateResponse