{-# 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 #-}
module Amazonka.MGN.GetLaunchConfiguration
(
GetLaunchConfiguration (..),
newGetLaunchConfiguration,
getLaunchConfiguration_sourceServerID,
LaunchConfiguration (..),
newLaunchConfiguration,
launchConfiguration_ec2LaunchTemplateID,
launchConfiguration_targetInstanceTypeRightSizingMethod,
launchConfiguration_launchDisposition,
launchConfiguration_copyTags,
launchConfiguration_name,
launchConfiguration_sourceServerID,
launchConfiguration_licensing,
launchConfiguration_copyPrivateIp,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetLaunchConfiguration = GetLaunchConfiguration'
{
GetLaunchConfiguration -> Text
sourceServerID :: Prelude.Text
}
deriving (GetLaunchConfiguration -> GetLaunchConfiguration -> Bool
(GetLaunchConfiguration -> GetLaunchConfiguration -> Bool)
-> (GetLaunchConfiguration -> GetLaunchConfiguration -> Bool)
-> Eq GetLaunchConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLaunchConfiguration -> GetLaunchConfiguration -> Bool
$c/= :: GetLaunchConfiguration -> GetLaunchConfiguration -> Bool
== :: GetLaunchConfiguration -> GetLaunchConfiguration -> Bool
$c== :: GetLaunchConfiguration -> GetLaunchConfiguration -> Bool
Prelude.Eq, ReadPrec [GetLaunchConfiguration]
ReadPrec GetLaunchConfiguration
Int -> ReadS GetLaunchConfiguration
ReadS [GetLaunchConfiguration]
(Int -> ReadS GetLaunchConfiguration)
-> ReadS [GetLaunchConfiguration]
-> ReadPrec GetLaunchConfiguration
-> ReadPrec [GetLaunchConfiguration]
-> Read GetLaunchConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLaunchConfiguration]
$creadListPrec :: ReadPrec [GetLaunchConfiguration]
readPrec :: ReadPrec GetLaunchConfiguration
$creadPrec :: ReadPrec GetLaunchConfiguration
readList :: ReadS [GetLaunchConfiguration]
$creadList :: ReadS [GetLaunchConfiguration]
readsPrec :: Int -> ReadS GetLaunchConfiguration
$creadsPrec :: Int -> ReadS GetLaunchConfiguration
Prelude.Read, Int -> GetLaunchConfiguration -> ShowS
[GetLaunchConfiguration] -> ShowS
GetLaunchConfiguration -> String
(Int -> GetLaunchConfiguration -> ShowS)
-> (GetLaunchConfiguration -> String)
-> ([GetLaunchConfiguration] -> ShowS)
-> Show GetLaunchConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLaunchConfiguration] -> ShowS
$cshowList :: [GetLaunchConfiguration] -> ShowS
show :: GetLaunchConfiguration -> String
$cshow :: GetLaunchConfiguration -> String
showsPrec :: Int -> GetLaunchConfiguration -> ShowS
$cshowsPrec :: Int -> GetLaunchConfiguration -> ShowS
Prelude.Show, (forall x. GetLaunchConfiguration -> Rep GetLaunchConfiguration x)
-> (forall x.
Rep GetLaunchConfiguration x -> GetLaunchConfiguration)
-> Generic GetLaunchConfiguration
forall x. Rep GetLaunchConfiguration x -> GetLaunchConfiguration
forall x. GetLaunchConfiguration -> Rep GetLaunchConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLaunchConfiguration x -> GetLaunchConfiguration
$cfrom :: forall x. GetLaunchConfiguration -> Rep GetLaunchConfiguration x
Prelude.Generic)
newGetLaunchConfiguration ::
Prelude.Text ->
GetLaunchConfiguration
newGetLaunchConfiguration :: Text -> GetLaunchConfiguration
newGetLaunchConfiguration Text
pSourceServerID_ =
GetLaunchConfiguration' :: Text -> GetLaunchConfiguration
GetLaunchConfiguration'
{ $sel:sourceServerID:GetLaunchConfiguration' :: Text
sourceServerID =
Text
pSourceServerID_
}
getLaunchConfiguration_sourceServerID :: Lens.Lens' GetLaunchConfiguration Prelude.Text
getLaunchConfiguration_sourceServerID :: (Text -> f Text)
-> GetLaunchConfiguration -> f GetLaunchConfiguration
getLaunchConfiguration_sourceServerID = (GetLaunchConfiguration -> Text)
-> (GetLaunchConfiguration -> Text -> GetLaunchConfiguration)
-> Lens GetLaunchConfiguration GetLaunchConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLaunchConfiguration' {Text
sourceServerID :: Text
$sel:sourceServerID:GetLaunchConfiguration' :: GetLaunchConfiguration -> Text
sourceServerID} -> Text
sourceServerID) (\s :: GetLaunchConfiguration
s@GetLaunchConfiguration' {} Text
a -> GetLaunchConfiguration
s {$sel:sourceServerID:GetLaunchConfiguration' :: Text
sourceServerID = Text
a} :: GetLaunchConfiguration)
instance Core.AWSRequest GetLaunchConfiguration where
type
AWSResponse GetLaunchConfiguration =
LaunchConfiguration
request :: GetLaunchConfiguration -> Request GetLaunchConfiguration
request = Service -> GetLaunchConfiguration -> Request GetLaunchConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetLaunchConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetLaunchConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetLaunchConfiguration))
-> Logger
-> Service
-> Proxy GetLaunchConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetLaunchConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
(\Int
s ResponseHeaders
h Object
x -> Object -> Either String LaunchConfiguration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable GetLaunchConfiguration
instance Prelude.NFData GetLaunchConfiguration
instance Core.ToHeaders GetLaunchConfiguration where
toHeaders :: GetLaunchConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetLaunchConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON GetLaunchConfiguration where
toJSON :: GetLaunchConfiguration -> Value
toJSON GetLaunchConfiguration' {Text
sourceServerID :: Text
$sel:sourceServerID:GetLaunchConfiguration' :: GetLaunchConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"sourceServerID" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceServerID)
]
)
instance Core.ToPath GetLaunchConfiguration where
toPath :: GetLaunchConfiguration -> ByteString
toPath = ByteString -> GetLaunchConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/GetLaunchConfiguration"
instance Core.ToQuery GetLaunchConfiguration where
toQuery :: GetLaunchConfiguration -> QueryString
toQuery = QueryString -> GetLaunchConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty