{-# 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.LaunchTemplateOverrides where
import Amazonka.AutoScaling.Types.LaunchTemplateSpecification
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LaunchTemplateOverrides = LaunchTemplateOverrides'
{
LaunchTemplateOverrides -> Maybe Text
weightedCapacity :: Prelude.Maybe Prelude.Text,
LaunchTemplateOverrides -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
LaunchTemplateOverrides -> Maybe LaunchTemplateSpecification
launchTemplateSpecification :: Prelude.Maybe LaunchTemplateSpecification
}
deriving (LaunchTemplateOverrides -> LaunchTemplateOverrides -> Bool
(LaunchTemplateOverrides -> LaunchTemplateOverrides -> Bool)
-> (LaunchTemplateOverrides -> LaunchTemplateOverrides -> Bool)
-> Eq LaunchTemplateOverrides
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchTemplateOverrides -> LaunchTemplateOverrides -> Bool
$c/= :: LaunchTemplateOverrides -> LaunchTemplateOverrides -> Bool
== :: LaunchTemplateOverrides -> LaunchTemplateOverrides -> Bool
$c== :: LaunchTemplateOverrides -> LaunchTemplateOverrides -> Bool
Prelude.Eq, ReadPrec [LaunchTemplateOverrides]
ReadPrec LaunchTemplateOverrides
Int -> ReadS LaunchTemplateOverrides
ReadS [LaunchTemplateOverrides]
(Int -> ReadS LaunchTemplateOverrides)
-> ReadS [LaunchTemplateOverrides]
-> ReadPrec LaunchTemplateOverrides
-> ReadPrec [LaunchTemplateOverrides]
-> Read LaunchTemplateOverrides
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchTemplateOverrides]
$creadListPrec :: ReadPrec [LaunchTemplateOverrides]
readPrec :: ReadPrec LaunchTemplateOverrides
$creadPrec :: ReadPrec LaunchTemplateOverrides
readList :: ReadS [LaunchTemplateOverrides]
$creadList :: ReadS [LaunchTemplateOverrides]
readsPrec :: Int -> ReadS LaunchTemplateOverrides
$creadsPrec :: Int -> ReadS LaunchTemplateOverrides
Prelude.Read, Int -> LaunchTemplateOverrides -> ShowS
[LaunchTemplateOverrides] -> ShowS
LaunchTemplateOverrides -> String
(Int -> LaunchTemplateOverrides -> ShowS)
-> (LaunchTemplateOverrides -> String)
-> ([LaunchTemplateOverrides] -> ShowS)
-> Show LaunchTemplateOverrides
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchTemplateOverrides] -> ShowS
$cshowList :: [LaunchTemplateOverrides] -> ShowS
show :: LaunchTemplateOverrides -> String
$cshow :: LaunchTemplateOverrides -> String
showsPrec :: Int -> LaunchTemplateOverrides -> ShowS
$cshowsPrec :: Int -> LaunchTemplateOverrides -> ShowS
Prelude.Show, (forall x.
LaunchTemplateOverrides -> Rep LaunchTemplateOverrides x)
-> (forall x.
Rep LaunchTemplateOverrides x -> LaunchTemplateOverrides)
-> Generic LaunchTemplateOverrides
forall x. Rep LaunchTemplateOverrides x -> LaunchTemplateOverrides
forall x. LaunchTemplateOverrides -> Rep LaunchTemplateOverrides x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchTemplateOverrides x -> LaunchTemplateOverrides
$cfrom :: forall x. LaunchTemplateOverrides -> Rep LaunchTemplateOverrides x
Prelude.Generic)
newLaunchTemplateOverrides ::
LaunchTemplateOverrides
newLaunchTemplateOverrides :: LaunchTemplateOverrides
newLaunchTemplateOverrides =
LaunchTemplateOverrides' :: Maybe Text
-> Maybe Text
-> Maybe LaunchTemplateSpecification
-> LaunchTemplateOverrides
LaunchTemplateOverrides'
{ $sel:weightedCapacity:LaunchTemplateOverrides' :: Maybe Text
weightedCapacity =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:LaunchTemplateOverrides' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:launchTemplateSpecification:LaunchTemplateOverrides' :: Maybe LaunchTemplateSpecification
launchTemplateSpecification = Maybe LaunchTemplateSpecification
forall a. Maybe a
Prelude.Nothing
}
launchTemplateOverrides_weightedCapacity :: Lens.Lens' LaunchTemplateOverrides (Prelude.Maybe Prelude.Text)
launchTemplateOverrides_weightedCapacity :: (Maybe Text -> f (Maybe Text))
-> LaunchTemplateOverrides -> f LaunchTemplateOverrides
launchTemplateOverrides_weightedCapacity = (LaunchTemplateOverrides -> Maybe Text)
-> (LaunchTemplateOverrides
-> Maybe Text -> LaunchTemplateOverrides)
-> Lens
LaunchTemplateOverrides
LaunchTemplateOverrides
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateOverrides' {Maybe Text
weightedCapacity :: Maybe Text
$sel:weightedCapacity:LaunchTemplateOverrides' :: LaunchTemplateOverrides -> Maybe Text
weightedCapacity} -> Maybe Text
weightedCapacity) (\s :: LaunchTemplateOverrides
s@LaunchTemplateOverrides' {} Maybe Text
a -> LaunchTemplateOverrides
s {$sel:weightedCapacity:LaunchTemplateOverrides' :: Maybe Text
weightedCapacity = Maybe Text
a} :: LaunchTemplateOverrides)
launchTemplateOverrides_instanceType :: Lens.Lens' LaunchTemplateOverrides (Prelude.Maybe Prelude.Text)
launchTemplateOverrides_instanceType :: (Maybe Text -> f (Maybe Text))
-> LaunchTemplateOverrides -> f LaunchTemplateOverrides
launchTemplateOverrides_instanceType = (LaunchTemplateOverrides -> Maybe Text)
-> (LaunchTemplateOverrides
-> Maybe Text -> LaunchTemplateOverrides)
-> Lens
LaunchTemplateOverrides
LaunchTemplateOverrides
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateOverrides' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:LaunchTemplateOverrides' :: LaunchTemplateOverrides -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: LaunchTemplateOverrides
s@LaunchTemplateOverrides' {} Maybe Text
a -> LaunchTemplateOverrides
s {$sel:instanceType:LaunchTemplateOverrides' :: Maybe Text
instanceType = Maybe Text
a} :: LaunchTemplateOverrides)
launchTemplateOverrides_launchTemplateSpecification :: Lens.Lens' LaunchTemplateOverrides (Prelude.Maybe LaunchTemplateSpecification)
launchTemplateOverrides_launchTemplateSpecification :: (Maybe LaunchTemplateSpecification
-> f (Maybe LaunchTemplateSpecification))
-> LaunchTemplateOverrides -> f LaunchTemplateOverrides
launchTemplateOverrides_launchTemplateSpecification = (LaunchTemplateOverrides -> Maybe LaunchTemplateSpecification)
-> (LaunchTemplateOverrides
-> Maybe LaunchTemplateSpecification -> LaunchTemplateOverrides)
-> Lens
LaunchTemplateOverrides
LaunchTemplateOverrides
(Maybe LaunchTemplateSpecification)
(Maybe LaunchTemplateSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateOverrides' {Maybe LaunchTemplateSpecification
launchTemplateSpecification :: Maybe LaunchTemplateSpecification
$sel:launchTemplateSpecification:LaunchTemplateOverrides' :: LaunchTemplateOverrides -> Maybe LaunchTemplateSpecification
launchTemplateSpecification} -> Maybe LaunchTemplateSpecification
launchTemplateSpecification) (\s :: LaunchTemplateOverrides
s@LaunchTemplateOverrides' {} Maybe LaunchTemplateSpecification
a -> LaunchTemplateOverrides
s {$sel:launchTemplateSpecification:LaunchTemplateOverrides' :: Maybe LaunchTemplateSpecification
launchTemplateSpecification = Maybe LaunchTemplateSpecification
a} :: LaunchTemplateOverrides)
instance Core.FromXML LaunchTemplateOverrides where
parseXML :: [Node] -> Either String LaunchTemplateOverrides
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe LaunchTemplateSpecification
-> LaunchTemplateOverrides
LaunchTemplateOverrides'
(Maybe Text
-> Maybe Text
-> Maybe LaunchTemplateSpecification
-> LaunchTemplateOverrides)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe LaunchTemplateSpecification -> LaunchTemplateOverrides)
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
"WeightedCapacity")
Either
String
(Maybe Text
-> Maybe LaunchTemplateSpecification -> LaunchTemplateOverrides)
-> Either String (Maybe Text)
-> Either
String
(Maybe LaunchTemplateSpecification -> LaunchTemplateOverrides)
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
"InstanceType")
Either
String
(Maybe LaunchTemplateSpecification -> LaunchTemplateOverrides)
-> Either String (Maybe LaunchTemplateSpecification)
-> Either String LaunchTemplateOverrides
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe LaunchTemplateSpecification)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LaunchTemplateSpecification")
instance Prelude.Hashable LaunchTemplateOverrides
instance Prelude.NFData LaunchTemplateOverrides
instance Core.ToQuery LaunchTemplateOverrides where
toQuery :: LaunchTemplateOverrides -> QueryString
toQuery LaunchTemplateOverrides' {Maybe Text
Maybe LaunchTemplateSpecification
launchTemplateSpecification :: Maybe LaunchTemplateSpecification
instanceType :: Maybe Text
weightedCapacity :: Maybe Text
$sel:launchTemplateSpecification:LaunchTemplateOverrides' :: LaunchTemplateOverrides -> Maybe LaunchTemplateSpecification
$sel:instanceType:LaunchTemplateOverrides' :: LaunchTemplateOverrides -> Maybe Text
$sel:weightedCapacity:LaunchTemplateOverrides' :: LaunchTemplateOverrides -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"WeightedCapacity" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
weightedCapacity,
ByteString
"InstanceType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
instanceType,
ByteString
"LaunchTemplateSpecification"
ByteString -> Maybe LaunchTemplateSpecification -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe LaunchTemplateSpecification
launchTemplateSpecification
]