{-# 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-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 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_optionSettings,
    createConfigurationTemplate_platformArn,
    createConfigurationTemplate_sourceConfiguration,
    createConfigurationTemplate_solutionStackName,
    createConfigurationTemplate_environmentId,
    createConfigurationTemplate_description,
    createConfigurationTemplate_tags,
    createConfigurationTemplate_applicationName,
    createConfigurationTemplate_templateName,

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

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

import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Lens as Lens
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'
  { -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | An optional description for this configuration.
    CreateConfigurationTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | 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
(CreateConfigurationTemplate
 -> CreateConfigurationTemplate -> Bool)
-> (CreateConfigurationTemplate
    -> CreateConfigurationTemplate -> Bool)
-> Eq CreateConfigurationTemplate
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]
(Int -> ReadS CreateConfigurationTemplate)
-> ReadS [CreateConfigurationTemplate]
-> ReadPrec CreateConfigurationTemplate
-> ReadPrec [CreateConfigurationTemplate]
-> Read 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
(Int -> CreateConfigurationTemplate -> ShowS)
-> (CreateConfigurationTemplate -> String)
-> ([CreateConfigurationTemplate] -> ShowS)
-> Show CreateConfigurationTemplate
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.
 CreateConfigurationTemplate -> Rep CreateConfigurationTemplate x)
-> (forall x.
    Rep CreateConfigurationTemplate x -> CreateConfigurationTemplate)
-> Generic CreateConfigurationTemplate
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:
--
-- '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@.
--
-- '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.
--
-- '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.
--
-- '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@.
--
-- 'description', 'createConfigurationTemplate_description' - An optional description for this configuration.
--
-- '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' :: Maybe [ConfigurationOptionSetting]
-> Maybe Text
-> Maybe SourceConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> CreateConfigurationTemplate
CreateConfigurationTemplate'
      { $sel:optionSettings:CreateConfigurationTemplate' :: Maybe [ConfigurationOptionSetting]
optionSettings =
          Maybe [ConfigurationOptionSetting]
forall a. Maybe a
Prelude.Nothing,
        $sel:platformArn:CreateConfigurationTemplate' :: Maybe Text
platformArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceConfiguration:CreateConfigurationTemplate' :: Maybe SourceConfiguration
sourceConfiguration = Maybe SourceConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:solutionStackName:CreateConfigurationTemplate' :: Maybe Text
solutionStackName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:environmentId:CreateConfigurationTemplate' :: Maybe Text
environmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateConfigurationTemplate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateConfigurationTemplate' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationName:CreateConfigurationTemplate' :: Text
applicationName = Text
pApplicationName_,
        $sel:templateName:CreateConfigurationTemplate' :: Text
templateName = Text
pTemplateName_
      }

-- | 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 :: (Maybe [ConfigurationOptionSetting]
 -> f (Maybe [ConfigurationOptionSetting]))
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_optionSettings = (CreateConfigurationTemplate -> Maybe [ConfigurationOptionSetting])
-> (CreateConfigurationTemplate
    -> Maybe [ConfigurationOptionSetting]
    -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate
     CreateConfigurationTemplate
     (Maybe [ConfigurationOptionSetting])
     (Maybe [ConfigurationOptionSetting])
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) ((Maybe [ConfigurationOptionSetting]
  -> f (Maybe [ConfigurationOptionSetting]))
 -> CreateConfigurationTemplate -> f CreateConfigurationTemplate)
-> ((Maybe [ConfigurationOptionSetting]
     -> f (Maybe [ConfigurationOptionSetting]))
    -> Maybe [ConfigurationOptionSetting]
    -> f (Maybe [ConfigurationOptionSetting]))
-> (Maybe [ConfigurationOptionSetting]
    -> f (Maybe [ConfigurationOptionSetting]))
-> CreateConfigurationTemplate
-> f CreateConfigurationTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ConfigurationOptionSetting]
  [ConfigurationOptionSetting]
  [ConfigurationOptionSetting]
  [ConfigurationOptionSetting]
-> Iso
     (Maybe [ConfigurationOptionSetting])
     (Maybe [ConfigurationOptionSetting])
     (Maybe [ConfigurationOptionSetting])
     (Maybe [ConfigurationOptionSetting])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ConfigurationOptionSetting]
  [ConfigurationOptionSetting]
  [ConfigurationOptionSetting]
  [ConfigurationOptionSetting]
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 :: (Maybe Text -> f (Maybe Text))
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_platformArn = (CreateConfigurationTemplate -> Maybe Text)
-> (CreateConfigurationTemplate
    -> Maybe Text -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate
     CreateConfigurationTemplate
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe SourceConfiguration -> f (Maybe SourceConfiguration))
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_sourceConfiguration = (CreateConfigurationTemplate -> Maybe SourceConfiguration)
-> (CreateConfigurationTemplate
    -> Maybe SourceConfiguration -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate
     CreateConfigurationTemplate
     (Maybe SourceConfiguration)
     (Maybe 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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_solutionStackName = (CreateConfigurationTemplate -> Maybe Text)
-> (CreateConfigurationTemplate
    -> Maybe Text -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate
     CreateConfigurationTemplate
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_environmentId = (CreateConfigurationTemplate -> Maybe Text)
-> (CreateConfigurationTemplate
    -> Maybe Text -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate
     CreateConfigurationTemplate
     (Maybe Text)
     (Maybe Text)
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)

-- | An optional description for this configuration.
createConfigurationTemplate_description :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe Prelude.Text)
createConfigurationTemplate_description :: (Maybe Text -> f (Maybe Text))
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_description = (CreateConfigurationTemplate -> Maybe Text)
-> (CreateConfigurationTemplate
    -> Maybe Text -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate
     CreateConfigurationTemplate
     (Maybe Text)
     (Maybe Text)
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)

-- | Specifies the tags applied to the configuration template.
createConfigurationTemplate_tags :: Lens.Lens' CreateConfigurationTemplate (Prelude.Maybe [Tag])
createConfigurationTemplate_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_tags = (CreateConfigurationTemplate -> Maybe [Tag])
-> (CreateConfigurationTemplate
    -> Maybe [Tag] -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate
     CreateConfigurationTemplate
     (Maybe [Tag])
     (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateConfigurationTemplate -> f CreateConfigurationTemplate)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateConfigurationTemplate
-> f CreateConfigurationTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
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 :: (Text -> f Text)
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_applicationName = (CreateConfigurationTemplate -> Text)
-> (CreateConfigurationTemplate
    -> Text -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate CreateConfigurationTemplate Text Text
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 :: (Text -> f Text)
-> CreateConfigurationTemplate -> f CreateConfigurationTemplate
createConfigurationTemplate_templateName = (CreateConfigurationTemplate -> Text)
-> (CreateConfigurationTemplate
    -> Text -> CreateConfigurationTemplate)
-> Lens
     CreateConfigurationTemplate CreateConfigurationTemplate Text Text
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 :: CreateConfigurationTemplate -> Request CreateConfigurationTemplate
request = Service
-> CreateConfigurationTemplate
-> Request CreateConfigurationTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateConfigurationTemplate)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateConfigurationTemplate))
-> Logger
-> Service
-> Proxy CreateConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateConfigurationTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateConfigurationTemplateResult"
      (\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String ConfigurationSettingsDescription
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)

instance Prelude.Hashable CreateConfigurationTemplate

instance Prelude.NFData CreateConfigurationTemplate

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

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

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