{-# 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.EKS.Types.NodegroupUpdateConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NodegroupUpdateConfig = NodegroupUpdateConfig'
{
NodegroupUpdateConfig -> Maybe Natural
maxUnavailable :: Prelude.Maybe Prelude.Natural,
NodegroupUpdateConfig -> Maybe Natural
maxUnavailablePercentage :: Prelude.Maybe Prelude.Natural
}
deriving (NodegroupUpdateConfig -> NodegroupUpdateConfig -> Bool
(NodegroupUpdateConfig -> NodegroupUpdateConfig -> Bool)
-> (NodegroupUpdateConfig -> NodegroupUpdateConfig -> Bool)
-> Eq NodegroupUpdateConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodegroupUpdateConfig -> NodegroupUpdateConfig -> Bool
$c/= :: NodegroupUpdateConfig -> NodegroupUpdateConfig -> Bool
== :: NodegroupUpdateConfig -> NodegroupUpdateConfig -> Bool
$c== :: NodegroupUpdateConfig -> NodegroupUpdateConfig -> Bool
Prelude.Eq, ReadPrec [NodegroupUpdateConfig]
ReadPrec NodegroupUpdateConfig
Int -> ReadS NodegroupUpdateConfig
ReadS [NodegroupUpdateConfig]
(Int -> ReadS NodegroupUpdateConfig)
-> ReadS [NodegroupUpdateConfig]
-> ReadPrec NodegroupUpdateConfig
-> ReadPrec [NodegroupUpdateConfig]
-> Read NodegroupUpdateConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodegroupUpdateConfig]
$creadListPrec :: ReadPrec [NodegroupUpdateConfig]
readPrec :: ReadPrec NodegroupUpdateConfig
$creadPrec :: ReadPrec NodegroupUpdateConfig
readList :: ReadS [NodegroupUpdateConfig]
$creadList :: ReadS [NodegroupUpdateConfig]
readsPrec :: Int -> ReadS NodegroupUpdateConfig
$creadsPrec :: Int -> ReadS NodegroupUpdateConfig
Prelude.Read, Int -> NodegroupUpdateConfig -> ShowS
[NodegroupUpdateConfig] -> ShowS
NodegroupUpdateConfig -> String
(Int -> NodegroupUpdateConfig -> ShowS)
-> (NodegroupUpdateConfig -> String)
-> ([NodegroupUpdateConfig] -> ShowS)
-> Show NodegroupUpdateConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodegroupUpdateConfig] -> ShowS
$cshowList :: [NodegroupUpdateConfig] -> ShowS
show :: NodegroupUpdateConfig -> String
$cshow :: NodegroupUpdateConfig -> String
showsPrec :: Int -> NodegroupUpdateConfig -> ShowS
$cshowsPrec :: Int -> NodegroupUpdateConfig -> ShowS
Prelude.Show, (forall x. NodegroupUpdateConfig -> Rep NodegroupUpdateConfig x)
-> (forall x. Rep NodegroupUpdateConfig x -> NodegroupUpdateConfig)
-> Generic NodegroupUpdateConfig
forall x. Rep NodegroupUpdateConfig x -> NodegroupUpdateConfig
forall x. NodegroupUpdateConfig -> Rep NodegroupUpdateConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodegroupUpdateConfig x -> NodegroupUpdateConfig
$cfrom :: forall x. NodegroupUpdateConfig -> Rep NodegroupUpdateConfig x
Prelude.Generic)
newNodegroupUpdateConfig ::
NodegroupUpdateConfig
newNodegroupUpdateConfig :: NodegroupUpdateConfig
newNodegroupUpdateConfig =
NodegroupUpdateConfig' :: Maybe Natural -> Maybe Natural -> NodegroupUpdateConfig
NodegroupUpdateConfig'
{ $sel:maxUnavailable:NodegroupUpdateConfig' :: Maybe Natural
maxUnavailable =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxUnavailablePercentage:NodegroupUpdateConfig' :: Maybe Natural
maxUnavailablePercentage = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
nodegroupUpdateConfig_maxUnavailable :: Lens.Lens' NodegroupUpdateConfig (Prelude.Maybe Prelude.Natural)
nodegroupUpdateConfig_maxUnavailable :: (Maybe Natural -> f (Maybe Natural))
-> NodegroupUpdateConfig -> f NodegroupUpdateConfig
nodegroupUpdateConfig_maxUnavailable = (NodegroupUpdateConfig -> Maybe Natural)
-> (NodegroupUpdateConfig
-> Maybe Natural -> NodegroupUpdateConfig)
-> Lens
NodegroupUpdateConfig
NodegroupUpdateConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodegroupUpdateConfig' {Maybe Natural
maxUnavailable :: Maybe Natural
$sel:maxUnavailable:NodegroupUpdateConfig' :: NodegroupUpdateConfig -> Maybe Natural
maxUnavailable} -> Maybe Natural
maxUnavailable) (\s :: NodegroupUpdateConfig
s@NodegroupUpdateConfig' {} Maybe Natural
a -> NodegroupUpdateConfig
s {$sel:maxUnavailable:NodegroupUpdateConfig' :: Maybe Natural
maxUnavailable = Maybe Natural
a} :: NodegroupUpdateConfig)
nodegroupUpdateConfig_maxUnavailablePercentage :: Lens.Lens' NodegroupUpdateConfig (Prelude.Maybe Prelude.Natural)
nodegroupUpdateConfig_maxUnavailablePercentage :: (Maybe Natural -> f (Maybe Natural))
-> NodegroupUpdateConfig -> f NodegroupUpdateConfig
nodegroupUpdateConfig_maxUnavailablePercentage = (NodegroupUpdateConfig -> Maybe Natural)
-> (NodegroupUpdateConfig
-> Maybe Natural -> NodegroupUpdateConfig)
-> Lens
NodegroupUpdateConfig
NodegroupUpdateConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodegroupUpdateConfig' {Maybe Natural
maxUnavailablePercentage :: Maybe Natural
$sel:maxUnavailablePercentage:NodegroupUpdateConfig' :: NodegroupUpdateConfig -> Maybe Natural
maxUnavailablePercentage} -> Maybe Natural
maxUnavailablePercentage) (\s :: NodegroupUpdateConfig
s@NodegroupUpdateConfig' {} Maybe Natural
a -> NodegroupUpdateConfig
s {$sel:maxUnavailablePercentage:NodegroupUpdateConfig' :: Maybe Natural
maxUnavailablePercentage = Maybe Natural
a} :: NodegroupUpdateConfig)
instance Core.FromJSON NodegroupUpdateConfig where
parseJSON :: Value -> Parser NodegroupUpdateConfig
parseJSON =
String
-> (Object -> Parser NodegroupUpdateConfig)
-> Value
-> Parser NodegroupUpdateConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NodegroupUpdateConfig"
( \Object
x ->
Maybe Natural -> Maybe Natural -> NodegroupUpdateConfig
NodegroupUpdateConfig'
(Maybe Natural -> Maybe Natural -> NodegroupUpdateConfig)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> NodegroupUpdateConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxUnavailable")
Parser (Maybe Natural -> NodegroupUpdateConfig)
-> Parser (Maybe Natural) -> Parser NodegroupUpdateConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxUnavailablePercentage")
)
instance Prelude.Hashable NodegroupUpdateConfig
instance Prelude.NFData NodegroupUpdateConfig
instance Core.ToJSON NodegroupUpdateConfig where
toJSON :: NodegroupUpdateConfig -> Value
toJSON NodegroupUpdateConfig' {Maybe Natural
maxUnavailablePercentage :: Maybe Natural
maxUnavailable :: Maybe Natural
$sel:maxUnavailablePercentage:NodegroupUpdateConfig' :: NodegroupUpdateConfig -> Maybe Natural
$sel:maxUnavailable:NodegroupUpdateConfig' :: NodegroupUpdateConfig -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"maxUnavailable" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxUnavailable,
(Text
"maxUnavailablePercentage" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxUnavailablePercentage
]
)