{-# 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.EC2.CreateLaunchTemplateVersion
-- 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 a new version of a launch template. You can specify an existing
-- version of launch template from which to base the new version.
--
-- Launch template versions are numbered in the order in which they are
-- created. You cannot specify, change, or replace the numbering of launch
-- template versions.
--
-- Launch templates are immutable; after you create a launch template, you
-- can\'t modify it. Instead, you can create a new version of the launch
-- template that includes any changes you require.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#manage-launch-template-versions Modify a launch template (manage launch template versions)>
-- in the /Amazon Elastic Compute Cloud User Guide/.
module Amazonka.EC2.CreateLaunchTemplateVersion
  ( -- * Creating a Request
    CreateLaunchTemplateVersion (..),
    newCreateLaunchTemplateVersion,

    -- * Request Lenses
    createLaunchTemplateVersion_clientToken,
    createLaunchTemplateVersion_dryRun,
    createLaunchTemplateVersion_launchTemplateId,
    createLaunchTemplateVersion_launchTemplateName,
    createLaunchTemplateVersion_sourceVersion,
    createLaunchTemplateVersion_versionDescription,
    createLaunchTemplateVersion_launchTemplateData,

    -- * Destructuring the Response
    CreateLaunchTemplateVersionResponse (..),
    newCreateLaunchTemplateVersionResponse,

    -- * Response Lenses
    createLaunchTemplateVersionResponse_launchTemplateVersion,
    createLaunchTemplateVersionResponse_warning,
    createLaunchTemplateVersionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateLaunchTemplateVersion' smart constructor.
data CreateLaunchTemplateVersion = CreateLaunchTemplateVersion'
  { -- | Unique, case-sensitive identifier you provide to ensure the idempotency
    -- of the request. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring idempotency>.
    --
    -- Constraint: Maximum 128 ASCII characters.
    CreateLaunchTemplateVersion -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    CreateLaunchTemplateVersion -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the launch template.
    --
    -- You must specify either the @LaunchTemplateId@ or the
    -- @LaunchTemplateName@, but not both.
    CreateLaunchTemplateVersion -> Maybe Text
launchTemplateId :: Prelude.Maybe Prelude.Text,
    -- | The name of the launch template.
    --
    -- You must specify the @LaunchTemplateName@ or the @LaunchTemplateId@, but
    -- not both.
    CreateLaunchTemplateVersion -> Maybe Text
launchTemplateName :: Prelude.Maybe Prelude.Text,
    -- | The version number of the launch template version on which to base the
    -- new version. The new version inherits the same launch parameters as the
    -- source version, except for parameters that you specify in
    -- @LaunchTemplateData@. Snapshots applied to the block device mapping are
    -- ignored when creating a new version unless they are explicitly included.
    CreateLaunchTemplateVersion -> Maybe Text
sourceVersion :: Prelude.Maybe Prelude.Text,
    -- | A description for the version of the launch template.
    CreateLaunchTemplateVersion -> Maybe Text
versionDescription :: Prelude.Maybe Prelude.Text,
    -- | The information for the launch template.
    CreateLaunchTemplateVersion -> Sensitive RequestLaunchTemplateData
launchTemplateData :: Data.Sensitive RequestLaunchTemplateData
  }
  deriving (CreateLaunchTemplateVersion -> CreateLaunchTemplateVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLaunchTemplateVersion -> CreateLaunchTemplateVersion -> Bool
$c/= :: CreateLaunchTemplateVersion -> CreateLaunchTemplateVersion -> Bool
== :: CreateLaunchTemplateVersion -> CreateLaunchTemplateVersion -> Bool
$c== :: CreateLaunchTemplateVersion -> CreateLaunchTemplateVersion -> Bool
Prelude.Eq, Int -> CreateLaunchTemplateVersion -> ShowS
[CreateLaunchTemplateVersion] -> ShowS
CreateLaunchTemplateVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLaunchTemplateVersion] -> ShowS
$cshowList :: [CreateLaunchTemplateVersion] -> ShowS
show :: CreateLaunchTemplateVersion -> String
$cshow :: CreateLaunchTemplateVersion -> String
showsPrec :: Int -> CreateLaunchTemplateVersion -> ShowS
$cshowsPrec :: Int -> CreateLaunchTemplateVersion -> ShowS
Prelude.Show, forall x.
Rep CreateLaunchTemplateVersion x -> CreateLaunchTemplateVersion
forall x.
CreateLaunchTemplateVersion -> Rep CreateLaunchTemplateVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLaunchTemplateVersion x -> CreateLaunchTemplateVersion
$cfrom :: forall x.
CreateLaunchTemplateVersion -> Rep CreateLaunchTemplateVersion x
Prelude.Generic)

-- |
-- Create a value of 'CreateLaunchTemplateVersion' 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:
--
-- 'clientToken', 'createLaunchTemplateVersion_clientToken' - Unique, case-sensitive identifier you provide to ensure the idempotency
-- of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring idempotency>.
--
-- Constraint: Maximum 128 ASCII characters.
--
-- 'dryRun', 'createLaunchTemplateVersion_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'launchTemplateId', 'createLaunchTemplateVersion_launchTemplateId' - The ID of the launch template.
--
-- You must specify either the @LaunchTemplateId@ or the
-- @LaunchTemplateName@, but not both.
--
-- 'launchTemplateName', 'createLaunchTemplateVersion_launchTemplateName' - The name of the launch template.
--
-- You must specify the @LaunchTemplateName@ or the @LaunchTemplateId@, but
-- not both.
--
-- 'sourceVersion', 'createLaunchTemplateVersion_sourceVersion' - The version number of the launch template version on which to base the
-- new version. The new version inherits the same launch parameters as the
-- source version, except for parameters that you specify in
-- @LaunchTemplateData@. Snapshots applied to the block device mapping are
-- ignored when creating a new version unless they are explicitly included.
--
-- 'versionDescription', 'createLaunchTemplateVersion_versionDescription' - A description for the version of the launch template.
--
-- 'launchTemplateData', 'createLaunchTemplateVersion_launchTemplateData' - The information for the launch template.
newCreateLaunchTemplateVersion ::
  -- | 'launchTemplateData'
  RequestLaunchTemplateData ->
  CreateLaunchTemplateVersion
newCreateLaunchTemplateVersion :: RequestLaunchTemplateData -> CreateLaunchTemplateVersion
newCreateLaunchTemplateVersion RequestLaunchTemplateData
pLaunchTemplateData_ =
  CreateLaunchTemplateVersion'
    { $sel:clientToken:CreateLaunchTemplateVersion' :: Maybe Text
clientToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:CreateLaunchTemplateVersion' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:launchTemplateId:CreateLaunchTemplateVersion' :: Maybe Text
launchTemplateId = forall a. Maybe a
Prelude.Nothing,
      $sel:launchTemplateName:CreateLaunchTemplateVersion' :: Maybe Text
launchTemplateName = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceVersion:CreateLaunchTemplateVersion' :: Maybe Text
sourceVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:versionDescription:CreateLaunchTemplateVersion' :: Maybe Text
versionDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:launchTemplateData:CreateLaunchTemplateVersion' :: Sensitive RequestLaunchTemplateData
launchTemplateData =
        forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# RequestLaunchTemplateData
pLaunchTemplateData_
    }

-- | Unique, case-sensitive identifier you provide to ensure the idempotency
-- of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Ensuring idempotency>.
--
-- Constraint: Maximum 128 ASCII characters.
createLaunchTemplateVersion_clientToken :: Lens.Lens' CreateLaunchTemplateVersion (Prelude.Maybe Prelude.Text)
createLaunchTemplateVersion_clientToken :: Lens' CreateLaunchTemplateVersion (Maybe Text)
createLaunchTemplateVersion_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersion' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateLaunchTemplateVersion
s@CreateLaunchTemplateVersion' {} Maybe Text
a -> CreateLaunchTemplateVersion
s {$sel:clientToken:CreateLaunchTemplateVersion' :: Maybe Text
clientToken = Maybe Text
a} :: CreateLaunchTemplateVersion)

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
createLaunchTemplateVersion_dryRun :: Lens.Lens' CreateLaunchTemplateVersion (Prelude.Maybe Prelude.Bool)
createLaunchTemplateVersion_dryRun :: Lens' CreateLaunchTemplateVersion (Maybe Bool)
createLaunchTemplateVersion_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersion' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateLaunchTemplateVersion
s@CreateLaunchTemplateVersion' {} Maybe Bool
a -> CreateLaunchTemplateVersion
s {$sel:dryRun:CreateLaunchTemplateVersion' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateLaunchTemplateVersion)

-- | The ID of the launch template.
--
-- You must specify either the @LaunchTemplateId@ or the
-- @LaunchTemplateName@, but not both.
createLaunchTemplateVersion_launchTemplateId :: Lens.Lens' CreateLaunchTemplateVersion (Prelude.Maybe Prelude.Text)
createLaunchTemplateVersion_launchTemplateId :: Lens' CreateLaunchTemplateVersion (Maybe Text)
createLaunchTemplateVersion_launchTemplateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersion' {Maybe Text
launchTemplateId :: Maybe Text
$sel:launchTemplateId:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
launchTemplateId} -> Maybe Text
launchTemplateId) (\s :: CreateLaunchTemplateVersion
s@CreateLaunchTemplateVersion' {} Maybe Text
a -> CreateLaunchTemplateVersion
s {$sel:launchTemplateId:CreateLaunchTemplateVersion' :: Maybe Text
launchTemplateId = Maybe Text
a} :: CreateLaunchTemplateVersion)

-- | The name of the launch template.
--
-- You must specify the @LaunchTemplateName@ or the @LaunchTemplateId@, but
-- not both.
createLaunchTemplateVersion_launchTemplateName :: Lens.Lens' CreateLaunchTemplateVersion (Prelude.Maybe Prelude.Text)
createLaunchTemplateVersion_launchTemplateName :: Lens' CreateLaunchTemplateVersion (Maybe Text)
createLaunchTemplateVersion_launchTemplateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersion' {Maybe Text
launchTemplateName :: Maybe Text
$sel:launchTemplateName:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
launchTemplateName} -> Maybe Text
launchTemplateName) (\s :: CreateLaunchTemplateVersion
s@CreateLaunchTemplateVersion' {} Maybe Text
a -> CreateLaunchTemplateVersion
s {$sel:launchTemplateName:CreateLaunchTemplateVersion' :: Maybe Text
launchTemplateName = Maybe Text
a} :: CreateLaunchTemplateVersion)

-- | The version number of the launch template version on which to base the
-- new version. The new version inherits the same launch parameters as the
-- source version, except for parameters that you specify in
-- @LaunchTemplateData@. Snapshots applied to the block device mapping are
-- ignored when creating a new version unless they are explicitly included.
createLaunchTemplateVersion_sourceVersion :: Lens.Lens' CreateLaunchTemplateVersion (Prelude.Maybe Prelude.Text)
createLaunchTemplateVersion_sourceVersion :: Lens' CreateLaunchTemplateVersion (Maybe Text)
createLaunchTemplateVersion_sourceVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersion' {Maybe Text
sourceVersion :: Maybe Text
$sel:sourceVersion:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
sourceVersion} -> Maybe Text
sourceVersion) (\s :: CreateLaunchTemplateVersion
s@CreateLaunchTemplateVersion' {} Maybe Text
a -> CreateLaunchTemplateVersion
s {$sel:sourceVersion:CreateLaunchTemplateVersion' :: Maybe Text
sourceVersion = Maybe Text
a} :: CreateLaunchTemplateVersion)

-- | A description for the version of the launch template.
createLaunchTemplateVersion_versionDescription :: Lens.Lens' CreateLaunchTemplateVersion (Prelude.Maybe Prelude.Text)
createLaunchTemplateVersion_versionDescription :: Lens' CreateLaunchTemplateVersion (Maybe Text)
createLaunchTemplateVersion_versionDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersion' {Maybe Text
versionDescription :: Maybe Text
$sel:versionDescription:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
versionDescription} -> Maybe Text
versionDescription) (\s :: CreateLaunchTemplateVersion
s@CreateLaunchTemplateVersion' {} Maybe Text
a -> CreateLaunchTemplateVersion
s {$sel:versionDescription:CreateLaunchTemplateVersion' :: Maybe Text
versionDescription = Maybe Text
a} :: CreateLaunchTemplateVersion)

-- | The information for the launch template.
createLaunchTemplateVersion_launchTemplateData :: Lens.Lens' CreateLaunchTemplateVersion RequestLaunchTemplateData
createLaunchTemplateVersion_launchTemplateData :: Lens' CreateLaunchTemplateVersion RequestLaunchTemplateData
createLaunchTemplateVersion_launchTemplateData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersion' {Sensitive RequestLaunchTemplateData
launchTemplateData :: Sensitive RequestLaunchTemplateData
$sel:launchTemplateData:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Sensitive RequestLaunchTemplateData
launchTemplateData} -> Sensitive RequestLaunchTemplateData
launchTemplateData) (\s :: CreateLaunchTemplateVersion
s@CreateLaunchTemplateVersion' {} Sensitive RequestLaunchTemplateData
a -> CreateLaunchTemplateVersion
s {$sel:launchTemplateData:CreateLaunchTemplateVersion' :: Sensitive RequestLaunchTemplateData
launchTemplateData = Sensitive RequestLaunchTemplateData
a} :: CreateLaunchTemplateVersion) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

instance Core.AWSRequest CreateLaunchTemplateVersion where
  type
    AWSResponse CreateLaunchTemplateVersion =
      CreateLaunchTemplateVersionResponse
  request :: (Service -> Service)
-> CreateLaunchTemplateVersion
-> Request CreateLaunchTemplateVersion
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 CreateLaunchTemplateVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLaunchTemplateVersion)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe LaunchTemplateVersion
-> Maybe ValidationWarning
-> Int
-> CreateLaunchTemplateVersionResponse
CreateLaunchTemplateVersionResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"launchTemplateVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"warning")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateLaunchTemplateVersion where
  hashWithSalt :: Int -> CreateLaunchTemplateVersion -> Int
hashWithSalt Int
_salt CreateLaunchTemplateVersion' {Maybe Bool
Maybe Text
Sensitive RequestLaunchTemplateData
launchTemplateData :: Sensitive RequestLaunchTemplateData
versionDescription :: Maybe Text
sourceVersion :: Maybe Text
launchTemplateName :: Maybe Text
launchTemplateId :: Maybe Text
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:launchTemplateData:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Sensitive RequestLaunchTemplateData
$sel:versionDescription:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:sourceVersion:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:launchTemplateName:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:launchTemplateId:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:dryRun:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Bool
$sel:clientToken:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
launchTemplateId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
launchTemplateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive RequestLaunchTemplateData
launchTemplateData

instance Prelude.NFData CreateLaunchTemplateVersion where
  rnf :: CreateLaunchTemplateVersion -> ()
rnf CreateLaunchTemplateVersion' {Maybe Bool
Maybe Text
Sensitive RequestLaunchTemplateData
launchTemplateData :: Sensitive RequestLaunchTemplateData
versionDescription :: Maybe Text
sourceVersion :: Maybe Text
launchTemplateName :: Maybe Text
launchTemplateId :: Maybe Text
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:launchTemplateData:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Sensitive RequestLaunchTemplateData
$sel:versionDescription:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:sourceVersion:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:launchTemplateName:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:launchTemplateId:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:dryRun:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Bool
$sel:clientToken:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
launchTemplateId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
launchTemplateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive RequestLaunchTemplateData
launchTemplateData

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

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

instance Data.ToQuery CreateLaunchTemplateVersion where
  toQuery :: CreateLaunchTemplateVersion -> QueryString
toQuery CreateLaunchTemplateVersion' {Maybe Bool
Maybe Text
Sensitive RequestLaunchTemplateData
launchTemplateData :: Sensitive RequestLaunchTemplateData
versionDescription :: Maybe Text
sourceVersion :: Maybe Text
launchTemplateName :: Maybe Text
launchTemplateId :: Maybe Text
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:launchTemplateData:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Sensitive RequestLaunchTemplateData
$sel:versionDescription:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:sourceVersion:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:launchTemplateName:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:launchTemplateId:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
$sel:dryRun:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Bool
$sel:clientToken:CreateLaunchTemplateVersion' :: CreateLaunchTemplateVersion -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateLaunchTemplateVersion" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"LaunchTemplateId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
launchTemplateId,
        ByteString
"LaunchTemplateName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
launchTemplateName,
        ByteString
"SourceVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceVersion,
        ByteString
"VersionDescription" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
versionDescription,
        ByteString
"LaunchTemplateData" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Sensitive RequestLaunchTemplateData
launchTemplateData
      ]

-- | /See:/ 'newCreateLaunchTemplateVersionResponse' smart constructor.
data CreateLaunchTemplateVersionResponse = CreateLaunchTemplateVersionResponse'
  { -- | Information about the launch template version.
    CreateLaunchTemplateVersionResponse -> Maybe LaunchTemplateVersion
launchTemplateVersion :: Prelude.Maybe LaunchTemplateVersion,
    -- | If the new version of the launch template contains parameters or
    -- parameter combinations that are not valid, an error code and an error
    -- message are returned for each issue that\'s found.
    CreateLaunchTemplateVersionResponse -> Maybe ValidationWarning
warning :: Prelude.Maybe ValidationWarning,
    -- | The response's http status code.
    CreateLaunchTemplateVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLaunchTemplateVersionResponse
-> CreateLaunchTemplateVersionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLaunchTemplateVersionResponse
-> CreateLaunchTemplateVersionResponse -> Bool
$c/= :: CreateLaunchTemplateVersionResponse
-> CreateLaunchTemplateVersionResponse -> Bool
== :: CreateLaunchTemplateVersionResponse
-> CreateLaunchTemplateVersionResponse -> Bool
$c== :: CreateLaunchTemplateVersionResponse
-> CreateLaunchTemplateVersionResponse -> Bool
Prelude.Eq, ReadPrec [CreateLaunchTemplateVersionResponse]
ReadPrec CreateLaunchTemplateVersionResponse
Int -> ReadS CreateLaunchTemplateVersionResponse
ReadS [CreateLaunchTemplateVersionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLaunchTemplateVersionResponse]
$creadListPrec :: ReadPrec [CreateLaunchTemplateVersionResponse]
readPrec :: ReadPrec CreateLaunchTemplateVersionResponse
$creadPrec :: ReadPrec CreateLaunchTemplateVersionResponse
readList :: ReadS [CreateLaunchTemplateVersionResponse]
$creadList :: ReadS [CreateLaunchTemplateVersionResponse]
readsPrec :: Int -> ReadS CreateLaunchTemplateVersionResponse
$creadsPrec :: Int -> ReadS CreateLaunchTemplateVersionResponse
Prelude.Read, Int -> CreateLaunchTemplateVersionResponse -> ShowS
[CreateLaunchTemplateVersionResponse] -> ShowS
CreateLaunchTemplateVersionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLaunchTemplateVersionResponse] -> ShowS
$cshowList :: [CreateLaunchTemplateVersionResponse] -> ShowS
show :: CreateLaunchTemplateVersionResponse -> String
$cshow :: CreateLaunchTemplateVersionResponse -> String
showsPrec :: Int -> CreateLaunchTemplateVersionResponse -> ShowS
$cshowsPrec :: Int -> CreateLaunchTemplateVersionResponse -> ShowS
Prelude.Show, forall x.
Rep CreateLaunchTemplateVersionResponse x
-> CreateLaunchTemplateVersionResponse
forall x.
CreateLaunchTemplateVersionResponse
-> Rep CreateLaunchTemplateVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLaunchTemplateVersionResponse x
-> CreateLaunchTemplateVersionResponse
$cfrom :: forall x.
CreateLaunchTemplateVersionResponse
-> Rep CreateLaunchTemplateVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLaunchTemplateVersionResponse' 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:
--
-- 'launchTemplateVersion', 'createLaunchTemplateVersionResponse_launchTemplateVersion' - Information about the launch template version.
--
-- 'warning', 'createLaunchTemplateVersionResponse_warning' - If the new version of the launch template contains parameters or
-- parameter combinations that are not valid, an error code and an error
-- message are returned for each issue that\'s found.
--
-- 'httpStatus', 'createLaunchTemplateVersionResponse_httpStatus' - The response's http status code.
newCreateLaunchTemplateVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLaunchTemplateVersionResponse
newCreateLaunchTemplateVersionResponse :: Int -> CreateLaunchTemplateVersionResponse
newCreateLaunchTemplateVersionResponse Int
pHttpStatus_ =
  CreateLaunchTemplateVersionResponse'
    { $sel:launchTemplateVersion:CreateLaunchTemplateVersionResponse' :: Maybe LaunchTemplateVersion
launchTemplateVersion =
        forall a. Maybe a
Prelude.Nothing,
      $sel:warning:CreateLaunchTemplateVersionResponse' :: Maybe ValidationWarning
warning = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLaunchTemplateVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the launch template version.
createLaunchTemplateVersionResponse_launchTemplateVersion :: Lens.Lens' CreateLaunchTemplateVersionResponse (Prelude.Maybe LaunchTemplateVersion)
createLaunchTemplateVersionResponse_launchTemplateVersion :: Lens'
  CreateLaunchTemplateVersionResponse (Maybe LaunchTemplateVersion)
createLaunchTemplateVersionResponse_launchTemplateVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersionResponse' {Maybe LaunchTemplateVersion
launchTemplateVersion :: Maybe LaunchTemplateVersion
$sel:launchTemplateVersion:CreateLaunchTemplateVersionResponse' :: CreateLaunchTemplateVersionResponse -> Maybe LaunchTemplateVersion
launchTemplateVersion} -> Maybe LaunchTemplateVersion
launchTemplateVersion) (\s :: CreateLaunchTemplateVersionResponse
s@CreateLaunchTemplateVersionResponse' {} Maybe LaunchTemplateVersion
a -> CreateLaunchTemplateVersionResponse
s {$sel:launchTemplateVersion:CreateLaunchTemplateVersionResponse' :: Maybe LaunchTemplateVersion
launchTemplateVersion = Maybe LaunchTemplateVersion
a} :: CreateLaunchTemplateVersionResponse)

-- | If the new version of the launch template contains parameters or
-- parameter combinations that are not valid, an error code and an error
-- message are returned for each issue that\'s found.
createLaunchTemplateVersionResponse_warning :: Lens.Lens' CreateLaunchTemplateVersionResponse (Prelude.Maybe ValidationWarning)
createLaunchTemplateVersionResponse_warning :: Lens' CreateLaunchTemplateVersionResponse (Maybe ValidationWarning)
createLaunchTemplateVersionResponse_warning = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLaunchTemplateVersionResponse' {Maybe ValidationWarning
warning :: Maybe ValidationWarning
$sel:warning:CreateLaunchTemplateVersionResponse' :: CreateLaunchTemplateVersionResponse -> Maybe ValidationWarning
warning} -> Maybe ValidationWarning
warning) (\s :: CreateLaunchTemplateVersionResponse
s@CreateLaunchTemplateVersionResponse' {} Maybe ValidationWarning
a -> CreateLaunchTemplateVersionResponse
s {$sel:warning:CreateLaunchTemplateVersionResponse' :: Maybe ValidationWarning
warning = Maybe ValidationWarning
a} :: CreateLaunchTemplateVersionResponse)

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

instance
  Prelude.NFData
    CreateLaunchTemplateVersionResponse
  where
  rnf :: CreateLaunchTemplateVersionResponse -> ()
rnf CreateLaunchTemplateVersionResponse' {Int
Maybe ValidationWarning
Maybe LaunchTemplateVersion
httpStatus :: Int
warning :: Maybe ValidationWarning
launchTemplateVersion :: Maybe LaunchTemplateVersion
$sel:httpStatus:CreateLaunchTemplateVersionResponse' :: CreateLaunchTemplateVersionResponse -> Int
$sel:warning:CreateLaunchTemplateVersionResponse' :: CreateLaunchTemplateVersionResponse -> Maybe ValidationWarning
$sel:launchTemplateVersion:CreateLaunchTemplateVersionResponse' :: CreateLaunchTemplateVersionResponse -> Maybe LaunchTemplateVersion
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LaunchTemplateVersion
launchTemplateVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ValidationWarning
warning
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus