{-# 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.ComputeOptimizer.Types.AutoScalingGroupConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AutoScalingGroupConfiguration = AutoScalingGroupConfiguration'
{
AutoScalingGroupConfiguration -> Maybe Int
maxSize :: Prelude.Maybe Prelude.Int,
AutoScalingGroupConfiguration -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
AutoScalingGroupConfiguration -> Maybe Int
desiredCapacity :: Prelude.Maybe Prelude.Int,
AutoScalingGroupConfiguration -> Maybe Int
minSize :: Prelude.Maybe Prelude.Int
}
deriving (AutoScalingGroupConfiguration
-> AutoScalingGroupConfiguration -> Bool
(AutoScalingGroupConfiguration
-> AutoScalingGroupConfiguration -> Bool)
-> (AutoScalingGroupConfiguration
-> AutoScalingGroupConfiguration -> Bool)
-> Eq AutoScalingGroupConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingGroupConfiguration
-> AutoScalingGroupConfiguration -> Bool
$c/= :: AutoScalingGroupConfiguration
-> AutoScalingGroupConfiguration -> Bool
== :: AutoScalingGroupConfiguration
-> AutoScalingGroupConfiguration -> Bool
$c== :: AutoScalingGroupConfiguration
-> AutoScalingGroupConfiguration -> Bool
Prelude.Eq, ReadPrec [AutoScalingGroupConfiguration]
ReadPrec AutoScalingGroupConfiguration
Int -> ReadS AutoScalingGroupConfiguration
ReadS [AutoScalingGroupConfiguration]
(Int -> ReadS AutoScalingGroupConfiguration)
-> ReadS [AutoScalingGroupConfiguration]
-> ReadPrec AutoScalingGroupConfiguration
-> ReadPrec [AutoScalingGroupConfiguration]
-> Read AutoScalingGroupConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingGroupConfiguration]
$creadListPrec :: ReadPrec [AutoScalingGroupConfiguration]
readPrec :: ReadPrec AutoScalingGroupConfiguration
$creadPrec :: ReadPrec AutoScalingGroupConfiguration
readList :: ReadS [AutoScalingGroupConfiguration]
$creadList :: ReadS [AutoScalingGroupConfiguration]
readsPrec :: Int -> ReadS AutoScalingGroupConfiguration
$creadsPrec :: Int -> ReadS AutoScalingGroupConfiguration
Prelude.Read, Int -> AutoScalingGroupConfiguration -> ShowS
[AutoScalingGroupConfiguration] -> ShowS
AutoScalingGroupConfiguration -> String
(Int -> AutoScalingGroupConfiguration -> ShowS)
-> (AutoScalingGroupConfiguration -> String)
-> ([AutoScalingGroupConfiguration] -> ShowS)
-> Show AutoScalingGroupConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingGroupConfiguration] -> ShowS
$cshowList :: [AutoScalingGroupConfiguration] -> ShowS
show :: AutoScalingGroupConfiguration -> String
$cshow :: AutoScalingGroupConfiguration -> String
showsPrec :: Int -> AutoScalingGroupConfiguration -> ShowS
$cshowsPrec :: Int -> AutoScalingGroupConfiguration -> ShowS
Prelude.Show, (forall x.
AutoScalingGroupConfiguration
-> Rep AutoScalingGroupConfiguration x)
-> (forall x.
Rep AutoScalingGroupConfiguration x
-> AutoScalingGroupConfiguration)
-> Generic AutoScalingGroupConfiguration
forall x.
Rep AutoScalingGroupConfiguration x
-> AutoScalingGroupConfiguration
forall x.
AutoScalingGroupConfiguration
-> Rep AutoScalingGroupConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AutoScalingGroupConfiguration x
-> AutoScalingGroupConfiguration
$cfrom :: forall x.
AutoScalingGroupConfiguration
-> Rep AutoScalingGroupConfiguration x
Prelude.Generic)
newAutoScalingGroupConfiguration ::
AutoScalingGroupConfiguration
newAutoScalingGroupConfiguration :: AutoScalingGroupConfiguration
newAutoScalingGroupConfiguration =
AutoScalingGroupConfiguration' :: Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> AutoScalingGroupConfiguration
AutoScalingGroupConfiguration'
{ $sel:maxSize:AutoScalingGroupConfiguration' :: Maybe Int
maxSize =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:AutoScalingGroupConfiguration' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:desiredCapacity:AutoScalingGroupConfiguration' :: Maybe Int
desiredCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:minSize:AutoScalingGroupConfiguration' :: Maybe Int
minSize = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
autoScalingGroupConfiguration_maxSize :: Lens.Lens' AutoScalingGroupConfiguration (Prelude.Maybe Prelude.Int)
autoScalingGroupConfiguration_maxSize :: (Maybe Int -> f (Maybe Int))
-> AutoScalingGroupConfiguration -> f AutoScalingGroupConfiguration
autoScalingGroupConfiguration_maxSize = (AutoScalingGroupConfiguration -> Maybe Int)
-> (AutoScalingGroupConfiguration
-> Maybe Int -> AutoScalingGroupConfiguration)
-> Lens
AutoScalingGroupConfiguration
AutoScalingGroupConfiguration
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupConfiguration' {Maybe Int
maxSize :: Maybe Int
$sel:maxSize:AutoScalingGroupConfiguration' :: AutoScalingGroupConfiguration -> Maybe Int
maxSize} -> Maybe Int
maxSize) (\s :: AutoScalingGroupConfiguration
s@AutoScalingGroupConfiguration' {} Maybe Int
a -> AutoScalingGroupConfiguration
s {$sel:maxSize:AutoScalingGroupConfiguration' :: Maybe Int
maxSize = Maybe Int
a} :: AutoScalingGroupConfiguration)
autoScalingGroupConfiguration_instanceType :: Lens.Lens' AutoScalingGroupConfiguration (Prelude.Maybe Prelude.Text)
autoScalingGroupConfiguration_instanceType :: (Maybe Text -> f (Maybe Text))
-> AutoScalingGroupConfiguration -> f AutoScalingGroupConfiguration
autoScalingGroupConfiguration_instanceType = (AutoScalingGroupConfiguration -> Maybe Text)
-> (AutoScalingGroupConfiguration
-> Maybe Text -> AutoScalingGroupConfiguration)
-> Lens
AutoScalingGroupConfiguration
AutoScalingGroupConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupConfiguration' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:AutoScalingGroupConfiguration' :: AutoScalingGroupConfiguration -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: AutoScalingGroupConfiguration
s@AutoScalingGroupConfiguration' {} Maybe Text
a -> AutoScalingGroupConfiguration
s {$sel:instanceType:AutoScalingGroupConfiguration' :: Maybe Text
instanceType = Maybe Text
a} :: AutoScalingGroupConfiguration)
autoScalingGroupConfiguration_desiredCapacity :: Lens.Lens' AutoScalingGroupConfiguration (Prelude.Maybe Prelude.Int)
autoScalingGroupConfiguration_desiredCapacity :: (Maybe Int -> f (Maybe Int))
-> AutoScalingGroupConfiguration -> f AutoScalingGroupConfiguration
autoScalingGroupConfiguration_desiredCapacity = (AutoScalingGroupConfiguration -> Maybe Int)
-> (AutoScalingGroupConfiguration
-> Maybe Int -> AutoScalingGroupConfiguration)
-> Lens
AutoScalingGroupConfiguration
AutoScalingGroupConfiguration
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupConfiguration' {Maybe Int
desiredCapacity :: Maybe Int
$sel:desiredCapacity:AutoScalingGroupConfiguration' :: AutoScalingGroupConfiguration -> Maybe Int
desiredCapacity} -> Maybe Int
desiredCapacity) (\s :: AutoScalingGroupConfiguration
s@AutoScalingGroupConfiguration' {} Maybe Int
a -> AutoScalingGroupConfiguration
s {$sel:desiredCapacity:AutoScalingGroupConfiguration' :: Maybe Int
desiredCapacity = Maybe Int
a} :: AutoScalingGroupConfiguration)
autoScalingGroupConfiguration_minSize :: Lens.Lens' AutoScalingGroupConfiguration (Prelude.Maybe Prelude.Int)
autoScalingGroupConfiguration_minSize :: (Maybe Int -> f (Maybe Int))
-> AutoScalingGroupConfiguration -> f AutoScalingGroupConfiguration
autoScalingGroupConfiguration_minSize = (AutoScalingGroupConfiguration -> Maybe Int)
-> (AutoScalingGroupConfiguration
-> Maybe Int -> AutoScalingGroupConfiguration)
-> Lens
AutoScalingGroupConfiguration
AutoScalingGroupConfiguration
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingGroupConfiguration' {Maybe Int
minSize :: Maybe Int
$sel:minSize:AutoScalingGroupConfiguration' :: AutoScalingGroupConfiguration -> Maybe Int
minSize} -> Maybe Int
minSize) (\s :: AutoScalingGroupConfiguration
s@AutoScalingGroupConfiguration' {} Maybe Int
a -> AutoScalingGroupConfiguration
s {$sel:minSize:AutoScalingGroupConfiguration' :: Maybe Int
minSize = Maybe Int
a} :: AutoScalingGroupConfiguration)
instance Core.FromJSON AutoScalingGroupConfiguration where
parseJSON :: Value -> Parser AutoScalingGroupConfiguration
parseJSON =
String
-> (Object -> Parser AutoScalingGroupConfiguration)
-> Value
-> Parser AutoScalingGroupConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AutoScalingGroupConfiguration"
( \Object
x ->
Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> AutoScalingGroupConfiguration
AutoScalingGroupConfiguration'
(Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> AutoScalingGroupConfiguration)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Int -> Maybe Int -> AutoScalingGroupConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxSize")
Parser
(Maybe Text
-> Maybe Int -> Maybe Int -> AutoScalingGroupConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Int -> AutoScalingGroupConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"instanceType")
Parser (Maybe Int -> Maybe Int -> AutoScalingGroupConfiguration)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> AutoScalingGroupConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"desiredCapacity")
Parser (Maybe Int -> AutoScalingGroupConfiguration)
-> Parser (Maybe Int) -> Parser AutoScalingGroupConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"minSize")
)
instance
Prelude.Hashable
AutoScalingGroupConfiguration
instance Prelude.NFData AutoScalingGroupConfiguration