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