{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.OpsWorks.SetLoadBasedAutoScaling
(
SetLoadBasedAutoScaling (..),
newSetLoadBasedAutoScaling,
setLoadBasedAutoScaling_upScaling,
setLoadBasedAutoScaling_enable,
setLoadBasedAutoScaling_downScaling,
setLoadBasedAutoScaling_layerId,
SetLoadBasedAutoScalingResponse (..),
newSetLoadBasedAutoScalingResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SetLoadBasedAutoScaling = SetLoadBasedAutoScaling'
{
SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds
upScaling :: Prelude.Maybe AutoScalingThresholds,
SetLoadBasedAutoScaling -> Maybe Bool
enable :: Prelude.Maybe Prelude.Bool,
SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds
downScaling :: Prelude.Maybe AutoScalingThresholds,
SetLoadBasedAutoScaling -> Text
layerId :: Prelude.Text
}
deriving (SetLoadBasedAutoScaling -> SetLoadBasedAutoScaling -> Bool
(SetLoadBasedAutoScaling -> SetLoadBasedAutoScaling -> Bool)
-> (SetLoadBasedAutoScaling -> SetLoadBasedAutoScaling -> Bool)
-> Eq SetLoadBasedAutoScaling
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetLoadBasedAutoScaling -> SetLoadBasedAutoScaling -> Bool
$c/= :: SetLoadBasedAutoScaling -> SetLoadBasedAutoScaling -> Bool
== :: SetLoadBasedAutoScaling -> SetLoadBasedAutoScaling -> Bool
$c== :: SetLoadBasedAutoScaling -> SetLoadBasedAutoScaling -> Bool
Prelude.Eq, ReadPrec [SetLoadBasedAutoScaling]
ReadPrec SetLoadBasedAutoScaling
Int -> ReadS SetLoadBasedAutoScaling
ReadS [SetLoadBasedAutoScaling]
(Int -> ReadS SetLoadBasedAutoScaling)
-> ReadS [SetLoadBasedAutoScaling]
-> ReadPrec SetLoadBasedAutoScaling
-> ReadPrec [SetLoadBasedAutoScaling]
-> Read SetLoadBasedAutoScaling
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetLoadBasedAutoScaling]
$creadListPrec :: ReadPrec [SetLoadBasedAutoScaling]
readPrec :: ReadPrec SetLoadBasedAutoScaling
$creadPrec :: ReadPrec SetLoadBasedAutoScaling
readList :: ReadS [SetLoadBasedAutoScaling]
$creadList :: ReadS [SetLoadBasedAutoScaling]
readsPrec :: Int -> ReadS SetLoadBasedAutoScaling
$creadsPrec :: Int -> ReadS SetLoadBasedAutoScaling
Prelude.Read, Int -> SetLoadBasedAutoScaling -> ShowS
[SetLoadBasedAutoScaling] -> ShowS
SetLoadBasedAutoScaling -> String
(Int -> SetLoadBasedAutoScaling -> ShowS)
-> (SetLoadBasedAutoScaling -> String)
-> ([SetLoadBasedAutoScaling] -> ShowS)
-> Show SetLoadBasedAutoScaling
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetLoadBasedAutoScaling] -> ShowS
$cshowList :: [SetLoadBasedAutoScaling] -> ShowS
show :: SetLoadBasedAutoScaling -> String
$cshow :: SetLoadBasedAutoScaling -> String
showsPrec :: Int -> SetLoadBasedAutoScaling -> ShowS
$cshowsPrec :: Int -> SetLoadBasedAutoScaling -> ShowS
Prelude.Show, (forall x.
SetLoadBasedAutoScaling -> Rep SetLoadBasedAutoScaling x)
-> (forall x.
Rep SetLoadBasedAutoScaling x -> SetLoadBasedAutoScaling)
-> Generic SetLoadBasedAutoScaling
forall x. Rep SetLoadBasedAutoScaling x -> SetLoadBasedAutoScaling
forall x. SetLoadBasedAutoScaling -> Rep SetLoadBasedAutoScaling x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetLoadBasedAutoScaling x -> SetLoadBasedAutoScaling
$cfrom :: forall x. SetLoadBasedAutoScaling -> Rep SetLoadBasedAutoScaling x
Prelude.Generic)
newSetLoadBasedAutoScaling ::
Prelude.Text ->
SetLoadBasedAutoScaling
newSetLoadBasedAutoScaling :: Text -> SetLoadBasedAutoScaling
newSetLoadBasedAutoScaling Text
pLayerId_ =
SetLoadBasedAutoScaling' :: Maybe AutoScalingThresholds
-> Maybe Bool
-> Maybe AutoScalingThresholds
-> Text
-> SetLoadBasedAutoScaling
SetLoadBasedAutoScaling'
{ $sel:upScaling:SetLoadBasedAutoScaling' :: Maybe AutoScalingThresholds
upScaling =
Maybe AutoScalingThresholds
forall a. Maybe a
Prelude.Nothing,
$sel:enable:SetLoadBasedAutoScaling' :: Maybe Bool
enable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:downScaling:SetLoadBasedAutoScaling' :: Maybe AutoScalingThresholds
downScaling = Maybe AutoScalingThresholds
forall a. Maybe a
Prelude.Nothing,
$sel:layerId:SetLoadBasedAutoScaling' :: Text
layerId = Text
pLayerId_
}
setLoadBasedAutoScaling_upScaling :: Lens.Lens' SetLoadBasedAutoScaling (Prelude.Maybe AutoScalingThresholds)
setLoadBasedAutoScaling_upScaling :: (Maybe AutoScalingThresholds -> f (Maybe AutoScalingThresholds))
-> SetLoadBasedAutoScaling -> f SetLoadBasedAutoScaling
setLoadBasedAutoScaling_upScaling = (SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds)
-> (SetLoadBasedAutoScaling
-> Maybe AutoScalingThresholds -> SetLoadBasedAutoScaling)
-> Lens
SetLoadBasedAutoScaling
SetLoadBasedAutoScaling
(Maybe AutoScalingThresholds)
(Maybe AutoScalingThresholds)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLoadBasedAutoScaling' {Maybe AutoScalingThresholds
upScaling :: Maybe AutoScalingThresholds
$sel:upScaling:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds
upScaling} -> Maybe AutoScalingThresholds
upScaling) (\s :: SetLoadBasedAutoScaling
s@SetLoadBasedAutoScaling' {} Maybe AutoScalingThresholds
a -> SetLoadBasedAutoScaling
s {$sel:upScaling:SetLoadBasedAutoScaling' :: Maybe AutoScalingThresholds
upScaling = Maybe AutoScalingThresholds
a} :: SetLoadBasedAutoScaling)
setLoadBasedAutoScaling_enable :: Lens.Lens' SetLoadBasedAutoScaling (Prelude.Maybe Prelude.Bool)
setLoadBasedAutoScaling_enable :: (Maybe Bool -> f (Maybe Bool))
-> SetLoadBasedAutoScaling -> f SetLoadBasedAutoScaling
setLoadBasedAutoScaling_enable = (SetLoadBasedAutoScaling -> Maybe Bool)
-> (SetLoadBasedAutoScaling
-> Maybe Bool -> SetLoadBasedAutoScaling)
-> Lens
SetLoadBasedAutoScaling
SetLoadBasedAutoScaling
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLoadBasedAutoScaling' {Maybe Bool
enable :: Maybe Bool
$sel:enable:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Maybe Bool
enable} -> Maybe Bool
enable) (\s :: SetLoadBasedAutoScaling
s@SetLoadBasedAutoScaling' {} Maybe Bool
a -> SetLoadBasedAutoScaling
s {$sel:enable:SetLoadBasedAutoScaling' :: Maybe Bool
enable = Maybe Bool
a} :: SetLoadBasedAutoScaling)
setLoadBasedAutoScaling_downScaling :: Lens.Lens' SetLoadBasedAutoScaling (Prelude.Maybe AutoScalingThresholds)
setLoadBasedAutoScaling_downScaling :: (Maybe AutoScalingThresholds -> f (Maybe AutoScalingThresholds))
-> SetLoadBasedAutoScaling -> f SetLoadBasedAutoScaling
setLoadBasedAutoScaling_downScaling = (SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds)
-> (SetLoadBasedAutoScaling
-> Maybe AutoScalingThresholds -> SetLoadBasedAutoScaling)
-> Lens
SetLoadBasedAutoScaling
SetLoadBasedAutoScaling
(Maybe AutoScalingThresholds)
(Maybe AutoScalingThresholds)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLoadBasedAutoScaling' {Maybe AutoScalingThresholds
downScaling :: Maybe AutoScalingThresholds
$sel:downScaling:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds
downScaling} -> Maybe AutoScalingThresholds
downScaling) (\s :: SetLoadBasedAutoScaling
s@SetLoadBasedAutoScaling' {} Maybe AutoScalingThresholds
a -> SetLoadBasedAutoScaling
s {$sel:downScaling:SetLoadBasedAutoScaling' :: Maybe AutoScalingThresholds
downScaling = Maybe AutoScalingThresholds
a} :: SetLoadBasedAutoScaling)
setLoadBasedAutoScaling_layerId :: Lens.Lens' SetLoadBasedAutoScaling Prelude.Text
setLoadBasedAutoScaling_layerId :: (Text -> f Text)
-> SetLoadBasedAutoScaling -> f SetLoadBasedAutoScaling
setLoadBasedAutoScaling_layerId = (SetLoadBasedAutoScaling -> Text)
-> (SetLoadBasedAutoScaling -> Text -> SetLoadBasedAutoScaling)
-> Lens SetLoadBasedAutoScaling SetLoadBasedAutoScaling Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetLoadBasedAutoScaling' {Text
layerId :: Text
$sel:layerId:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Text
layerId} -> Text
layerId) (\s :: SetLoadBasedAutoScaling
s@SetLoadBasedAutoScaling' {} Text
a -> SetLoadBasedAutoScaling
s {$sel:layerId:SetLoadBasedAutoScaling' :: Text
layerId = Text
a} :: SetLoadBasedAutoScaling)
instance Core.AWSRequest SetLoadBasedAutoScaling where
type
AWSResponse SetLoadBasedAutoScaling =
SetLoadBasedAutoScalingResponse
request :: SetLoadBasedAutoScaling -> Request SetLoadBasedAutoScaling
request = Service
-> SetLoadBasedAutoScaling -> Request SetLoadBasedAutoScaling
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SetLoadBasedAutoScaling
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetLoadBasedAutoScaling)))
response =
AWSResponse SetLoadBasedAutoScaling
-> Logger
-> Service
-> Proxy SetLoadBasedAutoScaling
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetLoadBasedAutoScaling)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse SetLoadBasedAutoScaling
SetLoadBasedAutoScalingResponse
SetLoadBasedAutoScalingResponse'
instance Prelude.Hashable SetLoadBasedAutoScaling
instance Prelude.NFData SetLoadBasedAutoScaling
instance Core.ToHeaders SetLoadBasedAutoScaling where
toHeaders :: SetLoadBasedAutoScaling -> [Header]
toHeaders =
[Header] -> SetLoadBasedAutoScaling -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"OpsWorks_20130218.SetLoadBasedAutoScaling" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SetLoadBasedAutoScaling where
toJSON :: SetLoadBasedAutoScaling -> Value
toJSON SetLoadBasedAutoScaling' {Maybe Bool
Maybe AutoScalingThresholds
Text
layerId :: Text
downScaling :: Maybe AutoScalingThresholds
enable :: Maybe Bool
upScaling :: Maybe AutoScalingThresholds
$sel:layerId:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Text
$sel:downScaling:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds
$sel:enable:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Maybe Bool
$sel:upScaling:SetLoadBasedAutoScaling' :: SetLoadBasedAutoScaling -> Maybe AutoScalingThresholds
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"UpScaling" Text -> AutoScalingThresholds -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AutoScalingThresholds -> Pair)
-> Maybe AutoScalingThresholds -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoScalingThresholds
upScaling,
(Text
"Enable" 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
enable,
(Text
"DownScaling" Text -> AutoScalingThresholds -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AutoScalingThresholds -> Pair)
-> Maybe AutoScalingThresholds -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoScalingThresholds
downScaling,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LayerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
layerId)
]
)
instance Core.ToPath SetLoadBasedAutoScaling where
toPath :: SetLoadBasedAutoScaling -> ByteString
toPath = ByteString -> SetLoadBasedAutoScaling -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetLoadBasedAutoScaling where
toQuery :: SetLoadBasedAutoScaling -> QueryString
toQuery = QueryString -> SetLoadBasedAutoScaling -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SetLoadBasedAutoScalingResponse = SetLoadBasedAutoScalingResponse'
{
}
deriving (SetLoadBasedAutoScalingResponse
-> SetLoadBasedAutoScalingResponse -> Bool
(SetLoadBasedAutoScalingResponse
-> SetLoadBasedAutoScalingResponse -> Bool)
-> (SetLoadBasedAutoScalingResponse
-> SetLoadBasedAutoScalingResponse -> Bool)
-> Eq SetLoadBasedAutoScalingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetLoadBasedAutoScalingResponse
-> SetLoadBasedAutoScalingResponse -> Bool
$c/= :: SetLoadBasedAutoScalingResponse
-> SetLoadBasedAutoScalingResponse -> Bool
== :: SetLoadBasedAutoScalingResponse
-> SetLoadBasedAutoScalingResponse -> Bool
$c== :: SetLoadBasedAutoScalingResponse
-> SetLoadBasedAutoScalingResponse -> Bool
Prelude.Eq, ReadPrec [SetLoadBasedAutoScalingResponse]
ReadPrec SetLoadBasedAutoScalingResponse
Int -> ReadS SetLoadBasedAutoScalingResponse
ReadS [SetLoadBasedAutoScalingResponse]
(Int -> ReadS SetLoadBasedAutoScalingResponse)
-> ReadS [SetLoadBasedAutoScalingResponse]
-> ReadPrec SetLoadBasedAutoScalingResponse
-> ReadPrec [SetLoadBasedAutoScalingResponse]
-> Read SetLoadBasedAutoScalingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetLoadBasedAutoScalingResponse]
$creadListPrec :: ReadPrec [SetLoadBasedAutoScalingResponse]
readPrec :: ReadPrec SetLoadBasedAutoScalingResponse
$creadPrec :: ReadPrec SetLoadBasedAutoScalingResponse
readList :: ReadS [SetLoadBasedAutoScalingResponse]
$creadList :: ReadS [SetLoadBasedAutoScalingResponse]
readsPrec :: Int -> ReadS SetLoadBasedAutoScalingResponse
$creadsPrec :: Int -> ReadS SetLoadBasedAutoScalingResponse
Prelude.Read, Int -> SetLoadBasedAutoScalingResponse -> ShowS
[SetLoadBasedAutoScalingResponse] -> ShowS
SetLoadBasedAutoScalingResponse -> String
(Int -> SetLoadBasedAutoScalingResponse -> ShowS)
-> (SetLoadBasedAutoScalingResponse -> String)
-> ([SetLoadBasedAutoScalingResponse] -> ShowS)
-> Show SetLoadBasedAutoScalingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetLoadBasedAutoScalingResponse] -> ShowS
$cshowList :: [SetLoadBasedAutoScalingResponse] -> ShowS
show :: SetLoadBasedAutoScalingResponse -> String
$cshow :: SetLoadBasedAutoScalingResponse -> String
showsPrec :: Int -> SetLoadBasedAutoScalingResponse -> ShowS
$cshowsPrec :: Int -> SetLoadBasedAutoScalingResponse -> ShowS
Prelude.Show, (forall x.
SetLoadBasedAutoScalingResponse
-> Rep SetLoadBasedAutoScalingResponse x)
-> (forall x.
Rep SetLoadBasedAutoScalingResponse x
-> SetLoadBasedAutoScalingResponse)
-> Generic SetLoadBasedAutoScalingResponse
forall x.
Rep SetLoadBasedAutoScalingResponse x
-> SetLoadBasedAutoScalingResponse
forall x.
SetLoadBasedAutoScalingResponse
-> Rep SetLoadBasedAutoScalingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetLoadBasedAutoScalingResponse x
-> SetLoadBasedAutoScalingResponse
$cfrom :: forall x.
SetLoadBasedAutoScalingResponse
-> Rep SetLoadBasedAutoScalingResponse x
Prelude.Generic)
newSetLoadBasedAutoScalingResponse ::
SetLoadBasedAutoScalingResponse
newSetLoadBasedAutoScalingResponse :: SetLoadBasedAutoScalingResponse
newSetLoadBasedAutoScalingResponse =
SetLoadBasedAutoScalingResponse
SetLoadBasedAutoScalingResponse'
instance
Prelude.NFData
SetLoadBasedAutoScalingResponse