{-# 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_comparisonOperator,
putScalingPolicy_evaluationPeriods,
putScalingPolicy_policyType,
putScalingPolicy_scalingAdjustment,
putScalingPolicy_scalingAdjustmentType,
putScalingPolicy_targetConfiguration,
putScalingPolicy_threshold,
putScalingPolicy_name,
putScalingPolicy_fleetId,
putScalingPolicy_metricName,
PutScalingPolicyResponse (..),
newPutScalingPolicyResponse,
putScalingPolicyResponse_name,
putScalingPolicyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutScalingPolicy = PutScalingPolicy'
{
PutScalingPolicy -> Maybe ComparisonOperatorType
comparisonOperator :: Prelude.Maybe ComparisonOperatorType,
PutScalingPolicy -> Maybe Natural
evaluationPeriods :: Prelude.Maybe Prelude.Natural,
PutScalingPolicy -> Maybe PolicyType
policyType :: Prelude.Maybe PolicyType,
PutScalingPolicy -> Maybe Int
scalingAdjustment :: Prelude.Maybe Prelude.Int,
PutScalingPolicy -> Maybe ScalingAdjustmentType
scalingAdjustmentType :: Prelude.Maybe ScalingAdjustmentType,
PutScalingPolicy -> Maybe TargetConfiguration
targetConfiguration :: Prelude.Maybe TargetConfiguration,
PutScalingPolicy -> Maybe Double
threshold :: Prelude.Maybe Prelude.Double,
PutScalingPolicy -> Text
name :: Prelude.Text,
PutScalingPolicy -> Text
fleetId :: Prelude.Text,
PutScalingPolicy -> MetricName
metricName :: MetricName
}
deriving (PutScalingPolicy -> PutScalingPolicy -> Bool
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]
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
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. 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'
{ $sel:comparisonOperator:PutScalingPolicy' :: Maybe ComparisonOperatorType
comparisonOperator =
forall a. Maybe a
Prelude.Nothing,
$sel:evaluationPeriods:PutScalingPolicy' :: Maybe Natural
evaluationPeriods = forall a. Maybe a
Prelude.Nothing,
$sel:policyType:PutScalingPolicy' :: Maybe PolicyType
policyType = forall a. Maybe a
Prelude.Nothing,
$sel:scalingAdjustment:PutScalingPolicy' :: Maybe Int
scalingAdjustment = forall a. Maybe a
Prelude.Nothing,
$sel:scalingAdjustmentType:PutScalingPolicy' :: Maybe ScalingAdjustmentType
scalingAdjustmentType = forall a. Maybe a
Prelude.Nothing,
$sel:targetConfiguration:PutScalingPolicy' :: Maybe TargetConfiguration
targetConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:threshold:PutScalingPolicy' :: Maybe Double
threshold = 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_comparisonOperator :: Lens.Lens' PutScalingPolicy (Prelude.Maybe ComparisonOperatorType)
putScalingPolicy_comparisonOperator :: Lens' PutScalingPolicy (Maybe ComparisonOperatorType)
putScalingPolicy_comparisonOperator = 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_evaluationPeriods :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Natural)
putScalingPolicy_evaluationPeriods :: Lens' PutScalingPolicy (Maybe Natural)
putScalingPolicy_evaluationPeriods = 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 :: Lens' PutScalingPolicy (Maybe PolicyType)
putScalingPolicy_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_scalingAdjustment :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Int)
putScalingPolicy_scalingAdjustment :: Lens' PutScalingPolicy (Maybe Int)
putScalingPolicy_scalingAdjustment = 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_scalingAdjustmentType :: Lens.Lens' PutScalingPolicy (Prelude.Maybe ScalingAdjustmentType)
putScalingPolicy_scalingAdjustmentType :: Lens' PutScalingPolicy (Maybe ScalingAdjustmentType)
putScalingPolicy_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_targetConfiguration :: Lens.Lens' PutScalingPolicy (Prelude.Maybe TargetConfiguration)
putScalingPolicy_targetConfiguration :: Lens' PutScalingPolicy (Maybe TargetConfiguration)
putScalingPolicy_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_threshold :: Lens.Lens' PutScalingPolicy (Prelude.Maybe Prelude.Double)
putScalingPolicy_threshold :: Lens' PutScalingPolicy (Maybe Double)
putScalingPolicy_threshold = 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_name :: Lens.Lens' PutScalingPolicy Prelude.Text
putScalingPolicy_name :: Lens' PutScalingPolicy Text
putScalingPolicy_name = 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 :: Lens' PutScalingPolicy Text
putScalingPolicy_fleetId = 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 :: Lens' PutScalingPolicy MetricName
putScalingPolicy_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 :: (Service -> Service)
-> PutScalingPolicy -> Request PutScalingPolicy
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutScalingPolicy
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutScalingPolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> PutScalingPolicyResponse
PutScalingPolicyResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutScalingPolicy where
hashWithSalt :: Int -> PutScalingPolicy -> Int
hashWithSalt Int
_salt PutScalingPolicy' {Maybe Double
Maybe Int
Maybe Natural
Maybe ComparisonOperatorType
Maybe PolicyType
Maybe ScalingAdjustmentType
Maybe TargetConfiguration
Text
MetricName
metricName :: MetricName
fleetId :: Text
name :: Text
threshold :: Maybe Double
targetConfiguration :: Maybe TargetConfiguration
scalingAdjustmentType :: Maybe ScalingAdjustmentType
scalingAdjustment :: Maybe Int
policyType :: Maybe PolicyType
evaluationPeriods :: Maybe Natural
comparisonOperator :: Maybe ComparisonOperatorType
$sel:metricName:PutScalingPolicy' :: PutScalingPolicy -> MetricName
$sel:fleetId:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:name:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:threshold:PutScalingPolicy' :: PutScalingPolicy -> Maybe Double
$sel:targetConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe TargetConfiguration
$sel:scalingAdjustmentType:PutScalingPolicy' :: PutScalingPolicy -> Maybe ScalingAdjustmentType
$sel:scalingAdjustment:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:policyType:PutScalingPolicy' :: PutScalingPolicy -> Maybe PolicyType
$sel:evaluationPeriods:PutScalingPolicy' :: PutScalingPolicy -> Maybe Natural
$sel:comparisonOperator:PutScalingPolicy' :: PutScalingPolicy -> Maybe ComparisonOperatorType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ComparisonOperatorType
comparisonOperator
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
evaluationPeriods
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PolicyType
policyType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
scalingAdjustment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScalingAdjustmentType
scalingAdjustmentType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TargetConfiguration
targetConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
threshold
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fleetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MetricName
metricName
instance Prelude.NFData PutScalingPolicy where
rnf :: PutScalingPolicy -> ()
rnf PutScalingPolicy' {Maybe Double
Maybe Int
Maybe Natural
Maybe ComparisonOperatorType
Maybe PolicyType
Maybe ScalingAdjustmentType
Maybe TargetConfiguration
Text
MetricName
metricName :: MetricName
fleetId :: Text
name :: Text
threshold :: Maybe Double
targetConfiguration :: Maybe TargetConfiguration
scalingAdjustmentType :: Maybe ScalingAdjustmentType
scalingAdjustment :: Maybe Int
policyType :: Maybe PolicyType
evaluationPeriods :: Maybe Natural
comparisonOperator :: Maybe ComparisonOperatorType
$sel:metricName:PutScalingPolicy' :: PutScalingPolicy -> MetricName
$sel:fleetId:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:name:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:threshold:PutScalingPolicy' :: PutScalingPolicy -> Maybe Double
$sel:targetConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe TargetConfiguration
$sel:scalingAdjustmentType:PutScalingPolicy' :: PutScalingPolicy -> Maybe ScalingAdjustmentType
$sel:scalingAdjustment:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:policyType:PutScalingPolicy' :: PutScalingPolicy -> Maybe PolicyType
$sel:evaluationPeriods:PutScalingPolicy' :: PutScalingPolicy -> Maybe Natural
$sel:comparisonOperator:PutScalingPolicy' :: PutScalingPolicy -> Maybe ComparisonOperatorType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ComparisonOperatorType
comparisonOperator
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
evaluationPeriods
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PolicyType
policyType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
scalingAdjustment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ScalingAdjustmentType
scalingAdjustmentType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TargetConfiguration
targetConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
threshold
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fleetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MetricName
metricName
instance Data.ToHeaders PutScalingPolicy where
toHeaders :: PutScalingPolicy -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"GameLift.PutScalingPolicy" :: Prelude.ByteString),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.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
threshold :: Maybe Double
targetConfiguration :: Maybe TargetConfiguration
scalingAdjustmentType :: Maybe ScalingAdjustmentType
scalingAdjustment :: Maybe Int
policyType :: Maybe PolicyType
evaluationPeriods :: Maybe Natural
comparisonOperator :: Maybe ComparisonOperatorType
$sel:metricName:PutScalingPolicy' :: PutScalingPolicy -> MetricName
$sel:fleetId:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:name:PutScalingPolicy' :: PutScalingPolicy -> Text
$sel:threshold:PutScalingPolicy' :: PutScalingPolicy -> Maybe Double
$sel:targetConfiguration:PutScalingPolicy' :: PutScalingPolicy -> Maybe TargetConfiguration
$sel:scalingAdjustmentType:PutScalingPolicy' :: PutScalingPolicy -> Maybe ScalingAdjustmentType
$sel:scalingAdjustment:PutScalingPolicy' :: PutScalingPolicy -> Maybe Int
$sel:policyType:PutScalingPolicy' :: PutScalingPolicy -> Maybe PolicyType
$sel:evaluationPeriods:PutScalingPolicy' :: PutScalingPolicy -> Maybe Natural
$sel:comparisonOperator:PutScalingPolicy' :: PutScalingPolicy -> Maybe ComparisonOperatorType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ComparisonOperator" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComparisonOperatorType
comparisonOperator,
(Key
"EvaluationPeriods" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
evaluationPeriods,
(Key
"PolicyType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PolicyType
policyType,
(Key
"ScalingAdjustment" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
scalingAdjustment,
(Key
"ScalingAdjustmentType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScalingAdjustmentType
scalingAdjustmentType,
(Key
"TargetConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TargetConfiguration
targetConfiguration,
(Key
"Threshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
threshold,
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"FleetId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fleetId),
forall a. a -> Maybe a
Prelude.Just (Key
"MetricName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MetricName
metricName)
]
)
instance Data.ToPath PutScalingPolicy where
toPath :: PutScalingPolicy -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutScalingPolicy where
toQuery :: PutScalingPolicy -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
{ $sel:name:PutScalingPolicyResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutScalingPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putScalingPolicyResponse_name :: Lens.Lens' PutScalingPolicyResponse (Prelude.Maybe Prelude.Text)
putScalingPolicyResponse_name :: Lens' PutScalingPolicyResponse (Maybe Text)
putScalingPolicyResponse_name = 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 :: Lens' PutScalingPolicyResponse Int
putScalingPolicyResponse_httpStatus = 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 where
rnf :: PutScalingPolicyResponse -> ()
rnf PutScalingPolicyResponse' {Int
Maybe Text
httpStatus :: Int
name :: Maybe Text
$sel:httpStatus:PutScalingPolicyResponse' :: PutScalingPolicyResponse -> Int
$sel:name:PutScalingPolicyResponse' :: PutScalingPolicyResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus