{-# 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.GameLift.PutScalingPolicy
(
PutScalingPolicy (..),
newPutScalingPolicy,
putScalingPolicy_scalingAdjustmentType,
putScalingPolicy_evaluationPeriods,
putScalingPolicy_policyType,
putScalingPolicy_comparisonOperator,
putScalingPolicy_threshold,
putScalingPolicy_scalingAdjustment,
putScalingPolicy_targetConfiguration,
putScalingPolicy_name,
putScalingPolicy_fleetId,
putScalingPolicy_metricName,
PutScalingPolicyResponse (..),
newPutScalingPolicyResponse,
putScalingPolicyResponse_name,
putScalingPolicyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
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 PutScalingPolicy = PutScalingPolicy'
{
PutScalingPolicy -> Maybe ScalingAdjustmentType
scalingAdjustmentType :: Prelude.Maybe ScalingAdjustmentType,
PutScalingPolicy -> Maybe Natural
evaluationPeriods :: Prelude.Maybe Prelude.Natural,
PutScalingPolicy -> Maybe PolicyType
policyType :: Prelude.Maybe PolicyType,
PutScalingPolicy -> Maybe ComparisonOperatorType
comparisonOperator :: Prelude.Maybe ComparisonOperatorType,
PutScalingPolicy -> Maybe Double
threshold :: Prelude.Maybe Prelude.Double,
PutScalingPolicy -> Maybe Int
scalingAdjustment :: Prelude.Maybe Prelude.Int,
PutScalingPolicy -> Maybe TargetConfiguration
targetConfiguration :: Prelude.Maybe TargetConfiguration,
PutScalingPolicy -> Text
name :: Prelude.Text,
PutScalingPolicy -> Text
fleetId :: Prelude.Text,
PutScalingPolicy -> MetricName
metricName :: MetricName
}
deriving (PutScalingPolicy -> PutScalingPolicy -> Bool
(PutScalingPolicy -> PutScalingPolicy -> Bool)
-> (PutScalingPolicy -> PutScalingPolicy -> Bool)
-> Eq PutScalingPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutScalingPolicy -> PutScalingPolicy -> Bool
$c/= :: PutScalingPolicy -> PutScalingPolicy -> Bool
== :: PutScalingPolicy -> PutScalingPolicy -> Bool
$c== :: PutScalingPolicy -> PutScalingPolicy -> Bool
Prelude.Eq, ReadPrec [PutScalingPolicy]
ReadPrec PutScalingPolicy
Int -> ReadS PutScalingPolicy
ReadS [PutScalingPolicy]
(Int -> ReadS PutScalingPolicy)
-> ReadS [PutScalingPolicy]
-> ReadPrec PutScalingPolicy
-> ReadPrec [PutScalingPolicy]
-> Read PutScalingPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutScalingPolicy]
$creadListPrec :: ReadPrec [PutScalingPolicy]
readPrec :: ReadPrec PutScalingPolicy
$creadPrec :: ReadPrec PutScalingPolicy
readList :: ReadS [PutScalingPolicy]
$creadList :: ReadS [PutScalingPolicy]
readsPrec :: Int -> ReadS PutScalingPolicy
$creadsPrec :: Int -> ReadS PutScalingPolicy
Prelude.Read, Int -> PutScalingPolicy -> ShowS
[PutScalingPolicy] -> ShowS
PutScalingPolicy -> String
(Int -> PutScalingPolicy -> ShowS)
-> (PutScalingPolicy -> String)
-> ([PutScalingPolicy] -> ShowS)
-> Show PutScalingPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutScalingPolicy] -> ShowS
$cshowList :: [PutScalingPolicy] -> ShowS
show :: PutScalingPolicy -> String
$cshow :: PutScalingPolicy -> String
showsPrec :: Int -> PutScalingPolicy -> ShowS
$cshowsPrec :: Int -> PutScalingPolicy -> ShowS
Prelude.Show, (forall x. PutScalingPolicy -> Rep PutScalingPolicy x)
-> (forall x. Rep PutScalingPolicy x -> PutScalingPolicy)
-> Generic PutScalingPolicy
forall x. Rep PutScalingPolicy x -> PutScalingPolicy
forall x. PutScalingPolicy -> Rep PutScalingPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutScalingPolicy x -> PutScalingPolicy
$cfrom :: forall x. PutScalingPolicy -> Rep PutScalingPolicy x
Prelude.Generic)
newPutScalingPolicy ::
Prelude.Text ->
Prelude.Text ->
MetricName ->
PutScalingPolicy
newPutScalingPolicy :: Text -> Text -> MetricName -> PutScalingPolicy
newPutScalingPolicy Text
pName_ Text
pFleetId_ MetricName
pMetricName_ =
PutScalingPolicy' :: Maybe ScalingAdjustmentType
-> Maybe Natural
-> Maybe PolicyType
-> Maybe ComparisonOperatorType
-> Maybe Double
-> Maybe Int
-> Maybe TargetConfiguration
-> Text
-> Text
-> MetricName
-> PutScalingPolicy
PutScalingPolicy'
{ $sel:scalingAdjustmentType:PutScalingPolicy' :: Maybe ScalingAdjustmentType
scalingAdjustmentType =
Maybe ScalingAdjustmentType
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationPeriods:PutScalingPolicy' :: Maybe Natural
evaluationPeriods = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:policyType:PutScalingPolicy' :: Maybe PolicyType
policyType = Maybe PolicyType
forall a. Maybe a
Prelude.Nothing,
$sel:comparisonOperator:PutScalingPolicy' :: Maybe ComparisonOperatorType
comparisonOperator = Maybe ComparisonOperatorType
forall a. Maybe a
Prelude.Nothing,
$sel:threshold:PutScalingPolicy' :: Maybe Double
threshold = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:scalingAdjustment:PutScalingPolicy' :: Maybe Int
scalingAdjustment = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:targetConfiguration:PutScalingPolicy' :: Maybe TargetConfiguration
targetConfiguration = Maybe TargetConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:name:PutScalingPolicy' :: Text
name = Text
pName_,
$sel:fleetId:PutScalingPolicy' :: Text
fleetId = Text
pFleetId_,
$sel:metricName:PutScalingPolicy' :: MetricName
metricName = MetricName
pMetricName_
}
putScalingPolicy_scalingAdjustmentType :: Lens.Lens' PutScalingPolicy (Prelude.Maybe ScalingAdjustmentType)
putScalingPolicy_scalingAdjustmentType :: (Maybe ScalingAdjustmentType -> f (Maybe ScalingAdjustmentType))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_scalingAdjustmentType = (PutScalingPolicy -> Maybe ScalingAdjustmentType)
-> (PutScalingPolicy
-> Maybe ScalingAdjustmentType -> PutScalingPolicy)
-> Lens
PutScalingPolicy
PutScalingPolicy
(Maybe ScalingAdjustmentType)
(Maybe ScalingAdjustmentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe ScalingAdjustmentType
scalingAdjustmentType :: Maybe ScalingAdjustmentType
$sel:scalingAdjustmentType:PutScalingPolicy' :: PutScalingPolicy -> Maybe ScalingAdjustmentType
scalingAdjustmentType} -> Maybe ScalingAdjustmentType
scalingAdjustmentType) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe ScalingAdjustmentType
a -> PutScalingPolicy
s {$sel:scalingAdjustmentType:PutScalingPolicy' :: Maybe ScalingAdjustmentType
scalingAdjustmentType = Maybe ScalingAdjustmentType
a} :: PutScalingPolicy)
putScalingPolicy_evaluationPeriods :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Natural)
putScalingPolicy_evaluationPeriods :: (Maybe Natural -> f (Maybe Natural))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_evaluationPeriods = (PutScalingPolicy -> Maybe Natural)
-> (PutScalingPolicy -> Maybe Natural -> PutScalingPolicy)
-> Lens
PutScalingPolicy PutScalingPolicy (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Natural
evaluationPeriods :: Maybe Natural
$sel:evaluationPeriods:PutScalingPolicy' :: PutScalingPolicy -> Maybe Natural
evaluationPeriods} -> Maybe Natural
evaluationPeriods) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Natural
a -> PutScalingPolicy
s {$sel:evaluationPeriods:PutScalingPolicy' :: Maybe Natural
evaluationPeriods = Maybe Natural
a} :: PutScalingPolicy)
putScalingPolicy_policyType :: Lens.Lens' PutScalingPolicy (Prelude.Maybe PolicyType)
putScalingPolicy_policyType :: (Maybe PolicyType -> f (Maybe PolicyType))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_policyType = (PutScalingPolicy -> Maybe PolicyType)
-> (PutScalingPolicy -> Maybe PolicyType -> PutScalingPolicy)
-> Lens
PutScalingPolicy
PutScalingPolicy
(Maybe PolicyType)
(Maybe PolicyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe PolicyType
policyType :: Maybe PolicyType
$sel:policyType:PutScalingPolicy' :: PutScalingPolicy -> Maybe PolicyType
policyType} -> Maybe PolicyType
policyType) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe PolicyType
a -> PutScalingPolicy
s {$sel:policyType:PutScalingPolicy' :: Maybe PolicyType
policyType = Maybe PolicyType
a} :: PutScalingPolicy)
putScalingPolicy_comparisonOperator :: Lens.Lens' PutScalingPolicy (Prelude.Maybe ComparisonOperatorType)
putScalingPolicy_comparisonOperator :: (Maybe ComparisonOperatorType -> f (Maybe ComparisonOperatorType))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_comparisonOperator = (PutScalingPolicy -> Maybe ComparisonOperatorType)
-> (PutScalingPolicy
-> Maybe ComparisonOperatorType -> PutScalingPolicy)
-> Lens
PutScalingPolicy
PutScalingPolicy
(Maybe ComparisonOperatorType)
(Maybe ComparisonOperatorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe ComparisonOperatorType
comparisonOperator :: Maybe ComparisonOperatorType
$sel:comparisonOperator:PutScalingPolicy' :: PutScalingPolicy -> Maybe ComparisonOperatorType
comparisonOperator} -> Maybe ComparisonOperatorType
comparisonOperator) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe ComparisonOperatorType
a -> PutScalingPolicy
s {$sel:comparisonOperator:PutScalingPolicy' :: Maybe ComparisonOperatorType
comparisonOperator = Maybe ComparisonOperatorType
a} :: PutScalingPolicy)
putScalingPolicy_threshold :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Double)
putScalingPolicy_threshold :: (Maybe Double -> f (Maybe Double))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_threshold = (PutScalingPolicy -> Maybe Double)
-> (PutScalingPolicy -> Maybe Double -> PutScalingPolicy)
-> Lens
PutScalingPolicy PutScalingPolicy (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Double
threshold :: Maybe Double
$sel:threshold:PutScalingPolicy' :: PutScalingPolicy -> Maybe Double
threshold} -> Maybe Double
threshold) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Double
a -> PutScalingPolicy
s {$sel:threshold:PutScalingPolicy' :: Maybe Double
threshold = Maybe Double
a} :: PutScalingPolicy)
putScalingPolicy_scalingAdjustment :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Int)
putScalingPolicy_scalingAdjustment :: (Maybe Int -> f (Maybe Int))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_scalingAdjustment = (PutScalingPolicy -> Maybe Int)
-> (PutScalingPolicy -> Maybe Int -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe Int
scalingAdjustment :: Maybe Int
$sel:scalingAdjustment:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
scalingAdjustment} -> Maybe Int
scalingAdjustment) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe Int
a -> PutScalingPolicy
s {$sel:scalingAdjustment:PutScalingPolicy' :: Maybe Int
scalingAdjustment = Maybe Int
a} :: PutScalingPolicy)
putScalingPolicy_targetConfiguration :: Lens.Lens' PutScalingPolicy (Prelude.Maybe TargetConfiguration)
putScalingPolicy_targetConfiguration :: (Maybe TargetConfiguration -> f (Maybe TargetConfiguration))
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_targetConfiguration = (PutScalingPolicy -> Maybe TargetConfiguration)
-> (PutScalingPolicy
-> Maybe TargetConfiguration -> PutScalingPolicy)
-> Lens
PutScalingPolicy
PutScalingPolicy
(Maybe TargetConfiguration)
(Maybe TargetConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Maybe TargetConfiguration
targetConfiguration :: Maybe TargetConfiguration
$sel:targetConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe TargetConfiguration
targetConfiguration} -> Maybe TargetConfiguration
targetConfiguration) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Maybe TargetConfiguration
a -> PutScalingPolicy
s {$sel:targetConfiguration:PutScalingPolicy' :: Maybe TargetConfiguration
targetConfiguration = Maybe TargetConfiguration
a} :: PutScalingPolicy)
putScalingPolicy_name :: Lens.Lens' PutScalingPolicy Prelude.Text
putScalingPolicy_name :: (Text -> f Text) -> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_name = (PutScalingPolicy -> Text)
-> (PutScalingPolicy -> Text -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Text
name :: Text
$sel:name:PutScalingPolicy' :: PutScalingPolicy -> Text
name} -> Text
name) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Text
a -> PutScalingPolicy
s {$sel:name:PutScalingPolicy' :: Text
name = Text
a} :: PutScalingPolicy)
putScalingPolicy_fleetId :: Lens.Lens' PutScalingPolicy Prelude.Text
putScalingPolicy_fleetId :: (Text -> f Text) -> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_fleetId = (PutScalingPolicy -> Text)
-> (PutScalingPolicy -> Text -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {Text
fleetId :: Text
$sel:fleetId:PutScalingPolicy' :: PutScalingPolicy -> Text
fleetId} -> Text
fleetId) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} Text
a -> PutScalingPolicy
s {$sel:fleetId:PutScalingPolicy' :: Text
fleetId = Text
a} :: PutScalingPolicy)
putScalingPolicy_metricName :: Lens.Lens' PutScalingPolicy MetricName
putScalingPolicy_metricName :: (MetricName -> f MetricName)
-> PutScalingPolicy -> f PutScalingPolicy
putScalingPolicy_metricName = (PutScalingPolicy -> MetricName)
-> (PutScalingPolicy -> MetricName -> PutScalingPolicy)
-> Lens PutScalingPolicy PutScalingPolicy MetricName MetricName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicy' {MetricName
metricName :: MetricName
$sel:metricName:PutScalingPolicy' :: PutScalingPolicy -> MetricName
metricName} -> MetricName
metricName) (\s :: PutScalingPolicy
s@PutScalingPolicy' {} MetricName
a -> PutScalingPolicy
s {$sel:metricName:PutScalingPolicy' :: MetricName
metricName = MetricName
a} :: PutScalingPolicy)
instance Core.AWSRequest PutScalingPolicy where
type
AWSResponse PutScalingPolicy =
PutScalingPolicyResponse
request :: PutScalingPolicy -> Request PutScalingPolicy
request = Service -> PutScalingPolicy -> Request PutScalingPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutScalingPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutScalingPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse PutScalingPolicy))
-> Logger
-> Service
-> Proxy PutScalingPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutScalingPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> PutScalingPolicyResponse
PutScalingPolicyResponse'
(Maybe Text -> Int -> PutScalingPolicyResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PutScalingPolicyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
Either String (Int -> PutScalingPolicyResponse)
-> Either String Int -> Either String PutScalingPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutScalingPolicy
instance Prelude.NFData PutScalingPolicy
instance Core.ToHeaders PutScalingPolicy where
toHeaders :: PutScalingPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutScalingPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"GameLift.PutScalingPolicy" :: Prelude.ByteString),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutScalingPolicy where
toJSON :: PutScalingPolicy -> Value
toJSON PutScalingPolicy' {Maybe Double
Maybe Int
Maybe Natural
Maybe ComparisonOperatorType
Maybe PolicyType
Maybe ScalingAdjustmentType
Maybe TargetConfiguration
Text
MetricName
metricName :: MetricName
fleetId :: Text
name :: Text
targetConfiguration :: Maybe TargetConfiguration
scalingAdjustment :: Maybe Int
threshold :: Maybe Double
comparisonOperator :: Maybe ComparisonOperatorType
policyType :: Maybe PolicyType
evaluationPeriods :: Maybe Natural
scalingAdjustmentType :: Maybe ScalingAdjustmentType
$sel:metricName:PutScalingPolicy' :: PutScalingPolicy -> MetricName
$sel:fleetId:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:name:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:targetConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe TargetConfiguration
$sel:scalingAdjustment:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:threshold:PutScalingPolicy' :: PutScalingPolicy -> Maybe Double
$sel:comparisonOperator:PutScalingPolicy' :: PutScalingPolicy -> Maybe ComparisonOperatorType
$sel:policyType:PutScalingPolicy' :: PutScalingPolicy -> Maybe PolicyType
$sel:evaluationPeriods:PutScalingPolicy' :: PutScalingPolicy -> Maybe Natural
$sel:scalingAdjustmentType:PutScalingPolicy' :: PutScalingPolicy -> Maybe ScalingAdjustmentType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ScalingAdjustmentType" Text -> ScalingAdjustmentType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ScalingAdjustmentType -> Pair)
-> Maybe ScalingAdjustmentType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScalingAdjustmentType
scalingAdjustmentType,
(Text
"EvaluationPeriods" 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
evaluationPeriods,
(Text
"PolicyType" Text -> PolicyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PolicyType -> Pair) -> Maybe PolicyType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PolicyType
policyType,
(Text
"ComparisonOperator" Text -> ComparisonOperatorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ComparisonOperatorType -> Pair)
-> Maybe ComparisonOperatorType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComparisonOperatorType
comparisonOperator,
(Text
"Threshold" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
threshold,
(Text
"ScalingAdjustment" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
scalingAdjustment,
(Text
"TargetConfiguration" Text -> TargetConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TargetConfiguration -> Pair)
-> Maybe TargetConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetConfiguration
targetConfiguration,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MetricName" Text -> MetricName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MetricName
metricName)
]
)
instance Core.ToPath PutScalingPolicy where
toPath :: PutScalingPolicy -> ByteString
toPath = ByteString -> PutScalingPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutScalingPolicy where
toQuery :: PutScalingPolicy -> QueryString
toQuery = QueryString -> PutScalingPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutScalingPolicyResponse = PutScalingPolicyResponse'
{
PutScalingPolicyResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
PutScalingPolicyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
(PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool)
-> (PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool)
-> Eq PutScalingPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
$c/= :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
== :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
$c== :: PutScalingPolicyResponse -> PutScalingPolicyResponse -> Bool
Prelude.Eq, ReadPrec [PutScalingPolicyResponse]
ReadPrec PutScalingPolicyResponse
Int -> ReadS PutScalingPolicyResponse
ReadS [PutScalingPolicyResponse]
(Int -> ReadS PutScalingPolicyResponse)
-> ReadS [PutScalingPolicyResponse]
-> ReadPrec PutScalingPolicyResponse
-> ReadPrec [PutScalingPolicyResponse]
-> Read PutScalingPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutScalingPolicyResponse]
$creadListPrec :: ReadPrec [PutScalingPolicyResponse]
readPrec :: ReadPrec PutScalingPolicyResponse
$creadPrec :: ReadPrec PutScalingPolicyResponse
readList :: ReadS [PutScalingPolicyResponse]
$creadList :: ReadS [PutScalingPolicyResponse]
readsPrec :: Int -> ReadS PutScalingPolicyResponse
$creadsPrec :: Int -> ReadS PutScalingPolicyResponse
Prelude.Read, Int -> PutScalingPolicyResponse -> ShowS
[PutScalingPolicyResponse] -> ShowS
PutScalingPolicyResponse -> String
(Int -> PutScalingPolicyResponse -> ShowS)
-> (PutScalingPolicyResponse -> String)
-> ([PutScalingPolicyResponse] -> ShowS)
-> Show PutScalingPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutScalingPolicyResponse] -> ShowS
$cshowList :: [PutScalingPolicyResponse] -> ShowS
show :: PutScalingPolicyResponse -> String
$cshow :: PutScalingPolicyResponse -> String
showsPrec :: Int -> PutScalingPolicyResponse -> ShowS
$cshowsPrec :: Int -> PutScalingPolicyResponse -> ShowS
Prelude.Show, (forall x.
PutScalingPolicyResponse -> Rep PutScalingPolicyResponse x)
-> (forall x.
Rep PutScalingPolicyResponse x -> PutScalingPolicyResponse)
-> Generic PutScalingPolicyResponse
forall x.
Rep PutScalingPolicyResponse x -> PutScalingPolicyResponse
forall x.
PutScalingPolicyResponse -> Rep PutScalingPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutScalingPolicyResponse x -> PutScalingPolicyResponse
$cfrom :: forall x.
PutScalingPolicyResponse -> Rep PutScalingPolicyResponse x
Prelude.Generic)
newPutScalingPolicyResponse ::
Prelude.Int ->
PutScalingPolicyResponse
newPutScalingPolicyResponse :: Int -> PutScalingPolicyResponse
newPutScalingPolicyResponse Int
pHttpStatus_ =
PutScalingPolicyResponse' :: Maybe Text -> Int -> PutScalingPolicyResponse
PutScalingPolicyResponse'
{ $sel:name:PutScalingPolicyResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutScalingPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putScalingPolicyResponse_name :: Lens.Lens' PutScalingPolicyResponse (Prelude.Maybe Prelude.Text)
putScalingPolicyResponse_name :: (Maybe Text -> f (Maybe Text))
-> PutScalingPolicyResponse -> f PutScalingPolicyResponse
putScalingPolicyResponse_name = (PutScalingPolicyResponse -> Maybe Text)
-> (PutScalingPolicyResponse
-> Maybe Text -> PutScalingPolicyResponse)
-> Lens
PutScalingPolicyResponse
PutScalingPolicyResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicyResponse' {Maybe Text
name :: Maybe Text
$sel:name:PutScalingPolicyResponse' :: PutScalingPolicyResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: PutScalingPolicyResponse
s@PutScalingPolicyResponse' {} Maybe Text
a -> PutScalingPolicyResponse
s {$sel:name:PutScalingPolicyResponse' :: Maybe Text
name = Maybe Text
a} :: PutScalingPolicyResponse)
putScalingPolicyResponse_httpStatus :: Lens.Lens' PutScalingPolicyResponse Prelude.Int
putScalingPolicyResponse_httpStatus :: (Int -> f Int)
-> PutScalingPolicyResponse -> f PutScalingPolicyResponse
putScalingPolicyResponse_httpStatus = (PutScalingPolicyResponse -> Int)
-> (PutScalingPolicyResponse -> Int -> PutScalingPolicyResponse)
-> Lens PutScalingPolicyResponse PutScalingPolicyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutScalingPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutScalingPolicyResponse' :: PutScalingPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutScalingPolicyResponse
s@PutScalingPolicyResponse' {} Int
a -> PutScalingPolicyResponse
s {$sel:httpStatus:PutScalingPolicyResponse' :: Int
httpStatus = Int
a} :: PutScalingPolicyResponse)
instance Prelude.NFData PutScalingPolicyResponse