{-# 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.ModifyLaunchTemplate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Modifies a launch template. You can specify which version of the launch
-- template to set as the default version. When launching an instance, the
-- default version applies when a launch template version is not specified.
module Amazonka.EC2.ModifyLaunchTemplate
  ( -- * Creating a Request
    ModifyLaunchTemplate (..),
    newModifyLaunchTemplate,

    -- * Request Lenses
    modifyLaunchTemplate_clientToken,
    modifyLaunchTemplate_defaultVersion,
    modifyLaunchTemplate_dryRun,
    modifyLaunchTemplate_launchTemplateId,
    modifyLaunchTemplate_launchTemplateName,

    -- * Destructuring the Response
    ModifyLaunchTemplateResponse (..),
    newModifyLaunchTemplateResponse,

    -- * Response Lenses
    modifyLaunchTemplateResponse_launchTemplate,
    modifyLaunchTemplateResponse_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:/ 'newModifyLaunchTemplate' smart constructor.
data ModifyLaunchTemplate = ModifyLaunchTemplate'
  { -- | 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.
    ModifyLaunchTemplate -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The version number of the launch template to set as the default version.
    ModifyLaunchTemplate -> Maybe Text
defaultVersion :: 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@.
    ModifyLaunchTemplate -> 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.
    ModifyLaunchTemplate -> Maybe Text
launchTemplateId :: Prelude.Maybe Prelude.Text,
    -- | The name of the launch template.
    --
    -- You must specify either the @LaunchTemplateName@ or the
    -- @LaunchTemplateId@, but not both.
    ModifyLaunchTemplate -> Maybe Text
launchTemplateName :: Prelude.Maybe Prelude.Text
  }
  deriving (ModifyLaunchTemplate -> ModifyLaunchTemplate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyLaunchTemplate -> ModifyLaunchTemplate -> Bool
$c/= :: ModifyLaunchTemplate -> ModifyLaunchTemplate -> Bool
== :: ModifyLaunchTemplate -> ModifyLaunchTemplate -> Bool
$c== :: ModifyLaunchTemplate -> ModifyLaunchTemplate -> Bool
Prelude.Eq, ReadPrec [ModifyLaunchTemplate]
ReadPrec ModifyLaunchTemplate
Int -> ReadS ModifyLaunchTemplate
ReadS [ModifyLaunchTemplate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyLaunchTemplate]
$creadListPrec :: ReadPrec [ModifyLaunchTemplate]
readPrec :: ReadPrec ModifyLaunchTemplate
$creadPrec :: ReadPrec ModifyLaunchTemplate
readList :: ReadS [ModifyLaunchTemplate]
$creadList :: ReadS [ModifyLaunchTemplate]
readsPrec :: Int -> ReadS ModifyLaunchTemplate
$creadsPrec :: Int -> ReadS ModifyLaunchTemplate
Prelude.Read, Int -> ModifyLaunchTemplate -> ShowS
[ModifyLaunchTemplate] -> ShowS
ModifyLaunchTemplate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyLaunchTemplate] -> ShowS
$cshowList :: [ModifyLaunchTemplate] -> ShowS
show :: ModifyLaunchTemplate -> String
$cshow :: ModifyLaunchTemplate -> String
showsPrec :: Int -> ModifyLaunchTemplate -> ShowS
$cshowsPrec :: Int -> ModifyLaunchTemplate -> ShowS
Prelude.Show, forall x. Rep ModifyLaunchTemplate x -> ModifyLaunchTemplate
forall x. ModifyLaunchTemplate -> Rep ModifyLaunchTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyLaunchTemplate x -> ModifyLaunchTemplate
$cfrom :: forall x. ModifyLaunchTemplate -> Rep ModifyLaunchTemplate x
Prelude.Generic)

-- |
-- Create a value of 'ModifyLaunchTemplate' 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', 'modifyLaunchTemplate_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.
--
-- 'defaultVersion', 'modifyLaunchTemplate_defaultVersion' - The version number of the launch template to set as the default version.
--
-- 'dryRun', 'modifyLaunchTemplate_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', 'modifyLaunchTemplate_launchTemplateId' - The ID of the launch template.
--
-- You must specify either the @LaunchTemplateId@ or the
-- @LaunchTemplateName@, but not both.
--
-- 'launchTemplateName', 'modifyLaunchTemplate_launchTemplateName' - The name of the launch template.
--
-- You must specify either the @LaunchTemplateName@ or the
-- @LaunchTemplateId@, but not both.
newModifyLaunchTemplate ::
  ModifyLaunchTemplate
newModifyLaunchTemplate :: ModifyLaunchTemplate
newModifyLaunchTemplate =
  ModifyLaunchTemplate'
    { $sel:clientToken:ModifyLaunchTemplate' :: Maybe Text
clientToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:defaultVersion:ModifyLaunchTemplate' :: Maybe Text
defaultVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:ModifyLaunchTemplate' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:launchTemplateId:ModifyLaunchTemplate' :: Maybe Text
launchTemplateId = forall a. Maybe a
Prelude.Nothing,
      $sel:launchTemplateName:ModifyLaunchTemplate' :: Maybe Text
launchTemplateName = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The version number of the launch template to set as the default version.
modifyLaunchTemplate_defaultVersion :: Lens.Lens' ModifyLaunchTemplate (Prelude.Maybe Prelude.Text)
modifyLaunchTemplate_defaultVersion :: Lens' ModifyLaunchTemplate (Maybe Text)
modifyLaunchTemplate_defaultVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyLaunchTemplate' {Maybe Text
defaultVersion :: Maybe Text
$sel:defaultVersion:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
defaultVersion} -> Maybe Text
defaultVersion) (\s :: ModifyLaunchTemplate
s@ModifyLaunchTemplate' {} Maybe Text
a -> ModifyLaunchTemplate
s {$sel:defaultVersion:ModifyLaunchTemplate' :: Maybe Text
defaultVersion = Maybe Text
a} :: ModifyLaunchTemplate)

-- | 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@.
modifyLaunchTemplate_dryRun :: Lens.Lens' ModifyLaunchTemplate (Prelude.Maybe Prelude.Bool)
modifyLaunchTemplate_dryRun :: Lens' ModifyLaunchTemplate (Maybe Bool)
modifyLaunchTemplate_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyLaunchTemplate' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: ModifyLaunchTemplate
s@ModifyLaunchTemplate' {} Maybe Bool
a -> ModifyLaunchTemplate
s {$sel:dryRun:ModifyLaunchTemplate' :: Maybe Bool
dryRun = Maybe Bool
a} :: ModifyLaunchTemplate)

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

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

instance Core.AWSRequest ModifyLaunchTemplate where
  type
    AWSResponse ModifyLaunchTemplate =
      ModifyLaunchTemplateResponse
  request :: (Service -> Service)
-> ModifyLaunchTemplate -> Request ModifyLaunchTemplate
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 ModifyLaunchTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyLaunchTemplate)))
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 LaunchTemplate -> Int -> ModifyLaunchTemplateResponse
ModifyLaunchTemplateResponse'
            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
"launchTemplate")
            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 ModifyLaunchTemplate where
  hashWithSalt :: Int -> ModifyLaunchTemplate -> Int
hashWithSalt Int
_salt ModifyLaunchTemplate' {Maybe Bool
Maybe Text
launchTemplateName :: Maybe Text
launchTemplateId :: Maybe Text
dryRun :: Maybe Bool
defaultVersion :: Maybe Text
clientToken :: Maybe Text
$sel:launchTemplateName:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:launchTemplateId:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:dryRun:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Bool
$sel:defaultVersion:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:clientToken:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> 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 Text
defaultVersion
      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

instance Prelude.NFData ModifyLaunchTemplate where
  rnf :: ModifyLaunchTemplate -> ()
rnf ModifyLaunchTemplate' {Maybe Bool
Maybe Text
launchTemplateName :: Maybe Text
launchTemplateId :: Maybe Text
dryRun :: Maybe Bool
defaultVersion :: Maybe Text
clientToken :: Maybe Text
$sel:launchTemplateName:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:launchTemplateId:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:dryRun:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Bool
$sel:defaultVersion:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:clientToken:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> 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 Text
defaultVersion
      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

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

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

instance Data.ToQuery ModifyLaunchTemplate where
  toQuery :: ModifyLaunchTemplate -> QueryString
toQuery ModifyLaunchTemplate' {Maybe Bool
Maybe Text
launchTemplateName :: Maybe Text
launchTemplateId :: Maybe Text
dryRun :: Maybe Bool
defaultVersion :: Maybe Text
clientToken :: Maybe Text
$sel:launchTemplateName:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:launchTemplateId:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:dryRun:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Bool
$sel:defaultVersion:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
$sel:clientToken:ModifyLaunchTemplate' :: ModifyLaunchTemplate -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ModifyLaunchTemplate" :: 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
"SetDefaultVersion" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
defaultVersion,
        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
      ]

-- | /See:/ 'newModifyLaunchTemplateResponse' smart constructor.
data ModifyLaunchTemplateResponse = ModifyLaunchTemplateResponse'
  { -- | Information about the launch template.
    ModifyLaunchTemplateResponse -> Maybe LaunchTemplate
launchTemplate :: Prelude.Maybe LaunchTemplate,
    -- | The response's http status code.
    ModifyLaunchTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyLaunchTemplateResponse
-> ModifyLaunchTemplateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyLaunchTemplateResponse
-> ModifyLaunchTemplateResponse -> Bool
$c/= :: ModifyLaunchTemplateResponse
-> ModifyLaunchTemplateResponse -> Bool
== :: ModifyLaunchTemplateResponse
-> ModifyLaunchTemplateResponse -> Bool
$c== :: ModifyLaunchTemplateResponse
-> ModifyLaunchTemplateResponse -> Bool
Prelude.Eq, ReadPrec [ModifyLaunchTemplateResponse]
ReadPrec ModifyLaunchTemplateResponse
Int -> ReadS ModifyLaunchTemplateResponse
ReadS [ModifyLaunchTemplateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyLaunchTemplateResponse]
$creadListPrec :: ReadPrec [ModifyLaunchTemplateResponse]
readPrec :: ReadPrec ModifyLaunchTemplateResponse
$creadPrec :: ReadPrec ModifyLaunchTemplateResponse
readList :: ReadS [ModifyLaunchTemplateResponse]
$creadList :: ReadS [ModifyLaunchTemplateResponse]
readsPrec :: Int -> ReadS ModifyLaunchTemplateResponse
$creadsPrec :: Int -> ReadS ModifyLaunchTemplateResponse
Prelude.Read, Int -> ModifyLaunchTemplateResponse -> ShowS
[ModifyLaunchTemplateResponse] -> ShowS
ModifyLaunchTemplateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyLaunchTemplateResponse] -> ShowS
$cshowList :: [ModifyLaunchTemplateResponse] -> ShowS
show :: ModifyLaunchTemplateResponse -> String
$cshow :: ModifyLaunchTemplateResponse -> String
showsPrec :: Int -> ModifyLaunchTemplateResponse -> ShowS
$cshowsPrec :: Int -> ModifyLaunchTemplateResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyLaunchTemplateResponse x -> ModifyLaunchTemplateResponse
forall x.
ModifyLaunchTemplateResponse -> Rep ModifyLaunchTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyLaunchTemplateResponse x -> ModifyLaunchTemplateResponse
$cfrom :: forall x.
ModifyLaunchTemplateResponse -> Rep ModifyLaunchTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyLaunchTemplateResponse' 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:
--
-- 'launchTemplate', 'modifyLaunchTemplateResponse_launchTemplate' - Information about the launch template.
--
-- 'httpStatus', 'modifyLaunchTemplateResponse_httpStatus' - The response's http status code.
newModifyLaunchTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyLaunchTemplateResponse
newModifyLaunchTemplateResponse :: Int -> ModifyLaunchTemplateResponse
newModifyLaunchTemplateResponse Int
pHttpStatus_ =
  ModifyLaunchTemplateResponse'
    { $sel:launchTemplate:ModifyLaunchTemplateResponse' :: Maybe LaunchTemplate
launchTemplate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ModifyLaunchTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the launch template.
modifyLaunchTemplateResponse_launchTemplate :: Lens.Lens' ModifyLaunchTemplateResponse (Prelude.Maybe LaunchTemplate)
modifyLaunchTemplateResponse_launchTemplate :: Lens' ModifyLaunchTemplateResponse (Maybe LaunchTemplate)
modifyLaunchTemplateResponse_launchTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyLaunchTemplateResponse' {Maybe LaunchTemplate
launchTemplate :: Maybe LaunchTemplate
$sel:launchTemplate:ModifyLaunchTemplateResponse' :: ModifyLaunchTemplateResponse -> Maybe LaunchTemplate
launchTemplate} -> Maybe LaunchTemplate
launchTemplate) (\s :: ModifyLaunchTemplateResponse
s@ModifyLaunchTemplateResponse' {} Maybe LaunchTemplate
a -> ModifyLaunchTemplateResponse
s {$sel:launchTemplate:ModifyLaunchTemplateResponse' :: Maybe LaunchTemplate
launchTemplate = Maybe LaunchTemplate
a} :: ModifyLaunchTemplateResponse)

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

instance Prelude.NFData ModifyLaunchTemplateResponse where
  rnf :: ModifyLaunchTemplateResponse -> ()
rnf ModifyLaunchTemplateResponse' {Int
Maybe LaunchTemplate
httpStatus :: Int
launchTemplate :: Maybe LaunchTemplate
$sel:httpStatus:ModifyLaunchTemplateResponse' :: ModifyLaunchTemplateResponse -> Int
$sel:launchTemplate:ModifyLaunchTemplateResponse' :: ModifyLaunchTemplateResponse -> Maybe LaunchTemplate
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LaunchTemplate
launchTemplate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus