{-# 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.AutoScaling.SetDesiredCapacity
(
SetDesiredCapacity (..),
newSetDesiredCapacity,
setDesiredCapacity_honorCooldown,
setDesiredCapacity_autoScalingGroupName,
setDesiredCapacity_desiredCapacity,
SetDesiredCapacityResponse (..),
newSetDesiredCapacityResponse,
)
where
import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SetDesiredCapacity = SetDesiredCapacity'
{
SetDesiredCapacity -> Maybe Bool
honorCooldown :: Prelude.Maybe Prelude.Bool,
SetDesiredCapacity -> Text
autoScalingGroupName :: Prelude.Text,
SetDesiredCapacity -> Int
desiredCapacity :: Prelude.Int
}
deriving (SetDesiredCapacity -> SetDesiredCapacity -> Bool
(SetDesiredCapacity -> SetDesiredCapacity -> Bool)
-> (SetDesiredCapacity -> SetDesiredCapacity -> Bool)
-> Eq SetDesiredCapacity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetDesiredCapacity -> SetDesiredCapacity -> Bool
$c/= :: SetDesiredCapacity -> SetDesiredCapacity -> Bool
== :: SetDesiredCapacity -> SetDesiredCapacity -> Bool
$c== :: SetDesiredCapacity -> SetDesiredCapacity -> Bool
Prelude.Eq, ReadPrec [SetDesiredCapacity]
ReadPrec SetDesiredCapacity
Int -> ReadS SetDesiredCapacity
ReadS [SetDesiredCapacity]
(Int -> ReadS SetDesiredCapacity)
-> ReadS [SetDesiredCapacity]
-> ReadPrec SetDesiredCapacity
-> ReadPrec [SetDesiredCapacity]
-> Read SetDesiredCapacity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetDesiredCapacity]
$creadListPrec :: ReadPrec [SetDesiredCapacity]
readPrec :: ReadPrec SetDesiredCapacity
$creadPrec :: ReadPrec SetDesiredCapacity
readList :: ReadS [SetDesiredCapacity]
$creadList :: ReadS [SetDesiredCapacity]
readsPrec :: Int -> ReadS SetDesiredCapacity
$creadsPrec :: Int -> ReadS SetDesiredCapacity
Prelude.Read, Int -> SetDesiredCapacity -> ShowS
[SetDesiredCapacity] -> ShowS
SetDesiredCapacity -> String
(Int -> SetDesiredCapacity -> ShowS)
-> (SetDesiredCapacity -> String)
-> ([SetDesiredCapacity] -> ShowS)
-> Show SetDesiredCapacity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetDesiredCapacity] -> ShowS
$cshowList :: [SetDesiredCapacity] -> ShowS
show :: SetDesiredCapacity -> String
$cshow :: SetDesiredCapacity -> String
showsPrec :: Int -> SetDesiredCapacity -> ShowS
$cshowsPrec :: Int -> SetDesiredCapacity -> ShowS
Prelude.Show, (forall x. SetDesiredCapacity -> Rep SetDesiredCapacity x)
-> (forall x. Rep SetDesiredCapacity x -> SetDesiredCapacity)
-> Generic SetDesiredCapacity
forall x. Rep SetDesiredCapacity x -> SetDesiredCapacity
forall x. SetDesiredCapacity -> Rep SetDesiredCapacity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetDesiredCapacity x -> SetDesiredCapacity
$cfrom :: forall x. SetDesiredCapacity -> Rep SetDesiredCapacity x
Prelude.Generic)
newSetDesiredCapacity ::
Prelude.Text ->
Prelude.Int ->
SetDesiredCapacity
newSetDesiredCapacity :: Text -> Int -> SetDesiredCapacity
newSetDesiredCapacity
Text
pAutoScalingGroupName_
Int
pDesiredCapacity_ =
SetDesiredCapacity' :: Maybe Bool -> Text -> Int -> SetDesiredCapacity
SetDesiredCapacity'
{ $sel:honorCooldown:SetDesiredCapacity' :: Maybe Bool
honorCooldown =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:autoScalingGroupName:SetDesiredCapacity' :: Text
autoScalingGroupName = Text
pAutoScalingGroupName_,
$sel:desiredCapacity:SetDesiredCapacity' :: Int
desiredCapacity = Int
pDesiredCapacity_
}
setDesiredCapacity_honorCooldown :: Lens.Lens' SetDesiredCapacity (Prelude.Maybe Prelude.Bool)
setDesiredCapacity_honorCooldown :: (Maybe Bool -> f (Maybe Bool))
-> SetDesiredCapacity -> f SetDesiredCapacity
setDesiredCapacity_honorCooldown = (SetDesiredCapacity -> Maybe Bool)
-> (SetDesiredCapacity -> Maybe Bool -> SetDesiredCapacity)
-> Lens
SetDesiredCapacity SetDesiredCapacity (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetDesiredCapacity' {Maybe Bool
honorCooldown :: Maybe Bool
$sel:honorCooldown:SetDesiredCapacity' :: SetDesiredCapacity -> Maybe Bool
honorCooldown} -> Maybe Bool
honorCooldown) (\s :: SetDesiredCapacity
s@SetDesiredCapacity' {} Maybe Bool
a -> SetDesiredCapacity
s {$sel:honorCooldown:SetDesiredCapacity' :: Maybe Bool
honorCooldown = Maybe Bool
a} :: SetDesiredCapacity)
setDesiredCapacity_autoScalingGroupName :: Lens.Lens' SetDesiredCapacity Prelude.Text
setDesiredCapacity_autoScalingGroupName :: (Text -> f Text) -> SetDesiredCapacity -> f SetDesiredCapacity
setDesiredCapacity_autoScalingGroupName = (SetDesiredCapacity -> Text)
-> (SetDesiredCapacity -> Text -> SetDesiredCapacity)
-> Lens SetDesiredCapacity SetDesiredCapacity Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetDesiredCapacity' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:SetDesiredCapacity' :: SetDesiredCapacity -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: SetDesiredCapacity
s@SetDesiredCapacity' {} Text
a -> SetDesiredCapacity
s {$sel:autoScalingGroupName:SetDesiredCapacity' :: Text
autoScalingGroupName = Text
a} :: SetDesiredCapacity)
setDesiredCapacity_desiredCapacity :: Lens.Lens' SetDesiredCapacity Prelude.Int
setDesiredCapacity_desiredCapacity :: (Int -> f Int) -> SetDesiredCapacity -> f SetDesiredCapacity
setDesiredCapacity_desiredCapacity = (SetDesiredCapacity -> Int)
-> (SetDesiredCapacity -> Int -> SetDesiredCapacity)
-> Lens SetDesiredCapacity SetDesiredCapacity Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetDesiredCapacity' {Int
desiredCapacity :: Int
$sel:desiredCapacity:SetDesiredCapacity' :: SetDesiredCapacity -> Int
desiredCapacity} -> Int
desiredCapacity) (\s :: SetDesiredCapacity
s@SetDesiredCapacity' {} Int
a -> SetDesiredCapacity
s {$sel:desiredCapacity:SetDesiredCapacity' :: Int
desiredCapacity = Int
a} :: SetDesiredCapacity)
instance Core.AWSRequest SetDesiredCapacity where
type
AWSResponse SetDesiredCapacity =
SetDesiredCapacityResponse
request :: SetDesiredCapacity -> Request SetDesiredCapacity
request = Service -> SetDesiredCapacity -> Request SetDesiredCapacity
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetDesiredCapacity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetDesiredCapacity)))
response =
AWSResponse SetDesiredCapacity
-> Logger
-> Service
-> Proxy SetDesiredCapacity
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetDesiredCapacity)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse SetDesiredCapacity
SetDesiredCapacityResponse
SetDesiredCapacityResponse'
instance Prelude.Hashable SetDesiredCapacity
instance Prelude.NFData SetDesiredCapacity
instance Core.ToHeaders SetDesiredCapacity where
toHeaders :: SetDesiredCapacity -> [Header]
toHeaders = [Header] -> SetDesiredCapacity -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetDesiredCapacity where
toPath :: SetDesiredCapacity -> ByteString
toPath = ByteString -> SetDesiredCapacity -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetDesiredCapacity where
toQuery :: SetDesiredCapacity -> QueryString
toQuery SetDesiredCapacity' {Int
Maybe Bool
Text
desiredCapacity :: Int
autoScalingGroupName :: Text
honorCooldown :: Maybe Bool
$sel:desiredCapacity:SetDesiredCapacity' :: SetDesiredCapacity -> Int
$sel:autoScalingGroupName:SetDesiredCapacity' :: SetDesiredCapacity -> Text
$sel:honorCooldown:SetDesiredCapacity' :: SetDesiredCapacity -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SetDesiredCapacity" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"HonorCooldown" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
honorCooldown,
ByteString
"AutoScalingGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
autoScalingGroupName,
ByteString
"DesiredCapacity" ByteString -> Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Int
desiredCapacity
]
data SetDesiredCapacityResponse = SetDesiredCapacityResponse'
{
}
deriving (SetDesiredCapacityResponse -> SetDesiredCapacityResponse -> Bool
(SetDesiredCapacityResponse -> SetDesiredCapacityResponse -> Bool)
-> (SetDesiredCapacityResponse
-> SetDesiredCapacityResponse -> Bool)
-> Eq SetDesiredCapacityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetDesiredCapacityResponse -> SetDesiredCapacityResponse -> Bool
$c/= :: SetDesiredCapacityResponse -> SetDesiredCapacityResponse -> Bool
== :: SetDesiredCapacityResponse -> SetDesiredCapacityResponse -> Bool
$c== :: SetDesiredCapacityResponse -> SetDesiredCapacityResponse -> Bool
Prelude.Eq, ReadPrec [SetDesiredCapacityResponse]
ReadPrec SetDesiredCapacityResponse
Int -> ReadS SetDesiredCapacityResponse
ReadS [SetDesiredCapacityResponse]
(Int -> ReadS SetDesiredCapacityResponse)
-> ReadS [SetDesiredCapacityResponse]
-> ReadPrec SetDesiredCapacityResponse
-> ReadPrec [SetDesiredCapacityResponse]
-> Read SetDesiredCapacityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetDesiredCapacityResponse]
$creadListPrec :: ReadPrec [SetDesiredCapacityResponse]
readPrec :: ReadPrec SetDesiredCapacityResponse
$creadPrec :: ReadPrec SetDesiredCapacityResponse
readList :: ReadS [SetDesiredCapacityResponse]
$creadList :: ReadS [SetDesiredCapacityResponse]
readsPrec :: Int -> ReadS SetDesiredCapacityResponse
$creadsPrec :: Int -> ReadS SetDesiredCapacityResponse
Prelude.Read, Int -> SetDesiredCapacityResponse -> ShowS
[SetDesiredCapacityResponse] -> ShowS
SetDesiredCapacityResponse -> String
(Int -> SetDesiredCapacityResponse -> ShowS)
-> (SetDesiredCapacityResponse -> String)
-> ([SetDesiredCapacityResponse] -> ShowS)
-> Show SetDesiredCapacityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetDesiredCapacityResponse] -> ShowS
$cshowList :: [SetDesiredCapacityResponse] -> ShowS
show :: SetDesiredCapacityResponse -> String
$cshow :: SetDesiredCapacityResponse -> String
showsPrec :: Int -> SetDesiredCapacityResponse -> ShowS
$cshowsPrec :: Int -> SetDesiredCapacityResponse -> ShowS
Prelude.Show, (forall x.
SetDesiredCapacityResponse -> Rep SetDesiredCapacityResponse x)
-> (forall x.
Rep SetDesiredCapacityResponse x -> SetDesiredCapacityResponse)
-> Generic SetDesiredCapacityResponse
forall x.
Rep SetDesiredCapacityResponse x -> SetDesiredCapacityResponse
forall x.
SetDesiredCapacityResponse -> Rep SetDesiredCapacityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetDesiredCapacityResponse x -> SetDesiredCapacityResponse
$cfrom :: forall x.
SetDesiredCapacityResponse -> Rep SetDesiredCapacityResponse x
Prelude.Generic)
newSetDesiredCapacityResponse ::
SetDesiredCapacityResponse
newSetDesiredCapacityResponse :: SetDesiredCapacityResponse
newSetDesiredCapacityResponse =
SetDesiredCapacityResponse
SetDesiredCapacityResponse'
instance Prelude.NFData SetDesiredCapacityResponse