{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AutoScaling.Types.LaunchTemplateSpecification where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LaunchTemplateSpecification = LaunchTemplateSpecification'
{
LaunchTemplateSpecification -> Maybe Text
launchTemplateName :: Prelude.Maybe Prelude.Text,
LaunchTemplateSpecification -> Maybe Text
launchTemplateId :: Prelude.Maybe Prelude.Text,
LaunchTemplateSpecification -> Maybe Text
version :: Prelude.Maybe Prelude.Text
}
deriving (LaunchTemplateSpecification -> LaunchTemplateSpecification -> Bool
(LaunchTemplateSpecification
-> LaunchTemplateSpecification -> Bool)
-> (LaunchTemplateSpecification
-> LaunchTemplateSpecification -> Bool)
-> Eq LaunchTemplateSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchTemplateSpecification -> LaunchTemplateSpecification -> Bool
$c/= :: LaunchTemplateSpecification -> LaunchTemplateSpecification -> Bool
== :: LaunchTemplateSpecification -> LaunchTemplateSpecification -> Bool
$c== :: LaunchTemplateSpecification -> LaunchTemplateSpecification -> Bool
Prelude.Eq, ReadPrec [LaunchTemplateSpecification]
ReadPrec LaunchTemplateSpecification
Int -> ReadS LaunchTemplateSpecification
ReadS [LaunchTemplateSpecification]
(Int -> ReadS LaunchTemplateSpecification)
-> ReadS [LaunchTemplateSpecification]
-> ReadPrec LaunchTemplateSpecification
-> ReadPrec [LaunchTemplateSpecification]
-> Read LaunchTemplateSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchTemplateSpecification]
$creadListPrec :: ReadPrec [LaunchTemplateSpecification]
readPrec :: ReadPrec LaunchTemplateSpecification
$creadPrec :: ReadPrec LaunchTemplateSpecification
readList :: ReadS [LaunchTemplateSpecification]
$creadList :: ReadS [LaunchTemplateSpecification]
readsPrec :: Int -> ReadS LaunchTemplateSpecification
$creadsPrec :: Int -> ReadS LaunchTemplateSpecification
Prelude.Read, Int -> LaunchTemplateSpecification -> ShowS
[LaunchTemplateSpecification] -> ShowS
LaunchTemplateSpecification -> String
(Int -> LaunchTemplateSpecification -> ShowS)
-> (LaunchTemplateSpecification -> String)
-> ([LaunchTemplateSpecification] -> ShowS)
-> Show LaunchTemplateSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchTemplateSpecification] -> ShowS
$cshowList :: [LaunchTemplateSpecification] -> ShowS
show :: LaunchTemplateSpecification -> String
$cshow :: LaunchTemplateSpecification -> String
showsPrec :: Int -> LaunchTemplateSpecification -> ShowS
$cshowsPrec :: Int -> LaunchTemplateSpecification -> ShowS
Prelude.Show, (forall x.
LaunchTemplateSpecification -> Rep LaunchTemplateSpecification x)
-> (forall x.
Rep LaunchTemplateSpecification x -> LaunchTemplateSpecification)
-> Generic LaunchTemplateSpecification
forall x.
Rep LaunchTemplateSpecification x -> LaunchTemplateSpecification
forall x.
LaunchTemplateSpecification -> Rep LaunchTemplateSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LaunchTemplateSpecification x -> LaunchTemplateSpecification
$cfrom :: forall x.
LaunchTemplateSpecification -> Rep LaunchTemplateSpecification x
Prelude.Generic)
newLaunchTemplateSpecification ::
LaunchTemplateSpecification
newLaunchTemplateSpecification :: LaunchTemplateSpecification
newLaunchTemplateSpecification =
LaunchTemplateSpecification' :: Maybe Text
-> Maybe Text -> Maybe Text -> LaunchTemplateSpecification
LaunchTemplateSpecification'
{ $sel:launchTemplateName:LaunchTemplateSpecification' :: Maybe Text
launchTemplateName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:launchTemplateId:LaunchTemplateSpecification' :: Maybe Text
launchTemplateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:LaunchTemplateSpecification' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
launchTemplateSpecification_launchTemplateName :: Lens.Lens' LaunchTemplateSpecification (Prelude.Maybe Prelude.Text)
launchTemplateSpecification_launchTemplateName :: (Maybe Text -> f (Maybe Text))
-> LaunchTemplateSpecification -> f LaunchTemplateSpecification
launchTemplateSpecification_launchTemplateName = (LaunchTemplateSpecification -> Maybe Text)
-> (LaunchTemplateSpecification
-> Maybe Text -> LaunchTemplateSpecification)
-> Lens
LaunchTemplateSpecification
LaunchTemplateSpecification
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpecification' {Maybe Text
launchTemplateName :: Maybe Text
$sel:launchTemplateName:LaunchTemplateSpecification' :: LaunchTemplateSpecification -> Maybe Text
launchTemplateName} -> Maybe Text
launchTemplateName) (\s :: LaunchTemplateSpecification
s@LaunchTemplateSpecification' {} Maybe Text
a -> LaunchTemplateSpecification
s {$sel:launchTemplateName:LaunchTemplateSpecification' :: Maybe Text
launchTemplateName = Maybe Text
a} :: LaunchTemplateSpecification)
launchTemplateSpecification_launchTemplateId :: Lens.Lens' LaunchTemplateSpecification (Prelude.Maybe Prelude.Text)
launchTemplateSpecification_launchTemplateId :: (Maybe Text -> f (Maybe Text))
-> LaunchTemplateSpecification -> f LaunchTemplateSpecification
launchTemplateSpecification_launchTemplateId = (LaunchTemplateSpecification -> Maybe Text)
-> (LaunchTemplateSpecification
-> Maybe Text -> LaunchTemplateSpecification)
-> Lens
LaunchTemplateSpecification
LaunchTemplateSpecification
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpecification' {Maybe Text
launchTemplateId :: Maybe Text
$sel:launchTemplateId:LaunchTemplateSpecification' :: LaunchTemplateSpecification -> Maybe Text
launchTemplateId} -> Maybe Text
launchTemplateId) (\s :: LaunchTemplateSpecification
s@LaunchTemplateSpecification' {} Maybe Text
a -> LaunchTemplateSpecification
s {$sel:launchTemplateId:LaunchTemplateSpecification' :: Maybe Text
launchTemplateId = Maybe Text
a} :: LaunchTemplateSpecification)
launchTemplateSpecification_version :: Lens.Lens' LaunchTemplateSpecification (Prelude.Maybe Prelude.Text)
launchTemplateSpecification_version :: (Maybe Text -> f (Maybe Text))
-> LaunchTemplateSpecification -> f LaunchTemplateSpecification
launchTemplateSpecification_version = (LaunchTemplateSpecification -> Maybe Text)
-> (LaunchTemplateSpecification
-> Maybe Text -> LaunchTemplateSpecification)
-> Lens
LaunchTemplateSpecification
LaunchTemplateSpecification
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpecification' {Maybe Text
version :: Maybe Text
$sel:version:LaunchTemplateSpecification' :: LaunchTemplateSpecification -> Maybe Text
version} -> Maybe Text
version) (\s :: LaunchTemplateSpecification
s@LaunchTemplateSpecification' {} Maybe Text
a -> LaunchTemplateSpecification
s {$sel:version:LaunchTemplateSpecification' :: Maybe Text
version = Maybe Text
a} :: LaunchTemplateSpecification)
instance Core.FromXML LaunchTemplateSpecification where
parseXML :: [Node] -> Either String LaunchTemplateSpecification
parseXML [Node]
x =
Maybe Text
-> Maybe Text -> Maybe Text -> LaunchTemplateSpecification
LaunchTemplateSpecification'
(Maybe Text
-> Maybe Text -> Maybe Text -> LaunchTemplateSpecification)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> LaunchTemplateSpecification)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LaunchTemplateName")
Either
String (Maybe Text -> Maybe Text -> LaunchTemplateSpecification)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> LaunchTemplateSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LaunchTemplateId")
Either String (Maybe Text -> LaunchTemplateSpecification)
-> Either String (Maybe Text)
-> Either String LaunchTemplateSpecification
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Version")
instance Prelude.Hashable LaunchTemplateSpecification
instance Prelude.NFData LaunchTemplateSpecification
instance Core.ToQuery LaunchTemplateSpecification where
toQuery :: LaunchTemplateSpecification -> QueryString
toQuery LaunchTemplateSpecification' {Maybe Text
version :: Maybe Text
launchTemplateId :: Maybe Text
launchTemplateName :: Maybe Text
$sel:version:LaunchTemplateSpecification' :: LaunchTemplateSpecification -> Maybe Text
$sel:launchTemplateId:LaunchTemplateSpecification' :: LaunchTemplateSpecification -> Maybe Text
$sel:launchTemplateName:LaunchTemplateSpecification' :: LaunchTemplateSpecification -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"LaunchTemplateName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
launchTemplateName,
ByteString
"LaunchTemplateId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
launchTemplateId,
ByteString
"Version" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
version
]