{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GameLift.PutScalingPolicy
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates or updates a scaling policy for a fleet. Scaling policies are
-- used to automatically scale a fleet\'s hosting capacity to meet player
-- demand. An active scaling policy instructs Amazon GameLift to track a
-- fleet metric and automatically change the fleet\'s capacity when a
-- certain threshold is reached. There are two types of scaling policies:
-- target-based and rule-based. Use a target-based policy to quickly and
-- efficiently manage fleet scaling; this option is the most commonly used.
-- Use rule-based policies when you need to exert fine-grained control over
-- auto-scaling.
--
-- Fleets can have multiple scaling policies of each type in force at the
-- same time; you can have one target-based policy, one or multiple
-- rule-based scaling policies, or both. We recommend caution, however,
-- because multiple auto-scaling policies can have unintended consequences.
--
-- Learn more about how to work with auto-scaling in
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-autoscaling.html Set Up Fleet Automatic Scaling>.
--
-- __Target-based policy__
--
-- A target-based policy tracks a single metric:
-- PercentAvailableGameSessions. This metric tells us how much of a
-- fleet\'s hosting capacity is ready to host game sessions but is not
-- currently in use. This is the fleet\'s buffer; it measures the
-- additional player demand that the fleet could handle at current
-- capacity. With a target-based policy, you set your ideal buffer size and
-- leave it to Amazon GameLift to take whatever action is needed to
-- maintain that target.
--
-- For example, you might choose to maintain a 10% buffer for a fleet that
-- has the capacity to host 100 simultaneous game sessions. This policy
-- tells Amazon GameLift to take action whenever the fleet\'s available
-- capacity falls below or rises above 10 game sessions. Amazon GameLift
-- will start new instances or stop unused instances in order to return to
-- the 10% buffer.
--
-- To create or update a target-based policy, specify a fleet ID and name,
-- and set the policy type to \"TargetBased\". Specify the metric to track
-- (PercentAvailableGameSessions) and reference a @TargetConfiguration@
-- object with your desired buffer value. Exclude all other parameters. On
-- a successful request, the policy name is returned. The scaling policy is
-- automatically in force as soon as it\'s successfully created. If the
-- fleet\'s auto-scaling actions are temporarily suspended, the new policy
-- will be in force once the fleet actions are restarted.
--
-- __Rule-based policy__
--
-- A rule-based policy tracks specified fleet metric, sets a threshold
-- value, and specifies the type of action to initiate when triggered. With
-- a rule-based policy, you can select from several available fleet
-- metrics. Each policy specifies whether to scale up or scale down (and by
-- how much), so you need one policy for each type of action.
--
-- For example, a policy may make the following statement: \"If the
-- percentage of idle instances is greater than 20% for more than 15
-- minutes, then reduce the fleet capacity by 10%.\"
--
-- A policy\'s rule statement has the following structure:
--
-- If @[MetricName]@ is @[ComparisonOperator]@ @[Threshold]@ for
-- @[EvaluationPeriods]@ minutes, then @[ScalingAdjustmentType]@ to\/by
-- @[ScalingAdjustment]@.
--
-- To implement the example, the rule statement would look like this:
--
-- If @[PercentIdleInstances]@ is @[GreaterThanThreshold]@ @[20]@ for
-- @[15]@ minutes, then @[PercentChangeInCapacity]@ to\/by @[10]@.
--
-- To create or update a scaling policy, specify a unique combination of
-- name and fleet ID, and set the policy type to \"RuleBased\". Specify the
-- parameter values for a policy rule statement. On a successful request,
-- the policy name is returned. Scaling policies are automatically in force
-- as soon as they\'re successfully created. If the fleet\'s auto-scaling
-- actions are temporarily suspended, the new policy will be in force once
-- the fleet actions are restarted.
module Amazonka.GameLift.PutScalingPolicy
  ( -- * Creating a Request
    PutScalingPolicy (..),
    newPutScalingPolicy,

    -- * Request Lenses
    putScalingPolicy_comparisonOperator,
    putScalingPolicy_evaluationPeriods,
    putScalingPolicy_policyType,
    putScalingPolicy_scalingAdjustment,
    putScalingPolicy_scalingAdjustmentType,
    putScalingPolicy_targetConfiguration,
    putScalingPolicy_threshold,
    putScalingPolicy_name,
    putScalingPolicy_fleetId,
    putScalingPolicy_metricName,

    -- * Destructuring the Response
    PutScalingPolicyResponse (..),
    newPutScalingPolicyResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newPutScalingPolicy' smart constructor.
data PutScalingPolicy = PutScalingPolicy'
  { -- | Comparison operator to use when measuring the metric against the
    -- threshold value.
    PutScalingPolicy -> Maybe ComparisonOperatorType
comparisonOperator :: Prelude.Maybe ComparisonOperatorType,
    -- | Length of time (in minutes) the metric must be at or beyond the
    -- threshold before a scaling event is triggered.
    PutScalingPolicy -> Maybe Natural
evaluationPeriods :: Prelude.Maybe Prelude.Natural,
    -- | The type of scaling policy to create. For a target-based policy, set the
    -- parameter /MetricName/ to \'PercentAvailableGameSessions\' and specify a
    -- /TargetConfiguration/. For a rule-based policy set the following
    -- parameters: /MetricName/, /ComparisonOperator/, /Threshold/,
    -- /EvaluationPeriods/, /ScalingAdjustmentType/, and /ScalingAdjustment/.
    PutScalingPolicy -> Maybe PolicyType
policyType :: Prelude.Maybe PolicyType,
    -- | Amount of adjustment to make, based on the scaling adjustment type.
    PutScalingPolicy -> Maybe Int
scalingAdjustment :: Prelude.Maybe Prelude.Int,
    -- | The type of adjustment to make to a fleet\'s instance count:
    --
    -- -   __ChangeInCapacity__ -- add (or subtract) the scaling adjustment
    --     value from the current instance count. Positive values scale up
    --     while negative values scale down.
    --
    -- -   __ExactCapacity__ -- set the instance count to the scaling
    --     adjustment value.
    --
    -- -   __PercentChangeInCapacity__ -- increase or reduce the current
    --     instance count by the scaling adjustment, read as a percentage.
    --     Positive values scale up while negative values scale down; for
    --     example, a value of \"-10\" scales the fleet down by 10%.
    PutScalingPolicy -> Maybe ScalingAdjustmentType
scalingAdjustmentType :: Prelude.Maybe ScalingAdjustmentType,
    -- | An object that contains settings for a target-based scaling policy.
    PutScalingPolicy -> Maybe TargetConfiguration
targetConfiguration :: Prelude.Maybe TargetConfiguration,
    -- | Metric value used to trigger a scaling event.
    PutScalingPolicy -> Maybe Double
threshold :: Prelude.Maybe Prelude.Double,
    -- | A descriptive label that is associated with a fleet\'s scaling policy.
    -- Policy names do not need to be unique. A fleet can have only one scaling
    -- policy with the same name.
    PutScalingPolicy -> Text
name :: Prelude.Text,
    -- | A unique identifier for the fleet to apply this policy to. You can use
    -- either the fleet ID or ARN value. The fleet cannot be in any of the
    -- following statuses: ERROR or DELETING.
    PutScalingPolicy -> Text
fleetId :: Prelude.Text,
    -- | Name of the Amazon GameLift-defined metric that is used to trigger a
    -- scaling adjustment. For detailed descriptions of fleet metrics, see
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html Monitor Amazon GameLift with Amazon CloudWatch>.
    --
    -- -   __ActivatingGameSessions__ -- Game sessions in the process of being
    --     created.
    --
    -- -   __ActiveGameSessions__ -- Game sessions that are currently running.
    --
    -- -   __ActiveInstances__ -- Fleet instances that are currently running at
    --     least one game session.
    --
    -- -   __AvailableGameSessions__ -- Additional game sessions that fleet
    --     could host simultaneously, given current capacity.
    --
    -- -   __AvailablePlayerSessions__ -- Empty player slots in currently
    --     active game sessions. This includes game sessions that are not
    --     currently accepting players. Reserved player slots are not included.
    --
    -- -   __CurrentPlayerSessions__ -- Player slots in active game sessions
    --     that are being used by a player or are reserved for a player.
    --
    -- -   __IdleInstances__ -- Active instances that are currently hosting
    --     zero game sessions.
    --
    -- -   __PercentAvailableGameSessions__ -- Unused percentage of the total
    --     number of game sessions that a fleet could host simultaneously,
    --     given current capacity. Use this metric for a target-based scaling
    --     policy.
    --
    -- -   __PercentIdleInstances__ -- Percentage of the total number of active
    --     instances that are hosting zero game sessions.
    --
    -- -   __QueueDepth__ -- Pending game session placement requests, in any
    --     queue, where the current fleet is the top-priority destination.
    --
    -- -   __WaitTime__ -- Current wait time for pending game session placement
    --     requests, in any queue, where the current fleet is the top-priority
    --     destination.
    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)

-- |
-- Create a value of 'PutScalingPolicy' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'comparisonOperator', 'putScalingPolicy_comparisonOperator' - Comparison operator to use when measuring the metric against the
-- threshold value.
--
-- 'evaluationPeriods', 'putScalingPolicy_evaluationPeriods' - Length of time (in minutes) the metric must be at or beyond the
-- threshold before a scaling event is triggered.
--
-- 'policyType', 'putScalingPolicy_policyType' - The type of scaling policy to create. For a target-based policy, set the
-- parameter /MetricName/ to \'PercentAvailableGameSessions\' and specify a
-- /TargetConfiguration/. For a rule-based policy set the following
-- parameters: /MetricName/, /ComparisonOperator/, /Threshold/,
-- /EvaluationPeriods/, /ScalingAdjustmentType/, and /ScalingAdjustment/.
--
-- 'scalingAdjustment', 'putScalingPolicy_scalingAdjustment' - Amount of adjustment to make, based on the scaling adjustment type.
--
-- 'scalingAdjustmentType', 'putScalingPolicy_scalingAdjustmentType' - The type of adjustment to make to a fleet\'s instance count:
--
-- -   __ChangeInCapacity__ -- add (or subtract) the scaling adjustment
--     value from the current instance count. Positive values scale up
--     while negative values scale down.
--
-- -   __ExactCapacity__ -- set the instance count to the scaling
--     adjustment value.
--
-- -   __PercentChangeInCapacity__ -- increase or reduce the current
--     instance count by the scaling adjustment, read as a percentage.
--     Positive values scale up while negative values scale down; for
--     example, a value of \"-10\" scales the fleet down by 10%.
--
-- 'targetConfiguration', 'putScalingPolicy_targetConfiguration' - An object that contains settings for a target-based scaling policy.
--
-- 'threshold', 'putScalingPolicy_threshold' - Metric value used to trigger a scaling event.
--
-- 'name', 'putScalingPolicy_name' - A descriptive label that is associated with a fleet\'s scaling policy.
-- Policy names do not need to be unique. A fleet can have only one scaling
-- policy with the same name.
--
-- 'fleetId', 'putScalingPolicy_fleetId' - A unique identifier for the fleet to apply this policy to. You can use
-- either the fleet ID or ARN value. The fleet cannot be in any of the
-- following statuses: ERROR or DELETING.
--
-- 'metricName', 'putScalingPolicy_metricName' - Name of the Amazon GameLift-defined metric that is used to trigger a
-- scaling adjustment. For detailed descriptions of fleet metrics, see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html Monitor Amazon GameLift with Amazon CloudWatch>.
--
-- -   __ActivatingGameSessions__ -- Game sessions in the process of being
--     created.
--
-- -   __ActiveGameSessions__ -- Game sessions that are currently running.
--
-- -   __ActiveInstances__ -- Fleet instances that are currently running at
--     least one game session.
--
-- -   __AvailableGameSessions__ -- Additional game sessions that fleet
--     could host simultaneously, given current capacity.
--
-- -   __AvailablePlayerSessions__ -- Empty player slots in currently
--     active game sessions. This includes game sessions that are not
--     currently accepting players. Reserved player slots are not included.
--
-- -   __CurrentPlayerSessions__ -- Player slots in active game sessions
--     that are being used by a player or are reserved for a player.
--
-- -   __IdleInstances__ -- Active instances that are currently hosting
--     zero game sessions.
--
-- -   __PercentAvailableGameSessions__ -- Unused percentage of the total
--     number of game sessions that a fleet could host simultaneously,
--     given current capacity. Use this metric for a target-based scaling
--     policy.
--
-- -   __PercentIdleInstances__ -- Percentage of the total number of active
--     instances that are hosting zero game sessions.
--
-- -   __QueueDepth__ -- Pending game session placement requests, in any
--     queue, where the current fleet is the top-priority destination.
--
-- -   __WaitTime__ -- Current wait time for pending game session placement
--     requests, in any queue, where the current fleet is the top-priority
--     destination.
newPutScalingPolicy ::
  -- | 'name'
  Prelude.Text ->
  -- | 'fleetId'
  Prelude.Text ->
  -- | 'metricName'
  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_
    }

-- | Comparison operator to use when measuring the metric against the
-- threshold value.
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)

-- | Length of time (in minutes) the metric must be at or beyond the
-- threshold before a scaling event is triggered.
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)

-- | The type of scaling policy to create. For a target-based policy, set the
-- parameter /MetricName/ to \'PercentAvailableGameSessions\' and specify a
-- /TargetConfiguration/. For a rule-based policy set the following
-- parameters: /MetricName/, /ComparisonOperator/, /Threshold/,
-- /EvaluationPeriods/, /ScalingAdjustmentType/, and /ScalingAdjustment/.
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)

-- | Amount of adjustment to make, based on the scaling adjustment type.
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)

-- | The type of adjustment to make to a fleet\'s instance count:
--
-- -   __ChangeInCapacity__ -- add (or subtract) the scaling adjustment
--     value from the current instance count. Positive values scale up
--     while negative values scale down.
--
-- -   __ExactCapacity__ -- set the instance count to the scaling
--     adjustment value.
--
-- -   __PercentChangeInCapacity__ -- increase or reduce the current
--     instance count by the scaling adjustment, read as a percentage.
--     Positive values scale up while negative values scale down; for
--     example, a value of \"-10\" scales the fleet down by 10%.
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)

-- | An object that contains settings for a target-based scaling policy.
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)

-- | Metric value used to trigger a scaling event.
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)

-- | A descriptive label that is associated with a fleet\'s scaling policy.
-- Policy names do not need to be unique. A fleet can have only one scaling
-- policy with the same name.
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)

-- | A unique identifier for the fleet to apply this policy to. You can use
-- either the fleet ID or ARN value. The fleet cannot be in any of the
-- following statuses: ERROR or DELETING.
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)

-- | Name of the Amazon GameLift-defined metric that is used to trigger a
-- scaling adjustment. For detailed descriptions of fleet metrics, see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html Monitor Amazon GameLift with Amazon CloudWatch>.
--
-- -   __ActivatingGameSessions__ -- Game sessions in the process of being
--     created.
--
-- -   __ActiveGameSessions__ -- Game sessions that are currently running.
--
-- -   __ActiveInstances__ -- Fleet instances that are currently running at
--     least one game session.
--
-- -   __AvailableGameSessions__ -- Additional game sessions that fleet
--     could host simultaneously, given current capacity.
--
-- -   __AvailablePlayerSessions__ -- Empty player slots in currently
--     active game sessions. This includes game sessions that are not
--     currently accepting players. Reserved player slots are not included.
--
-- -   __CurrentPlayerSessions__ -- Player slots in active game sessions
--     that are being used by a player or are reserved for a player.
--
-- -   __IdleInstances__ -- Active instances that are currently hosting
--     zero game sessions.
--
-- -   __PercentAvailableGameSessions__ -- Unused percentage of the total
--     number of game sessions that a fleet could host simultaneously,
--     given current capacity. Use this metric for a target-based scaling
--     policy.
--
-- -   __PercentIdleInstances__ -- Percentage of the total number of active
--     instances that are hosting zero game sessions.
--
-- -   __QueueDepth__ -- Pending game session placement requests, in any
--     queue, where the current fleet is the top-priority destination.
--
-- -   __WaitTime__ -- Current wait time for pending game session placement
--     requests, in any queue, where the current fleet is the top-priority
--     destination.
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

-- | /See:/ 'newPutScalingPolicyResponse' smart constructor.
data PutScalingPolicyResponse = PutScalingPolicyResponse'
  { -- | A descriptive label that is associated with a fleet\'s scaling policy.
    -- Policy names do not need to be unique.
    PutScalingPolicyResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    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)

-- |
-- Create a value of 'PutScalingPolicyResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'name', 'putScalingPolicyResponse_name' - A descriptive label that is associated with a fleet\'s scaling policy.
-- Policy names do not need to be unique.
--
-- 'httpStatus', 'putScalingPolicyResponse_httpStatus' - The response's http status code.
newPutScalingPolicyResponse ::
  -- | 'httpStatus'
  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_
    }

-- | A descriptive label that is associated with a fleet\'s scaling policy.
-- Policy names do not need to be unique.
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)

-- | The response's http status code.
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