{-# 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.ElasticBeanstalk.CreateConfigurationTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an AWS Elastic Beanstalk configuration template, associated with
-- a specific Elastic Beanstalk application. You define application
-- configuration settings in a configuration template. You can then use the
-- configuration template to deploy different versions of the application
-- with the same configuration settings.
--
-- Templates aren\'t associated with any environment. The @EnvironmentName@
-- response element is always @null@.
--
-- Related Topics
--
-- -   DescribeConfigurationOptions
--
-- -   DescribeConfigurationSettings
--
-- -   ListAvailableSolutionStacks
module Amazonka.ElasticBeanstalk.CreateConfigurationTemplate
  ( -- * Creating a Request
    CreateConfigurationTemplate (..),
    newCreateConfigurationTemplate,

    -- * Request Lenses
    createConfigurationTemplate_description,
    createConfigurationTemplate_environmentId,
    createConfigurationTemplate_optionSettings,
    createConfigurationTemplate_platformArn,
    createConfigurationTemplate_solutionStackName,
    createConfigurationTemplate_sourceConfiguration,
    createConfigurationTemplate_tags,
    createConfigurationTemplate_applicationName,
    createConfigurationTemplate_templateName,

    -- * Destructuring the Response
    ConfigurationSettingsDescription (..),
    newConfigurationSettingsDescription,

    -- * Response Lenses
    configurationSettingsDescription_applicationName,
    configurationSettingsDescription_dateCreated,
    configurationSettingsDescription_dateUpdated,
    configurationSettingsDescription_deploymentStatus,
    configurationSettingsDescription_description,
    configurationSettingsDescription_environmentName,
    configurationSettingsDescription_optionSettings,
    configurationSettingsDescription_platformArn,
    configurationSettingsDescription_solutionStackName,
    configurationSettingsDescription_templateName,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Request to create a configuration template.
--
-- /See:/ 'newCreateConfigurationTemplate' smart constructor.
data CreateConfigurationTemplate = CreateConfigurationTemplate'
  { -- | An optional description for this configuration.
    CreateConfigurationTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of an environment whose settings you want to use to create the
    -- configuration template. You must specify @EnvironmentId@ if you don\'t
    -- specify @PlatformArn@, @SolutionStackName@, or @SourceConfiguration@.
    CreateConfigurationTemplate -> Maybe Text
environmentId :: Prelude.Maybe Prelude.Text,
    -- | Option values for the Elastic Beanstalk configuration, such as the
    -- instance type. If specified, these values override the values obtained
    -- from the solution stack or the source configuration template. For a
    -- complete list of Elastic Beanstalk configuration options, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html Option Values>
    -- in the /AWS Elastic Beanstalk Developer Guide/.
    CreateConfigurationTemplate -> Maybe [ConfigurationOptionSetting]
optionSettings :: Prelude.Maybe [ConfigurationOptionSetting],
    -- | The Amazon Resource Name (ARN) of the custom platform. For more
    -- information, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html Custom Platforms>
    -- in the /AWS Elastic Beanstalk Developer Guide/.
    --
    -- If you specify @PlatformArn@, then don\'t specify @SolutionStackName@.
    CreateConfigurationTemplate -> Maybe Text
platformArn :: Prelude.Maybe Prelude.Text,
    -- | The name of an Elastic Beanstalk solution stack (platform version) that
    -- this configuration uses. For example,
    -- @64bit Amazon Linux 2013.09 running Tomcat 7 Java 7@. A solution stack
    -- specifies the operating system, runtime, and application server for a
    -- configuration template. It also determines the set of configuration
    -- options as well as the possible and default values. For more
    -- information, see
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html Supported Platforms>
    -- in the /AWS Elastic Beanstalk Developer Guide/.
    --
    -- You must specify @SolutionStackName@ if you don\'t specify
    -- @PlatformArn@, @EnvironmentId@, or @SourceConfiguration@.
    --
    -- Use the
    -- <https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_ListAvailableSolutionStacks.html ListAvailableSolutionStacks>
    -- API to obtain a list of available solution stacks.
    CreateConfigurationTemplate -> Maybe Text
solutionStackName :: Prelude.Maybe Prelude.Text,
    -- | An Elastic Beanstalk configuration template to base this one on. If
    -- specified, Elastic Beanstalk uses the configuration values from the
    -- specified configuration template to create a new configuration.
    --
    -- Values specified in @OptionSettings@ override any values obtained from
    -- the @SourceConfiguration@.
    --
    -- You must specify @SourceConfiguration@ if you don\'t specify
    -- @PlatformArn@, @EnvironmentId@, or @SolutionStackName@.
    --
    -- Constraint: If both solution stack name and source configuration are
    -- specified, the solution stack of the source configuration template must
    -- match the specified solution stack name.
    CreateConfigurationTemplate -> Maybe SourceConfiguration
sourceConfiguration :: Prelude.Maybe SourceConfiguration,
    -- | Specifies the tags applied to the configuration template.
    CreateConfigurationTemplate -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the Elastic Beanstalk application to associate with this
    -- configuration template.
    CreateConfigurationTemplate -> Text
applicationName :: Prelude.Text,
    -- | The name of the configuration template.
    --
    -- Constraint: This name must be unique per application.
    CreateConfigurationTemplate -> Text
templateName :: Prelude.Text
  }
  deriving (CreateConfigurationTemplate -> CreateConfigurationTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConfigurationTemplate -> CreateConfigurationTemplate -> Bool
$c/= :: CreateConfigurationTemplate -> CreateConfigurationTemplate -> Bool
== :: CreateConfigurationTemplate -> CreateConfigurationTemplate -> Bool
$c== :: CreateConfigurationTemplate -> CreateConfigurationTemplate -> Bool
Prelude.Eq, ReadPrec [CreateConfigurationTemplate]
ReadPrec CreateConfigurationTemplate
Int -> ReadS CreateConfigurationTemplate
ReadS [CreateConfigurationTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConfigurationTemplate]
$creadListPrec :: ReadPrec [CreateConfigurationTemplate]
readPrec :: ReadPrec CreateConfigurationTemplate
$creadPrec :: ReadPrec CreateConfigurationTemplate
readList :: ReadS [CreateConfigurationTemplate]
$creadList :: ReadS [CreateConfigurationTemplate]
readsPrec :: Int -> ReadS CreateConfigurationTemplate
$creadsPrec :: Int -> ReadS CreateConfigurationTemplate
Prelude.Read, Int -> CreateConfigurationTemplate -> ShowS
[CreateConfigurationTemplate] -> ShowS
CreateConfigurationTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConfigurationTemplate] -> ShowS
$cshowList :: [CreateConfigurationTemplate] -> ShowS
show :: CreateConfigurationTemplate -> String
$cshow :: CreateConfigurationTemplate -> String
showsPrec :: Int -> CreateConfigurationTemplate -> ShowS
$cshowsPrec :: Int -> CreateConfigurationTemplate -> ShowS
Prelude.Show, forall x.
Rep CreateConfigurationTemplate x -> CreateConfigurationTemplate
forall x.
CreateConfigurationTemplate -> Rep CreateConfigurationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateConfigurationTemplate x -> CreateConfigurationTemplate
$cfrom :: forall x.
CreateConfigurationTemplate -> Rep CreateConfigurationTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CreateConfigurationTemplate' 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:
--
-- 'description', 'createConfigurationTemplate_description' - An optional description for this configuration.
--
-- 'environmentId', 'createConfigurationTemplate_environmentId' - The ID of an environment whose settings you want to use to create the
-- configuration template. You must specify @EnvironmentId@ if you don\'t
-- specify @PlatformArn@, @SolutionStackName@, or @SourceConfiguration@.
--
-- 'optionSettings', 'createConfigurationTemplate_optionSettings' - Option values for the Elastic Beanstalk configuration, such as the
-- instance type. If specified, these values override the values obtained
-- from the solution stack or the source configuration template. For a
-- complete list of Elastic Beanstalk configuration options, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html Option Values>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- 'platformArn', 'createConfigurationTemplate_platformArn' - The Amazon Resource Name (ARN) of the custom platform. For more
-- information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html Custom Platforms>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- If you specify @PlatformArn@, then don\'t specify @SolutionStackName@.
--
-- 'solutionStackName', 'createConfigurationTemplate_solutionStackName' - The name of an Elastic Beanstalk solution stack (platform version) that
-- this configuration uses. For example,
-- @64bit Amazon Linux 2013.09 running Tomcat 7 Java 7@. A solution stack
-- specifies the operating system, runtime, and application server for a
-- configuration template. It also determines the set of configuration
-- options as well as the possible and default values. For more
-- information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html Supported Platforms>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- You must specify @SolutionStackName@ if you don\'t specify
-- @PlatformArn@, @EnvironmentId@, or @SourceConfiguration@.
--
-- Use the
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_ListAvailableSolutionStacks.html ListAvailableSolutionStacks>
-- API to obtain a list of available solution stacks.
--
-- 'sourceConfiguration', 'createConfigurationTemplate_sourceConfiguration' - An Elastic Beanstalk configuration template to base this one on. If
-- specified, Elastic Beanstalk uses the configuration values from the
-- specified configuration template to create a new configuration.
--
-- Values specified in @OptionSettings@ override any values obtained from
-- the @SourceConfiguration@.
--
-- You must specify @SourceConfiguration@ if you don\'t specify
-- @PlatformArn@, @EnvironmentId@, or @SolutionStackName@.
--
-- Constraint: If both solution stack name and source configuration are
-- specified, the solution stack of the source configuration template must
-- match the specified solution stack name.
--
-- 'tags', 'createConfigurationTemplate_tags' - Specifies the tags applied to the configuration template.
--
-- 'applicationName', 'createConfigurationTemplate_applicationName' - The name of the Elastic Beanstalk application to associate with this
-- configuration template.
--
-- 'templateName', 'createConfigurationTemplate_templateName' - The name of the configuration template.
--
-- Constraint: This name must be unique per application.
newCreateConfigurationTemplate ::
  -- | 'applicationName'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  CreateConfigurationTemplate
newCreateConfigurationTemplate :: Text -> Text -> CreateConfigurationTemplate
newCreateConfigurationTemplate
  Text
pApplicationName_
  Text
pTemplateName_ =
    CreateConfigurationTemplate'
      { $sel:description:CreateConfigurationTemplate' :: Maybe Text
description =
          forall a. Maybe a
Prelude.Nothing,
        $sel:environmentId:CreateConfigurationTemplate' :: Maybe Text
environmentId = forall a. Maybe a
Prelude.Nothing,
        $sel:optionSettings:CreateConfigurationTemplate' :: Maybe [ConfigurationOptionSetting]
optionSettings = forall a. Maybe a
Prelude.Nothing,
        $sel:platformArn:CreateConfigurationTemplate' :: Maybe Text
platformArn = forall a. Maybe a
Prelude.Nothing,
        $sel:solutionStackName:CreateConfigurationTemplate' :: Maybe Text
solutionStackName = forall a. Maybe a
Prelude.Nothing,
        $sel:sourceConfiguration:CreateConfigurationTemplate' :: Maybe SourceConfiguration
sourceConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateConfigurationTemplate' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:applicationName:CreateConfigurationTemplate' :: Text
applicationName = Text
pApplicationName_,
        $sel:templateName:CreateConfigurationTemplate' :: Text
templateName = Text
pTemplateName_
      }

-- | An optional description for this configuration.
createConfigurationTemplate_description :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe Prelude.Text)
createConfigurationTemplate_description :: Lens' CreateConfigurationTemplate (Maybe Text)
createConfigurationTemplate_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Maybe Text
description :: Maybe Text
$sel:description:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Maybe Text
a -> CreateConfigurationTemplate
s {$sel:description:CreateConfigurationTemplate' :: Maybe Text
description = Maybe Text
a} :: CreateConfigurationTemplate)

-- | The ID of an environment whose settings you want to use to create the
-- configuration template. You must specify @EnvironmentId@ if you don\'t
-- specify @PlatformArn@, @SolutionStackName@, or @SourceConfiguration@.
createConfigurationTemplate_environmentId :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe Prelude.Text)
createConfigurationTemplate_environmentId :: Lens' CreateConfigurationTemplate (Maybe Text)
createConfigurationTemplate_environmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Maybe Text
environmentId :: Maybe Text
$sel:environmentId:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
environmentId} -> Maybe Text
environmentId) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Maybe Text
a -> CreateConfigurationTemplate
s {$sel:environmentId:CreateConfigurationTemplate' :: Maybe Text
environmentId = Maybe Text
a} :: CreateConfigurationTemplate)

-- | Option values for the Elastic Beanstalk configuration, such as the
-- instance type. If specified, these values override the values obtained
-- from the solution stack or the source configuration template. For a
-- complete list of Elastic Beanstalk configuration options, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html Option Values>
-- in the /AWS Elastic Beanstalk Developer Guide/.
createConfigurationTemplate_optionSettings :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe [ConfigurationOptionSetting])
createConfigurationTemplate_optionSettings :: Lens'
  CreateConfigurationTemplate (Maybe [ConfigurationOptionSetting])
createConfigurationTemplate_optionSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Maybe [ConfigurationOptionSetting]
optionSettings :: Maybe [ConfigurationOptionSetting]
$sel:optionSettings:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [ConfigurationOptionSetting]
optionSettings} -> Maybe [ConfigurationOptionSetting]
optionSettings) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Maybe [ConfigurationOptionSetting]
a -> CreateConfigurationTemplate
s {$sel:optionSettings:CreateConfigurationTemplate' :: Maybe [ConfigurationOptionSetting]
optionSettings = Maybe [ConfigurationOptionSetting]
a} :: CreateConfigurationTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the custom platform. For more
-- information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html Custom Platforms>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- If you specify @PlatformArn@, then don\'t specify @SolutionStackName@.
createConfigurationTemplate_platformArn :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe Prelude.Text)
createConfigurationTemplate_platformArn :: Lens' CreateConfigurationTemplate (Maybe Text)
createConfigurationTemplate_platformArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Maybe Text
platformArn :: Maybe Text
$sel:platformArn:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
platformArn} -> Maybe Text
platformArn) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Maybe Text
a -> CreateConfigurationTemplate
s {$sel:platformArn:CreateConfigurationTemplate' :: Maybe Text
platformArn = Maybe Text
a} :: CreateConfigurationTemplate)

-- | The name of an Elastic Beanstalk solution stack (platform version) that
-- this configuration uses. For example,
-- @64bit Amazon Linux 2013.09 running Tomcat 7 Java 7@. A solution stack
-- specifies the operating system, runtime, and application server for a
-- configuration template. It also determines the set of configuration
-- options as well as the possible and default values. For more
-- information, see
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html Supported Platforms>
-- in the /AWS Elastic Beanstalk Developer Guide/.
--
-- You must specify @SolutionStackName@ if you don\'t specify
-- @PlatformArn@, @EnvironmentId@, or @SourceConfiguration@.
--
-- Use the
-- <https://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_ListAvailableSolutionStacks.html ListAvailableSolutionStacks>
-- API to obtain a list of available solution stacks.
createConfigurationTemplate_solutionStackName :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe Prelude.Text)
createConfigurationTemplate_solutionStackName :: Lens' CreateConfigurationTemplate (Maybe Text)
createConfigurationTemplate_solutionStackName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Maybe Text
solutionStackName :: Maybe Text
$sel:solutionStackName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
solutionStackName} -> Maybe Text
solutionStackName) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Maybe Text
a -> CreateConfigurationTemplate
s {$sel:solutionStackName:CreateConfigurationTemplate' :: Maybe Text
solutionStackName = Maybe Text
a} :: CreateConfigurationTemplate)

-- | An Elastic Beanstalk configuration template to base this one on. If
-- specified, Elastic Beanstalk uses the configuration values from the
-- specified configuration template to create a new configuration.
--
-- Values specified in @OptionSettings@ override any values obtained from
-- the @SourceConfiguration@.
--
-- You must specify @SourceConfiguration@ if you don\'t specify
-- @PlatformArn@, @EnvironmentId@, or @SolutionStackName@.
--
-- Constraint: If both solution stack name and source configuration are
-- specified, the solution stack of the source configuration template must
-- match the specified solution stack name.
createConfigurationTemplate_sourceConfiguration :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe SourceConfiguration)
createConfigurationTemplate_sourceConfiguration :: Lens' CreateConfigurationTemplate (Maybe SourceConfiguration)
createConfigurationTemplate_sourceConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Maybe SourceConfiguration
sourceConfiguration :: Maybe SourceConfiguration
$sel:sourceConfiguration:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe SourceConfiguration
sourceConfiguration} -> Maybe SourceConfiguration
sourceConfiguration) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Maybe SourceConfiguration
a -> CreateConfigurationTemplate
s {$sel:sourceConfiguration:CreateConfigurationTemplate' :: Maybe SourceConfiguration
sourceConfiguration = Maybe SourceConfiguration
a} :: CreateConfigurationTemplate)

-- | Specifies the tags applied to the configuration template.
createConfigurationTemplate_tags :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe [Tag])
createConfigurationTemplate_tags :: Lens' CreateConfigurationTemplate (Maybe [Tag])
createConfigurationTemplate_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Maybe [Tag]
a -> CreateConfigurationTemplate
s {$sel:tags:CreateConfigurationTemplate' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateConfigurationTemplate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the Elastic Beanstalk application to associate with this
-- configuration template.
createConfigurationTemplate_applicationName :: Lens.Lens' CreateConfigurationTemplate Prelude.Text
createConfigurationTemplate_applicationName :: Lens' CreateConfigurationTemplate Text
createConfigurationTemplate_applicationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Text
applicationName :: Text
$sel:applicationName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
applicationName} -> Text
applicationName) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Text
a -> CreateConfigurationTemplate
s {$sel:applicationName:CreateConfigurationTemplate' :: Text
applicationName = Text
a} :: CreateConfigurationTemplate)

-- | The name of the configuration template.
--
-- Constraint: This name must be unique per application.
createConfigurationTemplate_templateName :: Lens.Lens' CreateConfigurationTemplate Prelude.Text
createConfigurationTemplate_templateName :: Lens' CreateConfigurationTemplate Text
createConfigurationTemplate_templateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConfigurationTemplate' {Text
templateName :: Text
$sel:templateName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
templateName} -> Text
templateName) (\s :: CreateConfigurationTemplate
s@CreateConfigurationTemplate' {} Text
a -> CreateConfigurationTemplate
s {$sel:templateName:CreateConfigurationTemplate' :: Text
templateName = Text
a} :: CreateConfigurationTemplate)

instance Core.AWSRequest CreateConfigurationTemplate where
  type
    AWSResponse CreateConfigurationTemplate =
      ConfigurationSettingsDescription
  request :: (Service -> Service)
-> CreateConfigurationTemplate
-> Request CreateConfigurationTemplate
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateConfigurationTemplate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateConfigurationTemplateResult"
      (\Int
s ResponseHeaders
h [Node]
x -> forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)

instance Prelude.Hashable CreateConfigurationTemplate where
  hashWithSalt :: Int -> CreateConfigurationTemplate -> Int
hashWithSalt Int
_salt CreateConfigurationTemplate' {Maybe [ConfigurationOptionSetting]
Maybe [Tag]
Maybe Text
Maybe SourceConfiguration
Text
templateName :: Text
applicationName :: Text
tags :: Maybe [Tag]
sourceConfiguration :: Maybe SourceConfiguration
solutionStackName :: Maybe Text
platformArn :: Maybe Text
optionSettings :: Maybe [ConfigurationOptionSetting]
environmentId :: Maybe Text
description :: Maybe Text
$sel:templateName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
$sel:applicationName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
$sel:tags:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [Tag]
$sel:sourceConfiguration:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe SourceConfiguration
$sel:solutionStackName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:platformArn:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:optionSettings:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [ConfigurationOptionSetting]
$sel:environmentId:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:description:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
environmentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ConfigurationOptionSetting]
optionSettings
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platformArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
solutionStackName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SourceConfiguration
sourceConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName

instance Prelude.NFData CreateConfigurationTemplate where
  rnf :: CreateConfigurationTemplate -> ()
rnf CreateConfigurationTemplate' {Maybe [ConfigurationOptionSetting]
Maybe [Tag]
Maybe Text
Maybe SourceConfiguration
Text
templateName :: Text
applicationName :: Text
tags :: Maybe [Tag]
sourceConfiguration :: Maybe SourceConfiguration
solutionStackName :: Maybe Text
platformArn :: Maybe Text
optionSettings :: Maybe [ConfigurationOptionSetting]
environmentId :: Maybe Text
description :: Maybe Text
$sel:templateName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
$sel:applicationName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
$sel:tags:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [Tag]
$sel:sourceConfiguration:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe SourceConfiguration
$sel:solutionStackName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:platformArn:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:optionSettings:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [ConfigurationOptionSetting]
$sel:environmentId:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:description:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
environmentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConfigurationOptionSetting]
optionSettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platformArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
solutionStackName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SourceConfiguration
sourceConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName

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

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

instance Data.ToQuery CreateConfigurationTemplate where
  toQuery :: CreateConfigurationTemplate -> QueryString
toQuery CreateConfigurationTemplate' {Maybe [ConfigurationOptionSetting]
Maybe [Tag]
Maybe Text
Maybe SourceConfiguration
Text
templateName :: Text
applicationName :: Text
tags :: Maybe [Tag]
sourceConfiguration :: Maybe SourceConfiguration
solutionStackName :: Maybe Text
platformArn :: Maybe Text
optionSettings :: Maybe [ConfigurationOptionSetting]
environmentId :: Maybe Text
description :: Maybe Text
$sel:templateName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
$sel:applicationName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Text
$sel:tags:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [Tag]
$sel:sourceConfiguration:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe SourceConfiguration
$sel:solutionStackName:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:platformArn:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:optionSettings:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe [ConfigurationOptionSetting]
$sel:environmentId:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
$sel:description:CreateConfigurationTemplate' :: CreateConfigurationTemplate -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateConfigurationTemplate" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"Description" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
description,
        ByteString
"EnvironmentId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
environmentId,
        ByteString
"OptionSettings"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ConfigurationOptionSetting]
optionSettings
            ),
        ByteString
"PlatformArn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
platformArn,
        ByteString
"SolutionStackName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
solutionStackName,
        ByteString
"SourceConfiguration" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe SourceConfiguration
sourceConfiguration,
        ByteString
"Tags"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"ApplicationName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
applicationName,
        ByteString
"TemplateName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
templateName
      ]