{-# 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.Config.Types.SsmControls where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SsmControls = SsmControls'
{
SsmControls -> Maybe Natural
concurrentExecutionRatePercentage :: Prelude.Maybe Prelude.Natural,
SsmControls -> Maybe Natural
errorPercentage :: Prelude.Maybe Prelude.Natural
}
deriving (SsmControls -> SsmControls -> Bool
(SsmControls -> SsmControls -> Bool)
-> (SsmControls -> SsmControls -> Bool) -> Eq SsmControls
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SsmControls -> SsmControls -> Bool
$c/= :: SsmControls -> SsmControls -> Bool
== :: SsmControls -> SsmControls -> Bool
$c== :: SsmControls -> SsmControls -> Bool
Prelude.Eq, ReadPrec [SsmControls]
ReadPrec SsmControls
Int -> ReadS SsmControls
ReadS [SsmControls]
(Int -> ReadS SsmControls)
-> ReadS [SsmControls]
-> ReadPrec SsmControls
-> ReadPrec [SsmControls]
-> Read SsmControls
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SsmControls]
$creadListPrec :: ReadPrec [SsmControls]
readPrec :: ReadPrec SsmControls
$creadPrec :: ReadPrec SsmControls
readList :: ReadS [SsmControls]
$creadList :: ReadS [SsmControls]
readsPrec :: Int -> ReadS SsmControls
$creadsPrec :: Int -> ReadS SsmControls
Prelude.Read, Int -> SsmControls -> ShowS
[SsmControls] -> ShowS
SsmControls -> String
(Int -> SsmControls -> ShowS)
-> (SsmControls -> String)
-> ([SsmControls] -> ShowS)
-> Show SsmControls
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SsmControls] -> ShowS
$cshowList :: [SsmControls] -> ShowS
show :: SsmControls -> String
$cshow :: SsmControls -> String
showsPrec :: Int -> SsmControls -> ShowS
$cshowsPrec :: Int -> SsmControls -> ShowS
Prelude.Show, (forall x. SsmControls -> Rep SsmControls x)
-> (forall x. Rep SsmControls x -> SsmControls)
-> Generic SsmControls
forall x. Rep SsmControls x -> SsmControls
forall x. SsmControls -> Rep SsmControls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SsmControls x -> SsmControls
$cfrom :: forall x. SsmControls -> Rep SsmControls x
Prelude.Generic)
newSsmControls ::
SsmControls
newSsmControls :: SsmControls
newSsmControls =
SsmControls' :: Maybe Natural -> Maybe Natural -> SsmControls
SsmControls'
{ $sel:concurrentExecutionRatePercentage:SsmControls' :: Maybe Natural
concurrentExecutionRatePercentage =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:errorPercentage:SsmControls' :: Maybe Natural
errorPercentage = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
ssmControls_concurrentExecutionRatePercentage :: Lens.Lens' SsmControls (Prelude.Maybe Prelude.Natural)
ssmControls_concurrentExecutionRatePercentage :: (Maybe Natural -> f (Maybe Natural))
-> SsmControls -> f SsmControls
ssmControls_concurrentExecutionRatePercentage = (SsmControls -> Maybe Natural)
-> (SsmControls -> Maybe Natural -> SsmControls)
-> Lens SsmControls SsmControls (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SsmControls' {Maybe Natural
concurrentExecutionRatePercentage :: Maybe Natural
$sel:concurrentExecutionRatePercentage:SsmControls' :: SsmControls -> Maybe Natural
concurrentExecutionRatePercentage} -> Maybe Natural
concurrentExecutionRatePercentage) (\s :: SsmControls
s@SsmControls' {} Maybe Natural
a -> SsmControls
s {$sel:concurrentExecutionRatePercentage:SsmControls' :: Maybe Natural
concurrentExecutionRatePercentage = Maybe Natural
a} :: SsmControls)
ssmControls_errorPercentage :: Lens.Lens' SsmControls (Prelude.Maybe Prelude.Natural)
ssmControls_errorPercentage :: (Maybe Natural -> f (Maybe Natural))
-> SsmControls -> f SsmControls
ssmControls_errorPercentage = (SsmControls -> Maybe Natural)
-> (SsmControls -> Maybe Natural -> SsmControls)
-> Lens SsmControls SsmControls (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SsmControls' {Maybe Natural
errorPercentage :: Maybe Natural
$sel:errorPercentage:SsmControls' :: SsmControls -> Maybe Natural
errorPercentage} -> Maybe Natural
errorPercentage) (\s :: SsmControls
s@SsmControls' {} Maybe Natural
a -> SsmControls
s {$sel:errorPercentage:SsmControls' :: Maybe Natural
errorPercentage = Maybe Natural
a} :: SsmControls)
instance Core.FromJSON SsmControls where
parseJSON :: Value -> Parser SsmControls
parseJSON =
String
-> (Object -> Parser SsmControls) -> Value -> Parser SsmControls
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SsmControls"
( \Object
x ->
Maybe Natural -> Maybe Natural -> SsmControls
SsmControls'
(Maybe Natural -> Maybe Natural -> SsmControls)
-> Parser (Maybe Natural) -> Parser (Maybe Natural -> SsmControls)
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
"ConcurrentExecutionRatePercentage")
Parser (Maybe Natural -> SsmControls)
-> Parser (Maybe Natural) -> Parser SsmControls
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
"ErrorPercentage")
)
instance Prelude.Hashable SsmControls
instance Prelude.NFData SsmControls
instance Core.ToJSON SsmControls where
toJSON :: SsmControls -> Value
toJSON SsmControls' {Maybe Natural
errorPercentage :: Maybe Natural
concurrentExecutionRatePercentage :: Maybe Natural
$sel:errorPercentage:SsmControls' :: SsmControls -> Maybe Natural
$sel:concurrentExecutionRatePercentage:SsmControls' :: SsmControls -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ConcurrentExecutionRatePercentage" 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
concurrentExecutionRatePercentage,
(Text
"ErrorPercentage" 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
errorPercentage
]
)